This project delivers the entry resource for a P3 platform instance.
What is a P3 platform instance? A P3 platform is a set of web and linked data applications that allows the user to transform and store data using the Linked Data Platform (LDP) standard as well as the Transforming Container API.
What is the the entry resource? That's the Linked Data resource that links to the web and linked applications that constitute the platform instance.
So what is this project about? This project provides the web application that returns an RDF description of a platform instance. It also provides and HTML representation of the platform which uses LD2h to render the platform using RDF2h templates.
Without cloning the repository or compiling the project you can run the application with docker:
docker run --rm -ti -p 80:8080 fusepoolp3/entry-resource
The first access to the service using a JavaScript capable client will configure the platform instance. For that it uses the hostname of the request, so it is important to use the correct hostname on the first request for the platform resource.
Starting P3 Entry Resource with the above command will use a default configuration
script that configure a new platform instance using services of the Platform
Reference Implementation
instance on sandbox.fusepool.info
.
Normally you want to provide your own configuration script. With docker you can
provide a backend-config.js configuration script as follows. Run the docker
image from the directory with your 01-backend-config.js
file:
docker run --rm -v $(pwd):/etc/fusepool-p3/boot-scripts/ -p 80:8080 fusepoolp3/entry-resource
When launched p3-entry-resource
will check for configuration scripts in ~/.fusepool-p3/boot-script
, in /etc/fusepool-p3/boot-scripts/
as well as its internal resource folder src/eu/fusepool/p3/entry/default-config/. In the above example we override the built-in 01-backend-config.js
in full, this script has to implemement a functionP3BackendConfigurator.initialize
taht gets an PlatformEntryConfigurator instance as argument and returns a promise that is fulfilled when the platform is configured. To configure the platform the configuration script should invoke the methods provided by the PlatformEntryConfigurator
instance.
Rather than fully replacing the configuration script we can also instead add additional scripts that selectively modify the default configuration class, this typically makes our script much shorter by avoiding code duplication.
Typically one would override one or several of the following:
- P3BackendConfigurator.prototype.serviceHost: a string with the hostname
- P3BackendConfigurator.prototype.getLdpRoot: a function returning a promise for the LDP Root
- P3BackendConfigurator.prototype.registerRegistries: a function retuning a promise that is fullfilled when the various registries are registered
- P3BackendConfigurator.prototype.registerBackendfeatures: a function returning a promise that is fulfilled when the LDP-Root and the SPARQL Endpoint are registered
After the first configuration an instance stores its configuration persistently
in .fusepool-p3\PlatformConfig.ser
, so delete this file if you want to create
a new configuration.
Use the --recursive
option when cloning this repo to make sure submodules are cloned too.
This project can be used with docker, gradle or eclipse. Choose the way you prefer.
With docker you can either build it locally or just get a pre-built version from dockerhub.
docker build -t p3-entry-resource .
To use the built build above and launch it on port 80:
docker run --rm -ti -p 80:8080 p3-entry-resource
To use the version from dockerhub
docker run --rm -ti -p 80:8080 fusepoolp3/entry-resource
You can also build with maven:
mvn install
This creates an executable jar launcher/target
.
Execute with:
java -jar launcher/target/launcher-*.jar
To allow access to additional resources via the provided HTTP
endpoint either create a file ~/.fusepool-p3/content-graph.ttl
with the data to be provided, or link to a SPARQL endpoint using
a file ~/.fusepool-p3/remote-content-graph.ttl
similar to the following (Ontology will change soon):
<http://test.lindas-data.ch/sparql>
a <http://sparql.endpont/> ;
<http://example.org/replacement> [
<http://example.org/targetPrefix> "http://localhost:8080/";
<http://example.org/sourcePrefix> "http://test.lindas-data.ch/"
] .