NeTEx-CEN / NeTEx

NeTEx is a CEN Technical Standard for exchanging Public Transport schedules and related data.
http://netex-cen.eu
GNU General Public License v3.0
83 stars 39 forks source link

Elements missing the unique constraint #463

Open skinkie opened 1 year ago

skinkie commented 1 year ago

The following element have id and version attributes, but lack the unique constraint. Hence the examples will not be correctly checked.

AccessibilityAssessment
AccessibilityLimitation
AccessRightParameterAssignment
AccessZone
ActivatedEquipment
AdditionalDriverOption
Address
AddressablePlace
AdministrativeZone
AlternativeModeOfOperation
AlternativeQuayDescriptor
AvailabilityCondition
Call-Z
CallZ
Cancelling
CellInContext
CellPrice
Centroid
ClassificationDescriptor
ClassificationHierarchyMember
CodespaceAssignment
CollectionPointRef
CommonSectionPointMember
ComplexFeatureMember
ComplexFeatureProjection
Country
CustomerPurchasePackageElementAccess
CustomerPurchasePackagePrice
DatedCall
DatedCall-Z
DatedCallZ
DatedPassingTime
DatedServiceJourney
DatedVehicleJourney
DeadRunCall
DefaultDeadRunRunTime
DefaultServiceJourneyRunTime
DeliveryVariant
Descriptor
DestinationDisplayVariant'
Duty
Entrance
EstimatedPassingTime
EstimatedPassingTimeView
FacilityRequirement
FareContractEntry_
FareInterval
FareProductPrice
FareQuotaFactor
FareStructureElementInSequence
FareStructureFactor
FareTableInContext
FareUnit
FlexibleLine
FlexibleLinkProperties
FlexiblePointProperties
FlexibleQuay
FlexibleRoute
FlexibleServiceProperties
FlexibleStopAssignment
GeneralFrameMember
GeneralZone
GenericParameterAssignmentInContext
GeographicalIntervalPrice
GroupConstraintMember
GroupMember
GroupOfLinks
GroupOfPlaces
GroupOfPoints
GroupOfTimingLinks
HelpPointEquipment
InterchangeRuleTiming
JourneyHeadway
JourneyLayover
JourneyPatternHeadway
JourneyWaitTime
Layer
LimitingRuleInContext
LineSectionPointMember
LineShape
ManagementAgent
MediumAccessDevice
MonitoredCall
MonthValidityOffset
NormalDatedVehicleJourney
ObservedPassingTime
ObservedPassingTimeView
OfferedTravelSpecification
OnwardCall
OperatingDay
OrganisationalUnit
OrganisationDayType
OtherOrganisation
OtherPlaceEquipment
ParkingChargeBand
ParkingComponent
PassengerCapacity
PassengerCarryingRequirement
PassengerCarryingRequirementsView
PassingTime
PassingTimeView
Point
Point2
PointOfInterestVehicleEntrance
PointOnLineSection
PreviousCall
PurposeOfJourneyPartition
QueueingEquipment
Refunding
RentalOption
RequestedTravelSpecification
Reselling
ResidentialQualification
RoundingStep
RouteInstruction
SalesOfferPackageEntitlementGiven
SalesOfferPackageEntitlementRequired
SchematicMap
SchematicMapMember
ServiceAccessRight
ServiceAccessRight_
ServiceAccessRight1
ServiceAccessRight2
SignEquipment
SimpleAvailabilityCondition
SimpleValidityCondition
SitePathLink
SpatialFeature
StairFlight
StartTimeAtStopPoint
StopPlaceVehicleEntrance
Subscribing
Suitability
Suspending
TargetPassingTime
TargetPassingTimeView
TemplateServiceJourney
TimeDemandProfileMember
TimetabledPassingTime
TimetabledPassingTimeView
TimingAlgorithmType
TopographicPlaceDescriptor
TopographicProjection
TransportType
TravelAgent
TravelSpecification_
TravelSpecification1
TravelSpecification2
TurnaroundTimeLimitTime
TypeOfCodespaceAssignment
TypeOfCongestion
TypeOfDeliveryVariant
TypeOfEntity
TypeOfFacility
TypeOfFareProduct
TypeOfLink
TypeOfMobilityService
TypeOfModeOfOperation
TypeOfNotice
TypeOfOperation
TypeOfOrganisationPart
TypeOfPaymentMethod
TypeOfSecurityList
TypeOfServiceFeature
TypeOfTariff
TypeOfTimeDemandType
TypeOfVersion
TypeOfZone
typesOfPaymentMethod
UserNeed
ValidBetween
ValidDuring
ValidityParameterAssignment
ValidityPeriod
VehicleJourneyHeadway
VehicleJourneyLayover
VehicleJourneyRunTime
VehicleJourneyStopAssignment
VehicleJourneyWaitTime
VehicleManoeuvringRequirement
VehicleMeetingPlace_
VehicleMeetingPlace1
VehicleMeetingPlace2
VehicleMeetingPointAssignment_
VehicleMeetingPointAssignment1
VehicleMeetingPointAssignment2
VehiclePoolingMeetingPlace
VehicleServicePlaceAssignment
VehicleServicePlaceAssignment_
VehicleServicePlaceAssignment1
VehicleServicePlaceAssignment2
VehicleTypePreference
VehicleTypeZoneRestriction
Via
Zone
Aurige commented 1 year ago

