gremlin

Shapeless and gremlin scala: How do I return the result of a call to `as`?

☆樱花仙子☆ 提交于 2019-12-11 04:09:56
问题 So, I am calling this function as (from gremlin-scala ): case class GremlinScala[End, Labels <: HList](traversal: GraphTraversal[_, End]) { def as(name: String, moreNames: String*)(implicit p: Prepend[Labels, End :: HNil]) = GremlinScala[End, p.Out](traversal.as(name, moreNames: _*)) } It is defined here: https://github.com/mpollmeier/gremlin-scala/blob/master/gremlin-scala/src/main/scala/gremlin/scala/GremlinScala.scala#L239 It takes an implicit Prepend argument, which I am not sure I

Why can't I set the Id for a new vertex using Gremlin in Java?

天大地大妈咪最大 提交于 2019-12-11 03:46:55
问题 I'm using Gremlin with Java and a Neo4j graph. I create 3 new vertices and try to set their Ids to 1,2,3 but it does not seem to be working, what am I doing wrong? Vertex v1 = g.addVertex(1); v1.setProperty("name","jim"); Vertex v2 = g.addVertex(2); v2.setProperty("name","bob"); Vertex v3 = g.addVertex(3); v3.setProperty("name","fred"); //iterate through the vertices and get their id's (shouldn't they be 1,2, and 3 ?? for (Vertex V:GVs) System.out.println(V.getId()); returns: 15 16 17 Why is

Gremlin : GroupBy vertices , having count > 1

五迷三道 提交于 2019-12-11 03:17:44
问题 I am using TITAN 0.4, and gremlin for traversals. My requirement is to identify duplicate vertices in graph, and to merge those. There are > 15 M vertices in graph. gremlin> g.V.has('domain').groupBy{it.domain}{it.id}.cap ==>{google.com=[4], yahoo.com=[16, 24, 20]} I am able to group the vertices, but I need only those domains(vertices) which exists more than once. In the above example, I need to return only ==>{yahoo.com=[16, 24, 20]} The key "domain" is indexed, if that makes any difference

Get edge properties as well as source and target vertex ID in Gremlin query language

*爱你&永不变心* 提交于 2019-12-11 02:49:29
问题 I am trying to retrieve the edge properties as values as well as the target and source node IDs. My current database looks like that: Edge: _id _label _outV _inV name ID 0 edge 0 1 E 0 Nodes: _id _label _name ID 0 node A 0 1 node B 1 I have tried this query: >g.V().as('a').outE('edge').as('b').inV().values('ID').as('to'). select('b').valueMap().as('edge'). select('a').values('ID').as('from'). select('to','edge','from') ==>[to:0,edge:[ID:0,name:E],from:1] What I am trying to get is [to:0,ID:0

Gremlin.net textContains equivalent

余生长醉 提交于 2019-12-11 02:08:31
问题 I am using Gremlin.net library to connect to a janus graph server. I am usin cassandra and elasstic search for data storage and indexing. In gremlin language and gremlin console I use textContains to search within the text of a property. I am using Mixed index for that, but I can find the equivalent for that in Gremlin.net Library? can anyone help? 回答1: Gremlin.Net will not have that. TinkerPop doesn't have text or geo search predicates that JanusGraph and other systems have. At this point,

Comparing properties in Gremlin

会有一股神秘感。 提交于 2019-12-10 21:46:56
问题 I have a simple graph, with parents and children being vertices. Parents have the relationship "isParentOf" to their children. The vertices all have one property: the "familyName". I want to use gremlin to match all the parents whose child's familyName is different from theirs. Note: I cannot use the Groovy syntax of Gremlin. I must use pure Java code only. 回答1: The GremlinPipeline should look like this: find all parents follow the "isParentOf" relationship and get all the children filter the

How to add property to vertex property in java?

非 Y 不嫁゛ 提交于 2019-12-10 20:18:37
问题 I want to add property to a vertex property. In gremlin i add property "phone" to vertex property "places" that has value is "place1" g.V(v).properties('places').hasValue('place1').property('phone',"123456789") It worked ok without using transaction commit. But when i used this way in java code, it not worked. So in java code, how to add a property to vertex property? Thank for your help. 回答1: You need to iterate() the traversal. g.V(v).properties('places').hasValue('place1').property('phone'

OrientDB Gremlin server not working in python

萝らか妹 提交于 2019-12-10 20:11:31
问题 I am using the orientdb and gremlin server in python, Gremlin server is started successfully, but when I am trying to add one vertex to the orientdb through gremlin code it's giving me an error. query = """graph.addVertex(label, "Test", "title", "abc", "title", "abc")""" following is the Traceback /usr/bin/python3.6 /home/admin-12/Documents/bitbucket/ecodrone/ecodrone/test/test1.py Traceback (most recent call last): File "/home/admin-12/Documents/bitbucket/ecodrone/ecodrone/test/test1.py",

Gremlin find highest match

强颜欢笑 提交于 2019-12-10 19:36:59
问题 I am planning to use a Graph Database (AWS Neptune) that can be queried with Gremlin as a sort of Knowledge base. The KB would be used as a classification tool on with entities with multiple features. For simplicity, I am using geometric shapes to code the properties of my entities in this example. Let's suppose I want to classify Points that can be related to Squares, Triangles and Circles. I have blueprint the different possible relationships of Points with the possibles Squares, Triangles

Tinkerpop Gremlin Depth First Search Order

不羁岁月 提交于 2019-12-10 19:07:54
问题 I have a very simple example graph which I am trying to get a depth first query on. Let's say the graph edges look like this A->B A->C B->D B->E C->F C->G A depth first search from A should return A-B-D-E-C-F-G But if I could get the below order it would be even better D-E-B-A-F-G-C-A How can I create a Gremlin query that will output this order? If I do something like this g.V('A').repeat(outE().inV()).emit() I get an order of A,B,C,D,E,F,G which is breadth first. I can't work out how to get