Skip to content

Instantly share code, notes, and snippets.

@thomasfr
Forked from peterneubauer/Subcategories.adoc
Created September 18, 2013 13:18
Show Gist options
  • Save thomasfr/6609029 to your computer and use it in GitHub Desktop.
Save thomasfr/6609029 to your computer and use it in GitHub Desktop.

Vienna is cool

First, let’s rock

CREATE (getr{name:'C1'})
CREATE (alc{name:'C2'})
CREATE ({caption:'beverages', lang:'EN'})<-[:CAPTION]-(getr)
CREATE (getr)-[:CAPTION]->({caption:'Getraenke', lang:'DE'})
CREATE ({caption:'alcoholic stuff', lang:'EN'})<-[:CAPTION]-(alc)
CREATE (alc)-[:CAPTION]->(alc_de{caption:'Alkoholika', lang:'DE'})
CREATE (getr)<-[:IS_A]-(alc)
CREATE ({name:"Wein"})-[:TAGGED]->(alc_de)

Find English things that are beverages

MATCH (bev_caption)<-[:CAPTION]-bev<-[:IS_A*0..]-(cat)-[:CAPTION]-(caption)
WHERE bev_caption.caption = 'beverages' AND caption.lang='DE'
RETURN bev_caption.caption, caption.caption
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment