but for graphs MATCH (user)-[:friend]->(follower) WHERE user.name IN ['Joe', 'John', 'Sara', 'Maria', 'Steve'] AND follower.name =~ ’S.*' LIMIT 5 RETURN user.name, follower.name
E S MATCH ()-[r:ACTED_IN]->() RETURN r MATCH (gene:Person)-[:ACTED_IN]->(m), (other)-[:ACTED_IN]->(m) WHERE gene.name="Gene Hackman" RETURN DISTINCT other; MATCH (a:Person)-[:ACTED_IN]->(m) RETURN a.name, count(m) ORDER BY count(m) DESC LIMIT 10; MATCH (tom:Person)-[:ACTED_IN]->()<-[:ACTED_IN]-(a:Person) WHERE tom.name="Tom Hanks" AND a.born < tom.born RETURN a.name;
}), p = shortestPath((kevin)-[*..15]-(al)) RETURN p MATCH p=shortestPath((kevin:Person)-[r:ACTED_IN*]-(actor)) WHERE kevin.name='Kevin Bacon' AND actor.name='Al Pacino' RETURN length([m in nodes(p) WHERE m:Movie]) as BaconNumber, [m in nodes(p) WHERE m:Movie | m.title] as Movies, [a in nodes(p) WHERE a:Person | a.name][1..-1] as KnowsActors