lotus-sparql-examples

A set of SPARQL examples that are used in LOTUS

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

wd_nps_bioactivity

rq turtle/ttl

Bioactive compounds isolated from Actinomycetes (Q62606918), between 2014 and 2019, with related taxa and references.

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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
#title: Bioactive compounds isolated from Actinomycetes (Q62606918), between 2014 and 2019, with related taxa and references.
SELECT ?taxon ?taxon_name ?compound ?compound_smiles ?bioactivity ?isolation_reference ?reference_title WHERE {
    ?taxon (wdt:P171*) wd:Q62606918;
    wdt:P225 ?taxon_name.
    ?compound wdt:P235 ?compound_id;
    wdt:P233 ?compound_smiles;
    p:P703 ?statement;
    (wdt:P2868/wdt:P486) ?meshId.
    ?mesh wdt:P486 ?meshId;
    rdfs:label ?bioactivity.
    FILTER(LANGMATCHES(LANG(?bioactivity), "EN"))
    ?statement ps:P703 ?taxon;
    prov:wasDerivedFrom ?ref.
    ?ref pr:P248 ?isolation_reference.
    ?isolation_reference wdt:P1476 ?reference_title;
    wdt:P577 ?reference_date.
    FILTER(((YEAR(?reference_date)) >= 2014 ) && ((YEAR(?reference_date)) <= 2019 ))
}
LIMIT 10000

graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?bioactivity"):::projected 
  v5("?compound"):::projected 
  v6("?compound_id")
  v7("?compound_smiles"):::projected 
  v12("?isolation_reference"):::projected 
  v10("?mesh")
  v9("?meshId")
  v11("?ref")
  v1("?reference_date")
  v13("?reference_title"):::projected 
  v8("?statement")
  v3("?taxon"):::projected 
  v4("?taxon_name"):::projected 
  a1((" "))
  c5(["wd:Q62606918"]):::iri 
  f0[["year-from-dateTime(?reference_date) >= '2014^^xsd:integer'year-from-dateTime(?reference_date) <= '2019^^xsd:integer'"]]
  f0 --> v1
  f1[["langmatch(?bioactivity,'EN')"]]
  f1 --> v2
  v3 --"p:direct/P171"-->  c5
  v3 --"p:direct/P225"-->  v4
  v5 --"p:direct/P235"-->  v6
  v5 --"p:direct/P233"-->  v7
  v5 --"p:P703"-->  v8
  v5 --"p:direct/P2868"-->  a1
  a1 --"p:direct/P486"-->  v9
  v10 --"p:direct/P486"-->  v9
  v10 --"rdfs:label"-->  v2
  v8 --"p:statement/P703"-->  v3
  v8 --"prov:wasDerivedFrom"-->  v11
  v11 --"p:reference/P248"-->  v12
  v12 --"p:direct/P1476"-->  v13
  v12 --"p:direct/P577"-->  v1