This is the server backend and API for NAMPI.
The NAMPI backend is a Spring Boot app, the data is stored in Apache Fuseki and the identity management is handled by Keycloak.
- A new keycloak realm needs to be created using the default settings.
- A new client has to be created using the default settings. (For the development environment
Valid Redirect URIs
can be set to*
) - A role
user
for authenticated users has to be created.
Some users can be created for a development environment. They need to get at least the role user
and a password assigned.
- A stand alone fuseki instance has to be created.
- A persistent new dataset needs to be created to store data.
- In a development environment, some test data can be imported in the dataset.
A number of command line parameters are available to configure the application.
Parameter | Mandatory | Default Value | Example | Description |
---|---|---|---|---|
APPLICATION_PORT | 8080 | The port the application will run on | ||
CORE_OWL_URL | https://raw.githubusercontent.com/nam-pi/ontologies/master/core.owl | The location of the NAMPI-Core ontology | ||
KEYCLOAK_URL | * | http://localhost:8080/auth/ | The Keycloak URL | |
KEYCLOAK_REALM | * | nampi | The name of the Keycloak realm | |
KEYCLOAK_RESOURCE | * | nampi-client | The name of the Keycloak client | |
LOGGING_LEVEL | INFO | DEBUG | The Spring Boot logging level | |
TRIPLE_STORE_URL | * | http://localhost:3030/nampi-data | The Fuseki URL including the path to the dataset |
The application can be run from the command line using Maven, the environment parameters can be appended to the command.
mvn spring-boot:run "'-Dspring-boot.run.arguments=--KEYCLOAK_URL=http://localhost:8081/auth,--KEYCLOAK_REALM=nampi,--KEYCLOAK_RESOURCE=nampi-client,--LOGGING_LEVEL=DEBUG,--TRIPLE_STORE_URL=http://localhost:3030/nampi-data'"
The application runs on the configured port, requests can be made using standard HTTP requests
- None (Defaults to JSON-LD)
application/ld+json
application/n-triples
application/rdf+xml
text/turtle
Protected endpoints like /users/search/current
need to be accessed using a valid OAuth 2
Bearer Token Header Authorization: Bearer [Token]
. The token can be acquired / refreshed in all ways configured in Keycloak. Examples are:
Access Token Endpoint: [Keycloak URL]/realms/nampi/protocol/openid-connect/token
Authorization Endpoint: [Keycloak URL]/auth/realms/nampi/protocol/openid-connect/auth
Access Token Endpoint: [Keycloak URL]/auth/realms/nampi/protocol/openid-connect/token