I globally agree but I'm puzzled because some, like OperatingDay had constraints that were commented (see below). We need to ask @nick-knowles if he remembers why

`

    <!--        <xsd:unique name="OperatingDay_UniqueBy_Id_Version">
            <xsd:annotation>
                <xsd:documentation>Every [OperatingDay Id + Version] must be unique within document.</xsd:documentation>
            </xsd:annotation>
            <xsd:selector xpath=".//netex:OperatingDay"/>
            <xsd:field xpath="@id"/>
            <xsd:field xpath="@version"/>
        </xsd:unique>-->
    <!-- =====OperatingDay unique==In Calendar======================== -->`
nick-knowles commented 11 months ago

These fall into various different categories and it will take some time to check them all

Here is a start

(1) Missing uniqueness constraint.

Yes there are surprising number of these It looks like quite a lot of changes to netex_publication have been lost. (it is a merge bottleneck) Some I know for sure I had previously fixed as I have prepared quiet complex examples for some elements

AccessZone ActivatedEquipmentAdministrativeZone AvailabilityCondition

ComplexFeatureProjection CustomerPurchasePackageElementAccess CustomerPurchasePackagePrice DefaultDeadRunRunTime DefaultServiceJourneyRunTime EstimatedPassingTime EstimatedPassingTimeView

FareProductPrice FareQuotaFactor FlexibleLine FlexibleLinkProperties FlexiblePointProperties FlexibleQuay FlexibleRoute FlexibleServiceProperties FlexibleStopAssignment

GeneralZone GeographicalIntervalPrice GroupOfPlaces GroupOfTimingLinks HelpPointEquipment ManagementAgent

NormalDatedVehicleJourney ObservedPassingTime ObservedPassingTimeView OnwardCall OfferedTravelSpecification OperatingDay OrganisationalUnit OrganisationDayType

ParkingChargeBand PassengerCapacity PassengerCarryingRequirement PassengerCarryingRequirementsView PointOfInterestVehicleEntrance PreviousCall PurposeOfJourneyPartition

QueueingEquipment RequestedTravelSpecification ResidentialQualification RoundingStep RouteInstruction SchematicMap SchematicMapMember StartTimeAtStopPoint StopPlaceVehicleEntrance TemplateServiceJourney

TravelAgent TopographicProjection TurnaroundTimeLimitTime TypeOfCongestion TypeOfDeliveryVariant TypeOfEntity TypeOfFacility TypeOfFareProduct TypeOfLink TypeOfMobilityService TypeOfModeOfOperation TypeOfNotice TypeOfOperation TypeOfOrganisationPart TypeOfPaymentMethod TypeOfSecurityList TypeOfServiceFeature TypeOfTariff TypeOfTimeDemandType TypeOfVersion TypeOfZone

