gremlin

How to build index for already present property?

删除回忆录丶 提交于 2020-03-05 00:32:07
问题 When I am updating my schema, I created a new property(say A) but I forgot to build index. Without knowing that, I have tried to add the value for that property resulted in :> g.V().hasLabel('AA').has('active',true).property('A','ok').count() ** Could not find a suitable index to answer graph query and graph scans are disabled: [(~label = user)]:VERTEX** :> g.V().hasLabel('AA').has('active',true).has('A','ok').valueMap() But when I do valueMap by traversing it with other indexed property then

How to build index for already present property?

前提是你 提交于 2020-03-05 00:30:51
问题 When I am updating my schema, I created a new property(say A) but I forgot to build index. Without knowing that, I have tried to add the value for that property resulted in :> g.V().hasLabel('AA').has('active',true).property('A','ok').count() ** Could not find a suitable index to answer graph query and graph scans are disabled: [(~label = user)]:VERTEX** :> g.V().hasLabel('AA').has('active',true).has('A','ok').valueMap() But when I do valueMap by traversing it with other indexed property then

Using valueMap with match()

假如想象 提交于 2020-01-25 11:23:06
问题 I am calling JanusGraph remote, which returns ReferenceVertex by default. In order to retrieve properties as well, I use valueMap(), which works well for simple queries. However, in my use case I need to build a join, which works well based on ReferenceVertex as follows: // select t1.table2_ID, t2.table2_ID from table1 as t1 inner join table2 as t2 on t1.table2_ID = t2.table2_ID GraphTraversal<?, ?> t1 = __.start().as("table1").out("relatesTo").hasLabel("table2").as("table2"); GraphTraversal<

gremlinpython - return id and label as string

為{幸葍}努か 提交于 2020-01-25 00:47:05
问题 I'm using gremlinpython 3.4.1 on Python 3.7.2, and when get vertex/edge responses it is providing <T.id: > for id and <T.label: 3> for the label. How would I get it to provide the string value for id and label in the response instead? My aim is take the output and generate JSON The output: python3 stackoverflow.py [{'name': ['USA'], 'parentname': ['USA'], 'shortname': ['US'], <T.id: 1>: 'country-us', 'parentid': ['country-us'], <T.label: 3>: 'Country'}] The code: from gremlin_python import

Titan gremlin console and java returns different result for group().by() query

♀尐吖头ヾ 提交于 2020-01-24 20:48:22
问题 I am using Titan 1.0.0 supported by cassandra 2.1.7 as backend storage. While trying to execute the same query on gremlin console and java program, I am getting 2 the output in two different formats. I am using the gremlin console provided by titan-1.0.0-hadoop1 and for java I am using TinkerPop Gremlin 3.0.1-incubating. Gremlin Console: gremlin> g.V().has('msid',within(-2128958273, 2147477890)).as('in').local(outE('hie_child').has('hostid_e',within(153,83)).order().by('hrank',incr).limit(5))

how to query by vertex id in Datastax DSE 5.0 Graph in a concise way?

孤街浪徒 提交于 2020-01-23 13:33:27
问题 It seems that the unique id for vertices is community_id in DSE Graph. I have found that this works (id is long) : v = g.V().has("VertexLabel","community_id",id).next() none of those work: v = g.V("community_id",id).next() v = g.V("community_id","VertexLabel:"+id).next() v = g.V(id).next() v = g.V().hasId(id).next() v = g.V().hasId("VertexLabel:"+id).next() v = g.V("VertexLabel:"+id).next() Edit After some investigation I found that for a vertex v, v.id() returns a LinkedHashMap: Vertex v =

How to generate a custom JSON output from a CosmosDB Graph using Gremlin?

霸气de小男生 提交于 2020-01-16 19:08:10
问题 I'm using the CosmosDB Graph database to store the names of a few people, their marriages and the children whom they have out of the marriages. In the following diagram, you will see that the person Husband has a Child A from his first marriage and Child B from his second marriage. Father of Husband Mother of Husband GRAND FATHER & GRAND MOTHER +---------------+--------------+ Marriage | +------------+---------------+--------------+-----------+ FATHER & MOTHER Ex Wife A Marriage Husband

How to generate a custom JSON output from a CosmosDB Graph using Gremlin?

二次信任 提交于 2020-01-16 19:08:08
问题 I'm using the CosmosDB Graph database to store the names of a few people, their marriages and the children whom they have out of the marriages. In the following diagram, you will see that the person Husband has a Child A from his first marriage and Child B from his second marriage. Father of Husband Mother of Husband GRAND FATHER & GRAND MOTHER +---------------+--------------+ Marriage | +------------+---------------+--------------+-----------+ FATHER & MOTHER Ex Wife A Marriage Husband

Issues while connecting gremlin to gremlin server

拈花ヽ惹草 提交于 2020-01-16 04:44:06
问题 I want to connect to my gremlin server where i have given the gremlin-server.yaml and remote.yaml with the same host. My gremlin is on the linux server. While giving the :remote command i get, gremlin> :remote connect tinkerpop.server conf/remote-objects.yaml 05:20:38 WARN org.apache.tinkerpop.gremlin.driver.handler.WebSocketClientHandler - Exception caught during WebSocket processing - closing connection io.netty.handler.codec.http.websocketx.WebSocketHandshakeException: Invalid handshake

Is there a document about how gremlin 'match()' works?

ⅰ亾dé卋堺 提交于 2020-01-14 22:49:21
问题 I'm writing gremlin query with 'match()' traversal. It seems some pattern matching behaves differently than other pattern languages. How input traverser values are bound by pattern variables. g.V('A', 'B').match(__.as('x'), __.as('y')).project('x', 'y') ==>[x:v[A],y:v[A]] ==>[x:v[B],y:v[B]] I think pattern variable x and y have no constraints and result will be ==>[x:v[A],y:v[A]] ==>[x:v[A],y:v[B]] ==>[x:v[B],y:v[A]] ==>[x:v[B],y:v[B]] It seems a constraint x = y is added implicitly. When