gremlin

gremlin intersection operation

感情迁移 提交于 2020-06-28 05:16:09
问题 I'm using the gremlin console v3.3.1. Using the "Modern" graph from the tutorial: http://tinkerpop.apache.org/docs/current/tutorials/getting-started/ Creating the graph with this: gremlin>graph = TinkerFactory.createModern() gremlin>g = graph.traversal() I can find all the people that know "vadas" like this: g.V().hasLabel('person').has('name', 'vadas').in('knows').hasLabel('person').valueMap() And I can find all the people that created the software "lop" with this: g.V().hasLabel('software')

Displaying sub-levels in gremlin query

天涯浪子 提交于 2020-06-28 04:11:40
问题 I have the graph as shown in the figure below. The numbers represent the level format of the node which is required as output from the gremlin query along with the properties of the nodes. The graph structure can change that is more nodes can be added to the graph. The level must be returned in a similar format for additional nodes. For example, children of 1.1.1 should return the level as 1.1.1.1,1.1.1.2 ... The following query but the level is in continuous format 1,2,3 ... g.withSack(0). V

Displaying sub-levels in gremlin query

那年仲夏 提交于 2020-06-28 04:11:08
问题 I have the graph as shown in the figure below. The numbers represent the level format of the node which is required as output from the gremlin query along with the properties of the nodes. The graph structure can change that is more nodes can be added to the graph. The level must be returned in a similar format for additional nodes. For example, children of 1.1.1 should return the level as 1.1.1.1,1.1.1.2 ... The following query but the level is in continuous format 1,2,3 ... g.withSack(0). V

Tinkerpop Gremlin Console: java.lang.NoSuchMethodError: org.apache.tinkerpop.gremlin.driver.RequestOptions$Builder.userAgent

给你一囗甜甜゛ 提交于 2020-06-17 09:34:08
问题 As my last post at 403 Forbidden error for Gremlin to AWS Neptune, I could successfully connect to my Neptune Cluster DB via my Tinkerpop Gremlin console v 3.4.3 that installed at my EC2 instance as v 3.4.1 suggested at https://docs.aws.amazon.com/neptune/latest/userguide/iam-auth-connecting-gremlin-console.html didn't work for me. \,,,/ (o o) -----oOOo-(3)-oOOo----- plugin activated: tinkerpop.server plugin activated: tinkerpop.utilities plugin activated: tinkerpop.tinkergraph gremlin>

'Or' operator for node properties in Gremlin assigned to one subgraph

半腔热情 提交于 2020-06-16 19:26:06
问题 I have a Janusgraph database which contains nodes with the label 'Paper', the node properties 'paperTitle' and 'year' and the edge type 'References'. I'm trying to write a query that will allow me to select two papers by title and all their references and assign that result to a subgraph. I can select one paper using two conditions like this: sg = g.V(). and(has('Paper', 'paperTitle', 'ladle pouring guide'), has('Paper', 'year', '1950')). inE('References'). subgraph('sg1'). cap('sg1'). next()

'Or' operator for node properties in Gremlin assigned to one subgraph

纵饮孤独 提交于 2020-06-16 19:23:19
问题 I have a Janusgraph database which contains nodes with the label 'Paper', the node properties 'paperTitle' and 'year' and the edge type 'References'. I'm trying to write a query that will allow me to select two papers by title and all their references and assign that result to a subgraph. I can select one paper using two conditions like this: sg = g.V(). and(has('Paper', 'paperTitle', 'ladle pouring guide'), has('Paper', 'year', '1950')). inE('References'). subgraph('sg1'). cap('sg1'). next()

'Or' operator for node properties in Gremlin assigned to one subgraph

一笑奈何 提交于 2020-06-16 19:22:16
问题 I have a Janusgraph database which contains nodes with the label 'Paper', the node properties 'paperTitle' and 'year' and the edge type 'References'. I'm trying to write a query that will allow me to select two papers by title and all their references and assign that result to a subgraph. I can select one paper using two conditions like this: sg = g.V(). and(has('Paper', 'paperTitle', 'ladle pouring guide'), has('Paper', 'year', '1950')). inE('References'). subgraph('sg1'). cap('sg1'). next()

Merging maps in Gremlin

你说的曾经没有我的故事 提交于 2020-06-15 04:35:13
问题 I'm trying to write a single query that satisfies two requirements in the response object: Must include all properties of a vertex, without specifying individual fields in the query. Must flatten results at the same level on the object. As separate queries, I can do: 1. valueMap query g.V(1) .valueMap().by(unfold()).fold() Response: { "property1": "value1", "property2": "value2" } 2. project query g.V(1) .project("projectedProperty") .by(out("X").valueMap().by(unfold()).fold()) Response: {

Merging maps in Gremlin

混江龙づ霸主 提交于 2020-06-15 04:35:10
问题 I'm trying to write a single query that satisfies two requirements in the response object: Must include all properties of a vertex, without specifying individual fields in the query. Must flatten results at the same level on the object. As separate queries, I can do: 1. valueMap query g.V(1) .valueMap().by(unfold()).fold() Response: { "property1": "value1", "property2": "value2" } 2. project query g.V(1) .project("projectedProperty") .by(out("X").valueMap().by(unfold()).fold()) Response: {

What is the equivalent of the gremlin queries in gremlin javascript?

妖精的绣舞 提交于 2020-05-30 08:23:46
问题 How can I write the 3 gremlin queries below with gremlin javascript, please? gremlin> g.V.filter{it.name.matches(".*ark.*")}.name g.V().filter({ it.getProperty("name").contains("ark") }) g.V().filter(label().is('person')) 回答1: filter() traversal method expects a predicate or a traversal. Predicates using lambdas are not yet supported on the JavaScript GLV, I've filed a ticket for it: https://issues.apache.org/jira/browse/TINKERPOP-2001 const gremlin = require('gremlin'); const __ = gremlin