query-d2098ec00a22ecec825b4f963565f1db
Current Ambassadors & High Commissioners on twitter
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 distinct ?person ?personLabel ?positionLabel ?start_date ?twitter_username where
{
?person p:P39 ?positionStatement .
?positionStatement ps:P39 ?position .
{ ?position wdt:P31 wd:Q18115939 . } union { ?position wdt:P31 wd:Q56760832 } .
?positionStatement pq:P580 ?start_date .
filter not exists {?positionStatement pq:P582 ?end_date . }
?person wdt:P2002 ?twitter_username .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} order by ?positionLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?end_date")
v4("?person"):::projected
v5("?position")
v1("?positionLabel"):::projected
v2("?positionStatement")
v6("?start_date"):::projected
v7("?twitter_username"):::projected
c5(["wd:Q18115939"]):::iri
c10(["bd:serviceParam"]):::iri
c6(["wd:Q56760832"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"p:qualifier/P582"--> e0v2
e0v2("?end_date"):::projected
e0v1("?positionStatement"):::projected
end
f0--EXISTS--> f0e0
f0 --> v2
f0 --> c1
f0 --> v3
v2 --"p:qualifier/P582"--> v3
v4 --"p:P39"--> v2
v2 --"p:statement/P39"--> v5
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v5 --"p:direct/P31"--> c6
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v5 --"p:direct/P31"--> c5
end
union0r <== or ==> union0l
end
v2 --"p:qualifier/P580"--> v6
v4 --"p:direct/P2002"--> v7
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end