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

Support for COUNT(*) #1358

Closed
tholiebig opened this issue Jun 1, 2024 · 5 comments · Fixed by #1411
Closed

Support for COUNT(*) #1358

tholiebig opened this issue Jun 1, 2024 · 5 comments · Fixed by #1411

Comments

@tholiebig
Copy link

The query parser seems to not support COUNT(*). Is there a timetable for resolving this problem?
PS: I also vote for adding FILTER NOT EXISTS to clever.

@joka921
Copy link
Member

joka921 commented Jul 26, 2024

Hi,
PR #1411 Will add support for COUNT([DISTINCT] *). It is already running on our public wikidata endpoint. Not that there is currently a bug that shows too large results for the DISTINCT case when the query contains a property path. This has already been fixed, but not yet deployed to the endpoint.
You can expect this to be merged some time next week hopefully.

FILTER NOT EXISTS is somewhere on the list (currently thinking about the correct semantics and an efficient implementation), but we do not have an estimated time frame for this.

@tholiebig
Copy link
Author

That's great news. Thank you this information. Please keep me posted about FILTER NOT EXISTS.

@tholiebig
Copy link
Author

Hi, thanks again for supporting this.
However, I couldn't get it to work:

> qlever --version
qlever 0.5.6

> curl -s localhost:7019 -H "Accept: text/tab-separated-values" --data-urlencode query='SELECT (count (distinct *) as ?cnt) WHERE { ?s ?p ?o } LIMIT 10'
{
    "exception": "Invalid SPARQL query: This parser currently doesn't support COUNT(*), please specify an explicit expression for the COUNT",
    "metadata": {
        "line": 1,
        "positionInLine": 8,
        "query": "SELECT (count (*) as ?cnt) WHERE { ?s ?p ?o } LIMIT 10",
        "startIndex": 8,
        "stopIndex": 16
    },
    "query": "SELECT (count (*) as ?cnt) WHERE { ?s ?p ?o } LIMIT 10",
    "resultsize": 0,
    "status": "ERROR",
    "time": {
        "computeResult": 2,
        "total": 2
    }
}

Any hints?

@hannahbast
Copy link
Member

@tholiebig It looks like you are using an old version of QLever. Are you using Docker? Then make sure that you pull the latest version with docker pull adfreiburg/qlever.

@tholiebig
Copy link
Author

Yes, that did it. Thanks @hannahbast I suggest to add this to the usage description.

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

Successfully merging a pull request may close this issue.

3 participants