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

Proposal for an extension of ClassInFrameRef #650

Open
wants to merge 14 commits into
base: next
Choose a base branch
from
133 changes: 133 additions & 0 deletions examples/functions/basic/ClassInFrame.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
<?xml version="1.0" encoding="UTF-8"?>
<PublicationDelivery xmlns:acsb="http://www.ifopt.org.uk/acsb" xmlns:ifopt="http://www.ifopt.org.uk/ifopt" xmlns="http://www.netex.org.uk/netex" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:siri="http://www.siri.org.uk/siri" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://www.netex.org.uk/netex ../../../xsd/NeTEx_publication.xsd">
<PublicationTimestamp>2001-12-17T09:30:47.0Z</PublicationTimestamp>
<ParticipantRef>SYS001</ParticipantRef>
<dataObjects>
<CompositeFrame version="1" created="2009-12-02T00:00:00Z" id="RATP:Neptune:CompositeFrame:100110107">
<Name>NEPTUNE Mapping Frame</Name>
<TypeOfFrameRef version="01" ref="Neptune:TypeOfFrame:CompositeFrame"/>
<codespaces>
<Codespace id="ratp_pivi_data">
<Xmlns>RATP_PIVI</Xmlns>
<XmlnsUrl>http://www.ratp.fr/ratp</XmlnsUrl>
<Description>RATP datas</Description>
</Codespace>
</codespaces>
<FrameDefaults>
<DefaultCodespaceRef ref="ratp_pivi_data"/>
<DefaultLocale>
<TimeZoneOffset>-1</TimeZoneOffset>
<SummerTimeZoneOffset>-2</SummerTimeZoneOffset>
<DefaultLanguage>fr</DefaultLanguage>
</DefaultLocale>
<DefaultLocationSystem>EPSG:4326</DefaultLocationSystem>
</FrameDefaults>
<frames>
<ResourceFrame version="any" id="Neptune:ResourceFrame:FrameProfile01">
<Name>RATP--Neptune-Line Profile </Name>
<codespaces>
<Codespace id="neptune_data">
<Xmlns>Neptune</Xmlns>
<XmlnsUrl>http://www.Neptune.fr/Neptune</XmlnsUrl>
<Description>Neptune data </Description>
</Codespace>
</codespaces>
<FrameDefaults>
<DefaultCodespaceRef ref="neptune_data"/>
</FrameDefaults>
<typesOfValue>
<TypeOfValidity version="01" id="Neptune:TypeOfValidity:WeeklyPlanned">
<Name>Weekley export of Neptune Planned data</Name>
<Periodicity>P7D</Periodicity>
<Nature>planned</Nature>
</TypeOfValidity>
<TypeOfFrame version="01" id="Neptune:TypeOfFrame:CompositeFrame">
<Name>Neptune Profile: Composite Frame </Name>
<Description>RATP--Neptune-Line-xxxxxx frames will be composite frame containing Service, Timetable (and Service Calendar) and Resource frames with all the usual NEPTUNE attributes filled in, for a given line xxxxx.</Description>
<TypeOfValidityRef version="01" ref="Neptune:TypeOfValidity:WeeklyPlanned"/>
<FrameClassRef nameOfClass="CompositeFrame"/>
<classes>
<ClassInFrameRef nameOfClass="AvailabilityCondition" classRefType="memberReferences"/>
</classes>
<includes>
<TypeOfFrame version="01" id="Neptune:TypeOfFrame:TimeTableFrame">
<Name>Neptune Profile:ServiceCalendar Frame </Name>
<FrameClassRef nameOfClass="TimeTableFrame"/>
<classes>
<ClassInFrameRef classRefType="members" nameOfClass="TimeTableFrame">
<MemberRef nameOfClass="passingTimes" use="required"/>
<MemberRef nameOfClass="calls" use="prohibited"/>
</ClassInFrameRef>
<ClassInFrameRef classRefType="members" nameOfClass="ServiceJourney"/>
<ClassInFrameRef classRefType="members" nameOfClass="JourneyPart"/>
</classes>
</TypeOfFrame>
<TypeOfFrame version="01" id="Neptune:TypeOfFrame:ServiceFrame">
<Name>Neptune Profile: Service Frame </Name>
<FrameClassRef nameOfClass="ServiceFrame"/>
<classes>
<ClassInFrameRef classRefType="memberReferences" nameOfClass="ScheduledStopPoint"/>
<ClassInFrameRef classRefType="memberReferences" nameOfClass="ServicePattern"/>
<ClassInFrameRef classRefType="memberReferences" nameOfClass="Network"/>
<ClassInFrame>
<attributes>
<ClassAttributeInFrame name="Name">
<Mandatory>required</Mandatory>
</ClassAttributeInFrame>
<ClassAttributeInFrame name="lines">
<Mandatory>required</Mandatory>
</ClassAttributeInFrame>
</attributes>
</ClassInFrame>
<ClassInFrameRef classRefType="memberReferences" nameOfClass="RoutePoint"/>
<ClassInFrameRef classRefType="memberReferences" nameOfClass="RouteLink"/>
<ClassInFrameRef classRefType="memberReferences" nameOfClass="Line"/>
<ClassInFrameRef classRefType="memberReferences" nameOfClass="Route"/>
<ClassInFrameRef classRefType="memberReferences" nameOfClass="Direction"/>
<ClassInFrameRef classRefType="memberReferences" nameOfClass="TariffZone"/>
<ClassInFrameRef classRefType="memberReferences" nameOfClass="PassengerStopAssignment"/>
</classes>
</TypeOfFrame>
<TypeOfFrame version="01" id="Neptune:TypeOfFrame:SiteFrame">
<Name>Neptune Profile: Site Frame </Name>
<FrameClassRef nameOfClass="SiteFrame"/>
<classes>
<ClassInFrameRef classRefType="memberReferences" nameOfClass="StopPlace"/>
</classes>
</TypeOfFrame>
<TypeOfFrame version="01" id="Neptune:TypeOfFrame:ServiceCalendarFrame">
<Name>Neptune Profile:ServceCalendar Frame </Name>
<FrameClassRef nameOfClass="ServiceCalendarFrame"/>
<classes>
<ClassInFrameRef classRefType="memberReferences" nameOfClass="ServiceCalendar"/>
<ClassInFrameRef classRefType="memberReferences" nameOfClass="DayType"/>
<ClassInFrameRef classRefType="memberReferences" nameOfClass="DayTypeAssignment"/>
</classes>
</TypeOfFrame>
<TypeOfFrame version="01" id="Neptune:TypeOfFrame:ResourceFrame">
<Name>Neptune Profile: Resource Frame </Name>
<FrameClassRef nameOfClass="ResourceFrame"/>
<classes>
<ClassInFrameRef classRefType="memberReferences" nameOfClass="TypeOfFrame"/>
<ClassInFrameRef classRefType="memberReferences" nameOfClass="Operator"/>
<ClassInFrameRef classRefType="memberReferences" nameOfClass="Authority"/>
</classes>
</TypeOfFrame>
</includes>
</TypeOfFrame>
</typesOfValue>
<organisations>
<!-- NEPTUNE [mapping:variable] : Operator.version mapped to NEPTUNE Company->ObjectVersion -->
<Operator version="1" id="RATP_PIVI:Company:100">
<!-- NEPTUNE [mapping:variable] : Operator->id mapped to NEPTUNE Company->ObjectId -->
<!-- NEPTUNE [mapping:variable] : Operator->name mapped to NEPTUNE Company->RegistrationNumber -->
<CompanyNumber>100</CompanyNumber>
<!-- NEPTUNE [mapping:variable] : Operator->name mapped to NEPTUNE Company->name -->
<Name>RATP</Name>
</Operator>
</organisations>
</ResourceFrame>
</frames>
</CompositeFrame>
</dataObjects>
</PublicationDelivery>
32 changes: 18 additions & 14 deletions xsd/netex_framework/netex_responsibility/netex_entity_support.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,23 @@ Rail transport, Roads and Road transport
<xsd:documentation>Reference to a Type of an ENTITY.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="ClassRefStructure">
<xsd:complexType name="ClassRefStructure" mixed="true">
ue71603 marked this conversation as resolved.
Show resolved Hide resolved
ue71603 marked this conversation as resolved.
Show resolved Hide resolved
<xsd:annotation>
<xsd:documentation>Type for a reference to the Class of a ENTITY.</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="nameOfClass" type="NameOfClass" use="required">
<xsd:annotation>
<xsd:documentation>Name of referenced Class.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
<xsd:sequence>
<xsd:element name="MemberRef" type="ClassRefStructure" minOccurs="0" maxOccurs="unbounded"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why a recursive definition here (we are within the ClassRefStructure definition) ?
And the result is a bit weird
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Aurige Can't a member have member again? I think recursive is correc.t Or what would be your proposal?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

