qlever icon indicating copy to clipboard operation
qlever copied to clipboard

`rdfs:label` + `FILTER` optimization breaks with property paths

Open larsgw opened this issue 4 months ago • 1 comments

A query with the following clause led to an OOM error (https://qlever.dev/wikidata/8cm28Y):

OPTIONAL {
    ?child wdt:P105/rdfs:label ?child_rank_label . FILTER (LANG(?child_rank_label) = 'en')
}

Tried to allocate 6.7 GB, but only 6.4 GB were available

However it changing it to the following worked:

OPTIONAL {
    ?child wdt:P105 ?child_rank .
    ?child_rank rdfs:label ?child_rank_label . FILTER (LANG(?child_rank_label) = 'en')
}

So I think the optimization for rdfs:label in conjunction with FILTER(LANG(...) = ...) does not (yet) apply correctly to expressions with simple property paths.

larsgw avatar Dec 01 '25 11:12 larsgw

This also seems to work fine so that's maybe an easier workaround.

OPTIONAL {
    ?child wdt:P105 [ rdfs:label ?child_rank_label ] . FILTER (LANG(?child_rank_label) = 'en')
}

larsgw avatar Dec 01 '25 11:12 larsgw