Skip to content

Instantly share code, notes, and snippets.

@rdmpage
Last active October 3, 2018 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rdmpage/d2eb8dc17b7a8f18f11dff33a869fa1d to your computer and use it in GitHub Desktop.
Save rdmpage/d2eb8dc17b7a8f18f11dff33a869fa1d to your computer and use it in GitHub Desktop.
OpenBioDiv query to get specimens from MNRJ

OpenBioDiv query to get specimens from MNRJ

Query by Viktor Senderov:

"In order to illustrate the capabilities of OpenBiodiv and draw attention to the impact of the tragically lost collection of the Museu Nacional de Rio de Janeiro (MNRJ), I can ask our system to give me the number of times a specimen from that collection was used in a taxonomic article, and in which ones."

http://big4-project.eu/news/11665_blog-post-openbiodiv-the-semantic-web-comes-to-biodiversity-informatics/

See query at https://goo.gl/4ovg2o

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX openbiodiv: <http://openbiodiv.net/>
PREFIX pkm: <http://proton.semanticweb.org/protonkm#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX po: <http://www.essepuntato.it/2008/12/pattern#>
PREFIX : <http://www.ontotext.com/connectors/lucene#>
PREFIX fabio: <http://purl.org/spar/fabio/>
PREFIX dcelements: <http://purl.org/dc/elements/1.1/>
PREFIX dwc: <http://rs.tdwg.org/dwc/terms/>
PREFIX prism: <http://prismstandard.org/namespaces/basic/2.0/>
PREFIX dwciri: <http://rs.tdwg.org/dwc/iri/>
SELECT ?institution_name (COUNT( DISTINCT ?icu) AS ?times_mentioned) (COUNT(DISTINCT ?title) AS ?articles) (GROUP_CONCAT(DISTINCT ?title; SEPARATOR=", ") AS ?doi_of_articles) (GROUP_CONCAT(DISTINCT ?name; SEPARATOR=", ") AS ?names_mentioned) (COUNT (DISTINCT ?name) AS ?number_of_taxa)
{
?s rdf:type openbiodiv:ScientificName ;
rdfs:label ?name .
?tnu pkm:mentions ?s .
BIND("Museu Nacional de Rio de Janeiro (MNRJ)" as ?institution_name)
?icu rdf:type openbiodiv:InstitutionalCodeUsage ;
dwc:institutional_code "MNRJ" .
?container po:contains ?icu, ?tnu ;
rdf:type fabio:JournalArticle ;
prism:doi ?title .
} GROUP BY ?institution_name
ORDER BY DESC (?times_mentioned)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment