Skip to content

Getting started

dabo505 edited this page Sep 29, 2021 · 6 revisions

If you are not fluent with Node.js & NPM read more about how to create a package.json file. Once you understand the basics and created a basic package.json file with npm init, you can install your first external dependency: barnard59. Do this by running:

npm install --save barnard59 barnard59-formats barnard59-http

This will fetch barnard59, barnard59-formats, and among others barnard59-core and barnard59-base. This is all we need to run the first example. To get this, copy or download the fetch-json-to-ntriples example from the examples directory in the root directory of your folder where you installed barnard59.

The fastest way to run it, is with npx. Once you installed it, you can run the example by typing

npx barnard59 run fetch-json-to-ntriples.ttl --pipeline http://example.org/pipeline/utc

in your console.

Alternatively you can add a "scripts"-field and copy this line to the scripts section of your package.json:

"start": "barnard59 run fetch-json-to-ntriples.ttl --pipeline http://example.org/pipeline/utc"

If you now type npm run start, you should get the following output on your console:

$ npm run start

> barnard@1.0.0 start /Users/someone/pipeline-test
> barnard59 run fetch-json-to-ntriples.ttl --format text/turtle --pipeline http://example.org/pipeline/utc

<http://worldtimeapi.org/api/timezone/etc/UTC> <http://purl.org/dc/elements/1.1/date> "2019-11-28T17:58:07.101392+00:00" .

This pipeline converts a JSON result from the API at http://worldtimeapi.org/api/timezone/etc/UTC to (minimal) RDF.

If you want to automate a pipeline, continue in the automation page and learn about running a pipeline in Docker & CI/CD.

For a more complex example we provide a simple pipeline that converts CSV files to RDF using the CSV on the Web specification for describing the mapping.

Clone this wiki locally