Step by step guide to creating a new dataspace backed by SPARQL services

Manage dataspaces

Dataspaces are configured in config/system.trig. TriG RDF syntax is used.

The configuration uses the Application domain ontology. A dataspace is comprised of an end-user application and an administrative application, both of them are backed by each own SPARQL service. Each application can also specify its own XSLT stylesheet.

Application base URIs need to be relative to the system base URI configured in the .env file. A change of system base URI currently requires a change of application base URIs, otherwise they will not be reachable.

Change base URI(s)

Lets say we want to use https://ec2-54-235-229-141.compute-1.amazonaws.com/linkeddatahub/ as the new base URI of our dataspaces. The easiest way is to simple replace occurences of the default https://localhost:4443/ base URI with the new value. It can be done using the following shell command:

sed -i 's/https:\/\/localhost:4443\//https:\/\/ec2-54-235-229-141.compute-1.amazonaws.com\/linkeddatahub\//g' config/system.trig

Note that sed requires to escape forward slashes / with backslashes \.

Create a dataspace

Add instances of lapp:EndUserApplication, lapp:AdminApplication and their corresponding apl:GenericServices following the default dataspace in config/system.trig.

Make sure the file's syntax is valid Turtle, otherwise the setup will not work. You can use Turtle Validator to check the syntax.

Change stylesheet

Change the value of ac:stylesheet to the URI of your XSLT stylesheet. Add the property if it is absent.

The stylesheet can either be uploaded as a file or mounted in docker-compose.yml, in the volumes section of the linkeddatahub service. Mounting is useful when developing, however if you want to make sure your dataspace is compatible with LinkedDataHub Cloud, you should use file uploads as there is no way to mount local files on to LinkedDataHub Cloud.

You will need to restart LinkedDataHub's Docker service for the new stylesheet to take effect.

It is rarely necessary to change the stylesheet of an admin application.

Manage services

LinkedDataHub service as well as the default SPARQL services fuseki-end-user and fuseki-admin are defined in docker-compose.yml and run as Docker containers.

Dataspaces and their base URIs are managed automatically in the LinkedDataHub cloud version.

Create a context

Follow these steps:

  1. Go to the Root context
  2. Make sure you are authenticated
  3. On the top left-hand side click on the Context button
  4. In the form that opens, fill out the following fields:
    Base URI
    Here you can change the relative path of your context. It may not have forward slashes (/) in it. Attempt to use an already existing path will result in an error. By default, a unique UUID will be assigned.
    Title
    The human-readable title of your context
    Description
    Optionally, enter a human-readable description of your context
    Public
    Choose whether your context should be publicly listed on LinkedDataHub Cloud

The following video shows the creation of both a context and a dataspace:

pushd . && cd "$SCRIPT_ROOT/apps"

./create-context.sh \
-b "${base}" \
-f "${cert_pem_file}" \
-p "${cert_password}" \
--title "${title}" \
--description "${description}" \
--app-base "${base}${slug}/" \
--public

popd

Create a dataspace

Follow these steps:

  1. Go to your existing context or create one
  2. Make sure you are authenticated
  3. On the top left-hand side click on the App button
  4. In the form that opens, fill out the following fields:
    Base URI
    Here you can change the relative path of your context. It may not have forward slashes (/) in it. Attempt to use an already existing path will result in an error.
    Title
    The human-readable title of your context
    Description
    Optionally, enter a human-readable description of your context
    Public
    Choose whether your dataspace should be publicly listed on LinkedDataHub Cloud. This does not mean that the documents in the dataspace will be public — they are subject to access control.

The following video shows the creation of both a context and a dataspace:

pushd . && cd "$SCRIPT_ROOT/apps"

./create-app.sh \
-b "${base}" \
-f "${cert_pem_file}" \
-p "${cert_password}" \
--title "${title}" \
--description "${description}" \
--app-base "${base}${slug}/" \
--public

popd
Date Created
8 March 2021 19:12
Date Modified
16 March 2021 00:31
Maker
Martynas Jusevičius
Owner
Martynas Jusevičius