query-4df0eaf07f3e1c3db56447b9216eaa3a
OrWiki Humans without Country of Citizenship (P27)
SELECT ?item ?statements ?wikis ?itemLabel ?itemDescription
WHERE {
?item wdt:P31 wd:Q5 . # item is a human
MINUS { ?item wdt:P27 [] . } # without the property country of citizenship
?article schema:about ?item .
?article schema:isPartOf https://or.wikipedia.org/ .
?item wikibase:statements ?statements . # for counting statements
OPTIONAL { ?item wikibase:sitelinks ?wikis. } #count sitelinks
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en" } # for generating label
}
ORDER BY ASC(?wikis)
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 schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#OrWiki Humans without Country of Citizenship (P27)
SELECT ?item ?statements ?wikis ?itemLabel ?itemDescription
WHERE {
?item wdt:P31 wd:Q5 . # item is a human
MINUS { ?item wdt:P27 [] . } # without the property country of citizenship
?article schema:about ?item .
?article schema:isPartOf <https://or.wikipedia.org/> .
?item wikibase:statements ?statements . # for counting statements
OPTIONAL { ?item wikibase:sitelinks ?wikis. } #count sitelinks
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en" } # for generating label
}
ORDER BY ASC(?wikis)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?article")
v2("?item"):::projected
v4("?statements"):::projected
v1("?wikis"):::projected
a1((" "))
c10(["bd:serviceParam"]):::iri
c2(["wd:Q5"]):::iri
c6([https://or.wikipedia.org/]):::iri
c12(["#91;AUTO_LANGUAGE#93;, en"]):::literal
v2 --"wdt:P31"--> c2
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v2 --"wdt:P27"--> a1
end
v3 --"schema:about"--> v2
v3 --"schema:isPartOf"--> c6
v2 --"wikibase:statements"--> v4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wikibase:sitelinks".-> v1
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end