Skip to content

Commit 7ddb7f7

Browse files
committed
fix(openlabel): resolve audit findings on v1 structural schema
Make the LinkML structural schema faithfully validate the ASAM OpenLABEL v1.0.0 scenario tagging file format and its full tag vocabulary. Structural format (openlabel-v2-schema.yaml): - Accept numeric vec.val arrays (ranges/sets such as [3.4, 3.7] and [2, 3]) via standard LinkML any_of[float, string]; items were previously string-only and rejected the spec's own section 8.2.5 examples. Removing the schema-wide default_range lets any_of generate a clean, draft-independent anyOf (no helper class, no post-processing). - Allow tag_data as object OR string, matching ASAM oneOf[object, string]. - Constrain schema_version to "1.0.0", boolean/text type to "value", and drop the fabricated "set" vec type so the schema matches the ASAM schema exactly. - Generate the JSON Schema deterministically with gen-json-schema --deterministic --indent 3 (consistent with the OWL/SHACL/context targets), so output is stable and the pretty-format-json hook is a no-op. Tag vocabulary (openlabel-v2.yaml, scripts/sync_tag_type_enum.py): - Add 15 intermediate ODD/Behaviour category classes (SceneryJunction, EnvironmentWeather, BehaviourMotion, DrivableArea*, Geometry*, ...) and 10 mid-level enum values (RoundaboutLarge/Mini/Normal/Compact/Double and the uniform/variable signs) so every ASAM v1 tag class is a valid tag.type. - Derive TagTypeEnum from all openlabel_v2-namespaced classes; the vocabulary grows 227 -> 256 and now covers all 243 ASAM tag classes (0 missing). - New classes carry ISO 34503:2023 comments and v1 PAS 1883 notes, matching the model's ISO-migration citation convention. Tests and tooling: - Validate spec chapter-8 examples against BOTH the authoritative ASAM schema and the LinkML schema, and assert the vocabulary covers every ASAM tag class (replaces a tautological count test). Suite grows 19 -> 44 tests. - Correct the equivalence/stricter claims and add a scope note in SCHEMA_MODELING.md. Regenerated OWL/SHACL/JSON-LD context/JSON Schema/PROPERTIES; SHACL conformance suite and 44 unit tests pass; full pipeline is idempotent. Signed-off-by: Carlo van Driesten <carlo.van-driesten@bmw.de>
1 parent 629d50c commit 7ddb7f7

11 files changed

Lines changed: 11659 additions & 4018 deletions

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ _generate_default:
214214
"$(GEN_JSONLD_CONTEXT)" --deterministic --normalize-prefixes --no-metadata --exclude-external-imports --xsd-anyuri-as-iri linkml/$$domain/$$domain.yaml 2>/dev/null | tr -d '\r' | sed -e '$${' -e '/^$$/d' -e '}' > artifacts/$$domain/$$domain.context.jsonld; \
215215
if [ -f linkml/$$domain/$$domain-schema.yaml ]; then \
216216
echo " Generating JSON Schema for $$domain..."; \
217-
"$(GEN_JSON_SCHEMA)" linkml/$$domain/$$domain-schema.yaml 2>/dev/null | tr -d '\r' > artifacts/$$domain/$$domain.schema.json; \
217+
"$(GEN_JSON_SCHEMA)" --deterministic --indent 3 linkml/$$domain/$$domain-schema.yaml 2>/dev/null | tr -d '\r' | sed -e '$${' -e '/^$$/d' -e '}' > artifacts/$$domain/$$domain.schema.json; \
218218
fi; \
219219
done
220220
@echo "[OK] Artifacts generated"

artifacts/openlabel-v2/PROPERTIES.md

Lines changed: 1071 additions & 427 deletions
Large diffs are not rendered by default.

artifacts/openlabel-v2/openlabel-v2.context.jsonld

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
"@id": "BehaviourCommunication",
2424
"@type": "@vocab"
2525
},
26+
"BehaviourMotion": {
27+
"@id": "BehaviourMotion"
28+
},
2629
"ConnectivityCommunication": {
2730
"@context": {
2831
"@vocab": "https://w3id.org/ascs-ev/envited-x/openlabel/v2/",
@@ -67,6 +70,18 @@
6770
"@id": "DrivableAreaEdge",
6871
"@type": "@vocab"
6972
},
73+
"DrivableAreaGeometry": {
74+
"@id": "DrivableAreaGeometry"
75+
},
76+
"DrivableAreaLaneSpecification": {
77+
"@id": "DrivableAreaLaneSpecification"
78+
},
79+
"DrivableAreaSigns": {
80+
"@id": "DrivableAreaSigns"
81+
},
82+
"DrivableAreaSurface": {
83+
"@id": "DrivableAreaSurface"
84+
},
7085
"DrivableAreaSurfaceCondition": {
7186
"@context": {
7287
"@vocab": "https://w3id.org/ascs-ev/envited-x/openlabel/v2/",
@@ -107,6 +122,18 @@
107122
"@id": "DrivableAreaType",
108123
"@type": "@vocab"
109124
},
125+
"DynamicElementsSubjectVehicle": {
126+
"@id": "DynamicElementsSubjectVehicle"
127+
},
128+
"DynamicElementsTraffic": {
129+
"@id": "DynamicElementsTraffic"
130+
},
131+
"EnvironmentConnectivity": {
132+
"@id": "EnvironmentConnectivity"
133+
},
134+
"EnvironmentIllumination": {
135+
"@id": "EnvironmentIllumination"
136+
},
110137
"EnvironmentParticulates": {
111138
"@context": {
112139
"@vocab": "https://w3id.org/ascs-ev/envited-x/openlabel/v2/",
@@ -117,6 +144,15 @@
117144
"@id": "EnvironmentParticulates",
118145
"@type": "@vocab"
119146
},
147+
"EnvironmentWeather": {
148+
"@id": "EnvironmentWeather"
149+
},
150+
"GeometryHorizontal": {
151+
"@id": "GeometryHorizontal"
152+
},
153+
"GeometryLongitudinal": {
154+
"@id": "GeometryLongitudinal"
155+
},
120156
"GeometryTransverse": {
121157
"@context": {
122158
"@vocab": "https://w3id.org/ascs-ev/envited-x/openlabel/v2/",
@@ -149,6 +185,9 @@
149185
"@id": "IlluminationCloudiness",
150186
"@type": "xsd:boolean"
151187
},
188+
"IlluminationDay": {
189+
"@id": "IlluminationDay"
190+
},
152191
"IlluminationLowLight": {
153192
"@context": {
154193
"@vocab": "https://w3id.org/ascs-ev/envited-x/openlabel/v2/",
@@ -378,6 +417,9 @@
378417
"Scenario": {
379418
"@id": "Scenario"
380419
},
420+
"SceneryDrivableArea": {
421+
"@id": "SceneryDrivableArea"
422+
},
381423
"SceneryFixedStructure": {
382424
"@context": {
383425
"@vocab": "https://w3id.org/ascs-ev/envited-x/openlabel/v2/",
@@ -388,6 +430,9 @@
388430
"@id": "SceneryFixedStructure",
389431
"@type": "@vocab"
390432
},
433+
"SceneryJunction": {
434+
"@id": "SceneryJunction"
435+
},
391436
"ScenerySpecialStructure": {
392437
"@context": {
393438
"@vocab": "https://w3id.org/ascs-ev/envited-x/openlabel/v2/",

0 commit comments

Comments
 (0)