query-a0a00b3b156db784ac7026b8b78ab3d8
Co-occurrence of drug and disease terms (duplications removed) SELECT DISTINCT ?articletitle ?disease ?drug WHERE {?term1 wdt:P19 ?anchor1. ?term2 wdt:P19 ?anchor2. ?term1 wdt:P15 ?disease. ?term2 wdt:P15 ?drug. ?term1 wdt:P16 "infectiousdiseases". ?term2 wdt:P16 "infectiousdiseasesdrugs". ?anchor1 wdt:P12 ?article. ?anchor2 wdt:P12 ?article. ?article wdt:P20 ?articletitle. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Co-occurrence of drug and disease terms (duplications removed)
SELECT DISTINCT ?articletitle ?disease ?drug
WHERE {?term1 wdt:P19 ?anchor1.
?term2 wdt:P19 ?anchor2.
?term1 wdt:P15 ?disease.
?term2 wdt:P15 ?drug.
?term1 wdt:P16 "infectiousdiseases".
?term2 wdt:P16 "infectiousdiseasesdrugs".
?anchor1 wdt:P12 ?article.
?anchor2 wdt:P12 ?article.
?article wdt:P20 ?articletitle.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?anchor1")
v4("?anchor2")
v7("?article")
v8("?articletitle"):::projected
v5("?disease"):::projected
v6("?drug"):::projected
v1("?term1")
v3("?term2")
c9(["bd:serviceParam"]):::iri
c4(["infectiousdiseases"]):::literal
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c5(["infectiousdiseasesdrugs"]):::literal
v1 --"wdt:P19"--> v2
v3 --"wdt:P19"--> v4
v1 --"wdt:P15"--> v5
v3 --"wdt:P15"--> v6
v1 --"wdt:P16"--> c4
v3 --"wdt:P16"--> c5
v2 --"wdt:P12"--> v7
v4 --"wdt:P12"--> v7
v7 --"wdt:P20"--> v8
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end