Badges for computational geoscience containers
1.9K
API for retrieving scalable badges for scientific publications. Used by the o2r-extender, which is a Chrome extension that integrates these badges into several research aggregators.
Based on the Badges for computational geoscience containers study project at ifgi. We thank the project team for their contributions for this project.
executable: Information about executability and reproducibility of a publication.licence: The license type.spatial: Where research took place.releasetime: The publication date.peerreview: If and by which process the publication was peer reviewed.Services and what they are used for:
Note that the badger will only find results if the respective service has the publication listed.
>= 6.2 and npm (optional; for development)There are three options to get the badger running on your system.
docker pull o2rproject/o2r-badger
# Start the badger:
docker run -it -e DEBUG=* -p 8089:8089 o2rproject/o2r-badger
First, clone the repository: git clone https://github.com/o2r-project/o2r-badger
This project includes a Dockerfile which can be built with:
docker build -t badger -f Dockerfile.local .
## Start the badger:
docker run -it -e DEBUG=* -p 8089:8089 badger
git clone https://github.com/o2r-project/o2r-badger
cd o2r-badger
npm install --production
# Start the badger:
DEBUG=* npm start
The badger is running and can be accessed via http://localhost:8089/. To display badges for common research aggregators, install the o2r-extender, a chrome extension. More info here
curl http://localhost:8089/api/1.0/badge/peerreview/10.5194%2Fgmdd-8-3905-2015
Returns a small badge for the DOI 10.5194/gmdd-8-3905-2015:
curl -o output.svg -H "Content-Type: application/json" --data '{
"id":"opxYU",
"created":"2016-08-19T13:59:13.134Z",
"metadata":{
"licence":{
"data":"Against-DRM",
"text":"CC-BY-4.0",
"code":"AAL"
}
}
}' http://localhost:8089/api/1.0/badge/licence/extended
Will return a big badge for the license data contained in the json document (o2r compendium):
Small badges:
GET /api/1.0/badge/:type/:doi
The badger can also create a badge for information that is sent via a POST request (see the example above):
POST /api/1.0/badge/:type
Extended badges:
GET /api/1.0/badge/:type/:doi/extended
POST /api/1.0/badge/:type/extended
:type: Badge type, one of executable, spatial, licence, releasetime or peerreview:doi: A DOI to identify the publication, in the form 10.999/testThe DOI must be URL encoded!
format - The image format for extended badges. May be svg or pngwidth - The image width for extended badgesIf the badger finds no data for a given DOI a grey "n/a" badge is returned:
If there is an unexpected error during execution, or if the services are not accessbile, an error will be returned:
404 Not found
{"error":"error accessing crossref API"}
Most relevant configuration can be done via the following environment variables when starting the service.
They are picked up in the file config/config.js where all configuration settings can be changed.
BADGER_PORT
Defines the port the badger is listening to. Defaults to 8089.BADGER_O2R_HOST
The address used to query the o2r API . Defaults to https://o2r.uni-muenster.de.BADGER_TEST_ENDPOINT
The address used for tests. Defaults to http://localhostDISABLE_TRACKING
Disables Piwik API tracking when set to true. Defaults to false.PIWIK_TOKEN
The secret piwik token used to access the Piwik tracking server.Other settings in config.js without corresponding environment variable:
c.net.proxy
Proxy used for all outgoing requests (o2r, crossref, doaj). Not tested.c.ext.crossref
Crossref API endpoint.c.ext.o2r
o2r endpoint. Can be modified via BADGER_O2R_HOST.c.ext.doajArticles and c.ext.doajJournals
DOAJ search endpoint for articles and journals.Additional Piwik API tracking settings:
c.tracking.piwikURL
Piwik server address.c.tracking.piwikBaseURL
Piwik base URL which is prepended to all API routes.c.tracking.piwikSiteID
Piwik site ID. Can be found in the piwik tracking code.The badger tracks API requests using Piwik except for requests with a "do not track" header.
A (local) piwik server can be set up manually or using Docker Compose.
First install the badger locally:
npm install
Then start it with npm start or in your development environment.
For tests run npm test.
This work is based on the study project "Badges for computational geoscience containers", see here and the original code repos. We thank the valuable contributions of the students in this project.
This project provides an API for retrieving a scalable badge as svg or png.
This badge will provide the user information about where a research took place. The base for receiving those information is a bounding box in json format. For the small badge, the mean center of the bounding box is calculated and sended via reverse geocoding to the geocoding service geonames.org. This service sends back the country and if available also the district. For the extended badge, the spatial information can be requested via the o2r API /spatial/o2r/:id/extended. When requesting the API, the user receives a Leaflet Map where the bounding box of the research location is highlighted.
The project developed an API for retrieving information on the executability of compendia. It was established in the context of the o2r project. The information about the executablility of a compendia are requested from the o2r API.
The project's aim is to provide an API, which gives information about the licencing of a research compendium.
The API is specified as: /api/1.0/badge/licence/:id/:extended?. With :id specifying the ID of the research compendium and :extended is optional. If extended is given in the URL, the big badges are sent to the client. Otherwise, small badges from shields.io are the response.
For licences of code (software) the list of licences available at Open Definition Licenses Service
with this json file is provided.
For licences of data and text of the research compendia the licences from Open Definition is used
with the list in this json file.
In this project we developed an API for retrieving badges which provide information about the release date of a compendium.
API to receive a release-badge for a compendium with a specific DOI (testing locally): http://localhost:8089/api/1.0/badge/releasetime/:id/
with id being an URL-encoded DOI of an published compendium. To receive a "big badge" for a paper page, "extended" has to be added at the end of the API.
The information about the release date are requested through the crossref API.
Creating badges to check if a journel is peer reviewed or not.
Components of our task:
The following API calls are supported (localhost might need to be replaced by a custom host name or IP address):
As you will notice currently the only service supported is DOAJ, with a DOI as identifier. An example request would be:
This project is licensed under Apache License 2.0.
Content type
Image
Digest
Size
74.3 MB
Last updated
about 9 years ago
docker pull o2rproject/o2r-badger