http://neo4j.com/download/
a pattern-matching query language for graphs
MATCH (m:Movie)
WHERE m.released=1992
RETURN m
MATCH (m:Movie), (p: Person)
MATCH path=(m)<-[:ACTED_IN]-(p)
WHERE m.released=1992
return path
MATCH (m:Movie), (p: Person {name: "Tom Hanks"})
MATCH (p)-[:DIRECTED]->(m)
return m
MATCH (m:Movie)<-[:ACTED_IN]-(a:Person)
RETURN m.title as movie, collect(a.name) as cast
LIMIT 20
MATCH (p: Person {name: "Tom Hanks"})
MATCH (p)-[:DIRECTED]->(m:Movie)
WITH distinct m
return count(m)
MATCH (category:Category{id:'5294ecd1389a5e44303bd774'})
MATCH (category)-[:CHILD_OF*0..50]->(subcats: Category)<-[:PHOTO_OF]-(photo: Photo)
with photo
order by photo.created_at
return last(collect(photo.id)) as last_photo_id
MATCH (cat_user:User {id:"51e52cfc389a5e35fa403436"}),
(category:Category)
WHERE category.parent_id='0'
MATCH (category)-[:CHILD_OF*0..50]->(subcats)
WITH distinct subcats as dsubcats, category, cat_user
MATCH (dsubcats)<-[:PHOTO_OF]-(photo:Photo)-[:OWNER]->(cat_user)
with photo, category, cat_user
order by photo.created_at
return distinct category.id, last(collect(photo.id)) as last_photo_id, count(distinct photo) as photo_count, category.name
GIVE ME THE PHOTOS CONNECTED TO PLACES NEAR LAT 22.7 LON 79.10
START place=node:geom('withinDistance:[22.7, 79.10, 100.0]')
where place.type='Place'
MATCH (place)-[:CHILD_OF*0..50]->(subplaces:Place)
with distinct subplaces, place
MATCH (subplaces)<-[:TAKEN_AT]-(photo:Photo)
return place.name, photo
GIVE ME THE COUNT OF PHOTOS IN NORTH AMERICA FOR WILD ANIMALS
MATCH (place: Place{id: '5571b6a691201b05075468f8'})
MATCH (category: Category{id: '529500b0389a5e442fd8fcad'})
MATCH (place)-[:CHILD_OF*0..10]->(subplaces)<-[:TAKEN_AT]-(photo:Photo)
MATCH (category)-[:CHILD_OF*0..10]->(subcategories: Category)<-[:PHOTO_OF]-(photo: Photo)
return count(distinct photo)