gremlin

gremlin python - add multiple but an unknown number of properties to a vertex

时间秒杀一切 提交于 2019-12-13 16:43:32
问题 I want to add more than one property to a vertex, but from the outset do not explicitly know what those properties might be. For example, say for one person to be added as vertex to the graph, we have the following property dictionary: Person 1 { "id": 1, "first_name": "bob", "age": 25, "height": 177 } Maybe for another vertex to be added, a person has the following properties: Person 2 { "id": 2, "first_name": "joe", "surname": "bloggs", "occupation": "lawyer", "birthday": "12 September" }

Gremlin on Neo4j 2.2.7

怎甘沉沦 提交于 2019-12-13 04:01:04
问题 I need to incorporate the possibility of sending Gremlin scripts to my Neo4j 2.2.7 DB so I tried to install the thinkaurelius neo4j plugin by using one of the prebuilt releases. Unfortunately I guess those releases were built for older Neo4j versions (2.1.6) and, as a result, I got this error when I tried to start Neo4j from my Windows machine with Java 8: Starting Neo4j Server failed: javax.servlet.ServletException: org.neo4j.server.web.NeoServletContainer-e1dd969@ae4c07fc==org.neo4j.server

Is it possible to tell whether a Gremlin Drop() step did anything?

不问归期 提交于 2019-12-13 03:47:43
问题 I have a traversal that ends with a drop() to delete a vertex. I would like to be able to tell the difference between the drop() removing a vertex and the traversal just not matching anything. I tried adding an alias to one of the earlier nodes and select()ing it at the end of the traversal, but that doesn't return anything even when the traversal does match the graph. e.g. g.V('id', '1').as('flag') .out('has_child') .drop() .select('flag') .toList() 回答1: The trick is that drop() is a filter

Get Gremlin query as a String and execute it in java without submitting it to the GremlinServer

社会主义新天地 提交于 2019-12-13 03:39:06
问题 I have a Gremlin query in the String format (for example "g.V()"). I want to execute this String without submitting it to the GremlinServer. I use the below dependency: <dependency> <groupId>org.apache.tinkerpop</groupId> <artifactId>gremlin-driver</artifactId> <version>3.3.1</version> </dependency> Is there any way? 回答1: You can execute Gremlin string directly in GremlinGroovyScriptEngine or through the GremlinExecutor (which just passes the string to the GremlinGroovyScriptEngine but has

gremlinpython - How do you select(keys) in a graph_traversal?

痴心易碎 提交于 2019-12-13 03:34:30
问题 In this stackoverflow question a suggestion was made to use the query supplied in the first answer to do a particular gremlin_python traversal. Namely g.V().has('name', 'USA').limit(1000).hasLabel('Country'). map(union(project('id','label'). by(id). by(label), valueMap()).unfold(). group(). by(keys). by(select(values))) I am able to import all but "keys" from the gremlin_python graph traversal library like the following from gremlin_python.process.graph_traversal import union, project,

Gremlin: how can I return vertex and their associated vertex?

故事扮演 提交于 2019-12-13 03:09:50
问题 I Need to return some groups and people in that group, like this: Group A -----Person A -----Person B -----Person C Group B -----Person D -----Person E -----Person F How can I do that with gremlin. They are connected to group with a edge. 回答1: It is always helpful to include a sample graph with your questions on Gremlin preferably as a something easily pasted to the Gremlin Console as follows: g.addV('group').property('name','Group A').as('ga'). addV('group').property('name','Group B').as('gb

Gremlin - select a vertex, create new vertices and edges in single query

陌路散爱 提交于 2019-12-13 02:48:23
问题 I have a user vertex already created. g.V().has('user','username','vipul').as('user') I want to create a new 'group' vertex with some properties and also a new 'options' vertex with some other properties. g.addV(label,'group','group_name','DC11').as('group') g.addV(label,'options','command_line_arguments','-D -n').as('options') Now I want to create an edge from user to group and another edge from group to options. user ---> group, group ---> options Can these queries be combined, selecting a

Gremlin doesn't start up while connecting to cassandra

感情迁移 提交于 2019-12-13 02:17:18
问题 I have my Titan 1.0.0 and cassandra 2.1.2 setup running fine in my linux. When i start my gremlin using, ./gremlin.sh ../conf/gremlin-server/gremlin-server-cassandra-es.yaml I get the following error: \,,,/ (o o) -----oOOo-(3)-oOOo----- plugin activated: aurelius.titan plugin activated: tinkerpop.server plugin activated: tinkerpop.utilities SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/home/ec2-user/titan/titan-1.0.0- hadoop1/lib/slf4j-log4j12-1.7.5

How to efficiently create a vertex with a label and several properties?

不打扰是莪最后的温柔 提交于 2019-12-13 02:05:26
问题 I want to create a vertex with a given label and some properties. Since the g.addVertexWithLabel() method only takes the label as an argument and I cannot find any v.addLabel() method, it seems that I have to add the properties one by one after creating the vertex. Or am I missing something here? 回答1: No. As of Titan 0.5.4, there is no API that allows you to add it all at once. In fact, even the Gremlin Groovy sugar of: g.addVertex([name:"stephen"]) just calls Element.setProperty(k,v) for

Could not load file or assembly 'System.Reflection.TypeExtensions, Version=4.0.0.0' when using Gremlin.NET in Azure Functions

点点圈 提交于 2019-12-13 01:26:21
问题 I want to update an Azure CosmosDB Graph from Azure Functions with Gremlin.NET. I'm using 1.0.10 Functions Cli, .NET Framework 4.7.1 and a project with these dependencies: <PackageReference Include="Gremlin.Net" Version="3.3.2" /> <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DocumentDB" Version="1.2.0" /> <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DurableTask" Version="1.2.2-beta3" /> <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.13"