Resolve conflicting element names in fares: StepLimitUnit, FulfilmentMethodTypes, NumberOfUnits#1049
Open
atibaut wants to merge 1 commit into
Open
Resolve conflicting element names in fares: StepLimitUnit, FulfilmentMethodTypes, NumberOfUnits#1049atibaut wants to merge 1 commit into
atibaut wants to merge 1 commit into
Conversation
…dTypes and NumberOfUnits; deprecate misleadingly named forms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following my semantic wave... because better machine reasoning depends on humans describing semantics with precision and without ambiguity.
Several fares elements share a name with an element of a different type or meaning in another context, which misleads implementers and produces confusing generated bindings. This PR resolves the three genuine cases without breaking existing documents, using the same pattern as #1041: the correctly named element is added, the old one is deprecated, and both are wrapped in an
xsd:choiceso a document cannot state the same fact twice. New components are marked+v2.1, deprecations-v2.1.Proposed changes
1.
AdjustmentUnits/ quantity vs unit kindnetex_farePrice_version.xsd)AdjustmentUnitsisxsd:decimal(a step-calculation quantity); unchanged.netex_usageParameterTravel_version.xsd) the same nameAdjustmentUnitswas an enumeration (StepLimitUnitEnumeration: stops, sections, zones, networks, …) defined as 'Geographical parameter limiting the access rights by counts of stops, sections or zones'. New elementStepLimitUnitadded (name follows the enumeration and the owning STEP LIMIT entity);AdjustmentUnitsdeprecated.2.
FulfilmentMethodType/ singular name, list typenetex_salesDistribution_version.xsd) it is a single enumeration value; unchanged (name matches type).DistributionParametersGroup(netex_accessRightParameter_version.xsd) the same nameFulfilmentMethodTypeheld aFulfilmentMethodListOfEnumerations. New elementFulfilmentMethodTypesadded; the singular-named list deprecated.3.
Amounton AMOUNT OF PRICE UNIT / not a monetary amountnetex_farePrice_version.xsd)AmountisCurrencyAmountType(money); unchanged.netex_fareProduct_version.xsd)Amountisxsd:decimaldocumented as "Number of units". New elementNumberOfUnitsadded;Amountdeprecated.Framework
NameOfClassenumeration (netex_entity_support.xsd): valuesFulfilmentMethodTypesandStepLimitUnitadded in alphabetical position (NumberOfUnitsalready present).All four files have a
<Modified>changelog entry added.Related cases checked but not changed
PaymentMethodon REFUNDING (netex_usageParameterAfterSales_version.xsd) also carries a list type under a singular name, but it is already deprecated in the schema ("DEPRECATED - use PaymentMethods on RESELLING"), so no change is needed.PaymentMethodelements onDistributionParametersGroupand fare table cells are internally consistent (singular name, singular type); whether they should allow multiple values is a modelling question for the team, not a naming defect, so they were left as-is.Backwards compatibility
xsd:choicewrapping only prevents using both the old and new name simultaneously. No example uses the affected elements in the changed contexts (checked: no<AmountOfPriceUnit>,<AdjustmentUnits>or<FulfilmentMethodType>instances inexamples/), so no example changes are needed.Verification (xmllint)
NeTEx_publication.xsdcompiles (proves the new choice content models are UPA-valid).<Amount>in other (unaffected) contexts:ENTUR-SchoolTwiceADayTripCarnet_2020120.xml,Netex_101.21_TfL_GeographicFares_UnitZone_MultipleProduct.xml,rail/Netex_era_crossborder_de.xml.Supersedes #1043
Closes and replaces #1043: rebuilt as a single commit on the current
v2.1-wiptip (was 11 commits behind, causing conflicts), resolving two context conflicts (fareProduct,usageParameterTravel) that arose purely from line-shift against unrelated intervening changes, no semantic changes to the resolution itself.