0

I have two Decision node - parent and child.

I have implemented following method that returns path between these nodes.

@Query("MATCH path=(d:Decision)<-[:CONTAINS*]-(ancestorD:Decision) WHERE id(d) = {decisionId} AND id(ancestorD) = {ancestorDecisionId} RETURN path LIMIT {limit}")
List<Path> findPathsFromDecisionToAncestorDecision(@Param("decisionId") Long decisionId, @Param("ancestorDecisionId") Long ancestorDecisionId, @Param("limit") Integer limit);

In SDN 3.4.4.RELEASE and Neo4j 2.3.3 for direct parent and child it reutrns 1 path.

Right now in Neo4j 3.0.1 and SDN 4.1.1.RELEASE it returns 0 path.

Is it okay or this query should be rewrited ?

Luanne
  • 19,145
  • 1
  • 39
  • 51
brunoid
  • 2,121
  • 2
  • 12
  • 22

1 Answers1

3

There is no concept of a Path in SDN 4, just hydrated nodes that reference other nodes via relationships.

Your options here are to return nodes and relationships and traverse the object graph (see http://graphaware.com/neo4j/2016/04/06/mapping-query-entities-sdn.html for examples), or, if you want a strict path, use the underlying GraphDatabaseService (available if you use the embedded driver) and deal with raw nodes and relationships.

Luanne
  • 19,145
  • 1
  • 39
  • 51