query-b245bc2ad632f28e33905351e6028b3a
ORDER BY doesn't work well with items and null values
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?place ?placeLabel ?event ?eventLabel ?ref ?refp ?refv
WHERE
{
wd:Q28922083 p:P17 ?s .
?s ps:P17 ?place .
?s pq:P793 ?event .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
} ORDER BY DESC(?event)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?event"):::projected
v3("?place"):::projected
v2("?s")
c1(["wd:Q28922083"]):::iri
c6(["bd:serviceParam"]):::iri
c8(["en"]):::literal
c1 --"p:P17"--> v2
v2 --"p:statement/P17"--> v3
v2 --"p:qualifier/P793"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end