Open WolfgangFahl opened 1 year ago
More often than not the above query times out on the wikidata query service. It also doesn't work in the Qlever environment. see #42
Event details may be queried separately:
SELECT
?item
(GROUP_CONCAT(?_event; SEPARATOR = "|") AS ?event)
(GROUP_CONCAT(?_eventLabel; SEPARATOR = "|") AS ?eventLabel)
(GROUP_CONCAT(?_eventSeries; SEPARATOR = "|") AS ?eventSeries)
(GROUP_CONCAT(?_eventSeriesLabel; SEPARATOR = "|") AS ?eventSeriesLabel)
(GROUP_CONCAT(?_eventSeriesOrdinal; SEPARATOR = "|") AS ?eventSeriesOrdinal)
(GROUP_CONCAT(?_dblpEventId; SEPARATOR = "|") AS ?dblpEventId)
WHERE {
VALUES ?item {
wd:Q107266045
}
?item wdt:P4745 ?_event.
?_event rdfs:label ?_eventLabel.
FILTER((LANG(?_eventLabel)) = "en")
OPTIONAL { ?_event wdt:P10692 ?_dblpEventId. }
OPTIONAL {
?_event p:P179 ?_partOfTheEventSeriesStmt.
?_partOfTheEventSeriesStmt ps:P179 ?_eventSeries;
pq:P1545 ?_eventSeriesOrdinal.
?_eventSeries rdfs:label ?_eventSeriesLabel.
FILTER((LANG(?_eventSeriesLabel)) = "en")
}
}
GROUP BY ?item
The part that is incompatible to QLever is the casting to integer for the sorting of the result
xsd:integer(?sVolume)
is not supported by QLever
Also adding DISTINCT
to the sub-query improves the execution time
Please create an issue with QLever for
xsd:integer(?sVolume) is not supported by QLever
upstream
We need a two-phase query implementation now.
The query is already two-phased see
which uses the queries
for proceedings https://github.com/WolfgangFahl/pyCEURmake/blob/1ddbe2c34246e6fafda59a443630233ca15ba72f/ceurws/resources/queries/ceurws.yaml#L5-L74
for aggregated events by proceeding https://github.com/WolfgangFahl/pyCEURmake/blob/1ddbe2c34246e6fafda59a443630233ca15ba72f/ceurws/resources/queries/ceurws.yaml#L75-L100
Please create an issue with QLever for
xsd:integer(?sVolume) is not supported by QLever
upstream
@WolfgangFahl
I think the main problem with the query is that when you use OPTIONAL
with multi-valued fields, that causes Cartesian product (explosion). If the variables have N1, N2, N3 values then the result set contains N1N2N3 rows.
DISTINCT
is too late: you've already exploded the result set, and DISTINCT has to do a lot of work (materialize the whole result set, sort it, uniquify it)GROUP_CONCAT
is not needed on single-valued fields, and is wrong on multi-valued fields (you'd get the same value N1 repeated N2*N3 times)Use UNION
instead of OPTIONAL