SPARQL queries to Geospecies

Submitted by admin on Tue, 02/16/2016 - 17:21

The dataset is online here

http://lod.geospecies.org/

but the dump file is available here

https://datahub.io/dataset/geospecies

The dataset is organized in 5 taxonomic level: Specie, Genus, Familiy, Order, Class, Phylum, Kingdom. I consider "Specie" like the "instance level".
For the SPARQL queries I used the word "class" but remember it is not the same class of taxonomic level. Because of this reason, they used the word "bioclasses" as part of the respective URIs.

a) All set of "classes" derived from top taxonomic level "Kingdom"
<code>
SELECT ?rootclass ?class FROM <http://lod.geospecies.org&gt; {
?rootclass skos:narrowerTransitive+ ?class.
FILTER(!REGEX(?class, 'http://lod.geospecies.org/ses&#039;))
{
SELECT ?rootclass FROM <http://lod.geospecies.org&gt; {
?rootclass rdf:type <http://rdf.geospecies.org/ont/geospecies#KingdomConcept&gt;.
}
}
}

</code>

b) All "classes" from which <code> <http://lod.geospecies.org/ses/aF5ti&gt; </code> is a member

<code>
SELECT * {
?s skos:broaderTransitive+ ?class.
?s rdf:type <http://rdf.geospecies.org/ont/geospecies#SpeciesConcept&gt;.
FILTER (?s = <http://lod.geospecies.org/ses/aF5ti&gt;)
}
</code>

c) Number of "instances" by "class" = <code><http://lod.geospecies.org/bioclasses/aEbRZ></code&gt;

<code>
select ?class ?label count(?instance) as ?instance {
?class skos:narrowerTransitive+ ?instance.
?class <http://purl.org/dc/terms/title&gt; ?label.
?instance rdf:type <http://rdf.geospecies.org/ont/geospecies#SpeciesConcept&gt;.
FILTER(?class = <http://lod.geospecies.org/bioclasses/aEbRZ&gt;)
}
</code>

Etiquetas