tinkerpop

GraphFactory message: GraphFactory could not instantiate this Graph implementation [com.thinkaurelius.titan.core.TitanFactory]

╄→гoц情女王★ 提交于 2019-12-12 03:48:45
问题 I'm trying to make graph queries via a gremlin-shell to a Cassandra backend (locally or remotely). I downloaded a stock Gremlin Server distribution and then installed Titan (as described here in the manual-installation). http://s3.thinkaurelius.com/docs/titan/0.9.0-M1/server.html I added all the property settings and classpath : ~/gremlin-server-3.0.0.M6$ cat conf/titan-cassandra.properties gremlin.graph=com.thinkaurelius.titan.core.TitanFactory storage.backend=cassandrathrift storage

Gremlin drop() isn't working via java api

自闭症网瘾萝莉.ら 提交于 2019-12-12 02:52:53
问题 I'm using titan db 1.0.0 backed by a local dynamodb instance (which uses the 3.0 tinkerpop stack). I've spent more time than I'd like to admit trying to figure out why drop() wasn't working. In my use case I'm trying to remove a specific edge found via a traversal, but even graph.traversal().V().drop() wasn't working. I did much googling, but perhaps not with the right keywords. I finally figured out the issue which I'll specify in my answer. Hopefully others find this useful. 回答1: I finally

Gremlin - adding new vertex if it exceeds the limit

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 17:45:45
问题 Sample data: I have two vertices by names User , Points First adding data for vertex User g.addV('User').property('id',1). addV('User').property('id',2). addV('User').property('id',3).iterate() Now adding Points vertices and connecting addingPoints Edge from User to Points g.V().hasLabel('User').has('id',1).as('curUser1'). V().hasLabel('User').has('id',2).as('curUser2'). V().hasLabel('User').has('id',3).as('curUser3'). addV('Points').property('totalPoints',0).property('userPoints',0).

Fetching all the paths between two nodes using gremlin in java

↘锁芯ラ 提交于 2019-12-11 13:17:48
问题 Hi I am kinda new to gremlin and trying to achieve some solve by finding all the paths between two nodes. In simple query on gremlin console I was able to do that using this query : (Name of the first Node).loop(1){it.loops<100}{true}.has('name', (Name of the second node)).path{it.name} But while I was trying to fetch that from java methods I am into sea of problems, like: -- no clue on where to put the query exactly ? -- what data structure will be right to receive the array of rows. -- how

Tinkerpop Frames: Query vertices based on interface type

半世苍凉 提交于 2019-12-11 13:05:35
问题 I'm using Tinkerpop Frames to create a set of vertices and edges. Adding a new vertex is simple but retreiving vertices based on type seems a bit difficult. Assume I have a class A and B and I want to add a new one so: framedGraph.addVertex(null, A.class); framedGraph.addVertex(null, B.class); That's straight forward. But what if I want to retrieve all vertices with type A ? Doing this failed, because it returned all vertices (both A and B ). framedGraph.query().vertices(A.class); Is there

Programmatically add global variables to gremlin server

强颜欢笑 提交于 2019-12-11 06:01:19
问题 How do I add global variables to an embedded Gremlin server instance? Also, I want to avoid loading the server configuration from a file, although I can load resources from the classpath. 回答1: getGlobalBindings() on GremlinExecutor is indeed deprecated, but the javadoc explains how you should proceed: replaced by getScriptEngineManager() to add global scoped bindings directly to that object. That comes from the 3.2.5 javadoc when it was originally deprecated in preparation for pretty large

Get edge properties as well as source and target vertex ID in Gremlin query language

*爱你&永不变心* 提交于 2019-12-11 02:49:29
问题 I am trying to retrieve the edge properties as values as well as the target and source node IDs. My current database looks like that: Edge: _id _label _outV _inV name ID 0 edge 0 1 E 0 Nodes: _id _label _name ID 0 node A 0 1 node B 1 I have tried this query: >g.V().as('a').outE('edge').as('b').inV().values('ID').as('to'). select('b').valueMap().as('edge'). select('a').values('ID').as('from'). select('to','edge','from') ==>[to:0,edge:[ID:0,name:E],from:1] What I am trying to get is [to:0,ID:0

Comparing properties in Gremlin

会有一股神秘感。 提交于 2019-12-10 21:46:56
问题 I have a simple graph, with parents and children being vertices. Parents have the relationship "isParentOf" to their children. The vertices all have one property: the "familyName". I want to use gremlin to match all the parents whose child's familyName is different from theirs. Note: I cannot use the Groovy syntax of Gremlin. I must use pure Java code only. 回答1: The GremlinPipeline should look like this: find all parents follow the "isParentOf" relationship and get all the children filter the

Gremlin find highest match

强颜欢笑 提交于 2019-12-10 19:36:59
问题 I am planning to use a Graph Database (AWS Neptune) that can be queried with Gremlin as a sort of Knowledge base. The KB would be used as a classification tool on with entities with multiple features. For simplicity, I am using geometric shapes to code the properties of my entities in this example. Let's suppose I want to classify Points that can be related to Squares, Triangles and Circles. I have blueprint the different possible relationships of Points with the possibles Squares, Triangles

Tinkerpop Gremlin Depth First Search Order

不羁岁月 提交于 2019-12-10 19:07:54
问题 I have a very simple example graph which I am trying to get a depth first query on. Let's say the graph edges look like this A->B A->C B->D B->E C->F C->G A depth first search from A should return A-B-D-E-C-F-G But if I could get the below order it would be even better D-E-B-A-F-G-C-A How can I create a Gremlin query that will output this order? If I do something like this g.V('A').repeat(outE().inV()).emit() I get an order of A,B,C,D,E,F,G which is breadth first. I can't work out how to get