tinkerpop3

How to fire match query in gremlin . Filter query not working in cosmos db with java driver

老子叫甜甜 提交于 2019-12-02 20:40:06
问题 I have 2 problem statements with similar approach .Can I put a contains or like query in both to solve my problem in gremlin: 1) Returning vertex 'a' in the following query when the outE() (as depicted in below gremlin query) has label with contains print. g.V().hasLabel('url').has('name','sw10707').as('a').outE('print').has('forward','states').inV().select('a') 2) Returning all the vertices as stated below which contains print in their edge labels: g.V().hasLabel('url').has('name','sw10707')

Recursively query simpler tree-like structures with Gremlin

夙愿已清 提交于 2019-12-02 17:49:09
问题 Consider the following data: g.addV('RootTopic').property('name', 'A').as('A') .addV('RootTopic').property('name', 'M').as('M') .addV('Topic').property('name', 'A1').as('A1') .addV('Topic').property('name', 'A2').as('A2') .addV('Topic').property('name', 'B1').as('B1') .addV('Topic').property('name', 'B2').as('B2') .addV('Topic').property('name', 'N1').as('N1') .addV('Topic').property('name', 'N2').as('N2') .addV('Topic').property('name', 'O1').as('O1') .addE('refines').from('A').to('A1')

Recursively query simpler tree-like structures with Gremlin

ぃ、小莉子 提交于 2019-12-02 11:53:11
Consider the following data: g.addV('RootTopic').property('name', 'A').as('A') .addV('RootTopic').property('name', 'M').as('M') .addV('Topic').property('name', 'A1').as('A1') .addV('Topic').property('name', 'A2').as('A2') .addV('Topic').property('name', 'B1').as('B1') .addV('Topic').property('name', 'B2').as('B2') .addV('Topic').property('name', 'N1').as('N1') .addV('Topic').property('name', 'N2').as('N2') .addV('Topic').property('name', 'O1').as('O1') .addE('refines').from('A').to('A1') .addE('refines').from('A').to('A2') .addE('refines').from('A1').to('B1') .addE('refines').from('A1').to('B2

Index does not work when using order().by() in Titan

纵饮孤独 提交于 2019-12-02 03:06:02
问题 The Titan documentation says that: Mixed indexes support ordering natively and efficiently. However, the property key used in the order().by() method must have been previously added to the mixed indexed for native result ordering support. This is important in cases where the the order().by() key is different from the query keys. If the property key is not part of the index, then sorting requires loading all results into memory. So, I made a mixed index on prop1 property. The mixed index on

How to remove an edge and add a new edge between two vertices?

≯℡__Kan透↙ 提交于 2019-12-01 18:43:14
问题 I'm trying to drop an edge and add a new edge between two vertices. How do I do that in Tinkerpop3? def user = g.V().has("userId", 'iamuser42').has("tenantId", 'testtenant').hasLabel('User'); user.outE("is_invited_to_join").where(otherV().has("groupId", 'test123')).drop(); def group = g.V().has("groupId", 'test123').has("tenantId", 'testtenant').hasLabel('Group').next(); user.addEdge("is_member_of", group); This is the error I get on gremlin shell: No signature of method: org.apache.tinkerpop

Why does Gremlin JavaScript use “from_” mapping instead of “from”?

Deadly 提交于 2019-12-01 13:42:00
I struggled with this for hours before finding out that you have to use from_ instead of from when using gremlin javascript. After digging through the source code I finally found out that the code is using from_ instead of from (see code ). Since I'm a newbie this comes off as strange because its counterpart to is still to (and not to_ , see code here ) I googled everywhere but couldn't find the reason why this works this way, and feel uneasy about using the underscore version since most of the times underscores denote private methods that users should not really trust. Also, is there an

TinkerPop: Adding Vertex Graph API v/s Traversal API

╄→尐↘猪︶ㄣ 提交于 2019-12-01 09:51:27
Background : In one of the SO posts it is recommended to use Traversal API than Graph API to make mutation. So I tried out some tests and found Graph API seemed to be faster, I do totally believe the advice but I am trying to understand how its better. I did try googling but did not find a similar post Testing : Query 1 : Executed in 0.19734525680541992 seconds g.addV('Test').property('title1', 'abc').property('title2', 'abc') Query 2 : Executed in 0.13838958740234375 seconds graph.addVertex(label, "Test", "title1", "abc", "title2", "abc") Question : Which one is better and why? If both are

Setup and configuration of Titan for a Spark cluster and Cassandra

≯℡__Kan透↙ 提交于 2019-12-01 08:11:01
There are already several questions on the aurelius mailing list as well as here on stackoverflow about specific problems with configuring Titan to get it working with Spark. But what is missing in my opinion is a high-level description of a simple setup that uses Titan and Spark. What I am looking for is a somewhat minimal setup that uses recommended settings. For example for Cassandra, the replication factor should be 3 and a dedicated datacenter should be used for analytics. From the information I found in the documentation of Spark, Titan, and Cassandra, such a minimal setup could look

Gremlin: What's an efficient way of finding an edge between two vertices?

女生的网名这么多〃 提交于 2019-12-01 06:01:03
问题 So obviously, a straight forward way to find an edge between two vertices is to: graph.traversal().V(outVertex).bothE(edgeLabel).filter(__.otherV().is(inVertex)) I feel that filter step will have to iterate through all edges making really slow for some applications with a lot of edges. Another way could be: traversal = graph.traversal() .V(outVertex) .bothE(edgeLabel) .as("x") .otherV() .is(outVertex) // uses index? .select("x"); I'm assuming the second approach could be much faster since it

Setup and configuration of Titan for a Spark cluster and Cassandra

狂风中的少年 提交于 2019-12-01 04:22:59
问题 There are already several questions on the aurelius mailing list as well as here on stackoverflow about specific problems with configuring Titan to get it working with Spark. But what is missing in my opinion is a high-level description of a simple setup that uses Titan and Spark. What I am looking for is a somewhat minimal setup that uses recommended settings. For example for Cassandra, the replication factor should be 3 and a dedicated datacenter should be used for analytics. From the