Skip to content

Latest commit

 

History

History

conforming

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Tractus-X Conforming Agent (KA-CONF)

KA-CONF is a module of the Tractus-X Knowledge Agents Reference Implementations.

About this Module

The Conforming Agent is a component that may be used in place of Matchmaking and Binding Agents to prove the conformity of other components of the KA architecture. It implements (depending on its configuration) and validates the KA-MATCH and KA-BIND SPARQL profiles behind the Knowledge Agents standard API. It may also be used to provoque error behaviour in the KA dataflow in order to check robustness and conformity in the case of problems. It may also be used in unit test environments as a mock server.

Architecture

The FOSS Conforming Agent is built using Jersey (for the REST endpoints) and RDF4J (for SPARQL parsing). It exposes three endpoints for the three different SPARQL profiles which are to be certified/tested in the KA architecture:

  • The '/match' endpoint for the KA-MATCH profile
  • The '/bind' endpoint for the KA-BIND profile
  • The '/transfer' endpoint for the KA-TRANSFER profile

The Conforming Agent does not perform any logic but just returns prerendered results depending on the input parameters.

Security

The conforming agent will be configurable to support the following http/s based security mechanisms:

  • Basic Authentication
  • Oauth2

Deployment

Compile, Test & Package

mvn package

This will generate

  • a plugin jar containing all necessary components to be dropped into a Jakarta-Compatible Web Server.
  • a standalone jar including the Jakarta-Reference Implementation (Glassfish).

Run Locally

The standalone jar may be started as follows

java -cp target/conforming-agent-1.14.24-SNAPSHOT.jar org.eclipse.tractusx.agents.conforming.Bootstrap"

Containerizing

You could either call

mvn install -Pwith-docker-image

or invoke the following docker command after a successful package run

docker build -t tractusx/conforming-agent:1.14.24-SNAPSHOT -f src/main/docker/Dockerfile .

This will create a docker image based on a minimal java environment for running the Glassfish-based standalone jar.

To run the docker image, you could invoke this command

docker run -p 8080:8080 \
  tractusx/conforming-agent:1.14.24-SNAPSHOT

Afterwards, you should be able to access the local SparQL endpoint via the browser or by directly invoking a query

curl --location --request POST 'http://localhost:8080/bind' \
--header 'Content-Type: application/sparql-query' \
--header 'Accept: application/json' \
--data-raw 'PREFIX : <http://example.org/voc#>

SELECT ?x
WHERE {
   ?x a :Professor .
}'

You may manipulate any of the following environment variables to configure the image behaviour. Note that there is no builtin security (ssl/auth) for the exposed endpoints. This must be provided by hiding them in an appropriate service network layer.

ENVIRONMENT VARIABLE Required Example Description List
JAVA_TOOL_OPTIONS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8090 JMV (Debugging option) X

Notice for Docker Image

DockerHub: https://hub.docker.com/r/tractusx/conforming-agent

Eclipse Tractus-X product(s) installed within the image:

Used base image

As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.