Search in sources :

Example 36 with TraversalDescription

use of org.neo4j.graphdb.traversal.TraversalDescription in project neo4j by neo4j.

the class TraversalDescriptionBuilder method from.

public TraversalDescription from(Map<String, Object> description) {
    try {
        TraversalDescription result = new MonoDirectionalTraversalDescription();
        result = describeOrder(result, description);
        result = describeUniqueness(result, description);
        result = describeExpander(result, description);
        result = describePruneEvaluator(result, description);
        result = describeReturnFilter(result, description);
        return result;
    } catch (NoClassDefFoundError e) {
        // the backported javax.script jar file(s) on the classpath.
        throw new EvaluationException(e);
    }
}
Also used : MonoDirectionalTraversalDescription(org.neo4j.kernel.impl.traversal.MonoDirectionalTraversalDescription) TraversalDescription(org.neo4j.graphdb.traversal.TraversalDescription) MonoDirectionalTraversalDescription(org.neo4j.kernel.impl.traversal.MonoDirectionalTraversalDescription)

Example 37 with TraversalDescription

use of org.neo4j.graphdb.traversal.TraversalDescription in project neo4j by neo4j.

the class DatabaseActions method traverse.

// Traversal
public ListRepresentation traverse(long startNode, Map<String, Object> description, final TraverserReturnType returnType) {
    Node node = graphDb.getNodeById(startNode);
    TraversalDescription traversalDescription = traversalDescriptionBuilder.from(description);
    final Iterable<Path> paths = traversalDescription.traverse(node);
    return toListPathRepresentation(paths, returnType);
}
Also used : Path(org.neo4j.graphdb.Path) WeightedPath(org.neo4j.graphalgo.WeightedPath) Node(org.neo4j.graphdb.Node) TraversalDescription(org.neo4j.graphdb.traversal.TraversalDescription)

Aggregations

TraversalDescription (org.neo4j.graphdb.traversal.TraversalDescription)37 Test (org.junit.Test)20 Node (org.neo4j.graphdb.Node)12 Path (org.neo4j.graphdb.Path)12 Transaction (org.neo4j.graphdb.Transaction)7 Evaluator (org.neo4j.graphdb.traversal.Evaluator)6 GraphDatabaseService (org.neo4j.graphdb.GraphDatabaseService)5 HashMap (java.util.HashMap)3 WeightedPath (org.neo4j.graphalgo.WeightedPath)3 LiteDepthFirstSelector (org.neo4j.graphalgo.impl.util.LiteDepthFirstSelector)3 BidirectionalTraversalDescription (org.neo4j.graphdb.traversal.BidirectionalTraversalDescription)3 BranchOrderingPolicy (org.neo4j.graphdb.traversal.BranchOrderingPolicy)3 BranchSelector (org.neo4j.graphdb.traversal.BranchSelector)3 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 Direction (org.neo4j.graphdb.Direction)2 PathExpander (org.neo4j.graphdb.PathExpander)2 Relationship (org.neo4j.graphdb.Relationship)2 RelationshipType (org.neo4j.graphdb.RelationshipType)2 TraversalBranch (org.neo4j.graphdb.traversal.TraversalBranch)2