Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging why attributes appear in classes #734

Closed
skinkie opened this issue Dec 22, 2022 · 4 comments
Closed

Debugging why attributes appear in classes #734

skinkie opened this issue Dec 22, 2022 · 4 comments

Comments

@skinkie
Copy link
Contributor

skinkie commented Dec 22, 2022

I am currently evaluating why the NeTEx XSD adds the dated_vehicle_journey_ref to route_ref.

I can see that:

  1. order comes from PointInLinkSequence_VersionedChildStructure
  2. link_sequence_ref, projections, description come from PointInLinkSequenceGroup.

Might this be a bug in the schema creation?

https://github.com/NeTEx-CEN/NeTEx/blob/master/xsd/netex_framework/netex_genericFramework/netex_pointAndLinkSequence_version.xsd#L134~

Would it be possible to annotate where an attribute originates from in a tree like representation?

Upon searching my hypothesis is now that "LinkSequenceRef" is to blame, which is used both as substitution group as it is as element ref.

When removing this subsitutiongroup, navigation_path_ref is removed, so I am confident there is a relationship...
https://github.com/NeTEx-CEN/NeTEx/blob/master/xsd/netex_part_1/part1_ifopt/netex_ifopt_path_support.xsd#L184

@dataclass(unsafe_hash=True)
class PointInLinkSequenceVersionedChildStructure(VersionedChildStructure):
    """
    Type for a POINT IN LINK SEQUENCE i.e. a Node of a graph.

    :ivar dated_vehicle_journey_ref:
    :ivar dated_special_service_ref:
    :ivar special_service_ref:
    :ivar template_service_journey_ref:
    :ivar service_journey_ref:
    :ivar dead_run_ref:
    :ivar vehicle_journey_ref:
    :ivar navigation_path_ref:
    :ivar service_journey_pattern_ref:
    :ivar service_pattern_ref:
    :ivar dead_run_journey_pattern_ref:
    :ivar journey_pattern_ref:
    :ivar timing_pattern_ref:
    :ivar route_ref:
    :ivar link_sequence_ref:
    :ivar projections: PROJECTIONs of POINT.
    :ivar description: Further Description of a POINT IN LINK SEQUENCE
    :ivar order: Order of POINT within parent.

To summarize. I think there is a bug that introduces elements from a substitution group "LinkSequenceRef", based on every element that has the substitutionGroup "LinkSequenceRef".

@tefra
Copy link
Owner

tefra commented Dec 22, 2022

I am a bit confused what attributes do you think are wrong?

Yeah the class is getting pretty much every property above the link_sequence_ref because of substitution groups

Screenshot 2022-12-22 at 15 52 00

Yeah I think the origin metadata would be super helpful

@skinkie
Copy link
Contributor Author

skinkie commented Dec 22, 2022

@tefra I really really wonder if there should be any other property then the link_sequence_ref on the PointInLinkSequence? I think what happens is that the substitutionGroup is applied in reverse.

From my understanding (and discussion with the NeTEx XSD developers) the following attributes are unexpected:

    :ivar dated_vehicle_journey_ref:
    :ivar dated_special_service_ref:
    :ivar special_service_ref:
    :ivar template_service_journey_ref:
    :ivar service_journey_ref:
    :ivar dead_run_ref:
    :ivar vehicle_journey_ref:
    :ivar navigation_path_ref:
    :ivar service_journey_pattern_ref:
    :ivar service_pattern_ref:
    :ivar dead_run_journey_pattern_ref:
    :ivar journey_pattern_ref:
    :ivar timing_pattern_ref:
    :ivar route_ref:

@skinkie
Copy link
Contributor Author

skinkie commented Dec 23, 2022

@tefra the tool reports the correct attributes. Document below validates against the NeTEx schema. I'll go back upstream. For the part of this ticket to 'explain' where an attribute originates from, I'll would like to keep this feature request open.

<?xml version="1.0" encoding="UTF-8"?>
<PublicationDelivery xmlns="http://www.netex.org.uk/netex" xmlns:gml="http://www.opengis.net/gml/3.2" version="ntx:1.1">
  <PublicationTimestamp>2022-12-23T09:56:19.513998</PublicationTimestamp>
  <ParticipantRef>NDOV</ParticipantRef>
  <Description>NeTEx export</Description>
  <dataObjects>
    <GeneralFrame id="GF" version="1">
      <members>
        <ScheduledStopPoint id="SSP1" version="1">
          <Name>SSP1</Name>
        </ScheduledStopPoint>
        <ScheduledStopPoint id="SSP2" version="1">
          <Name>SSP2</Name>
        </ScheduledStopPoint>
        <ServiceJourneyPattern id="SJP" version="1">
          <pointsInSequence>
            <StopPointInJourneyPattern id="SPIJP1" version="1" order="1">
              <ServiceJourneyPatternRef version="1" ref="SJP"/>
              <ScheduledStopPointRef version="1" ref="SSP1"/>
            </StopPointInJourneyPattern>
            <StopPointInJourneyPattern id="SPIJP2" version="1" order="2">
              <ScheduledStopPointRef version="1" ref="SSP2"/>
            </StopPointInJourneyPattern>
          </pointsInSequence>
        </ServiceJourneyPattern>
      </members>
    </GeneralFrame>
  </dataObjects>
</PublicationDelivery>

@tefra
Copy link
Owner

tefra commented Mar 9, 2024

I am closing this one for now, I will gladly accept any contributions

@tefra tefra closed this as completed Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants