query-7e13aa30e8fdf1ec364b1a249a4c827d
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 distinct ?item ?itemLabel ?givennameLabel ?familynameLabel ?dob
WHERE
{
?item p:P39 ?statement. #there is a P39 for the item
?statement ps:P39 wd:Q13218630. #the P39 is United States representative
filter not exists {?statement pq:P582 [].} #the P39 does not have an end date
optional {?item wdt:P735 ?givenname.} #item might have a given name
optional {?item wdt:P734 ?familyname.} #item might have a family name
optional {?item wdt:P569 ?dob.} #item might have a date of birth
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;
v5("?dob"):::projected
v4("?familyname")
v3("?givenname")
v2("?item"):::projected
v1("?statement")
a1((" "))
c4(["wd:Q13218630"]):::iri
c9(["bd:serviceParam"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"p:qualifier/P582"--> e0a1
e0v1("?statement"):::projected
e0a1((" ")):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> a1
v1 --"p:qualifier/P582"--> a1
v2 --"p:P39"--> v1
v1 --"p:statement/P39"--> c4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P735".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P734".-> v4
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P569".-> v5
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end