query-1f8cde3d68a713b91e61dce994aa8aeb

rq turtle/ttl

Co-occurrence of ScienceSource annotations with known Wikidata drug-disease treatment pairs filtered out. PREFIX ss: http://sciencesource.wmflabs.org/entity/ PREFIX sst: http://sciencesource.wmflabs.org/prop/direct/

SELECT ?drugann ?drug ?diseaseann ?disease ?articletitle ?articledate WHERE { SERVICE http://sciencesource-query.wmflabs.org/proxy/wdqs/bigdata/namespace/wdq/sparql { ?diseaseann sst:P2 ?wdcode1; sst:P15 ?disease; sst:P16 "infectiousdiseases"; sst:P19 ?anchor1. ?drugann sst:P2 ?wdcode2; sst:P15 ?drug; sst:P16 "infectiousdiseasesdrugs"; sst:P19 ?anchor2.
?anchor1 sst:P10 ?charnumber1. ?anchor2 sst:P10 ?charnumber2. ?anchor1 sst:P12 ?article. ?anchor2 sst:P12 ?article. ?article sst:P17 ?articledate. ?article sst:P20 ?articletitle. FILTER (abs(?charnumber2 - ?charnumber1) < 200) } ?item1 wdt:P31 wd:Q12136. FILTER(str(?item1) = CONCAT("http://wikidata.org/entity/", ?wdcode1)) ?item2 wdt:P31 wd:Q11173. FILTER(str(?item2) = CONCAT("http://wikidata.org/entity/", ?wdcode2)) MINUS {?item2 wdt:P2175 ?item1} } LIMIT 100

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
#Co-occurrence of ScienceSource annotations with known Wikidata drug-disease treatment pairs filtered out.
PREFIX ss: <http://sciencesource.wmflabs.org/entity/>
PREFIX sst: <http://sciencesource.wmflabs.org/prop/direct/>

SELECT ?drugann ?drug ?diseaseann ?disease ?articletitle ?articledate
WHERE
 {
SERVICE <http://sciencesource-query.wmflabs.org/proxy/wdqs/bigdata/namespace/wdq/sparql>
  {      ?diseaseann sst:P2 ?wdcode1;
                     sst:P15 ?disease;
                     sst:P16 "infectiousdiseases";
                     sst:P19 ?anchor1.
         ?drugann sst:P2 ?wdcode2;
                  sst:P15 ?drug;
                  sst:P16 "infectiousdiseasesdrugs";
                  sst:P19 ?anchor2.       
         ?anchor1 sst:P10 ?charnumber1.
         ?anchor2 sst:P10 ?charnumber2.
         ?anchor1 sst:P12 ?article.
         ?anchor2 sst:P12 ?article.
         ?article sst:P17 ?articledate.
         ?article sst:P20 ?articletitle.
         FILTER (abs(?charnumber2 - ?charnumber1) < 200)
  }
   ?item1 wdt:P31 wd:Q12136.
   FILTER(str(?item1) = CONCAT("http://wikidata.org/entity/", ?wdcode1))
   ?item2 wdt:P31 wd:Q11173.
   FILTER(str(?item2) = CONCAT("http://wikidata.org/entity/", ?wdcode2))
   MINUS {?item2 wdt:P2175 ?item1}
   }
LIMIT 100

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v9("?anchor1") v12("?anchor2") v13("?article") v14("?articledate"):::projected v15("?articletitle"):::projected v6("?charnumber1") v5("?charnumber2") v8("?disease"):::projected v7("?diseaseann"):::projected v11("?drug"):::projected v10("?drugann"):::projected v3("?item1") v1("?item2") v4("?wdcode1") v2("?wdcode2") c7(["infectiousdiseases"]):::literal c9(["infectiousdiseasesdrugs"]):::literal c16(["wd:Q11173"]):::iri c15(["wd:Q12136"]):::iri f0[["str(?item2) = concat('http://wikidata.org/entity/',?wdcode2)"]] f0 --> v1 f0 --> v2 f1[["str(?item1) = concat('http://wikidata.org/entity/',?wdcode1)"]] f1 --> v3 f1 --> v4 subgraph s1["http://sciencesource-query.wmflabs.org/proxy/wdqs/bigdata/namespace/wdq/sparql"] style s1 stroke-width:4px; f2[["numeric-abs(?charnumber2 - ?charnumber1) < '200^^xsd:integer'"]] f2 --> v5 f2 --> v6 v7 --http://sciencesource.wmflabs.org/prop/direct/P2--> v4 v7 --http://sciencesource.wmflabs.org/prop/direct/P15--> v8 v7 --http://sciencesource.wmflabs.org/prop/direct/P16--> c7 v7 --http://sciencesource.wmflabs.org/prop/direct/P19--> v9 v10 --http://sciencesource.wmflabs.org/prop/direct/P2--> v2 v10 --http://sciencesource.wmflabs.org/prop/direct/P15--> v11 v10 --http://sciencesource.wmflabs.org/prop/direct/P16--> c9 v10 --http://sciencesource.wmflabs.org/prop/direct/P19--> v12 v9 --http://sciencesource.wmflabs.org/prop/direct/P10--> v6 v12 --http://sciencesource.wmflabs.org/prop/direct/P10--> v5 v9 --http://sciencesource.wmflabs.org/prop/direct/P12--> v13 v12 --http://sciencesource.wmflabs.org/prop/direct/P12--> v13 v13 --http://sciencesource.wmflabs.org/prop/direct/P17--> v14 v13 --http://sciencesource.wmflabs.org/prop/direct/P20--> v15 end v3 --"wdt:P31"--> c15 v1 --"wdt:P31"--> c16 subgraph minus3["MINUS"] style minus3 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P2175"--> v3 end