Skip to content

openeuropa/triple-store-dev

Repository files navigation

Content layer development triple store

Triple storage containing default data to kick-start content layer local development based on OpenLink Virtuoso.

Important

The EU Publications Office released the official Digital Europa Thesaurus vocabulary. Prior to version 1.1.0 a local temporary copy of said vocabulary was being used. Please ensure to update to a newer version. More information in the below section.

The following RDF triples will be imported once the service starts:

New default content can be added to robo.yml as shown below:

data:
  - name: "corporate-body"
    graph: "http://publications.europa.eu/resource/authority/corporate-body"
    url: "http://publications.europa.eu/resource/cellar/07e1a665-2b56-11e7-9412-01aa75ed71a1.0001.10/DOC_1"
    format: "rdf"

Value of format: property can be either rdf or zip. If zip then an additional file: property is expected containing the archived RDF file name as shown below:

data:
  - name: "eurovoc-thesaurus"
    graph: "http://publications.europa.eu/resource/dataset/eurovoc"
    url: "http://publications.europa.eu/resource/cellar/9f2bd600-ae7b-11e7-837e-01aa75ed71a1.0001.09/DOC_1"
    file: "eurovoc_in_skos_core_concepts.rdf"
    format: "zip"

Build and run

Build:

$ docker build . -t openeuropa/triple-store-dev

Run:

docker run --name=triple-store-dev -p 8890:8890 openeuropa/triple-store-dev

Visit the RDF storage at: http://localhost:8890

Available commands

Fetch remote data:

$ docker exec triple-store-dev ./vendor/bin/robo fetch

Purge all data, to be ran before import:

$ docker exec triple-store-dev ./vendor/bin/robo purge

Import default data:

$ docker exec triple-store-dev ./vendor/bin/robo import

All commands above accept the following options:

--import-dir[=IMPORT-DIR]        Data import directory. [default: "./import"]
--host[=HOST]                    Virtuoso backend host. [default: "localhost"]
--port[=PORT]                    Virtuoso backend port. [default: 1111]
--username[=USERNAME]            Virtuoso backend username. [default: "dba"]
--password[=PASSWORD]            Virtuoso backend password. [default: "dba"]

Passing these options to a command will override their related default value set in robo.yml.

Option values can also be set using the following environment variables:

IMPORT_DIR
DBA_HOST
DBA_PORT
DBA_USERNAME
DBA_PASSWORD

Default values set via environment variables will override values set in robo.yml.

Working with Docker Compose

In Docker Compose declare service as follow:

services:
  triple-store:
    image: openeuropa/triple-store-dev
    ports:
      - 8890:8890

For more information about Docker Compose configuration check the parent Docker image OpenLink Virtuoso Open Source Edition.

Additionally, the environment variable SPARQL_UPDATE=true can be defined to allow writing to the triple store. Please note that only true as value is supported. Any other value will be the same as ommitting the variable.

services:
  triple-store:
    image: openeuropa/triple-store-dev
    environment:
      - SPARQL_UPDATE=true

In order to test a specific branch of the triple-store-dev image follow the steps below:

In the docker-compose.yml of the testing project (i.e. the oe_content module) use:

  sparql:
    build: /path/to/your/local/triple-store-dev/checkout
#    image: openeuropa/triple-store-dev
    environment:

Given that all your services are down, to rebuild run the following:

docker-compose build --force-rm --no-cache sparql
docker-compose up -d

Changelog

The changelog is generated using a local docker installation which installs muccg/docker-github-changelog-generator

This reads the Github API for the required repository and writes the CHANGELOG.md to the root of the repository.

Prerequisites

  • Local Docker machine running.
  • A Github Access Token should be generated and exported (or written to ~/.gitconfig) as CHANGELOG_GITHUB_TOKEN=<YOUR TOKEN HERE>

Before tagging a new release export the following:

export CHANGELOG_GITHUB_TOKEN=<YOUR TOKEN HERE>
export CHANGELOG_FUTURE_RELEASE=<YOUR FUTURE TAG RELEASE e.g '1.0.0'>

The changelog can then be generated by running:

composer run-script changelog

Updating from version 1.0.0

A temporary local copy of the Digital Europa Thesaurus was provided until version 1.0.0 of this repository. When the official version of the vocabulary was released, it was noticed that a wrong concept scheme URI was present in the local copy.

In order to update to version 1.1.0 or later, change any references of the old concept scheme URI http://data.europa.eu/uxp to the correct one

http://data.europa.eu/uxp/det