FAQ: Difference between revisions
No edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
==Handling VehicleType in the European Passenger Information Profile== | |||
=== '''Question 1:''' The EPIP example file ''NX-PI-01_LU_NAP_LINE_AVL-AVL-91_20210113.xml,'' that is available for download under https://data4pt-project.eu/knowledge-database/guidelines/, includes the data category '''''VehicleType'''''. === | |||
Is it correct to include the data category '''''VehicleType''''' in the '''''TimetableFrame''''' as as in the example? | Is it correct to include the data category '''''VehicleType''''' in the '''''TimetableFrame''''' as as in the example? | ||
'''Answer 1:''' Yes, the European Passenger Information Profile, ''CEN/TS 16614-4:2020,''(EPIP) states that the data category '''''VehicleType''''' can be provided in the '''''TimetableFrame.''''' See ''table 131 – TypeOfFrame: EU_PI_TIMETABLE in the documentation.'' | '''Answer 1:''' Yes, the European Passenger Information Profile, ''CEN/TS 16614-4:2020,''(EPIP) states that the data category '''''VehicleType''''' can be provided in the '''''TimetableFrame.''''' See ''table 131 – TypeOfFrame: EU_PI_TIMETABLE in the documentation.'' | ||
=== '''Question 2:''' Are there other possibilities where to define the vehicle type? === | |||
'''Answer 2:''' Yes, the European Passenger Information Profile, ''CEN/TS 16614-4:2020,''(EPIP) actually also allows, as an option, that the data category '''''VehicleType''''' is instead provided in the '''''ResourceFrame.''''' See ''table Table 127 – TypeOfFrame: EU_PI_COMMON in the documentation.'' This second option is now (2021-02-24) also supported in the set of XSD-files available for download from the project website. | '''Answer 2:''' Yes, the European Passenger Information Profile, ''CEN/TS 16614-4:2020,''(EPIP) actually also allows, as an option, that the data category '''''VehicleType''''' is instead provided in the '''''ResourceFrame.''''' See ''table Table 127 – TypeOfFrame: EU_PI_COMMON in the documentation.'' This second option is now (2021-02-24) also supported in the set of XSD-files available for download from the project website. | ||
=How do you create C# classes from the NeTEx XSD?= | ==How do you create C# classes from the NeTEx XSD? == | ||
'''Answer''': It is possible to create C# classes in different ways. | '''Answer''': It is possible to create C# classes in different ways. | ||
Line 27: | Line 24: | ||
The work steps if you are using the Microsoft tool are: | The work steps if you are using the Microsoft tool are: | ||
# Get the zipped XSD. Extract the ZIP to a folder. | #Get the zipped XSD. Extract the ZIP to a folder. | ||
# Make sure that you have a recent version of the xsd.exe. It is part of the .NET Framework Developer Pack and can be downloaded from https://dotnet.microsoft.com/download/dotnet-framework | #Make sure that you have a recent version of the xsd.exe. It is part of the .NET Framework Developer Pack and can be downloaded from https://dotnet.microsoft.com/download/dotnet-framework | ||
# Install the developer pack. The xsd.exe will be placed in a folder with a path similar to ''C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools'' | #Install the developer pack. The xsd.exe will be placed in a folder with a path similar to ''C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools'' | ||
# Open a command prompt in the same folder as where the NeTEx_publication_reduced-NoConstraint.xsd resides. | #Open a command prompt in the same folder as where the NeTEx_publication_reduced-NoConstraint.xsd resides. | ||
# Execute the following command (you may have to adapt the path to xsd.exe): ''"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\xsd.exe" /c /language:C# gml_combo_v3_2_1_simplified.xsd NeTEx_publication_reduced-NoConstraint.xsd'' | #Execute the following command (you may have to adapt the path to xsd.exe): ''"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\xsd.exe" /c /language:C# gml_combo_v3_2_1_simplified.xsd NeTEx_publication_reduced-NoConstraint.xsd'' | ||
The work steps if you are using the MGANSS tool are: | The work steps if you are using the MGANSS tool are: | ||
# Get the zipped XSD. Extract the ZIP to a folder. | #Get the zipped XSD. Extract the ZIP to a folder. | ||
# Download and extract the binary from https://github.com/mganss/XmlSchemaClassGenerator/releases to a separate folder e.g. ''C:\MGANSS''. | #Download and extract the binary from https://github.com/mganss/XmlSchemaClassGenerator/releases to a separate folder e.g. ''C:\MGANSS''. | ||
# Open a command prompt in the same folder as where the NeTEx_publication_reduced-NoConstraint.xsd resides. | #Open a command prompt in the same folder as where the NeTEx_publication_reduced-NoConstraint.xsd resides. | ||
# Execute the following command (you may have to adapt the path to the exe): ''C:\MGANSS\XmlSchemaClassGenerator.Console.exe NeTEx_publication_reduced-NoConstraint.xsd -n <nowiki>http://www.opengis.net/gml/3.2=gml</nowiki> -v'' | #Execute the following command (you may have to adapt the path to the exe): ''C:\MGANSS\XmlSchemaClassGenerator.Console.exe NeTEx_publication_reduced-NoConstraint.xsd -n <nowiki>http://www.opengis.net/gml/3.2=gml</nowiki> -v'' |
Revision as of 14:40, 21 October 2021
Handling VehicleType in the European Passenger Information Profile
Question 1: The EPIP example file NX-PI-01_LU_NAP_LINE_AVL-AVL-91_20210113.xml, that is available for download under https://data4pt-project.eu/knowledge-database/guidelines/, includes the data category VehicleType.
Is it correct to include the data category VehicleType in the TimetableFrame as as in the example?
Answer 1: Yes, the European Passenger Information Profile, CEN/TS 16614-4:2020,(EPIP) states that the data category VehicleType can be provided in the TimetableFrame. See table 131 – TypeOfFrame: EU_PI_TIMETABLE in the documentation.
Question 2: Are there other possibilities where to define the vehicle type?
Answer 2: Yes, the European Passenger Information Profile, CEN/TS 16614-4:2020,(EPIP) actually also allows, as an option, that the data category VehicleType is instead provided in the ResourceFrame. See table Table 127 – TypeOfFrame: EU_PI_COMMON in the documentation. This second option is now (2021-02-24) also supported in the set of XSD-files available for download from the project website.
How do you create C# classes from the NeTEx XSD?
Answer: It is possible to create C# classes in different ways.
There are many tools out there, but for instance, you could use the Microsoft xsd.exe tool or the mganss/XMLSchemaClassGenerator tool available on Github at https://github.com/mganss/XmlSchemaClassGenerator
Currently there are some issues if you try to use the official NeTEx XSD as a starting point with either of these tools.
However, the above-mentioned tools work fine if you use them together with an adapted set of XSD-files available from Data4PT. The file set is designed to be compatible with the official NeTEx XSD and to cover many important use cases. It does however not cover all use cases possible with the official schema. There is an interactive graphical presentation of the adapted and reduced XSD available at https://data4pt.org/NeTEx/GraphicKit/Documention_of_reduced_XSD.html
If you wish to try out this reduced XSD, you can download it at https://data4pt.org/NeTEx/GraphicKit/XSD_reduced.zip
The work steps if you are using the Microsoft tool are:
- Get the zipped XSD. Extract the ZIP to a folder.
- Make sure that you have a recent version of the xsd.exe. It is part of the .NET Framework Developer Pack and can be downloaded from https://dotnet.microsoft.com/download/dotnet-framework
- Install the developer pack. The xsd.exe will be placed in a folder with a path similar to C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools
- Open a command prompt in the same folder as where the NeTEx_publication_reduced-NoConstraint.xsd resides.
- Execute the following command (you may have to adapt the path to xsd.exe): "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\xsd.exe" /c /language:C# gml_combo_v3_2_1_simplified.xsd NeTEx_publication_reduced-NoConstraint.xsd
The work steps if you are using the MGANSS tool are:
- Get the zipped XSD. Extract the ZIP to a folder.
- Download and extract the binary from https://github.com/mganss/XmlSchemaClassGenerator/releases to a separate folder e.g. C:\MGANSS.
- Open a command prompt in the same folder as where the NeTEx_publication_reduced-NoConstraint.xsd resides.
- Execute the following command (you may have to adapt the path to the exe): C:\MGANSS\XmlSchemaClassGenerator.Console.exe NeTEx_publication_reduced-NoConstraint.xsd -n http://www.opengis.net/gml/3.2=gml -v