query-14641586ac7448d2679fe82ed33e2122
SPARQL query
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 ?wikidata_id ?wikidata_idLabel (?wikidata_idLabel as ?name) ?dc_id ?party_id ?area_id ?twitter_username
WHERE
{
?wikidata_id p:P3602 ?ps .
?ps ps:P3602 wd:Q62223284 .
OPTIONAL { ?wikidata_id wdt:P6465 ?dc_id }
OPTIONAL { ?wikidata_id wdt:P21 ?gender }
OPTIONAL { ?wikidata_id wdt:P2002 ?twitter_username }
OPTIONAL { ?ps pq:P102 ?party_id . }
OPTIONAL { ?ps pq:P768 ?area_id . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?area_id"):::projected
v3("?dc_id"):::projected
v4("?gender")
v8("?name")
v6("?party_id"):::projected
v2("?ps")
v5("?twitter_username"):::projected
v1("?wikidata_id"):::projected
c10(["bd:serviceParam"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c3(["wd:Q62223284"]):::iri
v1 --"p:P3602"--> v2
v2 --"p:statement/P3602"--> c3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P6465".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P21".-> v4
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P2002".-> v5
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:qualifier/P102".-> v6
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:qualifier/P768".-> v7
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end
bind0[/"?wikidata_idLabel"/]
null --o bind0
bind0 --as--o v8