I am trying to use the newest Game of Thrones dataset from the sandbox graph data science to get the shortest path only to season 3 nodes and relationships. I tried:
match (p:Person)-[r:INTERACTS]->(q:Person) where r.book=3 with p as a, q as b
match pa = shortestPath((a)-[:INTERACTS*]-(b)) where id(a) > id(b)
return length(pa) as len, extract(x IN nodes(pa) | x.name) as path order by len desc limit 5
I first filter the nodes and relationships to season 3 only but 'a' and 'b' are closely connected, so the result lengths are all 1. I wonder if there is a way to finish this task. I also try filter r in shortestPath but it took too long and the sandbox failed to execute.