Interoperable-data / ERA_vocabulary

ERA vocabulary is an ontology defined by the European Union Agency for Railways (ERA) to describe the concepts and relationships related to the European railway infrastructure and the vehicles authorized to operate over it.
https://data-interop.era.europa.eu/era-vocabulary/
MIT License
4 stars 3 forks source link

SHACL constraints Missing compared to XSD constraints #11

Closed xuemduan closed 5 months ago

xuemduan commented 1 year ago

There are aslo some constraints appeared in RINF XSD Schema V1.5 but they are not available in SHACL shapes.

For instance in this example the maxLength and datatype are missing from the SHACL shapes shape.

The ex:mesonetelementShape targets the era:NetElement which, on its own turn, is created, according to the RML mapping rules from BPoint-RINF-meso-net-elements.yml, from rml:reference "OPName/@Value".

In the XSD file, the maxLength is limited to 450 and the datatype to string but this is not the case with the corresponding SHACL shape.

<xs:element minOccurs="1" maxOccurs="1" name="OPName">
  <xs:complexType>
    <xs:attribute name="Value" type="MidCharString" use="required" />
  </xs:complexType>
</xs:element>

<xs:simpleType name="MidCharString">
  <xs:restriction base="xs:string">
    <xs:maxLength value="450" />
  </xs:restriction>
</xs:simpleType>
ex:mesonetelementShape
    a sh:NodeShape ;
    sh:targetClass era:NetElement ; # Applies to all MesoNetElements
    sh:property [                 # _:b1
      sh:path rdfs:label ;           # constrains the values of rdfs:label   
      sh:minCount 1 ;
      sh:maxCount 1 ;
#     sh:nodeKind sh:IRI ;
#     sh:message "message"@en ;
    ] ;
ednaru commented 1 year ago

The RINF Application guide was used as a reference to write the SHACL shapes. In the guide the data presentation for OPName is a character string with no maximum limit on the number of characters. The XSD mae habe been aligned with a previous version of the guide. In the OPName property shape the datatype string is checked.

opName: # 1.2.0.0.0.1

era-sh:operationalpointsShape sh:property era-sh:opName . era-sh:opName a sh:PropertyShape; rdfs:comment "Name normally related to the town or village or to traffic control purpose." ; era:rinfIndex "1.2.0.0.0.1" ; sh:path era:opName ;

sh:minCount 0 ;

sh:maxCount 1 ;
sh:datatype xsd:string ;
sh:severity sh:Warning ;
sh:message "opName (1.2.0.0.0.1): There has to be one opName as most, and it must be represented as a String."@en .