sparql-examples

SPARQL examples for the EMI

View the Project on GitHub earth-metabolome-initiative/sparql-examples

9

rq turtle/ttl

Which samples have features annotated as Aspidosperma_type alkaloids by CANOPUS with a probability score above 0.5, ordered by the decreasing count of features?

Use at

PREFIX enpkg: <https://enpkg.commons-lab.org/kg/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT (COUNT(DISTINCT(?feature)) as ?count)
WHERE
        {   
        ?feature rdf:type enpkg:LCMSFeature .
                ?feature enpkg:has_canopus_annotation ?annotation .
        }
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?annotation")
  v3("?count")
  v1("?feature"):::projected 
  c2(["enpkg:LCMSFeature"]):::iri 
  v1 --"a"-->  c2
  v1 --"enpkg:has_canopus_annotation"-->  v2
  bind1[/"count(?feature)"/]
  v1 --o bind1
  bind1 --as--o v3