input from Christophe needed

Copy link
Contributor

@Aurige Aurige May 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a ClassRefStructure inside a ClassRefStructure referred as Member ... but I'm not sure about what we wan't to say here, and waht is a member classs of a class ? Do you mean nested (for example a Quay inside a StopPlace) ? and if so, how would you make the difference between a ref (i.e a QuayRef) and the full object inclusion (Quay) ?

This recursion only allow to do things like this:

<netex:ClassRef nameOfClass="TOTO" use="required">
	<netex:MemberRef nameOfClass="TITI"/>
</netex:ClassRef>

Copy link
Contributor Author

@ue71603 ue71603 May 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original task is from Stefan. So I ask hiim:

In order to make a profile definition TypeOfFrame/ClassInFrameRef is an embedded way to describe a profile. What is currently lacking is the ability to describe the elements required in the profile.

If from this minimal definition a derived XML Schema (or Schematron) can be generated, every profile can be validated against an always up to date NeTEx upstream, without manual the manual labor of maintaining an extra XML Schema by hand (such as EPIP, Dutch, etc.)

@skinkie how deep do we want to go and Ref and objects?

</xsd:sequence>
<xsd:attribute name="nameOfClass" type="NameOfClass" use="required">
<xsd:annotation>
<xsd:documentation>Name of referenced Class.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="use" type="MandatoryEnumeration" default="optional">
skinkie marked this conversation as resolved.
Show resolved Hide resolved
<xsd:annotation>
<xsd:documentation>Whether the member is required, optional or prohibited.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<!-- ==== Entity Class =================================================================== -->
<xsd:element name="ClassInFrameRef" type="ClassInFrameRefStructure" substitutionGroup="ClassRef">
Expand Down Expand Up @@ -181,17 +185,17 @@ Rail transport, Roads and Road transport
<xsd:restriction base="xsd:normalizedString">
<xsd:enumeration value="required">
<xsd:annotation>
<xsd:documentation source="comment">Include elements that meet selection criteria (e.g. validity condition).</xsd:documentation>
<xsd:documentation source="comment">Required.</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="optional">
<xsd:annotation>
<xsd:documentation source="Comment">Include elements that are referenced by primary element. E.g. TYPES OF VALUE, OPERATOR etc.</xsd:documentation>
<xsd:documentation source="Comment">Optional.</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="notAllowed">
<xsd:enumeration value="prohibited">
<xsd:annotation>
<xsd:documentation source="comment">Include all elements.</xsd:documentation>
<xsd:documentation source="comment">Not allowed.</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
</xsd:restriction>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ Rail transport, Roads and Road transport
</xsd:element>
<xsd:element name="Mandatory" type="MandatoryEnumeration" default="optional" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Whether element is required, optional or not allowed.</xsd:documentation>
<xsd:documentation>Whether element is required, optional or prohibited.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="attributes" minOccurs="0">
Expand Down Expand Up @@ -549,7 +549,7 @@ Rail transport, Roads and Road transport
</xsd:element>
<xsd:element name="Mandatory" type="MandatoryEnumeration" default="optional" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Whether element is required, optional or not allowed.</xsd:documentation>
<xsd:documentation>Whether element is required, optional or prohibited.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
Expand All @@ -573,7 +573,7 @@ Rail transport, Roads and Road transport
<xsd:element ref="RelationshipRef"/>
<xsd:element name="Mandatory" type="MandatoryEnumeration" default="optional" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Whether relationship is required, optional or not allowed.</xsd:documentation>
<xsd:documentation>Whether relationship is required, optional or prohibited.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="Containment" type="ContainmentEnumeration" default="both" minOccurs="0">
Expand Down
Loading