query-552bcbc5522d48ab429b3ebc06448984
TODO
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 ?replaces ?replacedBy ?start ?end WHERE {
VALUES ?sen {
wd:Q508752
}
?sen p:P39 ?stmt.
?stmt ps:P39 wd:Q4416090;
pq:P2937 ?term.
{
?stmt pq:P1365 ?replaces;
pq:P580 ?start.
}
UNION
{
?stmt pq:P1366 ?replacedBy;
pq:P582 ?end.
}
BIND(COALESCE(?start, ?end) AS ?date)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY (?sen) (?date)
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v9("?date")
v8("?end"):::projected
v7("?replacedBy"):::projected
v5("?replaces"):::projected
v3("?sen"):::projected
v6("?start"):::projected
v3("?stmt")
v4("?term")
c10(["bd:serviceParam"]):::iri
c3(["wd:Q4416090"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
bind0[/VALUES ?sen/]
bind0-->v3
bind00(["wd:Q508752"])
bind00 --> bind0
v3 --"p:P39"--> v3
v3 --"p:statement/P39"--> c3
v3 --"p:qualifier/P2937"--> v4
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v3 --"p:qualifier/P1366"--> v7
v3 --"p:qualifier/P582"--> v8
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:qualifier/P1365"--> v5
v3 --"p:qualifier/P580"--> v6
end
union0r <== or ==> union0l
end
bind1[/"?start?end"/]
v6 --o bind1
v8 --o bind1
bind1 --as--o v9
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end