Skip to content

COUNT over pattern involving limit-bound subquery: can't wait to see the results #2465

@karlisc

Description

@karlisc

Update:
The following query
SELECT (COUNT(?x) as ?cx) WHERE { { SELECT ?x WHERE {?x ?p ?y.} LIMIT 1 } }
gives 20,853,874,240 on Wikidata QLever endpoint. It should give 1.

The behaviour was initially observed on the Uniprot QLever endpoint, but it carries over to Wikidata QLever, as well.

Original formulation:
The following query does not give the results immediately, as it most likely would be expected to.

SELECT (COUNT(?x) as ?cx) WHERE { 
{ SELECT ?x WHERE {?x a <http://purl.uniprot.org/core/Gene>. } LIMIT 1 } 
?x a ?y. }

If counting is not done on the outermost level, behavior is much more reasonable, even for higher limits.

This is observed on the Uniprot QLever dataset.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions