Dev:Semantic Constraints

From railML 3 Wiki
Jump to: navigation, search

Semantic constraints
 

XML Schema Definitions (XSDs) offer a variety of possibilities to define syntactic constraints, describing the syntax of an XML file, including the type and multiplicity of an element. For example in railML®2, it is possible to describe and validate that a <train> must reference one or more <trainPart>s, that all <trackElements> must have a position on the <track>, that the length of a <tunnel> is a decimal number and that allowed positions of <couplers> are at the front, rear or both ends of a <wagon>. However, XML Schema Definitions are not able to express a constraint on one element or attribute that depends on the value or existence of another element or attribute. One example is that an XSD cannot express that a departure time must be greater than or equal to the arrival time, or that it does not make sense to specify a stopOnRequest and at the same time that the train is not allowed to stop. Such rules restricting the contents, or semantics, of one element or attribute depending on other content, are called semantic constraints.

Semantic constraints are as important as syntactic constraints. If they are ignored, other software may not be able to handle your railML® files, or may interpret the contents in different ways. Therefore, their implementation will be checked during certification.

Elements with approved semantic constraints are listed in Category:Semantic constraints. On the element documentation pages, the semantic constraints can be found in a dedicated chapter below the syntactic constraints. Proposed semantic constraints are listed in Category:Semantic constraints_proposed. A list of the semantic constraints by introduction date of a can be found below.

Every application of railML® has to be checked not only on XSD compliance but also on the obedience to the semantic constraints.

How to introduce Semantic Constraints

Constraints that can be described by XML Schema Definitions (XSDs) should be implemented syntactically in the schemas. Please, follow the guideline for participating in the development process. If a constraint cannot be described by XML Schema Definitions, you can propose a semantic constraints.

Semantic constraints can be proposed either by one of the railML® working groups (link to the railML® website) or suggested by anyone through a post in the forum (link to the railML® website).

If there is consensus in a working group to add a new semantic constraint, a post will be made in the forum and the proposed constraint will be added to the element documentation using Template:Semcon, with status=proposed and added to the list below. If there are no objections in the forum, it will be approved after six weeks and implemented in the wiki with status=approved.

If you see the need for a semantic constraint beyond the schema, please discuss it in the forum (link to the railML® website) and then add a proposal in the element documentation using Template:Semcon, with status=proposed. Please also add the proposal to the list below! If a consensus is reached in the forum, the proposal will be accepted, it will implemented in the wiki with status=approved.

Note.png Semantic constraints that have been proposed before the 10th of December 2018 shall be considered as approved until decided otherwise.

Design guidelines

Current Constraints

railML®2

View/edit list on the separate source page.


Element ID Proposal date Date of acception Date of deprecation
<TT:timetablePeriod> TT:001 2018-11-12 2019-03-21
<TT:specialService> TT:001 2018-11-12 2019-03-21
<TT:specialService> TT:001 2018-11-12 2019-03-21
<TT:operatingPeriodRef> TT:001 2018-11-12 2019-03-21
<TT:operatingPeriod> TT:001 2018-11-12 2019-03-21
<TT:operatingDay> TT:001 2018-11-12 2019-03-21
<TT:ocpTT> (first semantic constraint) TT:002 2018-10-25 2019-06-20
<TT:ocpTT> (second semantic constraint) 2018-10-25 discarded
<TT:circulation> TT:001 2018-11-12 2019-03-21
<TT:blockPart> (first semantic constraint) TT:001 2018-11-12 2019-03-21
<TT:blockPart> (second semantic constraint) TT:003 2019-07-13
<TT:blockPart> (third semantic constraint) TT:004 2019-07-20
<RS:operator> TT:001 2018-11-12 2019-03-21
<IS:state> TT:001 2018-11-12 2019-03-21
<IS:state (with length)> TT:001 2018-11-12 2019-03-21
<IS:designator> TT:001 2018-11-12 2019-03-21
<IS:speedChange> IS:001 2019-04-11
<TT:rostering> TT:005 2019-05-22 2019-06-25
<TT:stopDescription> (first semantic constraint) TT:006 2018-09-03 2019-06-20
<TT:stopDescription> (Stop on request / More than one stop type per OCP) TT:007 2019-06-19 never 2020-04-23
<TT:trackInfo> (first semantic constraint) TT:008 2018-08-21 2019-06-20
<TT:trackInfo> (second semantic constraint) TT:009 2018-08-21 2019-06-20
<TT:times> (second semantic constraint) TT:010 2019-06-19
<IS:trackEnd> IS:002 2019-06-17
<IS:trackBegin> IS:003 2019-06-17
<IS:track> IS:004 2019-06-17
<IS:ocp> IS:005 2019-06-19
<IS:mileageChange> IS:006 2019-06-19
<IS:propOperational> IS:007 2020-02-25
<IS:uptime> IS:008 2020-02-28
<IS:uptime> IS:009 2020-02-28
<IS:uptime> IS:010 2020-02-28

railML®3

View/edit list on the separate source page.

Element ID Proposal date Date of acception Date of deprecation
foo There are no semantic constraints or proposals for railML®3 yet.