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
78 stars 40 forks source link

Unenforced key-identity-constraints #444

Open skinkie opened 1 year ago

skinkie commented 1 year ago

The following list of refs are currently unenforced by key identity constraints, this means that a reference to an object is not checked against it exists. None of the concepts below are part of an example in master either.

AccessZoneRef
AccountedObjectRef
ActivatedEquipmentRef
AdditionalDriverOptionRef
AddressablePlaceRef
AdjacentPointRef
AdministrativeZoneRef
AllAuthoritiesRef
AllCountriesRef
AllDistributionChannelsRef
AllOperatorsRef
AllOrganisationsRef
AllPublicTransportOrganisationsRef
AllTransportOrganisationsRef
AlternativeJourneyRef
AlternativeNameRef
AlternativeTextRef
AssignmentRef
BaselineVersionFrameRef
BookedObjectRef
BookingPolicyRef
CancellingRef
ClassifiedAsRef
ClassInFrameRef
ClassRef
CodespaceAssignmentRef
CollectionPointRef
ComplexFeatureProjectionRef
ConditionedObjectRef
ConnectingJourneyRef
ConnectingStopPointRef
ConnectionZoneRef
CountryRef
CustomerPurchasePackagePriceRef
DataManagedObjectRef
DatedJourneyPatternRef
DatedJourneyRef
DatedVehicleJourneyRef
DefaultDeadRunRunTimeRef
DefaultServiceJourneyTimeRef
DeliveryVariantRef
DeltaRef
DepictedObjectRef
DerivedFromVersionRef
DestinationDisplayVariantRef
DriverRef
DutyRef
EndMeetingPointRef
EndPointRef
EntityInVersionInFrameRef
EntranceRef
EquipmentRef
EstimatedPassingTimeRef
ExchangableFromIntervalRef
ExchangableUntilIntervalRef
ExcludingJourneyPatternRef
ExternalConnectionLinkRef
ExternalDatedVehicleJourneyRef
ExternalDirectionRef
ExternalInterchangeRef
ExternalLineRef
ExternalOperatorRef
ExternalProductCategoryRef
ExternalStopPointRef
ExternalVehicleJourneyRef
FacilityRef
FacilityRequirementRef
FacilitySetRef
FareProductRef
FareQueryRef
FareQuotaFactorRef
FareRequestRef
FareStructureElementInSequenceRef
FareTableColumnRef
FareTableRowRef
FlexibleLinkPropertiesRef
FlexibleModeOfOperationRef
FlexiblePointPropertiesRef
FlexibleQuayRef
FlexibleServiceAssignmentRef
FlexibleServicePropertiesRef
FrameClassRef
FromFarePointInPatternRef
FromLinkRef
FromPointInJourneyPatternRef
FromVersionRef
GeneralFrameMemberRef
GisFeatureRef
GroupOfCustomerPurchasePackagesRef
GroupOfNoticesRef
GroupOfPlacesRef
GroupOfTimingLinksRef
GroupRef
HelpPointEquipmentRef
HostUserProfileRef
IdentityDocumentRef
InfrastructureLinkRestrictionRef
InterchangeRuleTimingRef
InverseRouteRef
JourneyPatternHeadwayRef
JourneyTimingRef
LayerRef
LineInDirectionRef
LineLinkRef
LinkInSequenceRef
LocalServiceRef
LocatingSystemRef
LogEntryRef
LogRef
LuggageLockerEquipmentRef
MainPlaceRef
MaximumPeriodIntervalRef
MemberClassRef
MemberObjectRef
MemberTypeOfValueRef
MinimumPeriodIntervalRef
ModeRef
MonthValidityOffsetRef
NamedObjectRef
NetworkRestrictionRef
NoticedObjectRef
ObjectRef
ObservedPassingTimeRef
OfferedTravelSpecificationRef
OntoFeatureRef
OppositeDirectionRef
OrderedVersionOfObjectRef
OrganisationalUnitRef
OtherOrganisationRef
ParentClassificationRef
ParentCommonSectionRef
ParentJourneyPartRef
ParentJourneyRef
ParentRef
ParentSiteRef
ParkingChargeBandRef
ParkingEntranceRef
PassengerCapacityRef
PassengerCarryingRequirementRef
PassengerSeatRef
PassingTimeRef
PathAssignmentRef
PlaceLightingEquipmentRef
PlaceRef
PointInSequenceRef
PointOfInterestHierarchyRef
PointOfInterestVehicleEntranceRef
PriceableObjectRef
ProfileParameterRef
ProjectedFeartureRef
ProjectedPointRef
ProjectToPointRef
PurposeOfJourneyPartitionRef
QueueingEquipmentRef
RailwayLinkRef
ReferencePointRef
RelationshipRef
RentalOptionRef
RepeatedTripFareQueryRef
RepeatedTripFareRequestRef
RepresentedByGroupRef
RequestedTravelSpecificationRef
ResellingRef
ResidentialQualificationRef
RetailingOrganizationRef
RoadLinkRef
RoundingStepRef
RouteInstructionRef
RuleObjectRef
SalesOfferPackageEntitlementGivenRef
SalesOfferPackageEntitlementRequiredRef
ScheduledModeOfOperationRef
ScheduleQueryRef
ScheduleRequestRef
SchematicMapMemberRef
SchematicMapRef
SectionRef
ServiceAccessRightRef
ServiceLinkInSequenceRef
SignEquipmentRef
SimpleObjectRef
SingleTripFareQueryRef
SingleTripFareRequestRef
SiteComponentRef
SiteElementRef
SiteEquipmentRef
SpatialFeatureRef
StartMeetingPointRef
StartPointRef
StartTimeAtStopPointRef
StopAssignmentRef
StopDepartureQueryRef
StopEventRequestRef
StopFinderQueryRef
StopFinderRequestRef
StopPlaceSpaceRef
StopPlaceVehicleEntranceRef
SubscribingRef
SupplyContractRef
SuspendingRef
TargetPassingTimeRef
TariffObjectRef
TimetabledPassingTimeRef
TimingAlgorithmTypeRef
ToFarePointInPatternRef
ToLinkRef
TopographicProjectionRef
ToPointInJourneyPatternRef
ToVersionRef
TransportTypeRef
TriggerObjectRef
TripLegRef
TripPatternTripRef
TripPlanQueryRef
TripPlanRequestRef
TripRef
TurnaroundTimeLimitTimeRef
TypeOfCodespaceAssignmentRef
TypeOfCongestionRef
TypeOfDeliveryVariantRef
TypeOfFacilityRef
TypeOfFareProductRef
TypeOfFlexibleServiceRef
TypeOfMobilityServiceRef
TypeOfModeOfOperationRef
TypeOfNoticeRef
TypeOfOperationRef
TypeOfOrganisationPartRef
TypeOfPaymentMethodRef
TypeOfSecurityListRef
TypeOfServiceFeatureRef
TypeOfTimeDemandTypeRef
TypeOfVersionRef
VehicleEntranceRef
VehicleEquipmentRef
VehicleJourneyStopAssignmentRef
VehicleManoeuvringRequirementRef
VehiclePoolingMeetingPlaceRef
VehicleProfileRef
VehicleRequirementRef
VehicleServicePlaceAssignmentRef
VehicleTypePreferenceRef
VehicleTypeZoneRestrictionRef
VersionOfObjectRef
WaitingEquipmentRef
WheelchairVehicleRef
WireLinkRef

