query-eb002d1fe26c3790236d853a593be421
SPARQL query
Use at
- https://query.wikidata.org/sparql
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/>
SELECT DISTINCT ?wikidata ?wikidata_group ?wikidata_area (SUBSTR(str(?start),1,10) AS ?start_date) WHERE {
?wikidata p:P39 ?mem .
?mem ps:P39 wd:Q33129158 .
OPTIONAL { ?mem pq:P4100 ?wikidata_group }
OPTIONAL { ?mem pq:P768 ?wikidata_area }
OPTIONAL { ?mem pq:P580 ?start }
FILTER NOT EXISTS { ?mem pq:P582 [] } # no end date
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?mem")
v5("?start"):::projected
v6("?start_date")
v2("?wikidata"):::projected
v4("?wikidata_area"):::projected
v3("?wikidata_group"):::projected
a1((" "))
c4(["wd:Q33129158"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"p:qualifier/P582"--> e0a1
e0v1("?mem"):::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;
v1 -."p:qualifier/P4100".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:qualifier/P768".-> v4
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:qualifier/P580".-> v5
end
bind1[/"substring(str(?start),'1^^xsd:integer','10^^xsd:integer')"/]
v5 --o bind1
bind1 --as--o v6