This is a sample OSLC PROMCODE server, that is based on the OASIS OSLC PROMCODE Specification 1.0.
Follow the 3 sections below to:
You will set up an RDF data store to store the OSLC PROMCODE resources.
We will utilize the Apache Jena Fuseki that is an open source RDF server. You can select either Docker version or Java version.
- Download docker version of fuseki server from https://repo1.maven.org/maven2/org/apache/jena/jena-fuseki-docker/4.2.0/
docker-compose build --build-arg JENA_VERSION=3.16.0
docker-compose run --rm --service-ports fuseki --update --mem /dataset
- Download jar file from https://repo1.maven.org/maven2/org/apache/jena/jena-fuseki-server/
- For the latest Java version, run the following command
java -cp jena-fuseki-server-4.2.0.jar org.apache.jena.fuseki.main.cmds.FusekiMainCmd --update --mem /dataset
- For Java 1.8 , run the following command
java -cp jena-fuseki-server-3.16.0.jar org.apache.jena.fuseki.main.cmds.FusekiMainCmd --update --mem /dataset
There are multiple options to run the OSLC Server. Below are the simplest options if you don't want to use anything except JDK and a Maven installation. Prerequisites:
- JDK 11
- Maven 3
Follow these steps to start the server:
cd promcode-lyo-server
mvn clean jetty:run-war
Now proceed to the steps listed in the next section Navigating OSLC servers.
Follow these steps to start the server:
cd promcode-lyo-server
mvn clean cargo:run
The OSLC server is available at the following URL:
From that point, you can navigate through the Service Provider Catalog, or using the built-in Swagger Editor.
THe server contains no data at startup. You can add resources to the server by performing resource operations on their creation factories.
This can be done through the built-in Swagger editor, or using the command line.
- create a file named artifact1.ttl
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix oslc_promcode: <http://open-services.net/ns/promcode#> .
<> a oslc_promcode:Artifact ;
dcterms:identifier "1" ;
dcterms:title "A1" ;
dcterms:description "UI for making a reservation" .
curl -d @artifact1.ttl -H "Accept: text/turtle;" -H "Content-type: text/turtle" http://localhost:8080/promcode-server/oslc/service1/artifacts/create
curl -H "Accept: text/turtle;" http://localhost:8080/promcode-server/oslc/artifact/1
This server is modelled and generated using Lyo Designer.
It is recommended that any changes to the code should be done using LyoDesigner to maintain traceability between the model and the code. Below are some instructions on how to open the projects in this repository with LyoDesigner.
It is recommended you get familiar with the LyoDesigner tool before you perform any changes.
To open the relevant projects for the OSLC PROMCODE server, you need to follow the steps below.
The first step is to install Lyo Designer.
The PROMCODE domain model is already modelled and made available to be used by any PROMCODE server installation.
- Import the Lyo Git repository
- In LyoDesigner, import the Modelling project under the "domains\org.eclipse.lyo.tools.domainmodels" folder.
This project contains the PROMCODE model, and all other OSLC Domain Specifications.
In LyoDesigner, import the Modelling project under the "promcode-lyo-server-model" folder.
This model depends on the PROMCODE domain model, imported in the previous step. It is important the domain model is imported first.
This models a simple PROMCODE server, which can be used as a basis for your own extensions and modifications.
- In LyoDesigner, import the Maven project under the "promcode-lyo-server" folder.
This maven project is generated from the server model imported above.