query-31ff89d7a5ab7920c9a0aa91486ec8aa
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
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 ?item ?itemLabel ?istLabel ?admin ?adminLabel ?adminDescription ?start ?end WHERE {
VALUES ?admin { wd:Q16287 wd:Q18288162 wd:Q426025 wd:Q28769238 wd:Q2567535}
?item wdt:P31 ?ist .
?stat ps:P131 ?admin.
?item p:P131 ?stat; #The trick is the semicolon
OPTIONAL { ?stat pq:P580 ?start. }
OPTIONAL { ?stat pq:P582 ?end. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "it". }
} ORDER BY ?item ?start
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?admin"):::projected
v6("?end"):::projected
v4("?ist")
v1("?item"):::projected
v2("?start"):::projected
v5("?stat")
c7(["bd:serviceParam"]):::iri
c9(["it"]):::literal
bind0[/VALUES ?admin/]
bind0-->v3
bind00(["wd:Q16287"])
bind00 --> bind0
bind01(["wd:Q18288162"])
bind01 --> bind0
bind02(["wd:Q426025"])
bind02 --> bind0
bind03(["wd:Q28769238"])
bind03 --> bind0
bind04(["wd:Q2567535"])
bind04 --> bind0
v1 --"p:direct/P31"--> v4
v5 --"p:statement/P131"--> v3
v1 --"p:P131"--> v5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:qualifier/P580".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:qualifier/P582".-> v6
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end