The object store for saving/retrieving knowledge objects.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

readme.md

KGrid Shelf

CircleCI GitHub release

KGrid Shelf - (access, acquisition) view Knowledge Objects (and sets of Knowledge Objects ) & their components; deposit & remove published versions of Knowledge Objects; copy versions of Knowledge Objects s between Libraries & Activators (Knowledge Objects are immutable).

KGrid Shelf has two modules, the shelf api and gateway component. The api is used but other KGrid components to provide access to the KOs while the gateway wraps the api in a covenant spring boot for easy RESTFul access to the shelf api.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

For building and running the application you need:

Clone

To get started you can simply clone this repository using git:

git clone https://github.com/kgrid/kgrid-shelf.git
cd kgrid-shelf

Quick start

This quick start will run the activator and load two example knowledge objects for testing.
This example can loads a sample KO shelf (where to look for the KOs) via the kgrid.shelf.cdostore.filesystem.location property. By default application will start up and PORT 8080.

mvn clean package
java -jar target/kgrid-shelf*.jar --kgrid.shelf.cdostore.url=filesystem:file://shelf

Once Running access the Activators Health Endpoint. All statuses reported should be UP

{
  "status": "UP",
  "shelf": {
    "status": "UP",
    "kgrid.shelf.cdostore.url": "filesystem:file://shelf/"
  },
  "diskSpace": {
    "status": "UP",
    "total": 499963170816,
    "free": 421147205632,
    "threshold": 10485760
  }
}
   

Unit tests

Unit tests can be executed via mvn test

mvn clean test

Integration tests

For integration tests we need to have a Fedora Commons instance running. We use Fedora image based on Fedora Docker which is part of Fedora Labs. This coupled with docker-maven-plugin maintained by fabric8io allows us to spin up fcrepo and run shelf tests against a running fcrepo instance. The container is stopped and removed after the verify. There is a fcrepo_it maven profile that will configure the instance and run the tests

mvn clean verify -P fcrepo_it

The first time we run mvn verify -P fcrepo_it the docker image with only the fcreop running.
The build will wait until the fcrepo is up and running than will run the integration tests.

Integration tests are identified using @Category(FedoraIntegrationTest.class). Once the tests are complete the docker container will be stopped and removed.

Tips and Tricks

  • You can start up fcrepo docker instance with

mvn docker:start -P fcrepo_it

and stop it with

mvn docker:stop -P fcrepo_it

Yo can keep the fcrepo container running after the tests running with the docker.keepRunning switch mvn -Ddocker.keepRunning clean verify -P fcrepo_it Once started, access Docker FCRepo

Fedora Fuseki Tests

Fuseki tests are identified using @Category(FedoraFusekiTest.class). These use a docker instance of Fedora that includes Tomcat 8.0.53, Fedora 4.7.5, Solr 4.10.3 ,Apache Karaf 4.0.5, Fuseki 2.3.1, Fcrepo-camel-toolbox 4.7.2

NOTE: this is not run as a part of CircleCI build because of the heavy weight nature of the full Fedora image

mvn clean verify -P fcrepo_fuseki

Tips and Tricks

  • You can start up fcrepo docker instance with

mvn docker:start -P fcrepo_fuseki

and stop it with

mvn docker:stop -P fcrepo_fuseki

Yo can keep the fcrepo container running after the tests running with the docker.keepRunning switch mvn -Ddocker.keepRunning clean verify -P fcrepo_fuseki

Once started, access Docker FCRepo

Fedora Repository Characterization Tests

A set of tests that help the KGrid team understand the behavior of the Fedora Repository in terms of JSON LD and our KOIO ontology. Details can be found at Fedora Repository Characterization Tests readme

Additional Information

The port of the shelf gateway can be altered via the server.port property

java -jar shelf-gateway/target/shelf-gateway-*-boot.jar --kgrid.shelf.cdostore.url=filesystem:file://etc/shelf --server.port=8090