Dev:Semantic Constraints: Difference between revisions

From railML 2 Wiki
Jump to navigation Jump to search
[checked revision][checked revision]
Line 28: Line 28:
==={{rml|2}}===
==={{rml|2}}===
{{wiki2|Dev:Semantic_Constraints/table2|View/edit list on the separate source page}}.
{{wiki2|Dev:Semantic_Constraints/table2|View/edit list on the separate source page}}.
{{{{trans2}}:Dev:Semantic_Constraints/table2}}
<!--{{{{trans2}}:Dev:Semantic_Constraints/table2}}-->
 
==={{rml|3}}===
==={{rml|3}}===
{{wiki3|Dev:Semantic_Constraints/table3|View/edit list on the separate source page}}.
{{wiki3|Dev:Semantic_Constraints/table3|View/edit list on the separate source page}}.

Revision as of 16:16, 16 April 2020

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.

🗒️ 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.

railML® 3

View/edit list on the separate source page.

  1. REDIRECT Template:Table/Dev:Semantic Constraints