NeTEx icon indicating copy to clipboard operation
NeTEx copied to clipboard

Wrong assignment of ActualVehicleEquipmentGroup

Open Robbendebiene opened this issue 5 months ago • 13 comments

I noticed that EquipmentRef can be assigned to WheelchairVehicleEquipment and AccessVehicleEquipment. This seemed wrong to me. My guess is that the ActualVehicleEquipmentGroup shouldn't be part of them.

Currently things like this can be done:

<ActualVehicleEquipment>
   <Units>3</Units>
   <AccessVehicleEquipmentRef ref="a"/>
</ActualVehicleEquipment>

<AccessVehicleEquipment version="any" id="a">
   <Units>3</Units><!-- feels wrong -->
   <BedEquipmentRef ref="x"/><!-- feels wrong -->
   <!-- equipment properties here -->
</AccessVehicleEquipment>

I think only this should be possible

<ActualVehicleEquipment>
   <Units>3</Units>
   <AccessVehicleEquipmentRef ref="a"/>
</ActualVehicleEquipment>

<AccessVehicleEquipment version="any" id="a">
   <!-- equipment properties here -->
</AccessVehicleEquipment>

The commit states that these changes are originally from @nick-knowles

Robbendebiene avatar Jul 31 '25 06:07 Robbendebiene

I don't think this is the right solution. I think that the cause is more in the direction of the subsitution group...

skinkie avatar Jul 31 '25 07:07 skinkie

@skinkie you disagree it seems

ue71603 avatar Jul 31 '25 08:07 ue71603

@skinkie Can you please elaborate what substitution group you are referring to (I assume substitutionGroup="PassengerEquipment") and how it would solve the problem?

In my solution I probably would also have to change <xsd:extension base="ActualVehicleEquipment_VersionStructure"> for WheelchairVehicleEquipment_VersionStructure and AccessVehicleEquipment_VersionStructure. Though to be honest, I haven't understood the usage of X_VersionStructure yet.

Robbendebiene avatar Jul 31 '25 08:07 Robbendebiene

@Robbendebiene therefore I want to have @Aurige or @nick-knowles comment here.

skinkie avatar Jul 31 '25 08:07 skinkie

This is coming from Transmodel ... If I remember well the key point of the ActualVehicleEquipment is to connect the Equipment to a VehicleType, but as the ActualVehicleEquipment can be standalone, it also needs to be able to refer an Equipment (not to be used when already embedded in an Equipment). But I'm puzzled by the VehicleType relation (instead of Vehicle) in the XSD ... So changes here would require a larger group discussion image

Aurige avatar Aug 04 '25 09:08 Aurige

I feel like there might be a small misunderstanding, so I just want to restate that the problem I'm reporting is more about AccessVehicleEquipment and WheelchairVehicleEquipment than about ActualVehicleEquipment.

Simply speaking I think AccessVehicleEquipment and WheelchairVehicleEquipment should not incorporate any properties from ActualVehicleEquipment (like the EquipmentRef). Instead ActualVehicleEquipment should be used to reference AccessVehicleEquipment and WheelchairVehicleEquipment.

I think ActualVehicleEquipment is fine except that it doesn't make sense to allow it in ResourceFrame/equipments and that there is a small inconsistency in what actualVehicleEquipments can contain which I described here: https://github.com/NeTEx-CEN/NeTEx/issues/875

But I'm puzzled by the VehicleType relation (instead of Vehicle) in the XSD ...

That is actually a question I had as well which I raised here https://github.com/NeTEx-CEN/NeTEx/issues/875#issue-3010873449 So perhaps it makes sense to discuss these topics together.

Robbendebiene avatar Aug 04 '25 11:08 Robbendebiene

Happy to approve if @skinkie running the script confirms that no examples are broken

TuThoThai avatar Aug 26 '25 13:08 TuThoThai

THIS FAILS.

