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 by other KGrid components to provide access to the KOs while the gateway wraps the api in a simple spring boot application for easy RESTFul access to the shelf api for testing and development.
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.
For building and running the application you need:
To get started you can simply clone this repository using git:
git clone https://github.com/kgrid/kgrid-shelf.git
cd kgrid-shelf
This quick start will run the activator and load two example knowledge objects for testing.
This example will load a sample KO shelf (where to look for the KOs) via the kgrid.shelf.cdostore.url property.
Note: this property must be a valid URI.
By default, application will start up on 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 can be executed via maven:
mvn clean test
-
There is also
There are two methods by which knowledge objects can be imported to the shelf:
Currently, knowledge objects can be loaded from a url, a local file, or a classpath reference.
{
"manifest":
[
"http://path-to-web-ko",
"file:/path-to-local-ko",
"classpath:/path-to-classpath-ko"
]
}
When running the shelf, an array of manifest files can be automatically imported by setting the property: kgrid.shelf.manifest
.
Example:
kgrid.shelf.manifest=file:/path/to/manifest,http://path-to-manifest,classpath:/path-to-manifest
The Shelf-API has an endpoint for importing a single manifest.
To use it, simple send a POST
request to /kos/manifest/
endpoint of your shelf with the contents of the manifest.json
file as the request body. See the API documentation for more information.