Skip to content

Commit 2dbcf5e

Browse files
authored
fix(ontology): fix semantic bugs in hdmap/scenario OpenLABEL v1 integration (#72)
The hdmap and scenario domains had several modelling bugs exposed during SHACL validation with the corrected context generator: - scenario:Scenario used rdfs:subClassOf openlabel:Scenario, causing every Scenario instance to be inferred as an RDF class under RDFS entailment; replaced with rdfs:seeAlso - ContentOrTag union was too narrow (only openlabel:Tag); renamed to ContentOrDynamicAnnotation with proper ODD members (OddEnvironment, OddDynamicElements, Behaviour, RoadUser) - hdmap SHACL used generic OddShape with ill-formed sh:node xsd:boolean (violates SHACL §4.7.1); replaced with specific OddSceneryShape - Missing owl:imports for openlabel in both hdmap.owl.ttl and scenario.owl.ttl Also: - Add OddSceneryShape, OddEnvironmentShape, OddDynamicElementsShape to openlabel.shacl.ttl for granular ODD validation in domain union shapes - Add Safety Pool DB v1.6 scenario tagging ontology import - Update test data to use bare enum values and openlabel: prefix for @type - Retain openlabel prefix in existing invalid tests for prefix-style coverage - Add flat-context invalid tests (no explicit prefix) for both scenario (wrong enum value) and hdmap (false boolean with value present) Signed-off-by: Carlo van Driesten <carlo.van-driesten@bmw.de>
1 parent f0042b5 commit 2dbcf5e

24 files changed

Lines changed: 1295 additions & 108 deletions

artifacts/hdmap/hdmap.context.jsonld

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"skos": "http://www.w3.org/2004/02/skos/core#",
1717
"schema": "https://schema.org/",
1818
"hdmap": "https://w3id.org/ascs-ev/envited-x/hdmap/v6/",
19+
"openlabel": "https://openlabel.asam.net/V1-0-0/ontologies/",
1920
"envited-x": "https://w3id.org/ascs-ev/envited-x/envited-x/v3/",
2021
"georeference": "https://w3id.org/ascs-ev/envited-x/georeference/v5/",
2122
"accuracyLaneModel2d": {

artifacts/hdmap/hdmap.owl.ttl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646

4747
# Imports strict dependencies
4848
owl:imports <https://w3id.org/ascs-ev/envited-x/envited-x/v3> ,
49-
<https://w3id.org/ascs-ev/envited-x/georeference/v5> ;
49+
<https://w3id.org/ascs-ev/envited-x/georeference/v5> ,
50+
<https://openlabel.asam.net/V1-0-0/ontologies> ;
5051

5152
# Reference to SHACL validation rules
5253
dcterms:conformsTo <https://w3id.org/ascs-ev/envited-x/hdmap/v6/shapes> ;

artifacts/hdmap/hdmap.shacl.ttl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,9 @@ hdmap:ContentOrOddSceneryShape a sh:NodeShape ;
209209
sh:description "HDMap Content or OpenLABEL ODD Scenery Union Shape"@en ;
210210
sh:or (
211211
[ sh:node hdmap:ContentShape ]
212-
[ sh:node openlabel:OddShape ] # Validates against the external OpenLABEL shape
213-
[ sh:node xsd:boolean ]
212+
[ sh:node openlabel:OddSceneryShape ]
214213
) ;
215-
sh:message "Each item of hasContent must conform to either Scenario Content or OpenLABEL Tag."@en .
214+
sh:message "Each item of hasContent must conform to either HDMap Content or OpenLABEL OddScenery."@en .
216215

217216
hdmap:ContentShape a sh:NodeShape ;
218217
sh:closed false ;

artifacts/openlabel/openlabel.shacl.ttl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,30 @@ openlabel:BehaviourShape a sh:NodeShape ;
446446
# ODD Shape
447447
##############################################################################
448448

449+
##############################################################################
450+
# ODD Sub-Shapes (for use in domain union shapes)
451+
# Property validation is inherited from OddShape via rdfs:subClassOf inference.
452+
##############################################################################
453+
454+
openlabel:OddSceneryShape a sh:NodeShape ;
455+
sh:targetClass openlabel:OddScenery ;
456+
sh:closed false ;
457+
sh:description "Shape for ODD Scenery data (BSI PAS-1883 §5.2: road geometry, lane specs, signs, junctions, structures)."@en .
458+
459+
openlabel:OddEnvironmentShape a sh:NodeShape ;
460+
sh:targetClass openlabel:OddEnvironment ;
461+
sh:closed false ;
462+
sh:description "Shape for ODD Environment data (BSI PAS-1883 §5.3: weather, illumination, connectivity, particulates)."@en .
463+
464+
openlabel:OddDynamicElementsShape a sh:NodeShape ;
465+
sh:targetClass openlabel:OddDynamicElements ;
466+
sh:closed false ;
467+
sh:description "Shape for ODD Dynamic Elements data (BSI PAS-1883 §5.4: traffic density, flow, subject vehicle speed)."@en .
468+
469+
##############################################################################
470+
# ODD Shape (flat, validates all Odd properties)
471+
##############################################################################
472+
449473
openlabel:OddShape a sh:NodeShape ;
450474
sh:targetClass openlabel:Odd ;
451475
sh:property

artifacts/scenario/PROPERTIES.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Class_definition_for_Format
1111
class Class_definition_for_Quality
1212
class Class_definition_for_Quantity
1313
class Class_definition_for_Scenario
14-
class Content_or_OpenLabel_Tag
14+
class Content_or_OpenLABEL_Dynamic_Annotation
1515
```
1616

1717
### Class Hierarchy
@@ -23,7 +23,7 @@ class Content_or_OpenLabel_Tag
2323
- Class definition for Quality (https://w3id.org/ascs-ev/envited-x/scenario/v6/Quality)
2424
- Class definition for Quantity (https://w3id.org/ascs-ev/envited-x/scenario/v6/Quantity)
2525
- Class definition for Scenario (https://w3id.org/ascs-ev/envited-x/scenario/v6/Scenario)
26-
- Content or OpenLabel Tag (https://w3id.org/ascs-ev/envited-x/scenario/v6/ContentOrTag)
26+
- Content or OpenLABEL Dynamic Annotation (https://w3id.org/ascs-ev/envited-x/scenario/v6/ContentOrDynamicAnnotation)
2727

2828
### Class Definitions
2929

@@ -35,8 +35,8 @@ class Content_or_OpenLabel_Tag
3535
|Class definition for Format|https://w3id.org/ascs-ev/envited-x/scenario/v6/Format|Contains properties that describe the format of the scenario asset.|Format|
3636
|Class definition for Quality|https://w3id.org/ascs-ev/envited-x/scenario/v6/Quality|Contains properties that describe the accuracy of objects and the calibration of the scenario asset.|Quality|
3737
|Class definition for Quantity|https://w3id.org/ascs-ev/envited-x/scenario/v6/Quantity|Contains properties that describe the quantity of the scenario asset (e.g., number of traffic objects, controllers).|Quantity|
38-
|Class definition for Scenario|https://w3id.org/ascs-ev/envited-x/scenario/v6/Scenario|General properties for defining a scenario asset, including format, content, data sources, quantity, and quality attributes.|Scenario, SimulationAsset|
39-
|Content or OpenLabel Tag|https://w3id.org/ascs-ev/envited-x/scenario/v6/ContentOrTag|Combines Scenario content with OpenLABEL's Tag.||
38+
|Class definition for Scenario|https://w3id.org/ascs-ev/envited-x/scenario/v6/Scenario|General properties for defining a scenario asset, including format, content, data sources, quantity, and quality attributes.|SimulationAsset|
39+
|Content or OpenLABEL Dynamic Annotation|https://w3id.org/ascs-ev/envited-x/scenario/v6/ContentOrDynamicAnnotation|Combines Scenario content with OpenLABEL's dynamic annotation types: OddEnvironment, OddDynamicElements, Behaviour, and RoadUser.||
4040

4141
## Prefixes
4242

artifacts/scenario/scenario.context.jsonld

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"skos": "http://www.w3.org/2004/02/skos/core#",
1717
"schema": "https://schema.org/",
1818
"scenario": "https://w3id.org/ascs-ev/envited-x/scenario/v6/",
19+
"openlabel": "https://openlabel.asam.net/V1-0-0/ontologies/",
1920
"envited-x": "https://w3id.org/ascs-ev/envited-x/envited-x/v3/",
2021
"georeference": "https://w3id.org/ascs-ev/envited-x/georeference/v5/",
2122
"abstractionLevel": {
@@ -133,7 +134,7 @@
133134
"@id": "scenario:weatherSummary"
134135
},
135136
"Content": "scenario:Content",
136-
"ContentOrTag": "scenario:ContentOrTag",
137+
"ContentOrDynamicAnnotation": "scenario:ContentOrDynamicAnnotation",
137138
"DataSource": "scenario:DataSource",
138139
"DomainSpecification": "scenario:DomainSpecification",
139140
"Format": "scenario:Format",

artifacts/scenario/scenario.owl.ttl

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353

5454
# Imports strict dependencies
5555
owl:imports <https://w3id.org/ascs-ev/envited-x/envited-x/v3> ,
56-
<https://w3id.org/ascs-ev/envited-x/georeference/v5> ;
56+
<https://w3id.org/ascs-ev/envited-x/georeference/v5> ,
57+
<https://openlabel.asam.net/V1-0-0/ontologies> ;
5758

5859
# Reference to SHACL validation rules
5960
dcterms:conformsTo <https://w3id.org/ascs-ev/envited-x/scenario/v6/shapes> ;
@@ -67,8 +68,8 @@
6768
scenario:Scenario a owl:Class ;
6869
rdfs:label "Class definition for Scenario"@en ;
6970
rdfs:comment "General properties for defining a scenario asset, including format, content, data sources, quantity, and quality attributes."@en ;
70-
rdfs:subClassOf envited-x:SimulationAsset ,
71-
openlabel:Scenario ;
71+
rdfs:subClassOf envited-x:SimulationAsset ;
72+
rdfs:seeAlso openlabel:Scenario ;
7273
rdfs:subClassOf [
7374
a owl:Restriction ;
7475
owl:onProperty scenario:hasDomainSpecification ;
@@ -185,18 +186,19 @@ scenario:hasManifest a owl:ObjectProperty ;
185186
owl:unionOf ( envited-x:Manifest manifest:Link )
186187
] .
187188

188-
# Declare a union class combining scenario:Content and openlabel:Tag
189-
scenario:ContentOrTag a owl:Class ;
190-
rdfs:label "Content or OpenLabel Tag"@en ;
191-
rdfs:comment "Combines Scenario content with OpenLABEL's Tag."@en ;
192-
owl:unionOf (scenario:Content openlabel:Tag) .
189+
# Union class for scenario content and OpenLABEL dynamic annotations.
190+
# Excludes OddScenery (belongs to hdmap) and AdminTag (covered by Gaia-X ResourceDescription).
191+
scenario:ContentOrDynamicAnnotation a owl:Class ;
192+
rdfs:label "Content or OpenLABEL Dynamic Annotation"@en ;
193+
rdfs:comment "Combines Scenario content with OpenLABEL's dynamic annotation types: OddEnvironment, OddDynamicElements, Behaviour, and RoadUser."@en ;
194+
owl:unionOf (scenario:Content openlabel:OddEnvironment openlabel:OddDynamicElements openlabel:Behaviour openlabel:RoadUser) .
193195

194196
scenario:hasContent a owl:ObjectProperty ;
195197
rdfs:label "Object property: hasContent"@en ;
196198
rdfs:comment "Links a DomainSpecification to an instance of scenario:Content that describes the scenario's content."@en ;
197199
rdfs:subPropertyOf envited-x:hasContent ;
198200
rdfs:domain scenario:DomainSpecification ;
199-
rdfs:range scenario:ContentOrTag .
201+
rdfs:range scenario:ContentOrDynamicAnnotation .
200202

201203
scenario:hasDataSource a owl:ObjectProperty ;
202204
rdfs:label "Object property: hasDataSource"@en ;

artifacts/scenario/scenario.shacl.ttl

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ scenario:DomainSpecificationShape a sh:NodeShape ;
103103
sh:property
104104
[
105105
sh:minCount 1 ;
106-
sh:node scenario:ContentOrTagShape ;
106+
sh:node scenario:ContentOrDynamicAnnotationShape ;
107107
sh:name "content"@en ;
108108
sh:description "Attributes describing the content of the scenario."@en ;
109109
sh:order 1 ;
@@ -156,15 +156,17 @@ scenario:DomainSpecificationShape a sh:NodeShape ;
156156
] ;
157157
sh:targetClass scenario:DomainSpecification .
158158

159-
### New Union Shape for Content
160-
scenario:ContentOrTagShape a sh:NodeShape ;
161-
sh:description "Scenario Content or OpenLABEL Tag Union Shape"@en ;
159+
### Union Shape for Content or Dynamic Annotations
160+
scenario:ContentOrDynamicAnnotationShape a sh:NodeShape ;
161+
sh:description "Scenario Content or OpenLABEL Dynamic Annotation Union Shape"@en ;
162162
sh:or (
163163
[ sh:node scenario:ContentShape ]
164-
[ sh:node openlabel:TagShape ]
165-
[ sh:node xsd:boolean ]
164+
[ sh:node openlabel:OddEnvironmentShape ]
165+
[ sh:node openlabel:OddDynamicElementsShape ]
166+
[ sh:node openlabel:BehaviourShape ]
167+
[ sh:node openlabel:RoadUserShape ]
166168
) ;
167-
sh:message "Each item of hasContent must conform to either Scenario Content, an OpenLABEL Tag, or a boolean."@en .
169+
sh:message "Each item of hasContent must conform to Scenario Content, OddEnvironment, OddDynamicElements, Behaviour, or RoadUser."@en .
168170

169171
### Detailed Shapes (Expanded based on Instance Data)
170172
scenario:FormatShape a sh:NodeShape ;

config/ontoenv.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ local = "imports/rdf/rdf.owl.ttl"
4747
uri = "http://www.w3.org/2000/01/rdf-schema#"
4848
local = "imports/rdfs/rdfs.owl.ttl"
4949

50+
[dependencies.safetypooldb]
51+
uri = "https://live.safetypooldb.ai/api/ontologies/v1.6/"
52+
local = "imports/safetypooldb/safetypooldb.owl.ttl"
53+
description = "Safety Pool DB V1.6 Scenario Tagging Ontology"
54+
5055
[dependencies.schema]
5156
uri = "https://schema.org/"
5257
local = "imports/schema/schema.owl.ttl"

imports/catalog-v001.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<uri name="http://www.w3.org/ns/prov#" uri="prov/prov.owl.ttl"/>
1414
<uri name="http://www.w3.org/ns/shacl#" uri="sh/sh.owl.ttl"/>
1515
<uri name="http://xmlns.com/foaf/0.1/" uri="foaf/foaf.owl.ttl"/>
16+
<uri name="https://live.safetypooldb.ai/api/ontologies/v1.6/" uri="safetypooldb/safetypooldb.owl.ttl"/>
1617
<uri name="https://schema.org" uri="schema/schema.context.jsonld"/>
1718
<uri name="https://schema.org/" uri="schema/schema.owl.ttl"/>
1819
<uri name="https://w3id.org/security#" uri="sec/sec.owl.ttl"/>

0 commit comments

Comments
 (0)