raillabel_providerkit.ontologies package

Submodules

raillabel_providerkit.ontologies.manager module

Built-in ontology definitions for raillabel-providerkit.

This module provides access to pre-built ontology parameter files that can be used for scene validation. Instead of managing ontology files separately, you can use:

from raillabel_providerkit.ontologies import get_ontology_path

path = get_ontology_path(“osdar26”) issues = validate(scene_path, ontology=path)

All ontology files are stored centrally in the config/ontologies/ directory.

raillabel_providerkit.ontologies.manager.get_ontology_path(ontology_name: str) Path

Get the path to a built-in ontology file.

Parameters:

ontology_name (str) – Name of the ontology to load. Supported values: - “osdar26”: Extended railway environment ontology (25 classes) - “automatedtrain”: Safety-critical classes for automated train operation - “osdar23”: Original OSDAR23 dataset ontology

Returns:

Path to the ontology YAML file (located in config/ontologies/)

Return type:

Path

Raises:

ValueError – If the ontology name is not recognized

raillabel_providerkit.ontologies.manager.get_schema_path(schema_name: str) Path

Get the path to a built-in schema file.

Parameters:

schema_name (str) – Name of the schema to load. Supported values: - “raillabel”: Generic RailLabel JSON schema (OpenLABEL subset) - “osdar23”: OSDAR23-specific RailLabel schema - “osdar26”: OSDAR26-specific RailLabel schema - “automatedtrain”: AutomatedTrain-specific RailLabel schema - “understand_ai_t4”: Understand.AI T4 format schema - “ontology”: Ontology validation schema (v2)

Returns:

Path to the schema file (located in config/schemas/)

Return type:

Path

Raises:

ValueError – If the schema name is not recognized

Notes

The ontology-specific schemas (osdar23, osdar26, automatedtrain) are currently identical copies of the base raillabel schema, as they share the same OpenLABEL structure. Ontology-specific validation is handled by the ontology YAML files.

raillabel_providerkit.ontologies.manager.list_available_ontologies() list[str]

List all available built-in ontologies.

Returns:

List of available ontology names

Return type:

list[str]

raillabel_providerkit.ontologies.manager.list_available_schemas() list[str]

List all available built-in schemas.

Returns:

List of available schema names

Return type:

list[str]

Module contents

Package for built-in ontology and schema definitions.

raillabel_providerkit.ontologies.get_ontology_path(ontology_name: str) Path

Get the path to a built-in ontology file.

Parameters:

ontology_name (str) – Name of the ontology to load. Supported values: - “osdar26”: Extended railway environment ontology (25 classes) - “automatedtrain”: Safety-critical classes for automated train operation - “osdar23”: Original OSDAR23 dataset ontology

Returns:

Path to the ontology YAML file (located in config/ontologies/)

Return type:

Path

Raises:

ValueError – If the ontology name is not recognized

raillabel_providerkit.ontologies.get_schema_path(schema_name: str) Path

Get the path to a built-in schema file.

Parameters:

schema_name (str) – Name of the schema to load. Supported values: - “raillabel”: Generic RailLabel JSON schema (OpenLABEL subset) - “osdar23”: OSDAR23-specific RailLabel schema - “osdar26”: OSDAR26-specific RailLabel schema - “automatedtrain”: AutomatedTrain-specific RailLabel schema - “understand_ai_t4”: Understand.AI T4 format schema - “ontology”: Ontology validation schema (v2)

Returns:

Path to the schema file (located in config/schemas/)

Return type:

Path

Raises:

ValueError – If the schema name is not recognized

Notes

The ontology-specific schemas (osdar23, osdar26, automatedtrain) are currently identical copies of the base raillabel schema, as they share the same OpenLABEL structure. Ontology-specific validation is handled by the ontology YAML files.

raillabel_providerkit.ontologies.list_available_ontologies() list[str]

List all available built-in ontologies.

Returns:

List of available ontology names

Return type:

list[str]

raillabel_providerkit.ontologies.list_available_schemas() list[str]

List all available built-in schemas.

Returns:

List of available schema names

Return type:

list[str]