query-520a07d3906f2868e04511333c877282
TODO
Use at
- https://query.wikidata.org/sparql
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#>
SELECT ?item ?itemLabel ?regex
WHERE
{
?item wdt:P921 wd:Q130971.
?item wdt:P921 wd:Q12204.
?item rdfs:label ?itemLabel. filter(lang(?itemLabel)="en").
filter(contains(?itemLabel,"Mycobacterium tuberculosis"))
bind(if(regex(?itemLabel, ".*(tuberculosis).*(tuberculosis).*"),"both","just MT") as ?regex)
} order by ?regex ?itemLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?item"):::projected
v2("?itemLabel"):::projected
v4("?regex"):::projected
c4(["wd:Q130971"]):::iri
c5(["wd:Q12204"]):::iri
f0[["contains(?itemLabel,'Mycobacterium tuberculosis')"]]
f0 --> v2
f1[["?itemLabel = 'en'"]]
f1 --> v2
v3 --"wdt:P921"--> c4
v3 --"wdt:P921"--> c5
v3 --"rdfs:label"--> v2
bind2[/"if(regex(?itemLabel,'.*(tuberculosis).*(tuberculosis).*'),'both','just MT')"/]
v2 --o bind2
bind2 --as--o v4