ra0o0f / arangoclient.net

ArangoDB .NET Client with LINQ support
Apache License 2.0
99 stars 37 forks source link

Graph #63

Open francnuec opened 7 years ago

francnuec commented 7 years ago

Please, I don't seem to have it figured out but how do I use Arango's graph querying/traversal capabilities with this client and/or LINQ? An example would be great too.

ra0o0f commented 7 years ago

@francnuec graph query by LINQ can be found here:

https://github.com/ra0o0f/arangoclient.net/tree/next/src/ArangoDB.Client.Examples/Linq

working with graphs:

https://github.com/ra0o0f/arangoclient.net/blob/next/src/ArangoDB.Client.Examples/Graphs/GraphCommand.cs

traversal API:

https://github.com/ra0o0f/arangoclient.net/blob/next/src/ArangoDB.Client.Examples/Traversal/TraversalCommand.cs

francnuec commented 7 years ago

Thank you. Seeing the examples folder really helped me a lot.

However, say I have this neo4j cypher command:

MATCH (n:Actor)-[r:ACTED_IN]->(n2:Movie { title: 'The Matrix' })
RETURN n, r, n2

How can I achieve same with this ArangoDB client especially using LINQ and its where clauses too to filter in a single DB call? The Traversal command here only seems to consider just a Vertex, and an Edge. I want to know how I can match a particular complete relationship (vertex-edge-vertex) with conditions on one of the vertices.

I'm assuming your knowledge of neo4j. I'm sorry if wrong.

Hunter21007 commented 7 years ago

Yes i agree, actually both sides of the edge have to be same type. It would be nice to define more like START-EDGE-END (I do not know how to deal with graphs which involves more different types)

But in the basic usage scenario this would be very helpfull

Hunter21007 commented 7 years ago

But i see, this is not easy, because there no any type information in the query result. :( All vertices are in the same collection