FC4E-T4-3 / type-api

MIT License
3 stars 1 forks source link

TypeAPI

Java Spring Boot Type Sense

Table of Contents

Introduction

The DTR Toolkit is a framework designed to work with Data Type Registries (DTRs). It provides functionalities for extracting, validating, and managing types, units, and taxonomies from various DTR sources.

Features

Installation

Prerequisites

Steps

  1. Clone the repository:
    
    git clone https://github.com/yourusername/dtr-toolkit.git
    cd dtr-toolkit
  2. Start a TypeSense server. The TypeAPI requires a TypeSense server running to store types, units and taxonomies and provide fast search capabilities. The easiest way to set this up is via docker.
  -p 8108:8108 \
  -v /path/to/data:/data \
  typesense/typesense:latest \
  --data-dir /data \
  --api-key xyz \
  --listen-port 8108

These are the default settings for port and key. If you wish to choose your own you need to adjust the src/main/resources/application.propertiesfile:

typesense.url=localhost
typesense.port=8108
typesense.key=xyz
  1. Build and run the project:
    ./gradlew buildRun

Via Docker Compose

You can also simply use the provided docker-compose.yml file to run the service and a typesense instance. The docker image for the TypeAPI is stored in the GitHub Container Registry: ghcr.io/fc4e-t4-3/dtr-toolkit:latest. So if you want a simple setup, just run docker-compose upin the same folder as the docker-compose.yml to start the containers.

Usage

Once the application is running, you can access the Swagger UI at http://localhost:8080.

Configuration

The Data Type Registries that are imported are defined insrc/main/config/config.toml, for example:

url="http://typeregistry.lab.pidconsortium.net/"
suffix="objects?query=*"
style="eosc"
types=["BasicInfoType","InfoType","KernelInformationProfile"]
units=["MeasurementUnit"]
taxonomy=["TaxonomyNode"]
general=["ExtendedMimeType"]

Where the styledescribes the underlying schema definitions, types contains the names of the schema element types, units the name of the measurement units, taxonomy the name of the TaxonomyNode schema and under general other types can be imported that don't fit other categories.

License

This project is licensed under the MIT License - see the LICENSE file for details.