mapping-service

A Web Service supporting plugin-based transformation of or information extraction from uploaded files

https://github.com/kit-data-manager/mapping-service

Science Score: 52.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
    Organization kit-data-manager has institutional domain (www.scc.kit.edu)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.6%) to scientific vocabulary

Keywords

restful-api
Last synced: 6 months ago · JSON representation ·

Repository

A Web Service supporting plugin-based transformation of or information extraction from uploaded files

Basic Info
  • Host: GitHub
  • Owner: kit-data-manager
  • License: apache-2.0
  • Language: Java
  • Default Branch: main
  • Homepage:
  • Size: 1.92 MB
Statistics
  • Stars: 1
  • Watchers: 2
  • Forks: 5
  • Open Issues: 13
  • Releases: 8
Topics
restful-api
Created about 4 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog License Citation

README.md

Mapping-Service

Java CI with Gradle CodeQL codecov License

The mapping-service provides a generic interface for mapping various documents. The tools required for this, such as Gemma, JOLT, XSLT, ... can be loaded into the mapping-service as plugins, regardless of the programming language in which they were developed. These tools are then made usable via the REST-API and a Web-UI. The mapping schemas are stored in a database and can be managed via the REST-API and the Web-UI.

The Web-UI is accessible via the following URL: http://<IP or hostname>:8095 The REST-API is documented at the following link: http://<IP or hostname>:8095/swagger-ui/index.html

How to build

Dependencies that are needed to build and are not being downloaded via gradle:

  • OpenJDK 17
  • Python 3
  • pip (runtime only)

./gradlew build

Python Location

Currently, mapping-service requires Python to be installed in order to build and to run. At runtime, the Python executable is configured in application.properties(see below). For building the mapping-service Python executable is set to /usr/bin/python3 by default. In case you want to build the mapping-service on a machine on which the Python installation is located elsewhere, e.g., under Windows, you can provide the Python location used at compile time externally, i.e.:

.\gradlew "-DpythonExecutable=file:///C:/Python310/python.exe" build

How to start

Before you can start the mapping-service, you first have to create an application.properties file in the source folder. As an example you may use config/application.default.properties and modify it according to your needs. Espacially the following properties (at the end of the file) are important: - spring.datasource.url=jdbc:h2:file:/tmp/mapping-service/database The path points to the location of the database in which your configured mappings are stored. - mapping-service.pythonExecutable=${pythonExecutable:'file:///usr/bin/python3'} \ If no pythonExecutable is provided externally (see above) the default /usr/bin/python3 is used. - mapping-service.pluginLocation=file:///tmp/mapping-service/plugins \ The local folder where available plugins are located. - mapping-service.mappingsLocation:file:///tmp/mapping-service/ \ Enter the location where you want to store your mappings. This folder will be created if it does not exist yet.

In order to provide the mapping-service with mapping functionality, there are already some pre-compiled plugins available under in the plugins folder of this repository. Copy them to your configured mapping-service.pluginLocation to make them available to the mapping-service. The source code of the gemma-plugin can be found here. The plugin shows how to integrate Python mappings easily.

There is also the possibility to add new plugins directly at the source tree and create a pluggable Jar out of them. Therefor, check src/main/java/edu/kit/datamanager/mappingservice/plugins/impl. Just add your new plugin, e.g., based on the TestPlugin example. In order to make the plugin usable by the mapping service, you then have to build a plugin Jar out of it. In order to do that, just call:

./gradlew buildPluginJar

This task creates a file default-plugins-<VERSION> at build/libs which has to be copied to mapping-service.pluginLocation to make it available.

After doing this, the mapping-service is ready for the first start. This can be achieved by executing:

java -jar build/lib/mapping-service-<VERSION>.jar

This assumes, that the command is called from the source folder and that your application.properties is located in the same folder. Otherwise, you may use:

java -jar build/lib/mapping-service-<VERSION>.jar --spring.config.location=/tmp/application.properties

Ideally, for production use, you place everything (mapping-service-<VERSION>.jar, application.properties, mapping-service.pluginLocation, mapping-service.mappingsLocation, and spring.datasource.url) in a separate folder from where you then call the mapping-service via:

java -jar mapping-service-<VERSION>.jar

Installation

There are three ways to install metaStore2 as a microservice: - Using the image available via GitHub Packages (recommended) - Building docker image locally - Building and running locally

Installation via GitHub Packages

Prerequisites

In order to run this microservice via docker you'll need:

Installation

Typically, there is no need for locally building images as all version are accessible via GitHub Packages. Have a look of available images and their tags here Just follow instructions below.

Build docker container locally

Prerequisites

In order to run this microservice via docker you'll need:

Installation

Clone repository

First of all you'll have to clone this repository: user@localhost:/home/user/$ git clone https://github.com/kit-data-manager/mapping-service.git Clone to 'mapping-service' [...] user@localhost:/home/user/$ cd mapping-service user@localhost:/home/user/mapping-service$

Create image

