Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 2.21 KB

README.md

File metadata and controls

39 lines (27 loc) · 2.21 KB

Developing Semantic Containers

This tutorial describes the basic steps to develop a specific Semantic Container by extending the semantic base container. Refer to the Tutorial-Overview for other aspects.

Clone Semantic Container Template

For most use cases the following template provides a scaffold to create a specialized Semantic Container: https://github.com/sem-con/template

git clone https://github.com/sem-con/template.git

Adapt the Template

Use the following checklist to make the necessary changes:

  1. specify repository and container name in build.sh
  2. add any necessary software components in the Dockerfile
    you might also want to add gems in the Gemfile - use as starting point the version from the base container
  3. implement a custom method for responding to GET /api/data by editing app/helpers/data_access_helper.rb
  4. if you want to provide additional API endpoints edit config/routes.rb and implement the controller in app/controllers/api/v1
  5. to provide custom container initialization edit the script directory
  6. by convention it is sensible to provide a default init.trig and commands for running the container in test

Build and Test the new Semantic Container

After you have implemented the new functionality the Semantic Container can be built with the following command in the root directory:

./build.sh

This downloads the current base container and applies the provided changes to create derived Semantic Container. Start the container with docker run -p 3000:3000 repo/sc-name and start testing.

Examples

Here are some links to examples for extending the base container:

  • sc-seismic: annotates a open data source and makes it avaialable as Semantic Container
  • sc-sparql: integrate another service and extend the Semantic Container with additional API endpoints
  • sc-sentinel: demonstrates asynchronous processing and process pipelines