graph
graph copied to clipboard
Practical Gremlin - An Apache TinkerPop Tutorial
An example along these lines would be useful to add. ``` gremlin> g.V('3').valueMap().as('vm').unfold().filter(select(keys).is(without('city','desc'))) ==>country=[US] ==>code=[AUS] ==>longest=[12250] ==>elev=[542] ==>icao=[KAUS] ==>lon=[-97.6698989868164] ==>type=[airport] ==>region=[US-TX] ==>runways=[2] ==>lat=[30.1944999694824]
The section titled "Pattern matching using a where step" is really about combining `where` and `as` steps so the name of the section should probably be something like "Pattern matching...
Since the original manuscript was written, it has become more common for graph databases to index labels. It's probably a good time to revise the wording in section "3.9. Working...
Add a short discussion of cases where the `RepeatUnrollStrategy` does not apply. The most important one being to understand that: ``` g.V().has('code','AUS'). repeat(out().dedup()). times(7). path(). by('code') [AUS,YYZ,YUL,YGL,YPX,AKV,YIK,YZG] [AUS,YYZ,CPH,SFJ,JAV,JUV,NAQ,THU] [AUS,YYZ,YTS,YMO,YFA,ZKE,YAT,YPO] ```...
Add an example that includes a `repeat` step such as shown below to section 4.12.3 gremlin> g.V(3).repeat(flatMap(outE().has('dist',gt(2000)).inV())).times(2).path().limit(1) ==>[v[3],v[49],v[334]]
Should add notes showing some alternative approaches that use shorter queries if all you want is to find the path. ``` gremlin> g.V('3').repeat(out().where(without('a')).store('a')).times(7).path().by('code') ==>[AUS,ATL,YUL,YGL,YPX,AKV,YIK,YZG] ==>[AUS,BOS,CPH,SFJ,JAV,JUV,NAQ,THU] ==>[AUS,YYZ,YTS,YMO,YFA,ZKE,YAT,YPO] gremlin> g.V('3').repeat(out().dedup()).times(7).path().by('code') ==>[AUS,ATL,YUL,YGL,YPX,AKV,YIK,YZG] ==>[AUS,BOS,CPH,SFJ,JAV,JUV,NAQ,THU]...
``` g.withSideEffect("m",mean).withSideEffect("c",count).V().hasLabel('airport').values('runways').math('(_ - m)^2').sum().math('_ / c').math('sqrt(_)') No such property: mean for class: groovysh_evaluate Type ':help' or ':h' for help. Display stack trace? [yN] ``` 3.29.6. Calculating a standard deviation
Both GraphSON and native Traversal traversals can be converted back to text strings quite easily using the Java/Groovy client libraries. However the steps involved are not simple to figure out...
Need to add an example where a property is dropped inside a side effect before a different property is added as this seems to be a pattern people find useful.
Need to add an example along these lines ``` gremlin> g.V(50,8).values('city').as('c').V().filter(values('desc').where(TextP.containing('c'))).values('desc') ==>London Heathrow ==>London Gatwick ==>London City Airport ==>London Stansted Airport ==>London Luton Airport ==>London Southend Airport ==>London Airport ==>Dallas/Fort...