Skip to content

Build and run

victor felder edited this page Mar 29, 2021 · 1 revision

Prerequisites

Ontodia can be run on Linux, MacOS and Windows. You will need git, node.js 6+ and npm 3+ installed. For help with installing node.js on your platform please consult, for example, this guide.

Installing dependencies

Before building or running Ontodia, you should install Ontodia dependencies, to do this run from the project directory:

npm install

Building Ontodia bundle

To build Ontodia bundle, you have to run npm task 'build'. This task will produce bundled version of Ontodia and TypeScript definitions without peer dependencies to use in your project (see TypeScript example and JavaScript example )

npm run build

When using Ontodia without any build pipeline, you need to have all dependencies bundled with Ontodia. You can do this by building Ontodia with BUNDLE_PEERS environment variable set. This command will do it on Linux/MacOS:

BUNDLE_PEERS=true npm run build

Running development version of Ontodia

If you want just to experiment with Ontodia API or make some changes to the library, it can be launched in development mode with many example configurations. Ontodia requires an access to data, and you have to provide a SPARQL endpoint URL in environment property. We've set a simple dataset at https://library-ontodia-org.herokuapp.com/sparql to use for demonstration purposes. You need to set SPARQL endpoint in environment variable 'SPARQL_ENDPOINT'. For launching development server there's a special 'demo' npm task.

Setting environment variable varies across operating systems.

For MacOS and Linux run:

SPARQL_ENDPOINT=https://library-ontodia-org.herokuapp.com/sparql npm run demo

For Windows run:

set SPARQL_ENDPOINT=https://library-ontodia-org.herokuapp.com/sparql
npm run demo

Upon starting, Ontodia will be accessible at http://localhost:10444/, to switch Ontodia to work with SPARQL endpoint data, select "sparql" from the top-right dropdown list.