Reproduce:

xmllint --xpath ".//*[local-name()='selector']/@xpath"  NeTEx_publication.xsd | sed 's/xpath=\"//g;s/"//g' | tr "|" "\n" | sed "s/[ ]*//g" | grep "Ref$" | sed "s/.*netex://g" | sort -u >  /tmp/allselectors.txt
grep -h -e "name=\"[A-Z][A-Za-z]\+Ref\"" `find netex_framework netex_part_1 netex_part_2 netex_part_3 netex_part_5 netex_service -type f -name "*.xsd"` | grep -v abstract=\"true\" | sed 's/.*name="\([A-Z][A-Za-z]\+Ref\)".*/\1/g' | sort -u > /tmp/all-refs.txt
diff -u /tmp/allselectors.txt /tmp/all-refs.txt | grep "^+" | sed "s/^+//g"
ue71603 commented 1 year ago

@Aurige If of interest I can ask André to add those and to start building examples.

skinkie commented 1 year ago

@ue71603 I wonder if we should automate a file with a GeneralFrame with positive and negative matching constraints.

ue71603 commented 1 year ago

If you could

Aurige commented 1 year ago

@Aurige If of interest I can ask André to add those and to start building examples.

yes sure :-) ... that's quite a lot of work ! We need to be careful about performances (checking constraints take time), but since we also have the "noConstraint" version that's Ok. And of course, more examples are always helpful.

nick-knowles commented 6 months ago

Needs some clean up but most of the references are legit - abstract elements still need refs so that they can be substituted for

skinkie commented 6 months ago

Abstract elements cannot be used on their own. There is no effect of an "abstract ref". Sure they need the attribute, but that should be modeled as use="required" anyway.