Here's a question about efficient queries.

I have a graph with information about publications, topics, and persons,
among other things. Now I need to extract from this graph who has knowledge
about a certain topic.

One part of my query matches persons that know about a topic or its
sub-topics, like so:

match (n {name:"Cognitive
Science"})-[r:INCLUDES*]->(o)<-[rr:KNOWS_ABOUT]-(person:Person) return as Topic, as Researcher
match (n {name:"Cognitive Science"})<-[rr:KNOWS_ABOUT]-(person:Person)
return as Topic, as Researcher

Since this is only a part of a much larger query, I'd like to get rid of
the second line, but I can't come up with a query that includes matches to
the 'super topic' (Cognitive Science).
Is there an identity relationship so that the first could be reformulated
in a way that node o is the same as node n? Would it be a good approach to
explicitly make every node identical to itself via this relationship?

match (n {name:"Cognitive

Or is using a path a solution?

Any input is welcome, thanks.

best regards,

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 
For more options, visit

Reply via email to