[prev] 131 [next]

Example Graph Queries (cont)

Example: pairs of Persons related by the "parent" relationship

SPARQL:

PREFIX p: <http://www.people.org/>
SELECT ?X ?Y
WHERE { ?X p:parent ?Y }

Cypher:

MATCH (person1:Person)-[:parent]->(person2:Person)
RETURN person1, person2