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
1
vote
1 answer

How do i upload tinkergraph into python/gremlin?

I am trying to use gremlin in python. I imported the following: from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection from gremlin_python.structure.graph import Graph from gremlin_python import statics from…
Maths12
  • 852
  • 3
  • 17
  • 31
1
vote
1 answer

Joining vertices with type indirection

I want to do a join between two vertex types using gremlin select * from type1 inner join type2 in type2.id = type1.type2_id The following works when using type1 and type2 as vertex labels: g.V() .hasLabel("type2").as("t2") .inE("hasJoin") …
1
vote
1 answer

Most idiomatic way to iterate through and add to set functionally

I'm using Gremlin to iterate through a GraphTraversal object and retrieve the vertices. Here's what I'm working with: def getVertexSet(vIter: GraphTraversal[Vertex, Vertex]): Set[Vertex] = { val s = mutable.HashSet.empty[Vertex] …
franklin
  • 1,800
  • 7
  • 32
  • 59
1
vote
1 answer

Pagination in Janusgraph - how do I implement traversal.next(pagesize) in Java

Environment: Janusgraph 0.3.3 cql-es, tinkergraph 3.3.3, gremlin driver 3.3.3 with remote websocket connection and following advice from stephen mallette: How to perform pagination in Gremlin Following works in gremlin console: t =…
ptc
  • 734
  • 5
  • 11
1
vote
0 answers

Gremlin query to retrieve nodes of OrientDB Generic classes

Having one class UserRoles which is not extending to any superclass V. How I will get the vertices for this. The following query doesn't work: g.traversal().V().hasLabel("UserRoles").toList()
Nandita Sahu
  • 89
  • 1
  • 7
1
vote
2 answers

Does AWS Neptune support text search and sorting with Gremlin?

I'm using AWS Neptune with Gremlin. Is there a way of using wildcard for search like ' % title % ' & sorting something with order by asc / desc ?
Code Wines
  • 241
  • 1
  • 11
1
vote
1 answer

Gremlin nested loops and double repeat statements

How does gremlin interpret double repeats such as described here for Lowest Common Ancestor algorithm? http://tinkerpop.apache.org/docs/3.2.3-SNAPSHOT/recipes/#_lowest_common_ancestor It appears this is interpreted as a nested loop inside another…
rossb83
  • 1,694
  • 4
  • 21
  • 40
1
vote
1 answer

Gremlin-Python: Property existence check

I can't seem to figure out an idiomatic way to filter nodes that have or don't have a certain property (regardless of its value). Property exists: > g.V().hasNot('weight', None).toList() *** gremlin_python.driver.protocol.GremlinServerError: 599:…
scribu
  • 2,958
  • 4
  • 34
  • 44
1
vote
1 answer

In Gremlin, how can I group pairs of elements by a property from one of them?

After some traversal I select the elements I'm interested in through select(). How can I group by one of the properties from one specific element. What I did: g.V() // ... some traversal happens here where I obtain a and…
GalmWing
  • 731
  • 1
  • 7
  • 14
1
vote
1 answer

Connecting a local gephi instance to a remote titan server

Here is the scenario I want to resolve: I have two environments: a local machine and a virtual machine hosted in Azure In the virtual machine I start a gremlin container which includes the gremlin client, server and connects to a cassandra graph…
JBeloqui
  • 27
  • 5
1
vote
1 answer

Most optimal gremlin query for getting all related vertices

I need to get all the vertices related by any number of relationships to the starting vertex. I have a working query, but it starts to slow significantly after a few hundred edges and the complexity of the graph. Is there any more efficient way of…
1
vote
1 answer

Traverse through graph based on edge's properties values | Gremlin

I have a graph in which all Edges have the same property but values may differ between Vertices. I need to traverse through the graph from an specific vertex though all edges that have an specific value for that proerty. For example I have this…
valdo
  • 11
  • 1
1
vote
2 answers

Shortest path taking into consideration the weight on tinkergraph in Java

I'm trying to find the shortest path taking into consideration the weights properties on the edges my work is on TinkerGraph and i want to do it in java. gremlin is not very helpful for me g.V().has(id1). repeat(both().simplePath()). …
alaa elias
  • 11
  • 5
1
vote
1 answer

How to know the number of vertices encountered while traversing from one vertex to another in gremlin

In the above picture we can see that , I can traverse to node 5 from both node 1 and 2 , but while traversing from 1 only one vertex in encountered which is 3 but for two it is 5 and 4 . How can I write a gremlin query , that will return the number…
Mithun Sarker Shuvro
  • 3,902
  • 6
  • 32
  • 64
1
vote
1 answer

How to connect with an existing JanusGraph using Gremlin-Python

I have created a graph with a set of vertices and edges in JanusGraph using Gremlin console. I want to open the same graph and want to add more vertices using Gremlin-Python. I have written below code, but it is not working and it gives me zero…
Servesh Singh
  • 113
  • 1
  • 9