ad-freiburg / qlever

Very fast SPARQL Engine, which can handle very large knowledge graphs like the complete Wikidata, offers context-sensitive autocompletion for SPARQL queries, and allows combination with text search. It's faster than engines like Blazegraph or Virtuoso, especially for queries involving large result sets.
Apache License 2.0
376 stars 45 forks source link

Error processing query on imdb index #1437

Closed Stiksels closed 3 weeks ago

Stiksels commented 1 month ago

Context

Query

PREFIX imdb: <https://www.imdb.com/>
SELECT ?event ?udb_title ?cp_type ?cp_thema ?imdb_movie ?imdb_title WHERE {
  {
    SELECT DISTINCT ?event ?udb_title ?cp_type ?cp_thema { 
      ?event <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.cidoc-crm.org/cidoc-crm/E7_Activity> .
      ?event @nl@<http://purl.org/dc/terms/title> ?udb_title . 
      ?event <http://purl.org/dc/terms/type> ?udb_type FILTER(?udb_type = <https://taxonomy.uitdatabank.be/terms/0.50.6.0.0> ) .
      ?udb_type ^<http://www.w3.org/2002/07/owl#sameAs> ?cp_type .
      OPTIONAL {
        ?event <https://data.vlaanderen.be/ns/cultuurparticipatie#thema> ?udb_thema .
        ?udb_thema ^<http://www.w3.org/2002/07/owl#sameAs> ?cp_thema .
      }
    }
    LIMIT 10
  }
  MINUS {
    ?event <http://www.w3.org/ns/prov#invalidatedAtTime> ?deleted . 
    }
    SERVICE <https://qlever.cs.uni-freiburg.de/api/imdb> {
      SELECT ?imdb_movie ?imdb_title WHERE {
        ?imdb_movie  imdb:title ?imdb_title .
        ?imdb_movie imdb:numVotes ?votes .
        ?imdb_movie imdb:averageRating ?rating .
#        FILTER CONTAINS(?imdb_title, "De Buurtpolitie: De Perfecte Overval")
        FILTER (CONTAINS(LCASE(STR(?imdb_title)), LCASE(STR(?udb_title))))
     }
    }
}
GROUP BY ?event ?udb_title ?cp_type ?cp_thema ?imdb_movie ?imdb_title

curl request

curl -s https://qlever-api.publiq.services/uit-kg/ -H "Accept: text/tab-separated-values" -H "Content-type: application/sparql-query" --data "PREFIX imdb: <https://www.imdb.com/> SELECT ?event ?udb_title ?cp_type ?cp_thema ?imdb_movie ?imdb_title WHERE { { SELECT DISTINCT ?event ?udb_title ?cp_type ?cp_thema { ?event <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.cidoc-crm.org/cidoc-crm/E7_Activity> . ?event @nl@<http://purl.org/dc/terms/title> ?udb_title . ?event <http://purl.org/dc/terms/type> ?udb_type FILTER(?udb_type = <https://taxonomy.uitdatabank.be/terms/0.50.6.0.0> ) . ?udb_type ^<http://www.w3.org/2002/07/owl#sameAs> ?cp_type . OPTIONAL { ?event <https://data.vlaanderen.be/ns/cultuurparticipatie#thema> ?udb_thema . ?udb_thema ^<http://www.w3.org/2002/07/owl#sameAs> ?cp_thema } } LIMIT 10 } MINUS { ?event <http://www.w3.org/ns/prov#invalidatedAtTime> ?deleted } SERVICE <https://qlever.cs.uni-freiburg.de/api/imdb> { SELECT ?imdb_movie ?imdb_title WHERE { ?imdb_movie imdb:title ?imdb_title . ?imdb_movie imdb:numVotes ?votes . ?imdb_movie imdb:averageRating ?rating . FILTER (CONTAINS(LCASE(STR(?imdb_title)), LCASE(STR(?udb_title)))) } } } GROUP BY ?event ?udb_title ?cp_type ?cp_thema ?imdb_movie ?imdb_title"

Error message

Error processing query
Assertion `false` failed. Unsupported escape sequence found in RDF literal "Re \ Entry". Please report this to the developers. In file "/app/src/parser/RdfEscaping.cpp " at line 144
joka921 commented 3 weeks ago

Hi @Stiksels I a just merged the fix for this, it will take some time until the new version is rolled out in our public demos. Thanks again for reporting this subtle bug.

Stiksels commented 2 weeks ago

hi @joka921 , is this new version available in the public demo at SERVICE https://qlever.cs.uni-freiburg.de/api/imdb ? I still get the same error as mentioned above:

Assertion `false` failed. Unsupported escape sequence found in RDF literal "Re \ Entry". Please report this to the developers. In file "/app/src/parser/RdfEscaping.cpp " at line 144
joka921 commented 2 weeks ago

Hi @Stiksels The bug was on the receiving side of the SERVICE clause. So if you post the queries on a QLever instance that you host yourself (it looks like it, I don't recognize your dataset), then you have to update your own QLever to actually benefit from this. If you start Qlever via Docker, a docker pull ad-freiburg/qlever should do the trick. Unfortunately the qlever-control script (pip install qleverl) currently doesn't automatically update the QLever binaries/Docker containers. This is something where we are currently discussing how we want to keep these tools in sync.