query-78ec4f32623c811b9d7e216d5e1db5db
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>
prefix schema: <http://schema.org/>
SELECT DISTINCT ?contLabel ?pays ?paysLabel ?count WHERE {
{
SELECT ?pays (COUNT(DISTINCT ?pers) AS ?count) WHERE {
?pers wdt:P31 wd:Q5 .
?pers wdt:P21 wd:Q6581072 .
?pers wdt:P27 ?pays .
?pays wdt:P30 wd:Q15 .
filter not exists {
?pays wdt:P30 ?continent
filter( ?continent != wd:Q15) .
}
OPTIONAL { ?wartfrpers schema:about ?pers . ?wartfrpers schema:inLanguage "fr" }
FILTER(!bound(?wartfrpers))
} GROUP BY ?pays
}
?pays wdt:P30 ?cont .
SERVICE wikibase:label {
bd:serviceParam wikibase:language "fr,en" .
}
} ORDER BY DESC(?count)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?cont")
v3("?continent")
v6("?count"):::projected
v4("?pays"):::projected
v5("?pers")
v2("?wartfrpers")
c6(["wd:Q6581072"]):::iri
c10(["fr"]):::literal
c1(["wd:Q15"]):::iri
c12(["bd:serviceParam"]):::iri
c4(["wd:Q5"]):::iri
c14(["fr,en"]):::literal
f0[["not bound(?wartfrpers)"]]
f0 --> v2
f1[["not "]]
subgraph f1e0["Exists Clause"]
e0f0[["?continent != 'wd:Q15'"]]
e0f0 --> e0v1
e0v2 --"p:direct/P30"--> e0v1
e0v1("?continent"):::projected
e0v2("?pays"):::projected
end
f1--EXISTS--> f1e0
f1 --> v3
f1 --> v4
f1 --> c2
f2[["?continent != 'wd:Q15'"]]
f2 --> v3
v4 --"p:direct/P30"--> v3
v5 --"p:direct/P31"--> c4
v5 --"p:direct/P21"--> c6
v5 --"p:direct/P27"--> v4
v4 --"p:direct/P30"--> c1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."schema:about".-> v5
v2 --"schema:inLanguage"--> c10
end
bind4[/"count(?pers)"/]
v5 --o bind4
bind4 --as--o v6
v4 --"p:direct/P30"--> v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
end