gremlin

create complex gremlin-java query

北战南征 提交于 2020-01-14 03:17:08
问题 I have model implemented in titan graph database with relations presented below: [A] ---(e1)---> [B] <---(e2)--- [C] ---(e3)---> [D] | | | | | | | prop:id | prop:number | | label:e3 | | | prop:id | label:e1 label:e2 prop:number prop:prop1 A and B are "main vertices" (for example users), vertices B and C are "less important vertices" describing some data connected with users. The input for the query algorithm is property id of vertex A . I want to find all such vertices D , that are connected

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

岁酱吖の 提交于 2020-01-11 07:20:09
问题 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

Breadth First enumeration in Gremlin

心不动则不痛 提交于 2020-01-11 04:10:06
问题 I'm trying to get breadth first enumeration working with Gremlin, however I'm having trouble finding a way to output all the steps observed during the enumeration. I can only print out the result of the last iteration. My question would be, given a starting node like this, how can I follow all paths (without knowing the overall depth) using Gremlin and print out everything I find along the way? study=g.v('myId') I have tried the scatter approach, looping approach (although both seem to

Following GRAPHSON format not working

巧了我就是萌 提交于 2020-01-07 08:47:22
问题 I Am trying to convert the following graphSon Format into a graph instance using the follwing command graph.io(IoCore.graphson()).reader().create().readGraph(stream, graph); But while running converting the GRaphSON into graph instance given below {"id":0, "label":"buyer", "outE": {"email_is": [{"id":0,"inV":1, "properties":{"weight":1} } ]} ,"properties": {"buyer": [{ "id":0,"value":"buyer0" }] ,"age": [{ "id":1,"value":10}] }} {"id":1, "label":"email", "inE": { "email_is": [{"id":1,"outV":0

Json loading with gremlin server in titan graph database

心不动则不痛 提交于 2020-01-07 06:59:30
问题 I am trying to load Json file into the Titan graph database using gremlin query I got the following queries graph = TitanFactory.open('conf/titan-cassandra-es.properties') g = graph.traversal() g.loadGraphSON('tjson.json.json') I am getting error like No signature of method: org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource.loadGraphSon() is applicable for argument types: (java.lang.String) values: [tjson.json] question is : How to load the Json file 回答1: I assume

How to execute gremlin query with mogwai

橙三吉。 提交于 2020-01-06 19:58:48
问题 Im trying to query a titan db 0.5.4 via mogwai, but when I run the following script i get the error: rexpro.exceptions.RexProScriptException: transaction is not open and I found the same question here P.S there is no tag for mogwai script: #!/usr/bin/env python3 from mogwai.connection import execute_query, setup con = setup('127.0.0.1', graph_name="bio4j", username="re", password="re") results = execute_query("2 * a",params={"a":2}, connection= con) print(results) results = execute_query(

Bulk load data in titan db from nodejs

南楼画角 提交于 2020-01-06 08:13:06
问题 My current scenario is like I have a rabbit mq which gives me the details of the order placed. On the other side I have my titan db (cassandra storage, es index backends and gremlin server). Yet another I have nodejs application which can interact with gremlin server through http api using https://www.npmjs.com/package/gremlin . I am able to make hits to my graph database from here. Now what I am trying to do is load data from rabbit mq into titan db. What I have been able to do till now is

Node Async - Callback was already called - using 2 for loops and an if statement

南楼画角 提交于 2020-01-06 07:27:18
问题 Could someone please explain why I keep seeing the Error: Callback was already called . I feel I have covered all cases - so why would be 'already called': function addVertices(outercallback) { async.forEachLimit(fullData, 25, function (data, innercallback) { myJson.matches.forEach(function (oMatches) { if (data.$.id == oMatches.SourceId) { oMatches.Ids.forEach(function (oId) { client.execute("g.addV('test').property('id', \"" + oId + "\")", {}, (err, results) => { if (err) { return

Error when launching the graph (DSEGraphFrame )

﹥>﹥吖頭↗ 提交于 2020-01-06 06:09:56
问题 I have a dse graph in validation/prod environement. The problem occurs when I try to launch a DSEGraphFrame query using Spark in Scala. val graph = spark.dseGraph("my_graph") generates the following exception: Exception in thread "main" com.datastax.driver.core.exceptions.InvalidQueryException: The method DseGraphRpc.getSchemaBlob does not exist. Make sure that the required component for that method is active/enabled at com.datastax.driver.core.exceptions.InvalidQueryException.copy

Is there a Gremlin NULL keyword or something similar that isn't a traversal step?

杀马特。学长 韩版系。学妹 提交于 2020-01-06 04:52:46
问题 Problem I've been optimizing the performance of our app that's built on graph (Gremlin API on Cosmos DB) and I've been generally having a bad time of it. After quite a lot of digging, I realize that a bunch of the pain is being caused by unneeded traversal processing. If I want to get all foo vertices along with any bar edges that those edges may have (think left join from SQL), I would write the following in Gremlin: g.V().hasLabel("foo").as("foos"). coalesce(out("bar"),constant()).as("bars"