gremlin

Making my titan db graph with cassandra and elasticsearch backend

左心房为你撑大大i 提交于 2019-12-08 08:48:48
问题 My problem is that I want to store Product, customer and seller data in titan graph database which has cassandra as storage backend and elasticsearch as indexing backend. Then I ll be querying that data to make recommendations to both customer and seller. I am not able to get to the point where I can store my own data .Since data is going to be huge I ll be using cassandra and elasticsearch . What I have done so far is that I have cassandra , elasticsearch set up. Now I can run bin/titan.sh

Gremlin query to override the Vertex

瘦欲@ 提交于 2019-12-08 08:03:50
问题 How to write gremlin query which will do Get existing vertex Remove all existing properties(obviously except id, label, index property etc) Add new properties with values(mostly string only) Or is there any alternate way to override the vertex using gremlin query? 回答1: Using the TinkerPop modern graph as an example: gremlin> g.V().has('person','name','marko').valueMap(true) ==>[id:1,label:person,name:[marko],age:[29]] and assuming full Gremlin support you could keep the "name" property (i.e.

Gremlin: Get Edges that were traversed

妖精的绣舞 提交于 2019-12-08 06:33:43
问题 Sample data: TinkerPop Modern Required Data format : {'relation': '['created']', 'id': [10224, 10220], 'title': ['Marko', 'lop']} {'relation': '['knows', 'created']', 'id': [10224, 10226, 10222], 'title': ['Marko', 'Josh', 'ripple']} {'relation': '['knows', 'created']', 'id': [10225, 10224, 10220], 'title': ['Vadas', 'Marko', 'lop']} {'relation': '['knows', 'knows', 'knows', 'created']', 'id': [10225, 10224, 10226, 10222], 'title': ['Vadas', 'Marko', 'Josh', 'ripple']} {'relation': '['created

How to increase performance of shortest path using Gremlin?

余生颓废 提交于 2019-12-08 06:03:53
问题 I'm using JanusGraph with Gremlin and this dataset cotaining 2.6k nodes and 6.6k edges (3.3k edges on both sides). I've run the query for 10 minutes without find the shortest path. Using Gephi the shortest path is almost instantaneous. Here's my query: g.V(687).repeat(out().simplePath()).until(hasId(1343)).path().limit(1) 回答1: With simplePath() your query still processes a lot more paths than necessary. For example, if 688 is a direct neighbor of 687 , but also a neighbor of 1000 , which is

How to execute Gremlin against OrientDB using orientjs?

橙三吉。 提交于 2019-12-08 04:30:24
问题 In Node, what is the correct way to execute Gremlin queries against a database? My current attempt using the Official Node OrientDB Driver: const { ODatabase } = require('orientjs'); const db = new ODatabase({...}); db.query('g.V()') .then(console.log, console.error); And I get: OrientDB.RequestError: Cannot find a command executor for the command request: sql.g.V() DB name="mynevo" at child.Operation.parseError (.../orientjs/lib/transport/binary/protocol33/operation.js:864:13) However, when

Create if not exist Vertex and Edge in 1 query gremlin

你说的曾经没有我的故事 提交于 2019-12-08 03:10:19
问题 I find the following code to create edge if it has not existed yet. g.V().hasLabel("V1") .has("userId", userId).as("a") .V().hasLabel("V1").has("userId", userId2) .coalesce( bothE("link").where(outV().as("a")), addE("link").from("a") ) It works fine but I want to create both vertices and edge if they are not existed in 1 query. I try the following code with new graph, it just create new vertices but no relation between them. g.V().hasLabel("V1") .has("userId", userId).fold() .coalesce( unfold

TitanDB Index not changing state

只谈情不闲聊 提交于 2019-12-07 16:42:40
问题 I wanted to drop an existing index and followed the steps in the documentation so far. I have no separate indexing backend configured for now. However, when I get to the step where you have to wait for the index status to change using m.awaitGraphIndexStatus it waits forever for the change and times out with the following error: GraphIndexStatusReport[success=false, indexName='usernameComposite', targetStatus=DISABLED, notConverged={username=INSTALLED}, converged={}, elapsed=PT1M0.092S] The

Gremlin-Server Add Vertex with Multiple Properties (Titan 1.0.0)

那年仲夏 提交于 2019-12-07 10:21:55
问题 I'm creating a Titan graph (backed by Dynamodb); I'm using Titan 1.0.0 and running Gremlin-Server 3 (on TinkerPop3). I'm trying to add a vertex to my graph with a label and multiple properties in a single line. I'm able to add a vertex with a label and a single property, and I can add multiple properties to a vertex after it has been created, but it seems that I can't do it all at once. For testing I'm running commands in the gremlin shell, but the end use case is interacting with it via REST

Proper handling of date operations in Gremlin

丶灬走出姿态 提交于 2019-12-07 08:42:39
问题 I am using AWS Neptune Gremlin with gremlin_python . My date in property is stored as datetime as required in Neptune specs. I created it using Python code like this: properties_dict['my_date'] = datetime.fromtimestamp(my_date, timezone.utc) and then constructed the Vertex with properties: for prop in properties: query += """.property("%s", "%s")"""%(prop, properties[prop]) Later when interacting with the constructed graph, I am only able to find the vertices by an exact string matching query

Normal JSON to GraphSON format

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-07 07:53:00
问题 I have two questions: Where I can actually find the basic format for a GraphSON file, that is guaranteed to be successfully loaded by the gremlin console? I'm trying to convert a JSON (with about 10-20 fields) to another file that can be queried by gremlin but I can't actually find any relevant information about the fields reserved by the graphson format or how I should handle the IDs etc. I exported the modern graph they provide and it's not even a valid JSON (Multiple JSON root elements),