Last active
December 17, 2015 17:08
-
-
Save rvanbruggen/5643349 to your computer and use it in GitHub Desktop.
Beergraph with in-graph index
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*** | |
*** SHOW ME THE IN-GRAPH-ALCOHOLINDEX | |
*** | |
start | |
alcperc=node:node_auto_index(type="AlcoholPercentage") | |
match | |
p=(alcperc-[:PRECEDES]->()) | |
return p; | |
start | |
minalcperc=node:node_auto_index(name="0"), | |
maxalcperc=node:node_auto_index(name="26.5") | |
match | |
p = (minalcperc-[:PRECEDES*]-maxalcperc) | |
return p; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*** | |
*** FINDING other beers that have a "same or similar" AlcoholPercentage as Orval | |
*** | |
start | |
orval=node:node_auto_index(name="Orval") | |
match | |
orval-[:IS_A]-beertype, | |
orval-[:HAS_ALCOHOL_PERCENTAGE]-alcperc, | |
alcperc-[:PRECEDES*0..10]-otheralcperc, | |
otherbeer-[:HAS_ALCOHOL_PERCENTAGE]-otheralcperc, | |
otherbeer-[:IS_A]-beertype, | |
otherbeer-[:BREWS]-otherbrewery | |
return | |
otherbeer.name, beertype.name, otherbrewery.name; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*** | |
*** FINDING other beers that have a "similar but not the same" AlcoholPercentage as Orval | |
*** | |
start | |
orval=node:node_auto_index(name="Orval") | |
match | |
orval-[:IS_A]-beertype, | |
orval-[:HAS_ALCOHOL_PERCENTAGE]-alcperc, | |
alcperc-[:PRECEDES*1..10]-otheralcperc, | |
otherbeer-[:HAS_ALCOHOL_PERCENTAGE]-otheralcperc, | |
otherbeer-[:IS_A]-beertype, | |
otherbeer-[:BREWS]-otherbrewery | |
return | |
otherbeer.name, beertype.name, otherbrewery.name; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*** | |
*** Finding the other beers from the same brewery that have a similar AlcoholPercentage as duvel | |
*** | |
start | |
duvel=node:node_auto_index(name="Duvel") | |
match | |
duvel-[:BREWS]-brewery, | |
duvel-[:IS_A]-beertype, | |
duvel-[:HAS_ALCOHOL_PERCENTAGE]-alcperc, | |
alcperc-[:PRECEDES*1..10]-otheralcperc, | |
otherbeer-[:HAS_ALCOHOL_PERCENTAGE]-otheralcperc, | |
otherbeer-[:IS_A]-otherbeertype, | |
otherbeer-[:BREWS]-brewery | |
return | |
otherbeer.name, otherbeertype.name, brewery.name, otheralcperc.name | |
order by | |
otherbeer.name; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment