Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scenarios around pattern matching and self-loops #162

Merged
merged 3 commits into from
Mar 1, 2017

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
Contributor

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
Contributor

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
Contributor

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.

None yet

3 participants