We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add examples of using K,V pairs to see a traversal that will create vertices and or edges along the lines of:
nodes = [ ["name": "Kim", "breed": "Beagle"], ["name": "Max", "breed": "Mixed"], ["name": "Toby", "breed": "Golden Retriever"]] gremlin> g.inject(nodes).unfold().as("nodes"). ......1> addV("dog").as("new_node"). ......2> sideEffect(select('nodes').unfold().as('kv'). ......3> select('new_node'). ......4> property( select('kv').by(Column.keys), ......5> select('kv').by(Column.values))). ......6> id().toList() ==>9 ==>12 ==>15 gremlin> g.V().valueMap().with(WithOptions.tokens) ==>[id:9,label:dog,name:[Kim],breed:[Beagle]] ==>[id:12,label:dog,name:[Max],breed:[Mixed]] ==>[id:15,label:dog,name:[Toby],breed:[Golden Retriever]] g.inject(['age':28,'name':'Bob']).as('data'). addV('Person').as('new'). select('data').unfold().as('props'). select('new'). property(select('props').select(keys),select('props').select(values))
Also an example of adding edges given a set of IDs
gremlin> g.inject([[a:1,b:2],[a:5,b:6]]). ......1> unfold().as('p'). ......2> addE('test'). ......3> from(V().as('v').where(eq('v')).by(select('p').select('a')).by(id)). ......4> to(V().as('v').where(eq('v')).by(select('p').select('b')).by(id)) ==>e[61286][1-test->2] ==>e[61287][5-test->6]
Should also show how to use coalesce to create a merge pattern such as:
coalesce
gremlin> g.inject([['code':'AUS'],['code':'XYZ'],['code':'SFO']]). ......1> unfold().as('data'). ......2> coalesce(V().hasLabel('airport'). ......3> where(eq('data')). ......4> by('code'). ......5> by(select('code')), ......6> addV('airport'). ......7> property('code',select('code'))) ==>v[3] ==>v[61286] ==>v[23]
The text was updated successfully, but these errors were encountered:
The work to resolve this issue should probably positioned to new coverage of mergeV and mergeE once created.
mergeV
mergeE
Sorry, something went wrong.
krlawrence
No branches or pull requests
Add examples of using K,V pairs to see a traversal that will create vertices and or edges along the lines of:
Also an example of adding edges given a set of IDs
Should also show how to use
coalesce
to create a merge pattern such as:The text was updated successfully, but these errors were encountered: