-
Notifications
You must be signed in to change notification settings - Fork 9
Quick start
To quickly start experimenting with Ontodia, there are two options:
- use prepared JSFiddle at https://jsfiddle.net/yf8jg0k0/25/
- clone sources, compile and run it locally
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.
When everything's installed, run these commands
git clone https://github.com/ontodia-org/ontodia.git
cd ontodia
npm install
This will get you Ontodia sources, and install all of its dependencies.
Ontodia needs to have an access to data, therefore 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 have to set SPARQL endpoint in the environment variable 'SPARQL_ENDPOINT'. After that we're going to launch development server, which will compile TypeScript sources, bundle necessary dependencies and launch simple HTTP server.
The steps for setting environment variable vary 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
Output should be as follows (truncated):
> ontodia@0.4.0-dev.20170307 demo /home/yuricus/research/testOntodia/ontodia
> node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --port 10444 --config webpack.demo.config.js --content-base dist/
http://localhost:10444/webpack-dev-server/
webpack result is served from /
content is served from /home/yuricus/research/testOntodia/ontodia/dist
ts-loader: Using typescript@2.1.4 and /home/yuricus/research/testOntodia/ontodia/tsconfig.json
....
....
Child html-webpack-plugin for "wikidataGraph.html":
chunk {0} wikidataGraph.html 530 kB [rendered]
[0] ./~/html-webpack-plugin/lib/loader.js!./src/examples/template.ejs 2.85 kB {0} [built]
[1] ./~/lodash/lodash.js 527 kB {0} [built]
[2] (webpack)/buildin/module.js 251 bytes {0} [built]
webpack: Compiled successfully.
Point your browser to http://localhost:10444/sparql.html and you should see following screen:
To modify calls to Ontodia API, change src/examples/sparql.ts, it will be recompiled and browser window would be updated automatically.
To close development center, send interrupt Ctrl+C (Cmd+C) in the console.