Package org.neo4j.graphdb

Examples of org.neo4j.graphdb.RelationshipExpander


        graph.makeEdgeChain( "a,c,g,k" );
        graph.makeEdgeChain( "a,b,d,j,k" );
        graph.makeEdgeChain( "b,e,f,h,i,j" );
        graph.makeEdgeChain( "d,h" );
       
        RelationshipExpander expander = Traversal.expanderForTypes( MyRelTypes.R1, Direction.OUTGOING );
        Node a = graph.getNode( "a" );
        Node k = graph.getNode( "k" );
        assertPaths( GraphAlgoFactory.pathsWithLength( expander, 3 ).findAllPaths( a, k ), "a,c,g,k" );
        assertPaths( GraphAlgoFactory.pathsWithLength( expander, 4 ).findAllPaths( a, k ), "a,b,d,j,k" );
        assertPaths( GraphAlgoFactory.pathsWithLength( expander, 5 ).findAllPaths( a, k ) );
View Full Code Here


    public void makeSureNodesAreTraversedInCorrectOrder()
    {
        RelationshipType next = DynamicRelationshipType.withName( "NEXT" );
        RelationshipType firstComment = DynamicRelationshipType.withName( "FIRST_COMMENT" );
        RelationshipType comment = DynamicRelationshipType.withName( "COMMENT" );
        RelationshipExpander expander =
            new OrderedByTypeExpander().add( firstComment ).add( comment ).add( next );
        Iterator<Node> itr = Traversal.description().depthFirst().expand(
                expander ).traverse( referenceNode() ).nodes().iterator();
        assertOrder( itr, "A1", "C1", "C2", "C3", "A2", "C4", "C5", "C6", "A3", "C7", "C8", "C9" );
View Full Code Here

TOP

Related Classes of org.neo4j.graphdb.RelationshipExpander

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.