johnsonfoo / fyp-java-spring-data-neo4j

Spring Boot Application using Spring Data Neo4j for querying data stored in Neo4j
2 stars 0 forks source link

Limit depth of relationship returned for REST APIs #95

Open johnsonfoo opened 2 years ago

johnsonfoo commented 2 years ago

Currently, if A - Calls -> B - Calls -> C, we will get the following JSON response if we lookup information for node A.

{
   "name":"A",
   "called":[
      {
         "name":"B",
         "called":[
            {
               "name":"C",
               "called":[

               ]
            }
         ]
      }
   ]
}

If the relationship path traversed is very long, then JSON response will be very large as well. Thus, we wish to limit the depth of nodes traversed in order to reduce size of JSON response.

johnsonfoo commented 2 years ago

Similar to link and link. Community mentions solving by either:

  1. Creating own cypher statements to fetch portions needed
  2. Use projection (and multi-level projections) for defining what to fetch