Hi everybody,

I am complete beginner with Neo4j and I am trying to do an script which 
find patterns (particular subgraphs) in the Database.
My query looks something like this:

MATCH (Paiting_1:Piece)
MATCH (Red_1:Color)
MATCH (Paiting_2:Piece)
MATCH (Blue_1:Color)
WHERE Red_1.name CONTAINS 'Cherry'
AND Blue_1.name CONTAINS 'Sea'
AND NOT Paiting_1.name CONTAINS Paiting_2.name 
AND (Red_1)-[:IS_IN]->(Paiting_1)
AND (Blue_1)-[:IS_IN]->(Paiting_2)
AND (Paiting_1)-[:IN_SAME_HALL]->(Paiting_2)
RETURN Paiting_1.name,
Paiting_2.name

This query gets me the expected result, but as soon the size of the 
subgraphs I am looking grows, the times need to answer the query increases 
exponentially.
Probably there is a more fancy and efficient way to do it, but I haven't 
found it yet.

Best,
Ismael

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to neo4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to