A set of SPARQL examples that are used in different SIB resources
Among the SIRIUS structural annotations from Tabernaemontana coffeoides (Apocynaceae) seeds extract, which ones are reported in the Tabernaemontana genus?
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX sosa: <http://www.w3.org/ns/sosa/>
PREFIX emi: <https://purl.org/emi#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
SELECT DISTINCT ?ik2d ?genus
WHERE
{
?material sosa:hasSample ?extract ;
sosa:isSampleOf ?organe .
?organe emi:inTaxon ?wd_sp .
?wd_sp rdfs:label "tabernaemontana coffeoides" .
?extract sosa:isFeatureOfInterestOf ?lcms .
?lcms sosa:hasResult ?feature_list .
?feature_list emi:hasLCMSFeature ?feature .
?feature emi:hasAnnotation ?sirius_annotation .
?sirius_annotation a emi:StructuralAnnotation ;
prov:wasGeneratedBy ?activity ;
emi:hasChemicalStructure ?ik2d .
?activity prov:wasAssociatedWith <https://bio.informatik.uni-jena.de/software/sirius> .
?ik2d emi:hasSMILES ?smiles ;
emi:isInChIKey2DOf ?ik .
?ik emi:isInChIKeyOf ?wd_id .
{
SELECT DISTINCT ?wd_id ?genus WHERE {
?material sosa:hasSample ?extract ;
sosa:isSampleOf ?organe .
?organe emi:inTaxon ?wd_sp .
?wd_sp rdfs:label "tabernaemontana coffeoides" .
# OPTIONAL {
SERVICE <https://query.wikidata.org/sparql> {
?wd_sp wdt:P225 ?species_name .
?genus wdt:P31 wd:Q16521 ;
wdt:P105 wd:Q34740 ;
^wdt:P171* ?wd_sp .
?childtaxa wdt:P171* ?genus .
?wd_id wdt:P703 ?childtaxa
}
# }
} LIMIT 100
}
}