go-aas-proxy

Asset Administration Shell(AAS) proxy for RDBMS backend

View the Project on GitHub hiroyoshii/go-aas-proxy

go-aas-proxy

Asset Administration Shell(AAS) proxy for RDBMS backend

Build CodeQL OpenSSF Scorecard Go Report Card OpenSSF Best Practices GitHub go.mod Go version License

About

The go-aas-proxy is asset administration shell(aas) server which is implemented by go and proxy to RDBMS backend. not ready for production.

This implementation is inspired from "aas-proxy" in Representing the Virtual: Using AAS to Expose DigitalAssets paper. aas-proxy

"aas-proxy" means that submodels are configured by referencing the RDB of other applications. Therefore, only the AAS and the AAS-Submodel relationship can be created, updated, or deleted, while submodels are read-only.

Features

Unsuported:

Implementation Overview

architecture

How to run

  1. screate following submodel configuration file. - there are multiple reference database and query templates. - SQL query template has requested path parameter variables: .AasID, .SubmodelIDShort. - response template has query results variables: .<template file name>.Results.<column name> and .<template file name>.Columns.<column name>.
    • for example, template file path is sample/query.sql and column name is sample, variables are .Query.Results.Sample and .Query.Columns.Sample
submodels:
  - semanticID: "<submodel semantic ID>"
    queryTemplates:
      - path: "<SQL query file path (go template)>"
        dbName: "<database name for query execution>"
    responseTemplatePath: "<submodel json template file path>"
databases:
  - name: "<database name referenced by submodels.queryTemplates.dbName>"
    dbType: <type of RDBMS: postgres, mysql or oracle>
    dbConfig:
      host: <database host>
      port: <database port number>
      user: "<database user>"
      password: "<database password>"
      database: "<database name>"
      sslmode: "<sslmode if dbType is postgres>"
      options: "<database connection options>"
  1. set up postgresql database for aas and asset
  2. docker run
docker run \
-e SUBMODEL_CONFIG_PATH=<configuration file path in procedure 1.> \
-e AAS_TABLES_CREATED=true \
-e AAS_DB_HOST=<database host name in procedure 2.> \
hiroyoshii/go-aas-proxy:latest

Example

./e2e/scenario_setup.sh

Environment Variables

variables overview sample required
SUBMODEL_CONFIG_PATH submodel configuration file path.
submodel_config.yaml yes
AAS_TABLES_CREATED DDL stored AAS data is created or not when go-aas-proxy is started. true no (default: true)
AAS_DB_HOST Postgresql database host name for AAS stored 127.0.0.1 no (default: 127.0.0.1)
AAS_DB_PORT Postgresql database port number for AAS stored 5432 no (default: 5432)
AAS_DB_USER Postgresql database user for AAS stored postgres no (default: postgres)
AAS_DB_PASSWORD Postgresql database password for AAS stored password no (default: password)
AAS_DB_DATABASE Postgresql database name for AAS stored sample no (default: sample)
AAS_DB_SSL_MODE Postgresql database sslmode for AAS stored disable no (default: disable)

License

Apache License 2.0, see LICENSE.