Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
augustearth committed May 11, 2023
1 parent e018123 commit 4959ad0
Show file tree
Hide file tree
Showing 11 changed files with 382 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,12 @@ class DefaultGraphSchema implements GraphSchema {
/** edge constraints */
private Set<EdgeConstraint> edgeConstraints = new HashSet<EdgeConstraint>()

/* get edge constraints */
/**
* Get edge constraints
* @return Set of EdgeConstraint
*/
public Set<EdgeConstraint> getEdgeConstraints() {
return edgeConstraints
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ import org.gradle.api.Project
*/
class CarnivalApplicationPlugin implements Plugin<Project> {

/**
* Implementation of Plugin.apply(Project).
* @see <a href="https://docs.gradle.org/current/javadoc/org/gradle/api/Plugin.html">Plugin</a>
*/
void apply(Project project) {
def pn = project.rootProject.name
println "[CarnivalApplication] root project name: $pn"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ class VertexBuilder extends PropertyValuesHolder<VertexBuilder> {
// METHODS
///////////////////////////////////////////////////////////////////////////

/** */
/**
* Render this object as a String.
* @return String representation of this object.
*/
public String toString() {
def str = "${vertexDef}"
if (propertyValues.size() > 0) str += " ${propertyValues}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,42 +31,42 @@ import carnival.graph.Base
*/
class TinkerpopAnonTraversalExtension {

/** @see TinkerpopTraversalExtension */
/** @see TinkerpopTraversalExtension#out(DefaultTraversal, EdgeDefinition) */
static GraphTraversal out(__ traversal, EdgeDefinition edef) {
__.outE(edef.label).has(Base.PX.NAME_SPACE.label, edef.nameSpace).inV()
}

/** @see TinkerpopTraversalExtension */
/** @see TinkerpopTraversalExtension#both(DefaultTraversal, EdgeDefinition) */
static GraphTraversal both(__ traversal, EdgeDefinition edef) {
__.bothE(edef.label).has(Base.PX.NAME_SPACE.label, edef.nameSpace).otherV()
}

/** @see TinkerpopTraversalExtension */
/** @see TinkerpopTraversalExtension#in(DefaultTraversal, EdgeDefinition) */
static GraphTraversal "in"(__ traversal, EdgeDefinition edef) {
__.inE(edef.label).has(Base.PX.NAME_SPACE.label, edef.nameSpace).outV()
}

/** @see TinkerpopTraversalExtension */
/** @see TinkerpopTraversalExtension#isa(DefaultTraversal, VertexDefinition) */
static GraphTraversal isa(__ traversal, VertexDefinition vdef) {
__.hasLabel(vdef.label).has(Base.PX.NAME_SPACE.label, vdef.nameSpace)
}

/** @see TinkerpopTraversalExtension */
/** @see TinkerpopTraversalExtension#isa(DefaultTraversal, EdgeDefinition) */
static GraphTraversal isa(__ traversal, EdgeDefinition edef) {
__.hasLabel(edef.label).has(Base.PX.NAME_SPACE.label, edef.nameSpace)
}

/** @see TinkerpopTraversalExtension */
/** @see TinkerpopTraversalExtension#has(DefaultTraversal, PropertyDefinition) */
static GraphTraversal has(__ traversal, PropertyDefinition pdef) {
traversal.has(pdef.label)
}

/** @see TinkerpopTraversalExtension */
/** @see TinkerpopTraversalExtension#has(DefaultTraversal, PropertyDefinition, Enum) */
static GraphTraversal has(__ traversal, PropertyDefinition pdef, Enum value) {
traversal.has(pdef.label, value.name())
}

/** @see TinkerpopTraversalExtension */
/** @see TinkerpopTraversalExtension#has(DefaultTraversal, PropertyDefinition, Object) */
static GraphTraversal has(__ traversal, PropertyDefinition pdef, Object value) {
traversal.has(pdef.label, value)
}
Expand Down
Loading

0 comments on commit 4959ad0

Please sign in to comment.