On Thu, Dec 1, 2011 at 4:55 PM, jschweigl <johann.schwe...@gmail.com> wrote:

> Once I find the time to set up a blog, I'l happily do that.
>
> What's still annoying me is that I do not understand the difference between
> the query pairs 7/8 and 9/10 ...


I'll have a go.

The difference between 7 and 8 is which relationship is optional
7:  scenario-[:HAS_MOCKUP]->mock<-[r?:HAS_MOCKUP]-sub
8:  scenario-[r?:HAS_MOCKUP]->mock<-[:HAS_MOCKUP]-sub
(I've rewritten the second match to better show the difference.)

Both *scenario* and *sub* are bound, so only the relationship marked with *r
* is optional.

Now, if we're looking at a *scenario* that has no *mock*s connected to it,
no subgraphs will match with query number 7, but with query 8 you can still
get matches. I hope this makes sense. Let me know if it doesn't.

Query 10 I'm assuming has a typo in it. You bind an identifier named *sub*,
but in the match, you use *subprocess*.
Here are the interesting parts of queries 9 and 10. I've reworked the match
of query 10 to make the difference more notable, and I've fixed what I
think is a typo:
9: MATCH sub-[:HAS_MOCKUP]->mock<-[:HAS_MOCKUP]-scenario
10: MATCH sub-[:HAS_MOCKUP]->mock<-[r?:HAS_MOCKUP]-scenario
    WHERE r IS NULL

This makes the difference much clearer - query 9 will return all *sub* and *
scenario* combinations connected over a mock, and query 10 will return all
combinations* *not connected.

Hope this helps.

Andrés
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to