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

Conflicting constraints between SHACL shapes and XSD #10

Closed xuemduan closed 5 months ago

xuemduan commented 1 year ago

Hi,

I found that some constraints which appear in the SHACL shapes are not aligned with the constraints in RINF XSD Schema V1.5 .

For instance, in this example, the xs:minLength in the XSD file is 1, but in the SHACL shape, it is 4. See the extracts here:

<xs:simpleType name="IMCodeType">
  <xs:restriction base="xs:string">
    <xs:minLength value="1" />
    <xs:maxLength value="4" />
  </xs:restriction>
</xs:simpleType>  
era-sh:platformsShape sh:property era-sh:imCode .
era-sh:imCode
    a sh:PropertyShape;
    rdfs:comment "Each Platform can only be submitted by one infrastructure manager, represented by a four-digit code." ;
    era:rinfIndex "1.2.1.0.6.1" ;
    sh:path era:imCode ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:minLength 4 ;
    sh:maxLength 4 ;
    sh:severity sh:Warning ;
    sh:message "imCode (1.2.1.0.6.1): Each Platform can be referred to only one infrastructure manager, which MUST be represented with a four-digit code. This error may be due to having a Platform with no infrastructure manager associated, with more than one infrastructure managers, or with a code that has a different length."@en .

I was wondering what is the correct value for this case and in general?

Bests, Xuemin

ednaru commented 1 year ago

XSD schema is legacy. SHACL shapes were written according to the reference RINF application guide https://www.era.europa.eu/system/files/2022-11/rinf_application_guide_for_register_en_0.pdf where the data presentation for this attribute is specified as [AAAA]. I believe that either the XSD schema was aligned with a previous version of the reference RINF guide or it has an error.

gatemezing commented 10 months ago

Hello @xuemduan, it rather difficult to have a IMCode with just 1 length string. Even ISO code has at least 2 or 3. So, it's preferrable to follow the SHACL rules as it is the way to go with the vocabulary and the assets in the KG at https://virtuoso.ecdp.tech.ec.europa.eu/describe/?url=http%3A%2F%2Fdata.europa.eu%2F949%2FimCode