query-daf737314f2637fd0f40f8ed47bb0390
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 bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?title
WHERE {
{ SERVICE wikibase:mwapi {
bd:serviceParam wikibase:api "Search";
wikibase:endpoint "www.wikidata.org";
mwapi:srsearch "tuberculosis -mycobacterium haswbstatement:P31=Q13442814".
?page_title wikibase:apiOutput mwapi:title.
}
}
BIND(IRI(CONCAT(STR(wd:), ?page_title)) AS ?item)
FILTER NOT EXISTS { ?item wdt:P921 wd:Q12204. }
?item wdt:P31 wd:Q13442814;
wdt:P1476 ?title.
FILTER CONTAINS(LCASE(?title), "tuberculosis").
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?item"):::projected
v3("?page_title")
v1("?title"):::projected
c9(["www.wikidata.org"]):::literal
c5(["bd:serviceParam"]):::iri
c15(["wd:Q13442814"]):::iri
c7(["Search"]):::literal
c3(["wd:Q12204"]):::iri
c13(["mwapi:title"]):::iri
c11(["tuberculosis -mycobacterium haswbstatement:P31=Q13442814"]):::literal
f0[["contains(lower-case(?title),'tuberculosis')"]]
f0 --> v1
f1[["not "]]
subgraph f1e0["Exists Clause"]
e0v1 --"wdt:P921"--> e0c2
e0v1("?item"):::projected
e0c2(["wd:Q12204"]):::iri
end
f1--EXISTS--> f1e0
f1 --> v4
f1 --> c2
f1 --> c3
v4 --"wdt:P921"--> c3
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c5 --"mwapi:api"--> c7
c5 --"mwapi:endpoint"--> c9
c5 --"mwapi:srsearch"--> c11
v3 --"mwapi:apiOutput"--> c13
end
bind2[/"concat(str('wd:'),?page_title)"/]
v3 --o bind2
bind2 --as--o v4
v4 --"wdt:P31"--> c15
v4 --"wdt:P1476"--> v1