No description, website, or topics provided.
Ruby JavaScript CSS
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
EPrints_plugin
lib
.ruby-version
Gemfile
Gemfile.lock
LICENSE.txt
README.md
app.rb
config.ru

README.md

RepositoryLinter

An entry to the Repositories Fringe 14 Developer Challenge by Rory McNicholl, Paul Mucur and Richard Wincewicz.

This is a small API that, given article metadata in the form of ePrints JSON, will consult various different services (see below) to pull as much missing data as possible.

## Usage

Post your article metadata as JSON to /validate to receive metadata in return:

$ curl localhost:4567/validate -d '{ "title": "Revisiting the River Skerne: the long-term social benefits of river rehabilitation" }'

Will return:

{
  "errors": [
    "Publisher field is missing",
    "ISSN field is missing",
    "Publication field is missing",
    "DOI field is missing",
    "Funders field is missing",
    "Creators field is missing"
  ],
  "dois": [
    {
      "title": "Revisiting the River Skerne: The long-term social benefits of river rehabilitation",
      "doi": "http://dx.doi.org/10.1016/j.landurbplan.2013.01.009"
    }
  ]
}

Installation

This is a Ruby web application using the Sinatra DSL. It has been tested on Ruby 2.1 but should work on any version above 1.9.2.

It uses Bundler to manages dependencies and will run using the Puma web server by default.

In order to use the SHERPA/RoMEO API, you must have an API key and specify this in your environment like so:

$ ROMEO_API_KEY=decafbad bundle exec puma

(You can request an API key if you do not already have one.)

Accepted fields

The input format to this API is based on EPrints JSON export and, as such, supports the following fields:

{
  "creators": [
    {
      "name": {
        "given": "Joe",
        "family": "Bloggs"
      }
    }
  ],
  "title": "Some great article",
  "publisher": "Publishing House",
  "id_number": "10.1234/test",
  "publication": "A great publication",
  "issn": "1234-5678"
}

It will return a list of possible field values in the following format:

{
    "errors": [
        "Publisher field is missing"
    ],
    "funders": [],
    "dois": [
        {
            "title": "foo",
            "doi": "http: //dx.doi.org/10.1234/test"
        }
    ],
    "title": [
        "Foo bar"
    ],
    "issn": [
        "1234-5678"
    ],
    "publishers": [
        {
            "name": "Publisher"
        }
    ],
    "publications": [
        {
            "title": "Journal name",
            "issn": "1234-5678"
        }
    ],
    "volume": [
        "113"
    ],
    "page": [
        "94-103"
    ],
    "authors": [
        {
            "family": "Bloggs",
            "given": "Joe"
        }
    ],
    "subjects": [
        "Management"
    ]
}

APIs used