NeTEx icon indicating copy to clipboard operation
NeTEx copied to clipboard

Confused by VehicleMode, TransportMode, AllVehicleModesOfTransport, etc.

Open trurlurl opened this issue 1 year ago • 3 comments

There are elements like VehicleMode(s), TransportMode(s), OtherTransportModes, Mode that map to the following three enumerations, but in very inconsistent or non-obvious ways: VehicleModeEnumeration, AllVehicleModesOfTransportEnumeration, AllModesEnumeration. It would be helpful to disentangle things a bit - by improving annotations and perhaps, where possible, by renaming elements and the three enumeration types.

What I've found (unless I made some mistake):

  • AllVehicleModesOfTransportEnumeration is a superset of VehicleModeEnumeration, with additional values unknown, anyMode, intercityRail, urbanRail
  • AllModesEnumeration is a superset of AllVehicleModesOfTransportEnumeration, with additional values foot, bicycle, motorcycle, scooter, car, shuttle

I guess we can't get rid of VehicleModeEnumeration in favor of AllVehicleModesOfTransportEnumeration - or can we? If not, it would be good to describe the difference / rationale.

Could we choose less confusing names? E.g., PrimaryVehicleModesOfTransportEnumeration, AllVehicleModesOfTransportEnumeration, AllModesOfTransportEnumeration?

If the subset-superset hierarchy between the three enumerations were to hold in the future - would it make sense to inherit the values from the subset using the union construct in XSD?

As for the mapping from element names to the enumerations, could we choose more consistent names?

  • I guess that VehicleMode needs to stay for backwards compatibility. But then it would be good if OtherTransportModes (which also maps to VehicleModeEnumeration / PrimaryVehicleModesOfTransportEnumeration) could be renamed to OtherVehicleModes or OtherPrimaryVehicleModes.

  • TransportMode(s) should always map to AllModesEnumeration / AllModesOfTransportEnumeration.

  • A new name VehicleTransportMode might be introduced to consistently map to AllVehicleModesOfTransportEnumeration?

Last question: the plural forms referring to a list should, in principle, start with a lower case (transportModes). Change or leave it (many places)?

Depending on your feedback I would prepare a PR.

trurlurl avatar Sep 04 '24 11:09 trurlurl

@Aurige Can you pls instruct André? Or we discuss it tomorrow.

ue71603 avatar Sep 24 '24 20:09 ue71603

I'm open to renaming the enumeration's name and to "merge" some (most probably forgot VehicleModeEnumeration and only keep AllVehicleModesOfTransportEnumeration for example) But that's definitely to be discussed/approved by the group first

Aurige avatar Sep 25 '24 11:09 Aurige

Ok for a PR @trurlurl : trying to match TM as much as possible and avoid breaking compatibility With support from @Ulf9 @nick-knowles and me

Aurige avatar Sep 25 '24 12:09 Aurige

will be done with the PR

ue71603 avatar Apr 03 '25 14:04 ue71603