query-4e93d0d5ef2b8d26a16bdfafbeaba87c
Infectious diseases, related drugs, filtered co-occurrence
PREFIX ss: http://sciencesource.wmflabs.org/entity/ PREFIX sst: http://sciencesource.wmflabs.org/prop/direct/
SELECT ?item1 ?item2 ?str1 ?str2 WHERE {
?item1 wdt:P31 wd:Q12136; wdt:P1995 ?medspec. ?medspec wdt:P361* wd:Q788926 . ?item2 wdt:P31 wd:Q12140; wdt:P2175 ?condition. ?condition wdt:P1995 wd:Q788926. MINUS {?item2 wdt:P2175 ?item1}. BIND(substr(str(?item1),32) AS ?str1) . BIND(substr(str(?item2),32) AS ?str2) .
SERVICE http://sciencesource-query.wmflabs.org/proxy/wdqs/bigdata/namespace/wdq/sparql {?annotation1 sst:P16 "infectiousdiseases"; sst:P2 ?str1; sst:P3 ss:Q5. ?annotation2 sst:P16 "infectiousdiseasesdrugs"; sst:P2 ?str2; sst:P3 ss:Q5. ?annotation1 sst:P19 ?anchor1. ?annotation2 sst:P19 ?anchor2. ?anchor1 sst:P12 ?article; sst:P3 ss:Q2. ?anchor2 sst:P12 ?article; sst:P3 ss:Q2. ?article sst:P3 ss:Q4. ?anchor1 sst:P10 ?charnumber1. ?anchor2 sst:P10 ?charnumber2. FILTER (?charnumber2 - ?charnumber1 = 100) }
} LIMIT 10
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
#Infectious diseases, related drugs, filtered co-occurrence
PREFIX ss: <http://sciencesource.wmflabs.org/entity/>
PREFIX sst: <http://sciencesource.wmflabs.org/prop/direct/>
SELECT ?item1 ?item2 ?str1 ?str2
WHERE {
?item1 wdt:P31 wd:Q12136;
wdt:P1995 ?medspec.
?medspec wdt:P361* wd:Q788926 .
?item2 wdt:P31 wd:Q12140;
wdt:P2175 ?condition.
?condition wdt:P1995 wd:Q788926.
MINUS {?item2 wdt:P2175 ?item1}.
BIND(substr(str(?item1),32) AS ?str1) .
BIND(substr(str(?item2),32) AS ?str2) .
SERVICE <http://sciencesource-query.wmflabs.org/proxy/wdqs/bigdata/namespace/wdq/sparql>
{?annotation1 sst:P16 "infectiousdiseases";
sst:P2 ?str1;
sst:P3 ss:Q5.
?annotation2 sst:P16 "infectiousdiseasesdrugs";
sst:P2 ?str2;
sst:P3 ss:Q5.
?annotation1 sst:P19 ?anchor1.
?annotation2 sst:P19 ?anchor2.
?anchor1 sst:P12 ?article;
sst:P3 ss:Q2.
?anchor2 sst:P12 ?article;
sst:P3 ss:Q2.
?article sst:P3 ss:Q4.
?anchor1 sst:P10 ?charnumber1.
?anchor2 sst:P10 ?charnumber2.
FILTER (?charnumber2 - ?charnumber1 = 100)
}
}
LIMIT 10