Questions tagged [gremlin]

Gremlin is the graph traversal language and virtual machine of Apache TinkerPop™

Gremlin is a graph traversal language and virtual machine, developed by Apache TinkerPop. Gremlin is designed to work with any TinkerPop-enabled graph system, such as Titan, OrientDB, Neo4j, RDF stores like Stardog and Blazegraph, and others.

For more information, see the most recent reference documentation for TinkerPop.

3522 questions
8
votes
1 answer

Gremlin.Net Casting from Enumerable.SelectIListIterator object to real type

I don't know if my question is about c# and casting or related to Gremlin.net Library return Types. I am using this query to get vertices with their db ids. g.V().As("vertex").ValueMap>() …
janus graph
  • 407
  • 1
  • 3
  • 18
8
votes
1 answer

How to increment a vertex property value in a TinkerPop graph

How would I traverse through a graph and increment a value of a vertex property? Either by some fixed amount or by an amount in a property of an edge leading to it. eg. with the following graph: gremlin> graph =…
Matt Hamilton
  • 805
  • 1
  • 9
  • 12
8
votes
2 answers

Gremlin: What's an efficient way of finding an edge between two vertices?

So obviously, a straight forward way to find an edge between two vertices is to: graph.traversal().V(outVertex).bothE(edgeLabel).filter(__.otherV().is(inVertex)) I feel that filter step will have to iterate through all edges making really slow for…
Mohamed Taher Alrefaie
  • 15,698
  • 9
  • 48
  • 66
7
votes
5 answers

Get the id + the map of a vertex on Gremlin?

g.v(1).id gives me vertex 1 id, g.v(1).map gives me vertex 1 properties. But, how can I get a hash with id and propeties at the same time
michaelSc
  • 91
  • 1
  • 1
  • 6
7
votes
1 answer

Find people who bought the same games as someone else

I'm using Amazon Neptune to create and query a simple graph database. I'm currently running my code in an AWS Jupyter Notebook but will eventually move the code to Python (gremlin_python). As you can probably guess I'm pretty new to Gremlin and…
G_E
  • 189
  • 1
  • 10
7
votes
1 answer

Gremlin Console for Windows error "The most significant bit.."

Seems like Gremlin Console not working for Windows: I downloaded the latest Gremlin console and run the bin\gremlin.bat file. seems like after connecting (as in the below commands) and running a simple remote command (g.V(123).count()) I'm getting…
toto
  • 1,197
  • 2
  • 15
  • 26
7
votes
1 answer

Gremlin Javascript Traversal Never Resolves

I'm trying to use the gremlin npm module and connect to a Neptune database. During testing, I tried having gremlin connect to an inactive endpoint and invalid url to make the system more resilient. I expected some sort of error to be thrown.…
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…
7
votes
1 answer

How to specify id on gremlin vertex creation

Is there a way to specify the id of a new vertex? Something like g.addV('user', 'myId')?
The Hoff
  • 904
  • 1
  • 11
  • 22
7
votes
1 answer

Connecting gremlin CLI to a remote tinkerpop gremlin-server

Using gremlin-javascript, I'm connecting to a remote server using: const gremlin = require('gremlin') const Graph = gremlin.structure.Graph const DriverRemoteConnection = gremlin.driver.DriverRemoteConnection const graph = new Graph() const g =…
user479947
7
votes
2 answers

Gremlin Coalesce To Add Multiple Vertices and Edges

Right now I am able to generate a query to create as many vertices and edges as I want. e.g. g.V(). addV('vert1').as('a'). addV('vert2').as('b'). addE('has').from('a').to('b') ^^^^^^^^^^^^^ This works. Easy enough right? Now lets create a gremlin…
Austin Malpede
  • 115
  • 2
  • 8
7
votes
1 answer

Gremlin: Date filters

Filter Graph DB based on date field: I searched http://tinkerpop.apache.org/docs/current/reference/ but did not find a documentation for the same. Did some research and it seems lt, gt, etc are working. BUT is my below approach the proper way? or is…
Srinath Ganesh
  • 2,496
  • 2
  • 30
  • 60
7
votes
1 answer

How do I "cancel" an error in gremlin-console and continue with the next command without exiting?

In gremlin-console, when I make a syntax error like the example below - where I forgot to the 2nd quotation - I don't know what to type to return me back to the normal prompt gremlin>. Anything I type including Ctrl+C, Ctrl+U will continue the…
Glide
  • 20,235
  • 26
  • 86
  • 135
7
votes
3 answers

Gremlin - how do you merge vertices to combine their properties without listing the properties explicitly?

Background: I'm trying to implement a time-series versioned DB using this approach, using gremlin (tinkerpop v3). I want to get the latest state node (in red) for a given identity node (in blue) (linked by a 'state' edge which contains a timestamp…
John Stephenson
  • 499
  • 4
  • 13