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

Extend arbitrary length property path to return only furthest node #164

Open
jaw111 opened this issue Nov 25, 2022 · 0 comments
Open

Extend arbitrary length property path to return only furthest node #164

jaw111 opened this issue Nov 25, 2022 · 0 comments

Comments

@jaw111
Copy link
Contributor

jaw111 commented Nov 25, 2022

Why?

When querying tree-like structures, it is often useful to find the leaves of an arbitrary length path.

In some case it is possible to do this using MINUS or FILTER NOT EXISTS to remove solutions:

:john foaf:knows+ ?leaf .
MINUS { ?leaf foaf:knows [] }

However for more complex traversals where the arbitrary length match is part of a larger sequence it can be hard to formulate.

Previous work

unknown

Proposed solution

Allow use of some modifier like ~ that will exclude the intermediate nodes along that path segment.

:john foaf:knows+~ ?leaf .

In case the graph contains cyclical, then stop traversed when finding an already visited node and give no result for that traversal.

Considerations for backward compatibility

None foreseen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant