Comments (9)
Blank nodes in the template are unique across the solution mappings used while instantiating the template.
The query CONSTRUCT WHERE { ?S ?P ?O }
has a template of { ?S ?P ?O }
which has no blank nodes.
Blank nodes from the WHERE clause are not affected - they are just data.
from comunica.
Ok, then our implementation in Comunica is incorrect.
(and I'm actually happy about this, as it will allow us to significantly simplify things)
Thanks for the input @afs!
from comunica.
And anyone can make a PR to w3c/sparql-query for improvements of the spec text
from comunica.
Thanks for reporting!
from comunica.
This is a dupe of #1160
from comunica.
The query is equivalent to the following:
CONSTRUCT
{
?s ?p ?o
}
WHERE
{
?s ?p ?o
}
The WHERE
clause will be executed first, and will produce one query solution for each triple inside the dataset.
For each query solution, the query template will be instantiated.
According to what the SPARQL spec says, blank nodes will be scoped per query solution:
The blank node labels are scoped to the template for each solution.
So based on my understanding of the spec, this behaviour is correct.
The example in https://www.w3.org/TR/sparql11-query/#templatesWithBNodes aligns with this.
from comunica.
I'm sorry but I'll trust Jena on this.
Note that there are no bnodes in my query (which is what that section is about), only in my data.
from comunica.
Note that there are no bnodes in my query (which is what that section is about), only in my data.
This part of the spec seems to confirm your interpretation:
Blank node labels are scoped to a result set (see "SPARQL Query Results XML Format" and "SPARQL 1.1 Query Results JSON Format") or, for the CONSTRUCT query form, the result graph. Use of the same label within a result set indicates the same blank node.
Tbh, I would love to avoid this blank node weirdness, as it has given us plenty of headaches already.
@afs, what is your interpretation of https://www.w3.org/TR/sparql11-query/#templatesWithBNodes ? Did we implement it incorrectly in Comunica?
from comunica.
Steps that are needed to resolve this issue:
- Modify
BindingsToQuadsIterator
, so that the template is localized before the bindings are applied. - Remove the
localizeBlankNodes
context, CLI option, and all usages, as it won't be needed anymore.
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
- `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.