Is there an easy way to replace or merge vertices and keep/merge existing edges? Or just manually copy all properties from the vertex and recreate existing edges and all (meta-)properties and then drop the superfluous vertex?
相关问题
- Is there a document about how gremlin 'match()
- Gremlin Python in Web Application
- How to connect Gremlin Server to a remote Neo4j Da
- Limit number of items in group().by() in gremlin q
- Merging maps in Gremlin
相关文章
- How to add vertices to gremlin server in a batch f
- How to use ElasticSearch index in Titan Gremlin qu
- Gremlin remote command fails with timeout error: H
- How do I connect to a remote Neo4j database using
- How to delete graph in Titan with Cassandra storag
- Unable to create a composite index, stuck at INSTA
- Can RDF model a labeled property graph with edge p
- Getting vertices that are connected to ALL current
Alright, as mentioned in the comments above, you're going to do the matching in OLTP. That means you'll likely have a concrete entry point. Let's make up a simple sample graph:
To match vertices based on login
dkuppitz
and merge them into a single user vertex:I know, the query is crazy complicated, especially with the deeply nested lambdas. But unfortunately there's no way around the lambdas, since we don't have an
addE(<traversal>)
overload (I created a ticket though). Anyway, after executing the query above, the graph looks like this:Both
dkuppitz
vertices were merged into one (name
andage
properties are present) and the 2 edges were recreated accordingly.UPDATE:
With TINKERPOP-1793 we can get rid of all lambdas: