Skip to content

noi-techpark/transmodel-api

Repository files navigation

Transmodel (NeTEx and SIRI FM) API wrapper for Open Data Hub

REUSE Compliance

This API provides data from the Open Data Hub in the standard formats NeTEx (Italian Profile) and SIRI-LITE FM (JSON).

It acts as a wrapper of the Open Data Hub API and has no internal data storage.

Getting started

Clone the repository and cd into it

We suggest using docker compose up to build and test.
The docker image provides live code reloading

To run natively

cd src
go run .

Refer to the docker file and docker-compose for more details

Tech stack

The application is written in Go with

  • gin for REST
  • air to provide live reloading during development (not mandatory)

Domain documentation

For documentation on the procotols, see the initial issue

The documents linked there are also in the documentation directory

The subrepo netex-italian-profile tracks the Italian netex profile repo and contains examples and validation xsd files.
Analogously, the subrepo siri-italian-profile tracks the Italian siri profile repo

The Italian profiles are an extension of the base NeTEx/SIRI specifications by CEN

Open Data Hub API calls

Example calls such as the ones used by this API are provided in calls.http

Adding datasets to export

New data sources are implemented as providers, implementing one or more of the relevant interfaces (see other provider). The provider must then be added to the endpoint calls in src/main.go

Running automated tests

Native: From /src folder run go test ./...
Docker: docker compose up test

XML Validation

The validation directory has a script to validate the produced XML files against the Italian Profile xsd.
xmllint is needed to run it locally, but we have also set up a dockerized version.

docker compose --profile validate up --attach validate --abort-on-container-exit

This starts a local API, requests the XML files, adds the missing header parts, and validates them

The XML file that was validated is saved in ./validation/validate.xml

General Information

Guidelines

Find here guidelines for developers.

Support

For support, please contact [email protected].

Contributing

If you'd like to contribute, please follow our Getting Started instructions.

Documentation

More documentation can be found at https://opendatahub.readthedocs.io/en/latest/index.html.

License

The code in this project is licensed under the GNU AFFERO GENERAL PUBLIC LICENSE Version 3 license.

For detailed licensing information, please refer to the REUSE spec.

REUSE

This project is REUSE compliant, more information about the usage of REUSE in NOI Techpark repositories can be found here.

Since the CI for this project checks for REUSE compliance you might find it useful to use a pre-commit hook checking for REUSE compliance locally. The pre-commit-config file in the repository root is already configured to check for REUSE compliance with help of the pre-commit tool.

Install the tool by running:

pip install pre-commit

Then install the pre-commit hook via the config file by running:

pre-commit install

About

Transmodel (NeTEx and SIRI) wrapper for Open Data Hub

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages