Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-17-2021 03:57 AM
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
ConceptService.java
ConceptRepository.java
The error...
what am I doing wrong?
How do I get the node list from Concept2 nodes?
Concept1 <- [: broader] - Concept2
Thanks in advance
Regards
Guille
03-17-2021 04:41 AM
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
03-17-2021 09:32 AM
Thank you very much for answering
Regards
03-17-2021 09:38 AM
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.
All the sessions of the conference are now available online