Skip to content

Conversation

@Mats-SX
Copy link
Member

@Mats-SX Mats-SX commented Dec 6, 2016

There is lots of confusion around how self-relationships (or loops) are
matched by patterns. These scenarios aim to outline how this is supposed
to work, and how it differs from simple relationship matching.

@boggle
Copy link

boggle commented Feb 27, 2017

I think this does not reflect our last discussion on this, does it? Perhaps something worth picking up w Nadime, esp. MATCH p=(a)-(a) should match each single self-loop exactly once.

@Mats-SX
Copy link
Member Author

Mats-SX commented Feb 27, 2017

@boggle You're right, it doesn't. I'll update it.

There is lots of confusion around how self-relationships (or loops) are
matched by patterns. These scenarios aim to outline how this is supposed
to work, and how it differs from simple relationship matching.
Path equality is currently ill-defined for paths that traverse a single self-relationship,
as it makes the exact same triple of node-rel-node unequal to itself when traversed in
the reverse direction.
Rename feature (it isn't simple)
@Mats-SX
Copy link
Member Author

Mats-SX commented Feb 28, 2017

Updated with latest thinking. Please also see #192.

@thobe
Copy link

thobe commented Feb 28, 2017

Most of these scenarios are fine. But the ones where you could argue that direction would matter are missing. These are scenarios matching paths over loops.

Scenarios like this:

Given an empty graph
And having executed:
  """
  CREATE (a)-[:X]->(a)
  """
When executing query:
  """
  MATCH p=()-->()
  MATCH q=()<--()
  RETURN p = q
  """
Then the result should be:
  | p = q |
  |  ???  |

@thobe
Copy link

thobe commented Feb 28, 2017

While I agree with the pattern matching semantics for loops outlined here, I'm not convinced about how this extends to paths in #192, perhaps pattern matching should be considered a separate thing from path matching (at which point perhaps regular path patterns should be required for path matching).

@boggle boggle merged commit 76fa118 into opencypher:master Mar 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants