Detailed Installation - gsi-upm/demo-smartopendata GitHub Wiki
In this repository, we provide the source package for the SmartOpenData project. This version includes the SmartOpenData code application as well as its libraries. Before following this guide, make sure you meet the requirements listed next. This document should not describe the installation and configuration process of each of them. However, a list of links is provided for explaining how users can install and configure them.
1. INSTALL PACKAGES
The necessary packages to install this demo are:
- apache2
- default-jre
- default-jdk
- php5
- libapache2-mod-php5
- php-pear
- php5-dev
Using the apt-get install
utility is recommended.
2. DOWNLOAD THE SmartOpenData PACKAGE
Download or clone the SmartOpenData master package from our github repository (https://github.com/gsi-upm/demo-smartopendata/). Move it to $path
, where$path
corresponds to the Apache web directory (by default, this path is /var/www/html
). Note that once uncompressed, there will be two directories. Move the fuseki dir to another directory (ex. in /etc
or /opt
) in your system: do not place it in the Apache's directories.
3. FUSEKI CONFIGURATION
Note: The fuseki configuration official documentation can be found in here. Note that the Fuseki v1 is being used in this project.
As the fuseki configuration is in this repository, no extra configuration is needed. It is only necessary to place the fuseki folder in a proper directory inside your system. (Ex. /opt
or /etc
).
In previous versions it was necessary to edit the config.ttl
file in order to tune fuseki in each system. In the current version, fuseki can run without editing this file.
4. RUN FUSEKI
To run fuseki, place the fuseki
folder into a proper system path (for example, in /opt
). To run easily a Fuseki server, run
java -jar fuseki-server.jar --update --config=config.ttl /geo
Where config.ttl
is the configuration file or assembler file and /geo
is the name of the datapath. With this, Fuseki should be running in port 3030. For more information related to configuring or running a Fuseki server, see the official manual.
Note: When serving the data necessary for this demo, it is often recommendable to run the fuseki server with extra memory allocated, as fuseki can run out of memory. To do this, you can run:
java -Xmx2048m -jar fuseki-server.jar --update --config=config.ttl /geo
5. SmartOpenData CONFIGURATION
For a proper functioning of your system, a configuration variable must be changed in order to select a fuseki endpoint. In the mvvm.js
file, in smartopendata/js
, the line 13 is as follows:
var fuseki_endpoint = "http://$FUSEKI_SERVER$/slovakia/query?query=";
where $FUSEKI_SERVER$
is the route to the server in which fuseki is installed.
Change the endpoint URL according to your fuseki installation. Keep in mind that the slovakia/query?query=
must be present in order to address the correct data in fuseki.
6. CHECK EVERYTHING
To check if the SmartOpenData app was successfully deployed, access the URL listed below:
http:/$SERVER$/smartopendata/index.html#/sparql/slovakiaPolygonsDemo
Where:
$SERVER$
corresponds the server in which you have installed the apache server.
/smartopendata/ corresponds to apache web directory used for deploy the application.
7. CONFIGURE APACHE (OPTIONAL)
In order to compress the URL of the service, it is possible to add a sentence in the apache configuration (by default located in /etc/apache2/sites-available/000-default.conf
) that compresses the smartopendata/index.html#/sparql/slovakiaPolygonsDemo
route into something more compact. To do this, you can write this:
RedirectMatch ^/smartopendata?/$ http://$SERVER$/smartopendata/index.html#/sparql/slovakiaPolygonsDemo
changing $SERVER$
for the corresponding value.