weso / hercules-sync

Tools to synchronise data between the ontology files and Wikibase instance for the Hercules project at University of Murcia.
GNU General Public License v3.0
4 stars 1 forks source link
asio ontology rdf semantic-web wikibase

hercules-sync

License license
Build Status travis build status
Coverage coverage

Tools to synchronise data between the ontology files and Wikibase instance for the Hercules project at University of Murcia.

Directory structure

Defining a webhook in the source repo

In order to perform the synchronization automatically, a webhook must be created in the original repository where the ontology is stored. This webhook will be launched whenever a new push event occurs in the repo, and the synchronization service will be called to sync the changes with the wikibase instance. When creating a new webhook, the payload url must point to the URL where this server will be available. It is also important to define a secret key that will be used to accept only requests from the source repo and not from other ones. An example configuration will look like this one:

Launching the app with Docker

In order to execute the app you need to set the following configuration in the docker-compose.yml file:

Launching the app directly with Python

This application is compatible with Python 3.6 forwards, but the recommended Python version is at least Python 3.7 due to performance. After you have installed Python, you can run the following command to install every dependency:

pip install -r requirements.txt

After the requirements have been installed, you need to set directly the environment variables described in the previous section. After that, the following command can be executed to launch the app:

python wsgi.py

Alternatively, there is a sh script available that installs the dependencies and runs the server automatically. In order to execute this script, you have to set the environment variables and then run:

sh start_server.sh