Now you'll have to create an image containing the microservice. This can be done via a script. On default the created images will be tagged as follows:

'latest tag'-'actual date(yyyy-mm-dd)' (e.g.: 1.1.0-2023-06-27)

```

user@localhost:/home/user/mapping-service$ bash docker/buildDocker.sh

Build docker container ghcr.io/kit-data-manager/mapping-service:1.2.0-2023-06-27

[...]

Now you can create and start the container by calling ...

user@localhost:/home/user/mapping-service$ ```

Build docker container

After building image you have to create (and start) a container for executing microservice: ```

If you want to use a specific image you may list all possible tags first.

user@localhost:/home/user/mapping-service$ docker images ghcr.io/kit-data-manager/mapping-service --format {{.Tag}} 1.2.0-2023-06-27 user@localhost:/home/user/mapping-service$ docker run -d -p8095:8095 --name mapping4docker ghcr.io/kit-data-manager/mapping-service:1.2.0-2023-06-27 57c973e7092bfc3778569f90632d60775dfecd12352f13a4fd2fdf4270865286 user@localhost:/home/user/mapping-service$ ```

Customize settings

If you want to overwrite default configuration of your docker container you have to 'mount' a config directory containing 'application.properties' with your adapted settings. Therefor you have to provide an additional flag to the command mentioned before: ```

Overwriting default settings

Create config folder

user@localhost:/home/user/mapping-service$ mkdir config

Place your own 'application.properties' inside the config directory

Create/run container

user@localhost:/home/user/mapping-service$ docker run -d -p8095:8095 -v pwd/config:/spring/mapping-service/config --name mapping4docker ghcr.io/kit-data-manager/mapping-service:1.2.0-2023-06-27 57c973e7092bfc3778569f90632d60775dfecd12352f13a4fd2fdf4270865286 user@localhost:/home/user/mapping-service$ ```

Stop docker container

If you want to stop container just type user@localhost:/home/user/mapping-service$ docker stop mapping4docker

(Re)start docker container

If you want to (re)start container just type user@localhost:/home/user/mapping-service$ docker start mapping4docker

Build and run locally

Prerequisites

In order to run this microservice via docker you'll need:

Installation

Clone repository

First of all you'll have to clone this repository: user@localhost:/home/user/$ git clone https://github.com/kit-data-manager/mapping-service.git Clone to 'mapping-service' [...] user@localhost:/home/user/$ cd mapping-service user@localhost:/home/user/mapping-service$

Build service

To build service just execute the build.sh script: ```

user@localhost:/home/user/mapping-service$bash build.sh /PATH/TO/EMPTY/INSTALLATION/DIRECTORY

Build microservice of mapping-service at /PATH/TO/EMPTY/INSTALLATION/DIRECTORY

[...]

Now you can start the service by calling /PATH/TO/EMPTY/INSTALLATION/DIRECTORY/run.sh

user@localhost:/home/user/mapping-service$ ```

Customize settings

If you want to overwrite default configuration of your docker container you have to add a file named 'application.properties' to the 'config' directory inside your installation path (/PATH/TO/EMPTY/INSTALLATION/DIRECTORY)selected before. The added file should only contain your adapted settings. e.g. in case you want to change only the port to '1234' your 'application.properties' should look like this: ```

Overwriting default settings from ../application.properties

Server settings

server.port: 1234 ```

License

See LICENSE file in this repository.

Owner

  • Name: KIT Data Manager
  • Login: kit-data-manager
  • Kind: organization
  • Email: webmaster@datamanger.kit.edu
  • Location: Karlsruhe, Germany

Generic software and recommendations for FAIR research data management by DEM.

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Inckmann"
  given-names: "Maximilian"
  affiliation: Karlsruhe Institute of Technology
  email: maximilian.inckmann@kit.edu
  orcid: "https://orcid.org/0009-0005-2800-4833"
- family-names: "Jejkal"
  given-names: "Thomas"
  affiliation: Karlsruhe Institute of Technology
  email: thomas.jejkal@kit.edu
  orcid: "https://orcid.org/0000-0003-2804-688X"
- family-names: "Hartmann"
  given-names: "Volker"
  affiliation: Karlsruhe Institute of Technology
  email: volker.hartmann@kit.edu
  orcid: "https://orcid.org/0000-0001-6383-5214"
- family-names: "Pfeil"
  given-names: "Andreas"
  affiliation: Karlsruhe Institute of Technology
  email: andreas.pfeil@kit.edu
  orcid: "https://orcid.org/0000-0001-6575-1022"
title: "mapping-service"
type: software
abstract: The mapping-service provides a generic interface for mapping various documents. Mappers can be added as plugins regardless of the programming language in which they were developed and are then made usable via the REST-API and a Web-UI.
date-released: 2020-10-15
url: "https://github.com/kit-data-manager/mapping-service"
repository-code: "https://github.com/kit-data-manager/mapping-service"
license: Apache-2.0

GitHub Events

