query-0623b286094524190a55118ae6fc5d25
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?label
WHERE {
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:endpoint "www.wikidata.org";
wikibase:api "Generator";
mwapi:generator "search";
mwapi:gsrsearch "inlabel:Rapper";
mwapi:gsrlimit "max".
?item wikibase:apiOutputItem mwapi:title.
}
?item wdt:P31 wd:Q5.
MINUS { ?item wdt:P106 wd:Q2252262. }
?item rdfs:label ?label.
FILTER(LANG(?label) = "en") # Comment out to search non-english labels as well
FILTER(CONTAINS(LCASE(?label), "rapper"))
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v1("?label"):::projected
c6(["www.wikidata.org"]):::literal
c14(["max"]):::literal
c20(["wd:Q2252262"]):::iri
c10(["search"]):::literal
c4(["bd:serviceParam"]):::iri
c18(["wd:Q5"]):::iri
c12(["inlabel:Rapper"]):::literal
c16(["mwapi:title"]):::iri
c8(["Generator"]):::literal
f0[["contains(lower-case(?label),'rapper')"]]
f0 --> v1
f1[["?label = 'en'"]]
f1 --> v1
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c4 --"mwapi:endpoint"--> c6
c4 --"mwapi:api"--> c8
c4 --"mwapi:generator"--> c10
c4 --"mwapi:gsrsearch"--> c12
c4 --"mwapi:gsrlimit"--> c14
v2 --"mwapi:apiOutputItem"--> c16
end
v2 --"wdt:P31"--> c18
subgraph minus2["MINUS"]
style minus2 stroke-width:6px,fill:pink,stroke:red;
v2 --"wdt:P106"--> c20
end
v2 --"rdfs:label"--> v1