query-9214a6db6ecb48f32df95be71df6da30
SPARQL query
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
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 ?name (REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(?rawname, "ú", "u"), "á", "a"), "ó", "o"), "í", "i"), "é","e") AS ?namelabel) (SUBSTR(str(?start_date),1,10) AS ?mandate_start)
WHERE
{
?name p:P39 ?membership .
?membership ps:P39 wd:Q18229570 ; pq:P580 ?start_date .
FILTER NOT EXISTS { ?membership pq:P582 ?end }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en".
?name rdfs:label ?rawname .
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?end")
v7("?mandate_start")
v1("?membership")
v3("?name"):::projected
v6("?namelabel")
v5("?rawname"):::projected
v4("?start_date"):::projected
c7(["bd:serviceParam"]):::iri
c4(["wd:Q18229570"]):::iri
c9(["en"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"p:qualifier/P582"--> e0v2
e0v2("?end"):::projected
e0v1("?membership"):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> v2
v1 --"p:qualifier/P582"--> v2
v3 --"p:P39"--> v1
v1 --"p:statement/P39"--> c4
v1 --"p:qualifier/P580"--> v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
v3 --"rdfs:label"--> v5
end
bind1[/"replace(replace(replace(replace(replace(?rawname,'ú','u'),'á','a'),'ó','o'),'í','i'),'é','e')"/]
v5 --o bind1
bind1 --as--o v6
bind2[/"substring(str(?start_date),'1^^xsd:integer','10^^xsd:integer')"/]
v4 --o bind2
bind2 --as--o v7