Skip to content
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

Virtuoso Bug: Query incorrectly evaluates to empty result set; breaks keyword search over literal facet values #35

Open
Aklakan opened this issue Oct 19, 2020 · 0 comments

Comments

@Aklakan
Copy link
Member

Aklakan commented Oct 19, 2020

The following query incorrectly returns 0 results on the Virtuoso deployed at http://cord19.aksw.org/sparql

The actual query has a VALUES clause as the first UNION member (instead of the empty graph pattern) but it suffers from the same empty result set problem

SELECT  *
WHERE
  { {
     SELECT  ?o
        WHERE
          {
              {} # Empty for the sake of a minimal example
            UNION
              { ?s  ?p  ?o FILTER ( ?p = <http://id.loc.gov/ontologies/bibframe/title> )}
          }
      }
      OPTIONAL { ?o  <http://www.w3.org/2000/01/rdf-schema#label>  ?v_1 }

    FILTER ( regex(str(?o), "met", "i")  )
  }

LIMIT 100
  • Interestingly the query works when filtering?p to <http://example.org/dbpediaSubject> (instead of <http://id.loc.gov/ontologies/bibframe/title>).
    The titles are all literals and the dbpediaSubjects are all IRIs - so apparently the optional block fails to evaluate for literals.

  • The query APPEARS to work but actually DOESN'T when omitting the str function and writing directly regex(?o, ...):
    It seems as if the regex then evaluates to true regardless of ?o's value.

There may be some wacky optimization in place regarding variables in subject positions that are bound to literal values...

@Aklakan Aklakan changed the title Virtuoso Bug Virtuoso Bug: Query incorrectly evaluates to empty result set; breaks keyword search over literal facet values Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant