sparql-examples

A set of SPARQL examples that are used in different SIB resources

View the Project on GitHub sib-swiss/sparql-examples

005

How many features have the same SIRIUS and ISDB annotation?

Use at

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX enpkg: <https://enpkg.commons-lab.org/kg/>
PREFIX emi: <https://purl.org/emi#>

SELECT (COUNT(?feature) AS ?count)
WHERE {
        ?lcms emi:hasMassiveDOI ?massive_doi ;
            emi:hasLCMSFeatureSet ?feature_list .
        # FILTER(regex(str(?massive_doi), "MSV000087728")) # MassIVE id filter, MSV000087728 is pf1600, MSV000093464 is 337 Korean medicinal plants, if you want to query both you can pipe "MSV000087728|MSV000093464". You can apply or not these filters by ucommenting/commenting this line.
        ?feature_list emi:hasLCMSFeature ?feature .
        ?feature emi:hasAnnotation ?sirius_annotation .
        ?sirius_annotation a emi:StructuralAnnotation ;
            prov:wasGeneratedBy ?activity ;
            emi:hasChemicalStructure ?sirius_ik2d .
        ?activity prov:wasAssociatedWith <https://bio.informatik.uni-jena.de/software/sirius> .
        ?feature emi:hasAnnotation ?isdb_annotation .
        ?activity_isdb prov:wasAssociatedWith <https://oolonek.github.io/ISDB> .
        ?isdb_annotation a emi:StructuralAnnotation ;
            prov:wasGeneratedBy ?activity_isdb ;
            emi:hasChemicalStructure ?isdb_ik2d .
    FILTER(?isdb_ik2d = ?sirius_ik2d) .
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v8("?activity")
  v10("?activity_isdb")
  v11("?count")
  v6("?feature"):::projected 
  v5("?feature_list")
  v9("?isdb_annotation")
  v1("?isdb_ik2d")
  v3("?lcms")
  v4("?massive_doi")
  v7("?sirius_annotation")
  v2("?sirius_ik2d")
  c11([https://oolonek.github.io/ISDB]):::iri 
  c6(["emi:StructuralAnnotation"]):::iri 
  c10([https://bio.informatik.uni-jena.de/software/sirius]):::iri 
  f0[["?isdb_ik2d = ?sirius_ik2d"]]
  f0 --> v1
  f0 --> v2
  v3 --"emi:hasMassiveDOI"-->  v4
  v3 --"emi:hasLCMSFeatureSet"-->  v5
  v5 --"emi:hasLCMSFeature"-->  v6
  v6 --"emi:hasAnnotation"-->  v7
  v7 --"a"-->  c6
  v7 --"prov:wasGeneratedBy"-->  v8
  v7 --"emi:hasChemicalStructure"-->  v2
  v8 --"prov:wasAssociatedWith"-->  c10
  v6 --"emi:hasAnnotation"-->  v9
  v10 --"prov:wasAssociatedWith"-->  c11
  v9 --"a"-->  c6
  v9 --"prov:wasGeneratedBy"-->  v10
  v9 --"emi:hasChemicalStructure"-->  v1
  bind2[/"count(?feature)"/]
  v6 --o bind2
  bind2 --as--o v11