query-00bd22e21c41b83c0c69fa32e0f4b38c

rq turtle/ttl

Co-occurrence filtered by the condition "disease term before drug term" and character distance apart < 100 SELECT ?articletitle ?disease ?drug ?charnumber1 ?charnumber2 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:P10 ?charnumber1. ?anchor2 wdt:P10 ?charnumber2. ?anchor1 wdt:P12 ?article. ?anchor2 wdt:P12 ?article. ?article wdt:P20 ?articletitle. FILTER (?charnumber2 > ?charnumber1) FILTER (?charnumber2 - ?charnumber1) < 100) SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Co-occurrence filtered by the condition "disease term before drug term" and character distance apart < 100
SELECT ?articletitle ?disease ?drug ?charnumber1 ?charnumber2
  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:P10 ?charnumber1.
         ?anchor2 wdt:P10 ?charnumber2.
         ?anchor1 wdt:P12 ?article.
         ?anchor2 wdt:P12 ?article.
         ?article wdt:P20 ?articletitle.
         FILTER (?charnumber2 > ?charnumber1)
         FILTER (?charnumber2 - ?charnumber1) < 100)
         SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
         }

Query found at