Problem
The trafficAgentTypeValue slot in openlabel-v2 requires explicit {""@id"": ""openlabel_v2:VehicleCar""} notation in JSON-LD instance data, while all other enum slots allow bare string values like ""RoadTypeMotorway"".
Example (current -- verbose):
""trafficAgentTypeValue"": [
{""@id"": ""openlabel_v2:VehicleCar""},
{""@id"": ""openlabel_v2:HumanPedestrian""}
]
Desired (consistent with other enum slots):
""trafficAgentTypeValue"": [""VehicleCar"", ""HumanPedestrian""]
Root Cause
The LinkML JSON-LD context generator does not emit ""@type"": ""@vocab""`` for slots that use any_of` with multiple enum ranges:
trafficAgentTypeValue:
any_of:
- range: RoadUserHumanEnum
- range: RoadUserVehicleEnum
multivalued: true
Single-range enum slots get proper context coercion:
""DrivableAreaType"": {
""@context"": {""@vocab"": ""https://w3id.org/ascs-ev/envited-x/openlabel/v2/""},
""@id"": ""DrivableAreaType"",
""@type"": ""@vocab""
}
But trafficAgentTypeValue only gets:
""trafficAgentTypeValue"": {
""@id"": ""trafficAgentTypeValue""
}
Possible Solutions
-
Fix in LinkML context generator (gen-jsonld-context): When a slot has any_of with exclusively enum ranges that share the same namespace, emit @type: @vocab with the shared @vocab.
-
Schema workaround: Merge RoadUserHumanEnum and RoadUserVehicleEnum into a single TrafficAgentTypeEnum so the slot has a single enum range.
Affected Files
submodules/linkml -- gen-jsonld-context generator
artifacts/openlabel-v2/openlabel-v2.context.jsonld
tests/data/openlabel-v2/valid/openlabel-v2_instance.json
tests/data/openlabel-v2/invalid/fail11_traffic_agent_wrong_enum.json
Problem
The
trafficAgentTypeValueslot in openlabel-v2 requires explicit{""@id"": ""openlabel_v2:VehicleCar""}notation in JSON-LD instance data, while all other enum slots allow bare string values like""RoadTypeMotorway"".Example (current -- verbose):
Desired (consistent with other enum slots):
Root Cause
The LinkML JSON-LD context generator does not emit
""@type"": ""@vocab""`` for slots that useany_of` with multiple enum ranges:Single-range enum slots get proper context coercion:
But
trafficAgentTypeValueonly gets:Possible Solutions
Fix in LinkML context generator (
gen-jsonld-context): When a slot hasany_ofwith exclusively enum ranges that share the same namespace, emit@type: @vocabwith the shared@vocab.Schema workaround: Merge
RoadUserHumanEnumandRoadUserVehicleEnuminto a singleTrafficAgentTypeEnumso the slot has a single enum range.Affected Files
submodules/linkml--gen-jsonld-contextgeneratorartifacts/openlabel-v2/openlabel-v2.context.jsonldtests/data/openlabel-v2/valid/openlabel-v2_instance.jsontests/data/openlabel-v2/invalid/fail11_traffic_agent_wrong_enum.json