virtuoso-opensource icon indicating copy to clipboard operation
virtuoso-opensource copied to clipboard

Bug in binding EXISTS result

Open jakubklimek opened this issue 3 years ago • 1 comments

On this endpoint when I execute this query:

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

ASK {
  <https://slovník.gov.cz/datový/turistické-cíle/pojem/turistický-cíl> rdfs:subClassOf+ <https://slovník.gov.cz/datový/číselníky/pojem/položka-číselníku>
}

I get false. Indeed, in the data, there is no such property path. However, when I bind the result of EXISTS on the same graph pattern, I get 1:

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT * WHERE {
  BIND(EXISTS {<https://slovník.gov.cz/datový/turistické-cíle/pojem/turistický-cíl> rdfs:subClassOf+ <https://slovník.gov.cz/datový/číselníky/pojem/položka-číselníku>} AS ?is_codelist)
}

A secondary issue with this query is that I need to disable strict checking of void variables, otherwise I get Virtuoso 37000 Error SP031: SPARQL compiler: The list of return values contains '*' but the pattern does not contain variables even when I substitute the *with ?is_codelist.

Originally discovered in https://github.com/opendata-mvcr/model-driven-data/issues/77#issuecomment-995297316 by @sstenchlak .

Data available for download from https://github.com/opendata-mvcr/ssp/suites/4662510590/artifacts/126714376

jakubklimek avatar Dec 16 '21 07:12 jakubklimek

Our development team will have a look at this issue.

pkleef avatar Dec 16 '21 10:12 pkleef