openlink / virtuoso-opensource

Virtuoso is a high-performance and scalable Multi-Model RDBMS, Data Integration Middleware, Linked Data Deployment, and HTTP Application Server Platform
https://vos.openlinksw.com
Other
868 stars 210 forks source link

`FILTER EXISTS` breaks `LIMIT` #1315

Open mielvds opened 3 months ago

mielvds commented 3 months ago

When running the following query, I get 10000 results (the result limit) while I expected 1.

prefix premis: <http://www.loc.gov/premis/rdf/v3/>
select distinct * where {
  ?id a premis:File .
  filter exists {
    ?id a premis:File .
  }
} limit 1

Unfortunately, I can't share the dataset, which makes reproducing the issue difficult, but the limit should work in any case. I'm not sure, but it only seems to happen when the result size is larger or equal to the configured limit of 10000. We're using version 7.2.6-7. Furthermore, this also breaks the use of OFFSET, which no longer has any effect.

I tried a similar query

select distinct * where {
?p a schema:Person.
filter exists {
?p a schema:Person.
}
} limit 1

on https://dbpedia.org/sparql, but that works fine.

HughWilliams commented 3 months ago

You indicate running Virtuoso 7.2.6-7, which is not an official Virtuoso Open Source release and is rather old, thus where did you acquire it from? In any case, we would recommend that you upgrade to the latest Virtuoso 7.2.13 Open Source release and see if the problem persists.

Have you run a database integrity check to determine if there might be any corruption in the database?

mielvds commented 2 months ago

Sorry, the -7 is an image name by our service provider. I'll do a test locally.