-1

For now we are using the very simplified and not near reality approach that Azure officially lets one play: https://learn.microsoft.com/en-us/azure/cosmos-db/gremlin/quickstart-java.

But we need to use gremlin in a scriptive manner ... like this:

g.V().has()...

... not as a string script query that is then submited:

static final String gremlinQueries[] = new String[] {
            "g.addV('person').property('id', 'thomas').as('tom'),
            "g.addV('person').property('id', 'mary').as('may'),
            "g.addE('friends').from('tom').to('may')" };

(...)

for (String query : gremlinQueries) {

   ResultSet results = client.submit(query);
}

for (Result result : resultList) {
   result.toString()
}

I already tried to use Tinkerpop Documentation guides:

https://tinkerpop.apache.org/docs/current/reference/#gremlin-java https://tinkerpop.apache.org/docs/current/reference/#connecting-gremlin

David Makogon
  • 69,407
  • 21
  • 141
  • 189
  • It's not really clear what you're asking, but Cosmos DB's Gremlin API is accessed in the same manner as any other gremlin-based graph database (e.g. same SDKs). Also, you linked a few different help articles, but nobody should need to visit/read those to understand your question. What's your specific issue? Please edit to clarify. – David Makogon May 17 '23 at 18:24
  • sorry @DavidMakogon if I wasn't clear ... Stephen answered down there ... which seems to be: no solution! :-( – Omar Ghoche May 18 '23 at 13:25

1 Answers1

0

I believe you are asking how to send Gremlin bytecode queries to CosmosDB, but are finding that you can only send strings-based queries. If that is correct, note that CosmosDB does not currently support bytecode based requests, so you are in fact limited to strings. CosmosDB has a long open issue about this here.

stephen mallette
  • 45,298
  • 5
  • 67
  • 135