gbif-api
gbif-api copied to clipboard
Make GBIF API compatible with semantic web a.k.a. Linked Open Data (LOD)
As you probably know, LOD is a way to create semantic links between datasets, with relatively standard auto-describing vocabularies. As with ordinary web API's, this is also a way to decouple the data and the application(s). So, connecting GBIF data to standard LOD syntaxes and vocabularies can lead to many unforeseen use cases. My current first use case is to make maps with both my LOD botanical observations and GBIF observations.
I started mapping the GBIF JSON to standard LOD vocabularies in this project, using JSON-LD technique (see also https://json-ld.org/ ), which provides a LOD "reading grid" for the plain JSON data: https://github.com/jmvanel/rdf-convert/tree/master/gbif.org I hope I have your blessing.
To make things smoother technically, there are a few things that you could do.
- The more annoying is that most id's in your JSON are integers; it would be more convenient for JSON-LD tools if they were strings.
- Also, you could add new JSON-LD keys in the API :
@id , @type
. - After that, you could expose the JSON-LD side of your JSON URL's by one of the ways here:
https://www.w3.org/TR/json-ld/#modifying-behavior-with-link-relationships
or simply add an "
@context
" key in the JSON.
I hope I made an issue in the relevant github project .
NOTE: I also wrote a translator from GBIF DW archive to RDF (Turtle) : https://github.com/jmvanel/dwca-rdf but having RDF URL's like I propose here is more in line with the Semantic Web architecture.
For now, I studied the /occurrence and /species API's. My proposal could turn the gbif.org API into a regular citizen of the Web of Data (a.k.a. Linked Open Data). This is, web client programs will be able to get RDF triples from the existing URL's from gbif.org API , and recursively the triples obtained will refer to URL's that also return RDF triples. See famous Tim Berners Lee 5 stars mug page : https://www.w3.org/DesignIssues/LinkedData.html
There are 3 scenarios for using JSON-LD in gbif.org API .
- not changing anything, but be add this in documentation and be aware of the possibilities by external JSON-LD processors and discuss use cases and the big picture (LOD versus frictionlessdata.io, etc)
- just add at root an
@context
key - in addition add
@id
and@type
(see below)
The @context
key could point to my work-in-progress JSON-LD in github.com/jmvanel/rdf-convert/gbif.org , or more probably to a properly versioned URL :
"@context" : "https://raw.githubusercontent.com/jmvanel/rdf-convert/master/gbif.org/context.jsonld"
For a concrete proposal, here are key - value pairs for @id
and @type
that could be added to
https://api.gbif.org/v1/occurrence/1258202889 .
This would make more visible the URI, which could a be problem for API users (?) . But this would simplify the @context
. Note that the existing ID's being integers, wich is not taken in account by JSON-LD API recommendation at the moment, will be soon not a problem , I made an issue for that .
"@id" : "1258202889"
"@type" : "dwc:PreservedSpecimen"
For your understanding of JSON-LD , given above @context
, this is equivalent to
"@id" : "https://api.gbif.org/v1/occurrence/1258202889"
"@type" : "http://rs.tdwg.org/dwc/terms/PreservedSpecimen"