Comments (5)
Thanks for reporting!
from comunica.
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.
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 emptyWithMetadata
function.
from comunica.
As of today, nothing I'm aware of prevents Comunica from working with generalized RDF.
As such, implementing the suggested change may restrict some valid use cases (e.g. querying over N3 files).
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 generalizedRdf
option, which is false
by default. And if false
, we can modify our quadpattern query operation actor so that it always returns empty results when literals appear in non-object positions.
This would still enable users to force generalized RDF mode if they want to do so.
from comunica.
I'm wondering if we should not go for a more high-level approach, and introduce a proper generalizedRdf option, which is false by default. And if false, we can modify our quadpattern query operation actor so that it always returns empty results when literals appear in non-object positions.
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.
from comunica.
do you mean implement this in addition to doing an explicit restriction in the case of the TPF/QPF spec
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.
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.
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.
from comunica.
Related Issues (20)
- Comunica SPARQL endpoint configuration with CLI argument HOT 1
- `IN` operator does not work with literals HOT 10
- Link to other builds from https://query.linkeddatafragments.org/
- Slow query over 2 SPARQL endpoints produces no results or errors HOT 4
- Prefixes are lost when piping data HOT 2
- Blank nodes in `CONSTRUCT` output HOT 9
- `stringSource` RDF syntax errors uncaught HOT 3
- Migrate from cross-fetch to @inrupt/universal-fetch HOT 2
- Dynamic inner joins can create excessive number of requests HOT 3
- Investigate if `MediatedLinkedRdfSourcesAsyncRdfIterator` is leaving iterators open HOT 1
- `initialQuads` in `RdfSourceQPF` not consumed or closed HOT 2
- Investigate if the `bindingsStream` in `ActorQueryOperationLeftJoin` should be closed on the error event HOT 1
- Strange (?) behavior with `VALUES`, returning no data HOT 5
- Consider adding a context to bindings? HOT 5
- Too many results when rebinding results from sub select statement. HOT 3
- Agregates with xsd:date objects do not work HOT 6
- ZeroOrOne path expressions with 2 variables not supported yet HOT 1
- Restore Solid integration tests HOT 3
- SELECT queries over SPARQL endpoints even if COUNT was zero. HOT 1
- `HttpServiceSparqlEndpoint` does not support void queries HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from comunica.