lotus-sparql-examples

A set of SPARQL examples that are used in LOTUS

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

wd_nps_source

rq turtle/ttl

Referenced compound-taxon pairs (limited to 1000 results).

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 wdt: <http://www.wikidata.org/prop/direct/>
#title: Referenced compound-taxon pairs (limited to 1000 results).
SELECT DISTINCT ?compound ?compound_inchikey ?taxon ?taxon_name ?reference ?reference_doi WHERE {
    ?compound wdt:P235 ?compound_inchikey;       # get the inchikey
    p:P703[                                        # statement found in taxon
    ps:P703 ?taxon;                                # get the taxon
    (prov:wasDerivedFrom/pr:P248) ?reference ].    # get the reference
    ?taxon wdt:P225 ?taxon_name.                   # get the taxon scientific name
    ?reference wdt:P356 ?reference_doi.            # get the reference DOI
}
LIMIT 1000

graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v1("?compound"):::projected 
  v2("?compound_inchikey"):::projected 
  v4("?reference"):::projected 
  v6("?reference_doi"):::projected 
  v3("?taxon"):::projected 
  v5("?taxon_name"):::projected 
  a1((" "))
  a2((" "))
  v1 --"p:direct/P235"-->  v2
  a1 --"p:statement/P703"-->  v3
  a1 --"prov:wasDerivedFrom"-->  a2
  a2 --"p:reference/P248"-->  v4
  v1 --"p:P703"-->  a1
  v3 --"p:direct/P225"-->  v5
  v4 --"p:direct/P356"-->  v6