-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] Can use GraphSail to interact with Cosmos DB #1
Comments
Hi Charbel,
It isn't possible out of the box, but it shouldn't be difficult to
implement the GraphIndex class for Cosmos DB. See the TinkerGraph
implementation [1], and let's continue this thread offline to get that
connector written. You will be able to store and retrieve RDF, and evaluate
SPARQL queries.
Note: the SPARQL implementation is as correct as that of TP2 GraphSail
(because it uses the same tests), although I still plan to add a more
thorough test suite.
Josh
[1]
https://github.com/joshsh/graphsail/blob/master/src/main/java/net/fortytwo/tpop/sail/tg/TinkerGraphIndex.java
…On Mon, Aug 21, 2017 at 1:59 PM, Charbel kaed ***@***.***> wrote:
Hi @joshsh <https://github.com/joshsh>,
I am just entering the world of the Gremlin.
Is it possible to use GraphSail on top of Cosmos DB to serialize RDF and
execute SPARQL queries?
Thank you for your help,
Charbel
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAFpBFg4so3Dg5oN0q_SAE7GD0DN2e5Pks5sae-VgaJpZM4O90hU>
.
|
Btw. this is "offline". I thought I was replying to a gremlin-users post :-) |
Hi Joshsh, I am trying to figure out how GraphSail works. I am excited to get this connector written ! :D |
I am new to Cosmos DB, so let's meet in the middle. Since you support connections via Gremlin Console, I assume you support a TinkerPop Graph implementation exposed via Gremlin Server. That means GraphSail does not need to know the low-level details of the data store. However, I/we need to look at that Graph implementation and the classes it depends on in order to create the index wrapper. Currently, the only GraphSail documentation is from the TinkerPop 2 era. Integrating with the new GraphSail is slightly different because TP3 does not include an index API. Therefore, we need a specific index wrapper for each graph back-end. In most cases, this wrapper should be fairly simple. |
Hi Joshsh, So when you mention the need for an index wrapper, how can we write such wrapper without object representation in cosmos? |
@charbull I'm not sure I understand. Is there a public API you can point me to? I browsed the website but didn't find what I was looking for. It's not that you would be populating TinkerGraph, but that you would have implemented Graph. TinkerGraph is another Graph implementation. Is there a CosmosGraph class somewhere that adapts Cosmos DB to the Graph interface? http://tinkerpop.apache.org/javadocs/current/core/org/apache/tinkerpop/gremlin/structure/Graph.html |
Btw. at a glance, the link you posted looks like a client which talks to Gremlin Server. It's "what is under the hood" of Gremlin Server, serving up the graph data, that we need to work with. |
Hi @joshsh,
Regards, |
Thank you for the links, @bartdotnet. The Gremlin implementation includes a pretty extensive set of steps. All of this is done without the use of a (.NET port of) the TinkerPop API? If that is the case, then GraphSail is not compatible with Cosmos DB on the server side, although it might be possible to connect via withRemote; it depends on whether Cosmos DB provides a complete Gremlin Server -like service via WebSocket or HTTP. The remote console examples in the documentation you linked suggest that it might. |
Hi @joshsh and @bartdotnet,
@joshsh I believe you want to write a GraphIndex on top the Graph.Elements? |
@charbull, Graph.Elements is similar to the TinkerPop-compatible API I was expecting to find, but it is not quite TinkerPop (for example, in Vertex we should have an |
@joshsh I am seeing better now. so we would need a wrapper for tinker pop to cosmos elements. And we would still need a CosmosGraphIndex similar to the TinkerGraphIndex. Thank you |
@charbull that's one way. On the server side, you would need TinkerPop wrappers for Graph, Edge, Vertex, Property, etc. as well as an implementation of GraphIndex, which would tie into the underlying Cosmos API. For GraphIndex, you just need a way of creating a vertex index, adding a vertex to the index, and removing a vertex from the index. The other possibility I mentioned is to connect via |
Gremlin Driver from JavaTake a look at the Getting started example provided by the Cosmos DB Graph. The pom only contains a dependency to the Gremlin Server [1]. And then the code is standard Gremlin driver API. cluster = Cluster.build(new File("src/remote.yaml")).create();
client = cluster.connect();
String gremlinQueries[] = new String[] {
"g.V().drop()",
"E().drop()",
"g.addV('person').property('deviceid', 'thomas').property('firstName', 'Thomas').property('age', 44)",
"g.addV('person').property('deviceid', 'mary').property('firstName', 'Mary').property('lastName', 'Andersen').property('age', 39)",
...
ResultSet results = client.submit(gremlinString); The above code works well and adds the Vertex correctly. WithRemote from Gremlin ConsoleI tried withRemote, (I am just starting with Gremlin, I might have done something wrong) I was able to connect to cosmos db but couldn't create a vertex. Any thoughts on this? |
@charbull, are you able to execute a simple read query (e.g. |
Hey @joshsh, I have the same behavior. |
Hi, in https://github.com/bartdotnet/CosmosDbTests I tried to provide examples how to test connectivity via
all examples issue a simple "g.V().count()" that should work (note url to endpoint for (2) and (3) differ from (1). Bart, |
Thanks, @bartdotnet -- this makes it easy to explore those options. Per my observation and @charbull's comment, I don't see a straightforward path to GraphSail compatibility yet (through Gremlin.Net or Gremlin Console), but the upcoming object support sounds promising. |
Hi @joshsh,
I am just entering the world of the
Gremlin
.Is it possible to use GraphSail on top of Cosmos DB to serialize RDF and execute SPARQL queries?
Thank you for your help,
Charbel
The text was updated successfully, but these errors were encountered: