Create your first LDP server

Setup a new Moleculer project

You will need to have NodeJS installed on your computer.

First install the moleculer-cli tool globally.

npm install -g moleculer-cli

Then initialize a new project based on this template with this command:

moleculer init assemblee-virtuelle/semapps-template-ldp my-project

Choose yes to all questions

? Do you need a local instance of Jena Fuseki (with Docker)? Yes
? Do you need a read-only SPARQL endpoint? Yes
Create 'semapps' folder...
? Would you like to run 'npm install'? Yes

You can now go to the newly-created directory:

cd my-project

Launch your local Jena Fuseki instance

Jena Fuseki is a semantic triple store. It is where your app's data will be stored.

You need docker and docker-compose installed on your machine.

docker-compose up

Jena Fuseki is now available at the URL http://localhost:3030.

Please login - By default the login is admin and the password is also admin.

Please start by create a new dataset and name it localData (case sensitive) Your triples will be stored there.

Run Moleculer in dev mode

npm run dev

Your instance of SemApps is available at http://localhost:3000

Testing your LDP server

By default, the LDP service will create a LDP container in the /persons path.

Post an ActivityStreams Note to this LDP container with a tool like Insomnia, Postman or the RESTClient add-on for Firefox.

POST /persons HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Accept: */*
Content-Length: 97
"@context": "",
"type": "Person",
"name": "Guillaume Cousin"

Retrieve the /persons LDP container:

GET /persons HTTP/1.1
Host: localhost:3000
Accept: application/ld+json

You should get this result:

"@context": {
"ldp": "",
"as": ""
"@id": "http://localhost:3000/persons",
"@type": [
"ldp:contains": [
"@id": "http://localhost:3000/persons/db78b000",
"type": "Person",
"name": "Guillaume Cousin"