query-be017b4728b231489c9333a27b9971d4
Query for African-American librarians with no article on the English Wikipedia
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#>
SELECT DISTINCT ?item ?itemLabel
WHERE
{
?item wdt:P106/wdt:P279* wd:Q182436 ;
wdt:P172 wd:Q49085 .
# look for articles (sitelinks)
OPTIONAL { ?sitelink schema:about ?item . ?sitelink schema:inLanguage "en" }
# but select items with no such article
FILTER (!BOUND(?sitelink))
# humans only
?item wdt:P31 wd:Q5 .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v1("?sitelink")
a1((" "))
c8(["en"]):::literal
c3(["wd:Q182436"]):::iri
c12(["bd:serviceParam"]):::iri
c10(["wd:Q5"]):::iri
c5(["wd:Q49085"]):::iri
f0[["not bound(?sitelink)"]]
f0 --> v1
v2 --"wdt:P106"--> a1
a1 --"wdt:P279"--> c3
v2 --"wdt:P172"--> c5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."schema:about".-> v2
v1 --"schema:inLanguage"--> c8
end
v2 --"wdt:P31"--> c10
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c8
end