Total
  • Create event: 128
  • Release event: 3
  • Issues event: 11
  • Delete event: 136
  • Issue comment event: 51
  • Push event: 297
  • Pull request review event: 2
  • Pull request review comment event: 8
  • Pull request event: 271
  • Fork event: 1
Last Year
  • Create event: 128
  • Release event: 3
  • Issues event: 11
  • Delete event: 136
  • Issue comment event: 51
  • Push event: 297
  • Pull request review event: 2
  • Pull request review comment event: 8
  • Pull request event: 271
  • Fork event: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 23
  • Total pull requests: 240
  • Average time to close issues: 5 months
  • Average time to close pull requests: 15 days
  • Total issue authors: 7
  • Total pull request authors: 7
  • Average comments per issue: 1.22
  • Average comments per pull request: 0.28
  • Merged pull requests: 182
  • Bot issues: 1
  • Bot pull requests: 203
Past Year
  • Issues: 6
  • Pull requests: 208
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 17 days
  • Issue authors: 3
  • Pull request authors: 6
  • Average comments per issue: 0.83
  • Average comments per pull request: 0.23
  • Merged pull requests: 152
  • Bot issues: 1
  • Bot pull requests: 194
Top Authors
Issue Authors
  • VolkerHartmann (8)
  • vitalielias (4)
  • maximiliani (3)
  • ghost (2)
  • renovate[bot] (2)
  • ThomasJejkal (2)
  • Pfeil (1)
Pull Request Authors
  • renovate[bot] (236)
  • dependabot[bot] (47)
  • VolkerHartmann (16)
  • ThomasJejkal (15)
  • github-actions[bot] (8)
  • ghost (8)
  • craquet (4)
Top Labels
Issue Labels
bug (4) dependencies (2) enhancement (2) documentation (1)
Pull Request Labels
dependencies (282) bug (5) enhancement (2) invalid (2)

Dependencies

build.gradle maven
  • org.projectlombok:lombok 1.18.24 compileOnly
  • com.github.jknack:handlebars 4.3.0 implementation
  • com.google.guava:guava 31.1-jre implementation
  • commons-io:commons-io 2.11.0 implementation
  • edu.kit.datamanager:service-base 1.0.4 implementation
  • javax.validation:validation-api 2.0.1.Final implementation
  • org.apache.commons:commons-collections4 4.4 implementation
  • org.apache.httpcomponents:httpclient 4.5.13 implementation
  • org.eclipse.jgit:org.eclipse.jgit 6.3.0.202209071007-r implementation
  • org.javers:javers-spring-boot-starter-sql 6.6.5 implementation
  • org.json:json 20220320 implementation
  • org.springdoc:springdoc-openapi-data-rest 1.6.11 implementation
  • org.springdoc:springdoc-openapi-ui 1.6.11 implementation
  • org.springdoc:springdoc-openapi-webmvc-core 1.6.11 implementation
  • org.springframework.boot:spring-boot-starter-actuator 2.7.3 implementation
  • org.springframework.boot:spring-boot-starter-data-jpa 2.7.3 implementation
  • org.springframework.boot:spring-boot-starter-security 2.7.3 implementation
  • org.springframework.boot:spring-boot-starter-validation 2.7.3 implementation
  • org.springframework.boot:spring-boot-starter-web 2.7.3 implementation
  • com.h2database:h2 2.1.214 runtimeOnly
  • org.apache.httpcomponents:httpclient 4.5.13 runtimeOnly
  • org.postgresql:postgresql 42.5.0 runtimeOnly
  • net.bytebuddy:byte-buddy 1.12.16 testImplementation
  • org.junit.jupiter:junit-jupiter 5.9.0 testImplementation
  • org.junit.jupiter:junit-jupiter-migrationsupport 5.9.0 testImplementation
  • org.junit.vintage:junit-vintage-engine 5.9.0 testImplementation
  • org.mockito:mockito-core 4.8.0 testImplementation
  • org.powermock:powermock-api-mockito2 2.0.9 testImplementation
  • org.powermock:powermock-module-junit4 2.0.9 testImplementation
  • org.springframework.boot:spring-boot-starter-test 2.7.3 testImplementation
  • org.springframework.restdocs:spring-restdocs-mockmvc 2.0.6.RELEASE testImplementation
  • org.springframework.security:spring-security-test 5.7.3 testImplementation
  • org.springframework:spring-test 5.3.22 testImplementation
.github/workflows/CI.yml actions
  • actions/checkout v2 composite
  • actions/setup-java v1 composite
  • actions/setup-python v4 composite
  • codecov/codecov-action v1 composite
.github/workflows/branch_on_issue.yml actions
  • robvanderleek/create-issue-branch main composite
.github/workflows/codeql-analysis.yml actions
.github/workflows/docker-publish.yml actions
  • actions/checkout v4 composite
  • docker/build-push-action v5 composite
  • docker/login-action v3 composite
  • docker/metadata-action v5 composite
Dockerfile docker
  • build-env-java latest build
  • eclipse-temurin 17 build