User:RailML Coord Documentation/Examples: Difference between revisions

From railML 3 Wiki
Jump to navigation Jump to search
No edit summary
(Replaced content with "{{duplicate|subschema=infrastructure|element=infrastructure}} {{otherschema|IS}} {{otherschema|common}}")
Tag: Replaced
Line 1: Line 1:
{{head|Semantic constraints}}
{{duplicate|subschema=infrastructure|element=infrastructure}}


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 {{rml|2}}, it is possible to describe and validate that a {{wiki2|TT:train|<train>}} must reference one or more {{wiki2|TT:trainPart|<trainPart>}}s, that all {{wiki2|IS:trackElements|<trackElements>}} must have a {{attr|pos}}ition on the {{wiki2|IS:track|<track>}}, that the {{attr|length}} of a {{wiki2|IS:tunnel|<tunnel>}} is a decimal number and that allowed positions of {{wiki2|RS:couplers|<couplers>}} are at the {{enum|front}}, {{enum|rear}} or {{enum|both}} ends of a {{wiki2|RS:wagon|<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 {{attr|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.
{{otherschema|IS}}


Semantic constraints are as important as syntactic constraints. If they are ignored, other software may not be able to handle your {{rml}} files, or may interpret the contents in different ways. Therefore, their implementation will be checked during [[dev:Certification|certification]].
{{otherschema|common}}
 
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 {{rml}} 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 [[Dev:Guideline for participating in the development process|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 {{site|https://www.railml.org/en/workinggroups.html|{{rml}} working groups}} or suggested by anyone through a post in the {{site|https://www.railml.org/forum|forum}}.
 
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 <code>status=proposed</code> 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 <code>status=approved</code>.
 
If ''you'' see the need for a semantic constraint beyond the schema, please discuss it in the {{site|https://www.railml.org/forum|forum}} and then add a proposal in the element documentation using [[Template:Semcon]], with <code>status=proposed</code>. 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 <code>status=approved</code>.
 
{{note|Semantic constraints that have been '''proposed before the 10th of December 2018''' shall be considered as '''approved''' until decided otherwise.}}
==Design guidelines==
*Implement a seperate semantic constraint for every rule.
*Use the template with all mandatory arguments according to [[Template:SemanticConstraint]].
*Record the semantic constraint on the respective list below ({{wiki2|Dev:Semantic_Constraints/table2}} for {{rml|2}} and {{wiki3|Dev:Semantic_Constraints/table3}} for {{rml|3}}).
*assign a serial id to the semantic constraint according to [[#Current Constraints|the appropriate list below]].
 
==Current Constraints==
==={{rml|2}}===
{{wiki2|Dev:Semantic_Constraints/table2|View/edit list on the separate source page}}.
{{{{trans2}}:Dev:Semantic_Constraints/table2}}
 
==={{rml|3}}===
{{wiki3|Dev:Semantic_Constraints/table3|View/edit list on the separate source page}}.
{{{{trans3}}:Dev:Semantic_Constraints/table3}}
 
[[Category:GeneralDescription]]
{{interwiki}}

Revision as of 17:40, 16 April 2020

infrastructure:infrastructure

infrastructure

CO