query-6217a3b4a9720dc47c5530cd4a48e7aa
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 ?identifier__wikidata ?name ?source (REPLACE(STR(?start),"T00:00:00Z","") AS ?start_date) (REPLACE(STR(?end),"T00:00:00Z","") AS ?end_date) WHERE {
?identifier__wikidata p:P39 ?statement.
?statement ps:P39 wd:Q16744266; pq:P2937 wd:Q64022207 .
OPTIONAL { ?statement pq:P580 ?start }
OPTIONAL { ?statement pq:P582 ?end }
OPTIONAL {
?identifier__wikidata p:P973 ?describedAtPA .
?describedAtPA ps:P973 ?source .
OPTIONAL {
?describedAtPA pq:P1810 ?name .
}
FILTER(CONTAINS(LCASE(STR(?source)), "pa.org.za/"))
}
}
Query found at
- https://www.wikidata.org/wiki/User:Jacksonj04/prompts/South_Africa/Assembly/Peoples_Assembly/Term/27
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?describedAtPA")
v5("?end"):::projected
v9("?end_date")
v2("?identifier__wikidata"):::projected
v7("?name"):::projected
v1("?source"):::projected
v4("?start"):::projected
v8("?start_date")
v3("?statement")
c6(["wd:Q64022207"]):::iri
c4(["wd:Q16744266"]):::iri
v2 --"p:P39"--> v3
v3 --"p:statement/P39"--> c4
v3 --"p:qualifier/P2937"--> c6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P580".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P582".-> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:P973".-> v6
v6 --"p:statement/P973"--> v1
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v6 -."p:qualifier/P1810".-> v7
end
end
bind0[/"replace(str(?start),'T00:00:00Z','')"/]
v4 --o bind0
bind0 --as--o v8
bind1[/"replace(str(?end),'T00:00:00Z','')"/]
v5 --o bind1
bind1 --as--o v9