Hi,
You might want to try Gremlin for that. See http://gremlin.tinkerpop.com ...
Off the cuff, this is the Gremlin expression to accomplish your goal:
g.V[[nodeType:'A']].outE.inV[[nodeType:'B']].outE.inV[[nodeType:'C']].paths
Thats the depth-first version. You can do breadth-first as well. If you are
interested, bring it up on the Gremlin-users mailing list and we can help you
there.
http://groups.google.com/group/gremlin-users
Hope that helps,
Marko.
http://markorodriguez.com
On Feb 16, 2011, at 2:09 PM, Saikat Kanjilal wrote:
>
> Hi Folks,I've spent the last few days reading documentation around several
> aspects of neo4j surrounding extracting a subgraph. However I still dont see
> any articles or code examples pertaining to the extraction of a set of paths
> from the complete list of paths based on some prearranged criteria. I read
> the documentation on the Traverser API as well as graph matching API but it
> seems to be that this is related to node traversal (as opposed to path
> extraction) based on pattern matching. What I would like to know/understand
> is whether there is an API to extract a set of paths based on some criteria
> surrounding ordering of a subset of nodes in those paths, example is shown
> below:
> Data Set: million nodes:Query: Give me all the paths where the firstNode is
> of property with nodetype A and the secondNode is of property with nodetype B
> and the third node is of property with ndoetype CResult: I am looking to get
> back a subset of all the paths
>
> 2 questions:1) Can I even do the above with the current neo4j API or do I
> need to resort to using the graph matching API and stick to traversing nodes
> with pattern matching a subset of those nodes?2) If I cant do this are there
> any ramifications in performance when performing a DFS or a BFS with the
> Traverser API with a million nodes where I have a query like the one above
>
> I would love some insight and or pointers to links or resources to help with
> this.
> Best Regards
> _______________________________________________
> Neo4j mailing list
> [email protected]
> https://lists.neo4j.org/mailman/listinfo/user
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user