query-206b51947d5b76d53d31bca124c7134a
(Q56459584)Mayor of Ayios Dometios Some mayors were in office two or three non-continuous term. This is not showing in the list. The check can be done with query.
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 ?officeLabel ?item ?itemLabel ?itemDescription ?start ?end ?order ?predecessorLabel ?successorLabel ?ordernumber
{
?item p:P39 ?fc_stmt .
?fc_stmt ps:P39 ?office ; pq:P580 ?start .
values ?office { wd:Q56459584 }
optional { ?fc_stmt pq:P582 ?end }
optional { ?fc_stmt pq:P1545 ?order
bind(if(strlen(str(?order))=1,concat("0",?order),?order) as ?ordernumber)
}
optional { ?fc_stmt pq:P1365 ?predecessor }
optional { ?fc_stmt pq:P1366 ?successor}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
} order by ?ordernumber
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?end"):::projected
v3("?fc_stmt")
v2("?item"):::projected
v6("?office")
v7("?order"):::projected
v8("?ordernumber"):::projected
v8("?predecessor")
v5("?start"):::projected
v9("?successor")
c9(["bd:serviceParam"]):::iri
c11(["en"]):::literal
v2 --"p:P39"--> v3
v3 --"p:statement/P39"--> v6
v3 --"p:qualifier/P580"--> v5
bind0[/VALUES ?office/]
bind0-->v6
bind00(["wd:Q56459584"])
bind00 --> bind0
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P582".-> v6
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P1545".-> v7
bind1[/"if(string-length(str(?order)) = '1^^xsd:integer',concat('0',?order),?order)"/]
v7 --o bind1
bind1 --as--o v8
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P1365".-> v8
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P1366".-> v9
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end