gbfs2ld

0.0.15 • Public • Published

gbfs2ld

Converts GBFS data to Linked Data in compliance to the gbfs ontology.

Installing

npm install --save gbfs2ld

Command line usage

node gbfs2ld --help

Library usage

const gbfs2ld = require('gbfs2ld');

gbfs2ld({
    autodiscoveryFile: 'https://example.com/gbfs.json',
    urisTemplate: template,
}).then((result) => {
    console.log(result);
})
  • autodiscoveryFile: path to a gbfs autodiscoveryfile. This can either be local or remote. Note that all data mentioned in the autodiscoveryfile can also be local or remote. If your data doesn't have an autodiscoveryfile, you will have to create one either locally or on your website.
  • urisTemplate: Defines what url's should be used for the different entities of the system. See the example below for more information.
  • outdir (opt.): When an output directory is specified the output will be writen to the given directory. When no output directory is given, the result will be returned by the promise.

Uri template

Defines what url's should be used for the different entities of the gbfs data. It should contain templates for the following properties: system, stations, bikes, system_hours, regions, alerts, calendars, plans.

Example:

{
    "system": "http://example.org/system",
    "stations": "http://example.org/station/",
    "bikes": "http://example.org/bike/",
    "system_hours": "http://example.org/system_hours/",
    "regions": "http://example.org/region/",
    "alerts": "http://example.org/alert/",
    "calendars": "http://example.org/calendar/",
    "plans": "http://example.org/plan/"
}

Readme

Keywords

none

Package Sidebar

Install

npm i gbfs2ld

Weekly Downloads

89

Version

0.0.15

License

ISC

Unpacked Size

55.5 kB

Total Files

23

Last publish

Collaborators

  • amohoste