Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
07-19-2021 04:06 AM
Hi All
can't figure out how to exclude child from result select , if both parent and child are selected using where clause .
parent is having incoming relationship from child and child/parent are same type of nodes .
MATCH (area:AREA
)-[r1:CONTAINS
]-> (p:Data
)-[r2:CONTAINS]->(c:Values
) optional MATCH (area:AREA
)-[r3:CONTAINS
*]->
(child:AREA
) WITH area,p,child,collect(c) AS children WHERE ALL (c IN children WHERE c.y < 53 AND c.x >10)
return area,p,children,child
Test is selected only if the all values are in certain range . if the parent (AREA) is selected, Child area should be excluded , even if its values fall under same range.
Could you please suggest a solution?
thanks
sunil
07-21-2021 12:48 PM
MATCH (area:AREA)-[r1:CONTAINS]-> (p:Data)-[r2:CONTAINS]->(c:Values)
optional MATCH (area)-[r3:CONTAINS*]->(child:AREA)
WHERE c.y < 53 AND c.x >10
WITH area,p,child,collect(c) AS children
return area,p,children,child
You seems to store values about an area as separate nodes. This is not a healthy design.
Cheers
Benoit
07-25-2021 09:51 PM
(Area)->(polygon)->(coordinate)
type of area are different example (polygon ,circle,point, etc) so we can't have value in area .
MATCH (area:AREA)-[r1:CONTAINS]-> (p:Circle)-[r2:CONTAINS]->(c:coordinates)
optional MATCH (area)-[r3:CONTAINS*]->(child:AREA) WHERE c.y < 53 AND c.x >10
need to select only circles fall inside range , so child area which contain inside parent one should be excluded .
07-26-2021 06:55 AM
I presume you will have to compute first which shape is including/covering an other shape and define this way stable relations which you can query.
(a:Shape)-[:IS_COVERING]->(b:Shape)
I can't imagine you can compute and query at the same time.
(have a look at "A ROBUST ALGORITHM TO DETERMINE SURFACE/SURFACE
INTERSECTION IN BOTH PARAMETRIC SPACES " Teiseira/Creus)
All the sessions of the conference are now available online