query-8a5a2d3af0c66b5364fe99d1056beb47
Red Cross societies
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
?value ?user (URI(REPLACE(?f,"\\$1",?user)) as ?url) ?d
?item ?itemLabel ?itemDescription
WHERE
{
?item wdt:P9079 [] .
?item p:P8687 ?st .
?st pq:P585 ?d .
?st pq:P6552 ?id .
?st ps:P8687 ?value .
FILTER NOT EXISTS { ?item p:P8687 [ pq:P585 ?d2 ; pq:P6552 ?id ] . FILTER( ?d2 > ?d) }
?item p:P2002 [ ps:P2002 ?user ; pq:P6552 ?id ] .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
wd:P2002 wdt:P1630 ?f .
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?d"):::projected
v1("?d2")
v8("?f"):::projected
v3("?id")
v4("?item"):::projected
v5("?st")
v9("?url")
v7("?user"):::projected
v6("?value"):::projected
a2((" "))
a1((" "))
a3((" "))
c12(["wd:P2002"]):::iri
c9(["bd:serviceParam"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0f0[["?d2 > ?d"]]
e0f0 --> e0v1
e0f0 --> e0v2
e0a1 --"p:qualifier/P585"--> e0v1
e0a1 --"p:qualifier/P6552"--> e0v3
e0v4 --"p:P8687"--> e0a1
e0v2("?d"):::projected
e0v1("?d2"):::projected
e0v3("?id"):::projected
e0v4("?item"):::projected
e0a1((" ")):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> v2
f0 --> a1
f0 --> c1
f0 --> c2
f0 --> v3
f0 --> v4
f0 --> c3
f1[["?d2 > ?d"]]
f1 --> v1
f1 --> v2
a1 --"p:qualifier/P585"--> v1
a1 --"p:qualifier/P6552"--> v3
v4 --"p:P8687"--> a1
v4 --"p:direct/P9079"--> a2
v4 --"p:P8687"--> v5
v5 --"p:qualifier/P585"--> v2
v5 --"p:qualifier/P6552"--> v3
v5 --"p:statement/P8687"--> v6
a3 --"p:statement/P2002"--> v7
a3 --"p:qualifier/P6552"--> v3
v4 --"p:P2002"--> a3
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end
c12 --"p:direct/P1630"--> v8
bind2[/"replace(?f,'\$1',?user)"/]
v8 --o bind2
v7 --o bind2
bind2 --as--o v9