lotus-sparql-examples

A set of SPARQL examples that are used in LOTUS

View the Project on GitHub lotusnprod/lotus-sparql-examples

wd_drugs_taxon_medline

rq turtle/ttl

Drugs (in Medline) found in taxa.

Use at


PREFIX p: <http://www.wikidata.org/prop/>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
#title: Drugs (in Medline) found in taxa.
SELECT DISTINCT ?drug ?inchikey ?medlineDrugId WHERE {
    ?drug wdt:P235 ?inchikey;
    wdt:P10245 ?medlineDrugId;
    p:P703[
    ps:P703 ?taxon;
    (prov:wasDerivedFrom/pr:P248) ?reference ].
    FILTER (?taxon != wd:Q15978631) # exclude drugs found in Homo sapiens
}

graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?drug"):::projected 
  v3("?inchikey"):::projected 
  v4("?medlineDrugId"):::projected 
  v5("?reference")
  v1("?taxon")
  a1((" "))
  a2((" "))
  f0[["?taxon != 'wd:Q15978631'"]]
  f0 --> v1
  v2 --"p:direct/P235"-->  v3
  v2 --"p:direct/P10245"-->  v4
  a1 --"p:statement/P703"-->  v1
  a1 --"prov:wasDerivedFrom"-->  a2
  a2 --"p:reference/P248"-->  v5
  v2 --"p:P703"-->  a1