comunica / comunica-feature-link-traversal

📬 Comunica packages for link traversal-based query execution
Other
8 stars 11 forks source link

No results on re-execution of a TREE query using the same blank node has a object and a subject #102

Closed constraintAutomaton closed 2 months ago

constraintAutomaton commented 1 year ago

I realize that when I'm running a query that has a variable that will be a blank node and that variable is reused as a subject than when I rerun the query the engine will produce no result. For illustration let's consider this query

PREFIX tree: <https://w3id.org/tree#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT * WHERE {
  ?node tree:relation ?relation .
  ?relation tree:node ?nextNode .
}

where ?relation will be a blank node.

if instead I'm running this query

PREFIX tree: <https://w3id.org/tree#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT * WHERE {
  ?relation tree:node ?nextNode .
}

or that query

PREFIX tree: <https://w3id.org/tree#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT * WHERE {
  ?node tree:relation ?relation .
}

I'm not having this problem. Which make me think that the reused of the blank node might be the problem.

Here a link of an example using the engine

rubensworks commented 1 year ago

Query re-execution seems to work fine with regular link traversal AFAIK. So this might be a tree actor-specific bug?

constraintAutomaton commented 1 year ago

Query re-execution seems to work fine with regular link traversal AFAIK. So this might be a tree actor-specific bug?

At least on my end it does not. I has to be noted that the execution must have ended, for the bug to manifest.

example query with default config

rubensworks commented 1 year ago

I see, so it's a higher-level problem indeed.

rubensworks commented 1 year ago

I just realized that this may be the same problem as discovered in https://github.com/comunica/comunica/issues/1180#issuecomment-1485211746. But this will require some work to confirm.

rubensworks commented 1 year ago

Ok, the changes in Comunica indeed seem to have solved this problem as well 🎉

constraintAutomaton commented 1 year ago

Sadly, the problem still manifests itself when we rerun the query on the demo engine.

rubensworks commented 2 months ago

@constraintAutomaton Could you check again with the new code in comunica v3?

constraintAutomaton commented 2 months ago

@constraintAutomaton Could you check again with the new code in comunica v3?

Yes it seems to be working now!