tinkerpop

Tinkerpop/gremlin merge vertices (and edges)

∥☆過路亽.° 提交于 2019-12-01 23:52:47
Is there an easy way to replace or merge vertices and keep/merge existing edges? Or just manually copy all properties from the vertex and recreate existing edges and all (meta-)properties and then drop the superfluous vertex? Alright, as mentioned in the comments above, you're going to do the matching in OLTP. That means you'll likely have a concrete entry point. Let's make up a simple sample graph: g = TinkerGraph.open().traversal() // Stackoverflow data g.addV("user").property("login", "user3508638").as("a"). addV("user").property("login", "dkuppitz").property("age", 35).as("b"). addV(

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

Query to check if there is a cycle in a graph with edges visited only once

无人久伴 提交于 2019-12-01 11:18:19
How to write an query runs on my graph, that outputs 'false' if there is NO path traversing through each edge only once and return to the starting point. I was using the following sample graph : g = TinkerGraph.open().traversal() g.addV().property(id, 'blue').as('b'). addV().property(id, 'orange').as('o'). addV().property(id, 'red').as('r'). addV().property(id, 'white').as('w'). addE('bridge').from('w').to('b'). addE('bridge').from('w').to('o'). addE('bridge').from('w').to('r'). addE('bridge').from('w').to('r'). addE('bridge').from('o').to('b'). addE('bridge').from('o').to('b'). addE('bridge')

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

Query to check if there is a cycle in a graph with edges visited only once

百般思念 提交于 2019-12-01 08:20:32
问题 How to write an query runs on my graph, that outputs 'false' if there is NO path traversing through each edge only once and return to the starting point. 回答1: I was using the following sample graph: g = TinkerGraph.open().traversal() g.addV().property(id, 'blue').as('b'). addV().property(id, 'orange').as('o'). addV().property(id, 'red').as('r'). addV().property(id, 'white').as('w'). addE('bridge').from('w').to('b'). addE('bridge').from('w').to('o'). addE('bridge').from('w').to('r'). addE(

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

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

Choosing an appropriate way to use Neo4j in Python

房东的猫 提交于 2019-11-30 12:12:55
I am currently using embedded python binding for neo4j. I do not have any issues currently since my graph is very small (sparse and upto 100 nodes). The algorithm I am developing involves quite a lot of traversals on the graph, more specifically DFS on the graph in general as well as on different subgraphs. In the future I intend to run the algorithm on large graphs (supposedly sparse and with millions of nodes). Having read different threads related to the performance of python/neo4j bindings here , here , I wonder whether I should already switch to some REST API client for Python (like

Choosing an appropriate way to use Neo4j in Python

好久不见. 提交于 2019-11-29 17:59:58
问题 I am currently using embedded python binding for neo4j. I do not have any issues currently since my graph is very small (sparse and upto 100 nodes). The algorithm I am developing involves quite a lot of traversals on the graph, more specifically DFS on the graph in general as well as on different subgraphs. In the future I intend to run the algorithm on large graphs (supposedly sparse and with millions of nodes). Having read different threads related to the performance of python/neo4j

Titan Db ignoring index

人盡茶涼 提交于 2019-11-29 11:35:17
I have a graph with a couple of indices. They're two composite indices with label restraints. (both are exactly the same just on different properties/labels). One definitely seems to work but the other doesn't. I've done the following profile() to doubled check: One is called KeyOnNode : property uid and label node : gremlin> g.V().hasLabel("node").has("uid", "xxxxxxxx").profile().cap(...) ==>Traversal Metrics Step Count Traversers Time (ms) % Dur ============================================================================================================= TitanGraphStep([~label.eq(node), uid