query-c3e36266a764a043c6a62787cfc7745f
Trouble with ORDER BY The following query doesn't seem to always obey the ORDER BY clause:
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 * WHERE {
{
SELECT ?sen ?senLabel ?seatLabel ?seat ?termLabel ?stmt ?end ?replacedBy WHERE {
?sen p:P39 ?stmt.
?stmt ps:P39 wd:Q4416090;
pq:P2937 ?term;
pq:P768 ?seat;
pq:P582 ?end.
OPTIONAL { ?stmt pq:P1366 ?replacedBy. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY (?seat) (?end)
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?end"):::projected
v6("?replacedBy"):::projected
v1("?seat"):::projected
v3("?sen"):::projected
v4("?stmt"):::projected
v5("?term")
c9(["bd:serviceParam"]):::iri
c3(["wd:Q4416090"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v3 --"p:P39"--> v4
v4 --"p:statement/P39"--> c3
v4 --"p:qualifier/P2937"--> v5
v4 --"p:qualifier/P768"--> v1
v4 --"p:qualifier/P582"--> v2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:qualifier/P1366".-> v6
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end