cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

SDN6 does not return a list of related nodes (java)

Hi all,
I have created an endpoint that runs a custom query to get a list of nodes from which I need to get all the parents of each of these. I am using SDN6 with neo4.1.

I try to find all parents from cp node ("Concept")

(cp:Concept)<-[r:broader]-(:Concept)

this is the model

this the code:

ConceptEntity.java
3X_9_8_98e18091980a94e058cb3a3890d4affd4d624f3a.png

ConceptService.java
3X_f_1_f1a8927c7e12855e796dd84d0154c51a978e5e53.png

ConceptRepository.java
3X_1_e_1e6cba5dbd4ee6ee5d7016f5ba3211a2a44d76d2.png

The error...
3X_3_6_36e7ad8bc1a4207bf582299e1e470bd40d6c1256.png

what am I doing wrong?
How do I get the node list from Concept2 nodes?

Concept1 <- [: broader] - Concept2

Thanks in advance
Regards
Guille

3 REPLIES 3

With custom cypher query you have to also return the relationship (broader) and other Concept nodes. Otherwise you will just have the cp to get mapped by SDN.

The statement should look somehow like:

match (cp:Concept)<-[b:broader]-(otherCp:Concept)
where ....
return cp, collect(b), collect(otherCp)

If you want to know more about custom queries in general: Spring Data Reference Documentation / Custom queries

Thank you very much for answering
Regards

Can you share the code around
movies.spring.data.neo4j.api.ConceptController.lambda$1(ConceptController.java:56) ?
At least it seems that the data gets queried and returned from the framework to your controller.