Graph query language

User 956 | 12/5/2014, 8:29:32 AM

Hey all,

a SGraph object provides functions like triple_apply, but is there any query language to traverse throw the graph (like cypher for neo4j)?

Do I have to do this with joins?

Thanks for your help! Tarek

Comments

User 14 | 12/5/2014, 6:53:53 PM

Hi,

For simple traversal like node/relationship selection, you can use SGraph.getvertices() and SGraph.getedges() to select the vertices and edges you need.

The general pattern is: <pre><code>newg = SGraph( oldg.getvertices(...), oldg.getedges(...) )</code></pre>

If you want more complex traversal query, use triple_apply to label/mark the vertices and edges, and use the pattern above to extract the subgraph.

You might find our userguide and API doc helpful. User guide: http://graphlab.com/learn/userguide/index.html#WorkingwithdataGraphdata API doc: http://graphlab.com/products/create/docs/generated/graphlab.SGraph.html#graphlab.SGraph

Jay