-
Notifications
You must be signed in to change notification settings - Fork 15
Make blank nodes reusable across expressions #64
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
Conversation
|
@rubensworks Would Concretely:
Then you will see a blank node without |
|
Hmm, this should work even for single sources. I'll look into this asap. |
|
Updating to Comunica 1.12.1 will fix the problem 🎉 |
This comment has been minimized.
This comment has been minimized.
52dc8db to
478fc4c
Compare
|
@rubensworks Lol, I've upgraded to 1.12.1 and it just works, without me writing any code. |
63f6968 to
54128f0
Compare
|
@rubensworks I first I thought it was this one: Given that the passed In other words, I don't think 54128f0 should work, yet it does with 1.12.1 (didn't with 1.11.0). What do you think? |
|
@rubensworks Depending on how the resulting pattern from After all, a blank node in a pattern should represent a (non-returned) variable, whereas it seems to represent a specific constant here. …or is this actually the intended behavior, and will blank nodes with the same blank node label always match? In that sense I'm confused by https://github.com/comunica/comunica/blob/47c80ef2f5c118f3926c3be860865438dd8ba445/packages/actor-rdf-resolve-quad-pattern-federated/lib/FederatedQuadSource.ts#L222 . But then Also, is it safe that you are just minting variables named vs/vp/vo/vg in https://github.com/comunica/comunica/blob/47c80ef2f5c118f3926c3be860865438dd8ba445/packages/actor-rdf-resolve-quad-pattern-federated/lib/FederatedQuadSource.ts#L223-L226 ? What if any of the other components already have that name? |
Hmm, weird. I don't think it should work like that, will look into it.
Any blank nodes that occur at this stage originate from sources. Any blank nodes from the query will be translated to variables before query exec. The idea is that blank nodes will be matched by label, but not if they come from different sources, then they will never match.
This should be safe, yes, since we're working in quad pattern context here. These variable names are just used to mark wildcards in sources, but are then used to construct quads, so the variable names lever leave this context. |
I think that should be: blank nodes are matched by canonical URI if they have one. If not, blanks in a query act like variables. |
That should be what is happening now, since query-bnodes will become variables before query exec starts. |
|
Evidence seems to point at a comparison with blank node labels being done. |
|
I just had a look, and Comunica receives queries like these: SELECT ?name WHERE {
<urn:comunica_skolem:source_0:n3-0> <http://xmlns.com/foaf/0.1/name> ?name.
}Which means that the blank nodes are already skolemized somehow. I'll look into it a bit further now. |
|
Hmm, it looks like LDflex already contains the skolemization logic here: https://github.com/LDflex/LDflex/blob/master/src/SparqlHandler.js#L209-L217 If I disable this, the test fails, as expected. So I guess there is no issue, and everything is working as intended? |
|
My bad. I had forgotten about this piece of code, which apparently uses the same So it's actually working as intended. How exciting! Will finish this up and release soon. |
Closes #34.