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
14
votes
1 answer

RexProScriptException transaction is not open in Django with Titan (graph DB)

I am stuck with my TitanDB, Django1.8 and Mogwai0.7.7 package. I have Graph database titan/cassandra on localhost dev machine, and after creating wrong queries in rexster gremlin web interface my Django Object Graph Mapper mogwai stopped working.…
Dmitry Yudin
  • 1,033
  • 1
  • 10
  • 31
13
votes
2 answers

Azure Cosmos DB Graph Wildcard search

Is it possible to search Vertex properties with a contains in Azure Cosmos Graph DB? For example, I would like to find all persons which have 'Jr' in their name? g.V().hasLabel('person').has('name',within('Jr')).values('name') Seems like the…
Stephane
  • 11,056
  • 9
  • 41
  • 51
13
votes
1 answer

Gremlin get all incoming and outgoing vertex, including their edges and directions

I spent a week at Gremlin shell trying to compose one query to get all incoming and outgoing vertexes, including their edges and directions. All i tried…
Dmitry Yudin
  • 1,033
  • 1
  • 10
  • 31
13
votes
1 answer

Add edge between existing nodes in Gremlin

I'm new to Gremlin and just trying to build out a basic graph. I've been able to do a basic addEdge on new vertices, i.e. gremlin> v1 = g.addVertex() ==>v[200004] gremlin> v2 = g.addVertex() ==>v[200008] gremlin> e = g.addEdge(v1, v2, 'edge…
bcm360
  • 1,437
  • 2
  • 17
  • 25
12
votes
2 answers

Can RDF model a labeled property graph with edge properties?

I wanted to model partner relationship like the following, which I expressed in the format of labeled property graph. I wanted to use RDF language to express the above graph, particularly I wanted to understand if I can express the label of the…
chen
  • 4,302
  • 6
  • 41
  • 70
12
votes
1 answer

Gremlin: "The provided traverser does not map to a value" when using project

In the Modern graph, I want to get for each person the name and the list of names of software he created. So I tried the following query g.V().hasLabel('person').project('personName','softwareNames'). by(values('name')). …
cmant
  • 453
  • 1
  • 5
  • 11
12
votes
1 answer

Gremlin : Multiple filter condition "OR"

I want to query my TITAN 0.4 graph, based on two filter conditions with "OR" logical operator (return vertices if either of conditions is true). I searched this on http://sql2gremlin.com/, but only "AND" operator is given, My requirement is…
Remis Haroon - رامز
  • 3,304
  • 4
  • 34
  • 62
12
votes
7 answers

How Gremlin query same sql like for search feature

Im using OrientDB type graph. I need syntax of Gremlin for search same SQL LIKE operator LIKE 'search%' or LIKE '%search%' I've check with has and filter (in http://gremlindocs.com/). However it's must determine exact value is passed with type…
Minh Loc
  • 173
  • 1
  • 1
  • 10
11
votes
2 answers

Cosmos db graph vs Azure Sql Server - Performance and cost

Imagine a social network app. Users follow other users and users take photos. Photos have tags of other users. I'm trying to get an effective Cosmos db implementation of a graph for that app. I provide an SQL Server version as well as a…
François
  • 3,164
  • 25
  • 58
11
votes
1 answer

How to prevent Gremlin injection in C#?

When user enters data in a text box, many possibilities of SQL Injection are observed. To prevent this, many methods are available to have placeholders in the SQL query, which are replaced in the next step of code by the input. Similarly, how can we…
Sonali Agrawal
  • 303
  • 4
  • 14
11
votes
1 answer

How to remove edge between two vertices?

I want to remove edge between two vertices, so my code in java tinkerpop3 as below private void removeEdgeOfTwoVertices(Vertex fromV, Vertex toV,String edgeLabel,GraphTraversalSource g){ …
MichaelP
  • 2,761
  • 5
  • 31
  • 36
11
votes
1 answer

Titan db how to list all graph indexes

I've been looking at the management system but some things still elude me. Essentially what I want to do is: List all Edge based indexes (including vertex centric). List all Vertex based indexes (on a per label basis if the index is attached to a…
Pomme.Verte
  • 1,782
  • 1
  • 15
  • 32
11
votes
3 answers

Number of nodes/edges in a large graph via Gremlin?

What is the easiest & most efficient way to count the number of nodes/edges in a large graph via Gremlin? The best I have found is using the V iterator: gremlin> g.V.gather{it.size()} However, this is not a viable option for large graphs, per the…
bcm360
  • 1,437
  • 2
  • 17
  • 25
11
votes
2 answers

How to sort AND limit Noe4j result using Gremlin?

This is how you can sort (order) results from Neo4j graph using Gremlin: g.v(id).out('knows').sort{it.name} or g.v(id).out('knows').sort{a,b -> a.name <=> b.name} This is how to limit result using offset/skip and…
Alexei Tenitski
  • 9,030
  • 6
  • 41
  • 50
10
votes
1 answer

Default value when property is missing with project() step in Gremlin?

I have following graph: g.addV('TEST').property(id, 't1') g.addV('TEST').property(id, 't2').property('a', 1) If I do: g.V('t2').project('a').by(values('a')) the traversal works and returns map with key a because property is there. But if I have…
Vasar
  • 395
  • 2
  • 5
  • 15