Giter Club home page Giter Club logo

p3-entry-resource's Introduction

P3 Entry Resource Build Status

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.

Cloning

Use the --recursive option when cloning this repo to make sure submodules are cloned too.

Usage

This project can be used with docker, gradle or eclipse. Choose the way you prefer.

Docker

With docker you can either build it locally or just get a pre-built version from dockerhub.

Building

docker build  -t p3-entry-resource .

Running

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

Maven

You can also build with maven:

mvn install

This creates an executable jar launcher/target.

Execute with:

java -jar launcher/target/launcher-*.jar

Experimental features

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.ttlsimilar 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/"
	] .

p3-entry-resource's People

Contributors

retog avatar westei avatar andreybratus avatar

Stargazers

Trevor Lazarus avatar

Watchers

Danilo avatar  avatar Marco Combetto avatar  avatar Adrian Gschwend avatar Luigi Selmi avatar Sebastian Schaffert avatar James Cloos avatar Jakob Frank avatar Gabor Remenyi avatar Milos Jovanovik avatar Lorenzino Vaccari avatar  avatar Carl Blakeley avatar

Forkers

andreybratus

p3-entry-resource's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.