query-587f30aa6045edec46d825a0b87c9fb5
Members of 117th United States Congress sorted by age SELECT ?item ?itemLabel ?positionLabel ?dob WHERE { ?item p:P39 ?statement . ?statement ps:P39 ?position . ?statement pq:P2937 wd:Q65089999 . # parliamentary term: 117th United States Congress OPTIONAL { ?item wdt:P569 ?dob . } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . } } ORDER BY ASC(?dob)
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#>
# Members of 117th United States Congress sorted by age
SELECT ?item ?itemLabel ?positionLabel ?dob
WHERE
{
?item p:P39 ?statement .
?statement ps:P39 ?position .
?statement pq:P2937 wd:Q65089999 . # parliamentary term: 117th United States Congress
OPTIONAL { ?item wdt:P569 ?dob . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . }
}
ORDER BY ASC(?dob)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?dob"):::projected
v2("?item"):::projected
v4("?position")
v3("?statement")
c4(["wd:Q65089999"]):::iri
c7(["bd:serviceParam"]):::iri
c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v2 --"p:P39"--> v3
v3 --"p:statement/P39"--> v4
v3 --"p:qualifier/P2937"--> c4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P569".-> v1
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end