query-9d996cefee28ad8c22d1a6dd89133e00
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 "mycobacterium tuberculosis 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:Q130971. }
?item wdt:P31 wd:Q13442814;
wdt:P1476 ?title.
FILTER CONTAINS(LCASE(?title), "mycobacterium").
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
c10(["www.wikidata.org"]):::literal
c4(["wd:Q130971"]):::iri
c6(["bd:serviceParam"]):::iri
c16(["wd:Q13442814"]):::iri
c8(["Search"]):::literal
c12(["mycobacterium tuberculosis haswbstatement:P31=Q13442814"]):::literal
c14(["mwapi:title"]):::iri
f0[["contains(lower-case(?title),'tuberculosis')"]]
f0 --> v1
f1[["contains(lower-case(?title),'mycobacterium')"]]
f1 --> v1
f2[["not "]]
subgraph f2e0["Exists Clause"]
e0v1 --"wdt:P921"--> e0c2
e0v1("?item"):::projected
e0c2(["wd:Q130971"]):::iri
end
f2--EXISTS--> f2e0
f2 --> v4
f2 --> c3
f2 --> c4
v4 --"wdt:P921"--> c4
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c6 --"mwapi:api"--> c8
c6 --"mwapi:endpoint"--> c10
c6 --"mwapi:srsearch"--> c12
v3 --"mwapi:apiOutput"--> c14
end
bind3[/"concat(str('wd:'),?page_title)"/]
v3 --o bind3
bind3 --as--o v4
v4 --"wdt:P31"--> c16
v4 --"wdt:P1476"--> v1