Skip to content

Instantly share code, notes, and snippets.

@stardustnrust
Last active August 29, 2015 14:06
Show Gist options
  • Save stardustnrust/af08577b5ab7ddb6cc18 to your computer and use it in GitHub Desktop.
Save stardustnrust/af08577b5ab7ddb6cc18 to your computer and use it in GitHub Desktop.
Neo4J queries
Queries for Divinity Data
MATCH (person)-[r:WROTE]->(article)
WITH article
MATCH (article)-[r:ISABOUT]->(topic)
RETURN *
MATCH (a)-[r:WROTE]->(article)
RETURN r AS rels,article.title
MATCH (a)-[r:WROTE]->()
RETURN r AS rels
MATCH (person)-[:WROTE]->(article)
WITH article
MATCH (article)-[r:ISABOUT]->(topic)
RETURN topic.name
MATCH (person)-[:WROTE]->(article)
WITH person,article
MATCH (article)-[r:ISABOUT]->(topic)
RETURN person.name, topic.name
MATCH (person)-[:WROTE]->(article)
WITH person,article
MATCH (article)-[r:ISABOUT]->(topic)
RETURN person.name AS Name, collect(topic.name)AS Topics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment