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
Malformed QPF with literal subject #1163
Comments
Thanks for reporting! |
It should be possible to implement this by adding a condition here which returns an empty set of quads if any of the terms do not match the expected term type (in particular you could enforce " The subject MUST either be a variable or an IRI; the predicate MUST either be a variable or an IRI; the object MUST either be a variable, an IRI, or a literal; the graph MUST either be a variable or an IRI"). To return an empty set of quads with the correct metadata you should use this logic. I would suggest refactoring that logic into a |
As of today, nothing I'm aware of prevents Comunica from working with generalized RDF. But the TPF spec does indeed make the explicit restriction, so we should handle at least that part. I'm wondering if we should not go for a more high-level approach, and introduce a proper |
Just to clarify - do you mean implement this in addition to doing an explicit restriction in the case of the TPF/QPF spec. I think the in addition to part is important in order to allow use-cases such as querying over the union of a TPF/QPF endpoint and an N3 document. |
No, I was referring to just applying this restriction at a higher level. To avoid us having to implement the same restriction at different places.
But then we would be mixing regular RDF with generalized RDF, and crossing two formal boundaries, which would probably open up another can of worms. We may want to avoid going into this, without knowing for certain that this is a valid use case. |
Issue type:
Description:
The issue
Comunica translates some SPARQL queries to malformed QPF queries where the
subject
parameter is a literal, though-- Triple Pattern Fragments 3.2
-- Quad Pattern Fragments 3.2
Some servers ignore such QPF queries but others reject them.
When such a server responds with
400
, Comunica does not recover and query execution fails.What should be done
I think Comunica should not even attempt to send QPF requests with literal subjects because
Instead I think Comunica should just ignore these requests.
(If Linked Data Fragments ever supported generalized RDF then this would need to change.)
Assuming you agree, I'd gladly try my hand at a first contribution, but I'd need some guidance.
Unfamiliar as I am with the codebase, I naively think this might be as easy as a condition on the term type of the QPF request subject, if any.
To reproduce
Assume a QPF endpoint
https://example.org/qpf
that exposes the following data:Assume a SPARQL query
Comunica translates this query into two calls:
https://example.org/qpf
https://example.org/qpf?subject=%22o%22
Environment:
I'm using
The text was updated successfully, but these errors were encountered: