A set of SPARQL examples that are used in different SIB resources
List interactions and traits of all species which have an IUCN status (wdt:P141) of near threatened (wd:Q719675).
PREFIX emi: <https://purl.org/emi#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX sosa: <http://www.w3.org/ns/sosa/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX qudt: <https://qudt.org/2.1/schema/qudt#>
SELECT DISTINCT ?source_wd ?sourceName ?tryDataLab ?tryDataVal ?unit ?unitComment WHERE {
?trySpObs sosa:isSampleOf ?source_trySpName ; #retrieve trait/non-trait data from trydb for trySpName (scientific name of plant species as listed in trydb)
rdfs:label ?sourceName ;
sosa:isFeatureOfInterestOf ?tryObId .
?source_trySpName emi:inTaxon ?source_wd . #retrieve wikidata-id for trySpName
?tryObId sosa:hasResult ?tryData .
?tryData rdfs:label ?tryDataLab ;
rdf:type emi:Trait ; #filter data which is labelled as 'Trait'
rdf:value ?tryDataVal ; #retrieve values for Trait data
qudt:hasUnit ?unit . #retrieve units for Trait data
OPTIONAL {
?tryData rdfs:comment ?unitComment .
} #retrieve comments (containing original unprocessed unit information - necessary for understanding some data) for Trait data
SERVICE <https://qlever.cs.uni-freiburg.de/api/wikidata> {
?source_wd wdt:P141 wd:Q719675 . #filter wikidata-ids for trySpName, which have IUCN status (wdt:P141) as near threatened (wd:Q719675)
}
}