-
Notifications
You must be signed in to change notification settings - Fork 561
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 SPARQL DESCRIBE query implementation #2221
Add SPARQL DESCRIBE query implementation #2221
Conversation
93bae2a
to
6566af3
Compare
6566af3
to
63755b8
Compare
Just for reference, two previous abandoned attempts at doing this: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mgberg thanks for the PR, it looks great as always, I just have a question regarding the change in rdflib/plugins/sparql/parser.py
which I'm not entirely clear on.
The change should also be pretty safe as nothing should impact non-describe queries.
pre-commit.ci run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
SPARQL DESCRIBE was implemented in <RDFLib#2221> so there should be no xfail on it tests for it. This change removes one such xfail that was in place.
SPARQL DESCRIBE was implemented in <#2221> so there should be no `xfail` on it tests for it. This change removes one such `xfail` that was in place.
Summary of changes
This adds an implementation for SPARQL DESCRIBE queries, using the built-in
cbd
method. I see there are several issues and PRs for DESCRIBE implementation. I believe this should close #479 and should resolve #1913, or at least pick up where it left off. It should also resolve #1096.This implementation should support the full SPARQL specification for DESCRIBE; either explicit IRIs can be provided (with no WHERE clause), or variables projected from a WHERE clause can be provided, or variables projected from a WHERE clause AND explicit IRIs can be provided. If a WHERE clause is provided, it should be evaluated the same way as it would for a SELECT DISTINCT query (including dataset specifications).
The expected results for the test cases provided match the behavior seen when running the same queries against the same data using ARQ.
A possible future extension would be to add a global option (similar to
rdflib.plugins.sparql.SPARQL_LOAD_GRAPHS
) to change the method used to describe resources instead of always using CBD.Checklist
the same change.
./examples
for new features.CHANGELOG.md
).so maintainers can fix minor issues and keep your PR up to date.