VehicleJourneyHeadway VehicleJourneyLayover VehicleJourneyRunTime VehicleJourneyStopAssignment VehicleJourneyWaitTime VehicleManoeuvringRequirement VehiclePoolingMeetingPlace VehicleServicePlaceAssignment VehicleTypePreference VehicleTypeZoneRestriction

These usage parameters should all be unique

Cancelling Subscribing Suspending AdditionalDriverOption Refunding RentalOption SalesOfferPackageEntitlementGiven SalesOfferPackageEntitlementRequired

(2) Elements which are already fixed in pending changes

Duty

(3) Elements which are abstract and do not need constraints

(but Should at least be marked as abstract)

AccessRightParameterAssignment Address AddressablePlace AlternativeModeOfOperation Entrance

GroupOfLinks GroupOfPoints JourneyHeadway JourneyLayover JourneyPatternHeadway JourneyWaitTime

FareInterval FareUnit FareStructureElementInSequence FareStructureFactor Layer MediumAccessDevice ParkingComponent PassingTime Point Reselling SignEquipment SpatialFeature TransportType OtherOrganisation ServiceAccessRight SimpleAvailabilityCondition ValidityParameterAssignment Zone

NB. Anythings with _ on the end is abstract

FareContractEntry ServiceAccessRight TravelSpecification VehicleMeetingPlace VehicleMeetingPointAssignment VehicleServicePlaceAssignment

(4) Elements which are for inline use and do not need keys

(parent key can be used if desired)

AccessibilityAssessment AccessibilityLimitation CellPrice Centroid Descriptor LineShape TopographicPlaceDescriptor ValidBetween ValidDuring

(5) Elements which were intended to allow alternate encoding  of child elemenyts without an id 

This was done years ago to try and code some very lareg timetables can probbaly be dropped Itekmes end in -Z or InCOntext . Can probabkly be scrapopoed

Call-Z CellInContext DatedCall-Z FareTableInContext LimitingRuleInContext GenericParameterAssignmentInContext

(6) Special cases

a.  Country . Uses enum of IANA codes
b.  typesOfPaymentMethod  This is rferencing the wrong type should be a list
c. ValdityPeriod - part of Siri? Ignore
d. CodespaceAssignment metadat should be unique on prefix
e.  CollectionPointRef This is a reference to any Point

(7) Junk that can be deleted

AlternativeQuayDescriptor CallZ DatedCallZ

(3) Search artefacts which can be ignored??

I could not find..

Point2 ServiceAccessRight1 ServiceAccessRight2 TravelSpecification1 TravelSpecification2

VehicleMeetingPlace1 VehicleMeetingPlace2

VehicleMeetingPointAssignment1 VehicleMeetingPointAssignment2

VehicleServicePlaceAssignment1 VehicleServicePlaceAssignment2

===============

STILL TO CHECK

ClassificationDescriptor ClassificationHierarchyMember CommonSectionPointMember ComplexFeatureMember

DatedCall

DatedPassingTime DatedServiceJourney DatedVehicleJourney DeadRunCall

DeliveryVariant

DestinationDisplayVariant'

FacilityRequirement

GeneralFrameMember GroupConstraintMember GroupMember

InterchangeRuleTiming

LineSectionPointMember

MonitoredCall MonthValidityOffset

OtherPlaceEquipment

PassingTimeView

PointOnLineSection

Suitability

SimpleValidityCondition SitePathLink

StairFlight

Suitability TargetPassingTime TargetPassingTimeView TimeDemandProfileMember TimetabledPassingTime TimetabledPassingTimeView TimingAlgorithmType

TypeOfCodespaceAssignment

UserNeed Via

skinkie commented 11 months ago

@nick-knowles why is CallZ and DatedCallZ junk?

Aurige commented 11 months ago

XSD Key constraint means also unique

Aurige commented 11 months ago

@nick-knowles will check these constraints

Aurige commented 11 months ago

Group Decision: Drop Call-Z (PR to be drafted)

ue71603 commented 7 months ago

how to we proceed and when? @skinkie