examples/functions/timetable/Netex_21_Rail_NetworkTimetable_eurostar.xml:11730: Schemas validity error : Element '{http://www.netex.org.uk/netex}AccessibilityAssessment': This element is not expected. Expected is one of ( {http://www.netex.org.uk/netex}validityConditions, {http://www.netex.org.uk/netex}ValidBetween, {http://www.netex.org.uk/netex}alternativeTexts, {http://www.netex.org.uk/netex}keyList, {http://www.netex.org.uk/netex}privateCodes, {http://www.netex.org.uk/netex}Extensions, {http://www.netex.org.uk/netex}BrandingRef, {http://www.netex.org.uk/netex}Name, {http://www.netex.org.uk/netex}PrivateCode, {http://www.netex.org.uk/netex}PublicCode ).

Where it fails:

<WheelchairVehicleEquipment version="any" id="est:WheelchairVehicleEquipment:sfe_veheq_trne_LP01_10_02">
        <AccessibilityAssessment version="any" id="est:acaa_sfe_veheq_trne_LP01_10_02">
                <MobilityImpairedAccess>true</MobilityImpairedAccess>
                <suitabilities>
                        <Suitability id="est:acsst_sfe_veheq_trne_LP01_10_02">
                                <MobilityNeed>wheelchair</MobilityNeed>
                                <Suitable>notSuitable</Suitable>
                        </Suitability>
                </suitabilities>
        </AccessibilityAssessment>
        <NumberOfWheelchairAreas>1</NumberOfWheelchairAreas>
        <WidthOfAccessArea>1.0</WidthOfAccessArea>
        <CompanionSeat>true</CompanionSeat>
</WheelchairVehicleEquipment>

skinkie avatar Aug 26 '25 13:08 skinkie

THIS FAILS.

examples/functions/timetable/Netex_21_Rail_NetworkTimetable_eurostar.xml:11730: Schemas validity error : Element '{http://www.netex.org.uk/netex}AccessibilityAssessment': This element is not expected. Expected is one of ( {http://www.netex.org.uk/netex}validityConditions, {http://www.netex.org.uk/netex}ValidBetween, {http://www.netex.org.uk/netex}alternativeTexts, {http://www.netex.org.uk/netex}keyList, {http://www.netex.org.uk/netex}privateCodes, {http://www.netex.org.uk/netex}Extensions, {http://www.netex.org.uk/netex}BrandingRef, {http://www.netex.org.uk/netex}Name, {http://www.netex.org.uk/netex}PrivateCode, {http://www.netex.org.uk/netex}PublicCode ).

Where it fails:

<WheelchairVehicleEquipment version="any" id="est:WheelchairVehicleEquipment:sfe_veheq_trne_LP01_10_02">
        <AccessibilityAssessment version="any" id="est:acaa_sfe_veheq_trne_LP01_10_02">
                <MobilityImpairedAccess>true</MobilityImpairedAccess>
                <suitabilities>
                        <Suitability id="est:acsst_sfe_veheq_trne_LP01_10_02">
                                <MobilityNeed>wheelchair</MobilityNeed>
                                <Suitable>notSuitable</Suitable>
                        </Suitability>
                </suitabilities>
        </AccessibilityAssessment>
        <NumberOfWheelchairAreas>1</NumberOfWheelchairAreas>
        <WidthOfAccessArea>1.0</WidthOfAccessArea>
        <CompanionSeat>true</CompanionSeat>
</WheelchairVehicleEquipment>

Interesting, it is a modelling way we do not use in France as for us it is a bit redundant. If you are describing a WheelchairVehicleEquipment, we do not use AccessibilityAssessment 😄

TuThoThai avatar Aug 26 '25 14:08 TuThoThai

So there are two options:

  1. Deprecate the properties inherited from ActualVehicleEquipmentGroup for WheelchairVehicleEquipment and AccessVehicleEquipment instead of removing them because they are on master and also used in an example.
  2. Adjust the example and keep removing these properties. This would break backwards compatibility but on the other hand it is a bug which was never intended to work.

Which way to go?

Robbendebiene avatar Aug 27 '25 08:08 Robbendebiene

The online view of Transmodel 2021 (https://transmodel-cen.eu/model/) also contains the inheritance of ActualVehicleEquipment. So this at least explains why it is in NeTEx as well.

grafik

The question basically boils down to: Should AccessibilityAssessment be on the equipment definition as well (like it is e.g. for SanitaryEquipment) or should it only be on ActualVehicleEquipment? From a DeckPlan perspective one always requires an ActualVehicleEquipment so it is not needed in this area. However if the equipment is assigned via an VehicleEquipmentProfile or directly to a Trailing/TractiveElementType (as in the failing example) referencing an ActualVehicleEquipment which in turn references another equipment feels odd.

Robbendebiene avatar Sep 01 '25 09:09 Robbendebiene

I am all for deprecating erronous modeling.

skinkie avatar Sep 01 '25 10:09 skinkie

I added a separate group to annotate the properties as deprecated.

Robbendebiene avatar Sep 01 '25 11:09 Robbendebiene