I am new to neo4j can you please help to write a cypher query for the following subgraph. We are using neo4j.3.5.x version.
A--->next--->S1<----Has-----S
A--->.next---->S2<-----Has----S
B--->next--->T1<----Has-----T
B--->next--->T2<----Has-----T
B--->.next---->M1<-----Has----M
I need B node because which connected differnt END nodes T,M.
rushikesh
(Rushikesh Chaudhari)
2
@rayapatir4, do you want to create a graph or you want to search node B?
I need find query.I need B node as it participated in 2 different end nodes T,M
cobra
(Cobra)
4
Hello @rayapatir4
A request in the same style could do the job (you can add a Label to nodes):
MATCH (a)-[:NEXT]->()<-[:HAS_INSTANCE]-(c)
WITH a, count(DISTINCT c) AS nb_nodes
WHERE nb_nodes >= 2
RETURN a
Regards,
Cobra
1 Like
@cobra,
Thank you for your quick help. Its working as expected.
cobra
(Cobra)
6
No problem :) I'm happy to hear it