adsabs / resolver_service

Linkout service to provide users with links to external resources such as publisher's full text, data links, etc.
MIT License
1 stars 5 forks source link

Build Status Coverage Status

ADS Resolver Service

Short Summary

This microservice provides links to external resources such as publisher's full text, data links, etc.

Setup (recommended)

$ virtualenv python
$ source python/bin/activate
$ pip install -r requirements.txt
$ pip install -r dev-requirements.txt
$ vim local_config.py # edit, edit
$ alembic upgrade head # initialize database

Testing

On your desktop run:

$ py.test

API

Make a GET request with a bibcode to return all links associated with that bibcode:

curl -H "Authorization: Bearer <your API token>" -X GET https://api.adsabs.harvard.edu/v1/resolver/<bibcode>

For example to return all links associated with 2017arXiv170909566R, you would do

curl -H "Authorization: Bearer <your API token>" -X GET https://api.adsabs.harvard.edu/v1/resolver/2017arXiv170909566R

Make a GET request with a bibcode and link type to return all links of the type specified associated for that bibcode:

curl -H "Authorization: Bearer <your API token>" -X GET https://api.adsabs.harvard.edu/v1/resolver/<bibcode>/<link_type>

For example to return links for all full text sources, you would do

curl -H "Authorization: Bearer <your API token>" -X GET https://api.adsabs.harvard.edu/v1/resolver/2013MNRAS.435.1904M/esource

Available Link Types:

<link_type> is one of the following (case-insensitive):

Identification Link Types:

Please note that these links types' endpoints differ slightly from the rest of link types:

curl -H "Authorization: Bearer <your API token>" -X GET https://api.adsabs.harvard.edu/v1/resolver/<bibcode>/<Identification Link Type>:<id>

where Identification Link Types are: doi or arXiv and id is their respective identification. For example

curl -H "Authorization: Bearer <your API token>" -X GET https://dev.adsabs.harvard.edu/v1/resolver/2010ApJ...713L.103B/doi:10.1088/2041-8205/713/2/L103
curl -H "Authorization: Bearer <your API token>" -X GET https://dev.adsabs.harvard.edu/v1/resolver/2018arXiv180303598K/arXiv:1803.03598

Insert/Update records in db (internal use only):

curl -H "Authorization: Bearer <your API token>" -X PUT https://api.adsabs.harvard.edu/v1/resolver/update -d @dataLinksRecordList.json -H "Content-Type: application/json"

where dataLinksRecordList.json contains data in the format of protobuf structure DataLinksRecordList.

Maintainer(s)

Golnaz