0.3.0 • Published 3 years ago

edam2json-js v0.3.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

edam2json-js

Javascript library to convert EDAM to different formats JSON/TSV/CSV. Used both as a cli and a browser-compatible package.

Installation

$ yarn add edam2json-js

or

$ npm install edam2json-js

Importing/Requiring

import { jsonTreeFromURL } from "edam2json-js";

or

const jsonTreeFromURL = require("edam2json-js").jsonTreeFromURL;

Usage

As a browser package

jsonTreeFromURL is a function that takes a url (with .owl extention) as a first argument and outputs the converted json tree to the onSuccess function passed as a second argument. The third argument is onError function to be excuted in case of error (e.g CORS errors)

const url =
  "https://raw.githubusercontent.com/edamontology/edamontology/main/EDAM_dev.owl";

jsonTreeFromURL(
  url,
  (tree) => {
    console.log(tree);
  },
  (err) => {
    console.log(err);
  }
);

As a cli

For converting OWL file to json tree of terms.

edam2json-js -jt EDAM_FILE_PATH [-o OUTPUT_FILE]

For converting OWL file to csv/tsv format.

edam2json-js -csv EDAM_FILE_PATH [-o OUTPUT_FILE]
edam2json-js -tsv EDAM_FILE_PATH [-o OUTPUT_FILE]

License

MIT license

0.3.0

3 years ago

0.2.3

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.2.2

3 years ago

0.1.0

3 years ago