Azure Cosmos DB databases can be configured to use a Gremlin API. Via this feature, Cosmos DB aims to provide a compatible server interface for applications using the Tinkerpop Gremlin graph traversal language. Not all Gremlin features are supported by Cosmos DB's implementation.
Questions tagged [azure-cosmosdb-gremlinapi]
283 questions
7
votes
1 answer
Limit number of items in group().by() in gremlin query
I am trying to run a gremlin query which groups vertices of a certain label into several groups by a certain field (assume it is 'displayName') and limit the number of groups to n and the number of items in each group also to n.
Is there a way to…

Laith Hisham
- 107
- 1
- 1
- 8
7
votes
1 answer
Is it possible to generate gremlin queries from bytecode in python
Is it possible to generate gremlin script from the bytecode?
I am working on a POC in which I need to query graph Azure CosmosDB database via Gremlin API.
Currently, Azure CosmosDB does not support bytecode. Azure development team has started…

Sebastian Widz
- 1,962
- 4
- 26
- 45
4
votes
1 answer
CosmosDB: Gremlin Query to create a new property using existing property
Each vertex has a structure:
{
Id: 123,
field1: 10
}
I want to add field2 to all the vertices such that field2 has its value equal to field1.
The challenge is that almost all the queries I found here as well as other places give syntax…

dragos
- 183
- 1
- 1
- 13
4
votes
0 answers
Is there a way to access the Cosmos DB Gremlin API from Java / Kotlin similar to Spring Data?
We want to use Cosmos DB Gremlin API from Java, respectively Kotlin, and wonder which is the best way to do so. We know the Tinkerpop gremlin-driver works. But is there a way that supports typed mapping in the way Spring Data does?
A first attempt…

Manla
- 61
- 3
4
votes
1 answer
How can I download all the data from CosmosDB Gremlin API DB?
I don't see any menu item inside the Azure Portal Data Explorer to backup all the nodes and edges from a CosmosDB Gremlin Database to JSON or CSV. I tried to run the query g.V() to generate all the json for all the nodes but the json tab does not…

wonderful world
- 10,969
- 20
- 97
- 194
4
votes
1 answer
How to transform a Gremlin GraphSON in tree format to custom JSON tree format in CosmosDB?
I have the following Gremlin queries that ran successfully in CosmosDB:
g.addV('person').property(id, 'grand_father').property('name', 'Grand Father')
g.addV('person').property(id, 'father').property('name', 'Father')
g.addV('person').property(id,…

wonderful world
- 10,969
- 20
- 97
- 194
4
votes
1 answer
Understanding fold() and its impact on gremlin query cost in Azure Cosmos DB
I am trying to understand query costs in Azure Cosmos DB
I cannot figure out what is the difference in the following examples and why using fold() lowers the cost:
g.V().hasLabel('item').project('itemId', 'id').by('itemId').by('id')
which produces…

Sebastian Widz
- 1,962
- 4
- 26
- 45
3
votes
1 answer
Does Azure Cosmos DB supports RDF schema and SPARQL?
I have a requirement in which i need to design a solution to load data from source to knowledge graph. Also its mentioned that database should support RDF or Graph Database schema and SPARQL engine. SO I am not sure whether to use Cosmos DB graph…

Isha
- 31
- 1
3
votes
1 answer
Azure Cosmos Gremlin API: transactions and efficient graph traversal
We are experimenting with the Cosmos Gremlin API because we are building a large scale knowledge-management-system which is naturally suited for a graph DB. Knowledge items are highly interconnected and therefore a graph is much better than a…
user3151341
3
votes
0 answers
Connection pool setting in node.js app which connects to Azure GraphDB and query using gremlin
Following this tutorial where a node.js app connects to Azure cosmos - GraphDB and query the GraphDB using gremlin https://learn.microsoft.com/en-us/azure/cosmos-db/create-graph-nodejs
Created an app.js as below. This is working fine. I can submit a…

Pradeep Singh
- 1,094
- 1
- 9
- 24
3
votes
2 answers
How do I produce output even when there is no edge and when using select for projection
Can someone help me please with this simple query...Many thanks in advance...
I am using the following gremlin query and it works well giving me the original vertex (v) (with id-=12345), its edges (e) and the child vertex (id property). However, say…

nDev
- 97
- 2
- 9
3
votes
2 answers
Azure Cosmos DB Gremlin/Tinkerpop Token Auth with Java SDK
I'm trying to connect to a Gremlin collection in Azure Cosmos DB using a resource token. I adapted the documentation from here (it's for C# mainly): https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-use-resource-tokens-gremlin
The issue is…

dArignac
- 1,205
- 4
- 11
- 25
3
votes
0 answers
Cosmos DB Emulator refusing connections for the gremlin endpoint
I have an asp.net core mvc application which I test locally against the Azure Cosmos DB Emulator and most of the time it works fine, but once in a while after I start up the emulator I get the following error
SocketException: No connection could be…

Sandman
- 795
- 7
- 16
3
votes
4 answers
Insert vertex into local Cosmos DB Emulator using Gremlin Console
I am trying to add vertices (and eventually edges) to a local Cosmos DB graph using the Gremlin console. I've been following this tutorial. However, whenever I try to add a vertex, I get an error about the partition key.
My…

jkost4
- 73
- 1
- 8
3
votes
0 answers
Limitation of repeat() step to use only 32 loops using gremlin in azure cosmosdb graph.Possible WorkArounds
I am currenlty using Azure Cosmos DB[Gremlin API] to store Hierarichal Information. I am maintaining ParentChild Relationship amongst my vertices using edges of type 'ParentOf'.
Requirement: Given an known Parent vertex fetch all the child…

Prasanth Perumalla
- 41
- 5