gremlin

How to chain commands in Gremlin?

此生再无相见时 提交于 2019-12-24 02:25:24
问题 The following command works t = new Table(); g.V.as('id').as('properties').table(t){it.id}{it.map} print t The following command works t = new Table(); g.V.as('id').as('properties').table(t){it.id}{it.map}; print t The following command doesn't work t = new Table(); g.V.as('id').as('properties').table(t){it.id}{it.map}; print t Why? 回答1: The fast answer: You need to iterate your pipeline. The long answer: In the Gremlin REPL, iteration will happen for you automagically if your last statement

ClassCastException while fetching edge property value bewteen two vertices

不问归期 提交于 2019-12-24 01:41:39
问题 I am trying to fetch edge property value between two vertices and getting below exception java.lang.ClassCastException: java.lang.String cannot be cast to scala.runtime.Nothing$ Env: Titan InMemory Code : val age = Key[Int]("age") A ---("knows",age -> 10) --> B Gremlin query: graph.traversal().V().has("ID", "A").bothE("knows").as("x").otherV() .has("ID", "B").select("x").properties("age").headOption().get output : p[age->10] graph.traversal().V().has("ID", "A").bothE("knows").as("x").otherV()

OrientDB SQL vs Gremlin

不想你离开。 提交于 2019-12-23 21:02:08
问题 What query language in OrientDB provides the fastest solution: SQL or Gremlin? Gremlin is very attractive because it is universal for other graph libraries, however does this require a big translation in OrientDB or none at all (What is the latency)? 回答1: EDIT As @decebal pointed out this is not a good test case scenario. Please discard the below benchmarks. power of a graph database comes from relationships, those queries are obviously biased towards simple structures which reflects the only

Gremlin-Server Cassandra

喜夏-厌秋 提交于 2019-12-23 17:22:04
问题 I am starting to work with Titan and I am using cassandra as backend store. When I start titan.sh cassandra and elasticsearch were started but the gremlin server did not. I was looking at titan.sh and I have seen that it start gremlin server with conf/gremlin-server/gremlin-server.yaml. The problem is that the gremlin-server.yaml is configured as this: graphs: { graph: conf/gremlin-server/titan-berkeleyje-server.properties} Using BerkeleyDb. I have not seen the cassandra.yaml for Gremlin

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

我的梦境 提交于 2019-12-23 09:31:43
问题 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')). by(out('created').values('name').aggregate('a').select('a')) but I get the error The provided traverser does not map to a value: v[2]->[VertexStep(OUT,[created],vertex), PropertiesStep([name],value), AggregateStep(a), SelectOneStep(last,a)] The problem seems to be that vertex

Gremlin- how to find paths from A to Z that went through G only

人走茶凉 提交于 2019-12-23 02:47:11
问题 Need some help with Gremlin: If I know the start vertex and the end vertex and there are multiple paths between start and end BUT I have a couple of vertexes along the way. How can I find the correct path based on the data I have? For instance here I what I have to find the paths from 'college' to 'finch' g.V().has('station','college'). repeat(out().simplePath()) .until(has('station','finch')) .path().by('station') Results ==>[college, wellesley, bloor-yonge, rosedale, summerhill, st. clair,

Gremlin query for groupcount of last value

自作多情 提交于 2019-12-23 02:22:16
问题 I have a titan graph with two sets of vertices, one for UserID and another for Products. The edges between the UserID and Product vertices contain the "Dates" when products were purchased. I am looking for a gremlin query that can give me a groupcount of userids by the last product purchased For example if had data like below UserID,Date,Product A,2016-01-01,'Razor' A,2016-01-02,'Toothpaste' B,2016-02-01,'Toothpaste' B,2016-02-02,'Razor' C,2016-01-04,'Toothpaste' I am looking for an output

Limiting depth of shortest path query using Gremlin on JanusGraph

谁说胖子不能爱 提交于 2019-12-23 00:25:18
问题 I have a fairly large graph (currently 3806702 vertices and 7774654 edges, all edges with the same label) in JanusGraph. I am interested in shortest path searches in it. Gremlin recipes mention this query: g.V(startId).until(hasId(targetId)).repeat(out().simplePath()).path().limit(1) This returns path that I know to be a correct one immediately but then hangs the console ( top shows janusgraph and scylla to be processing stuff furiously though, so I guess it's working in the background, but

OrientDB Gremlin - Retrieve Vertex for a class in gremlin not hitting indexes

妖精的绣舞 提交于 2019-12-22 17:54:21
问题 I'm using OrientDB 2.1.11 and rexster 2.6 and gremlin is the main query language. I use via rexpro (and rexster REST). My issue is: how to get the indexes to hit from gremlin (I must use gremlin not orient sql). I have a vertex class zipcode, which has 1 property zip_code defined in schema and indexed as dictionary: zipcode.zip_code DICTIONARY ["zip_code"] SBTREE But when I query it using gremlin, its slow when records are around >25k (haven't tested with lower numbers). To give proper

OrientDB Gremlin - Retrieve Vertex for a class in gremlin not hitting indexes

我只是一个虾纸丫 提交于 2019-12-22 17:53:15
问题 I'm using OrientDB 2.1.11 and rexster 2.6 and gremlin is the main query language. I use via rexpro (and rexster REST). My issue is: how to get the indexes to hit from gremlin (I must use gremlin not orient sql). I have a vertex class zipcode, which has 1 property zip_code defined in schema and indexed as dictionary: zipcode.zip_code DICTIONARY ["zip_code"] SBTREE But when I query it using gremlin, its slow when records are around >25k (haven't tested with lower numbers). To give proper