@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix era-sh-eratv: <http://data.europa.eu/949/eratv/shapes/> .
@prefix era-sh: <http://data.europa.eu/949/shapes/> .
@prefix era-va-authcase: <http://data.europa.eu/949/concepts/va-authcases/> .
@prefix era: <http://data.europa.eu/949/> .
@prefix erad: <http://data.europa.eu/949/id/dataset/> .
@prefix erag: <http://data.europa.eu/949/id/graph/> .
@prefix erat: <http://data.europa.eu/949/id/distribution/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix geosparql: <http://www.opengis.net/ont/geosparql#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sf: <http://www.opengis.net/ont/sf#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix time: <http://www.w3.org/2006/time#> .
@prefix vpa: <https://w3id.org/vpa#> .
@prefix wgs: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .


######################################################
# SHACL metadata - owl:versionInfo, dcterms, dcat, prov
######################################################


<http://data.europa.eu/949/id/dataset/eratv/era-shapes> a dcat:Dataset ;

    dct:title "SHACL Shapes for ERATV dataset compliant with ERA ontology"@en ;
    dct:description """
    SHACL constraints validating RDF ERATV datasets
    according to the ERA ontology .
    """@en ;
    dct:publisher <http://publications.europa.eu/resource/authority/corporate-body/ERA> ;
    dct:creator <http://publications.europa.eu/resource/authority/corporate-body/ERA> ;
    dct:issued "2026-03-15"^^xsd:date ;

    ## FAIR – Accessible
    dcat:landingPage <https://rinf.data.era.europa.eu/era-vocabulary/era-shapes> ;

    ## FAIR – Interoperable
    dct:conformsTo <https://www.w3.org/TR/shacl/> ;
    dct:conformsTo era: ;

    ## FAIR – Reusable
    dct:license <http://data.europa.eu/eli/dec_impl/2017/863/oj> ;
    dct:language <http://publications.europa.eu/resource/authority/language/ENG> ;
    owl:versionInfo "3.2.2" ;

    ## DCAT distribution
    dcat:distribution <http://data.europa.eu/949/id/distribution/eratv/era-shapes> ;

    ## Provenance
    prov:wasDerivedFrom era: ;
    prov:wasAttributedTo <http://publications.europa.eu/resource/authority/corporate-body/ERA> .

###########################
# DCAT distribution details
#@#########################

<http://data.europa.eu/949/id/distribution/eratv/era-shapes>
    a dcat:Distribution ;
    dct:title "ERA ERATV SHACL shapes (Turtle)"@en ;
    dcat:downloadURL <https://data-interop.era.europa.eu/era-vocabulary/eratv/era-shapes> ;
    dcat:mediaType "text/turtle" ;
    dcat:format <http://publications.europa.eu/resource/authority/file-type/RDF_TURTLE> ;
    dct:license <http://data.europa.eu/eli/dec_impl/2017/863/oj> .


### AXle spacing ###
era-sh:AxleSpacingShape
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:AxleSpacing .

era-sh:AxleSpacingShape sh:property era-sh:AxleSpacingDistanceA .
era-sh:AxleSpacingDistanceA
    a sh:PropertyShape ;
    era:affectedProperty era:axleSpacingDistanceA ;
    era:affectedClass era:AxleSpacing ;
    era:scope "local" ;
    rdfs:comment "Validation for axleSpacingDistanceA property. Position of the axles along the unit: a: Distance between axles." ;
    sh:path era:axleSpacingDistanceA ;
    sh:datatype xsd:decimal ;
    sh:severity sh:Violation ;
    sh:message "axleSpacingDistanceA: The value must be a decimal representing the distance between axles."@en ;
    era:eratvIndex "4.5.3.4" .

era-sh:AxleSpacingShape sh:property era-sh:AxleSpacingDistanceB .
era-sh:AxleSpacingDistanceB
    a sh:PropertyShape ;
    era:affectedProperty era:axleSpacingDistanceB ;
    era:affectedClass era:AxleSpacing ;
    era:scope "local" ;
    rdfs:comment "Validation for axleSpacingDistanceB property. Position of the axles along the unit: b: Distance from end axle to the end of the nearest coupling plane." ;
    sh:path era:axleSpacingDistanceB ;
    sh:datatype xsd:decimal ;
    sh:severity sh:Violation ;
    sh:message "axleSpacingDistanceB: The value must be a decimal representing the distance from end axle to the end of the nearest coupling plane."@en ;
    era:eratvIndex "4.5.3.4" .

era-sh:AxleSpacingShape sh:property era-sh:AxleSpacingDistanceC .
era-sh:AxleSpacingDistanceC
    a sh:PropertyShape ;
    era:affectedProperty era:axleSpacingDistanceC ;
    era:affectedClass era:AxleSpacing ;
    era:scope "local" ;
    rdfs:comment "Validation for axleSpacingDistanceC property. Position of the axles along the unit: c: distance between two inside axles." ;
    sh:path era:axleSpacingDistanceC ;
    sh:datatype xsd:decimal ;
    sh:severity sh:Violation ;
    sh:message "axleSpacingDistanceC: The value must be a decimal representing the distance between two inside axles."@en ;
    era:eratvIndex "4.5.3.4" .

era-sh:AxleSpacingShape sh:property era-sh:AxleSpacingExplanation .
era-sh:AxleSpacingExplanation
    a sh:PropertyShape ;
    era:affectedProperty era:axleSpacingExplanation ;
    era:affectedClass era:AxleSpacing ;
    era:scope "local" ;
    rdfs:comment "Validation for axleSpacingExplanation property." ;
    sh:path era:axleSpacingExplanation ;
    sh:datatype xsd:string ;
    sh:severity sh:Violation ;
    sh:message "axleSpacingExplanation (4.5.3.4): The value must be a string."@en ;
    era:eratvIndex "4.5.3.4" .



era-sh:BrakingPerformanceShape 
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:BrakingPerformance .

era-sh:BrakingPerformanceShape sh:property era-sh:WithBrakedMass .
era-sh:WithBrakedMass
    a sh:PropertyShape ;
    era:affectedProperty era:withBrakedMass ;
    era:affectedClass era:BrakingPerformance ;
    era:scope "local" ;
    rdfs:comment "Validation for withBrakedMass property. Braked mass value." ;
    sh:path era:withBrakedMass ;
    sh:datatype xsd:decimal ;
    sh:severity sh:Violation ;
    sh:message "withBrakedMass: The value must be a decimal representing braked mass."@en .

era-sh:BrakingPerformanceShape sh:property era-sh:WithBrakedMassPercentage .
era-sh:WithBrakedMassPercentage
    a sh:PropertyShape ;
    era:affectedProperty era:withBrakedMassPercentage ;
    era:affectedClass era:BrakingPerformance ;
    era:scope "local" ;
    rdfs:comment "Validation for withBrakedMassPercentage property. Braked mass percentage value." ;
    sh:path era:withBrakedMassPercentage ;
    sh:datatype xsd:decimal ;
    sh:severity sh:Violation ;
    sh:message "withBrakedMassPercentage: The value must be a decimal representing braked mass percentage."@en .

era-sh:BrakingPerformanceShape sh:property era-sh:ServiceBrakingProfile .
era-sh:ServiceBrakingProfile
    a sh:PropertyShape ;
    era:affectedProperty era:serviceBrakingProfile ;
    era:affectedClass era:BrakingPerformance ;
    era:scope "local" ;
    rdfs:comment "Validation for serviceBrakingProfile property. Links to the maximum service braking profile." ;
    sh:path era:serviceBrakingProfile ;
    sh:nodeKind sh:IRI ;
    sh:class era:BrakingProfile ;
    sh:severity sh:Violation ;
    sh:message "serviceBrakingProfile: The value must be an IRI pointing to a BrakingProfile."@en ;
    era:eratvIndex "4.7.7" .

era-sh:BrakingProfileShape 
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:BrakingProfile .

era-sh:BrakingProfileShape sh:property era-sh:ProfileLoadConditionMass .
era-sh:ProfileLoadConditionMass
    a sh:PropertyShape ;
    era:affectedProperty era:profileLoadConditionMass ;
    era:affectedClass era:BrakingProfile ;
    era:scope "local" ;
    rdfs:comment "Validation for profileLoadConditionMass property. Load condition mass for which the braking profile applies." ;
    sh:path era:profileLoadConditionMass ;
    sh:datatype xsd:integer ;
    sh:severity sh:Violation ;
    sh:message "profileLoadConditionMass: The value must be an integer representing the load condition mass."@en ;
    era:eratvIndex "4.7.5.1" .

era-sh:BrakingProfileShape sh:property era-sh:ProfileDeceleration .
era-sh:ProfileDeceleration
    a sh:PropertyShape ;
    era:affectedProperty era:profileDeceleration ;
    era:affectedClass era:BrakingProfile ;
    era:scope "local" ;
    rdfs:comment "Validation for profileDeceleration property. Maximum train deceleration for a braking profile at design maximum speed." ;
    sh:path era:profileDeceleration ;
    sh:datatype xsd:decimal ;
    sh:severity sh:Violation ;
    sh:message "profileDeceleration: The value must be a decimal representing maximum deceleration in m/s²."@en ;
    era:eratvIndex "4.7.5" , "4.7.7" .

era-sh:BrakingProfileShape sh:property era-sh:ProfileStoppingDistance .
era-sh:ProfileStoppingDistance
    a sh:PropertyShape ;
    era:affectedProperty era:profileStoppingDistance ;
    era:affectedClass era:BrakingProfile ;
    era:scope "local" ;
    rdfs:comment "Validation for profileStoppingDistance property. Maximum train stopping distance for a braking profile at design maximum speed." ;
    sh:path era:profileStoppingDistance ;
    sh:datatype xsd:integer ;
    sh:severity sh:Violation ;
    sh:message "profileStoppingDistance: The value must be an integer representing stopping distance in meters."@en ;
    era:eratvIndex "4.7.5" , "4.7.7" .


era-sh:MaximumSpeedAndCantDeficiencyShape 
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:MaximumSpeedAndCantDeficiency .

era-sh:MaximumSpeedAndCantDeficiencyShape sh:property era-sh:VehicleTypeMaximumCantDeficiency .
era-sh:VehicleTypeMaximumCantDeficiency
    a sh:PropertyShape ;
    era:affectedProperty era:vehicleTypeMaximumCantDeficiency ;
    era:affectedClass era:MaximumSpeedAndCantDeficiency ;
    era:scope "local" ;
    rdfs:comment "Validation for vehicleTypeMaximumCantDeficiency property. Maximum cant deficiency for which the vehicle type has been assessed." ;
    sh:path era:vehicleTypeMaximumCantDeficiency ;
    sh:datatype xsd:integer ;
    sh:severity sh:Violation ;
    sh:message "vehicleTypeMaximumCantDeficiency: The value must be an integer representing cant deficiency in millimeters."@en ;
    era:eratvIndex "4.6.1.1" .

era-sh:MaximumSpeedAndCantDeficiencyShape sh:property era-sh:VehicleTypeMaximumSpeed .
era-sh:VehicleTypeMaximumSpeed
    a sh:PropertyShape ;
    era:affectedProperty era:vehicleTypeMaximumSpeed ;
    era:affectedClass era:MaximumSpeedAndCantDeficiency ;
    era:scope "local" ;
    rdfs:comment "Validation for vehicleTypeMaximumSpeed property. Maximum speed for which the vehicle type has been assessed with the corresponding cant deficiency." ;
    sh:path era:vehicleTypeMaximumSpeed ;
    sh:datatype xsd:integer ;
    sh:severity sh:Violation ;
    sh:message "vehicleTypeMaximumSpeed: The value must be an integer representing speed in km/h."@en ;
    era:eratvIndex "4.6.1.2" .

era-sh:RestrictionShape 
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:Restriction .

era-sh:RestrictionShape sh:property era-sh:IsConditionBasedRestriction .
era-sh:IsConditionBasedRestriction
    a sh:PropertyShape ;
    era:affectedProperty era:isConditionBasedRestriction ;
    era:affectedClass era:Restriction ;
    era:scope "local" ;
    rdfs:comment "Validation for isConditionBasedRestriction property." ;
    sh:path era:isConditionBasedRestriction ;
    sh:datatype xsd:boolean ;
    sh:severity sh:Violation ;
    sh:message "isConditionBasedRestriction: The value must be a boolean."@en .

era-sh:RestrictionShape sh:property era-sh:IsTimeBasedRestriction .
era-sh:IsTimeBasedRestriction
    a sh:PropertyShape ;
    era:affectedProperty era:isTimeBasedRestriction ;
    era:affectedClass era:Restriction ;
    era:scope "local" ;
    rdfs:comment "Validation for isTimeBasedRestriction property. Indicates if the restriction is time-based." ;
    sh:path era:isTimeBasedRestriction ;
    sh:datatype xsd:boolean ;
    sh:severity sh:Violation ;
    sh:message "isTimeBasedRestriction: The value must be a boolean (true/false)."@en .

era-sh:RestrictionShape sh:property era-sh:OtherCCSRadioSystemOnboard .
era-sh:OtherCCSRadioSystemOnboard
    a sh:PropertyShape ;
    era:affectedProperty era:otherCCSRadioSystemOnboard ;
    era:affectedClass era:Restriction ;
    era:scope "local" ;
    rdfs:comment "Validation for otherCCSRadioSystemOnboard property."@en ;
    sh:path era:otherCCSRadioSystemOnboard ;
    sh:nodeKind sh:IRI ;
    sh:maxCount 1 ;
    sh:severity sh:Violation ;
    sh:message "otherCCSRadioSystemOnboard: The value must be an IRI."@en .

era-sh:RestrictionShape sh:sparql era-sh:OtherCCSRadioSystemOnboardSKOS .
era-sh:OtherCCSRadioSystemOnboardSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:otherCCSRadioSystemOnboard ;
    era:affectedClass era:Restriction ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of otherCCSRadioSystemOnboard is a valid SKOS concept from the other CCS radio system concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "otherCCSRadioSystemOnboard: The Restriction {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/other-ccs-radio-system/OtherCCSRadioSystem>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:otherCCSRadioSystemOnboard AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:otherCCSRadioSystemOnboard ?concept .
            era:otherCCSRadioSystemOnboard era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:RestrictionShape sh:property era-sh:OtherCCSSystemOnboard .
era-sh:OtherCCSSystemOnboard
    a sh:PropertyShape ;
    era:affectedProperty era:otherCCSSystemOnboard ;
    era:affectedClass era:Restriction ;
    era:scope "local" ;
    rdfs:comment "Validation for otherCCSSystemOnboard property."@en ;
    sh:path era:otherCCSSystemOnboard ;
    sh:nodeKind sh:IRI ;
    sh:maxCount 1 ;
    sh:severity sh:Violation ;
    sh:message "otherCCSSystemOnboard: The value must be an IRI."@en .

era-sh:RestrictionShape sh:sparql era-sh:OtherCCSSystemOnboardSKOS .
era-sh:OtherCCSSystemOnboardSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:otherCCSSystemOnboard ;
    era:affectedClass era:Restriction ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of otherCCSSystemOnboard is a valid SKOS concept from the other CCS signalling system concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "otherCCSSystemOnboard: The Restriction {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/other-ccs-signalling-system/OtherCCSSignallingSystem>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:otherCCSSystemOnboard AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:otherCCSSystemOnboard ?concept .
            era:otherCCSSystemOnboard era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .



era-sh:VehicleRegistrationRestrictionShape 
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:VehicleRegistrationRestriction .


era-sh:VehicleShape 
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:Vehicle .

era-sh:VehicleShape sh:property era-sh:VehicleNumber .
era-sh:VehicleNumber
    a sh:PropertyShape ;
    era:affectedProperty era:vehicleNumber ;
    era:affectedClass era:Vehicle ;
    era:scope "local" ;
    rdfs:comment "Validation for vehicleNumber property." ;
    sh:path era:vehicleNumber ;
    sh:datatype xsd:string ;
    sh:maxCount 1 ;
    sh:severity sh:Violation ;
    sh:message "vehicleNumber: The value must be a string. At most one value is allowed."@en .

era-sh:VehicleShape sh:property era-sh:VehicleSeries .
era-sh:VehicleSeries
    a sh:PropertyShape ;
    era:affectedProperty era:vehicleSeries ;
    era:affectedClass era:Vehicle ;
    era:scope "local" ;
    rdfs:comment "Validation for vehicleSeries property." ;
    sh:path era:vehicleSeries ;
    sh:datatype xsd:string ;
    sh:severity sh:Violation ;
    sh:message "vehicleSeries: The value must be a string."@en .


era-sh:VehicleShape sh:property era-sh:HasCompositeBrakeBlockRetrofitted .
era-sh:HasCompositeBrakeBlockRetrofitted
    a sh:PropertyShape ;
    era:affectedProperty era:hasCompositeBrakeBlockRetrofitted ;
    era:affectedClass era:Vehicle ;
    era:scope "local" ;
    rdfs:comment "Validation for hasCompositeBrakeBlockRetrofitted property." ;
    sh:path era:hasCompositeBrakeBlockRetrofitted ;
    sh:datatype xsd:boolean ;
    sh:severity sh:Violation ;
    sh:message "hasCompositeBrakeBlockRetrofitted: The value must be a boolean."@en .

era-sh:VehicleShape sh:property era-sh:OperationalRestriction .
era-sh:OperationalRestriction
    a sh:PropertyShape ;
    era:affectedProperty era:operationalRestriction ;
    era:affectedClass era:Vehicle ;
    era:scope "local" ;
    rdfs:comment "Validation for operationalRestriction property."@en ;
    sh:path era:operationalRestriction ;
    sh:nodeKind sh:IRI ;
    sh:severity sh:Violation ;
    sh:message "operationalRestriction: The value must be an IRI."@en .

era-sh:VehicleShape sh:sparql era-sh:OperationalRestrictionSKOS .
era-sh:OperationalRestrictionSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:operationalRestriction ;
    era:affectedClass era:Vehicle ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of operationalRestriction is a valid SKOS concept from the restrictions concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "operationalRestriction: The Vehicle {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/restrictions/Restrictions>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:operationalRestriction AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:operationalRestriction ?concept .
            era:operationalRestriction era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeAuthorisationRestrictionShape sh:property era-sh:QuieterRoutesExemptedCountry .
era-sh:QuieterRoutesExemptedCountry
    a sh:PropertyShape ;
    era:affectedProperty era:quieterRoutesExemptedCountry ;
    era:affectedClass era:VehicleTypeAuthorisationRestriction ;
    era:scope "local" ;
    rdfs:comment "Validation for quieterRoutesExemptedCountry property."@en ;
    sh:path era:quieterRoutesExemptedCountry ;
    sh:nodeKind sh:IRI ;
    sh:severity sh:Violation ;
    sh:message "quieterRoutesExemptedCountry: The value must be an IRI."@en .

era-sh:VehicleShape sh:sparql era-sh:QuieterRoutesExemptedCountrySKOS .
era-sh:VehicleTypeAuthorisationRestrictionShape sh:sparql era-sh:QuieterRoutesExemptedCountrySKOS .
era-sh:QuieterRoutesExemptedCountrySKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:quieterRoutesExemptedCountry ;
    era:affectedClass era:Vehicle ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of quieterRoutesExemptedCountry is a valid SKOS concept from the country authority concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "quieterRoutesExemptedCountry: The Vehicle {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://publications.europa.eu/resource/authority/country>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:quieterRoutesExemptedCountry AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:quieterRoutesExemptedCountry ?concept .
            era:quieterRoutesExemptedCountry era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleShape sh:property era-sh:VehicleKeeper .
era-sh:VehicleKeeper
    a sh:PropertyShape ;
    era:affectedProperty era:vehicleKeeper ;
    era:affectedClass era:Vehicle ;
    era:scope "local" ;
    rdfs:comment "Validation for vehicleKeeper property." ;
    sh:path era:vehicleKeeper ;
    sh:nodeKind sh:IRI ;
    sh:class era:OrganisationRole ;
    sh:severity sh:Violation ;
    sh:message "vehicleKeeper: The value must be an IRI pointing to an OrganisationRole."@en .

era-sh:VehicleShape sh:property era-sh:VehicleType .
era-sh:VehicleType
    a sh:PropertyShape ;
    era:affectedProperty era:vehicleType ;
    era:affectedClass era:Vehicle ;
    era:scope "local" ;
    rdfs:comment "Validation for vehicleType property." ;
    sh:path era:vehicleType ;
    sh:nodeKind sh:IRI ;
    sh:class era:VehicleType ;
    sh:severity sh:Violation ;
    sh:message "vehicleType: The value must be an IRI pointing to a VehicleType."@en .



era-sh:VehicleTypeAuthorisationApplicationShape
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass  era:VehicleTypeAuthorisationApplication .

era-sh:VehicleTypeAuthorisationApplicationShape sh:sparql era-sh:VPAPermissionTypeSPARQL .
era-sh:VPAPermissionTypeSPARQL 
    a sh:SPARQLConstraint ;   # This triple is optional
    sh:message "VA Applications contain a valid authorisation case. Valid combinations are not checked."@en ;
    sh:prefixes vpa: , era-va-authcase: ;
    sh:select """
    PREFIX vpa: <https://w3id.org/vpa#>
    PREFIX era-va-authcase: <http://data.europa.eu/949/concepts/va-authcases/>
    SELECT $this ?authcasetype (vpa:permissionType AS ?path)
    WHERE {
      $this vpa:constitutedBy/vpa:permissionType ?authcasetype .
      FILTER (  !isLiteral(?authcasetype)                ||  # literal is not allowed
                !( ?authcasetype = era-va-authcase:C2T ) ||  # correct SKOS Concept for C2T
                !( ?authcasetype = era-va-authcase:NEW )     # correct SKOS Concept for NEW
                # incomplete
            )
      }
      """ ;
    .

era-sh:PAVA_CC_I_11_b
  a sh:NodeShape ;
  sh:nodeKind sh:IRI ;
  sh:targetClass era:VehicleTypeAuthorisationApplication .

##TODO: implement this shape
# era-sh:PAVA_CC_I_11_b sh:sparql era-sh:PAVA_CC_I_11_b_SPARQL .
# era-sh:PAVA_CC_I_11_b_SPARQL 
#     a sh:SPARQLConstraint ;   # This triple is optional
#     sh:message "VA Applications contain valid vehicle numbers (eventually in vehicle sets) as their scope."@en ;
#     #sh:js [ # js helper to validate the vehicle numbers at ?this  ]
# .

era-sh:VehicleTypeAuthorisationApplicationShape sh:property era-sh:IsPreEngagementApplication .
era-sh:IsPreEngagementApplication
    a sh:PropertyShape ;
    era:affectedProperty era:isPreEngagementApplication ;
    era:affectedClass era:VehicleTypeAuthorisationApplication ;
    era:scope "local" ;
    rdfs:comment "Validation for isPreEngagementApplication property." ;
    sh:path era:isPreEngagementApplication ;
    sh:datatype xsd:boolean ;
    sh:severity sh:Violation ;
    sh:message "isPreEngagementApplication: The value must be a boolean."@en .

era-sh:VehicleTypeAuthorisationApplicationShape sh:property era-sh:PreEngagementBaseline .
era-sh:PreEngagementBaseline
    a sh:PropertyShape ;
    era:affectedProperty era:preEngagementBaseline ;
    era:affectedClass era:VehicleTypeAuthorisationApplication ;
    era:scope "local" ;
    rdfs:comment "Validation for preEngagementBaseline property." ;
    sh:path era:preEngagementBaseline ;
    sh:nodeKind sh:IRI ;
    sh:class era:Document ;
    sh:severity sh:Violation ;
    sh:message "preEngagementBaseline: The value must be an IRI pointing to a Document."@en .


era-sh:VehicleTypeAuthorisationCaseShape
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass  era:VehicleTypeAuthorisationCase .

era-sh:VehicleAuthorisationCaseShape
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:VehicleAuthorisationCase .

era-sh:VehicleTypeAuthorisationCaseShape sh:property era-sh:AreaOfUse .
era-sh:VehicleAuthorisationCaseShape sh:property era-sh:AreaOfUse .
era-sh:AreaOfUse
    a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeAuthorisationCase ,
                      era:VehicleAuthorisationCase ;
    era:affectedProperty era:areaOfUse ;
    rdfs:comment "Validation for areaOfUse property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:areaOfUse ;
    sh:message "areaOfUse: The value must be an IRI."@en ;
    sh:severity sh:Violation .

era-sh:VehicleTypeAuthorisationCaseShape sh:sparql era-sh:AreaOfUseSKOS .
era-sh:VehicleAuthorisationCaseShape sh:sparql era-sh:AreaOfUseSKOS .
era-sh:AreaOfUseSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:areaOfUse ;
    era:affectedClass era:VehicleTypeAuthorisationCase ,
                      era:VehicleAuthorisationCase ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of areaOfUse is a valid SKOS concept from the countries concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "areaOfUse: The VehicleTypeAuthorisationCase {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://publications.europa.eu/resource/authority/country>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:areaOfUse AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:areaOfUse ?concept .
            era:areaOfUse era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

# TO DO: era:areaOfUse applicability Constraint (Not applicable for Authorisation Cases of `vpa:permissionType era-va-authcase:PRE4RP)

era-sh:VehicleTypeAuthorisationCaseShape sh:property era-sh:AuthorisingMemberState .
era-sh:VehicleAuthorisationCaseShape sh:property era-sh:AuthorisingMemberState .
era-sh:AuthorisingMemberState
    a sh:PropertyShape ;
    era:affectedProperty era:authorisingMemberState ;
    era:affectedClass era:VehicleTypeAuthorisationCase ,
                      era:VehicleAuthorisationCase ;
    era:scope "local" ;
    rdfs:comment "Indicates the member state where a vehicle type has been authorized. Not to be confused with Area Of Use."@en ;
    era:eratvIndex "3.1.1" ;
    sh:path era:authorisingMemberState ;
    sh:nodeKind sh:IRI ;
    sh:severity sh:Violation ;
    sh:message "authorisingMemberState (3.1.1): The value must be an IRI."@en .

era-sh:VehicleTypeAuthorisationCaseShape sh:sparql era-sh:AuthorisingMemberStateSKOS .
era-sh:VehicleAuthorisationCaseShape sh:sparql era-sh:AuthorisingMemberStateSKOS .
era-sh:AuthorisingMemberStateSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:authorisingMemberState ;
    era:affectedClass era:VehicleTypeAuthorisationCase ,
                      era:VehicleAuthorisationCase ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of authorisingMemberState is a valid SKOS concept from the countries concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "authorisingMemberState: The VehicleTypeAuthorisationCase {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://publications.europa.eu/resource/authority/country>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:authorisingMemberState AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:authorisingMemberState ?concept .
            era:authorisingMemberState era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeAuthorisationCaseShape sh:property era-sh:SafetyDeclaration .
era-sh:SafetyDeclaration
    a sh:PropertyShape ;
    era:affectedProperty era:safetyDeclaration ;
    era:affectedClass era:VehicleTypeAuthorisationCase ;
    era:scope "local" ;
    rdfs:comment "Validation for safetyDeclaration property. CSM-REA Safety Declaration." ;
    sh:path era:safetyDeclaration ;
    sh:datatype xsd:anyURI ;
    sh:severity sh:Violation ;
    sh:message "safetyDeclaration: The value must be an anyURI."@en .


era-sh:VehicleTypeAuthorisationCaseShape sh:property era-sh:ConfigDependentCompliance .
era-sh:ConfigDependentCompliance
    a sh:PropertyShape ;
    era:affectedProperty era:configDependentCompliance ;
    era:affectedClass era:VehicleTypeAuthorisationCase ;
    era:scope "local" ;
    rdfs:comment "Validation for configDependentCompliance property." ;
    sh:path era:configDependentCompliance ;
    sh:nodeKind sh:IRI ;
    sh:class era:VehicleTypeAuthorisationCheck ;
    sh:severity sh:Violation ;
    sh:message "configDependentCompliance: The value must be an IRI pointing to a VehicleTypeAuthorisationCheck."@en .

era-sh:VehicleTypeAuthorisationCaseShape sh:property era-sh:ConfigDependentCondition .
era-sh:VehicleAuthorisationCaseShape sh:property era-sh:ConfigDependentCondition .
era-sh:ConfigDependentCondition
    a sh:PropertyShape ;
    era:affectedProperty era:configDependentCondition ;
    era:affectedClass era:VehicleTypeAuthorisationCase ,
                      era:VehicleAuthorisationCase ;
    era:scope "local" ;
    rdfs:comment "Validation for configDependentCondition property." ;
    sh:path era:configDependentCondition ;
    sh:nodeKind sh:IRI ;
    sh:class era:VehicleTypeAuthorisationCheck ;
    sh:severity sh:Violation ;
    sh:message "configDependentCondition: The value must be an IRI pointing to a VehicleTypeAuthorisationCheck."@en .

era-sh:VehicleTypeAuthorisationCaseShape sh:property era-sh:TypeRegistrationMethod .
era-sh:VehicleAuthorisationCaseShape sh:property era-sh:TypeRegistrationMethod .
era-sh:TypeRegistrationMethod
    a sh:PropertyShape ;
    era:affectedProperty era:typeRegistrationMethod ;
    era:affectedClass era:VehicleTypeAuthorisationCase ,
                      era:VehicleAuthorisationCase ;
    era:scope "local" ;
    rdfs:comment "Validation for typeRegistrationMethod property."@en ;
    sh:path era:typeRegistrationMethod ;
    sh:nodeKind sh:IRI ;
    sh:severity sh:Violation ;
    sh:message "typeRegistrationMethod: The value must be an IRI."@en .

era-sh:VehicleTypeAuthorisationCaseShape sh:sparql era-sh:TypeRegistrationMethodSKOS .
era-sh:VehicleAuthorisationCaseShape sh:sparql era-sh:TypeRegistrationMethodSKOS .
era-sh:TypeRegistrationMethodSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:typeRegistrationMethod ;
    era:affectedClass era:VehicleTypeAuthorisationCase ,
                      era:VehicleAuthorisationCase ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of typeRegistrationMethod is a valid SKOS concept from the vehicle type registration methods concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "typeRegistrationMethod: The VehicleTypeAuthorisationCase {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/vehicle-type-registration-methods/VehicleTypeRegistrationMethods>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:typeRegistrationMethod AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:typeRegistrationMethod ?concept .
            era:typeRegistrationMethod era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .


era-sh:VehicleTypeAuthorisationRestrictionShape 
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass  era:VehicleTypeAuthorisationRestriction .

era-sh:VehicleTypeAuthorisationRestrictionShape sh:property era-sh:HasStrictLocalHistoricalTouristUse .
era-sh:HasStrictLocalHistoricalTouristUse
    a sh:PropertyShape ;
    era:affectedProperty era:hasStrictLocalHistoricalTouristUse ;
    era:affectedClass era:VehicleTypeAuthorisationRestriction ;
    era:scope "local" ;
    rdfs:comment "Validation for hasStrictLocalHistoricalTouristUse property. Indicates if the restriction applies to strictly local, historical or tourist use." ;
    sh:path era:hasStrictLocalHistoricalTouristUse ;
    sh:datatype xsd:boolean ;
    sh:severity sh:Violation ;
    sh:message "hasStrictLocalHistoricalTouristUse: The value must be a boolean (true/false)."@en ;
    era:eratvIndex "3.1.2.3" .

era-sh:VehicleTypeAuthorisationRestrictionShape sh:property era-sh:OnboardRecordingDevice .
era-sh:OnboardRecordingDevice
    a sh:PropertyShape ;
    era:affectedProperty era:onboardRecordingDevice ;
    era:affectedClass era:VehicleTypeAuthorisationRestriction ;
    era:scope "local" ;
    rdfs:comment "Validation for onboardRecordingDevice property."@en ;
    sh:path era:onboardRecordingDevice ;
    sh:nodeKind sh:IRI ;
    sh:severity sh:Violation ;
    sh:message "onboardRecordingDevice: The value must be an IRI."@en .

era-sh:VehicleTypeAuthorisationRestrictionShape sh:sparql era-sh:OnboardRecordingDeviceSKOS .
era-sh:OnboardRecordingDeviceSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:onboardRecordingDevice ;
    era:affectedClass era:VehicleTypeAuthorisationRestriction ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of onboardRecordingDevice is a valid SKOS concept from the onboard recording devices concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "onboardRecordingDevice: The VehicleTypeAuthorisationRestriction {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/onboard-recording-devices/OnboardRecording>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:onboardRecordingDevice AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:onboardRecordingDevice ?concept .
            era:onboardRecordingDevice era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeAuthorisationRestrictionShape sh:property era-sh:QuieterRoutesNoiseCategory .
era-sh:QuieterRoutesNoiseCategory
    a sh:PropertyShape ;
    era:affectedProperty era:quieterRoutesNoiseCategory ;
    era:affectedClass era:VehicleTypeAuthorisationRestriction ;
    era:scope "local" ;
    rdfs:comment "Validation for quieterRoutesNoiseCategory property."@en ;
    sh:path era:quieterRoutesNoiseCategory ;
    sh:nodeKind sh:IRI ;
    sh:severity sh:Violation ;
    sh:message "quieterRoutesNoiseCategory: The value must be an IRI."@en .

era-sh:VehicleTypeAuthorisationRestrictionShape sh:sparql era-sh:QuieterRoutesNoiseCategorySKOS .
era-sh:QuieterRoutesNoiseCategorySKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:quieterRoutesNoiseCategory ;
    era:affectedClass era:VehicleTypeAuthorisationRestriction ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of quieterRoutesNoiseCategory is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "quieterRoutesNoiseCategory: The VehicleTypeAuthorisationRestriction {$this} with label {?label} has a value {?value} that is not one of the predefined values."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:quieterRoutesNoiseCategory AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:quieterRoutesNoiseCategory ?concept .
            era:quieterRoutesNoiseCategory era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .



era-sh:VehicleTypeAuthorisationShape 
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass  era:VehicleTypeAuthorisation .

era-sh:VehicleTypeAuthorisationShape sh:property era-sh:VehicleTypeAuthorisationHolder .
era-sh:VehicleTypeAuthorisationHolder
    a sh:PropertyShape ;
    era:affectedProperty era:vehicleTypeAuthorisationHolder ;
    era:affectedClass era:VehicleTypeAuthorisation ;
    era:scope "local" ;
    rdfs:comment "Validation for vehicleTypeAuthorisationHolder property. Indicates the vehicle type authorisation holder." ;
    sh:path era:vehicleTypeAuthorisationHolder ;
    sh:nodeKind sh:IRI ;
    sh:class era:OrganisationRole ;
    sh:severity sh:Violation ;
    sh:message "vehicleTypeAuthorisationHolder: The value must be an IRI pointing to an OrganisationRole."@en ;
    era:eratvIndex "3.1.3.1.2" ,
                   "3.1.3.2.3" ,
                   "3.1.3.3.3" ,
                   "3.1.3.4.3" ,
                   "3.1.3.5.3" ,
                   "3.1.3.6.3" ,
                   "3.1.3.7.3" ,
                   "3.1.3.8.3" .

era-sh:VehicleTypeConfigParameterSetShape 
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:VehicleTypeConfigParameterSet .

era-sh:VehicleTypeShape sh:property era-sh:AxleSpacingDistance .
era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:AxleSpacingDistance .
era-sh:AxleSpacingDistance a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeConfigParameterSet ;
    era:affectedProperty era:axleSpacingDistance ;
    rdfs:comment "Validation for axleSpacingDistance property."@en ;
    sh:nodeKind sh:IRI ;
    era:eratvIndex "4.5.3.4" ;
    sh:path era:axleSpacingDistance ;
    sh:message "era:axleSpacingDistance: its value must be an IRI."@en ;
    sh:class era:AxleSpacing ;
    sh:severity sh:Violation .

era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:CatenaryMaxRatedCurrent .
era-sh:CatenaryMaxRatedCurrent a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeConfigParameterSet ;
    era:affectedProperty era:catenaryMaxRatedCurrent ;
    rdfs:comment "Validation for catenaryMaxRatedCurrent property."@en  ;
    sh:datatype xsd:integer ; 
    era:eratvIndex "4.10.3" ;
    sh:path era:catenaryMaxRatedCurrent ;
    sh:message "The catenaryMaxRatedCurrent must be an integer value."@en  ;
    sh:severity sh:Violation .

era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh-eratv:ContactStripMaterial .
era-sh-eratv:ContactStripMaterial a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeConfigParameterSet ;
    era:affectedProperty era:contactStripMaterial ;
    rdfs:comment "Validation for contactStripMaterial property."@en  ;
    sh:nodeKind sh:IRI ;
    sh:maxCount 1 ;
    era:eratvIndex "4.10.10" ;
    sh:path era:contactStripMaterial ;
    sh:message "era:contactStripMaterial: its value must be an IRI."@en ;
    sh:severity sh:Violation .

era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:HasOnboardEnergyMeasurement .
era-sh:HasOnboardEnergyMeasurement a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeConfigParameterSet ;
    era:affectedProperty era:hasOnboardEnergyMeasurement ;
    rdfs:comment "Validation for hasOnboardEnergyMeasurement property."@en  ;
    sh:datatype xsd:boolean ;
    era:eratvIndex "4.10.12" ;
    sh:path era:hasOnboardEnergyMeasurement ;
    sh:message "The hasOnboardEnergyMeasurement must be a boolean value."@en  ;
    sh:severity sh:Violation .

era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:EnergySupplyMaxPower .
era-sh:EnergySupplyMaxPower a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeConfigParameterSet ;
    era:affectedProperty era:energySupplyMaxPower ;
    rdfs:comment "Validation for energySupplyMaxPower property."@en ;
    sh:datatype xsd:decimal ;
    sh:path era:energySupplyMaxPower ;
    sh:message "The energySupplyMaxPower must be a decimal value."@en ;
    era:eratvIndex "4.10.2" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:ForConfiguration .
era-sh:RestrictionShape sh:property era-sh:ForConfiguration .
era-sh:ForConfiguration a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeConfigParameterSet ,
                      era:Restriction ;
    era:affectedProperty era:forConfiguration ;
    rdfs:comment "Validation for forConfiguration property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:forConfiguration ;
    sh:message "era:forConfiguration: its value must be an IRI pointing to a VehicleTypeConfiguration."@en ;
    sh:class era:VehicleTypeConfiguration ;
    sh:severity sh:Violation .

era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:HasAutomaticDroppingDevice .
era-sh:HasAutomaticDroppingDevice a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeConfigParameterSet ;
    era:affectedProperty era:hasAutomaticDroppingDevice ;
    rdfs:comment "Validation for hasAutomaticDroppingDevice property."@en ;
    sh:datatype xsd:boolean ;
    sh:path era:hasAutomaticDroppingDevice ;
    sh:message "The hasAutomaticDroppingDevice must be a boolean value."@en ;
    era:eratvIndex "4.10.11" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:HasBrakingPerformance .
era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:HasBrakingPerformance .
era-sh:HasBrakingPerformance a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeConfigParameterSet ;
    era:affectedProperty era:hasBrakingPerformance ;
    rdfs:comment "Validation for hasBrakingPerformance property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:hasBrakingPerformance ;
    sh:message "era:hasBrakingPerformance: its value must be an IRI pointing to a BrakingPerformance."@en ;
    sh:class era:BrakingPerformance ;
    era:eratvIndex "4.7" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:HasCurrentLimitation .
era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:HasCurrentLimitation .
era-sh:HasCurrentLimitation a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeConfigParameterSet ;
    era:affectedProperty era:hasCurrentLimitation ;
    rdfs:comment "Validation for hasCurrentLimitation property."@en ;
    sh:datatype xsd:boolean ;
    sh:path era:hasCurrentLimitation ;
    sh:message "The hasCurrentLimitation must be a boolean value."@en ;
    era:eratvIndex "4.10.14" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:HasOCLChargeableTractionStorage .
era-sh:HasOCLChargeableTractionStorage a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeConfigParameterSet ;
    era:affectedProperty era:hasOCLChargeableTractionStorage ;
    rdfs:comment "Validation for hasOCLChargeableTractionStorage property."@en ;
    sh:datatype xsd:boolean ;
    sh:path era:hasOCLChargeableTractionStorage ;
    sh:message "The hasOCLChargeableTractionStorage must be a boolean value."@en ;
    era:eratvIndex "4.10.16" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:HasParkingBrake .
era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:HasParkingBrake .
era-sh:HasParkingBrake a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeConfigParameterSet ;
    era:affectedProperty era:hasParkingBrake ;
    rdfs:comment "Validation for hasParkingBrake property."@en ;
    sh:datatype xsd:boolean ;
    sh:path era:hasParkingBrake ;
    sh:message "The hasParkingBrake must be a boolean value."@en ;
    era:eratvIndex "4.7.3.4" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:HasVehicleTypeConfiguration .
era-sh:HasVehicleTypeConfiguration a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeConfigParameterSet ;
    era:affectedProperty era:hasVehicleTypeConfiguration ;
    rdfs:comment "Validation for hasVehicleTypeConfiguration property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:hasVehicleTypeConfiguration ;
    sh:message "era:hasVehicleTypeConfiguration: its value must be an IRI pointing to a VehicleTypeConfiguration."@en ;
    sh:class era:VehicleTypeConfiguration ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:HasWheelSlideProtectionSystem .
era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:HasWheelSlideProtectionSystem .
era-sh:HasWheelSlideProtectionSystem a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeConfigParameterSet ;
    era:affectedProperty era:hasWheelSlideProtectionSystem ;
    rdfs:comment "Validation for hasWheelSlideProtectionSystem property."@en ;
    sh:datatype xsd:boolean ;
    sh:path era:hasWheelSlideProtectionSystem ;
    sh:message "The hasWheelSlideProtectionSystem must be a boolean value."@en ;
    era:eratvIndex "4.7.8" ;
    sh:severity sh:Violation .


# TODO homogenise with ERA-RINF-shapes.ttl
era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh-eratv:MaxCurrentStandstillPantograph .
era-sh-eratv:MaxCurrentStandstillPantograph a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeConfigParameterSet ;
    era:affectedProperty era:maxCurrentStandstillPantograph ;
    rdfs:comment "Validation for maxCurrentStandstillPantograph property."@en ;
    sh:datatype xsd:decimal ;
    sh:maxCount 1 ;
    sh:path era:maxCurrentStandstillPantograph ;
    sh:message "The maxCurrentStandstillPantograph must be a decimal value."@en ;
    era:eratvIndex "4.10.4" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:MaximumLocomotivesCoupled .
era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:MaximumLocomotivesCoupled .
era-sh:VehicleTypeAuthorisationRestrictionShape sh:property era-sh:MaximumLocomotivesCoupled .
era-sh:MaximumLocomotivesCoupled a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeConfigParameterSet ;
    era:affectedProperty era:maximumLocomotivesCoupled ;
    rdfs:comment "Validation for maximumLocomotivesCoupled property."@en ;
    sh:datatype xsd:integer ;
    sh:path era:maximumLocomotivesCoupled ;
    sh:message "The maximumLocomotivesCoupled must be an integer value."@en ;
    era:eratvIndex "4.1.5" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh-eratv:MinimumContactWireHeight .
era-sh-eratv:MinimumContactWireHeight
	a sh:PropertyShape ;
    era:affectedProperty era:minimumContactWireHeight ;
    era:affectedClass era:VehicleTypeConfigParameterSet ;
	rdfs:comment "Indication of the minimum contact wire height expressed in metres."@en ;
	era:eratvIndex "4.10.5" ;
	sh:path era:minimumContactWireHeight ;
	sh:datatype xsd:double ;
	sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "minimumContactWireHeight (4.10.5): The value must be a double (real) number."@en .

era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:NumberOfPantographsInContactWithOCL .
era-sh:NumberOfPantographsInContactWithOCL a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeConfigParameterSet ;
    era:affectedProperty era:numberOfPantographsInContactWithOCL ;
    rdfs:comment "Validation for numberOfPantographsInContactWithOCL property."@en ;
    sh:datatype xsd:integer ;
    sh:path era:numberOfPantographsInContactWithOCL ;
    sh:message "The numberOfPantographsInContactWithOCL must be an integer value."@en ;
    era:eratvIndex "4.10.7" ;
    sh:severity sh:Violation .

# SPARQL constraint to check applicability based on numberOfPantographsInContactWithOCL
era-sh:VehicleTypeConfigParameterSetShape sh:sparql era-sh:OclTypeApplicabilitySPARQL .
era-sh:OclTypeApplicabilitySPARQL a sh:SPARQLConstraint ;
    sh:severity sh:Warning ;
    era:eratvIndex "4.10.9" ;
    sh:message "OCL type ({?oclType}) is not applicable when numberOfPantographsInContactWithOCL (value: {?numPanto}) is less than 2."@en ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        
        SELECT $this ?oclType ?numPanto (era:oclType AS ?path) WHERE {
            $this era:oclType ?oclType .
            $this era:numberOfPantographsInContactWithOCL ?numPanto .
            FILTER(?numPanto < 2)
        }
    """ .

era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:QuasiStaticGuidingForce .
era-sh:QuasiStaticGuidingForce a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeConfigParameterSet ;
    era:affectedProperty era:quasiStaticGuidingForce ;
    rdfs:comment "Validation for quasiStaticGuidingForce property."@en ;
    sh:datatype xsd:decimal ;
    sh:path era:quasiStaticGuidingForce ;
    sh:message "The quasiStaticGuidingForce must be a decimal value."@en ;
    era:eratvIndex "4.5.4" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:ShortestDistanceBetweenPantographsInContactWithOCL .
era-sh:ShortestDistanceBetweenPantographsInContactWithOCL a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeConfigParameterSet ;
    era:affectedProperty era:shortestDistanceBetweenPantographsInContactWithOCL ;
    rdfs:comment "Validation for shortestDistanceBetweenPantographsInContactWithOCL property."@en ;
    sh:datatype xsd:string ;
    sh:pattern "^Single:" ;
    sh:path era:shortestDistanceBetweenPantographsInContactWithOCL ;
    sh:message "The shortestDistanceBetweenPantographsInContactWithOCL must be a string with the following format: 'Single: ___(; Multiple: ___)'."@en ;
    era:eratvIndex "4.10.8" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:TotalVehicleMass .
era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:TotalVehicleMass .
era-sh:TotalVehicleMass a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeConfigParameterSet ;
    era:affectedProperty era:totalVehicleMass ;
    rdfs:comment "Validation for totalVehicleMass property."@en ;
    sh:datatype xsd:integer ;
    sh:path era:totalVehicleMass ;
    sh:message "The totalVehicleMass must be an integer value."@en ;
    era:eratvIndex "4.5.5" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:VehiclePantographHead .
era-sh:VehiclePantographHead a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeConfigParameterSet ;
    era:affectedProperty era:vehiclePantographHead ;
    rdfs:comment "Validation for vehiclePantographHead property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:vehiclePantographHead ;
    sh:message "era:vehiclePantographHead: its value must be an IRI."@en ;
    era:eratvIndex "4.10.6" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:VehicleTypeMaximumSpeedAndCantDeficiency .
era-sh:VehicleTypeMaximumSpeedAndCantDeficiency a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeConfigParameterSet ;
    era:affectedProperty era:vehicleTypeMaximumSpeedAndCantDeficiency ;
    rdfs:comment "Validation for vehicleTypeMaximumSpeedAndCantDeficiency property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:vehicleTypeMaximumSpeedAndCantDeficiency ;
    sh:message "era:vehicleTypeMaximumSpeedAndCantDeficiency: its value must be an IRI pointing to a MaximumSpeedAndCantDeficiency."@en ;
    sh:class era:MaximumSpeedAndCantDeficiency ;
    era:eratvIndex "4.6.4" ;
    sh:severity sh:Violation .

    
era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:MinVehicleImpedance .

era-sh:MinVehicleImpedanceShape sh:property era-sh:MinImpedanceFrequency .
era-sh:MinImpedanceFrequency a sh:PropertyShape ;
    era:affectedClass era:MinVehicleImpedance ;
    era:affectedProperty era:minImpedanceFrequency ;
    era:scope "local" ;
    rdfs:comment "Validation for minImpedanceFrequency property."@en ;
    sh:path era:minImpedanceFrequency ;
    sh:datatype xsd:double ;
    sh:maxCount 1 ;
    sh:severity sh:Violation ;
    sh:message "minImpedanceFrequency: The value must be a double."@en .

era-sh:MinVehicleImpedanceShape sh:property era-sh:MinImpedanceResistance .
era-sh:MinImpedanceResistance a sh:PropertyShape ;
    era:affectedClass era:MinVehicleImpedance ;
    era:affectedProperty era:minImpedanceResistance ;
    era:scope "local" ;
    rdfs:comment "Validation for minImpedanceResistance property."@en ;
    sh:path era:minImpedanceResistance ;
    sh:datatype xsd:double ;
    sh:maxCount 1 ;
    sh:severity sh:Violation ;
    sh:message "minImpedanceResistance: The value must be a double."@en .

era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:EmergencyBrakeProfile  .
era-sh:EmergencyBrakeProfile a sh:PropertyShape ;
    era:affectedProperty era:emergencyBrakeProfile ;
    era:affectedClass era:VehicleTypeConfigParameterSet ;
    era:scope "local" ;
    rdfs:comment "Validation that the value of emergencyBrakeProfile points to an instance of BrakingProfile."@en ;
    sh:path era:emergencyBrakeProfile ;
    sh:nodeKind sh:IRI ;
    sh:class era:BrakingProfile ;
    sh:severity sh:Violation ;
    sh:message "emergencyBrakeProfile: its value must be an IRI of type BrakingProfile."@en .

era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:EtcsBaselineIncompleteCompatibility .
era-sh:VehicleTypeShape sh:property era-sh:EtcsBaselineIncompleteCompatibility .
era-sh:EtcsBaselineIncompleteCompatibility
    a sh:PropertyShape ;
    era:affectedProperty era:etcsBaselineIncompleteCompatibility ;
    era:affectedClass era:VehicleType, era:VehicleTypeConfigParameterSet ;
    era:scope "local" ;
    rdfs:comment "Validation for etcsBaselineIncompleteCompatibility property." ;
    sh:path era:etcsBaselineIncompleteCompatibility ;
    sh:datatype xsd:string ;
    sh:maxCount 1 ;
    sh:severity sh:Violation ;
    sh:message "etcsBaselineIncompleteCompatibility (4.13.1.2): The value must be a string."@en ;
    era:eratvIndex "4.13.1.2" .


era-sh:VehicleTypeConfigurationShape 
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:VehicleTypeConfiguration .

era-sh:VehicleTypeConfigurationShape sh:property era-sh:ForOnBoardClassA .
era-sh:ForOnBoardClassA a sh:PropertyShape ;
    era:affectedProperty era:forOnBoardClassA ;
    era:affectedClass era:VehicleTypeConfiguration ;
    era:scope "local" ;
    rdfs:comment "Validation of the forOnBoardClassA property for VehicleTypeConfiguration."@en ;
    sh:path era:forOnBoardClassA ;
    sh:nodeKind sh:IRI ;
    sh:severity sh:Violation ;
    sh:message "forOnBoardClassA: The value must be an IRI."@en .

### SKOS validation for era:forOnBoardClassA
era-sh:VehicleTypeConfigurationShape sh:sparql era-sh:ForOnBoardClassASKOS .
era-sh:ForOnBoardClassASKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:forOnBoardClassA ;
    era:affectedClass era:VehicleTypeConfiguration ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of forOnBoardClassA is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "forOnBoardClassA: The VehicleTypeConfiguration {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/etcs-equipment-on-board-level/ETCSEquipmentLevels>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:forOnBoardClassA AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:forOnBoardClassA ?concept .
            era:forOnBoardClassA era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeConfigurationShape sh:property era-sh:ForOnBoardClassB .
era-sh:ForOnBoardClassB a sh:PropertyShape ;
    era:affectedProperty era:forOnBoardClassB ;
    era:affectedClass era:VehicleTypeConfiguration ;
    era:scope "local" ;
    rdfs:comment "Validation of the forOnBoardClassB property for VehicleTypeConfiguration."@en ;
    sh:path era:forOnBoardClassB ;
    sh:nodeKind sh:IRI ;
    sh:severity sh:Violation ;
    sh:message "forOnBoardClassB: The value must be an IRI."@en .

### SKOS validation for era:forOnBoardClassB
era-sh:VehicleTypeConfigurationShape sh:sparql era-sh:ForOnBoardClassBSKOS .
era-sh:ForOnBoardClassBSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:forOnBoardClassB ;
    era:affectedClass era:VehicleTypeConfiguration ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of forOnBoardClassB is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "forOnBoardClassB: The VehicleTypeConfiguration {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/etcs-equipment-on-board-level/ETCSEquipmentLevels>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:forOnBoardClassB AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:forOnBoardClassB ?concept .
            era:forOnBoardClassB era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeConfigurationShape sh:property era-sh:ForWheelSetGauge  .
era-sh:ForWheelSetGauge
    a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeConfiguration ;
    era:affectedProperty era:forWheelSetGauge ;
    rdfs:comment "Validation for forWheelSetGauge property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:forWheelSetGauge ;
    sh:message "forWheelSetGauge: The value must be an IRI."@en ;
    sh:severity sh:Violation .

era-sh:VehicleTypeConfigurationShape sh:sparql era-sh:ForWheelSetGaugeSKOS  .
era-sh:ForWheelSetGaugeSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:forWheelSetGauge ;
    era:affectedClass era:VehicleTypeConfiguration ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of forWheelSetGauge is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "forWheelSetGauge: The VehicleTypeConfiguration {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/nominal-track-gauges/NominalTrackGauges>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:forWheelSetGauge AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:forWheelSetGauge ?concept .
            era:forWheelSetGauge era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .


era-sh:VehicleTypeConfigurationShape sh:property era-sh:ForEnergySupplySystem  .
era-sh:ForEnergySupplySystem
    a sh:PropertyShape ;
    era:affectedClass era:VehicleTypeConfiguration ;
    era:affectedProperty era:forEnergySupplySystem ;
    rdfs:comment "Validation for forEnergySupplySystem property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:forEnergySupplySystem ;
    sh:message "forEnergySupplySystem: The value must be an IRI."@en ;
    sh:severity sh:Violation .


era-sh:VehicleTypeConfigurationShape sh:sparql era-sh:ForEnergySupplySystemSKOS  .
era-sh:ForEnergySupplySystemSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:forEnergySupplySystem ;
    era:affectedClass era:VehicleTypeConfiguration ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of forEnergySupplySystem is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "forEnergySupplySystem: The VehicleTypeConfiguration {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/energy-supply-systems/EnergySupplySystems>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:forEnergySupplySystem AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:forEnergySupplySystem ?concept .
            era:forEnergySupplySystem era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape 
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:VehicleType .

era-sh:PermissiblePayloadShape 
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
#    sh:sparql era-sh:InSkosConceptScheme ; #using the improvement by Graphwise
    sh:targetClass era:PermissiblePayload .

# validate once with era-sh:InSkosConceptScheme SPARQL constraint
era-sh:InSkosConceptScheme 
  a sh:SPARQLConstraint ;
  sh:severity sh:Violation ;
  era:affectedClass era:PermissiblePayload ;
  era:affectedProperty era:forLineCategory ;
  era:eratvIndex "4.5.1.1", "4.9.2" ; 
  sh:message "Instance {$this} of class {?class} has enumerated property {?property} with value {?value} that is not in the list {?scheme}."@en ;
  sh:target era-sh:InSkosConceptSchemeSPARQL ;
  sh:deactivated true;
  sh:prefixes era:;
  sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    SELECT $this ?class ?property ?value ?scheme (?property AS ?path) {
    $this a ?class; ?property ?value .
    ?property era:inSkosConceptScheme ?scheme .
    FILTER NOT EXISTS {?value skos:inScheme ?scheme}}""".

era-sh:InSkosConceptSchemeSPARQL a sh:SPARQLTarget;
    sh:prefixes era:;
    sh:select """
      PREFIX era: <http://data.europa.eu/949/>
      PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
      SELECT distinct $this (?property AS ?path) {
        $this ?property ?value .
        ?property era:inSkosConceptScheme ?scheme .
        FILTER NOT EXISTS {?value skos:inScheme ?scheme}}""".

era-sh:PermissiblePayloadShape sh:property era-sh:ForLineCategory  .
era-sh:ForLineCategory a sh:PropertyShape ;
    era:affectedClass era:PermissiblePayload ;
    era:affectedProperty era:forLineCategory ;
    rdfs:comment "Validation for forLineCategory property."@en ;
    sh:nodeKind sh:IRI  ;
    sh:message "The forLineCategory value must be an IRI"@en ;
    sh:path era:forLineCategory ;
    era:eratvIndex "4.5.1.1" ; 
    sh:severity sh:Violation .

era-sh:PermissiblePayloadShape sh:property era-sh:PermissiblePayloadMass  .
era-sh:PermissiblePayloadMass a sh:PropertyShape ;
    era:affectedClass era:PermissiblePayload ;
    era:affectedProperty era:permissiblePayloadMass ;
    rdfs:comment "Validation for permissiblePayloadMass property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The permissiblePayloadMass value must be a decimal"@en ;
    sh:path era:permissiblePayloadMass ;
    era:eratvIndex "4.5.1.1" ;
    sh:severity sh:Violation .


era-sh:VehicleTypeShape sh:property era-sh:TypeName .
era-sh:TypeName a sh:PropertyShape ;
                era:affectedClass era:VehicleType ;
                era:affectedProperty rdfs:label ;
                rdfs:comment "Validation for Type Name property."@en ;
                sh:datatype rdf:langString ;
                sh:uniqueLang true ;
                sh:maxLength 256 ;
                sh:message "The Type Name value must be a character string with a maximum length of 256 characters."@en ;
                sh:path rdfs:label ;
                era:eratvIndex "1.1" ;
                sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:AlternativeTypeName .
era-sh:AlternativeTypeName a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:alternativeTypeName ;
    rdfs:comment "Validation for alternativeTypeName property."@en ;
    sh:datatype rdf:langString ;
    sh:uniqueLang true ;
    sh:maxLength 256 ;
    sh:message "The alternativeTypeName value must be a character string with a maximum length of 256 characters."@en ;
    sh:path era:alternativeTypeName ;
    era:eratvIndex "1.2" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:AltitudeRange .
era-sh:AltitudeRange a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:altitudeRange ;
    rdfs:comment "Validation for altitudeRange property."@en ;
    sh:datatype xsd:string ;
    sh:message "The altitudeRange value must be a character string."@en ;
    sh:path era:altitudeRange ;
    era:eratvIndex "4.3.2" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:AltitudeRangeDetail .
era-sh:AltitudeRangeDetail a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:altitudeRangeDetail ;
    rdfs:comment "Validation for altitudeRangeDetail property."@en ;
    sh:datatype xsd:integer ;
    sh:message "The altitudeRangeDetail value must be an integer."@en ;
    sh:path era:altitudeRangeDetail ;
    era:eratvIndex "4.3.2" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:AtoOnBoardImplementation .
era-sh:AtoOnBoardImplementation a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:atoOnBoardImplementation ;
    rdfs:comment "Validation for atoOnBoardImplementation property."@en ;
    sh:datatype xsd:string ;
    sh:message "The atoOnBoardImplementation value must be a character string."@en ;
    sh:path era:atoOnBoardImplementation ;
    era:eratvIndex "4.13.3.2" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:AxleBearingConditionMonitoring .
era-sh:AxleBearingConditionMonitoring a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:axleBearingConditionMonitoring ;
    rdfs:comment "Validation for axleBearingConditionMonitoring property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:axleBearingConditionMonitoring ;
    sh:message "era:axleBearingConditionMonitoring: its value must be an IRI."@en ;
    era:eratvIndex "4.9.2" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:sparql era-sh:AxleBearingConditionMonitoringSKOS .
era-sh:AxleBearingConditionMonitoringSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:axleBearingConditionMonitoring ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of axleBearingConditionMonitoring is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "axleBearingConditionMonitoring: The VehicleType {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/axle-monitoring/AxleBearingMonitoring>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:axleBearingConditionMonitoring AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:axleBearingConditionMonitoring ?concept .
            era:axleBearingConditionMonitoring era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh:BoardingAids .
era-sh:BoardingAids a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:boardingAids ;
    rdfs:comment "Validation for boardingAids property."@en ;
    sh:datatype xsd:string ;
    sh:message "The boardingAids value must be a character string."@en ;
    sh:path era:boardingAids ;
    era:eratvIndex "4.12.3.2" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:ConfigDependentParameter .
era-sh:ConfigDependentParameter a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:configDependentParameter ;
    rdfs:comment "Validation for configDependentParameter property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:configDependentParameter ;
    sh:message "era:configDependentParameter: its value must be an IRI pointing to a VehicleTypeConfigParameterSet."@en ;
    sh:class era:VehicleTypeConfigParameterSet ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:DataGSMRNetwork .
era-sh:DataGSMRNetwork a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:dataGSMRNetwork ;
    rdfs:comment "Validation for dataGSMRNetwork property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:dataGSMRNetwork ;
    sh:message "era:dataGSMRNetwork: its value must be an IRI."@en ;
    era:eratvIndex "4.13.2.11" ;
    sh:severity sh:Violation .

### SPARQLConstraint for dataGSMRNetwork SKOS validation
era-sh:VehicleTypeShape sh:sparql era-sh:DataGSMRNetworkSKOS .
era-sh:DataGSMRNetworkSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:dataGSMRNetwork ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of dataGSMRNetwork is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "dataGSMRNetwork: The VehicleType {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/gsmr-networks/GSMRNetworks>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:dataGSMRNetwork AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:dataGSMRNetwork ?concept .
            era:dataGSMRNetwork era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh:DesignMassExceptionalPayload .
era-sh:DesignMassExceptionalPayload a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:designMassExceptionalPayload ;
    rdfs:comment "Validation for designMassExceptionalPayload property."@en ;
    sh:datatype xsd:integer ;
    sh:message "The designMassExceptionalPayload value must be an integer."@en ;
    sh:path era:designMassExceptionalPayload ;
    era:eratvIndex "4.5.2.3" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:DesignMassNormalPayload .
era-sh:DesignMassNormalPayload a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:designMassNormalPayload ;
    rdfs:comment "Validation for designMassNormalPayload property."@en ;
    sh:datatype xsd:integer ;
    sh:message "The designMassNormalPayload value must be an integer."@en ;
    sh:path era:designMassNormalPayload ;
    era:eratvIndex "4.5.2.2" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:DesignMassWorkingOrder .
era-sh:DesignMassWorkingOrder a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:designMassWorkingOrder ;
    rdfs:comment "Validation for designMassWorkingOrder property."@en ;
    sh:datatype xsd:integer ;
    sh:message "The designMassWorkingOrder value must be an integer."@en ;
    sh:path era:designMassWorkingOrder ;
    era:eratvIndex "4.5.2.1" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:DrivingCabs .
era-sh:DrivingCabs a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:drivingCabs ;
    rdfs:comment "Validation for drivingCabs property."@en ;
    sh:datatype xsd:integer ;
    sh:in ( 0 1 2 ) ;
    sh:message "The drivingCabs value must be 0, 1, or 2."@en ;
    sh:path era:drivingCabs ;
    era:eratvIndex "4.1.1" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:HasEddyCurrentBrakePrevention .
era-sh:HasEddyCurrentBrakePrevention a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:hasEddyCurrentBrakePrevention ;
    rdfs:comment "Validation for hasEddyCurrentBrakePrevention property."@en ;
    sh:datatype xsd:boolean ;
    sh:message "The hasEddyCurrentBrakePrevention value must be a boolean (true/false)."@en ;
    sh:path era:hasEddyCurrentBrakePrevention ;
    era:eratvIndex "4.7.4.1.2" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:HasEddyCurrentBrake .
era-sh:HasEddyCurrentBrake a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:hasEddyCurrentBrake ;
    rdfs:comment "Validation for hasEddyCurrentBrake property."@en ;
    sh:datatype xsd:boolean ;
    sh:message "The hasEddyCurrentBrake value must be a boolean (true/false)."@en ;
    sh:path era:hasEddyCurrentBrake ;
    era:eratvIndex "4.7.4.1.1" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:EndCouplingType .
era-sh:EndCouplingType a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:endCouplingType ;
    rdfs:comment "Validation for endCouplingType property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:endCouplingType ;
    sh:message "era:endCouplingType: its value must be an IRI."@en ;
    era:eratvIndex "4.9.1" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:sparql era-sh:EndCouplingTypeSKOS .
era-sh:EndCouplingTypeSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:endCouplingType ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of endCouplingType is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "endCouplingType: The VehicleType {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/end-coupling-type/EndCouplingType>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:endCouplingType AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:endCouplingType ?concept .
            era:endCouplingType era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh:EtcsDataCommApp .
era-sh:EtcsDataCommApp a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:etcsDataCommApp ;
    rdfs:comment "Validation for etcsDataCommApp property."@en ;
    sh:datatype xsd:string ;
    sh:message "The etcsDataCommApp value must be a character string."@en ;
    sh:path era:etcsDataCommApp ;
    era:eratvIndex "4.13.2.9" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:EtcsNationalApplications .
era-sh:EtcsNationalApplications a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:etcsNationalApplications ;
    rdfs:comment "Validation for etcsNationalApplications property."@en ;
    sh:datatype xsd:string ;
    sh:message "The etcsNationalApplications value must be a character string."@en ;
    sh:path era:etcsNationalApplications ;
    era:eratvIndex "4.13.1.4" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:EtcsOnBoardImplementation .
era-sh:EtcsOnBoardImplementation a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:etcsOnBoardImplementation ;
    rdfs:comment "Validation for etcsOnBoardImplementation property."@en ;
    sh:datatype xsd:string ;
    sh:message "The etcsOnBoardImplementation value must be a character string."@en ;
    sh:path era:etcsOnBoardImplementation ;
    era:eratvIndex "4.13.1.7" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:EtcsOnboardSystemVersions .
era-sh:EtcsOnboardSystemVersions a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:etcsOnboardSystemVersions ;
    rdfs:comment "Validation for etcsOnboardSystemVersions property."@en ;
    sh:nodeKind sh:IRI ;
    sh:maxCount 1 ;
    sh:path era:etcsOnboardSystemVersions ;
    sh:message "era:etcsOnboardSystemVersions: its value must be an IRI."@en ;
    era:eratvIndex "4.13.1.11" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:sparql era-sh:EtcsOnboardSystemVersionsSKOS .
era-sh:EtcsOnboardSystemVersionsSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsOnboardSystemVersions ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of etcsOnboardSystemVersions is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "etcsOnboardSystemVersions: The VehicleType {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/etcs-m-versions/ETCSMVersions>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:etcsOnboardSystemVersions AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:etcsOnboardSystemVersions ?concept .
            era:etcsOnboardSystemVersions era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh:HasFerromagneticWheelMaterial .
era-sh:HasFerromagneticWheelMaterial a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:hasFerromagneticWheelMaterial ;
    rdfs:comment "Validation for hasFerromagneticWheelMaterial property."@en ;
    sh:datatype xsd:boolean ;
    sh:message "The hasFerromagneticWheelMaterial value must be a boolean (true/false)."@en ;
    sh:path era:hasFerromagneticWheelMaterial ;
    era:eratvIndex "4.14.2.12" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:FireSafetyCategory .
era-sh:FireSafetyCategory a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:fireSafetyCategory ;
    rdfs:comment "Validation for fireSafetyCategory property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:fireSafetyCategory ;
    sh:message "era:fireSafetyCategory: its value must be an IRI."@en ;
    era:eratvIndex "4.4.1" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:sparql era-sh:FireSafetyCategorySKOS .
era-sh:FireSafetyCategorySKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:fireSafetyCategory ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of fireSafetyCategory is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "fireSafetyCategory: The VehicleType {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/rolling-stock-fire/Categories>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:fireSafetyCategory AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:fireSafetyCategory ?concept .
            era:fireSafetyCategory era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh:FixedSeats .
era-sh:FixedSeats a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:fixedSeats ;
    rdfs:comment "Validation for fixedSeats property."@en ;
    sh:datatype xsd:string ;
    sh:message "The fixedSeats value must be a character string."@en ;
    sh:path era:fixedSeats ;
    era:eratvIndex "4.12.1.1" ;
    sh:severity sh:Violation .


era-sh:VehicleTypeShape sh:property era-sh:GsmRRadioDataCommunication .
era-sh:GsmRRadioDataCommunication a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:gsmRRadioDataCommunication ;
    rdfs:comment "Validation for gsmRRadioDataCommunication property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:gsmRRadioDataCommunication ;
    sh:message "era:gsmRRadioDataCommunication: its value must be an IRI."@en ;
    era:eratvIndex "4.13.2.7" ;
    sh:severity sh:Violation .

### SKOS SPARQLConstraint for gsmRRadioDataCommunication
era-sh:VehicleTypeShape sh:sparql era-sh:GsmRRadioDataCommunicationSKOS .
era-sh:GsmRRadioDataCommunicationSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:gsmRRadioDataCommunication ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of gsmRRadioDataCommunication is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "gsmRRadioDataCommunication: The VehicleType {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/gsm-r-radio-data-communication/GSMRRadioDataCommunications>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:gsmRRadioDataCommunication AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:gsmRRadioDataCommunication ?concept .
            era:gsmRRadioDataCommunication era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh:GsmRSetsInDrivingCab .
era-sh:GsmRSetsInDrivingCab a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:gsmRSetsInDrivingCab ;
    rdfs:comment "Validation for gsmRSetsInDrivingCab property."@en ;
    sh:datatype xsd:integer ;
    sh:in (0 1 2 3) ;
    sh:message "The gsmRSetsInDrivingCab value must be 0, 1, 2 or 3."@en ;
    sh:path era:gsmRSetsInDrivingCab ;
    era:eratvIndex "4.13.2.2" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:HasCantDeficiencyCompensation .
era-sh:HasCantDeficiencyCompensation a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:hasCantDeficiencyCompensation ;
    rdfs:comment "Validation for hasCantDeficiencyCompensation property."@en ;
    sh:datatype xsd:boolean ;
    sh:message "The hasCantDeficiencyCompensation value must be a boolean (true/false)."@en ;
    sh:path era:hasCantDeficiencyCompensation ;
    era:eratvIndex "4.6.2" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:HasLubricationDevicePrevention .
era-sh:HasLubricationDevicePrevention a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:hasLubricationDevicePrevention ;
    rdfs:comment "Validation for hasLubricationDevicePrevention property."@en ;
    sh:datatype xsd:boolean ;
    sh:message "The hasLubricationDevicePrevention value must be a boolean (true/false)."@en ;
    sh:path era:hasLubricationDevicePrevention ;
    era:eratvIndex "4.9.3.2" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:HasOnboardDerailmentFunction .
era-sh:HasOnboardDerailmentFunction a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:hasOnboardDerailmentFunction ;
    rdfs:comment "Validation for hasOnboardDerailmentFunction property."@en ;
    sh:datatype xsd:boolean ;
    sh:message "The hasOnboardDerailmentFunction value must be a boolean (true/false)."@en ;
    sh:path era:hasOnboardDerailmentFunction ;
    era:eratvIndex "4.15.2" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:HasRegenerativeBrake .
era-sh:HasRegenerativeBrake a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:hasRegenerativeBrake ;
    rdfs:comment "Validation for hasRegenerativeBrake property."@en ;
    sh:datatype xsd:boolean ;
    sh:message "The hasRegenerativeBrake value must be a boolean (true/false)."@en ;
    sh:path era:hasRegenerativeBrake ;
    era:eratvIndex "4.7.4.3.1" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:HasSandingPrevention .
era-sh:HasSandingPrevention a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:hasSandingPrevention ;
    rdfs:comment "Validation for hasSandingPrevention property."@en ;
    sh:datatype xsd:boolean ;
    sh:message "The hasSandingPrevention value must be a boolean (true/false)."@en ;
    sh:path era:hasSandingPrevention ;
    era:eratvIndex "4.14.2.14" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:HasShuntingRestrictions .
era-sh:HasShuntingRestrictions a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:hasShuntingRestrictions ;
    rdfs:comment "Validation for hasShuntingRestrictions property."@en ;
    sh:datatype xsd:boolean ;
    sh:message "The hasShuntingRestrictions value must be a boolean (true/false)."@en ;
    sh:path era:hasShuntingRestrictions ;
    era:eratvIndex "4.8.3" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:HasSignalProcessingDerailmentFunction .
era-sh:HasSignalProcessingDerailmentFunction a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:hasSignalProcessingDerailmentFunction ;
    rdfs:comment "Validation for hasSignalProcessingDerailmentFunction property."@en ;
    sh:datatype xsd:boolean ;
    sh:message "The hasSignalProcessingDerailmentFunction value must be a boolean (true/false)."@en ;
    sh:path era:hasSignalProcessingDerailmentFunction ;
    era:eratvIndex "4.15.3" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:HasTrainIntegrityConfirmation .
era-sh:HasTrainIntegrityConfirmation a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:hasTrainIntegrityConfirmation ;
    rdfs:comment "Validation for hasTrainIntegrityConfirmation property."@en ;
    sh:datatype xsd:boolean ;
    sh:message "The hasTrainIntegrityConfirmation value must be a boolean (true/false)."@en ;
    sh:path era:hasTrainIntegrityConfirmation ;
    era:eratvIndex "4.13.1.9" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:IncludedVersionsVariant .
era-sh:IncludedVersionsVariant a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:includedVersionsVariant ;
    rdfs:comment "Validation for includedVersionsVariant property."@en ;
    sh:datatype xsd:string ;
    sh:pattern "^[a-zA-Z0-9]{3}(-[a-zA-Z0-9]{3})?$" ;
    sh:message "The includedVersionsVariant value must be exactly three alphanumeric characters (e.g., 'A1B', 'XYZ', '012')."@en ;
    sh:path era:includedVersionsVariant ;
    era:eratvIndex "0.2" ;
    era:eratvIndex "0.4" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:LengthOfVehicle .
era-sh:LengthOfVehicle a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:lengthOfVehicle ;
    rdfs:comment "Validation for lengthOfVehicle property."@en ;
    sh:datatype xsd:decimal ;
    sh:maxCount 1 ;
    sh:message "The lengthOfVehicle value must be a decimal."@en ;
    sh:path era:lengthOfVehicle ;
    era:eratvIndex "4.8.1" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:LoadingPlatformHeight .
era-sh:LoadingPlatformHeight a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:loadingPlatformHeight ;
    rdfs:comment "Validation for loadingPlatformHeight property."@en ;
    sh:datatype xsd:integer ;
    sh:message "The loadingPlatformHeight value must be an integer."@en ;
    sh:path era:loadingPlatformHeight ;
    era:eratvIndex "4.8.7" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:HasMagneticBrakePrevention .
era-sh:HasMagneticBrakePrevention a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:hasMagneticBrakePrevention ;
    rdfs:comment "Validation for hasMagneticBrakePrevention property."@en ;
    sh:datatype xsd:boolean ;
    sh:message "The hasMagneticBrakePrevention value must be a boolean (true/false)."@en ;
    sh:path era:hasMagneticBrakePrevention ;
    era:eratvIndex "4.7.4.2.2" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:HasMagneticBrake .
era-sh:HasMagneticBrake a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:hasMagneticBrake ;
    rdfs:comment "Validation for hasMagneticBrake property."@en ;
    sh:datatype xsd:boolean ;
    sh:message "The hasMagneticBrake value must be a boolean (true/false)."@en ;
    sh:path era:hasMagneticBrake ;
    era:eratvIndex "4.7.4.2.1" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:MaxDistConsecutiveAxle .
era-sh:MaxDistConsecutiveAxle a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:maxDistConsecutiveAxle ;
    rdfs:comment "Validation for maxDistConsecutiveAxle property."@en ;
    sh:datatype xsd:integer ;
    sh:message "The maxDistConsecutiveAxle value must be an integer."@en ;
    sh:path era:maxDistConsecutiveAxle ;
    era:eratvIndex "4.14.2.1" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:MaxFlangeHeight .
era-sh:MaxFlangeHeight a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:maxFlangeHeight ;
    rdfs:comment "Validation for maxFlangeHeight property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The maxFlangeHeight value must be a decimal."@en ;
    sh:path era:maxFlangeHeight ;
    era:eratvIndex "4.14.2.9" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:MaxLengthVehicleNose .
era-sh:MaxLengthVehicleNose a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:maxLengthVehicleNose ;
    rdfs:comment "Validation for maxLengthVehicleNose property."@en ;
    sh:datatype xsd:integer ;
    sh:message "The maxLengthVehicleNose value must be an integer."@en ;
    sh:path era:maxLengthVehicleNose ;
    era:eratvIndex "4.14.2.4" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:MaximumAverageDeceleration .
era-sh:MaximumAverageDeceleration a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:maximumAverageDeceleration ;
    rdfs:comment "Validation for maximumAverageDeceleration property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The maximumAverageDeceleration value must be a decimal."@en ;
    sh:path era:maximumAverageDeceleration ;
    era:eratvIndex "4.7.1" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:MinDistConsecutiveAxle .
era-sh:MinDistConsecutiveAxle a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:minDistConsecutiveAxle ;
    rdfs:comment "Validation for minDistConsecutiveAxle property."@en ;
    sh:datatype xsd:integer ;
    sh:message "The minDistConsecutiveAxle value must be an integer."@en ;
    sh:path era:minDistConsecutiveAxle ;
    era:eratvIndex "4.14.2.2" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:MinDistFirstLastAxle .
era-sh:MinDistFirstLastAxle a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:minDistFirstLastAxle ;
    rdfs:comment "Validation for minDistFirstLastAxle property."@en ;
    sh:datatype xsd:integer ;
    sh:message "The minDistFirstLastAxle value must be an integer."@en ;
    sh:path era:minDistFirstLastAxle ;
    era:eratvIndex "4.14.2.3" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:MinFlangeHeight .
era-sh:MinFlangeHeight a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:minFlangeHeight ;
    rdfs:comment "Validation for minFlangeHeight property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The minFlangeHeight value must be a decimal."@en ;
    sh:path era:minFlangeHeight ;
    era:eratvIndex "4.14.2.8" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:MinFlangeThickness .
era-sh:MinFlangeThickness a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:minFlangeThickness ;
    rdfs:comment "Validation for minFlangeThickness property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The minFlangeThickness value must be a decimal."@en ;
    sh:path era:minFlangeThickness ;
    era:eratvIndex "4.14.2.7" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:MinRimWidth .
era-sh:MinRimWidth a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:minRimWidth ;
    rdfs:comment "Validation for minRimWidth property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The minRimWidth value must be a decimal."@en ;
    sh:path era:minRimWidth ;
    era:eratvIndex "4.14.2.5" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:MinWheelDiameter .
era-sh:MinWheelDiameter a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:minWheelDiameter ;
    rdfs:comment "Validation for minWheelDiameter property."@en ;
    sh:datatype xsd:integer ;
    sh:message "The minWheelDiameter value must be an integer."@en ;
    sh:path era:minWheelDiameter ;
    era:eratvIndex "4.14.2.6" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:MinimumConcaveVerticalRadius .
era-sh:MinimumConcaveVerticalRadius a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:minimumConcaveVerticalRadius ;
    rdfs:comment "Validation for minimumConcaveVerticalRadius property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The minimumConcaveVerticalRadius value must be a decimal."@en ;
    sh:path era:minimumConcaveVerticalRadius ;
    era:eratvIndex "4.8.6" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:MinimumConvexVerticalRadius .
era-sh:MinimumConvexVerticalRadius a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:minimumConvexVerticalRadius ;
    rdfs:comment "Validation for minimumConvexVerticalRadius property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The minimumConvexVerticalRadius value must be a decimal."@en ;
    sh:path era:minimumConvexVerticalRadius ;
    era:eratvIndex "4.8.5" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:NumberOfToilet .
era-sh:NumberOfToilet a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:numberOfToilet ;
    rdfs:comment "Validation for numberOfToilet property."@en ;
    sh:datatype xsd:integer ;
    sh:message "The numberOfToilet value must be an integer."@en ;
    sh:path era:numberOfToilet ;
    era:eratvIndex "4.12.1.2" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:OperationalMassNormalPayload .
era-sh:OperationalMassNormalPayload a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:operationalMassNormalPayload ;
    rdfs:comment "Validation for operationalMassNormalPayload property."@en ;
    sh:datatype xsd:integer ;
    sh:message "The operationalMassNormalPayload value must be an integer."@en ;
    sh:path era:operationalMassNormalPayload ;
    era:eratvIndex "4.5.2.5" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:OperationalMassWorkingOrder .
era-sh:OperationalMassWorkingOrder a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:operationalMassWorkingOrder ;
    rdfs:comment "Validation for operationalMassWorkingOrder property."@en ;
    sh:datatype xsd:integer ;
    sh:message "The operationalMassWorkingOrder value must be an integer."@en ;
    sh:path era:operationalMassWorkingOrder ;
    era:eratvIndex "4.5.2.4" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:HasMandatoryParkingBrake .
era-sh:HasMandatoryParkingBrake a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:hasMandatoryParkingBrake ;
    rdfs:comment "Validation for hasMandatoryParkingBrake property."@en ;
    sh:datatype xsd:boolean ;
    sh:message "The hasMandatoryParkingBrake value must be a boolean (true/false)."@en ;
    sh:path era:hasMandatoryParkingBrake ;
    era:eratvIndex "4.7.3" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:ParkingBrakeMaximumGradient .
era-sh:ParkingBrakeMaximumGradient a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:parkingBrakeMaximumGradient ;
    rdfs:comment "Validation for parkingBrakeMaximumGradient property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The parkingBrakeMaximumGradient value must be a decimal."@en ;
    sh:path era:parkingBrakeMaximumGradient ;
    era:eratvIndex "4.7.3" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:PassByNoiseLevel .
era-sh:PassByNoiseLevel a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:passByNoiseLevel ;
    rdfs:comment "Validation for passByNoiseLevel property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The passByNoiseLevel value must be a decimal."@en ;
    sh:path era:passByNoiseLevel ;
    era:eratvIndex "4.11.1" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:PermissiblePayloadForLineCategory .
era-sh:PermissiblePayloadForLineCategory a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:permissiblePayloadForLineCategory ;
    rdfs:comment "Validation for permissiblePayloadForLineCategory property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:permissiblePayloadForLineCategory ;
    sh:message "era:permissiblePayloadForLineCategory: its value must be an IRI pointing to a PermissiblePayload."@en ;
    sh:class era:PermissiblePayload ;
    era:eratvIndex "4.5.1" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:PortableBoardingAids .
era-sh:PortableBoardingAids a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:portableBoardingAids ;
    rdfs:comment "Validation for portableBoardingAids property."@en ;
    sh:datatype xsd:string ;
    sh:message "The portableBoardingAids value must be a character string."@en ;
    sh:path era:portableBoardingAids ;
    era:eratvIndex "4.12.3.2" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:HasRegenerativeBrakePrevention .
era-sh:HasRegenerativeBrakePrevention a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:hasRegenerativeBrakePrevention ;
    rdfs:comment "Validation for hasRegenerativeBrakePrevention property."@en ;
    sh:datatype xsd:boolean ;
    sh:message "The hasRegenerativeBrakePrevention value must be a boolean (true/false)."@en ;
    sh:path era:hasRegenerativeBrakePrevention ;
    era:eratvIndex "4.7.4.3.2" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:PreviousVehicleType .
era-sh:PreviousVehicleType a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:previousVehicleType ;
    rdfs:comment "Validation for previousVehicleType property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:previousVehicleType ;
    sh:message "era:previousVehicleType: its value must be an IRI pointing to a VehicleType."@en ;
    sh:class era:VehicleType ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:PrioritySeat .
era-sh:PrioritySeat a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:prioritySeat ;
    rdfs:comment "Validation for prioritySeat property."@en ;
    sh:datatype xsd:string ;
    sh:message "The prioritySeat value must be a character string."@en ;
    sh:path era:prioritySeat ;
    era:eratvIndex "4.12.2.1" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:PrmAccessibleToilet .
era-sh:PrmAccessibleToilet a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:prmAccessibleToilet ;
    rdfs:comment "Validation for prmAccessibleToilet property."@en ;
    sh:datatype xsd:integer ;
    sh:message "The prmAccessibleToilet value must be an integer."@en ;
    sh:path era:prmAccessibleToilet ;
    era:eratvIndex "4.12.2.3" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:RadioSwitchOverSpecialCondition .
era-sh:RadioSwitchOverSpecialCondition a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:radioSwitchOverSpecialCondition ;
    rdfs:comment "Validation for radioSwitchOverSpecialCondition property."@en ;
    sh:datatype xsd:string ;
    sh:message "The radioSwitchOverSpecialCondition value must be a character string."@en ;
    sh:path era:radioSwitchOverSpecialCondition ;
    era:eratvIndex "4.13.2.4" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:IsPassByNoiseMeasuredUnderReferenceConditions .
era-sh:IsPassByNoiseMeasuredUnderReferenceConditions a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:isPassByNoiseMeasuredUnderReferenceConditions ;
    rdfs:comment "Validation for isPassByNoiseMeasuredUnderReferenceConditions property."@en ;
    sh:datatype xsd:boolean ;
    sh:message "The isPassByNoiseMeasuredUnderReferenceConditions value must be a boolean (true/false)."@en ;
    sh:path era:isPassByNoiseMeasuredUnderReferenceConditions ;
    era:eratvIndex "4.11.1" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:SleepingPlace .
era-sh:SleepingPlace a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:sleepingPlace ;
    rdfs:comment "Validation for sleepingPlace property."@en ;
    sh:datatype xsd:string ;
    sh:message "The sleepingPlace value must be a character string."@en ;
    sh:path era:sleepingPlace ;
    era:eratvIndex "4.12.1.3" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:SnowIceHailConditions .
era-sh:SnowIceHailConditions a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:snowIceHailConditions ;
    rdfs:comment "Validation for snowIceHailConditions property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:snowIceHailConditions ;
    sh:message "era:snowIceHailConditions: its value must be an IRI."@en ;
    era:eratvIndex "4.3.3" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:sparql era-sh:SnowIceHailConditionsSKOS .
era-sh:SnowIceHailConditionsSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:snowIceHailConditions ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of snowIceHailConditions is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "snowIceHailConditions: The VehicleType {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/ice-conditions/IceConditions>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:snowIceHailConditions AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:snowIceHailConditions ?concept .
            era:snowIceHailConditions era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh:StartingNoiseLevel .
era-sh:StartingNoiseLevel a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:startingNoiseLevel ;
    rdfs:comment "Validation for startingNoiseLevel property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The startingNoiseLevel value must be a decimal."@en ;
    sh:path era:startingNoiseLevel ;
    era:eratvIndex "4.11.4" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:StaticAxleLoadExceptionalPayload .
era-sh:StaticAxleLoadExceptionalPayload a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:staticAxleLoadExceptionalPayload ;
    rdfs:comment "Validation for staticAxleLoadExceptionalPayload property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The staticAxleLoadExceptionalPayload value must be a decimal."@en ;
    sh:path era:staticAxleLoadExceptionalPayload ;
    era:eratvIndex "4.5.3.3" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:StaticAxleLoadNormalPayload .
era-sh:StaticAxleLoadNormalPayload a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:staticAxleLoadNormalPayload ;
    rdfs:comment "Validation for staticAxleLoadNormalPayload property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The staticAxleLoadNormalPayload value must be a decimal."@en ;
    sh:path era:staticAxleLoadNormalPayload ;
    era:eratvIndex "4.5.3.2" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:StaticAxleLoadWorkingOrder .
era-sh:StaticAxleLoadWorkingOrder a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:staticAxleLoadWorkingOrder ;
    rdfs:comment "Validation for staticAxleLoadWorkingOrder property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The staticAxleLoadWorkingOrder value must be a decimal."@en ;
    sh:path era:staticAxleLoadWorkingOrder ;
    era:eratvIndex "4.5.3.1" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:StationaryNoiseLevel .
era-sh:StationaryNoiseLevel a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:stationaryNoiseLevel ;
    rdfs:comment "Validation for stationaryNoiseLevel property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The stationaryNoiseLevel value must be a decimal."@en ;
    sh:path era:stationaryNoiseLevel ;
    era:eratvIndex "4.11.3" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:SupportedPlatformHeight .
era-sh:SupportedPlatformHeight a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:supportedPlatformHeight ;
    rdfs:comment "Validation for supportedPlatformHeight property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:supportedPlatformHeight ;
    sh:message "era:supportedPlatformHeight: its value must be an IRI."@en ;
    era:eratvIndex "4.12.3.1" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:sparql era-sh:SupportedPlatformHeightSKOS .
era-sh:SupportedPlatformHeightSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:supportedPlatformHeight ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of supportedPlatformHeight is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "supportedPlatformHeight: The VehicleType {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/platform-heights/PlatformHeights>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:supportedPlatformHeight AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:supportedPlatformHeight ?concept .
            era:supportedPlatformHeight era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh:ThermalCapacityDistance .
era-sh:ThermalCapacityDistance a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:thermalCapacityDistance ;
    rdfs:comment "Validation for thermalCapacityDistance property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The thermalCapacityDistance value must be a decimal."@en ;
    sh:path era:thermalCapacityDistance ;
    era:eratvIndex "4.7.2.1.4" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:ThermalCapacityGradient .
era-sh:ThermalCapacityGradient a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:thermalCapacityGradient ;
    rdfs:comment "Validation for thermalCapacityGradient property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The thermalCapacityGradient value must be a decimal."@en ;
    sh:path era:thermalCapacityGradient ;
    era:eratvIndex "4.7.2.1.3" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:ThermalCapacitySpeed .
era-sh:ThermalCapacitySpeed a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:thermalCapacitySpeed ;
    rdfs:comment "Validation for thermalCapacitySpeed property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The thermalCapacitySpeed value must be a decimal."@en ;
    sh:path era:thermalCapacitySpeed ;
    era:eratvIndex "4.7.2.1.2" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:ThermalCapacityTSIReference .
era-sh:ThermalCapacityTSIReference a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:thermalCapacityTSIReference ;
    rdfs:comment "Validation for thermalCapacityTSIReference property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:thermalCapacityTSIReference ;
    sh:message "era:thermalCapacityTSIReference: its value must be an IRI."@en ;
    era:eratvIndex "4.7.2.1.1" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:sparql era-sh:ThermalCapacityTSIReferenceSKOS .
era-sh:ThermalCapacityTSIReferenceSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:thermalCapacityTSIReference ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of thermalCapacityTSIReference is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "thermalCapacityTSIReference: The VehicleType {$this} with label {?label} has a value {?value} is not one of the predefined values and cannot be converted into a SKOS concept on this list:<http://data.europa.eu/949/concepts/thermal-capacity/ThermalCapacityTSIReferences>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:thermalCapacityTSIReference AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:thermalCapacityTSIReference ?concept .
            era:thermalCapacityTSIReference era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh:ThermalCapacityTime .
era-sh:ThermalCapacityTime a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:thermalCapacityTime ;
    rdfs:comment "Validation for thermalCapacityTime property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The thermalCapacityTime value must be a decimal."@en ;
    sh:path era:thermalCapacityTime ;
    era:eratvIndex "4.7.2.1.5" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:IsTransportableOnFerry .
era-sh:IsTransportableOnFerry a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:isTransportableOnFerry ;
    rdfs:comment "Validation for isTransportableOnFerry property."@en ;
    sh:datatype xsd:boolean ;
    sh:message "The isTransportableOnFerry value must be a boolean (true/false)."@en ;
    sh:path era:isTransportableOnFerry ;
    era:eratvIndex "4.8.8" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:TypeVersionId .
era-sh:TypeVersionId a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:typeVersionId ;
    rdfs:comment "Validation for typeVersionId property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:typeVersionId ;
    sh:message "era:typeVersionId: its value must be an IRI."@en ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:sparql era-sh:TypeVersionIdSKOS .
era-sh:TypeVersionIdSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:typeVersionId ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of typeVersionId is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "typeVersionId: The VehicleType {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/type-version-ids/TypeVersionIds>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:typeVersionId AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:typeVersionId ?concept .
            era:typeVersionId era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh:VehicleMaxSandingOutput .
era-sh:VehicleMaxSandingOutput a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:vehicleMaxSandingOutput ;
    rdfs:comment "Validation for vehicleMaxSandingOutput property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The vehicleMaxSandingOutput value must be a decimal indicating the grams per second value. If you provide value as a string in the format '[1st decimal] g per [2nd decimal] s' the 2nd decimal needs to be different than 0."@en ;
    sh:path era:vehicleMaxSandingOutput ;
    era:eratvIndex "4.14.2.13" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:VehicleTypeCategory .
era-sh:VehicleTypeCategory a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:vehicleTypeCategory ;
    rdfs:comment "Validation for vehicleTypeCategory property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:vehicleTypeCategory ;
    sh:message "era:vehicleTypeCategory: its value must be an IRI."@en ;
    era:eratvIndex "1.4" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:sparql era-sh:VehicleTypeCategorySKOS .
era-sh:VehicleTypeCategorySKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:vehicleTypeCategory ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of vehicleTypeCategory is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "vehicleTypeCategory: The VehicleType {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/vehicle-types/Categories>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:vehicleTypeCategory AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:vehicleTypeCategory ?concept .
            era:vehicleTypeCategory era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh:VehicleTypeManufacturer .
era-sh:VehicleTypeManufacturer a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:vehicleTypeManufacturer ;
    rdfs:comment "Validation for vehicleTypeManufacturer property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:vehicleTypeManufacturer ;
    sh:message "era:vehicleTypeManufacturer: its value must be an IRI pointing to an OrganisationRole."@en ;
    sh:class era:OrganisationRole ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:VehicleTypeNumber .
era-sh:VehicleTypeNumber a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:vehicleTypeNumber ;
    rdfs:comment "Validation for vehicleTypeNumber property."@en ;
    sh:datatype xsd:string ;
    sh:pattern "^\\d{2}-?\\d{3}-?\\d{4}-?\\d{1}$" ;
    sh:message "The vehicleTypeNumber value must be exactly 10 digits in the format 'XX-XXX-XXXX-X' (dashes optional)."@en ;
    sh:path era:vehicleTypeNumber ;
    era:eratvIndex "0.1" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:VehicleTypeSubCategory .
era-sh:VehicleTypeSubCategory a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:vehicleTypeSubCategory ;
    rdfs:comment "Validation for vehicleTypeSubCategory property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:vehicleTypeSubCategory ;
    sh:message "era:vehicleTypeSubCategory: its value must be an IRI."@en ;
    era:eratvIndex "1.5" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:sparql era-sh:VehicleTypeSubCategorySKOS .
era-sh:VehicleTypeSubCategorySKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:vehicleTypeSubCategory ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of vehicleTypeSubCategory is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "vehicleTypeSubCategory: The VehicleType/Certificate {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/vehicle-types/SubCategories>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:vehicleTypeSubCategory AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:vehicleTypeSubCategory ?concept .
            era:vehicleTypeSubCategory era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh:VehiclesComposingFixedFormation .
era-sh:VehiclesComposingFixedFormation a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:vehiclesComposingFixedFormation ;
    rdfs:comment "Validation for vehiclesComposingFixedFormation property."@en ;
    sh:datatype xsd:integer ;
    sh:message "The vehiclesComposingFixedFormation value must be an integer."@en ;
    sh:path era:vehiclesComposingFixedFormation ;
    era:eratvIndex "4.1.12" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:VoiceGSMRNetwork .
era-sh:VoiceGSMRNetwork a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:voiceGSMRNetwork ;
    rdfs:comment "Validation for voiceGSMRNetwork property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:voiceGSMRNetwork ;
    sh:message "era:voiceGSMRNetwork: its value must be an IRI."@en ;
    era:eratvIndex "4.13.2.10" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:sparql era-sh:VoiceGSMRNetworkSKOS .
era-sh:VoiceGSMRNetworkSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:voiceGSMRNetwork ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of voiceGSMRNetwork is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "voiceGSMRNetwork: The VehicleType {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/gsmr-networks/GSMRNetworks>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:voiceGSMRNetwork AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:voiceGSMRNetwork ?concept .
            era:voiceGSMRNetwork era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh:VoiceOperationalCommImpl .
era-sh:VoiceOperationalCommImpl a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:voiceOperationalCommImpl ;
    rdfs:comment "Validation for voiceOperationalCommImpl property."@en ;
    sh:datatype xsd:string ;
    sh:message "The voiceOperationalCommImpl value must be a character string."@en ;
    sh:path era:voiceOperationalCommImpl ;
    era:eratvIndex "4.13.2.6" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:WagonDerailmentFunction .
era-sh:WagonDerailmentFunction a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:wagonDerailmentFunction ;
    rdfs:comment "Validation for wagonDerailmentFunction property."@en ;
    sh:nodeKind sh:IRI ;
    sh:maxCount 1 ;
    sh:path era:wagonDerailmentFunction ;
    sh:message "era:wagonDerailmentFunction: its value must be an IRI."@en ;
    era:eratvIndex "4.15.1" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:sparql era-sh:WagonDerailmentFunctionSKOS .
era-sh:WagonDerailmentFunctionSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:wagonDerailmentFunction ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of wagonDerailmentFunction is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "wagonDerailmentFunction: The VehicleType {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/wagon-derailment-function/WagonDerailmentFunction>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:wagonDerailmentFunction AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:wagonDerailmentFunction ?concept .
            era:wagonDerailmentFunction era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh:WheelSetGaugeChangeoverFacility .
era-sh:WheelSetGaugeChangeoverFacility a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:wheelSetGaugeChangeoverFacility ;
    rdfs:comment "Validation for wheelSetGaugeChangeoverFacility property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:wheelSetGaugeChangeoverFacility ;
    sh:message "era:wheelSetGaugeChangeoverFacility: its value must be an IRI."@en ;
    era:eratvIndex "4.1.11" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:sparql era-sh:WheelSetGaugeChangeoverFacilitySKOS .
era-sh:WheelSetGaugeChangeoverFacilitySKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:wheelSetGaugeChangeoverFacility ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of wheelSetGaugeChangeoverFacility is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "wheelSetGaugeChangeoverFacility: The VehicleType {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/gauge-changeover-facilities/GaugeChangeoverFacilities>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:wheelSetGaugeChangeoverFacility AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:wheelSetGaugeChangeoverFacility ?concept .
            era:wheelSetGaugeChangeoverFacility era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh:WheelSetGaugeTransformationMethod .
era-sh:WheelSetGaugeTransformationMethod a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:wheelSetGaugeTransformationMethod ;
    rdfs:comment "Validation for wheelSetGaugeTransformationMethod property."@en ;
    sh:datatype xsd:string ;
    sh:message "The wheelSetGaugeTransformationMethod value must be a character string."@en ;
    sh:path era:wheelSetGaugeTransformationMethod ;
    era:eratvIndex "4.1.3.b" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:WheelchairSleepingPlace .
era-sh:WheelchairSleepingPlace a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:wheelchairSleepingPlace ;
    rdfs:comment "Validation for wheelchairSleepingPlace property."@en ;
    sh:datatype xsd:string ;
    sh:message "The wheelchairSleepingPlace value must be a character string."@en ;
    sh:path era:wheelchairSleepingPlace ;
    era:eratvIndex "4.12.1.3" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:WheelchairSpace .
era-sh:WheelchairSpace a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:wheelchairSpace ;
    rdfs:comment "Validation for wheelchairSpace property."@en ;
    sh:datatype xsd:string ;
    sh:message "The wheelchairSpace value must be a character string."@en ;
    sh:path era:wheelchairSpace ;
    era:eratvIndex "4.12.2.2" ;
    sh:severity sh:Violation .

# TODO homogenise with ERA-RINF-shapes.ttl
era-sh:VehicleTypeShape sh:property era-sh-eratv:MinimumWheelDiameter .
era-sh-eratv:MinimumWheelDiameter a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:minimumWheelDiameter ;
    rdfs:comment "Validation for minimumWheelDiameter property."@en ;
    sh:datatype xsd:integer ;
    sh:maxCount 1 ;
    sh:message "The minimumWheelDiameter value must be an integer."@en ;
    sh:path era:minimumWheelDiameter ;
    era:eratvIndex "4.8.2" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh-eratv:EtcsBaseline .
era-sh-eratv:EtcsBaseline a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:etcsBaseline ;
    rdfs:comment "Validation for etcsBaseline property."@en ;
    sh:nodeKind sh:IRI ;
    sh:maxCount 1 ;
    sh:path era:etcsBaseline ;
    sh:message "era:EtcsBaseline: its value must be an IRI."@en ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:sparql era-sh-eratv:EtcsBaselineSKOS .
era-sh-eratv:EtcsBaselineSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsBaseline ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of etcsBaseline is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "etcsBaseline: The VehicleType {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/etcs-baselines/ETCSBaselines>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:etcsBaseline AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:etcsBaseline ?concept .
            era:etcsBaseline era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .


era-sh:RestrictionShape sh:property era-sh:EtcsEquipmentOnBoardLevel .
era-sh:VehicleTypeShape sh:property era-sh:EtcsEquipmentOnBoardLevel .
era-sh:EtcsEquipmentOnBoardLevel a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:etcsEquipmentOnBoardLevel ;
    rdfs:comment "Validation for etcsEquipmentOnBoardLevel property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:etcsEquipmentOnBoardLevel ;
    sh:message "era:EtcsEquipmentOnBoardLevel: its value must be an IRI."@en ;
    sh:severity sh:Violation .

era-sh:RestrictionShape sh:sparql era-sh:EtcsEquipmentOnBoardLevelSKOS .
era-sh:VehicleTypeShape sh:sparql era-sh:EtcsEquipmentOnBoardLevelSKOS .
era-sh:EtcsEquipmentOnBoardLevelSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsEquipmentOnBoardLevel ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of etcsEquipmentOnBoardLevel is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "etcsEquipmentOnBoardLevel: The VehicleType {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/etcs-equipment-on-board-level/ETCSEquipmentLevels>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:etcsEquipmentOnBoardLevel AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:etcsEquipmentOnBoardLevel ?concept .
            era:etcsEquipmentOnBoardLevel era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh-eratv:AtoCommunicationSystem .
era-sh-eratv:AtoCommunicationSystem a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:atoCommunicationSystem ;
    rdfs:comment "Validation for atoCommunicationSystem property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:atoCommunicationSystem ;
    sh:message "era:atoCommunicationSystem: its value must be an IRI."@en ;
    era:eratvIndex "4.13.2.9" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:sparql era-sh-eratv:AtoCommunicationSystemSKOS .
era-sh-eratv:AtoCommunicationSystemSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:atoCommunicationSystem ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of atoCommunicationSystem is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "atoCommunicationSystem: The VehicleType {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/ato-commsys/ATOCommSystem>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:atoCommunicationSystem AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:atoCommunicationSystem ?concept .
            era:atoCommunicationSystem era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh:MaximumDesignSpeed .
era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:MaximumDesignSpeed .
era-sh:VehicleTypeAuthorisationRestrictionShape sh:property era-sh:MaximumDesignSpeed .
era-sh:MaximumDesignSpeed a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:maximumDesignSpeed ;
    rdfs:comment "Validation for maximumDesignSpeed property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The maximumDesignSpeed value must be an integer."@en ;
    sh:path era:maximumDesignSpeed ;
    era:eratvIndex "4.1.2.1" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh-eratv:DataRadioCompatible .
era-sh-eratv:DataRadioCompatible a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:dataRadioCompatible ;
    rdfs:comment "Validation for dataRadioCompatible property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:dataRadioCompatible ;
    sh:message "era:dataRadioCompatible: its value must be an IRI."@en ;
    era:eratvIndex "4.13.2.8" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:sparql era-sh-eratv:DataRadioCompatibleSKOS .
era-sh-eratv:DataRadioCompatibleSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:dataRadioCompatible ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of dataRadioCompatible is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "dataRadioCompatible: The VehicleType {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/radio-system-compatibilities-data/RadioSystemCompatibilitiesData>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:dataRadioCompatible AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:dataRadioCompatible ?concept .
            era:dataRadioCompatible era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh-eratv:CompatibleWithLineCategory .
era-sh-eratv:CompatibleWithLineCategory a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:compatibleWithLineCategory ;
    rdfs:comment "Validation for compatibleWithLineCategory property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:compatibleWithLineCategory ;
    sh:message "era:compatibleWithLineCategory: its value must be an IRI."@en ;
    era:eratvIndex "4.5.1.1" ;
    sh:severity sh:Violation .


era-sh:VehicleTypeShape sh:sparql era-sh-eratv:CompatibleWithLineCategorySKOS .
era-sh-eratv:CompatibleWithLineCategorySKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:compatibleWithLineCategory ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of compatibleWithLineCategory is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "compatibleWithLineCategory: The VehicleType {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/line-category/LineCategories>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:compatibleWithLineCategory AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:compatibleWithLineCategory ?concept .
            era:compatibleWithLineCategory era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .


era-sh:VehicleTypeShape sh:property era-sh:MinAxleLoad .
era-sh:MinAxleLoad a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:minAxleLoad ;
    rdfs:comment "Validation for minAxleLoad property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The minAxleLoad value must be a decimal."@en ;
    sh:path era:minAxleLoad ;
    era:eratvIndex "4.14.2.10" ;
    sh:severity sh:Violation .

era-sh:RestrictionShape sh:property era-sh-eratv:LegacyRadioSystem .
era-sh:VehicleTypeShape sh:property era-sh-eratv:LegacyRadioSystem .
era-sh-eratv:LegacyRadioSystem a sh:PropertyShape ;
    era:affectedClass era:VehicleType, era:Restriction ;
    era:affectedProperty era:legacyRadioSystem ;
    rdfs:comment "Validation for legacyRadioSystem property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:legacyRadioSystem ;
    sh:message "era:legacyRadioSystem: its value must be an IRI."@en ;
    era:eratvIndex "4.13.2.3" ;
    sh:severity sh:Violation .

era-sh:RestrictionShape sh:sparql era-sh-eratv:LegacyRadioSystemSKOS .
era-sh:VehicleTypeShape sh:sparql era-sh-eratv:LegacyRadioSystemSKOS .
era-sh-eratv:LegacyRadioSystemSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:legacyRadioSystem ;
    era:affectedClass era:VehicleType, era:Restriction ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of legacyRadioSystem is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "legacyRadioSystem: The VehicleType {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/legacy-radio-systems/LegacyRadioSystems>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:legacyRadioSystem AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:legacyRadioSystem ?concept .
            era:legacyRadioSystem era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh-eratv:EtcsInfill .
era-sh-eratv:EtcsInfill a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:etcsInfill ;
    rdfs:comment "Validation for etcsInfill property."@en ;
    sh:nodeKind sh:IRI ;
    sh:maxCount 1 ;
    sh:path era:etcsInfill ;
    sh:message "era:etcsInfill: its value must be an IRI."@en ;
    era:eratvIndex "4.13.1.3" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:sparql era-sh-eratv:EtcsInfillSKOS .
era-sh-eratv:EtcsInfillSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsInfill ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of etcsInfill is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "etcsInfill: The VehicleType {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/etcs-infills/ETCSInfills>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:etcsInfill AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:etcsInfill ?concept .
            era:etcsInfill era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh-eratv:EnergySupplySystem .
era-sh-eratv:EnergySupplySystem a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:energySupplySystem ;
    rdfs:comment "Validation for energySupplySystem property."@en ;
    sh:nodeKind sh:IRI ;
    sh:maxCount 1 ;
    sh:path era:energySupplySystem ;
    sh:message "era:energySupplySystem: its value must be an IRI."@en ;
    era:eratvIndex "4.10.1" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:sparql era-sh-eratv:EnergySupplySystemSKOS .
era-sh-eratv:EnergySupplySystemSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:energySupplySystem ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of energySupplySystem is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "energySupplySystem: The VehicleType {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/energy-supply-systems/EnergySupplySystems>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:energySupplySystem AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:energySupplySystem ?concept .
            era:energySupplySystem era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh:NonCodedRestrictions .
era-sh:RestrictionShape sh:property era-sh:NonCodedRestrictions .
era-sh:NonCodedRestrictions a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:nonCodedRestrictions ;
    rdfs:comment "Validation for nonCodedRestrictions property."@en ;
    sh:datatype xsd:string ;
    sh:message "The nonCodedRestrictions value must be a character string."@en ;
    sh:path era:nonCodedRestrictions ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:TrainControlSwitchOverSpecialCondition .
era-sh:TrainControlSwitchOverSpecialCondition a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:trainControlSwitchOverSpecialCondition ;
    era:eratvIndex "4.13.1.6" ;
    sh:datatype xsd:string ;
    rdfs:comment "Validation for trainControlSwitchOverSpecialCondition property."@en ;
    sh:path era:trainControlSwitchOverSpecialCondition ;
    sh:message "The trainControlSwitchOverSpecialCondition value must be a character string."@en ;
    sh:severity sh:Violation .

era-sh:RestrictionShape sh:property era-sh-eratv:ProtectionLegacySystem .
era-sh:VehicleTypeShape sh:property era-sh-eratv:ProtectionLegacySystem .
era-sh-eratv:ProtectionLegacySystem a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:protectionLegacySystem ;
    rdfs:comment "Validation for protectionLegacySystem property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:protectionLegacySystem ;
    sh:message "era:protectionLegacySystem: its value must be an IRI."@en ;
    era:eratvIndex "4.13.1.5" ;
    sh:severity sh:Violation .

era-sh:RestrictionShape sh:sparql era-sh-eratv:ProtectionLegacySystemSKOS .
era-sh:VehicleTypeShape sh:sparql era-sh-eratv:ProtectionLegacySystemSKOS .
era-sh-eratv:ProtectionLegacySystemSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:protectionLegacySystem ;
    era:affectedClass era:VehicleType, era:Restriction ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of protectionLegacySystem is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "protectionLegacySystem: The VehicleType/Restriction {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/other-protection-control-warning/OtherProtectionControlWarnings>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:protectionLegacySystem AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:protectionLegacySystem ?concept .
            era:protectionLegacySystem era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh:MassPerWheel .
era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:MassPerWheel .
era-sh:MassPerWheel a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:massPerWheel ;
    rdfs:comment "Validation for massPerWheel property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The massPerWheel value must be an decimal."@en ;
    sh:path era:massPerWheel ;
    era:eratvIndex "4.5.6" ;
    sh:severity sh:Violation .

era-sh:RestrictionShape sh:property era-sh-eratv:GaugingProfile .
era-sh:VehicleTypeShape sh:property era-sh-eratv:GaugingProfile .
era-sh-eratv:GaugingProfile a sh:PropertyShape ;
    era:affectedClass era:VehicleType, era:Restriction ;
    era:affectedProperty era:gaugingProfile ;
    rdfs:comment "Validation for gaugingProfile property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:gaugingProfile ;
    sh:message "era:gaugingProfile: its value must be an IRI."@en ;
    era:eratvIndex "4.2.1" ;
    sh:severity sh:Violation .

era-sh:RestrictionShape sh:sparql era-sh-eratv:GaugingProfileSKOS .
era-sh:VehicleTypeShape sh:sparql era-sh-eratv:GaugingProfileSKOS .
era-sh-eratv:GaugingProfileSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:gaugingProfile ;
    era:affectedClass era:VehicleType, era:Restriction ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of gaugingProfile is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "gaugingProfile: The VehicleType/Restriction {$this} with label {?label} has a value {?value} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/gaugings/GaugingProfiles>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this (era:gaugingProfile AS ?path) (?concept AS ?value) ?label
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:gaugingProfile ?concept .
            era:gaugingProfile era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:RestrictionShape sh:property era-sh-eratv:TrainDetectionSystemType .
era-sh:VehicleTypeShape sh:property era-sh-eratv:TrainDetectionSystemType .
era-sh-eratv:TrainDetectionSystemType a sh:PropertyShape ;
    era:affectedClass era:VehicleType, era:Restriction ;
    era:affectedProperty era:trainDetectionSystemType ;
    rdfs:comment "Validation for trainDetectionSystemType property."@en ;
    sh:nodeKind sh:IRI ;
    sh:maxCount 1 ;
    sh:path era:trainDetectionSystemType ;
    sh:message "era:trainDetectionSystemType: its value must be an IRI."@en ;
    era:eratvIndex "4.14.1" ;
    sh:severity sh:Violation .

era-sh:RestrictionShape sh:sparql era-sh-eratv:TrainDetectionSystemTypeSKOS .
era-sh:VehicleTypeShape sh:sparql era-sh-eratv:TrainDetectionSystemTypeSKOS .
era-sh-eratv:TrainDetectionSystemTypeSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:trainDetectionSystemType ;
    era:affectedClass era:VehicleType, era:Restriction ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of trainDetectionSystemType is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "trainDetectionSystemType: The VehicleType/Restriction {$this} with label {?label} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/train-detection/TrainDetectionSystems>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this ?concept ?label (era:trainDetectionSystemType AS ?path)
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:trainDetectionSystemType ?concept .
            era:trainDetectionSystemType era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh-eratv:UsesGroup555 .
era-sh-eratv:UsesGroup555 a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:usesGroup555 ;
    rdfs:comment "Validation for usesGroup555 property."@en ;
    sh:datatype xsd:boolean ;
    sh:message "The usesGroup555 value must be a boolean (true/false)."@en ;
    sh:path era:usesGroup555 ;
    sh:maxCount 1 ;
    era:eratvIndex "4.13.2.12" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh-eratv:TemperatureRange .
era-sh:VehicleTypeAuthorisationRestrictionShape sh:property era-sh-eratv:TemperatureRange .
era-sh-eratv:TemperatureRange a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:temperatureRange ;
    rdfs:comment "Validation for temperatureRange property."@en ;
    sh:nodeKind sh:IRI ;
    sh:maxCount 1 ;
    sh:path era:temperatureRange ;
    sh:message "era:temperatureRange: its value must be an IRI."@en ;
    era:eratvIndex "4.3.1" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:sparql era-sh-eratv:TemperatureRangeSKOS .
era-sh:VehicleTypeAuthorisationRestrictionShape sh:sparql era-sh-eratv:TemperatureRangeSKOS .
era-sh-eratv:TemperatureRangeSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:temperatureRange ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of temperatureRange is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "temperatureRange: The VehicleType {$this} with label {?label} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/temperature-ranges/TemperatureRanges>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this ?concept ?label (era:temperatureRange AS ?path)
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:temperatureRange ?concept .
            era:temperatureRange era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .


era-sh:VehicleTypeShape sh:property era-sh-eratv:EtcsSystemCompatibility .
era-sh-eratv:EtcsSystemCompatibility a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:etcsSystemCompatibility ;
    rdfs:comment "Validation for etcsSystemCompatibility property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:etcsSystemCompatibility ;
    sh:message "era:etcsSystemCompatibility: its value must be an IRI."@en ;
    era:eratvIndex "4.13.1.8" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:sparql era-sh-eratv:EtcsSystemCompatibilitySKOS .
era-sh-eratv:EtcsSystemCompatibilitySKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsSystemCompatibility ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of etcsSystemCompatibility is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "etcsSystemCompatibility: The VehicleType {$this} with label {?label} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/etcs-system-compatibilities/ETCSSystemCompatibilities>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this ?concept ?label (era:etcsSystemCompatibility AS ?path)
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:etcsSystemCompatibility ?concept .
            era:etcsSystemCompatibility era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:AxleSpacingDistance a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:axleSpacingDistance ;
    rdfs:comment "Validation for axleSpacingDistance property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:axleSpacingDistance ;
    sh:message "era:axleSpacingDistance: its value must be an IRI."@en ;
    era:eratvIndex "4.5.3.4" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh-eratv:SafeConsistLengthInformationNecessary .
era-sh-eratv:SafeConsistLengthInformationNecessary a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:safeConsistLengthInformationNecessary ;
    rdfs:comment "Validation for safeConsistLengthInformationNecessary property."@en ;
    sh:nodeKind sh:IRI ;
    sh:maxCount 1 ;
    sh:path era:safeConsistLengthInformationNecessary ;
    sh:message "era:safeConsistLengthInformationNecessary: its value must be an IRI."@en ;
    era:eratvIndex "4.13.1.10" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:sparql era-sh-eratv:SafeConsistLengthInformationNecessarySKOS .
era-sh-eratv:SafeConsistLengthInformationNecessarySKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:safeConsistLengthInformationNecessary ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of safeConsistLengthInformationNecessary is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "safeConsistLengthInformationNecessary: The VehicleType {$this} with label {?label} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/safe-consist-length/SafeConsistLengthNecessary>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this ?concept ?label (era:safeConsistLengthInformationNecessary AS ?path)
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:safeConsistLengthInformationNecessary ?concept .
            era:safeConsistLengthInformationNecessary era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

# TODO homogenise with ERA-RINF-shapes.ttl
era-sh:VehicleTypeShape sh:property era-sh-eratv:MaximumContactWireHeight .
era-sh-eratv:MaximumContactWireHeight a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:maximumContactWireHeight ;
    rdfs:comment "Validation for maximumContactWireHeight property."@en ;
    sh:datatype xsd:double ;
    sh:maxCount 1 ;
    sh:message "The maximumContactWireHeight value must be a decimal."@en ;
    sh:path era:maximumContactWireHeight ;
    era:eratvIndex "4.10.5" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh-eratv:RailInclination .
era-sh:VehicleTypeShape sh:property era-sh-eratv:RailInclination .
era-sh-eratv:RailInclination a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:railInclination ;
    rdfs:comment "Validation for railInclination property."@en ;
    sh:nodeKind sh:IRI ;
    sh:maxCount 1 ;
    sh:path era:railInclination ;
    sh:message "era:railInclination: its value must be an IRI."@en ;
    era:eratvIndex "4.6.5" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeConfigParameterSetShape sh:sparql era-sh-eratv:RailInclinationSKOS .
era-sh:VehicleTypeShape sh:sparql era-sh-eratv:RailInclinationSKOS .
era-sh-eratv:RailInclinationSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:railInclination ;
    era:affectedClass era:VehicleType, era:VehicleTypeConfigParameterSet ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of railInclination is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "railInclination: The VehicleType/VehicleTypeConfigParameterSet {$this} with label {?label} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/rail-inclinations/RailInclinations>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this ?concept ?label (era:railInclination AS ?path)
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:railInclination ?concept .
            era:railInclination era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh-eratv:AtoSystemVersion .
era-sh-eratv:AtoSystemVersion a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:atoSystemVersion ;
    rdfs:comment "Validation for atoSystemVersion property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:atoSystemVersion ;
    sh:message "era:atoSystemVersion: its value must be an IRI."@en ;
    era:eratvIndex "4.13.3.1" ;
    sh:severity sh:Violation .
    
era-sh:VehicleTypeShape sh:sparql era-sh-eratv:AtoSystemVersionSKOS .
era-sh-eratv:AtoSystemVersionSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:atoSystemVersion ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of atoSystemVersion is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "atoSystemVersion: The VehicleType {$this} with label {?label} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/ato-s-versions/ATOSystemVersions>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this ?concept ?label (era:atoSystemVersion AS ?path)
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:atoSystemVersion ?concept .
            era:atoSystemVersion era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .


era-sh:VehicleTypeShape sh:property era-sh-eratv:GsmRVersion .
era-sh-eratv:GsmRVersion a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:gsmRVersion ;
    rdfs:comment "Validation for gsmRVersion property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:gsmRVersion ;
    sh:message "era:gsmRVersion: its value must be an IRI."@en ;
    era:eratvIndex "4.13.2.1" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:sparql era-sh-eratv:GsmRVersionSKOS .
era-sh-eratv:GsmRVersionSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:gsmRVersion ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of gsmRVersion is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "gsmRVersion: The VehicleType {$this} with label {?label} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/gsmr-versions/GSMRVersions>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this ?concept ?label (era:gsmRVersion AS ?path)
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:gsmRVersion ?concept .
            era:gsmRVersion era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh-eratv:MinimumHorizontalRadius .
era-sh:VehicleTypeAuthorisationRestrictionShape sh:property era-sh-eratv:MinimumHorizontalRadius .
era-sh-eratv:MinimumHorizontalRadius a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:minimumHorizontalRadius ;
    rdfs:comment "Validation for minimumHorizontalRadius property."@en ;
     sh:or (
        [ sh:datatype xsd:decimal ]
        [ sh:datatype xsd:integer ]
    ) ;
    sh:message "The minimumHorizontalRadius value must be an integer or a decimal."@en ;
    sh:path era:minimumHorizontalRadius ;
    sh:maxCount 1 ;
    era:eratvIndex "4.8.4" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh-eratv:VoiceRadioCompatible .
era-sh-eratv:VoiceRadioCompatible a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:voiceRadioCompatible ;
    rdfs:comment "Validation for voiceRadioCompatible property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:voiceRadioCompatible ;
    sh:message "era:voiceRadioCompatible: its value must be an IRI."@en ;
    era:eratvIndex "4.13.2.5" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:sparql era-sh-eratv:VoiceRadioCompatibleSKOS .
era-sh-eratv:VoiceRadioCompatibleSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:voiceRadioCompatible ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of voiceRadioCompatible is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "voiceRadioCompatible: The VehicleType {$this} with label {?label} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/radio-system-compatibilities-voice/RadioSystemCompatibilitiesVoice>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this ?concept ?label (era:voiceRadioCompatible AS ?path)
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:voiceRadioCompatible ?concept .
            era:voiceRadioCompatible era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleShape sh:property era-sh:ManufacturingCountry .
era-sh:VehicleTypeShape sh:property era-sh:ManufacturingCountry .
era-sh:ManufacturingCountry a sh:PropertyShape ;
    era:affectedClass era:VehicleType ,
                      era:Vehicle ;
    era:affectedProperty era:manufacturingCountry ;
    rdfs:comment "Validation for manufacturingCountry property."@en ;
    sh:nodeKind sh:IRI ;
    sh:path era:manufacturingCountry ;
    sh:message "era:manufacturingCountry: its value must be an IRI."@en ;
    sh:severity sh:Violation .

era-sh:VehicleShape sh:sparql era-sh:ManufacturingCountrySKOS .
era-sh:VehicleTypeShape sh:sparql era-sh:ManufacturingCountrySKOS .
era-sh:ManufacturingCountrySKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:manufacturingCountry ;
    era:affectedClass era:Vehicle ,
                      era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of manufacturingCountry is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "manufacturingCountry: The Vehicle/VehicleType {$this} with label {?label} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://publications.europa.eu/resource/authority/country>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this ?concept ?label (era:manufacturingCountry AS ?path)
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:manufacturingCountry ?concept .
            era:manufacturingCountry era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:VehicleContactForce .
era-sh:VehicleTypeShape sh:property era-sh:VehicleContactForce .
era-sh:VehicleContactForce a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:vehicleContactForce ;
    rdfs:comment "Validation for vehicleContactForce property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The vehicleContactForce must be a decimal value."@en ;
    sh:path era:vehicleContactForce ;
    era:eratvIndex "4.10.15" ;
    sh:severity sh:Violation .

era-sh:RestrictionShape sh:property era-sh-eratv:WheelSetGauge .
era-sh:VehicleTypeShape sh:property era-sh-eratv:WheelSetGauge .
era-sh-eratv:WheelSetGauge a sh:PropertyShape ;
    era:affectedClass era:VehicleType, era:Restriction ;
    era:affectedProperty era:wheelSetGauge ;
    rdfs:comment "Validation for wheelSetGauge property."@en ;
    sh:nodeKind sh:IRI ;
    sh:maxCount 1 ;
    sh:path era:wheelSetGauge ;
    sh:message "era:wheelSetGauge: its value must be an IRI."@en ;
    era:eratvIndex "4.1.3" ;
    sh:severity sh:Violation .

### SPARQLConstraint for wheelSetGauge SKOS validation
era-sh:RestrictionShape sh:sparql era-sh-eratv:WheelSetGaugeSKOS .
era-sh:VehicleTypeShape sh:sparql era-sh-eratv:WheelSetGaugeSKOS .
era-sh-eratv:WheelSetGaugeSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:wheelSetGauge ;
    era:affectedClass era:VehicleType, era:Restriction ;  
    era:scope "local" ;
    rdfs:comment "Ensures that the value of wheelSetGauge is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "wheelSetGauge: The VehicleType {$this} with label {?label} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/nominal-track-gauges/NominalTrackGauges>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this ?concept ?label (era:wheelSetGauge AS ?path)
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:wheelSetGauge ?concept .
            era:wheelSetGauge era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh:MaximumBrakeThermalEnergyCapacity .
era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:MaximumBrakeThermalEnergyCapacity .
era-sh:MaximumBrakeThermalEnergyCapacity a sh:PropertyShape ;
    era:affectedClass era:VehicleType ;
    era:affectedProperty era:maximumBrakeThermalEnergyCapacity ;
    rdfs:comment "Validation for maximumBrakeThermalEnergyCapacity property."@en ;
    sh:datatype xsd:decimal ;
    sh:message "The maximumBrakeThermalEnergyCapacity value must be a decimal."@en ;
    sh:path era:maximumBrakeThermalEnergyCapacity ;
    era:eratvIndex "4.7.2.1.6" ;
    sh:severity sh:Violation .

era-sh:VehicleTypeShape sh:property era-sh:VehicleCategory .
era-sh:VehicleCategory
    a sh:PropertyShape ;
    era:affectedProperty era:vehicleCategory ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Validation for the vehicleCategory property for VehicleType."@en ;
    sh:path era:vehicleCategory ;
    sh:nodeKind sh:IRI ;
    sh:severity sh:Violation ;
    sh:message "vehicleCategory: The value must be an IRI."@en ;
    era:eratvIndex "1.4" .

### SKOS SPARQLConstraint for era:vehicleCategory
era-sh:VehicleTypeShape sh:sparql era-sh:VehicleCategorySKOS .
era-sh:VehicleCategorySKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:vehicleCategory ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of vehicleCategory is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "vehicleCategory: The VehicleType {$this} with label {?label} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/vehicle-types/Categories>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this ?concept ?label (era:vehicleCategory AS ?path)
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:vehicleCategory ?concept .
            era:vehicleCategory era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:ETCSBaselineCompatibility .
era-sh:VehicleTypeShape sh:property era-sh:ETCSBaselineCompatibility .
era-sh:ETCSBaselineCompatibility
    a sh:PropertyShape ;
    era:affectedProperty era:etcsBaselineCompatibility ;
    era:affectedClass era:VehicleType, era:VehicleTypeConfigParameterSet ;
    era:scope "local" ;
    rdfs:comment "Validation for the etcsBaselineCompatibility property for VehicleType and VehicleTypeConfigParameterSet."@en ;
    sh:path era:etcsBaselineCompatibility ;
    sh:nodeKind sh:IRI ;
    sh:maxCount 1 ;
    sh:severity sh:Violation ;
    sh:message "etcsBaselineCompatibility: The value must be an IRI."@en ;
    era:eratvIndex "4.13.1.2" .

### SKOS SPARQLConstraint for era:etcsBaselineCompatibility
# !!! - There is no available ConceptScheme in the ontology. Update this validation when there is one available. - !!!
era-sh:VehicleTypeConfigParameterSetShape sh:sparql era-sh:ETCSBaselineCompatibilitySKOS .
era-sh:VehicleTypeShape sh:sparql era-sh:ETCSBaselineCompatibilitySKOS .
era-sh:ETCSBaselineCompatibilitySKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsBaselineCompatibility ;
    era:affectedClass era:VehicleType, era:VehicleTypeConfigParameterSet ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of etcsBaselineCompatibility is a valid SKOS concept from the linked concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "etcsBaselineCompatibility: The VehicleType/VehicleTypeConfigParameterSet {$this} with label {?label} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/etcs-baselines/ETCSBaselines>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this ?concept ?label (era:etcsBaselineCompatibility AS ?path)
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:etcsBaselineCompatibility ?concept .
            era:etcsBaselineCompatibility era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

era-sh:VehicleTypeShape sh:property era-sh:AssessedCantDeficiency .
era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:AssessedCantDeficiency .
era-sh:AssessedCantDeficiency
    a sh:PropertyShape ;
    era:affectedProperty era:assessedCantDeficiency ;
    era:affectedClass era:VehicleType, era:VehicleTypeConfigParameterSet ;  
    era:scope "local" ;
    rdfs:comment "Validation for assessedCantDeficiency property. Cant deficiency (maximum uncompensated lateral acceleration) for which the vehicle has been assessed." ;
    sh:path era:assessedCantDeficiency ;
    sh:datatype xsd:integer ;
    sh:severity sh:Violation ;
    sh:message "assessedCantDeficiency: The value must be an integer representing cant deficiency in millimeters."@en ;
    era:eratvIndex "4.6.1" .

era-sh:VehicleTypeShape sh:property era-sh:AxleSpacing .
era-sh:AxleSpacing
    a sh:PropertyShape ;
    era:affectedProperty era:axleSpacing ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Validation for axleSpacing property. Position of the axles along the unit." ;
    sh:path era:axleSpacing ;
    sh:datatype xsd:string ;
    sh:severity sh:Violation ;
    sh:message "axleSpacing: The value must be a string describing the position of axles along the unit."@en ;
    era:eratvIndex "4.5.3.4" .

era-sh:VehicleTypeShape sh:property era-sh:BrakeWeightPercentage .
era-sh:BrakeWeightPercentage
    a sh:PropertyShape ;
    era:affectedProperty era:brakeWeightPercentage ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Validation for brakeWeightPercentage property. Brake weight percentage (lambda) or Braked mass." ;
    sh:path era:brakeWeightPercentage ;
    sh:datatype xsd:string ;
    sh:severity sh:Violation ;
    sh:message "brakeWeightPercentage: The value must be a string."@en ;
    era:eratvIndex "4.7.6" .

era-sh:VehicleTypeShape sh:property era-sh:VehicleContactForceFormula .
era-sh:VehicleTypeConfigParameterSetShape sh:property era-sh:VehicleContactForceFormula .
era-sh:VehicleContactForceFormula
    a sh:PropertyShape ;
    era:affectedProperty era:vehicleContactForceFormula ;
    era:affectedClass era:VehicleType, era:VehicleTypeConfigParameterSet ;
    era:scope "local" ;
    rdfs:comment "Validation for vehicleContactForceFormula property." ;
    sh:path era:vehicleContactForceFormula ;
    sh:datatype xsd:string ;
    sh:maxCount 1 ;
    sh:severity sh:Violation ;
    sh:message "vehicleContactForceFormula: The value must be a string."@en .

era-sh:VehicleTypeShape sh:property era-sh:VehicleTypePlatform .
era-sh:VehicleTypePlatform
    a sh:PropertyShape ;
    era:affectedProperty era:vehicleTypePlatform ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Validation for vehicleTypePlatform property. Platform for which the vehicle type is designed." ;
    sh:path era:vehicleTypePlatform ;
    sh:datatype xsd:string ;
    sh:severity sh:Violation ;
    sh:message "vehicleTypePlatform: The value must be a string."@en ;
    era:eratvIndex "4.1.4" .

# era-sh:MinVehicleImpedanceShape
era-sh:MinVehicleImpedanceShape sh:sparql era-sh:FrequencyResistanceExclusiveToVehicleTypeConfig .
era-sh:FrequencyResistanceExclusiveToVehicleTypeConfig
    a sh:SPARQLConstraint ;
    era:affectedClass era:MinVehicleImpedance ;
    sh:message "The properties minImpedanceFrequency and minImpedanceResistance are only allowed when MinVehicleImpedance is linked from a VehicleTypeConfigParameterSet. This error is due to {$this} having one, some, or all of these 2 properties, but not being connected to a VehicleTypeConfigParameterSet."@en ;
    sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    SELECT $this (?prop AS ?path) WHERE {
      $this ?prop ?value .
      FILTER(?prop IN (era:minImpedanceFrequency, era:minImpedanceResistance))
      FILTER NOT EXISTS {
        ?config a era:VehicleTypeConfigParameterSet ;
                era:minVehicleImpedance $this .
      }
    }
  """ .

# era-sh:MinVehicleImpedanceShape
era-sh:MinVehicleImpedanceShape sh:sparql era-sh:FrequencyResistanceRequired .
era-sh:FrequencyResistanceRequired
    a sh:SPARQLConstraint ;
    era:affectedClass era:MinVehicleImpedance ;
    sh:message "Properties minImpedanceFrequency and minImpedanceResistance are required when MinVehicleImpedance is linked from a VehicleTypeConfigParameterSet. This error is due to {$this} (being connected to {?config}) not having one or both of these 2 properties."@en ;
    sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    SELECT $this ?config (era:minVehicleImpedance AS ?path) WHERE {
      ?config a era:VehicleTypeConfigParameterSet ;
              era:minVehicleImpedance $this .
      FILTER (
        NOT EXISTS { $this era:minImpedanceFrequency ?freq . } ||
        NOT EXISTS { $this era:minImpedanceResistance ?res . }
      )
    }
  """ .


# Frequency applicability
era-sh:MinVehicleImpedanceShape sh:sparql era-sh:MinImpedanceFrequencyApplicability .
era-sh:MinImpedanceFrequencyApplicability
    a sh:SPARQLConstraint ;
    era:affectedProperty era:minImpedanceFrequency ;
    era:affectedClass era:MinVehicleImpedance ;
    era:scope "local" ;
    rdfs:comment "minImpedanceFrequency is applicable when MinVehicleImpedance is used in a VehicleTypeConfigParameterSet."@en ;
    sh:severity sh:Violation ;
    sh:message "The VehicleTypeConfigParameterSet {?config} ({?label}) has a MinVehicleImpedance which makes minImpedanceFrequency applicable. This error is due to {$this} not having a value for such a property"@en ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT DISTINCT $this ?label ?config (era:minImpedanceFrequency AS ?path)
        WHERE {
            ?config a era:VehicleTypeConfigParameterSet ;
                    era:minVehicleImpedance $this .
            FILTER NOT EXISTS { $this era:minImpedanceFrequency ?val . }
            OPTIONAL { ?config rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
        }
    """ .

# Resistance applicability
era-sh:MinVehicleImpedanceShape sh:sparql era-sh:MinImpedanceResistanceApplicability .
era-sh:MinImpedanceResistanceApplicability
    a sh:SPARQLConstraint ;
    era:affectedProperty era:minImpedanceResistance ;
    era:affectedClass era:MinVehicleImpedance ;
    era:scope "local" ;
    rdfs:comment "minImpedanceResistance is applicable when MinVehicleImpedance is used in a VehicleTypeConfigParameterSet."@en ;
    sh:severity sh:Violation ;
    sh:message "The VehicleTypeConfigParameterSet {?config} ({?label}) has a MinVehicleImpedance which makes minImpedanceResistance applicable. This error is due to {$this} not having a value for such a property"@en ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT DISTINCT $this ?label ?config (era:minImpedanceResistance AS ?path)
        WHERE {
            ?config a era:VehicleTypeConfigParameterSet ;
                    era:minVehicleImpedance $this .
            FILTER NOT EXISTS { $this era:minImpedanceResistance ?val . }
            OPTIONAL { ?config rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
        }
    """ .

era-sh:MinVehicleImpedanceShape sh:sparql era-sh:TrainSystemPropsExclusive .
era-sh:TrainSystemPropsExclusive
    a sh:SPARQLConstraint ;
    era:affectedClass era:MinVehicleImpedance ;
    sh:message "The properties minVehicleInputCapacitance, minVehicleInputImpedance, and minVehicleImpedanceVoltages are only allowed when MinVehicleImpedance is linked from a TrainDetectionSystem. This error is due to {$this} having one, some, or all of these 3 properties and not being linked to a TrainDetectionSystem."@en ;
    sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    SELECT $this (?prop AS ?path) WHERE {
      $this ?prop ?value .
      FILTER(?prop IN (era:minVehicleInputCapacitance, era:minVehicleInputImpedance, era:minVehicleImpedanceVoltages))
      FILTER NOT EXISTS {
        ?train a era:TrainDetectionSystem ;
               era:minVehicleImpedance $this .
      }
    }
  """ .

era-sh:MinVehicleImpedanceShape sh:sparql era-sh:TrainSystemPropsRequired .
era-sh:TrainSystemPropsRequired
    a sh:SPARQLConstraint ;
    era:affectedClass era:MinVehicleImpedance ;
    sh:message "The properties minVehicleInputCapacitance, minVehicleInputImpedance, and minVehicleImpedanceVoltages are required when MinVehicleImpedance is linked from a TrainDetectionSystem. This error is due to {$this} (being connected to {?train}) not having one, some, or all of these 3 properties."@en ;
    sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    SELECT $this ?train (era:minVehicleImpedance AS ?path) WHERE {
      ?train a era:TrainDetectionSystem ;
             era:minVehicleImpedance $this .
      FILTER (
        NOT EXISTS { $this era:minVehicleInputCapacitance ?cap . } ||
        NOT EXISTS { $this era:minVehicleInputImpedance ?imp . } ||
        NOT EXISTS { $this era:minVehicleImpedanceVoltages ?volt . }
      )
    }
  """ .

era-sh:VehicleTypeShape sh:property era-sh:DangerousGoodsTankCode .
era-sh:DangerousGoodsTankCode
    a sh:PropertyShape ;
    era:affectedProperty era:dangerousGoodsTankCode ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Validation for dangerousGoodsTankCode property." ;
    sh:path era:dangerousGoodsTankCode ;
    sh:datatype xsd:string ;
    sh:severity sh:Violation ;
    sh:message "dangerousGoodsTankCode (4.1.9): The value must be a string."@en ;
    era:eratvIndex "4.1.9" .

era-sh:VehicleTypeShape sh:property era-sh:LegacyRadioSystemComment .
era-sh:LegacyRadioSystemComment
    a sh:PropertyShape ;
    era:affectedProperty era:legacyRadioSystemComment ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Validation for legacyRadioSystemComment property." ;
    sh:path era:legacyRadioSystemComment ;
    sh:datatype xsd:string ;
    sh:severity sh:Violation ;
    sh:message "legacyRadioSystemComment (4.13.2.3): The value must be a string."@en ;
    era:eratvIndex "4.13.2.3" .

era-sh:VehicleTypeShape sh:property era-sh:ProtectionLegacySystemComment .
era-sh:ProtectionLegacySystemComment
    a sh:PropertyShape ;
    era:affectedProperty era:protectionLegacySystemComment ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Additional comments on Class B / Legacy train protection, control and warning systems installed."@en ;
    sh:path era:protectionLegacySystemComment ;
    sh:nodeKind sh:Literal ;
    sh:datatype xsd:string ;
    sh:severity sh:Violation ;
    sh:message "protectionLegacySystemComment (4.13.1.5): The value must be a string."@en ;
    era:eratvIndex "4.13.1.5" .

era-sh:VehicleTypeShape sh:property era-sh:TypeVersionNumber .
era-sh:TypeVersionNumber
    a sh:PropertyShape ;
    era:affectedProperty era:typeVersionNumber ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Validation for typeVersionNumber property." ;
    sh:path era:typeVersionNumber ;
    sh:datatype xsd:string ;
    sh:severity sh:Violation ;
    sh:message "typeVersionNumber: The value must be a string."@en .

era-sh:VehicleTypeShape sh:property era-sh:HasCantDefficiencyCompensation .
era-sh:HasCantDefficiencyCompensation
    a sh:PropertyShape ;
    era:affectedProperty era:hasCantDefficiencyCompensation ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Validation for hasCantDefficiencyCompensation property." ;
    sh:path era:hasCantDefficiencyCompensation ;
    sh:datatype xsd:boolean ;
    sh:severity sh:Violation ;
    sh:message "hasCantDefficiencyCompensation (4.6.2): The value must be a boolean."@en ;
    era:eratvIndex "4.6.2" .

era-sh:VehicleTypeShape sh:property era-sh:HasFlangeLubrication .
era-sh:HasFlangeLubrication
    a sh:PropertyShape ;
    era:affectedProperty era:hasFlangeLubrication ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Validation for hasFlangeLubrication property." ;
    sh:path era:hasFlangeLubrication ;
    sh:datatype xsd:boolean ;
    sh:severity sh:Violation ;
    sh:message "hasFlangeLubrication (4.9.3.1): The value must be a boolean."@en ;
    era:eratvIndex "4.9.3.1" .

era-sh:VehicleTypeShape sh:property era-sh:VehicleSubCategory .
era-sh:VehicleSubCategory
    a sh:PropertyShape ;
    era:affectedProperty era:vehicleSubCategory ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Validation for vehicleSubCategory property."@en ;
    sh:path era:vehicleSubCategory ;
    sh:nodeKind sh:IRI ;
    sh:severity sh:Violation ;
    sh:message "vehicleSubCategory (1.5): The value must be an IRI."@en ;
    era:eratvIndex "1.5" .

era-sh:VehicleTypeShape sh:sparql era-sh:VehicleSubCategorySKOS .
era-sh:VehicleSubCategorySKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:vehicleSubCategory ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Ensures that the value of vehicleSubCategory is a valid SKOS concept from the vehicle types concept scheme."@en ;
    sh:severity sh:Violation ;
    sh:message "vehicleSubCategory: The VehicleType {$this} with label {?label} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: <http://data.europa.eu/949/concepts/vehicle-types/Categories>."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT $this ?concept ?label (era:vehicleSubCategory AS ?path)
        WHERE {
            OPTIONAL { $this rdfs:label ?label0 } .
            BIND(COALESCE(?label0, "unknown label") AS ?label)
            $this era:vehicleSubCategory ?concept .
            era:vehicleSubCategory era:inSkosConceptScheme ?conceptScheme .
            FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme })
        }
    """ .

# ============================================================
# New minimal PropertyShapes for properties lacking shapes
# ============================================================

# certificate
era-sh:VehicleTypeShape sh:property era-sh:Certificate .
era-sh:Certificate
    a sh:PropertyShape ;
    era:affectedProperty era:certificate ;
    era:affectedClass era:VehicleType ;
    era:scope "local" ;
    rdfs:comment "Type or Design Examination Certificate."@en ;
    sh:path era:certificate ;
    sh:nodeKind sh:IRI ;
    sh:class era:CLD ;
    sh:severity sh:Warning ;
    sh:message "certificate: The value must be an IRI pointing to a CLD."@en .

# CLDShape (new NodeShape for CLD class)
era-sh:CLDShape
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:CLD .

# evidence document state
era-sh:ECDeclarationShape sh:property era-sh:DocState .
era-sh:CLDShape sh:property era-sh:DocState .
era-sh:DocState
    a sh:PropertyShape ;
    era:affectedProperty era:state ;
    era:affectedClass era:CLD ;
    era:scope "local" ;
    rdfs:comment "State of the Evidence Document."@en ;
    sh:path era:state ;
    sh:nodeKind sh:IRI ;
    sh:class skos:Concept ;
    sh:severity sh:Warning ;
    sh:message "state: The value must be an IRI and a SKOS concept."@en .

# ECDeclarationShape (NodeShape for ECDeclaration class)
era-sh:ECDeclarationShape
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:ECDeclaration .




######################################################
# SHACL metadata - owl:versionInfo, dcterms, dcat, prov
######################################################


<http://data.europa.eu/949/id/dataset/rinf/era-shapes> a dcat:Dataset ;

    dct:title "SHACL Shapes for RINF dataset compliant with ERA ontology"@en ;
    dct:description """
    SHACL constraints validating RDF RINF datasets
    according to the ERA ontology .
    """@en ;
    dct:publisher <http://publications.europa.eu/resource/authority/corporate-body/ERA> ;
    dct:creator <http://publications.europa.eu/resource/authority/corporate-body/ERA> ;
    dct:issued "2024-04-18"^^xsd:date ;
    dct:modified "2026-01-28"^^xsd:date , "2026-03-02"^^xsd:date, "2026-03-16"^^xsd:date , "2026-03-30"^^xsd:date ;

    ## FAIR – Accessible
    dcat:landingPage <https://rinf.data.era.europa.eu/era-vocabulary/era-shapes> ;

    ## FAIR – Interoperable
    dct:conformsTo <https://www.w3.org/TR/shacl/> ;
    dct:conformsTo era: ;

    ## FAIR – Reusable
    dct:license <http://data.europa.eu/eli/dec_impl/2017/863/oj> ;
    dct:language <http://publications.europa.eu/resource/authority/language/ENG> ;
    owl:versionInfo "3.2.2" ;

    ## DCAT distribution
    dcat:distribution <http://data.europa.eu/949/id/distribution/rinf/era-shapes> ;

    ## Provenance
    prov:wasDerivedFrom era: ;
    prov:wasAttributedTo <http://publications.europa.eu/resource/authority/corporate-body/ERA> .

###########################
# DCAT distribution details
#@######################### 

<http://data.europa.eu/949/id/distribution/rinf/era-shapes>
    a dcat:Distribution ;
    dct:title "ERA RINF SHACL shapes (Turtle)"@en ;
    dcat:downloadURL <https://data-interop.era.europa.eu/era-vocabulary/rinf/era-shapes> ;
    dcat:mediaType "text/turtle" ;
    dcat:format <http://publications.europa.eu/resource/authority/file-type/RDF_TURTLE> ;
    dct:license <http://data.europa.eu/eli/dec_impl/2017/863/oj> .


###################################
# Rules for basic net references
###################################


era-sh:NetBasicReferenceShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:NetBasicReference .  

era-sh:NetPointReferenceShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:NetPointReference .  

era-sh:NetLinearReferenceShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:NetLinearReference .  

era-sh:NetAreaReferenceShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:NetAreaReference .  

era-sh:LinearPositioningSystemShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:LinearPositioningSystem .  

era-sh:LinearPositioningSystemCoordinateShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:LinearPositioningSystemCoordinate .  




# appliesToDirection
era-sh:NetPointReferenceShape sh:property era-sh:AppliesToDirection.
era-sh:AppliesToDirection
	a sh:PropertyShape ;
    era:affectedProperty era:appliesToDirection;
    era:affectedClass era:NetPointReference;
    era:scope "local";
	rdfs:comment "The direction relative to the origin of the linear element towards the point reference applies."@en;
	sh:path era:appliesToDirection ;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "appliesToDirection: The net point reference must have an 'applies to direction' value that is an IRI."@en .	

# appliesToDirection
era-sh:NetPointReferenceShape sh:sparql era-sh:AppliesToDirectionSKOS.
era-sh:AppliesToDirectionSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:appliesToDirection;
    era:affectedClass era:NetPointReference;
    era:scope "local";
	rdfs:comment "The direction relative to the origin of the linear element towards the point reference applies."@en;
	sh:message "appliesToDirection: The net point reference {$this} with label {?thisLabel}  has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/orientations/Directions."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?thisLabel ?concept (era:appliesToDirection AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        $this era:appliesToDirection ?concept .
        era:appliesToDirection era:inSkosConceptScheme ?conceptScheme .
        FILTER NOT EXISTS { ?concept skos:inScheme ?conceptScheme }
    }
""" .



# hasLrsCoordinate - hasLRS
era-sh:NetPointReferenceShape sh:property era-sh:HasLrsCoordinate.
 era-sh:HasLrsCoordinate
	a sh:PropertyShape ;
    era:affectedProperty era:hasLrsCoordinate;
    era:affectedProperty era:hasLRS;
    era:affectedClass era:NetPointReference;
    era:scope "local";
	rdfs:comment "Specifies the LRS coordinate associated with a topological coordinate."@en;
	sh:path (era:hasLrsCoordinate era:hasLRS) ;
    sh:class era:LinearPositioningSystem;
	sh:severity sh:Violation ;
	sh:message "hasLrsCoordinate: The net point reference specifies an LRS coordinate that must be an instance of a LinearPositioningSystemCoordinate and that in turn references a LinearPositioningSystem. This error is due to having a value that is not a LinearPositioningSystemCoordinate that in turn references a LinearPositioningSystem."@en .	

# hasSequence
era-sh:NetLinearReferenceShape sh:property era-sh:HasSequence.
 era-sh:HasSequence
	a sh:PropertyShape ;
    era:affectedProperty era:hasSequence;
    era:affectedClass era:NetLinearReference;
    era:scope "local";
	rdfs:comment "The ordered sequence of topological linear elements which create a linear net reference."@en;
	sh:path era:hasSequence ;
    sh:class rdf:List;
	sh:severity sh:Violation ;
	sh:message "hasSequence: The net linear reference specifies an ordered sequence of topological linear elements that must be an instance of an rdf:List. This error is due to having a value that is not an instance of rdf:List."@en .	

# hasTopoCoordinate
era-sh:NetPointReferenceShape sh:property era-sh:HasTopoCoordinate.
 era-sh:HasTopoCoordinate
	a sh:PropertyShape ;
    era:affectedProperty era:hasTopoCoordinate;
    era:affectedClass era:NetPointReference;
    era:scope "local";
	rdfs:comment "Specifies the topological coordinate of a network point reference."@en;
	sh:path era:hasTopoCoordinate ;
    sh:class era:TopologicalCoordinate;
	sh:severity sh:Violation ;
	sh:message "hasTopoCoordinate: The net point reference specifies a topo coordinate that must be an instance of a TopologicalCoordinate. This error is due to having a value that is not an instance of TopologicalCoordinate."@en .

# includes
era-sh:NetAreaReferenceShape sh:property era-sh:Includes.
 era-sh:Includes
	a sh:PropertyShape ;
    era:affectedProperty era:includes;
    era:affectedClass era:NetAreaReference;
    era:scope "local";
	rdfs:comment "List of linear references included in an network area reference."@en;
	sh:path era:includes ;
    sh:class rdf:List;
	sh:severity sh:Violation ;
	sh:message "includes: The net area reference specifies a list of linear references that must be an instance of an rdf:List. This error is due to having a value that is not an instance of rdf:List."@en .	


# lrsMethod
era-sh:LinearPositioningSystemShape sh:property era-sh:LrsMethod.
era-sh:LrsMethod
	a sh:PropertyShape ;
    era:affectedProperty era:lrsMethod;
    era:affectedClass era:LinearPositioningSystem;
    era:scope "local";
	rdfs:comment "The preferred line referencing system."@en;
	sh:path era:lrsMethod ;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "lrsMethod: The linear positioning system must have an 'lrsMethod' value that is an IRI."@en .	

# lrsMethod
era-sh:LinearPositioningSystemShape sh:sparql era-sh:LrsMethodSKOS.
era-sh:LrsMethodSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:lrsMethod;
    era:affectedClass era:LinearPositioningSystem;
    era:scope "local";
	rdfs:comment "The preferred line referencing system."@en;
	sh:message "lrsMethod: The linear positionung system {$this} with label {?thisLabel}  has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/lines/ReferenceSystems."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?thisLabel ?concept (era:lrsMethod AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        $this era:lrsMethod ?concept .
        era:lrsMethod era:inSkosConceptScheme ?conceptScheme .
        FILTER NOT EXISTS { ?concept skos:inScheme ?conceptScheme }
    }
""" .

# startsAt
era-sh:NetLinearReferenceShape sh:property era-sh:StartsAt.
 era-sh:StartsAt
	a sh:PropertyShape ;
    era:affectedProperty era:startsAt;
    era:affectedClass era:NetLinearReference;
    era:scope "local";
	rdfs:comment "Specifies the starting point of a linear reference."@en;
	sh:path era:startsAt ;
    sh:minCount 1;
    sh:maxCount 1;
    sh:class era:NetPointReference;
	sh:severity sh:Violation ;
	sh:message "startsAt: The net linear reference specifies a starting point that must be an instance of a NetPointReference. This error is due to not having a value, having more than one value or having a value that is not an instance of NetPointReference."@en .	

# endsAt
era-sh:NetLinearReferenceShape sh:property era-sh:EndsAt.
 era-sh:EndsAt
	a sh:PropertyShape ;
    era:affectedProperty era:endsAt;
    era:affectedClass era:NetLinearReference;
    era:scope "local";
	rdfs:comment "Specifies the ending point of a linear reference."@en;
	sh:path era:endsAt ;
    sh:minCount 1;
    sh:maxCount 1;
    sh:class era:NetPointReference;
	sh:severity sh:Violation ;
	sh:message "endsAt: The net linear reference specifies an ending point that must be an instance of a NetPointReference. This error is due to not having a value, having more than one value or having a value that is not an instance of NetPointReference."@en .	

# kmPost: 
era-sh:LinearPositioningSystemCoordinateShape sh:property era-sh:KmPost .
era-sh:KmPost
	a sh:PropertyShape;
    era:affectedClass era:LinearPositioningSystemCoordinate;
    era:affectedProperty era:kmPost ;
    era:scope "local";
    rdfs:comment "The closest kilometric post on the line, used as a reference by the LRS coordinate."@en ;
	sh:path era:kmPost ;
	sh:nodeKind sh:IRI ;
	sh:class era:KilometricPost ;
	sh:severity sh:Violation ;
	sh:message "kmPost: The LinearPositioningSystemCoordinate may reference a KilometricPost through kmPost. This error is due to the value either not being an IRI, or being an IRI that is not an instance of KilometricPost."@en .


# offsetFromKilometricPost: 
era-sh:LinearPositioningSystemCoordinateShape sh:property era-sh:OffsetFromKilometricPost .
era-sh:OffsetFromKilometricPost
	a sh:PropertyShape;
    era:affectedClass era:LinearPositioningSystemCoordinate;
    era:affectedProperty era:offsetFromKilometricPost ;
    era:scope "local";
	rdfs:comment "Relative distance from a reference kilometric post."@en ;
	sh:path era:offsetFromKilometricPost ;
	sh:datatype xsd:double ;
	sh:severity sh:Violation ;
	sh:message "offsetFromKilometricPost: The offset from kilometric post must be represented as a double number."@en .

# lineId: 
era-sh:LinearPositioningSystemShape sh:property era-sh:LineId .
era-sh:LineId
	a sh:PropertyShape;
    era:affectedClass era:LinearPositioningSystem;
    era:affectedProperty era:lineId ;
    era:scope "local";
	rdfs:comment "Unique line identification or unique line number within Member State."@en ;
    era:rinfIndex "1.1.0.0.0.2";
    sh:maxCount 1;
	sh:path era:lineId ;
	sh:datatype xsd:string ;
	sh:severity sh:Violation ;
	sh:message "lineId: The line identification is unique and must be a string. This error is due to having more than one value or having a value that is not a string of characters"@en .

era-sh:LinearPositioningSystemShape sh:property era-sh:RdfsLabel .

#############################
# Rules for contact-line-systems
#############################

era-sh:ContactLineSystemShape  
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:ContactLineSystem .

era-sh:ContactLineSystemShapeSPARQLWarning
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:ContactLineSystem ;
    sh:severity sh:Warning .


# contactLineSystemType: # 1.1.1.2.2.1.1
era-sh:ContactLineSystemShape sh:property era-sh:ContactLineSystemType .
era-sh:ContactLineSystemType
	a sh:PropertyShape ;
    era:affectedProperty era:contactLineSystemType;
    era:affectedClass era:ContactLineSystem;
    era:scope "local";
	rdfs:comment "Indication of the type of the contact line system"@en  ;
	era:rinfIndex "1.1.1.2.2.1.1" ;
	sh:path era:contactLineSystemType ;
	sh:nodeKind sh:IRI ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
	sh:severity sh:Warning ;
	sh:message "contactLineSystemType (1.1.1.2.2.1.1): The contact line system must have a contact line system type, and its value must be an IRI. This error is due to the contact line system not having a value for this property, having more than one value for this property, or having a value that is not an IRI."@en .

#contactLineSystemType: # 1.1.1.2.2.1.1
era-sh:ContactLineSystemShape sh:sparql era-sh:ContactLineSystemTypeSKOS .
era-sh:ContactLineSystemTypeSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:contactLineSystemType;
    era:affectedClass era:ContactLineSystem;
    era:scope "local";
	rdfs:comment "Indication of the type of the contact line system"@en  ;
	era:rinfIndex "1.1.1.2.2.1.1" ;
	sh:message "contactLineSystemType (1.1.1.2.2.1.1): The contact line system {$this}  has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/contact-line-systems/ContactLineSystems."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    SELECT $this  ?concept (era:contactLineSystemType AS ?path)
    WHERE {
        $this era:contactLineSystemType ?concept .
        era:contactLineSystemType era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

#contactLineSystemType: # 1.1.1.2.2.1.1
era-sh:ContactLineSystemShape sh:sparql era-sh:ContactLineSystemTypeNotElectrifiedApplicability .
era-sh:ContactLineSystemTypeNotElectrifiedApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:contactLineSystemType;
    era:affectedClass era:ContactLineSystem;
    era:scope "local";
	rdfs:comment "When the value \"not electrified\" is chosen, all parameters 1.1.1.2.2.1.2 - 1.1.1.2.5.3 are not applicable"@en  ;
	era:rinfIndex "1.1.1.2.2.1.1" ;
    sh:message "contactLineSystemType (1.1.1.2.2.1.1): The Contact Line System {$this} ({?clsLabel}), has a 'Not electrified' type, and at least one of its parameters has values for at least one of the range of parameters between 1.1.1.2.2.1.2 and 1.1.1.2.5.3. This happens at least with property {?p} (RINF index {?index})."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?clsLabel ?p ?index (era:contactLineSystemType AS ?path)
    WHERE {
        $this era:contactLineSystemType <http://data.europa.eu/949/concepts/contact-line-systems/40> .
        OPTIONAL { $this rdfs:label ?clsLabel0 } .
        BIND(COALESCE(?clsLabel0, "unknown label") AS ?clsLabel)
        $this ?p ?y .
        ?p era:rinfIndex ?index .
        FILTER(
          strstarts(?index,'1.1.1.2.2.1.2') || 
          strstarts(?index,'1.1.1.2.2.1.3') || 
          strstarts(?index,'1.1.1.2.2.2') || 
          strstarts(?index,'1.1.1.2.2.3') || 
          strstarts(?index,'1.1.1.2.2.4') || 
          strstarts(?index,'1.1.1.2.2.5') || 
          strstarts(?index,'1.1.1.2.2.6') || 
          strstarts(?index,'1.1.1.2.3') || 
          strstarts(?index,'1.1.1.2.4') || 
          strstarts(?index, '1.1.1.2.5')
        )
    }
    """ .

#contactLineSystemType: # 1.1.1.2.2.1.1
era-sh:ContactLineSystemShape sh:sparql era-sh:ContactLineSystemTypeThirdOrFourthRailApplicability .
era-sh:ContactLineSystemTypeThirdOrFourthRailApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:contactLineSystemType;
    era:affectedClass era:ContactLineSystem;
    era:scope "local";
	rdfs:comment "When the value “Third Rail” or “Fourth Rail” is chosen, parameters 1.1.1.2.2.3, 1.1.1.2.2.5 - 1.1.1.2.4.2.3, 1.1.1.2.5.2 and 1.1.1.2.5.3 are not applicable"@en  ;
	era:rinfIndex "1.1.1.2.2.1.1" ;
    sh:message "contactLineSystemType (1.1.1.2.2.1.1): The Contact Line System {$this} ({?clsLabel}), has a 'Third Rail' or 'Fourth Rail' type, and at least one of its parameters has values for at least one of the parameters 1.1.1.2.2.3, 1.1.1.2.2.5 - 1.1.1.2.4.2.3, 1.1.1.2.5.2 and 1.1.1.2.5.3. This happens at least with property {?p} (RINF index {?index})."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?clsLabel ?p ?index (era:contactLineSystemType AS ?path)
    WHERE {
        { $this era:contactLineSystemType <http://data.europa.eu/949/concepts/contact-line-systems/20> }
        UNION
        { $this era:contactLineSystemType <http://data.europa.eu/949/concepts/contact-line-systems/30> }
        OPTIONAL { $this rdfs:label ?clsLabel0 } .
        BIND(COALESCE(?clsLabel0, "unknown label") AS ?clsLabel)
        $this ?p ?y .
        ?p era:rinfIndex ?index .
        FILTER EXISTS { $this ?p ?value } .
        FILTER(str(?index)='1.1.1.2.2.3' || str(?index)='1.1.1.2.2.5' || str(?index)='1.1.1.2.2.6' || strstarts(?index,'1.1.1.2.3') || strstarts(?index,'1.1.1.2.4') || str(?index)='1.1.1.2.5.2' || str(?index)='1.1.1.2.5.3')
    }
    """ .

# energySupplySystem: # 1.1.1.2.2.1.2
era-sh:ContactLineSystemShape sh:property era-sh:EnergySupplySystem .
era-sh:EnergySupplySystem
	a sh:PropertyShape ;
    era:affectedProperty era:energySupplySystem;
    era:affectedClass era:ContactLineSystem;
    era:scope "local";
	rdfs:comment "Indication of the traction supply system"@en  ;
	era:rinfIndex "1.1.1.2.2.1.2" ;
	sh:path era:energySupplySystem ;
	sh:nodeKind sh:IRI ;
    sh:maxCount 1 ;
	sh:severity sh:Warning ;
	sh:message "energySupplySystem (1.1.1.2.2.1.2): The contact line system defines the energy supply system.This error is due to a contact line system having more than one value for this property or having a value that is not an IRI."@en .

# energySupplySystem: # 1.1.1.2.2.1.2
era-sh:ContactLineSystemShapeSPARQLWarning sh:sparql era-sh:EnergySupplySystemSKOS .
era-sh:EnergySupplySystemSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:energySupplySystem;
    era:affectedClass era:ContactLineSystem;
    era:scope "local";
	rdfs:comment "Indication of the traction supply system"@en  ;
	era:rinfIndex "1.1.1.2.2.1.2" ;
	sh:message "energySupplySystem (1.1.1.2.2.1.2): The contact line system {$this} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/energy-supply-systems/EnergySupplySystems."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    SELECT $this  ?concept (era:energySupplySystem AS ?path)
    WHERE {
        $this era:energySupplySystem ?concept .
        era:energySupplySystem era:inSkosConceptScheme ?conceptScheme .
        FILTER (NOT EXISTS {?concept skos:inScheme ?conceptScheme} || REGEX(STR(?concept), "/eratv/"))
	}
""" .


# umax2: # 1.1.1.2.2.1.3
era-sh:ContactLineSystemShape sh:property era-sh:Umax2 .
era-sh:Umax2
	a sh:PropertyShape ;
    era:affectedProperty era:umax2;
    era:affectedClass era:ContactLineSystem;
    era:scope "local";
	rdfs:comment "Umax2 for lines referred to in sections 7.4.2.2.1 and 7.4.2.11.1 of Regulation (EU) 1301/2014"@en  ;
	era:rinfIndex "1.1.1.2.2.1.3" ;
	sh:path era:umax2 ;
	sh:datatype xsd:integer ;
	sh:pattern "^([1-9]\\d{0,5}|0)$" ;
    sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "umax2 (1.1.1.2.2.1.3): The contact line system defines the Umax2 . This error is due to having more than one value for this property, having a value that is not an integer, or having an integer that does not follow the pattern [NNNNNN]."@en .

# maxTrainCurrent: # 1.1.1.2.2.2
era-sh:ContactLineSystemShape sh:property era-sh:MaximumTrainCurrent .
era-sh:MaximumTrainCurrent
	a sh:PropertyShape ;
    era:affectedProperty era:maxTrainCurrent;
    era:affectedClass era:ContactLineSystem;
    era:scope "local";
	rdfs:comment "Indication of the maximum allowable train current"@en  ;
	era:rinfIndex "1.1.1.2.2.2" ;
	sh:path era:maxTrainCurrent ;
	sh:datatype xsd:integer ;
	sh:pattern "^([1-9]\\d{0,3}|0)$" ;
    sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "maxTrainCurrent (1.1.1.2.2.2): Defines the maximum allowable train current of the contact line system. This error is due to having more than one value for this property, having a value that is not an integer, or having an integer that does not follow the pattern [NNNN]."@en .

# maxCurrentStandstillPantograph: # 1.1.1.2.2.3, 1.2.2.0.6.1
era-sh:ContactLineSystemShape sh:property era-sh:MaxCurrentStandstillPantograph .
era-sh:MaxCurrentStandstillPantograph
	a sh:PropertyShape ;
    era:affectedProperty era:maxCurrentStandstillPantograph;
    era:affectedClass era:ContactLineSystem;
    era:scope "local";
	rdfs:comment "Indication of the maximum allowable current at standstill per pantograph"@en  ;
	era:rinfIndex "1.1.1.2.2.3", "1.2.2.0.6.1" ;
	sh:path era:maxCurrentStandstillPantograph ;
	sh:datatype xsd:integer ;
	sh:pattern "^([1-9]\\d{0,2}|0)$" ;
    sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "maxCurrentStandstillPantograph (1.1.1.2.2.3, 1.2.2.0.6.1): Defines the maximum allowable current at standstill per pantograph for the contact line system. This error is due to having more than one value for this property, having a value that is not an integer, or having an integer that does not follow the pattern [NNN]."@en .

# maxCurrentStandstillPantograph: # 1.1.1.2.2.3, 1.2.2.0.6.1
era-sh:ContactLineSystemShapeSPARQLWarning sh:sparql era-sh:MaxCurrentStandstillPantographApplicability .
era-sh:MaxCurrentStandstillPantographApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:maxCurrentStandstillPantograph;
    era:affectedClass era:ContactLineSystem;
    era:scope "local";
	rdfs:comment "This parameter is applicable (“Y”) only if “Overhead contact line (OCL)” is selected for parameter 1.1.1.2.2.1.1."@en  ;
	era:rinfIndex "1.1.1.2.2.3", "1.2.2.0.6.1" ;
	sh:message "maxCurrentStandstillPantograph (1.1.1.2.2.3, 1.2.2.0.6.1):The Contact Line System {$this} ({?clsLabel}), has a 'Overhead contact line (OCL)' type which makes the maxCurrentStandstillPantograph parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?clsLabel (era:maxCurrentStandstillPantograph AS ?path)
    WHERE {
        $this era:contactLineSystemType <http://data.europa.eu/949/concepts/contact-line-systems/10> .
        OPTIONAL { $this rdfs:label ?clsLabel0 } .
        BIND(COALESCE(?clsLabel0, "unknown label") AS ?clsLabel)
        FILTER NOT EXISTS { $this era:maxCurrentStandstillPantograph ?value } .
    }
    """ .

# conditionsAppliedRegenerativeBraking: # 1.1.1.2.2.4.1
era-sh:ContactLineSystemShape sh:property era-sh:ConditionsAppliedRegenerativeBraking .
era-sh:ConditionsAppliedRegenerativeBraking
	a sh:PropertyShape;
    era:affectedClass era:ContactLineSystem;
    era:affectedProperty era:conditionsAppliedRegenerativeBraking ;
    era:scope "local";
	rdfs:comment "Name and/or reference of the document specifying the conditions applying in regards to regenerative braking."@en  ;
	era:rinfIndex "1.1.1.2.2.4.1" ;
	sh:path era:conditionsAppliedRegenerativeBraking ;
	sh:class era:Document;
    sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "conditionsAppliedRegenerativeBraking (1.1.1.2.2.4.1): The contact line system has a conditionsAppliedRegenerativeBraking reference that must be a Document. This error is due to having more than one value for this property or having a value that is not a Document."@en .


# conditionsAppliedRegenerativeBraking: # 1.1.1.2.2.4.1 
era-sh:ContactLineSystemShapeSPARQLWarning sh:sparql era-sh:ConditionsAppliedRegenerativeBrakingApplicability .
era-sh:ConditionsAppliedRegenerativeBrakingApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:conditionsAppliedRegenerativeBraking;
    era:affectedClass era:ContactLineSystem;
    era:scope "local";
	rdfs:comment "This parameter is applicable (“Y”) only if “Overhead contact line (OCL)” is selected for parameter 1.1.1.2.2.1.1 and the regenerative braking status is “under conditions” (20) or “under conditions only for emergency brake” (40)."@en  ;
	era:rinfIndex "1.1.1.2.2.4.1" ;
	sh:message "conditionsAppliedRegenerativeBraking (1.1.1.2.2.4.1):The Contact Line System {$this} ({?clsLabel}), has a 'Overhead contact line (OCL)' type and a conditional regenerative braking status which makes the conditionsAppliedRegenerativeBraking parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX era-cls: <http://data.europa.eu/949/concepts/contact-line-systems/>
    PREFIX era-rb: <http://data.europa.eu/949/concepts/regenerative-braking/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

    SELECT DISTINCT $this ?clsLabel (era:conditionsAppliedRegenerativeBraking AS ?path)
    WHERE {
        $this era:contactLineSystemType era-cls:10 .
        $this era:conditionalRegenerativeBrake ?underConditionsSkosConcept .
        OPTIONAL { $this rdfs:label ?clsLabel0 } .
        BIND(COALESCE(?clsLabel0, "unknown label") AS ?clsLabel)
        FILTER NOT EXISTS { $this era:conditionsAppliedRegenerativeBraking ?value } .
        FILTER ( ?underConditionsSkosConcept IN ( era-rb:20 , era-rb:40) )
    }
    """ .

# maximumContactWireHeight: # 1.1.1.2.2.5 #
era-sh:ContactLineSystemShape sh:property era-sh:MaximumContactWireHeight .
era-sh:MaximumContactWireHeight
	a sh:PropertyShape ;
    era:affectedProperty era:maximumContactWireHeight;
    era:affectedClass era:ContactLineSystem;
    era:scope "local";
	rdfs:comment "Indication of the maximum contact wire height expressed in metres"@en  ; 
	era:rinfIndex "1.1.1.2.2.5" ; 
	sh:path era:maximumContactWireHeight ;
	sh:datatype xsd:double ;
	sh:pattern "^([0-9])(\\.\\d{1,2})?$" ;
    sh:maxCount 1;
	sh:severity sh:Violation ;
	sh:message "maximumContactWireHeight (1.1.1.2.2.5): The contact line system defines a maximum contact wire height expressed in metres. This error is due to having more than one value for this property, having a value that is not a double (real) number, or having a number that does not follow the pattern [N.NN] (with up to 2 decimals)."@en . 

# maximumContactWireHeight: # 1.1.1.2.2.5
era-sh:ContactLineSystemShapeSPARQLWarning sh:sparql era-sh:MaximumContactWireHeightApplicability .
era-sh:MaximumContactWireHeightApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:maximumContactWireHeight;
    era:affectedClass era:ContactLineSystem;
    era:scope "local";
	rdfs:comment "This parameter is applicable (“Y”) only if “Overhead contact line (OCL)” is selected for parameter 1.1.1.2.2.1.1."@en  ;
	era:rinfIndex "1.1.1.2.2.5" ;
	sh:message "maximumContactWireHeight (1.1.1.2.2.6):The Contact Line System {$this} ({?clsLabel}), has a 'Overhead contact line (OCL)' type which makes the maximumContactWireHeight parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?clsLabel (era:maximumContactWireHeight AS ?path)
    WHERE {
        $this era:contactLineSystemType <http://data.europa.eu/949/concepts/contact-line-systems/10> .
        OPTIONAL { $this rdfs:label ?clsLabel0 } .
        BIND(COALESCE(?clsLabel0, "unknown label") AS ?clsLabel)
        FILTER NOT EXISTS { $this era:maximumContactWireHeight ?value } .
    }
    """ .

# minimumContactWireHeight: # 1.1.1.2.2.6 #
era-sh:ContactLineSystemShape sh:property era-sh:MinimumContactWireHeight .
era-sh:MinimumContactWireHeight
	a sh:PropertyShape ;
    era:affectedProperty era:minimumContactWireHeight;
    era:affectedClass era:ContactLineSystem;
    era:scope "local";
	rdfs:comment "Indication of the minimum minimum contact wire height expressed in metres"@en  ;
	era:rinfIndex "1.1.1.2.2.6" ; 
	sh:path era:minimumContactWireHeight ;
	sh:datatype xsd:double ;
	sh:pattern "^([0-9])(\\.\\d{1,2})?$" ; 
    sh:maxCount 1;
	sh:severity sh:Violation ;
	sh:message "minimumContactWireHeight (1.1.1.2.2.6): The contact line system defines a minimum contact wire height expressed in metres. This error is due to having more than one value for this property, having a value that is not a double (real) number, or having a number that does not follow the pattern [N.NN] (with up to 2 decimals)."@en . 

# minimumContactWireHeight: # 1.1.1.2.2.6
era-sh:ContactLineSystemShapeSPARQLWarning sh:sparql era-sh:MinimumContactWireHeightApplicability .
era-sh:MinimumContactWireHeightApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:minimumContactWireHeight;
    era:affectedClass era:ContactLineSystem;
    era:scope "local";
	rdfs:comment "This parameter is applicable (“Y”) only if “Overhead contact line (OCL)” is selected for parameter 1.1.1.2.2.1.1."@en  ;
	era:rinfIndex "1.1.1.2.2.6" ;
	sh:message "minimumContactWireHeight (1.1.1.2.2.6):The Contact Line System {$this} ({?clsLabel}), has a 'Overhead contact line (OCL)' type which makes the minimumContactWireHeight parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?clsLabel (era:minimumContactWireHeight AS ?path)
    WHERE {
        $this era:contactLineSystemType <http://data.europa.eu/949/concepts/contact-line-systems/10> .
        OPTIONAL { $this rdfs:label ?clsLabel0 } .
        BIND(COALESCE(?clsLabel0, "unknown label") AS ?clsLabel)
        FILTER NOT EXISTS { $this era:minimumContactWireHeight ?value } .
    }
    """ .

# permissionChargingElectricEnergyTractionStandstill # 1.2.1.0.7.1
era-sh:PlatformEdgeShape sh:property era-sh:PermissionChargingElectricEnergyTractionStandstill .
era-sh:PermissionChargingElectricEnergyTractionStandstill
	a sh:PropertyShape ;
    era:affectedProperty era:permissionChargingElectricEnergyTractionStandstill;
    era:affectedClass era:PlatformEdge;
    era:scope "local";
	rdfs:comment "Indication if charging electric energy storage for traction purposes at standstill is permitted"@en  ;
	era:rinfIndex "1.2.1.0.7.1" ;
	sh:path era:permissionChargingElectricEnergyTractionStandstill ;
	sh:datatype xsd:boolean ;
    sh:maxCount 1;
	sh:severity sh:Violation ;
	sh:message "permissionChargingElectricEnergyTractionStandstill (1.2.1.0.7.1): The platform edge defines if charging electric energy storage for traction purposes at standstill is permitted. This error is due to having more than one value for this property or having a value that is not  Y/N (boolean)."@en .

# conditionsChargingElectricEnergyStorage # 1.2.1.0.7.2
era-sh:PlatformEdgeShape sh:property era-sh:ConditionsChargingElectricEnergyStorage .
era-sh:ConditionsChargingElectricEnergyStorage
	a sh:PropertyShape ;
    era:affectedProperty era:conditionsChargingElectricEnergyStorage;
    era:affectedClass era:PlatformEdge;
    era:scope "local";
	rdfs:comment "Indication if charging electric energy storage for traction purposes at standstill is permitted"@en  ;
	era:rinfIndex "1.2.1.0.7.2" ;
	sh:path era:conditionsChargingElectricEnergyStorage ;
	sh:datatype xsd:anyURI ;
    sh:maxCount 1;
	sh:severity sh:Violation ;
	sh:message "conditionsChargingElectricEnergyStorage (1.2.1.0.7.2): The platform edge defines the permitted conditions for charging electric energy storage for traction purposes at standstill. This error is due to having more than one value for this property or having a value that is not  an URI."@en .


#############################
# Rules for documents
#############################

era-sh:DocumentShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:Document.

# documentUrl
era-sh:DocumentShape sh:property era-sh:DocumentUrl .
era-sh:DocumentUrl
    a sh:PropertyShape ;
    era:affectedProperty era:documentUrl;
    era:affectedClass era:Document;
    era:scope "local";  
    rdfs:comment "URL that is used to download a document, e.g. url for a reference document in RINF."@en ;
    sh:path era:documentUrl ;           
    sh:datatype xsd:anyURI ;
    sh:severity sh:Violation ;
    sh:message "documentUrl: The value must be a valid URI (xsd:anyURI)."@en .


#############################
# Rules for ETCS
#############################

era-sh:ETCSShape  
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:ETCS .

# Created for recent properties that will be required in the future. i.e. "12 months after publication of Article 7 Guide"
era-sh:ETCSShapeWarning  
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:severity sh:Warning ;
    sh:targetClass era:ETCS .

era-sh:ETCS70ShapeSPARQLWarning
    a sh:NodeShape ;
    sh:severity sh:Warning ;
    sh:target [
        a sh:SPARQLTarget ;
		sh:prefixes era:; 
        sh:select """
            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
            PREFIX era: <http://data.europa.eu/949/>

            SELECT DISTINCT $this
            WHERE {
                $this a era:ETCS .
                $this era:etcsLevelType <http://data.europa.eu/949/concepts/etcs-levels/70> .
            }
        """ ;
    ] ;
.

era-sh:ETCSNon70ShapeSPARQLViolation
    a sh:NodeShape ;
    sh:severity sh:Violation ;
    sh:target [
        a sh:SPARQLTarget ;
		sh:prefixes era:; 
        sh:select """
            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
            PREFIX era: <http://data.europa.eu/949/>

            SELECT DISTINCT $this
            WHERE {
                $this a era:ETCS .
                {
                    $this era:etcsLevelType ?type .
                    FILTER (?type NOT IN ( <http://data.europa.eu/949/concepts/etcs-levels/70> ))                    
                } UNION {
                    FILTER NOT EXISTS { $this era:etcsLevelType ?type } .
                }
            }
        """ ;
    ] ;
.
    


# etcsBaseline: # 1.1.1.3.2.2, 1.2.1.1.1.2
era-sh:ETCSShape sh:property era-sh:EtcsBaseline .
era-sh:EtcsBaseline
	a sh:PropertyShape ;
    era:affectedProperty era:etcsBaseline;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "ETCS baseline installed lineside "@en ;
	era:rinfIndex "1.1.1.3.2.2" ;
    era:rinfIndex "1.2.1.1.1.2" ;
	sh:path era:etcsBaseline ;
	sh:nodeKind sh:IRI ;
    sh:maxCount 1;
	sh:severity sh:Violation ;
	sh:message "etcsBaseline (1.1.1.3.2.2, 1.2.1.1.1.2): The ETCS may have an ETCS baseline, and its value must be an IRI. This error is due to the ETCS instance having more than one value or having a value that is not an IRI."@en .

# etcsBaseline: # 1.1.1.3.2.2, 1.2.1.1.1.2
era-sh:ETCSShape sh:sparql era-sh:EtcsBaselineSKOS .
era-sh:EtcsBaselineSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsBaseline;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "ETCS baseline installed lineside "@en ;
	era:rinfIndex "1.1.1.3.2.2" ;
    era:rinfIndex "1.2.1.1.1.2" ;
	sh:message "etcsBaseline (1.1.1.3.2.2, 1.2.1.1.1.2): The ETCS {$this}  has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/etcs-baselines/."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    SELECT $this  ?concept (era:etcsBaseline AS ?path)
    WHERE {
        $this era:etcsBaseline ?concept .
        era:etcsBaseline era:inSkosConceptScheme ?conceptScheme .
        FILTER (NOT EXISTS {?concept skos:inScheme ?conceptScheme} || REGEX(STR(?concept), "/eratv/"))
	}
""" .

# etcsBaseline: # 1.1.1.3.2.2, 1.2.1.1.1.2
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:EtcsBaselineApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:EtcsBaselineApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:EtcsBaselineApplicability .
era-sh:EtcsBaselineApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsBaseline;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.2", "1.2.1.1.1.2" ;
	sh:message "etcsBaseline (1.1.1.3.2.2, 1.2.1.1.1.2): The ETCS {$this} ({?thisLabel}), has a ETCS level type which makes the etcsBaseline parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
	sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:etcsBaseline AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:etcsBaseline ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:etcsBaseline } .
    }
    """ .


# etcsInfill: # 1.1.1.3.2.4, 1.2.1.1.1.4
era-sh:ETCSShape sh:property era-sh:EtcsInfill .
era-sh:EtcsInfill
	a sh:PropertyShape ;
    era:affectedProperty era:etcsInfill;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Information about installed trackside equipment capable of transmitting infill information by loop or Global System for Mobile communications for Railways (GSM-R) for level 1 installations. "@en ;
	era:rinfIndex "1.1.1.3.2.4" ;
    era:rinfIndex "1.2.1.1.1.4" ;
	sh:path era:etcsInfill ;
	sh:nodeKind sh:IRI ;
    sh:maxCount 1;
	sh:severity sh:Violation ;
	sh:message "etcsInfill (1.1.1.3.2.4, 1.2.1.1.1.4): The ETCS may have an ETCS infill, and its value must be an IRI. This error is due to the ETCS instance having more than one value or having a value that is not an IRI."@en .

# etcsInfill: # 1.1.1.3.2.4, 1.2.1.1.1.4
era-sh:ETCSShape sh:sparql era-sh:EtcsInfillSKOS .
era-sh:EtcsInfillSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsInfill;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Information about installed trackside equipment capable of transmitting infill information by loop or Global System for Mobile communications for Railways (GSM-R) for level 1 installations. "@en ;
	era:rinfIndex "1.1.1.3.2.4" ;
    era:rinfIndex "1.2.1.1.1.4" ;
	sh:message "etcsInfill (1.1.1.3.2.4, 1.2.1.1.1.4): The ETCS {$this}  has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/etcs-infills/."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    SELECT $this  ?concept (era:etcsInfill AS ?path)
    WHERE {
        $this era:etcsInfill ?concept .
        era:etcsInfill era:inSkosConceptScheme ?conceptScheme .
        FILTER (NOT EXISTS {?concept skos:inScheme ?conceptScheme} || REGEX(STR(?concept), "/eratv/"))
	}
""" .

# etcsInfill: # 1.1.1.3.2.4, 1.2.1.1.1.4
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:EtcsInfillApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:EtcsInfillApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:EtcsInfillApplicability .
era-sh:EtcsInfillApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsInfill;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 contains 1. Related to rule for etcsLevelType "@en ;
	era:rinfIndex "1.1.1.3.2.4", "1.2.1.1.1.4" ;
	sh:message "etcsInfill (1.1.1.3.2.4, 1.2.1.1.1.4): The ETCS {$this} ({?thisLabel}), has a ETCS level type value of 1 which makes the etcsInfill parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
	sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:etcsInfill AS ?path)
    WHERE {
        $this era:etcsLevelType <http://data.europa.eu/949/concepts/etcs-levels/20> .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:etcsInfill ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:etcsInfill } .
    }
    """ .

# etcsMVersion: # 1.1.1.3.2.10, 1.2.1.1.1.10
era-sh:ETCSShape sh:property era-sh:EtcsMVersion.
era-sh:EtcsMVersion
	a sh:PropertyShape ; era:affectedProperty era:etcsMVersion  ;     era:affectedClass  era:ETCS;     era:scope "local";     
	rdfs:comment "ETCS_M version according to SRS 7.5.1.9 "@en ;
	era:rinfIndex "1.1.1.3.2.10" ;
    era:rinfIndex "1.2.1.1.1.10" ;
	sh:path era:etcsMVersion ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:maxCount 1 ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "etcsMVersion (1.1.1.3.2.10, 1.2.1.1.1.10): The ETCS has at most one ETCS_M version value and it must be an IRI. This error is due to the ETCS having more than one value or having a value that is not an IRI."@en .

# etcsMVersion: # 1.1.1.3.2.10, 1.2.1.1.1.10
era-sh:ETCSShape sh:sparql era-sh:EtcsMVersionSKOS.
era-sh:EtcsMVersionSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsMVersion  ;     era:affectedClass  era:ETCS;     era:scope "local";     
    rdfs:comment "ETCS_M version according to SRS 7.5.1.9 "@en ;
	era:rinfIndex "1.1.1.3.2.10" ;
    era:rinfIndex "1.1.1.3.2.10" ;
    sh:message "Indication of the etcsMVersion (1.1.1.3.2.10, 1.1.1.3.2.10):): The ETCS {$this}  has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/etcs-m-versions/ETCSMVersions."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept (era:etcsMVersion AS ?path)
    WHERE {
        $this era:etcsMVersion ?concept .
        era:etcsMVersion era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# etcsMVersion: # 1.1.1.3.2.10, 1.2.1.1.1.10
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:EtcsMVersionApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:EtcsMVersionApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:EtcsMVersionApplicability .
era-sh:EtcsMVersionApplicability
	a sh:SPARQLConstraint ; 
	era:affectedProperty era:etcsMVersion  ;     
	era:affectedClass  era:ETCS;     
	era:scope "local";     
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 contains 1. Related to rule for etcsLevelType "@en ;
	era:rinfIndex "1.1.1.3.2.10" ;
    era:rinfIndex "1.2.1.1.1.10" ;
	sh:message "etcsMVersion (1.1.1.3.2.10, 1.2.1.1.1.10): The ETCS {$this} ({?thisLabel}), has a ETCS level type '1' which makes the etcsMVersion parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
	sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:etcsMVersion AS ?path)
    WHERE {
        $this era:etcsLevelType <http://data.europa.eu/949/concepts/etcs-levels/20> .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:etcsMVersion ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:etcsMVersion } .
    }
    """ .


# etcsLevelType: # 1.1.1.3.2.1, 1.2.1.1.1.1
era-sh:ETCSShape sh:property era-sh:EtcsLevelType.
era-sh:EtcsLevelType
	a sh:PropertyShape ; era:affectedProperty era:etcsLevelType  ;     era:affectedClass  era:ETCS;     era:scope "local";     
	rdfs:comment "Indicates the type associated as a SKOS concept from the era:ETCSLevel related to the track side equipment. "@en ;
	era:rinfIndex "1.1.1.3.2.1" ;
    era:rinfIndex "1.2.1.1.1.1" ;
	sh:path era:etcsLevelType ;
	sh:maxCount 1 ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "etcsLevelType (1.1.1.3.2.1, 1.2.1.1.1.1): The ETCS has at most one etcsLevelType value and it must be an IRI. This error is due to the ETCS having more than one value or having a value that is not an IRI."@en .

# etcsLevelType: # 1.1.1.3.2.1, 1.2.1.1.1.1
era-sh:ETCSShape sh:sparql era-sh:EtcsLevelTypeSKOS.
era-sh:EtcsLevelTypeSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsLevelType  ;     era:affectedClass  era:ETCS;     era:scope "local";     
    rdfs:comment "Indicates the type associated as a SKOS concept from the era:ETCSLevel related to the track side equipment. "@en ;
	era:rinfIndex "1.1.1.3.2.10" ;
    era:rinfIndex "1.2.1.1.1.1" ;
    sh:message "Indication of the etcsLevelType (1.1.1.3.2.1, 1.2.1.1.1.1): The ETCS {$this}  has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/etcs-levels/."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept (era:etcsLevelType AS ?path)
    WHERE {
        $this era:etcsLevelType ?concept .
        era:etcsLevelType era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# etcsTransmitsTrackConditions: 1.1.1.3.2.12, 1.2.1.1.1.12
era-sh:ETCSShape sh:property era-sh:EtcsTransmitsTrackConditions.
era-sh:EtcsTransmitsTrackConditions
	a sh:PropertyShape;
    era:affectedProperty era:etcsTransmitsTrackConditions;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "If the trackside does not provide Track Conditions, the driver will need to be informed about such conditions via alternative methods. "@en ; 
	era:rinfIndex "1.1.1.3.2.12", "1.2.1.1.1.12" ;
	sh:path era:etcsTransmitsTrackConditions ;
	sh:maxCount 1 ; # Functional property
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "etcsTransmitsTrackConditions (1.1.1.3.2.12, 1.2.1.1.1.12): Each Track may define the existence of ETCS trackside engineered to transmit Track Conditions. This error is due to having more than one value or having a value that is not Y/N (boolean)."@en .

# etcsTransmitsTrackConditions: 1.1.1.3.2.12, 1.2.1.1.1.12
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:EtcsTransmitsTrackConditionsApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:EtcsTransmitsTrackConditionsApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:EtcsTransmitsTrackConditionsApplicability .
era-sh:EtcsTransmitsTrackConditionsApplicability
	a sh:SPARQLConstraint ; 
	era:affectedProperty era:etcsTransmitsTrackConditions  ;     
	era:affectedClass  era:ETCS;     
	era:scope "local";     
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.12", "1.2.1.1.1.12" ;
	sh:message "etcsTransmitsTrackConditions (1.1.1.3.2.12.1, 1.2.1.1.1.12.1): The ETCS {$this} ({?thisLabel}), has a ETCS level type which makes the etcsTransmitsTrackConditions parameter applicable. This error is due to {$this} not having a value for such a parameter."@en;
	sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:etcsTransmitsTrackConditions AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:etcsTransmitsTrackConditions ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:etcsTransmitsTrackConditions } .
    }
    """ .

# etcsTransmittedTrackConditions: # 1.1.1.3.2.12.1, 1.2.1.1.1.12.1
era-sh:ETCSShape sh:property era-sh:EtcsTransmittedTrackConditions.
era-sh:EtcsTransmittedTrackConditions
	a sh:PropertyShape ; 
	era:affectedProperty era:etcsTransmittedTrackConditions  ;     
	era:affectedClass  era:ETCS;     
	era:scope "local";     
	rdfs:comment "Transmittable track conditions by the CCSSubsystem, as per CCS TSI. "@en ;
	era:rinfIndex "1.1.1.3.2.12.1", "1.2.1.1.1.12.1" ;
	sh:path era:etcsTransmittedTrackConditions ;
	sh:maxCount 1 ; # Functional property
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "etcsTransmittedTrackConditions (1.1.1.3.2.12.1, 1.2.1.1.1.12.1): The ETCS has at most one etcsTransmittedTrackConditions value and it must be an IRI. This error is due to the ETCS having more than one value or having a value that is not an IRI."@en .

# etcsTransmittedTrackConditions: # 1.1.1.3.2.12.1, 1.2.1.1.1.12.1
era-sh:ETCSShape sh:sparql era-sh:EtcsTransmittedTrackConditionsSKOS.
era-sh:EtcsTransmittedTrackConditionsSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsTransmittedTrackConditions  ;     
	era:affectedClass  era:ETCS;     
	era:scope "local";     
    rdfs:comment "Transmittable track conditions by the CCSSubsystem, as per CCS TSI. "@en ;
	era:rinfIndex "1.1.1.3.2.12.1", "1.2.1.1.1.12.1" ;
    sh:message "etcsTransmittedTrackConditions (1.1.1.3.2.12.1, 1.2.1.1.1.12.1): The ETCS {$this}  has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/etcs-transmitted-tcs/TransmittedTrackConditions."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept (era:etcsTransmittedTrackConditions AS ?path)
    WHERE {
        $this era:etcsTransmittedTrackConditions ?concept .
        era:etcsTransmittedTrackConditions era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# etcsTransmittedTrackConditions: # 1.1.1.3.2.12.1, 1.2.1.1.1.12.1
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:EtcsTransmittedTrackConditionsApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:EtcsTransmittedTrackConditionsApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:EtcsTransmittedTrackConditionsApplicability .
era-sh:EtcsTransmittedTrackConditionsApplicability
	a sh:SPARQLConstraint ; 
	era:affectedProperty era:etcsTransmittedTrackConditions  ;     
	era:affectedClass  era:ETCS;     
	era:scope "local";     
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.12.1" , "1.2.1.1.1.12.1" ;
	sh:message "etcsTransmittedTrackConditions (1.1.1.3.2.12.1, 1.2.1.1.1.12.1): The ETCS {$this} ({?thisLabel}), has a ETCS level type which makes the etcsTransmittedTrackConditions parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ; 
	sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:etcsTransmittedTrackConditions AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:etcsTransmittedTrackConditions ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:etcsTransmittedTrackConditions } .
    }
    """ .

# etcsSystemCompatibility: 1.1.1.3.2.9, 1.2.1.1.1.9
era-sh:ETCSShape sh:property era-sh:EtcsSystemCompatibility.
era-sh:EtcsSystemCompatibility
	a sh:PropertyShape ; 
	era:affectedProperty era:etcsSystemCompatibility  ;     
	era:affectedClass  era:ETCS;     
	era:scope "local";     
	rdfs:comment "ETCS requirements used for demonstrating technical compatibility. "@en ;
	era:rinfIndex "1.1.1.3.2.9", "1.2.1.1.1.9" ;
	sh:path era:etcsSystemCompatibility ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "etcsSystemCompatibility (1.1.1.3.2.9, 1.2.1.1.1.9): The ETCS has a etcsSystemCompatibility value that must be an IRI. This error is due to the ETCS having a value that is not an IRI."@en .

# etcsSystemCompatibility: 1.1.1.3.2.9, 1.2.1.1.1.9
era-sh:ETCSShape sh:sparql era-sh:EtcsSystemCompatibilitySKOS.
era-sh:EtcsSystemCompatibilitySKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsSystemCompatibility  ;     
	era:affectedClass  era:ETCS;     
	era:scope "local";     
    rdfs:comment "ETCS requirements used for demonstrating technical compatibility. "@en ;
	era:rinfIndex "1.1.1.3.2.9", "1.2.1.1.1.9" ;
    sh:message "etcsSystemCompatibility (1.1.1.3.2.9, 1.2.1.1.1.9): The ETCS {$this}  has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/etcs-system-compatibilities/ETCSSystemCompatibilities."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept (era:etcsSystemCompatibility AS ?path)
    WHERE {
        $this era:etcsSystemCompatibility ?concept .
        era:etcsSystemCompatibility era:inSkosConceptScheme ?conceptScheme .
        FILTER (NOT EXISTS {?concept skos:inScheme ?conceptScheme} || REGEX(STR(?concept), "/eratv/"))
	}
""" .

# etcsSystemCompatibility: 1.1.1.3.2.9, 1.2.1.1.1.9
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:EtcsSystemCompatibilityApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:EtcsSystemCompatibilityApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:EtcsSystemCompatibilityApplicability .
era-sh:EtcsSystemCompatibilityApplicability
	a sh:SPARQLConstraint ; 
	era:affectedProperty era:etcsSystemCompatibility  ;     
	era:affectedClass  era:ETCS;     
	era:scope "local";     
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.9" , "1.2.1.1.1.9" ;
	sh:message "etcsSystemCompatibility (1.1.1.3.2.9, 1.2.1.1.1.9): The ETCS {$this} ({?thisLabel}), has a ETCS level type which makes the etcsSystemCompatibility parameter applicable. This error is due to {$this} not having a value for such a parameter."@en;
	sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:etcsSystemCompatibility AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:etcsSystemCompatibility ?value } .
    }
    """ .


###################################
# Rules for ERTMSErrorChangeRequest
###################################

era-sh:ERTMSErrorChangeRequestShape
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:ERTMSErrorChangeRequest ;
    sh:property era-sh:ChangeRequestPreventsService .

# era-sh:ChangeRequestPreventsService
era-sh:ChangeRequestPreventsService
    a sh:PropertyShape ;
    era:affectedProperty era:changeRequestPreventsService ;
    era:affectedClass era:ERTMSErrorChangeRequest ;
    era:scope "local" ;
    rdfs:comment "Indicates whether the given ERTMS error change request may prevent the system from providing normal service if not implemented or applied."@en ;
    sh:path era:changeRequestPreventsService ;
    sh:datatype xsd:boolean ;
    sh:maxCount 1 ;
    sh:severity sh:Violation ;
    sh:message "changeRequestPreventsService: Indicates whether the given ERTMS error change request may prevent the system from providing normal service if not implemented or applied. This error is due to having more than one value for this property or having a value that is not a boolean."@en .

###################################
# Rules for features
###################################


era-sh:FeatureShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:Feature .  


# validity
era-sh:FeatureShape sh:property era-sh:Validity .
era-sh:Validity
	a sh:PropertyShape;
    era:affectedClass era:Feature;
    era:affectedProperty era:validity ;
    era:scope "local";
	rdfs:comment "Relates a feature with a temporal feature to indicate a validity period. "@en ;
	sh:path era:validity ;
	sh:class era:TemporalFeature;
	sh:severity sh:Violation ;
	sh:message "validity: The feature has a validity value that points to an instance of TemporalFeature. This error is due to having a value that is not an instance of TemporalFeature."@en .

# hasGeometry: # 1.2.0.0.0.5, 1.1.0.0.1.1, 1.1.1.0.1.1, 1.1.1.3.14.6, 1.2.1.0.8.5
era-sh:FeatureShape sh:property era-sh:HasGeometry .
era-sh:HasGeometry
	a sh:PropertyShape;
    era:affectedClass era:Feature;
    era:affectedProperty geosparql:hasGeometry ;
    era:scope "local";
	rdfs:comment "Geographical coordinates in decimal degrees normally given for the centre of the OP. "@en ;
	era:rinfIndex "1.2.0.0.0.5", "1.1.0.0.1.1", "1.1.1.0.1.1", "1.1.1.3.14.6", "1.2.1.0.8.5" ;
	sh:path geosparql:hasGeometry ;
    # sh:node era-sh:GeometryShape; not implemented in the shacl engine
	sh:maxCount 1 ;
	sh:nodeKind sh:IRI ;
	sh:class geosparql:Geometry;
	sh:severity sh:Violation ;
	sh:message "hasGeometry (1.2.0.0.0.5):  Each feature must have at most one location. This error may be due to having a feature with more than one location or having a value that is not a geosparql:Geometry."@en .

#
# location TODO precision of decimals

era-sh:GeometryShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
 	sh:targetClass geosparql:Geometry .

# geosparql:asWKT
era-sh:GeometryShape sh:property era-sh:AsWKT .
era-sh:AsWKT
    a sh:PropertyShape;
    era:affectedClass geosparql:Geometry;
    era:affectedProperty geosparql:asWKT ;
    era:scope "local";
    sh:path geosparql:asWKT ;
 	sh:maxCount 1 ;
 	sh:datatype geosparql:wktLiteral ;
 	sh:severity sh:Violation ;
 	sh:message "geosparql:Geometry. This error may be due to having a Geometry with more than one asWKT property or its value is not of the wktLiteral type."@en .

# geosparql:asWKT - future required (warning level)
era-sh:GeometryShape sh:property era-sh:AsWKTFutureRequired .
era-sh:AsWKTFutureRequired
	a sh:PropertyShape ;
	era:affectedProperty geosparql:asWKT ;
	era:affectedClass geosparql:Geometry ;
	era:scope "local" ;
	sh:path geosparql:asWKT ;
	sh:minCount 1 ;
	sh:severity sh:Warning ;
	sh:message "This property is not yet required but will be 12 months after publication of Article 7 Guide."@en .


# HABD
era-sh:HABDShape  
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:HABD .

era-sh:HABDShapeSPARQLWarning
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:HABD ;
    sh:severity sh:Warning .

# tracksideHabd
era-sh:RunningTrackShape sh:property era-sh:TracksideHabd .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:TracksideHabd .
era-sh:TracksideHabd
	a sh:PropertyShape ;
    era:affectedProperty era:tracksideHabd ;
    era:affectedClass era:RunningTrack ;
    era:scope "local" ;
	rdfs:comment "Link between the running track and the HABD, covering the RINF parameters 1.1.1.1.7.(5-9)."@en ;
	sh:path era:tracksideHabd ;
	sh:class era:HABD ;
	sh:severity sh:Violation ;
	sh:message "tracksideHabd: The track may have hot axle box detector (HABD) references and each must be an instance of HABD. This error may be due to having a value that is not an instance of HABD."@en .

# hotAxleBoxDetectorDirection: # 1.1.1.1.7.9
era-sh:HABDShape sh:property era-sh:HotAxleBoxDetectorDirection.
era-sh:HotAxleBoxDetectorDirection
	a sh:PropertyShape ; 
    era:affectedProperty era:hotAxleBoxDetectorDirection  ;
    era:affectedClass  era:HABD;
    era:scope "local";
	rdfs:comment "Direction of measurement of the trackside HABD."@en ;
	era:rinfIndex "1.1.1.1.7.9" ;
	sh:path era:hotAxleBoxDetectorDirection ;
	sh:maxCount 1 ;
	sh:nodeKind sh:IRI ;
    sh:class skos:Concept ;
    sh:severity sh:Violation ;
	sh:message "hotAxleBoxDetectorDirection (1.1.1.1.7.9): The HABD must have at most one direction of measurement of the hot axle box detector value that is an IRI. This error may be due to HABD having more than one value of hot axle box detector direction, or having a value that is not an IRI."@en .

# hotAxleBoxDetectorDirection: # 1.1.1.1.7.9
era-sh:HABDShape sh:sparql era-sh:HotAxleBoxDetectorDirectionSKOS.
era-sh:HotAxleBoxDetectorDirectionSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:hotAxleBoxDetectorDirection  ;
    era:affectedClass  era:HABD;
    era:scope "local";
    rdfs:comment "Direction of measurement of the trackside HABD."@en ;
	era:rinfIndex "1.1.1.1.7.9" ;
    sh:message "Indication of the hotAxleBoxDetectorDirection (1.1.1.1.7.9):): The HABD {$this} has a value {?concept} through the era:hotAxleBoxDetectorDirection property that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/hot-axle-box-detector-direction/HotAxleBoxDetectorDirections."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept (era:hotAxleBoxDetectorDirection AS ?path)
    WHERE {
        $this era:hotAxleBoxDetectorDirection ?concept .
        era:hotAxleBoxDetectorDirection era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# 1.1.1.1.7.9 hotAxleBoxDetectorDirection applicability
era-sh:HABDShapeSPARQLWarning sh:sparql era-sh:HotAxleBoxDetectorDirectionApplicability .
era-sh:HotAxleBoxDetectorDirectionApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:hotAxleBoxDetectorDirection;
    era:affectedClass era:HABD;
    era:scope "local";
	rdfs:comment "Specific for the French Italian and Swedish networks. If the direction of measurement is: - the same as the direction defined by the start and end of the SoL: (N); - the opposite to the direction defined by the start and end of the SoL: (O); - both directions: (B). “Y” if the answer to parameter 1.1.1.1.7.5 is “N”."@en ;
	era:rinfIndex "1.1.1.1.7.9" ;
    sh:message "hotAxleBoxDetectorDirection (1.1.1.1.7.9): This error is due to HABD {?label}, violating the rule: “Y” if the answer to parameter 1.1.1.1.7.5 is “N”"@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    SELECT DISTINCT $this ?label (era:hotAxleBoxDetectorDirection AS ?path)
			WHERE {
                
                $this rdfs:label ?label .
                $this era:hotAxleBoxDetectorTSICompliant false .				
                FILTER NOT EXISTS {$this era:hotAxleBoxDetectorDirection ?value} . 
            }
			""" .

era-sh:HABDShape sh:sparql era-sh:HotAxleBoxDetectorDirectionCountryApplicability .
era-sh:HotAxleBoxDetectorDirectionCountryApplicability
    a sh:SPARQLConstraint ;
    era:affectedProperty era:hotAxleBoxDetectorDirection ;
    era:affectedClass  era:HABD ;
    sh:message "hotAxleBoxDetectorDirection: This property may only be used for HotAxleBoxDetectors located in France, Sweden, or Italy."@en ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX eu-country: <http://publications.europa.eu/resource/authority/country/> 
        SELECT $this ?val (era:hotAxleBoxDetectorDirection AS ?path) WHERE {
          $this a era:HABD ;
                era:hotAxleBoxDetectorDirection ?val .

          {
            ?parent era:tracksideHabd $this ;
                    era:inCountry ?country .
          }

          FILTER (?country NOT IN (
            eu-country:FRA,
            eu-country:SWE,
            eu-country:ITA
          ))
        }
    """ .


# hotAxleBoxDetectorGeneration: # 1.1.1.1.7.7
era-sh:HABDShape sh:property era-sh:HotAxleBoxDetectorGeneration.
era-sh:HotAxleBoxDetectorGeneration
	a sh:PropertyShape ; 
    era:affectedProperty era:hotAxleBoxDetectorGeneration ;
    era:affectedClass  era:HABD;
    era:scope "local";   
	rdfs:comment "Applicable if trackside HABD is not TSI compliant. Generation of the trackside HABD."@en ;
	era:rinfIndex "1.1.1.1.7.7" ;
	sh:path era:hotAxleBoxDetectorGeneration ;
    sh:datatype xsd:string ;
	sh:maxCount 1 ;
	#TODO: Single selection from predefined list (waiting for update of documentation)
	sh:severity sh:Violation ;
	sh:message "hotAxleBoxDetectorGeneration (1.1.1.1.7.7): The HABD must have at most one generation of the hot axle box detector value that is a string of characters. This error may be due to having more than one value or having a value that is not a string."@en .

# 1.1.1.1.7.7	hotAxleBoxDetectorGeneration applicability
era-sh:HABDShapeSPARQLWarning sh:sparql era-sh:HotAxleBoxDetectorGenerationApplicability .
era-sh:HotAxleBoxDetectorGenerationApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:hotAxleBoxDetectorGeneration;
    era:affectedClass era:HABD;
    era:scope "local";
	rdfs:comment "Specific for the French Italian and Swedish networks. Generation of trackside hot axle box detector. “Y” if the answer to parameter 1.1.1.1.7.5 is “N”"@en ;
	era:rinfIndex "1.1.1.1.7.7" ;
    sh:message "hotAxleBoxDetectorGeneration (1.1.1.1.7.7): This error is due to HABD {?label}, violating the rule: “Y” if the answer to parameter 1.1.1.1.7.5 is “N”"@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

    SELECT DISTINCT $this ?label (era:hotAxleBoxDetectorGeneration AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:hotAxleBoxDetectorTSICompliant false .
        FILTER NOT EXISTS {$this era:hotAxleBoxDetectorGeneration ?value} .
    }
  """ .

era-sh:HABDShape sh:sparql era-sh:HotAxleBoxDetectorGenerationCountryApplicability .
era-sh:HotAxleBoxDetectorGenerationCountryApplicability
    a sh:SPARQLConstraint ;
    era:affectedProperty era:hotAxleBoxDetectorGeneration ;
    era:affectedClass  era:HABD ;
    sh:message "hotAxleBoxDetectorGeneration: This property may only be used for HotAxleBoxDetectors located in France, Sweden, or Italy."@en ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX eu-country: <http://publications.europa.eu/resource/authority/country/> 
        SELECT ?this (era:hotAxleBoxDetectorGeneration AS ?path) WHERE {
          ?this a era:HABD ;
                era:hotAxleBoxDetectorGeneration ?val .

          {
            ?parent era:tracksideHabd ?this ;
                    era:inCountry ?country .
          }

          FILTER (?country NOT IN (
            eu-country:FRA,
            eu-country:SWE,
            eu-country:ITA
          ))
        }
    """ .

# hotAxleBoxDetectorIdentification: # 1.1.1.1.7.6
era-sh:HABDShape sh:property era-sh:HotAxleBoxDetectorIdentification.
era-sh:HotAxleBoxDetectorIdentification
	a sh:PropertyShape ; 
    era:affectedProperty era:hotAxleBoxDetectorIdentification ;
    era:affectedClass  era:HABD;
    era:scope "local";    
	rdfs:comment "Specific for the French, Italian and Swedish networks. Applicable if trackside HABD is not TSI compliant. Identification of the trackside HABD."@en ;
	era:rinfIndex "1.1.1.1.7.6" ;
	sh:path era:hotAxleBoxDetectorIdentification ;
	sh:maxCount 1 ;
    #sh:minCount 1 ;
	sh:datatype xsd:string ;
	sh:severity sh:Warning ;
	sh:message "hotAxleBoxDetectorIdentification (1.1.1.1.7.6): The HABD must have at most one value that defines the identification of the hot axle box detector and the value is a character string. This error may be due to having more than one value or having a value that is not a string."@en .

# 1.1.1.1.7.6	hotAxleBoxDetectorIdentification applicability
era-sh:HABDShapeSPARQLWarning sh:sparql era-sh:HotAxleBoxDetectorIdentificationApplicability .
era-sh:HotAxleBoxDetectorIdentificationApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:hotAxleBoxDetectorIdentification;
    era:affectedClass era:HABD;
    era:scope "local";
	rdfs:comment "Specific for the French Italian and Swedish networks. Applicable if trackside HABD is not TSI compliant, identification of trackside hot axle box detector.@en";
	era:rinfIndex "1.1.1.1.7.6" ;
    sh:message "hotAxleBoxDetectorIdentification (1.1.1.1.7.6): This error is due to HABD {?label}, violating the rule: “Y” if the answer to parameter 1.1.1.1.7.5 is “N”"@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    SELECT DISTINCT $this ?label (era:hotAxleBoxDetectorIdentification AS ?path)
			WHERE {
                
                $this rdfs:label ?label .
                $this era:hotAxleBoxDetectorTSICompliant false .				
                FILTER NOT EXISTS {$this era:hotAxleBoxDetectorIdentification ?value} . 
            }
			""" .

era-sh:HABDShape sh:sparql era-sh:HotAxleBoxDetectorIdentificationCountryApplicability .
era-sh:HotAxleBoxDetectorIdentificationCountryApplicability
    a sh:SPARQLConstraint ;
    era:affectedProperty era:hotAxleBoxDetectorIdentification ;
    era:affectedClass  era:HABD ;
    sh:message "hotAxleBoxDetectorIdentification: This property may only be used for HotAxleBoxDetectors located in France, Sweden, or Italy."@en ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX eu-country: <http://publications.europa.eu/resource/authority/country/> 
        SELECT ?this (era:hotAxleBoxDetectorIdentification AS ?path) WHERE {
          ?this a era:HABD ;
                era:hotAxleBoxDetectorIdentification ?val .

          {
            ?parent era:tracksideHabd ?this ;
                    era:inCountry ?country .
          }

          FILTER (?country NOT IN (
            eu-country:FRA,
            eu-country:SWE,
            eu-country:ITA
          ))
        }
    """ .

# hotAxleBoxDetectorLocation: # 1.1.1.1.7.8
era-sh:HABDShape sh:property era-sh:HotAxleBoxDetectorLocation.
era-sh:HotAxleBoxDetectorLocation
	a sh:PropertyShape ; 
    era:affectedProperty era:hotAxleBoxDetectorLocation  ;
    era:affectedClass  era:HABD;
    era:scope "local";   
	rdfs:comment "Applicable if trackside HABD is not TSI compliant. Location of the trackside HABD."@en ;
	era:rinfIndex "1.1.1.1.7.8" ;
	sh:path era:hotAxleBoxDetectorLocation ;
	sh:datatype xsd:double ;
	sh:pattern "^(\\+|\\-)?([1-9]\\d{1,3}|[0-9])\\.\\d{1,3}$" ;
	sh:severity sh:Violation ;
	sh:message "hotAxleBoxDetectorLocation (1.1.1.1.7.8): The HABD has a location of the hot axle box detector(s) value that must be a double (real) number with format [±NNNN.NNN]. This error may be due to having a value that is not a double (real) number or does not follow the pattern [±NNNN.NNN]."@en .

# 1.1.1.1.7.8	hotAxleBoxDetectorLocation applicability
era-sh:HABDShapeSPARQLWarning sh:sparql era-sh:HotAxleBoxDetectorLocationApplicability .
era-sh:HotAxleBoxDetectorLocationApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:hotAxleBoxDetectorLocation;
    era:affectedClass era:HABD;
    era:scope "local";
	rdfs:comment "Specific for the French Italian and Swedish networks. Applicable if trackside HABD is not TSI compliant, localisation of trackside hot axle box detector."@en;
	era:rinfIndex "1.1.1.1.7.8" ;
    sh:message "hotAxleBoxDetectorLocation (1.1.1.1.7.8): This error is due to the HABD {?label}, violating the rule: “Y” if the answer to parameter 1.1.1.1.7.5 is “N”"@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    SELECT DISTINCT $this ?label (era:hotAxleBoxDetectorLocation AS ?path)
			WHERE {
                
                $this rdfs:label ?label .
                $this era:hotAxleBoxDetectorTSICompliant false .				
                FILTER NOT EXISTS {$this era:hotAxleBoxDetectorLocation ?value} . 
            }
			""" .

era-sh:HABDShape sh:sparql era-sh:HotAxleBoxDetectorLocationCountryApplicability .
era-sh:HotAxleBoxDetectorLocationCountryApplicability
    a sh:SPARQLConstraint ;
    era:affectedProperty era:hotAxleBoxDetectorLocation ;
    era:affectedClass  era:HABD ;
    sh:message "hotAxleBoxDetectorLocation: This property may only be used for HotAxleBoxDetectors located in France, Sweden, or Italy."@en ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX eu-country: <http://publications.europa.eu/resource/authority/country/> 
        SELECT ?this (era:hotAxleBoxDetectorLocation AS ?path) WHERE {
          ?this a era:HABD ;
                era:hotAxleBoxDetectorLocation ?val .

          {
            ?parent era:tracksideHabd ?this ;
                    era:inCountry ?country .
          }

          FILTER (?country NOT IN (
            eu-country:FRA,
            eu-country:SWE,
            eu-country:ITA
          ))
        }
    """ .

# hotAxleBoxDetectorTSICompliant: # 1.1.1.1.7.5
era-sh:HABDShape sh:property era-sh:HotAxleBoxDetectorTSICompliant.
era-sh:HotAxleBoxDetectorTSICompliant
	a sh:PropertyShape ; 
    era:affectedProperty era:hotAxleBoxDetectorTSICompliant ;
    era:affectedClass  era:HABD;
    era:scope "local";  
	rdfs:comment "Trackside HABD compilant to TSI means that the HABD is compliant with EN 15437:2009 and specific cases mentioned in TSIs."@en ;
	era:rinfIndex "1.1.1.1.7.5" ;
	sh:path era:hotAxleBoxDetectorTSICompliant ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "hotAxleBoxDetectorTSICompliant (1.1.1.1.7.5): The HABD must have at most one value that defines if the hot axle box detector is TSI compliant and the value is Y/N (boolean). This error may be due to having more than one value or having a value that is not Y/N (boolean)."@en .

era-sh:HABDShape sh:sparql era-sh:HotAxleBoxDetectorTSICompliantCountryApplicability .
era-sh:HotAxleBoxDetectorTSICompliantCountryApplicability
    a sh:SPARQLConstraint ;
    era:affectedProperty era:hotAxleBoxDetectorTSICompliant ;
    era:affectedClass  era:HABD ;
    sh:message "hotAxleBoxDetectorTSICompliant: This property may only be used for HotAxleBoxDetectors located in France, Sweden, or Italy."@en ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX eu-country: <http://publications.europa.eu/resource/authority/country/> 
        SELECT ?this (era:hotAxleBoxDetectorTSICompliant AS ?path) WHERE {
          ?this a era:HABD ;
                era:hotAxleBoxDetectorTSICompliant ?val .

          {
            ?parent era:tracksideHabd ?this ;
                    era:inCountry ?country .
          }

          FILTER (?country NOT IN (
            eu-country:FRA,
            eu-country:SWE,
            eu-country:ITA
          ))
        }
    """ .



###################################
# Rules for infrastructure elements
###################################

era-sh:CommonCharacteristicsSubsetShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:CommonCharacteristicsSubset .

era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:CommonCharacteristicsSubset ;
    sh:severity sh:Warning .



era-sh:InfrastructureElementShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:InfrastructureElement .

era-sh:InfrastructureElementShape sh:property era-sh:RdfsLabel .

era-sh:ParameterApplicabilityShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:ParameterApplicability.

era-sh:SubsidiaryLocationShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:SubsidiaryLocation.



###################################
# Generic rdfs:label shape for all InfrastructureElement subclasses
###################################

# rdfs:label - Generic property shape that can be applied to any class that requires a label
era-sh:RdfsLabel
	a sh:PropertyShape ;
    era:affectedProperty rdfs:label ;
    era:scope "local" ;
	sh:path rdfs:label ;
	sh:datatype rdf:langString ;
    sh:nodeKind sh:Literal ;
    sh:uniqueLang true ;
	sh:severity sh:Violation ;
	sh:message "rdfs:label: Each element must have at least one label in English (@en). Additional multilingual labels are allowed, but only one value per language tag is permitted. All values must be language-tagged string literals."@en ;
	sh:sparql era-sh:LangStringEnRequired .

# infrastructureManager
era-sh:InfrastructureElementShape sh:property era-sh:InfrastructureManager .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:InfrastructureManager .
era-sh:InfrastructureManager
	a sh:PropertyShape ;
    era:affectedProperty era:infrastructureManager ;
    era:affectedClass era:CommonCharacteristicsSubset, era:InfrastructureElement;
    era:scope "local" ;
	rdfs:comment "Relates a subset with common characteristics with its IM, represented by an instance of organisation role."@en ;
	sh:path era:infrastructureManager ;
	sh:class era:OrganisationRole ;
	sh:severity sh:Violation ;
	sh:message "infrastructureManager: The subset with common characteristics must refer to an infrastructure manager that is an instance of OrganisationRole. This error may be due to having a value that is not an instance of OrganisationRole."@en .

# organisationCode: # 1.2.1.0.6.1, 1.1.0.0.0.1, 1.1.1.1.8.1, 1.2.1.0.0.1, 1.2.1.0.5.1, 1.2.2.0.0.1, 1.2.2.0.5.1 Check that the organisationRole instance points to the skos value for infrastructure manager.
era-sh:InfrastructureElementShape sh:sparql era-sh:InfrastructureManagerSKOSValue .
era-sh:InfrastructureManagerSKOSValue
	a sh:SPARQLConstraint;
    era:affectedProperty era:hasOrganisationRole;
    era:affectedProperty era:infrastructureManager;
    era:affectedProperty era:belongsTo;
    era:affectedClass era:InfrastructureElement;
    era:affectedClass era:CommonCharacteristicsSubset;
    era:affectedClass era:OrganisationRole;
    era:scope "local";   
	rdfs:comment "Each infrastructure element can only be submitted by one infrastructure manager, represented by a four-digit code. "@en ;
	era:rinfIndex "1.2.1.0.6.1" ;
    era:rinfIndex "1.1.0.0.0.1" ;
    era:rinfIndex "1.1.1.1.8.1" ;
    era:rinfIndex "1.2.1.0.0.1" ;
    era:rinfIndex "1.2.1.0.5.1" ;
    era:rinfIndex "1.2.2.0.0.1" ;
    era:rinfIndex "1.2.2.0.5.1" ;
    sh:message "imCode (1.2.1.0.6.1): Each infrastructure element {$this} with label {?label} refers to a network (subset with common characteristics), that in turn refers to an instance of an OrganisationRole. This instance must have an era:organisationRole pointing to the value era-organisation-roles:IM in the orgRoles SKOS concept scheme. The error is due to a {?value} different from <http://data.europa.eu/949/concepts/organisation-roles/IM>"@en ;
    sh:prefixes era:;
    sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?label ?value (era:hasOrganisationRole AS ?path)
    WHERE {
        $this a era:InfrastructureElement .
        $this era:belongsTo ?subset .
        ?subset era:infrastructureManager ?orgRole .
        ?orgRole era:hasOrganisationRole ?value .
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        FILTER(?value != <http://data.europa.eu/949/concepts/organisation-roles/IM>) .
    }
    """ .

# inCountry 
era-sh:InfrastructureElementShape sh:property era-sh:InCountry .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:InCountry .
era-sh:InCountry
	a sh:PropertyShape;
    era:affectedProperty era:inCountry;
    era:affectedClass era:InfrastructureElement;
    era:scope "local";
	rdfs:comment "Indicates the country to which the infrastructure element belongs "@en ; 
	sh:path era:inCountry ;
	sh:maxCount 1 ;
	sh:nodeKind sh:IRI;
	sh:severity sh:Violation ;
	sh:message "inCountry:  Each infrastructure element must have exactly one country. This error may be due to having an infrast without or with more than one country or it value is not a Concept."@en .

# inCountry
era-sh:InfrastructureElementShape sh:sparql era-sh:InCountrySKOS .
era-sh:InCountrySKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:inCountry;
    era:affectedClass era:InfrastructureElement;
    era:scope "local";
	rdfs:comment "Indicates the country to which the infrastructure element belongs "@en ;
	sh:message "The infrastructure element {$this} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://publications.europa.eu/resource/authority/country."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    SELECT $this ?concept (era:inCountry AS ?path)
    WHERE {
 		$this era:inCountry ?concept .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme <http://publications.europa.eu/resource/authority/country> .
		}
	}
""" .

# parameterApplicability
era-sh:InfrastructureElementShape sh:property era-sh:ParameterApplicability .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:ParameterApplicability .
era-sh:ParameterApplicability
	a sh:PropertyShape;
    era:affectedClass era:InfrastructureElement;
    era:affectedProperty era:parameterApplicability ;
    era:scope "local";
	rdfs:comment "Applicability interval that defines the date interval in which a characteristic of an infrastructure element is applicable. This interval can be applied for any of the technical characteristics or general information of infrastructure elements. This helps identifying planned changes applied to technical parameters over time. "@en ;
	sh:path era:parameterApplicability ;
	sh:class era:ParameterApplicability;
    # sh:node era-sh:ParameterApplicabilityShape; not implemented in the shacl engine
	sh:severity sh:Violation ;
	sh:message "parameterApplicability: The infratructure element may have a parameterApplicability reference that must be an instance of ParameterApplicability. This error is due to having having a value that is not an instance of ParameterApplicability."@en .

# belongsTo, organisationCode, infrastructureElement
era-sh:InfrastructureElementShape sh:sparql era-sh:BelongsToUniqueIM .
era-sh:BelongsToUniqueIM
	a sh:SPARQLConstraint ;
    era:affectedProperty era:belongsTo;
    era:affectedProperty era:organisationCode;
    era:affectedProperty era:infrastructureManager;
    era:affectedClass era:InfrastructureElement;
    era:affectedClass era:CommonCharacteristicsSubset;
    era:affectedClass era:OrganisationRole;
    era:affectedClass era:Body;
    era:scope "local";
    rdfs:comment "Each infrastructure element may belong to several common characteristics subsets, and each of them must point to the same infrastructure manager (same organisationCode in the Body linked via OrganisationRole/roleOf)."@en ;
    sh:message "belongsTo, organisationCode, infrastructureElement: This error is due to {$this} belonging to several common characteristics subsets, {?subset1Label}, {?subset2Label} that do not point to the same infrastructure manager (different organisationCodes on the roleOf Body), {?orgCode1}, {?orgCode2}."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?subset1Label ?subset2Label ?orgCode1 ?orgCode2 (era:belongsTo AS ?path)
    WHERE {
        $this era:belongsTo ?subset1 .
        $this era:belongsTo ?subset2 .
        FILTER(?subset1 != ?subset2) .
        FILTER(STR(?subset1) < STR(?subset2)) .
        ?subset1 era:infrastructureManager ?orgRole1 .
        ?subset2 era:infrastructureManager ?orgRole2 .
        ?orgRole1 era:roleOf ?body1 .
        ?orgRole2 era:roleOf ?body2 .
        ?body1 era:organisationCode ?orgCode1 .
        ?body2 era:organisationCode ?orgCode2 .
        FILTER(?orgCode1 != ?orgCode2) .
        OPTIONAL { ?subset1 rdfs:label ?subset1Label0 } .
        BIND(COALESCE(?subset1Label0, "unknown label") AS ?subset1Label)
        OPTIONAL { ?subset2 rdfs:label ?subset2Label0 } .
        BIND(COALESCE(?subset2Label0, "unknown label") AS ?subset2Label)
    }
    """ .

# belongsTo
era-sh:InfrastructureElementShape sh:property era-sh:BelongsTo .
era-sh:BelongsTo
	a sh:PropertyShape;
    era:affectedClass era:InfrastructureElement;
    era:affectedProperty era:belongsTo ;
    era:scope "local";
	rdfs:comment "Relationship between an infratructure element and a common characteristics subset. "@en ;
	sh:path era:belongsTo ;
	sh:class era:CommonCharacteristicsSubset;
	sh:severity sh:Violation ;
	sh:message "belongsTo: The infratructure element may belong to a common characteristics subset, a reference that must be an instance of CommonCharacteristicsSubset. This error is due to having a value that is not an instance of CommonCharacteristicsSubset."@en .

# contains - inverse of belongsTo
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:Contains .
era-sh:Contains
	a sh:PropertyShape;
    era:affectedClass era:CommonCharacteristicsSubset;
    era:affectedProperty era:contains ;
    era:scope "local";
	rdfs:comment "Relationship between a common characteristics subset and an infrastructure element (inverse of belongsTo). "@en ;
	sh:path era:contains ;
	sh:class era:InfrastructureElement;
	sh:severity sh:Violation ;
	sh:message "contains: The subset with common characteristics may contain an infrastructure element, a reference that must be an instance of InfrastructureElement. This error is due having a value that is not an instance of InfrastructureElement."@en .

# netReference
era-sh:InfrastructureElementShape sh:property era-sh:NetReference .
era-sh:LinearPositioningSystemShape sh:property era-sh:NetReference .
era-sh:NetReference
	a sh:PropertyShape;
    era:affectedClass era:InfrastructureElement;
    era:affectedProperty era:netReference ;
    era:scope "local";
	rdfs:comment "The reference that a physical insfrastructure element has it on the topology. It may be used to define the positioning or a representation as a point. line or area. "@en ;
	sh:path era:netReference ;
	sh:class era:NetBasicReference;
	sh:severity sh:Violation ;
	sh:message "netReference: The infratructure element must have a net reference that points to an instance of NetBasicReference. This error is due to having a value that is not an instance of NetBasicReference."@en .



# primaryLocation: #
era-sh:InfrastructureElementShape sh:property era-sh:PrimaryLocation .
era-sh:PrimaryLocation
	a sh:PropertyShape;
    era:affectedClass era:InfrastructureElement;
    era:affectedProperty era:primaryLocation ;
    era:scope "local"; 
	rdfs:comment "Primary location code developed for information exchange in accordance with the TSIs relating to the telematics applications subsystem. "@en ; 
	sh:path era:primaryLocation ;
	sh:class era:PrimaryLocation;
    # sh:node era-sh:PrimaryLocationShape; not implemented in the shacl engine
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "primaryLocation: The infrastructure element has a primaryLocation reference that must be an IRI that refers to an instance of PrimaryLocation."@en .

# hasPart: 
era-sh:InfrastructureElementShape sh:property era-sh:HasPart .
era-sh:HasPart
	a sh:PropertyShape;
    era:affectedClass era:InfrastructureElement;
    era:affectedProperty era:hasPart ;
    era:scope "local"; 
	rdfs:comment "Indicates that an infrastructure element is composed of one or more other (distinct) infrastructure elements."@en ; 
	sh:path era:hasPart ;
	sh:class era:InfrastructureElement;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "hasPart: The InfrastructureElement may have a hasPart reference that is an IRI that refers to an instance of InfrastructureElement. This error is due to having a value that is not an instance of InfrastructureElement."@en .

# isPartOf:
era-sh:InfrastructureElementShape sh:property era-sh:IsPartOf .
era-sh:IsPartOf
	a sh:PropertyShape;
    era:affectedClass era:InfrastructureElement;
    era:affectedProperty era:isPartOf ;
    era:scope "local"; 
	rdfs:comment "Indicates that an infrastructure element is a part of another (distinct) infrastructure element."@en ; 
	sh:path era:isPartOf ;
	sh:class era:InfrastructureElement;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "hasPart: The InfrastructureElement may have a isPartOf reference that is an IRI that refers to an instance of InfrastructureElement. This error is due to having a value that is not an instance of InfrastructureElement."@en .

#
# not yet available (notYetAvailable)
#
era-sh:InfrastructureElementShape sh:property era-sh:NotYetAvailableProperty .
era-sh:NotYetAvailableProperty
        a sh:PropertyShape;
        era:affectedProperty era:notYetAvailable;
        era:affectedClass era:InfrastructureElement;
        era:scope "local";
		sh:path era:notYetAvailable ;  
        rdfs:comment "Reference to a property that is not provided."@en ;
		sh:nodeKind sh:IRI ;
        sh:or (
 		[sh:class owl:ObjectProperty ;]
		[sh:class owl:DatatypeProperty ;]
		);
        sh:severity sh:Violation ;
		sh:message "The value of this property is a reference to an ontology property that is not provided and it must be an IRI. The error may be due to the property not belonging to the ERA ontology or the property not being an IRI."@en .

#
# not applicable (notApplicable)
#
era-sh:InfrastructureElementShape sh:property era-sh:NotApplicableProperty .
era-sh:NotApplicableProperty
        a sh:PropertyShape;
        era:affectedProperty era:notApplicable;
        era:affectedClass era:InfrastructureElement;
        era:scope "local";
		sh:path era:notApplicable ;  
        rdfs:comment "Reference to a property that is not applicable."@en ;
		sh:nodeKind sh:IRI ;
        sh:or (
 		[sh:class owl:ObjectProperty ;]
		[sh:class owl:DatatypeProperty ;]
		);
        sh:severity sh:Violation ;
		sh:message "The value of this property is a reference to an ontology property that is not provided and it must be an IRI. The error may be due to the property not belonging to the ERA ontology or the property not being an IRI."@en .

# subsetOf: 
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:SubsetOf .
era-sh:SubsetOf
	a sh:PropertyShape;
    era:affectedClass era:CommonCharacteristicsSubset;
    era:affectedProperty era:subsetOf ;
    era:scope "local"; 
	rdfs:comment "Relates a subset with common chatacteristics with another subset with common characteristics. "@en ; 
	sh:path era:subsetOf ;
	sh:class era:CommonCharacteristicsSubset;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "subsetOf: The common characteristics subset must have a subsetOf reference that is an IRI that refers to an instance of another common characteristics subset. This error is due to having a value that is not an instance of CommonCharacteristicsSubset."@en .

# exemptSpecialVehiclesFromATO
era-sh:InfrastructureElementShape sh:property era-sh:ExemptSpecialVehiclesFromATO .
era-sh:ExemptSpecialVehiclesFromATO
    a sh:PropertyShape ;
    era:affectedClass era:InfrastructureElement ;
    era:affectedProperty era:exemptSpecialVehiclesFromATO ;
    era:scope "local" ;
    rdfs:comment "Indicates whether special vehicles are exempted from the need to install ATO (Automatic Train Operation)."@en ;
    sh:path era:exemptSpecialVehiclesFromATO ;
    sh:datatype xsd:boolean ;
    sh:severity sh:Warning ;
    sh:message "exemptSpecialVehiclesFromATO: Value must be a boolean indicating whether special vehicles are exempt from ATO installation."@en .

# exemptSpecialVehiclesFromRMR
era-sh:InfrastructureElementShape sh:property era-sh:ExemptSpecialVehiclesFromRMR .
era-sh:ExemptSpecialVehiclesFromRMR
    a sh:PropertyShape ;
    era:affectedClass era:InfrastructureElement ;
    era:affectedProperty era:exemptSpecialVehiclesFromRMR ;
    era:scope "local" ;
    rdfs:comment "Indicates whether special vehicles are exempted from the need to install RMR (Railway Mobile Radio)."@en ;
    sh:path era:exemptSpecialVehiclesFromRMR ;
    sh:datatype xsd:boolean ;
    sh:severity sh:Warning ;
    sh:message "exemptSpecialVehiclesFromRMR: Value must be a boolean indicating whether special vehicles are exempt from RMR installation."@en .

# exemptSpecialVehiclesFromETCS
era-sh:InfrastructureElementShape sh:property era-sh:ExemptSpecialVehiclesFromETCS .
era-sh:ExemptSpecialVehiclesFromETCS
    a sh:PropertyShape ;
    era:affectedClass era:InfrastructureElement ;
    era:affectedProperty era:exemptSpecialVehiclesFromETCS ;
    era:scope "local" ;
    rdfs:comment "Indicates whether special vehicles are exempted from the need to install ETCS (European Train Control System)."@en ;
    sh:path era:exemptSpecialVehiclesFromETCS ;
    sh:datatype xsd:boolean ;
    sh:severity sh:Warning ;
    sh:message "exemptSpecialVehiclesFromETCS: Value must be a boolean indicating whether special vehicles are exempt from ETCS installation."@en .


# canonicalURI

era-sh:InfrastructureElementShape sh:property era-sh:CanonicalURI .

era-sh:CanonicalURI
	a sh:PropertyShape;
    era:affectedClass era:InfrastructureElement;
    era:affectedProperty era:canonicalURI ;
    era:scope "local"; 
	rdfs:comment "Relates to the annotation for a canonical URI of an instance of Infrastructure and subclasses "@en ; 
	sh:path era:canonicalURI ;
    sh:nodeKind sh:IRI ;
	sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "canonicalURI: The canonical URI that is an IRI. This error is due to having a value that is not an IRI or having more than one value"@en .



# operatingLanguage

era-sh:InfrastructureElementShape sh:property era-sh:OperatingLangague .
era-sh:InfrastructureElementShape sh:sparql era-sh:OperatingLangagueSKOS .

 era-sh:OperatingLangague 
	a sh:PropertyShape ;
	era:affectedClass era:InfrastructureElement;
    era:affectedProperty era:operatingLanguage ;
	era:rinfIndex "1.1.0.0.1.2" , "1.2.0.0.0.8" ; 
	era:scope "local";
	rdfs:comment "Relates to the operating language used for an infastructure element"@en ; 
	sh:path era:operatingLanguage ;
    sh:nodeKind sh:IRI ;
	sh:class skos:Concept ;
	sh:severity sh:Violation ;
	sh:message "operating language (1.1.0.0.1.2 , 1.2.0.0.0.8): The operating language thatthat is an IRI. This error is due to having a value that is not an IRI"@en .

# operatingLanguage 
era-sh:OperatingLangagueSKOS 
	a sh:SPARQLConstraint ;
	era:affectedProperty era:operatingLanguage ;
    era:affectedClass era:InfrastructureElement;
    era:scope "local";
	rdfs:comment "Relates to the operating language used for an infastructure element"@en  ;
	era:rinfIndex "1.1.0.0.1.2" , "1.2.0.0.0.8" ;
	sh:message """operating language (1.1.0.0.1.2 , 1.2.0.0.0.8): The operating language {$this} has a value {?concept} that is not one of 
	the predefined values and cannot be converted into a SKOS concept 
	on this list:http://publications.europa.eu/resource/authority/language.
	"""@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    SELECT $this  ?concept (era:operatingLanguage AS ?path)
    WHERE {
        $this era:operatingLanguage ?concept .
        era:operatingLanguage era:inSkosConceptScheme ?conceptScheme .
		FILTER (NOT EXISTS {?concept skos:inScheme ?conceptScheme} )
	}
""" .


# subsetName
# subsetName can be multilingual 
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:SubsetName .
era-sh:SubsetName
	a sh:PropertyShape;
    era:affectedClass era:CommonCharacteristicsSubset;
    era:affectedProperty era:subsetName ;
    era:scope "local";
	rdfs:comment "A subset of elements with common characteristics could be identified with a unique name/id."@en ;
	sh:path era:subsetName ;
	sh:datatype rdf:langString ;
    sh:nodeKind sh:Literal ;
    sh:uniqueLang true ;
	sh:severity sh:Violation ;
	sh:message "subsetName: Each Common Characteristics Subset may have a name. If it does, there should be at least one name in English (@en). Additional multilingual names are allowed, but only one value per language tag is permitted. All values must be language-tagged string literals."@en ;
	sh:sparql era-sh:LangStringEnRequiredIfPresent .


#############################
# Rules for KilometricPost
#############################

era-sh:KilometricPostShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:KilometricPost.


# kilometer: # 1.1.1.1.8.12.1, 1.1.1.1.8.13.1, 1.1.1.3.14.3, 1.1.1.3.14.7, 1.2.0.0.0.6, 1.2.1.0.5.10.1, 1.2.1.0.5.11.1, 1.2.1.0.8.3, 1.2.2.0.5.10.1, 1.2.2.0.5.9.1
era-sh:KilometricPostShape sh:property era-sh:Kilometer .
era-sh:Kilometer
	a sh:PropertyShape;
    era:affectedClass era:KilometricPost;
    era:affectedProperty era:kilometer ;
    era:scope "local";
	rdfs:comment "Distance measured in kilometers from the origin of a national railway line/route."@en ;
	era:rinfIndex "1.1.1.1.8.12.1" ,
       "1.1.1.1.8.13.1", "1.1.1.3.14.3",  "1.1.1.3.14.7 ",  "1.2.0.0.0.6",  "1.2.1.0.5.10.1", "1.2.1.0.5.11.1", "1.2.1.0.8.3", "1.2.2.0.5.10.1", "1.2.2.0.5.9.1";
	sh:path era:kilometer ;
	sh:datatype xsd:double ;
	sh:severity sh:Violation ;
	sh:message "kilometer (1.1.1.1.8.12.1, 1.1.1.1.8.13.1, 1.1.1.3.14.3, 1.1.1.3.14.7, 1.2.0.0.0.6, 1.2.1.0.5.10.1, 1.2.1.0.5.11.1, 1.2.1.0.8.3, 1.2.2.0.5.10.1, 1.2.2.0.5.9.1): The kilometer must be represented as a double number."@en .

# kmPostName: 
era-sh:KilometricPostShape sh:property era-sh:KmPostName .
era-sh:KmPostName
	a sh:PropertyShape;
    era:affectedClass era:KilometricPost;
    era:affectedProperty era:kmPostName ;
    era:scope "local";
	rdfs:comment "Name of the kilometric post (optional)."@en ;
	sh:path era:kmPostName ;
	sh:datatype xsd:string ;
	sh:severity sh:Violation ;
	sh:message "kmPostName: The kilometer post name must be represented as a string of characters."@en .

era-sh:KilometricPostShape sh:property era-sh:HasLRS .
era-sh:HasLRS
	a sh:PropertyShape ;
	era:affectedProperty era:hasLRS ;
	era:affectedClass era:KilometricPost ;
	era:scope "local" ;
	rdfs:comment "Specifies the linear referencing system to which the kilometre post is referenced."@en ;
	sh:path era:hasLRS ;
	sh:class era:LinearPositioningSystem ;
	sh:severity sh:Violation ;
	sh:message "hasLRS: The kilometric post must reference a LinearPositioningSystem. This error is due to having a value that is not an instance of LinearPositioningSystem."@en .

# measuredDistance: 
era-sh:KilometricPostShape sh:property era-sh:MeasuredDistance .
era-sh:MeasuredDistance
	a sh:PropertyShape;
    era:affectedClass era:KilometricPost;
    era:affectedProperty era:measuredDistance ;
    era:scope "local";
	rdfs:comment "Measured distance from the origin of the LRS."@en ;
	sh:path era:measuredDistance ;
	sh:datatype xsd:double ;
	sh:severity sh:Violation ;
	sh:message "measuredDistance: The kilometer post measured distance must be represented as a double number."@en .



###################################
# Rules for net elements
###################################



era-sh:NetElementShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:NetElement . 

era-sh:NetRelationShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:NetRelation . 

era-sh:NonLinearElementShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:NonLinearElement . 

era-sh:LinearElementShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:LinearElement . 


era-sh:LinearElementSectionShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:LinearElementSection . 

era-sh:TopologicalCoordinateShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:TopologicalCoordinate . 


# aggregates
era-sh:NonLinearElementShape sh:property era-sh:Aggregates .
era-sh:Aggregates
	a sh:PropertyShape;
    era:affectedClass era:NonLinearElement;
    era:affectedProperty era:aggregates ;
    era:scope "local";
	rdfs:comment "Specifies the linear elements aggregated by a non-linear element. "@en ;
	sh:path era:aggregates ;
	sh:class era:LinearElement;
	sh:severity sh:Violation ;
	sh:message "aggregates: The non linear element may aggregate only linear elements. This error is due having a value that is not an instance of LinearElement."@en .

# elementA
era-sh:NetRelationShape sh:property era-sh:ElementA .
era-sh:ElementA
	a sh:PropertyShape;
    era:affectedClass era:NetRelation;
    era:affectedProperty era:elementA ;
    era:scope "local";
	rdfs:comment "References the first topological element in an oriented relation. For example, it may indicate the object that corresponds to a section of line, an operational point or a track inside an operational point connected at start. "@en ;
	sh:path era:elementA ;
	sh:class era:LinearElement;
	sh:severity sh:Violation ;
	sh:message "elementA: The net relation references the first topological object that must be an instance of a linear element. This error is due having a value that is not an instance of LinearElement."@en .

# elementB
era-sh:NetRelationShape sh:property era-sh:ElementB .
era-sh:ElementB
	a sh:PropertyShape;
    era:affectedClass era:NetRelation;
    era:affectedProperty era:elementB ;
    era:scope "local";
	rdfs:comment "References the second topological linear element in an oriented relation. For example, it may indicate the object that corresponds to a section of line, an operational point or a track inside an operational point connected at end. "@en ;
	sh:path era:elementB ;
	sh:class era:LinearElement;
	sh:severity sh:Violation ;
	sh:message "elementB: The net relation references the second topological object that must be an instance of a linear element. This error is due having a value that is not an instance of LinearElement."@en .

# navigability
era-sh:NetRelationShape sh:property era-sh:Navigability.
era-sh:Navigability
	a sh:PropertyShape ;
    era:affectedProperty era:navigability;
    era:affectedClass era:NetRelation;
    era:scope "local";
	rdfs:comment "Indicates the navigation possibilities between two related topological linear elements. "@en ;
	sh:path era:navigability ;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "navigability: The net relation must have a navigability value that is an IRI."@en .	

# navigability
era-sh:NetRelationShape sh:sparql era-sh:NavigabilitySKOS.
era-sh:NavigabilitySKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:navigability;
    era:affectedClass era:NetRelation;
    era:scope "local";
	rdfs:comment "Indicates the navigation possibilities between two related topological linear elements. "@en ;
	sh:message "era:navigability: The net relation {$this} with label {?thisLabel}  has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/navigabilities/Navigabilities."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?thisLabel ?concept (era:navigability AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        $this era:navigability ?concept .
        era:navigability era:inSkosConceptScheme ?conceptScheme .
        FILTER NOT EXISTS { ?concept skos:inScheme ?conceptScheme }
    }
""" .

# onElement
era-sh:LinearElementSectionShape sh:property era-sh:OnElement .
era-sh:OnElement
	a sh:PropertyShape;
    era:affectedClass era:LinearElementSection;
    era:affectedProperty era:onElement ;
    era:scope "local";
	rdfs:comment "Specifies the linear element a section belongs to. "@en ;
	sh:path era:onElement ;
	sh:class era:LinearElement;
	sh:severity sh:Violation ;
	sh:message "onElement: The linear element section specifies the linear element it belongs to. This error is due having a value that is not an instance of LinearElement."@en .

# onLinearElement
era-sh:TopologicalCoordinateShape sh:property era-sh:OnLinearElement .
era-sh:OnLinearElement
	a sh:PropertyShape;
    era:affectedClass era:TopologicalCoordinate;
    era:affectedProperty era:onLinearElement ;
    era:scope "local";
	rdfs:comment "Specifies the linear element a coordinate is associated with. "@en ;
	sh:path era:onLinearElement ;
	sh:class era:LinearElement;
	sh:severity sh:Violation ;
	sh:message "onLinearElement: The topological coordinate specifies the linear element it belongs to. This error is due having a value that is not an instance of LinearElement."@en .

# appliesInBothDirections
era-sh:LinearElementSectionShape sh:property era-sh:AppliesInBothDirections .
era-sh:AppliesInBothDirections
	a sh:PropertyShape;
    era:affectedClass era:LinearElementSection;
    era:affectedProperty era:appliesInBothDirections ;
    era:scope "local";
	rdfs:comment "Specifies if the section applies in both directions (optional). "@en ;
	sh:path era:appliesInBothDirections ;
	sh:datatype xsd:boolean ;
	sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "appliesInBothDirections: The linear element section specifies if the section applies in both directions (optional). This error is due having a value that is not a boolean."@en .

# endOffsetFromOrigin
era-sh:LinearElementSectionShape sh:property era-sh:EndOffsetFromOrigin .
era-sh:EndOffsetFromOrigin
	a sh:PropertyShape;
    era:affectedClass era:LinearElementSection;
    era:affectedProperty era:endOffsetFromOrigin ;
    era:scope "local";
	rdfs:comment "End offset of the section from the origin. "@en ;
	sh:path era:endOffsetFromOrigin ;
	sh:maxCount 1 ;
	sh:minCount 1 ;
	sh:datatype xsd:double ;
	sh:pattern "^[1-9][0-9]*(\\.0+)?$" ; # Allow positive integers with optional .0
	sh:severity sh:Violation ;
	sh:message "endOffsetFromOrigin: The linear element section specifies  the end offset of the section from the origin. This error is due having a value that is not a positive integer or more than one value."@en .

# isOnOriginOfElementA
era-sh:NetRelationShape sh:property era-sh:IsOnOriginOfElementA .
era-sh:IsOnOriginOfElementA
	a sh:PropertyShape;
    era:affectedClass era:NetRelation;
    era:affectedProperty era:isOnOriginOfElementA ;
    era:scope "local";
	rdfs:comment "Determines if the position of the topological element A in a relation is the origin of element A. "@en ;
	sh:path era:isOnOriginOfElementA ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "isOnOriginOfElementA: The net relation specifies if the position of the topological element A in a relation is the origin of element A. This error is due having a value that is not a boolean."@en .

# isOnOriginOfElementB
era-sh:NetRelationShape sh:property era-sh:IsOnOriginOfElementB .
era-sh:IsOnOriginOfElementB
	a sh:PropertyShape;
    era:affectedClass era:NetRelation;
    era:affectedProperty era:isOnOriginOfElementB ;
    era:scope "local";
	rdfs:comment "Determines if the position of the topological element B in a relation is the origin of element B. "@en ;
	sh:path era:isOnOriginOfElementB ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "isOnOriginOfElementB: The net relation specifies if the position of the topological element B in a relation is the origin of element B. This error is due having a value that is not a boolean."@en .

# lengthOfNetLinearElement
era-sh:LinearElementShape sh:property era-sh:LengthOfNetLinearElement .
era-sh:LengthOfNetLinearElement
	a sh:PropertyShape;
    era:affectedClass era:LinearElement;
    era:affectedProperty era:lengthOfNetLinearElement ;
    era:scope "local";
	rdfs:comment "Length of a linear element. "@en ;
	sh:path era:lengthOfNetLinearElement ;
    sh:maxCount 1;
	sh:datatype xsd:double ;
	sh:severity sh:Violation ;
	sh:message "lengthOfNetLinearElement: The linear element has at most one value of length and it is a double number. This error is due to having more than one value or that the value is not a double number."@en .

# lengthOfNonStoppingArea: # 1.1.1.3.14.5
era-sh:LinearElementShape sh:property era-sh:LengthOfNonStoppingArea .
era-sh:LengthOfNonStoppingArea
	a sh:PropertyShape ;
    era:affectedProperty era:lengthOfNonStoppingArea ;
    era:affectedClass era:LinearElement ;
    era:scope "local" ;
	rdfs:comment "Length of a Non-stopping area."@en ;
	era:rinfIndex "1.1.1.3.14.5" ;
	sh:path era:lengthOfNonStoppingArea ;
	sh:maxCount 1 ;
	sh:datatype xsd:double ;
	sh:severity sh:Violation ;
	sh:message "lengthOfNonStoppingArea (1.1.1.3.14.5): The linear element has at most one length of non-stopping area value and it must be a double number. This error is due to having more than one value or that the value is not a double number."@en .

# offsetFromOrigin: 
era-sh:TopologicalCoordinateShape sh:property era-sh:OffsetFromOrigin .
era-sh:OffsetFromOrigin
	a sh:PropertyShape;
    era:affectedClass era:TopologicalCoordinate;
    era:affectedProperty era:offsetFromOrigin ;
    era:scope "local";
	rdfs:comment "Offset from the origin in a topological coordinate."@en ;
	sh:path era:offsetFromOrigin ;
	sh:datatype xsd:double ;
	sh:minInclusive 0 ;
	sh:minCount 1 ;
	sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "offsetFromOrigin: The offset from the origin in a topological coordinate must be represented as a non-negative double. This error is due to having more than one value, a negative value, or using the wrong datatype."@en .

# startOffsetFromOrigin: 
era-sh:LinearElementSectionShape sh:property era-sh:StartOffsetFromOrigin .
era-sh:StartOffsetFromOrigin
	a sh:PropertyShape;
    era:affectedClass era:LinearElementSection;
    era:affectedProperty era:startOffsetFromOrigin ;
    era:scope "local";
	rdfs:comment "Start offset of the section from the origin."@en ;
	sh:path era:startOffsetFromOrigin ;
	sh:datatype xsd:double ;
	sh:minCount 1 ;
	sh:maxCount 1 ;
	sh:pattern "^[1-9][0-9]*(\\.0+)?$" ; # Allow positive integers with optional .0
	sh:severity sh:Violation ;
	sh:message "startOffsetFromOrigin: The start offset of the section from the origin must be represented as a positive integer or more than one value."@en .



#############################
# Rules for op-track
#############################

#
# op-track
#

era-sh:OperationalPointShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:OperationalPoint .

era-sh:OperationalPointShapeSPARQLWarning
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:OperationalPoint ;
    sh:severity sh:Warning .


# trackId: # 1.2.1.0.0.2
era-sh:OperationalPointShape sh:sparql era-sh:NoRepeatedTrackIdsOP.
era-sh:NoRepeatedTrackIdsOP 
    a sh:SPARQLConstraint ; 
    era:affectedProperty era:trackId;
    era:affectedClass era:RunningTrack;
    era:affectedClass era:OperationalPoint;
    era:scope "global";
    rdfs:comment "Each track shall have unique identification or number within the OP. This number cannot be used for naming any other track in the same OP."@en ;
    era:rinfIndex "1.2.1.0.0.2" ;
    sh:message "trackId (1.2.1.0.0.2):: Each track shall have unique identification or number within the OP. This number cannot be used for naming any other track in the same OP. There is a problem with OP {$this} ({?opLabel}) and tracks {?track1} ({?track1Label}) and {?track2} ({?track2Label}), since they have the same identifier: {?value}."@en ;
    sh:prefixes era:;
    sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?opLabel ?track1 ?track1Label ?track2 ?track2Label ?value (era:trackId AS ?path)
    WHERE {
        $this a era:OperationalPoint ;
            era:hasPart ?track1 ;
            era:canonicalURI ?cano1 .
        $this a era:OperationalPoint ;
            era:hasPart ?track2 ;
            era:canonicalURI ?cano2 .
        ?track1 era:trackId ?value .
        ?track2 era:trackId ?value .
        FILTER(?track1 != ?track2) .
        FILTER(?cano1 != ?cano2) .
        OPTIONAL { $this rdfs:label ?opLabel0 } .
        BIND(COALESCE(?opLabel0, "unknown label") AS ?opLabel)
        OPTIONAL { ?track1 rdfs:label ?track1Label0 } .
        BIND(COALESCE(?track1Label0, "unknown label") AS ?track1Label)
        OPTIONAL { ?track2 rdfs:label ?track2Label0 } .
        BIND(COALESCE(?track2Label0, "unknown label") AS ?track2Label)
    }
    """ .


#############################
# Rules for operational-points
#############################

#
# operational-points
#
era-sh:OperationalPointShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:OperationalPoint.



# opName: # 1.2.0.0.0.1
#OpName can be multilingual 
era-sh:OperationalPointShape sh:property era-sh:OpName .
era-sh:OpName
	a sh:PropertyShape;
    era:affectedClass era:OperationalPoint;
    era:affectedProperty era:opName ;
    era:scope "local";
	rdfs:comment "Name normally related to the town or village or to traffic control purpose."@en ;
	era:rinfIndex "1.2.0.0.0.1" ;
	sh:path era:opName ;
	sh:datatype rdf:langString ;
    sh:nodeKind sh:Literal ;
    sh:uniqueLang true ;
	sh:severity sh:Violation ;
	sh:message "opName (1.2.0.0.0.1): Each Operational Point must have at least one name in English (@en). Additional multilingual names are allowed, but only one value per language tag is permitted. All values must be language-tagged string literals."@en ;
	sh:sparql era-sh:LangStringEnRequired .


# uopid: # 1.2.0.0.0.2 
era-sh:OperationalPointShape sh:property era-sh:UopidP .
era-sh:UopidP
	a sh:PropertyShape;
    era:affectedClass era:OperationalPoint;
    era:affectedProperty era:uopid ;
    era:scope "local";
	rdfs:comment "Code composed of country code and alphanumeric OP code. "@en ;
	era:rinfIndex "1.2.0.0.0.2" ;
	sh:path era:uopid ;
    sh:minCount 1 ; 
    sh:maxCount 1 ;
	sh:datatype xsd:string ;
	sh:pattern "^[A-Z]{2}.{0,10}$" ;
	sh:severity sh:Violation ;
	sh:message "uopid (1.2.0.0.0.2): This error is due to having more than one op id, not having an op id, having a value that is not a string, or having a value that does not follow the pattern where the first part 'AA' is the country code in two-letter system of ISO (or 'EU' for border points) and the second part is the alphanumeric OP code within the MS."@en .

# opType: # 1.2.0.0.0.4
era-sh:OperationalPointShape sh:property era-sh:OpTypeP .
era-sh:OpTypeP
	a sh:PropertyShape;
    era:affectedClass era:OperationalPoint;
    era:affectedProperty era:opType ;
    era:scope "local";
	rdfs:comment "Type of facility in relation to the dominating operational functions.Each existing case has to be approximated to the one of the above defined types by including size, importance and dominating functions. It is most important to recognize the most important role of specific OP in the network. That is why only one type for one OP is permitted. "@en ;
	era:rinfIndex "1.2.0.0.0.4" ;
	sh:path era:opType; 
    sh:minCount 1 ;
    sh:nodeKind sh:IRI;
	sh:severity sh:Violation ;
	sh:message "opType (1.2.0.0.0.4):  Each Operational Point must have exactly one type. This error may be due to having an OP  with no type or with more than one type, or its value is not an IRI."@en .




# opType: # 1.2.0.0.0.4
era-sh:OperationalPointShape sh:sparql era-sh:OpTypeSKOS .
era-sh:OpTypeSKOS
	a sh:SPARQLConstraint ;
    era:affectedClass era:OperationalPoint;
    era:affectedProperty era:opType ;
    era:scope "local";
	rdfs:comment "Type of facility in relation to the dominating operational functions.\nEach existing case has to be approximated to the one of the above defined types by including size, importance and dominating functions. It is most important to recognize the most important role of specific OP in the network. That is why only one type for one OP is permitted. "@en ;
	era:rinfIndex "1.2.0.0.0.4" ;
	sh:message "Type of operational point   (1.2.0.0.0.4): The OP {$this} (label {?opLabel}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/op-types/OperationalPointTypes."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?concept ?opLabel (era:opType AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?opLabel0 } .
        BIND(COALESCE(?opLabel0, "unknown label") AS ?opLabel)
        $this era:opType ?concept .
        era:opType era:inSkosConceptScheme ?conceptScheme .
        FILTER NOT EXISTS { ?concept skos:inScheme ?conceptScheme }
    }
""" .



# opTypeGaugeChangeover: # 1.2.0.0.0.4.1 
era-sh:OperationalPointShape sh:property era-sh:OpTypeGaugeChangeover .
era-sh:OpTypeGaugeChangeover
	a sh:PropertyShape;
    era:affectedClass era:OperationalPoint;
    era:affectedProperty era:opTypeGaugeChangeover ;
    era:scope "local";
	rdfs:comment "Type of track gauge changeover facility. "@en ;
	era:rinfIndex "1.2.0.0.0.4.1" ;
	sh:path era:opTypeGaugeChangeover ;
	sh:maxCount 1 ;
	sh:datatype xsd:string ;
	sh:severity sh:Violation ;
	sh:message "opTypeGaugeChangeover (1.2.0.0.0.4.1): The Operational Point must have at most one value of opTypeGaugeChangeover and its type must be a string."@en .

# digitalSchematicOverview: # 1.2.0.0.0.7.2
era-sh:OperationalPointShape sh:property era-sh:DigitalSchematicOverview .
era-sh:DigitalSchematicOverview
	a sh:PropertyShape;
    era:affectedClass era:OperationalPoint;
    era:affectedProperty era:digitalSchematicOverview ;
    era:scope "local";
	rdfs:comment "Diagrammatic representation of the operational point in Well Known Text polyline "@en ;
	era:rinfIndex "1.2.0.0.0.7.2" ;
	sh:path era:digitalSchematicOverview ;
	sh:severity sh:Violation ;
	sh:datatype geosparql:wktLiteral ;
	sh:message "digitalSchematicOverview (1.2.0.0.0.7.2): The Operational Point has a digitalSchematicOverview reference that must be a Well Known Text literal."@en .



# hasSchematicOverviewOPDigitalForm: # 1.2.0.0.0.7
era-sh:OperationalPointShape sh:property era-sh:HasSchematicOverviewOPDigitalForm .
era-sh:HasSchematicOverviewOPDigitalForm
	a sh:PropertyShape;
    era:affectedClass era:OperationalPoint;
    era:affectedProperty era:hasSchematicOverviewOPDigitalForm ;
    era:scope "local"; 
	rdfs:comment "The existence of a schematic overview of the operational point in digital form."@en ;
	era:rinfIndex "1.2.0.0.0.7" ; 
	sh:path era:hasSchematicOverviewOPDigitalForm ;
	sh:datatype xsd:boolean;
	sh:severity sh:Violation ;
	sh:message "hasSchematicOverviewOPDigitalForm (1.2.0.0.0.7): The Operational Point has a hasSchematicOverviewOPDigitalForm reference that must be a boolean."@en .

# schematicOverviewOP: # 1.2.0.0.0.7.1
era-sh:OperationalPointShape sh:property era-sh:SchematicOverviewOP .
era-sh:SchematicOverviewOP
	a sh:PropertyShape ;
    era:affectedProperty era:schematicOverviewOP ;
    era:affectedClass era:OperationalPoint ;
    era:scope "local" ;
	rdfs:comment "Document providing the schematic overview of the operational point."@en ;
	era:rinfIndex "1.2.0.0.0.7.1" ;
	sh:path era:schematicOverviewOP ;
	sh:datatype xsd:anyURI ;
	sh:severity sh:Violation ;
	sh:message "schematicOverviewOP (1.2.0.0.0.7.1): The Operational Point may have a schematic overview reference that must be a URI. This error may be due to having a value that is not a URI."@en .

# hasPart: Property that may relate an operational point with a siding or a track
era-sh:OperationalPointShape sh:sparql era-sh:HasPartOP .
era-sh:HasPartOP
    a sh:SPARQLConstraint ;
    era:affectedClass era:OperationalPoint ;
    era:affectedProperty era:hasPart ;
    era:scope "local" ;
    rdfs:comment "Reference from an aggregated element to a basic element."@en ;
    sh:severity sh:Violation ;
    sh:message "hasPart from an operational point: The Operational Point may have a hasPart reference that is an IRI referring to an InfrastructureElement (or one of its subclasses), or a KilometricPost object."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

        SELECT ?this ?value (era:hasPart AS ?path)
        WHERE {
            ?this era:hasPart ?value .

            # Violation if value is not an IRI
            FILTER (
                !isIRI(?value)
                ||
                # Violation if value is an IRI but not typed as InfrastructureElement(+subclasses) nor KilometricPost
                !EXISTS {
                    {
                        ?value rdf:type ?t .
                        ?t rdfs:subClassOf* era:InfrastructureElement .
                    }
                    UNION
                    {
                        ?value rdf:type era:KilometricPost .
                    }
                }
            )
        }
    """ .

era-sh:OperationalPointShapeSPARQLWarning sh:sparql era-sh:HasPartTrackOP .
era-sh:HasPartTrackOP
    a sh:SPARQLConstraint ;
    era:affectedClass era:OperationalPoint ;
    era:affectedProperty era:hasPart ;
    sh:message "Each Operational Point that is not a switch, a junction, a technical change, a depot or workshop, a passenger stop, or a border point must have a hasPart reference that is a Track object (or one of the subclasses: RunningTrack and Siding). This error is due to {$this} not having a hasPart reference to an instance of an era:Track (or a subclass)."@en ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX era-op-types: <http://data.europa.eu/949/concepts/op-types/>
        PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

        SELECT ?this (era:hasPart AS ?path)
        WHERE {
            ?this era:opType ?opType .
            FILTER (?opType NOT IN (
                era-op-types:50,
                era-op-types:70,
                era-op-types:80,
                era-op-types:90,
                era-op-types:110,
                era-op-types:120,
                era-op-types:140
            )) .

            FILTER NOT EXISTS {
                ?this era:hasPart ?part .
                ?part rdf:type/rdfs:subClassOf* era:Track .
            }
        }
    """ .

# uopid: # 1.2.0.0.0.2 enforce the border point constraint, if an OP is a border point, it should point to ReferenceBorderPoint and its uopid be the code in the RefenreceBorderPoint class.
 era-sh:OperationalPointShape sh:sparql era-sh:BorderPointValidCode .
era-sh:BorderPointValidCode
    a sh:SPARQLConstraint ;
    era:affectedClass era:OperationalPoint ;
    era:affectedProperty era:uopid ;
    era:scope "local" ;
    rdfs:comment "Code composed of country code and alphanumeric OP code."@en ;
    era:rinfIndex "1.2.0.0.0.2" ;
    sh:message """
uopid (1.2.0.0.0.2): The OperationalPoint {$this} with id {?uopid} and label {?opLabel} is a border point that references a ReferenceBorderPoint, but its uopid does not match the borderPointId of the referenced point ('{?uopid}' ≠ '{?refId}').
    """@en ;
    sh:prefixes era: ;
    sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?uopid ?refId ?opLabel (era:uopid AS ?path)
    WHERE {
        $this era:opType <http://data.europa.eu/949/concepts/op-types/90> ;
            era:referenceBorderPoint ?refBP ;
            era:uopid ?uopid .
        ?refBP a era:ReferenceBorderPoint ;
            era:borderPointId ?refId .
        OPTIONAL { $this rdfs:label ?opLabel0 } .
        BIND(COALESCE(?opLabel0, "unknown label") AS ?opLabel)
        FILTER (?uopid != ?refId)
    }
    """ .

era-sh:OperationalPointShape sh:sparql era-sh:BorderPointValidCoordinates .
era-sh:BorderPointValidCoordinates
    a sh:SPARQLConstraint ;
    era:affectedClass era:OperationalPoint ;
    era:affectedProperty geosparql:asWKT ;
    era:scope "local" ;
    rdfs:comment "Coordinates must exactly match the referenced border point."@en ;
    sh:message """
Coordinates: The OperationalPoint {$this} with label {?opLabel} is a border point whose coordinates do not match the referenced ReferenceBorderPoint.
OP coordinates: {?opWKT}
Reference coordinates: {?refWKT}
    """@en ;
    sh:prefixes era: ;
    sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX geo: <http://www.opengis.net/ont/geosparql#>
    SELECT DISTINCT $this ?opWKT ?refWKT ?opLabel (geo:asWKT AS ?path)
    WHERE {
        $this era:opType <http://data.europa.eu/949/concepts/op-types/90> ;
            era:referenceBorderPoint ?refBP ;
            geo:hasGeometry ?opGeom .
        ?opGeom geo:asWKT ?opWKT .
        ?refBP a era:ReferenceBorderPoint ;
            geo:hasGeometry ?refGeom .
        ?refGeom geo:asWKT ?refWKT .
        OPTIONAL { $this rdfs:label ?opLabel0 } .
        BIND(COALESCE(?opLabel0, "unknown label") AS ?opLabel)
        FILTER (?opWKT != ?refWKT)
    }
    """ .


# referenceBorderPoint: 
 era-sh:OperationalPointShape sh:property era-sh:ReferenceBorderPoint .
 era-sh:ReferenceBorderPoint
 	a sh:PropertyShape;
    era:affectedClass era:OperationalPoint;
    era:affectedProperty era:referenceBorderPoint;
    era:scope "local";
 	rdfs:comment "Relates an operational point that is a border point with an instance of the list of reference border points that are specified in the RINF Application Guide."@en ;
 	sh:path era:referenceBorderPoint ;
 	sh:nodeKind sh:IRI ;
    sh:class era:ReferenceBorderPoint;
    sh:maxCount 1;
 	sh:severity sh:Violation ;
 	sh:message "referenceBorderPoint : The Operational Point may have a reference border point that is a ReferenceBorderPoint object. This error may be due to having more than one value of a reference border point, or having a value that is not a ReferenceBorderPoint instance."@en .


era-sh:OperationalPointShape sh:sparql era-sh:BorderPointUopidPrefix .
era-sh:BorderPointUopidPrefix
    a sh:SPARQLConstraint ;
    era:affectedClass era:OperationalPoint ;
    era:affectedProperty era:uopid ;
    sh:message "uopid (1.2.0.0.0.2-prefix): The OperationalPoint {$this} with name {?opName} is a border point but its uopid {?uopid} does not start with 'EU' as required."@en ;
    sh:prefixes era: ;
    sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?uopid ?opName (era:uopid AS ?path)
    WHERE {
        $this era:opType <http://data.europa.eu/949/concepts/op-types/90> .
        OPTIONAL { $this era:opName ?opName0 } .
        BIND(COALESCE(?opName0, "unknown label") AS ?opName)
        $this era:uopid ?uopid .
        FILTER(!STRSTARTS(STR(?uopid), "EU"))
    }
""" .

era-sh:OperationalPointShapeSPARQLWarning sh:sparql era-sh:ReferenceBorderPointApplicability .
era-sh:ReferenceBorderPointApplicability 
    a sh:SPARQLConstraint ;
    era:affectedClass era:OperationalPoint ;
    era:affectedProperty era:referenceBorderPoint ;
    sh:message "referenceBorderPoint: The OperationalPoint {$this} with name {?opName} and uopid {?uopid} is a border point but does not have a referenceBorderPoint property."@en ;
    sh:prefixes era: ;
    sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?opName ?uopid (era:referenceBorderPoint AS ?path)
    WHERE {
        $this era:opType <http://data.europa.eu/949/concepts/op-types/90> .
        OPTIONAL { $this era:opName ?opName0 } .
        BIND(COALESCE(?opName0, "unknown label") AS ?opName)
				OPTIONAL { $this era:uopid   ?uopid0   }
        BIND(COALESCE(?uopid0, "unknown uopid") AS ?uopid)
        FILTER NOT EXISTS { $this era:referenceBorderPoint ?refBP }
    }
""" .

# netReference for OperationalPoint
era-sh:OperationalPointShape sh:property era-sh:NetReferenceOP .
era-sh:NetReferenceOP
    a sh:PropertyShape ;
    era:affectedProperty era:netReference ;
    era:affectedClass era:OperationalPoint ;
    era:scope "local" ;
    rdfs:comment "The reference that an OperationalPoint has on the topology. It must point to an instance of NetBasicReference."@en ;
    sh:path era:netReference ;
    sh:minCount 1 ;
    sh:class era:NetBasicReference ;
    sh:nodeKind sh:IRI ;
    sh:severity sh:Violation ;
    sh:message "netReference: Each OperationalPoint must have at least one netReference pointing to an instance of NetBasicReference. This error is due to not having a value or having a value that is not a NetBasicReference."@en .


## OrganisationRole 
era-sh:OrganisationRoleShape
	a sh:NodeShape ;
	sh:targetClass era:OrganisationRole ;
	sh:nodeKind sh:IRI ;
	sh:pattern "^http://data\\.europa\\.eu/949/" ;
	sh:message "OrganisationRole URI: The instance has a URI that does not follow the required pattern '^http://data.europa.eu/949/'. All instances of era:OrganisationRole must have URIs starting with http://data.europa.eu/949/."@en .

# organisationCode "1.2.1.0.6.1, 1.1.0.0.0.1, 1.1.1.1.8.1, 1.2.1.0.0.1, 1.2.1.0.5.1, 1.2.2.0.0.1, 1.2.2.0.5.1"
era-sh:BodyShape sh:property era-sh:OrganisationCode .
era-sh:OrganisationCode
    a sh:PropertyShape;
    era:affectedClass era:Body ;
    era:affectedProperty era:organisationCode ;
    era:scope "local";
    rdfs:comment "Four alpha-numeric code allocated by ERA to a body. It represent's the Infrastructure Manager (IM) code in RINF. Infrastructure manager means any body or firm responsible in particular for establishing, managing and maintaining railway infrastructure, including traffic management and control-command and signalling; the functions of the infrastructure manager on a network or part of a network may be allocated to different bodies or firms. Definition in (Article 3(2))."@en ;
    era:rinfIndex "1.2.1.0.6.1";
    era:rinfIndex "1.1.0.0.0.1";
    era:rinfIndex "1.1.1.1.8.1";
    era:rinfIndex "1.2.1.0.0.1";
    era:rinfIndex "1.2.1.0.5.1";
    era:rinfIndex "1.2.2.0.0.1";
    era:rinfIndex "1.2.2.0.5.1";
    sh:path era:organisationCode ;
    sh:datatype xsd:string ;
    sh:minCount 1;
    sh:maxCount 1 ;
    sh:minLength 4 ;
    sh:maxLength 4 ;
    sh:severity sh:Violation ;
    sh:message "organisationCode (1.2.1.0.6.1, 1.1.0.0.0.1, 1.1.1.1.8.1, 1.2.1.0.0.1, 1.2.1.0.5.1, 1.2.2.0.0.1, 1.2.2.0.5.1): A Body must have exactly one value of organisationCode. This error may be due to not having a value, having more than one value, having a value that is not a string or having a value that is not a four character code"@en .

# roleOf
era-sh:OrganisationRoleShape sh:property era-sh:RoleOf .
era-sh:RoleOf
	a sh:PropertyShape;
    era:affectedClass era:OrganisationRole;
    era:affectedProperty era:roleOf ;
    era:scope "local";
	rdfs:comment "Indicates the corresponding Body that plays a certain organisation role."@en ;
	sh:path era:roleOf ;
    sh:class era:Body;
    sh:minCount 1;
    sh:maxCount 1;
	sh:severity sh:Violation ;
	sh:message "roleOf: Each instance of Organization Role points thorugh roleOf to exactly one instance of Body. This error mae be due to having no value, having more than one value or having a value that is not an instance of Body."@en .

# role
era-sh:BodyShape sh:property era-sh:Role .
era-sh:Role
	a sh:PropertyShape;
    era:affectedClass era:Body;
    era:affectedProperty era:role ;
    era:scope "local";
	rdfs:comment "Indicates the relationship of a Body to the organisation roles that it can play."@en ;
	sh:path era:role ;
    sh:class era:OrganisationRole;
    sh:minCount 1;
	sh:severity sh:Violation ;
	sh:message "role: Each instance of a Body must have at least one role. This error mae be due to having no value or having a value that is not an instance of OrganisationRole."@en .


# hasOrganisationRole
era-sh:OrganisationRoleShape sh:property era-sh:HasOrganisationRole .
era-sh:HasOrganisationRole
	a sh:PropertyShape;
    era:affectedClass era:OrganisationRole;
    era:affectedProperty era:hasOrganisationRole ;
    era:scope "local";
	rdfs:comment "The role played in an n-ary relationship between a Body and a specific concept in the concept scheme of organisation roles."@en ;
	sh:path era:hasOrganisationRole ;
    sh:minCount 1;
    sh:maxCount 1;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "hasOrganisationRole: The organisation role must be represented as an IRI. This error may be due to not having a value, having more than one value, or having a value that is not an IRI."@en .


# hasOrganisationRole
era-sh:OrganisationRoleShape sh:sparql era-sh:HasOrganisationRoleSKOS.
era-sh:HasOrganisationRoleSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:hasOrganisationRole;
    era:affectedClass  era:OrganisationRole;
    era:scope "local";
    rdfs:comment "The role played in an n-ary relationship between a Body and a specific concept in the concept scheme of organisation roles."@en ;
    sh:message "Indication of the hasOrganisationRole: The OrganisationRole {$this}  has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/organisation-roles/."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept (era:hasOrganisationRole AS ?path)
    WHERE {
        $this era:hasOrganisationRole ?concept .
        era:hasOrganisationRole era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .



era-sh:OrientationShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:Orientation.

# carrierLinearElement
era-sh:OrientationShape sh:property era-sh:CarrierLinearElement .
era-sh:CarrierLinearElement
    a sh:PropertyShape ;
    era:affectedClass era:Orientation ;
    era:affectedProperty era:carrierLinearElement ;
    era:scope "local" ;
    rdfs:comment "The carrier linear element in relation to which the orientation is based on."@en ;
    sh:path era:carrierLinearElement ;
    sh:nodeKind sh:IRI ;
    sh:class era:LinearElement ;
    sh:severity sh:Violation ;
    sh:message "carrierLinearElement: The Orientation may reference a LinearElement through carrierLinearElement. This error is due to the value either not being an IRI, or being an IRI that is not an instance of LinearElement."@en .

# direction
era-sh:OrientationShape sh:property era-sh:Direction .
era-sh:Direction
    a sh:PropertyShape ;
    era:affectedClass era:Orientation ;
    era:affectedProperty era:direction ;
    era:scope "local" ;
    rdfs:comment "The direction of the orientation of a railway element, in relation to the carrier linear element."@en ;
    sh:path era:direction ;
    sh:nodeKind sh:IRI ;
    sh:severity sh:Violation ;
    sh:message "direction: The Orientation may reference a SKOS concept representing the direction in the form of an IRI. This error is due to the value not being an IRI."@en .

era-sh:OrientationShape sh:sparql era-sh:DirectionSKOS .
era-sh:DirectionSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:direction ;
    era:affectedClass era:Orientation ;
    era:scope "local" ;
    rdfs:comment "The direction of the orientation of a railway element, in relation to the carrier linear element."@en ;
    sh:message "direction: The Orientation {$this} with label {?thisLabel} has a value {?concept} that is not one of the predefined OrientationDirections in the SKOS concept scheme http://data.europa.eu/949/concepts/orientations/OrientationDirections."@en ;
    sh:prefixes era: ;
    sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?thisLabel ?concept (era:direction AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        $this era:direction ?concept .
        era:direction era:inSkosConceptScheme ?conceptScheme .
        FILTER NOT EXISTS { ?concept skos:inScheme ?conceptScheme }
    }
""" .

# side
era-sh:OrientationShape sh:property era-sh:Side .
era-sh:Side
    a sh:PropertyShape ;
    era:affectedClass era:Orientation ;
    era:affectedProperty era:side ;
    era:scope "local" ;
    rdfs:comment "Indication of the position of the signal in relation to the track in the running direction from the origin of the referencing system (e.g., direction of the main line)."@en ;
    sh:path era:side ;
    sh:nodeKind sh:IRI ;
    sh:severity sh:Violation ;
    sh:message "side: The Orientation may reference a SKOS concept representing the side in the form of an IRI. This error is due to the value not being an IRI."@en .

era-sh:OrientationShape sh:sparql era-sh:SideSKOS .
era-sh:SideSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:side ;
    era:affectedClass era:Orientation ;
    era:scope "local" ;
    rdfs:comment "Indication of the position of the signal in relation to the track in the running direction from the origin of the referencing system."@en ;
    sh:message "side: The Orientation {$this} with label {?thisLabel} has a value {?concept} that is not one of the predefined Sides in the SKOS concept scheme http://data.europa.eu/949/concepts/orientations/Sides."@en ;
    sh:prefixes era: ;
    sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?thisLabel ?concept (era:side AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        $this era:side ?concept .
        era:side era:inSkosConceptScheme ?conceptScheme .
        FILTER NOT EXISTS { ?concept skos:inScheme ?conceptScheme }
    }
""" .


era-sh:ParameterApplicabilityShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:ParameterApplicability.

era-sh:CommonCharacteristicsSubsetShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:CommonCharacteristicsSubset .  



# ofParameter
era-sh:ParameterApplicabilityShape sh:property era-sh:OfParameter .
era-sh:OfParameter
	a sh:PropertyShape;
    era:affectedClass era:ParameterApplicability;
    era:affectedProperty era:ofParameter ;
    era:scope "local";
	rdfs:comment "Applicability interval defines the date interval in which a characteristic of an infrastructure element is applicable. The characteristic to which it applies is the ofParameter property. "@en ;
	sh:path era:ofParameter ;
    sh:nodeKind sh:IRI ;
    sh:or (
 		[sh:class owl:ObjectProperty ;]
		[sh:class owl:DatatypeProperty ;]
		);
    #sh:minCount 1; cannot be mandatory for common characteristics subset
    sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "ofParameter: An instance of parameter applicability must have exactly one value of the characteristic (ofParameter) to which it applies to. This error may be due to not having a value, having more than one value, having a value that is not an IRI or is not an object or datatype property in the ontology."@en .

# time:hasBeginning
era-sh:ParameterApplicabilityShape sh:property era-sh:HasBeginning .
era-sh:HasBeginning
	a sh:PropertyShape;
    era:affectedClass era:ParameterApplicability;
    era:affectedProperty time:hasBeginning ;
    era:scope "local";
	rdfs:comment "Applicability interval defines the date interval in which a characteristic of an infrastructure element is applicable."@en ;
	sh:path time:hasBeginning ;
    sh:nodeKind sh:IRI ;
    sh:class time:Instant;
    #sh:minCount 1; cannot be mandatory for common characteristics subset
    sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "hasBeginning: An instance of parameter applicability must have exactly one value of the beginning of the interval in which it is applicable. This error may be due to not having a value, having more than one value, having a value that is not an IRI or is not a time:Instant."@en .

# time:hasEnd
era-sh:ParameterApplicabilityShape sh:property era-sh:HasEnd .
era-sh:HasEnd
	a sh:PropertyShape;
    era:affectedClass era:ParameterApplicability;
    era:affectedProperty time:hasEnd ;
    era:scope "local";
	rdfs:comment "Applicability interval defines the date interval in which a characteristic of an infrastructure element is applicable."@en ;
	sh:path time:hasEnd ;
    sh:nodeKind sh:IRI ;
    sh:class time:Instant;
    # sh:minCount 1; cannot be mandatory for common characteristics subset
    sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "hasEnd: An instance of parameter applicability must have exactly one value of the end of the interval in which it is applicable. This error may be due to not having a value, having more than one value, having a value that is not an IRI or is not a time:Instant."@en .

# parameterValueType
era-sh:ParameterApplicabilityShape sh:property era-sh:ParameterValueType .
era-sh:ParameterValueType
	a sh:PropertyShape;
    era:affectedClass era:ParameterApplicability;
    era:affectedProperty era:parameterValueType ;
    era:scope "local";
	rdfs:comment "In the case of a change in the value of a parameter, there needs to be an information on the type of the new value. The “Value type” will have different possible options: “nominal”, “planned temporary restriction”, “permanent restriction”, “planned temporary closure."@en ;
	sh:path era:parameterValueType ;
    sh:nodeKind sh:IRI ;
    # sh:minCount 1; cannot be mandatory for common characteristics subset
    sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "parameterValueType: An instance of parameter applicability must have exactly one value of the parameter value type. This error may be due to not having a value, having more than one value, having a value that is not an IRI."@en .

# parameterValueType
era-sh:ParameterApplicabilityShape sh:sparql era-sh:ParameterValueTypeSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:ParameterValueTypeSKOS.
era-sh:ParameterValueTypeSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:parameterValueType;
    era:affectedClass era:ParameterApplicability;
    era:scope "local";
	rdfs:comment "In the case of a change in the value of a parameter, there needs to be an information on the type of the new value. The “Value type” will have different possible options: “nominal”, “planned temporary restriction”, “permanent restriction”, “planned temporary closure."@en ;
	sh:message "parameterValueType: The parameter applicability {$this} with label {?thisLabel}  has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/parameterApplicability/ValueTypes."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?thisLabel ?concept (era:parameterValueType AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        $this era:parameterValueType ?concept .
        era:parameterValueType era:inSkosConceptScheme ?conceptScheme .
        FILTER NOT EXISTS { ?concept skos:inScheme ?conceptScheme }
    }
""" .

# parameterValue
era-sh:ParameterApplicabilityShape sh:property era-sh:ParameterValue .
era-sh:ParameterValue
	a sh:PropertyShape;
    era:affectedClass era:ParameterApplicability;
    era:affectedProperty era:parameterValue ;
    era:scope "local";
	rdfs:comment "This property is used to link an applicability to the precise value of the parameter"@en ;
	sh:path era:parameterValue ;
    # sh:minCount 1; cannot be mandatory for common characteristics subset
    sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "parameterValue: An instance of parameter applicability must have exactly one value of the parameter value. This error may be due to not having a value or having more than one value."@en .


#############################
# Rules for platform
#############################

#
# platform
#
era-sh:PlatformEdgeShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:PlatformEdge .

era-sh:OperationalPointShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:OperationalPoint .

era-sh:CommonCharacteristicsSubsetShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:CommonCharacteristicsSubset .  # Applies to all Common Characteritics Subset  with platform parameters 



# platformId: # 1.2.1.0.6.2
era-sh:PlatformEdgeShape sh:property era-sh:PlatformId .
era-sh:PlatformId
	a sh:PropertyShape;
    era:affectedProperty era:platformId;
    era:affectedClass era:PlatformEdge;
    era:scope "local";
    rdfs:comment "Unique platform identification or unique platform number within OP. "@en ;
	era:rinfIndex "1.2.1.0.6.2" ;
	sh:path era:platformId ;
	sh:minCount 1 ;
    sh:maxCount 1 ;
	sh:datatype xsd:string ;
	sh:severity sh:Violation ;
	sh:message "platformId (1.2.1.0.6.2): Each Platform must have exactly one platformId. This error may be due to having a platform without or with more than one platformId or it value is not a string."@en .

# platformId: # 1.2.1.0.6.2 Unique platform id within OP
era-sh:OperationalPointShape sh:sparql era-sh:NoRepeatedPlatformIdsOP.
era-sh:NoRepeatedPlatformIdsOP 
    a sh:SPARQLConstraint ; 
    era:affectedProperty era:platformId;
    era:affectedClass era:PlatformEdge;
    era:affectedClass era:OperationalPoint;
    era:scope "global";
    rdfs:comment "Each platform shall have unique identification or number within the OP. This number cannot be used for naming any other platform in the same OP. "@en ;
    era:rinfIndex "1.2.1.0.6.2" ;
    sh:message "platformId (1.2.1.0.6.2):: Each platform shall have unique identification or number within the OP. This number cannot be used for naming any other platform in the same OP. There is a problem with OP {$this} ({?opLabel}) and platforms {?platform1} ({?platform1Label}) and {?platform2} ({?platform2Label}), since they have the same identifier: {?value}."@en ;
    sh:prefixes era:;
    sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?opLabel ?platform1 ?platform1Label ?platform2 ?platform2Label ?value (era:platformId AS ?path)
    WHERE {
				$this era:hasPart ?platform1 ;
							era:hasPart ?platform2 .
				?platform1 a era:PlatformEdge ;
									 era:platformId ?value .
				?platform2 a era:PlatformEdge ;
									 era:platformId ?value .
				FILTER(?platform1 != ?platform2) .

        OPTIONAL { $this rdfs:label ?opLabel0 } .
        BIND(COALESCE(?opLabel0, "unknown label") AS ?opLabel)
        OPTIONAL { ?platform1 rdfs:label ?platform1Label0 } .
        BIND(COALESCE(?platform1Label0, "unknown label") AS ?platform1Label)
        OPTIONAL { ?platform2 rdfs:label ?platform2Label0 } .
        BIND(COALESCE(?platform2Label0, "unknown label") AS ?platform2Label)
    }
    """ .


# tenClassification: # 1.2.1.0.6.3
era-sh:PlatformEdgeShape sh:property era-sh:TenClassificationP .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:TenClassificationP .
era-sh:TenClassificationP
	a sh:PropertyShape;
    era:affectedProperty era:tenClassification;
    era:affectedClass era:PlatformEdge;
    era:scope "local";   
    rdfs:comment "Indicates the part of the trans-European network the platform belongs to. "@en ;
	era:rinfIndex "1.2.1.0.6.3" ;
	sh:path era:tenClassification ;
	sh:nodeKind sh:IRI;
	sh:severity sh:Violation ;
	sh:message "TEN classification (1.2.1.0.6.3): This error may be due to having a Platform with a TEN classification that is not an URI."@en .

#tenClassification: # 1.2.1.0.6.3
era-sh:PlatformEdgeShape sh:sparql era-sh:TenClassificationSKOSP .
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:TenClassificationSKOSP .
era-sh:TenClassificationSKOSP
	a sh:SPARQLConstraint ;
    era:affectedProperty era:tenClassification;
    era:affectedClass era:PlatformEdge;
    era:scope "local";    
	rdfs:comment "Indicates the part of the trans-European network the platform belongs to. "@en ;
	era:rinfIndex "1.2.1.0.6.3" ;
	sh:nodeKind sh:IRI ;
	sh:message "TEN classification (1.2.1.0.6.3): The platform {$this} with label {?label} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/ten-classifications/TENClassifications."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?concept ?label (era:tenClassification AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:tenClassification ?concept .
        era:tenClassification era:inSkosConceptScheme ?conceptScheme .
        FILTER NOT EXISTS { ?concept skos:inScheme ?conceptScheme }
    }
""" .


# lengthOfPlatform: # 1.2.1.0.6.4
era-sh:PlatformEdgeShape sh:property era-sh:LengthP .
era-sh:LengthP
	a sh:PropertyShape;
    era:affectedProperty era:lengthOfPlatform;
    era:affectedClass era:PlatformEdge;
    era:scope "local";   
    rdfs:comment "The maximum continuous length (expressed in metres) of that part of platform in front of which a train is intended to remain stationary in normal operating conditions for passengers to board and alight from the train, making appropriate allowance for stopping tolerances. "@en ;
	era:rinfIndex "1.2.1.0.6.4" ;
	sh:path era:lengthOfPlatform ;
	sh:maxCount 1 ;
	sh:datatype xsd:double ;
	sh:severity sh:Warning ;
	sh:message "length (1.2.1.0.6.4): Each Platform must have at most one length. This error may be caused due to having a platform with more than one length or having a value that is not a Real number."@en .
	


# platformHeight: # 1.2.1.0.6.5
era-sh:PlatformEdgeShape sh:property era-sh:PlatformHeightP .
 era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:PlatformHeightP .
era-sh:PlatformHeightP
	a sh:PropertyShape;
    era:affectedProperty era:platformHeight;
    era:affectedClass era:PlatformEdge;
    era:scope "local";   
    rdfs:comment "Distance between the upper surface of platform and running surface of the neighbouring track. It is the nominal value expressed in millimetres. "@en ;
	era:rinfIndex "1.2.1.0.6.5" ;
	sh:path era:platformHeight ;
	sh:maxCount 1 ;
	sh:nodeKind sh:IRI;
	sh:severity sh:Warning ;
	sh:message "platformHeight (1.2.1.0.6.5): Each Platform must have at most  one height. This error may be due to having a platform with more than one height, or having a value that is not an URI."@en .

# platformHeight: # 1.2.1.0.6.5
era-sh:PlatformEdgeShape sh:sparql era-sh:PlatformHeightSKOS .
 era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:PlatformHeightSKOS .
era-sh:PlatformHeightSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:platformHeight;
    era:affectedClass era:PlatformEdge;
    era:scope "local";   
	rdfs:comment "Distance between the upper surface of platform and running surface of the neighbouring track. It is the nominal value expressed in millimetres. "@en ;
	era:rinfIndex "1.2.1.0.6.5" ;
	sh:nodeKind sh:IRI ;
	sh:message "Platform height (1.2.1.0.6.5): The platform {$this} with label {?label} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/platform-heights/PlatformHeights."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:platformHeight AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:platformHeight ?concept .
        era:platformHeight era:inSkosConceptScheme ?conceptScheme .
        FILTER (NOT EXISTS {?concept skos:inScheme ?conceptScheme} || REGEX(STR(?concept), "/eratv/"))
	}
""" .


# assistanceStartingTrain: # 1.2.1.0.6.6
era-sh:PlatformEdgeShape sh:property era-sh:AssistanceStartingTrain .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:AssistanceStartingTrain  .
era-sh:AssistanceStartingTrain
	a sh:PropertyShape;
    era:affectedProperty era:assistanceStartingTrain;
    era:affectedClass era:PlatformEdge;
    era:scope "local";   
    rdfs:comment "Indication of existence of equipment or staff supporting the train crew in starting the train.\nFixed equipment (for example mirrors or CCTV cameras) or station staff indicating to train crew or driver when to close doors and whether this has been done successfully. "@en ;
	era:rinfIndex "1.2.1.0.6.6" ;
	sh:path era:assistanceStartingTrain ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "assistanceStartingTrain (1.2.1.0.6.6): Each Platform must have at most one assistanceStartingTrain declaration. This error may be caused due to having a platform with having more than one assistanceStartingTrain, or its value is not Y/N (boolean)."@en .
	
# areaBoardingAid: # 1.2.1.0.6.7
era-sh:PlatformEdgeShape sh:property era-sh:AreaBoardingAid .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:AreaBoardingAid .
era-sh:AreaBoardingAid
	a sh:PropertyShape;
    era:affectedProperty era:areaBoardingAid;
    era:affectedClass era:PlatformEdge;
    era:scope "local";
    rdfs:comment "Information of the train access level for which the boarding aid can be used. "@en ;
	era:rinfIndex "1.2.1.0.6.7" ;
	sh:path era:areaBoardingAid ;
	sh:maxCount 1 ;
	sh:datatype xsd:integer ;
	sh:severity sh:Warning ;
	sh:message "areaBoardingAid (1.2.1.0.6.7): Each Platform must have at most one areaBoardingAid value. This error may be caused due to having a platform with multiple areaBoardingAid values or having a value that is not an integer."@en .

# hasPlatformCurvature: # 1.2.1.0.6.8 
era-sh:PlatformEdgeShape sh:property era-sh:HasPlatformCurvature .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:HasPlatformCurvature .
era-sh:HasPlatformCurvature
	a sh:PropertyShape;
    era:affectedProperty era:hasPlatformCurvature;
    era:affectedClass era:PlatformEdge;
    era:scope "local";
    rdfs:comment "Indication of the existence of the curvature of the platform. "@en ;
	era:rinfIndex "1.2.1.0.6.8 " ;
	sh:path era:hasPlatformCurvature ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "hasPlatformCurvature (1.2.1.0.6.8): Each Platform must have at most one hasPlatformCurvature value. This error may be caused due to having a platform with multiple hasPlatformCurvature values or having a value that is not a boolean."@en .
	


era-sh:PrimaryLocationShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:PrimaryLocation.


# primaryLocationCode: # 1.2.0.0.0.3 
era-sh:PrimaryLocationShape sh:property era-sh:PrimaryLocationCode .
era-sh:PrimaryLocationCode
	a sh:PropertyShape;
    era:affectedClass era:PrimaryLocation;
    era:affectedProperty era:primaryLocationCode ;
    era:scope "local";
	rdfs:comment "Primary location code developed for information exchange in accordance with the TSIs relating to the telematics applications subsystem."@en ;
	era:rinfIndex "1.2.0.0.0.3" ;
	sh:path era:primaryLocationCode ;
	sh:datatype xsd:string ;
	sh:maxCount 1 ;
	sh:minCount 1 ; 
    sh:pattern "^[A-Z]{2}[0-9]{5}$";
	sh:severity sh:Violation ;
	sh:message "primaryLocationCode (1.2.0.0.0.3): The primary location code must be represented as a String and follow the pattern [AANNNNN]. It should be unique. "@en .

# containerHandlingFlag  
era-sh:PrimaryLocationShape sh:property era-sh:ContainerHandlingFlag .
era-sh:ContainerHandlingFlag
	a sh:PropertyShape ; 
    era:affectedProperty era:containerHandlingFlag ;
    era:affectedClass  era:PrimaryLocation;
    era:scope "local";
    rdfs:comment "Indicates whether a primary location is suitable for handling containers and loading or unloading of containers."@en ;
	sh:path era:containerHandlingFlag ;
	sh:datatype xsd:boolean;
	sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "containerHandlingFlag : The PrimaryLocation may have a containerHandlingFlag value that is a boolean. This error may be due to the Primary Location having  a value that is not a boolean."@en .

# freightFlag  
era-sh:PrimaryLocationShape sh:property era-sh:FreightFlag .
era-sh:FreightFlag
	a sh:PropertyShape ; 
    era:affectedProperty era:freightFlag ;
    era:affectedClass  era:PrimaryLocation;
    era:scope "local";
    rdfs:comment "Indicates whether a freight train can perform commercial freight activity at a primary location."@en ;
	sh:path era:freightFlag ;
    sh:maxCount 1;
	sh:datatype xsd:boolean;
	sh:severity sh:Violation ;
	sh:message "freightFlag : The PrimaryLocation may have a freightFlag value that is a boolean. This error may be due to the Primary Location having more than one value or having  a value that is not a boolean."@en .

# handoverPointFlag  
era-sh:PrimaryLocationShape sh:property era-sh:HandoverPointFlag .
era-sh:HandoverPointFlag
	a sh:PropertyShape ; 
    era:affectedProperty era:handoverPointFlag ;
    era:affectedClass  era:PrimaryLocation;
    era:scope "local";
    rdfs:comment "Indicates whether a primary location is a point where legal responsibility changes between Infrastructure Managers. This can be, but does not have to be, in conjunction with a state border."@en ;	sh:path era:handoverPointFlag ;
	sh:datatype xsd:boolean;
	sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "handoverPointFlag : The PrimaryLocation may have a handoverPointFlag value that is a boolean. This error may be due to the Primary Location having  a value that is not a boolean."@en .


# primaryLocationName
era-sh:PrimaryLocationShape sh:property era-sh:PrimaryLocationName .
era-sh:PrimaryLocationName
	a sh:PropertyShape ; 
    era:affectedProperty era:primaryLocationName ;
    era:affectedClass  era:PrimaryLocation;
    era:scope "local";
	rdfs:comment "Primary location name."@en ;
	sh:path era:primaryLocationName ;
	sh:datatype rdf:langString ;
	sh:nodeKind sh:Literal ;
    sh:uniqueLang true ;
	sh:severity sh:Violation ;
	sh:message "primaryLocationName : The PrimaryLocation may have one primaryLocationName per language tag. If it does, there should be at least one name in English (@en). This error may be due to the Primary Location having a value that is not conform per language tag."@en ;
    sh:sparql era-sh:LangStringEnRequiredIfPresent .

# inNUTS3
era-sh:PrimaryLocationShape sh:property era-sh:InNUTS3.
era-sh:InNUTS3
    a sh:PropertyShape ;
    era:affectedClass era:PrimaryLocation ;
    era:affectedProperty era:inNUTS3 ;
    era:scope "local" ;
    rdfs:comment "Reference to NUTS-3 place or city"@en ;
    sh:path era:inNUTS3 ;
    sh:maxCount 1 ;
    sh:nodeKind sh:IRI ;
    sh:class skos:Concept ;
    sh:severity sh:Warning ;
    sh:message """inNUTS3: Each PrimaryLocation may have at most one value for nuts3 which must be an IRI.
      This error is due to having more than one values, or a value that is not an IRI."""@en .

# inNUTS3 SKOS
era-sh:PrimaryLocationShape sh:sparql era-sh:InNUTS3SKOS.
era-sh:InNUTS3SKOS
    a sh:SPARQLConstraint ;
    era:affectedClass era:PrimaryLocation ;
    era:affectedProperty era:inNUTS3 ;
    era:scope "local" ;
    rdfs:comment "Reference to NUTS-3 place or city"@en ;
    sh:severity sh:Warning ;
    sh:message "inNUTS3: The PrimaryLocation {$this} with label {?thisLabel} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: https://publications.europa.eu/resource/authority/nuts."@en ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

        SELECT $this ?thisLabel ?concept (era:inNUTS3 AS ?path)
        WHERE {
          OPTIONAL { $this rdfs:label ?thisLabel0 } .
          BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)

          $this era:inNUTS3 ?concept .
          era:inNUTS3 era:inSkosConceptScheme ?conceptScheme .
          FILTER NOT EXISTS { ?concept skos:inScheme ?conceptScheme }
        }
""" .


# operationalRegimeType
era-sh:SectionOfLineShape sh:property era-sh:OperationalRegimeType .
era-sh:OperationalRegimeType
    a sh:PropertyShape ;
    era:affectedClass era:SectionOfLine ;
    era:affectedProperty era:operationalRegimeType ;
    era:scope "local" ;
    rdfs:comment "Double track type."@en ;
    sh:path era:operationalRegimeType ;
	sh:maxCount 1;
    sh:nodeKind sh:IRI ;
    sh:severity sh:Violation ;
    sh:message "operationalRegimeType: Each SectionOfLine may have at most one value for operational regime which must be an IRI. This error is due to having more than one values, or a value that is not an IRI."@en .

# operationalRegimeType
era-sh:SectionOfLineShape sh:sparql era-sh:OperationalRegimeTypeSKOS .
era-sh:OperationalRegimeTypeSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:operationalRegimeType ;
    era:affectedClass era:SectionOfLine ;
    era:scope "local" ;
    rdfs:comment "Double track type."@en ;
    sh:message "operationalRegimeType: The SectionOfLine {$this} with label {?thisLabel} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/operational-regime-types/OperationalRegimeTypes."@en ;
    sh:prefixes era: ;
    sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?thisLabel ?concept (era:operationalRegimeType AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        $this era:operationalRegimeType ?concept .
        era:operationalRegimeType era:inSkosConceptScheme ?conceptScheme .
        FILTER NOT EXISTS { ?concept skos:inScheme ?conceptScheme }
    }
""" .


# existenceOfIndustrialRisk: # 1.1.0.0.1.1
era-sh:SectionOfLineShape sh:property era-sh:ExistenceOfIndustrialRisk .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:ExistenceOfIndustrialRisk .
era-sh:ExistenceOfIndustrialRisk
    a sh:PropertyShape ;
    era:affectedProperty era:existenceOfIndustrialRisk ;
    era:affectedClass era:SectionOfLine ;
    era:affectedClass era:CommonCharacteristicsSubset ;
    era:scope "local" ;
    rdfs:comment "Indication that the full section of line (or a part of it) is identified by the Infrastructure Managers where drivers are not supposed to get off the locomotive."@en ;
    era:rinfIndex "1.1.0.0.1.1" ;
    sh:path era:existenceOfIndustrialRisk ;
    sh:datatype xsd:boolean ;
    sh:maxCount 1 ;
    sh:severity sh:Violation ;
    sh:message "existenceOfIndustrialRisk (1.1.0.0.1.1): Each section of line or common characteristics subset may have at most one value for existence of industrial risk. This error is due to having more than one value or having a value that is not Y/N (boolean)."@en .


# Commented-out for now
# era-sh:PrimaryLocationShape sh:property era-sh:HasPartPL .
# era-sh:HasPartPL
#	 a sh:PropertyShape;
#    era:affectedClass era:PrimaryLocation;
#    era:affectedProperty era:hasPart ;
#    era:scope "local";
#	rdfs:comment "Indicates that a PrimaryLocation hasPart at least one Track."@en ;
#	sh:path era:hasPart ;
#	sh:class era:Track;
#	sh:minCount 1;
#   sh:nodeKind sh:IRI ;
#	sh:severity sh:Violation ;
#	sh:message "hasPart: The PrimaryLocation must have a hasPart reference that is an IRI that refers to an instance of Track. This error is due to not having a value or having a value that is not an instance of Track."@en .




era-sh:RadioBlockCenterShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:RadioBlockCenter.



# rbcID: # 1.1.1.3.2.17, 1.2.1.1.1.17
era-sh:RadioBlockCenterShape sh:property era-sh:RbcID .
era-sh:RbcID
	a sh:PropertyShape;
    era:affectedClass era:RadioBlockCenter;
    era:affectedProperty era:rbcID ;
    era:scope "local";
	rdfs:comment "Unique RBC identification (NID_C+NID_RBC) as defined in the specification referenced in TSI CCS."@en ;
	era:rinfIndex "1.1.1.3.2.17" ;
    era:rinfIndex "1.2.1.1.1.17" ;
	sh:path era:rbcID ;
	sh:datatype xsd:string ;
    sh:maxCount 1 ;
    sh:pattern "^(\\d{4})( )?(\\d{4})$";
	sh:severity sh:Violation ;
	sh:message "rbcID (1.1.1.3.2.17, 1.2.1.1.1.17): The radio block center id must be represented as a String and follow the pattern [NNNN NNNN]. This error may be due to having a value that is not a string or that does not follow the pattern."@en .

# rbcID - future required (warning level)
era-sh:RadioBlockCenterShape sh:property era-sh:RbcIDFutureRequired .
era-sh:RbcIDFutureRequired
	a           sh:PropertyShape ;
	era:affectedProperty era:rbcID ;
	era:affectedClass era:RadioBlockCenter ;
	era:scope "local" ;
	sh:path     era:rbcID ;
	sh:minCount 1 ;
	sh:maxCount 1 ;
	sh:severity sh:Warning ;
	sh:message  "This property is not yet required but will be 12 months after publication of Article 7 Guide."@en .

# rbcPhone: # 1.1.1.3.2.17, 1.2.1.1.1.17
era-sh:RadioBlockCenterShape sh:property era-sh:RbcPhone .
era-sh:RbcPhone
	a sh:PropertyShape;
    era:affectedClass era:RadioBlockCenter;
    era:affectedProperty era:rbcPhone ;
    era:scope "local";
	rdfs:comment "Unique RBC calling number (NID_RADIO) as defined in the specification referenced in TSI CCS."@en ;
	era:rinfIndex "1.1.1.3.2.17" ;
    era:rinfIndex "1.2.1.1.1.17" ;
	sh:path era:rbcPhone ;
	sh:datatype xsd:string ;
    sh:maxCount 1;
    sh:pattern "^(\\d{4})( )?(\\d{4})( )?(\\d{4})( )?(\\d{4})$";
	sh:severity sh:Warning ;
	sh:message "rbcPhone (1.1.1.3.2.17, 1.2.1.1.1.17): The radio block center phone must be represented as a String and follow the pattern [NNNN NNNN NNNN NNNN].This error may be due to having a value that is not a string or that does not follow the pattern"@en .



#############################
# Rules for ReferenceBorderPoints
#############################


era-sh:ReferenceBorderPointShape
    a sh:NodeShape ;
    sh:targetClass era:ReferenceBorderPoint ;
    sh:nodeKind sh:IRI ;
    sh:pattern "^http://data\\.europa\\.eu/949/" ;
    sh:message "ReferenceBorderPoint URI: The instance has a URI that does not follow the required pattern '^http://data.europa.eu/949/'. All instances of era:ReferenceBorderPoint must have URIs starting with http://data.europa.eu/949/."@en .

era-sh:ReferenceBorderPointShape sh:property era-sh:BorderPointId .
era-sh:BorderPointId
    a sh:PropertyShape ;
    era:affectedClass era:ReferenceBorderPoint ;
    era:affectedProperty era:borderPointId ;
    sh:path era:borderPointId ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:pattern "^EU.{0,10}$" ;
    sh:severity sh:Violation ;
    sh:message "A ReferenceBorderPoint must have exactly one era:borderPointId, and it must be a string. This error is due to having more than one borderPointId, not having a borderPointId, having a value that is not a string, or having a value that does not follow the pattern where the first part is 'EU', and the second part is the alphanumeric OP code within the MS."@en .

era-sh:ReferenceBorderPointShape sh:property era-sh:ReferenceBorderPointGeometry .
era-sh:ReferenceBorderPointGeometry
    a sh:PropertyShape ;
    era:affectedClass era:ReferenceBorderPoint ;
    era:affectedProperty geosparql:hasGeometry ;
    sh:path geosparql:hasGeometry ;
    sh:nodeKind sh:IRI ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:class geosparql:Geometry;
    sh:severity sh:Violation ;
    sh:message "A ReferenceBorderPoint must have exactly one geo:hasGeometry, and its value must be an instance of geo:Gemoetry. This error is due to having more than one, having none, or having a value that is not an istance of geo:Geometry."@en .

# Check that all the OPs pointing to a ReferenceBorderPoint have the same uopid and coordinates
era-sh:ReferenceBorderPointShape sh:sparql era-sh:ConsistentOPsPerReferenceBorderPoint .
era-sh:ConsistentOPsPerReferenceBorderPoint
    a sh:SPARQLConstraint ;
    era:affectedClass era:ReferenceBorderPoint ;
    era:affectedProperty era:referenceBorderPoint ;
    sh:message "ReferenceBorderPoint {$this} is referenced by {?op1} and {?op2} with inconsistent uopid or coordinates (geo:asWKT). All OPs pointing to the same ReferenceBorderPoint must have the same uopid and identical coordinates."@en ;
    sh:prefixes era: ;
    sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX geo: <http://www.opengis.net/ont/geosparql#>

    SELECT DISTINCT $this ?op1 ?op2 (era:referenceBorderPoint AS ?path)
        WHERE {
            # Two different OPs pointing to the same ReferenceBorderPoint ($this)
            ?op1 era:referenceBorderPoint $this .
            ?op2 era:referenceBorderPoint $this .
            FILTER(?op1 != ?op2)

            # Ensure both OPs have uopid and geometry
            ?op1 era:uopid ?uopid1 .
            ?op2 era:uopid ?uopid2 .

            ?op1 era:netReference ?netRef1 .
            ?netRef1 geo:hasGeometry ?geom1 .
            ?geom1 geo:asWKT ?wkt1 .

            ?op2 era:netReference ?netRef2 .
            ?netRef2 geo:hasGeometry ?geom2 .
            ?geom2 geo:asWKT ?wkt2 .

            # Raise violation if either uopid or coordinates differ
            FILTER (?uopid1 != ?uopid2 || ?wkt1 != ?wkt2)
        }
"""
.



#############################
# Rules for Sections of Line
#############################


era-sh:SectionOfLineShape  
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:SectionOfLine .

#nationalLine: # 1.1.0.0.0.2
era-sh:SectionOfLineShape sh:property era-sh:NationalLineSoL .
era-sh:NationalLineSoL
    a sh:PropertyShape ;
    era:affectedProperty era:nationalLine;
    era:affectedClass era:SectionOfLine;
    era:scope "local";
    rdfs:comment "Indicates the national railway line that a Section of Line belongs to, via a linear positioning system."@en ;
    era:rinfIndex "1.1.0.0.0.2" ;
    sh:path era:nationalLine ;           
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:class era:LinearPositioningSystem;
    sh:nodeKind sh:IRI ;
    sh:severity sh:Violation ;
    sh:message "nationalLine (1.1.0.0.0.2): Each Section of Line must indicate exactly one national railway line via a linear positioning system. This error is due to not having a value, having more than one value, or having a value that is not an instance of LinearPositioningSystem."@en .

#opStart: # 1.1.0.0.0.3
era-sh:SectionOfLineShape sh:property era-sh:OpStart .
era-sh:OpStart
    a sh:PropertyShape ;
    era:affectedProperty era:opStart;
    era:affectedClass era:SectionOfLine;
    era:scope "global";    
    rdfs:comment "Each SoL may have only one start OP, and each OP has unique OP ID within the MS. The “uniqueOPID” is defined in parameter 1.2.0.0.0.2. Each SoL has the principal direction of the traffic defined by increasing kilometres running from the start OP to the end OP. That is why the start OP is always located at lowest kilometre of the line within the SoL. Data collected in the UK in miles will be transformed to km for uploading to the RINF application. The OP ID must exist in the MS file of RINF. The value of this parameter must be different from 1.1.0.0.0.4. No validation will be performed by RINF application regarding which is the start and which the end OP. This requires national verification. "@en ;
    era:rinfIndex "1.1.0.0.0.3" ;
    sh:path era:opStart ; 
    sh:disjoint era:opEnd ; # value must be different to opEnd
    sh:minCount 1 ; 
    sh:maxCount 1 ;
    sh:nodeKind sh:IRI ;
    sh:class era:OperationalPoint ; 
    sh:severity sh:Violation ;
    sh:message "opStart (1.1.0.0.0.3): There must be exactly one OP start for this section of line and it must be different from the OP end."@en .

#opEnd: # 1.1.0.0.0.4
era-sh:SectionOfLineShape sh:property era-sh:OpEnd .
era-sh:OpEnd
    a sh:PropertyShape ;
    era:affectedProperty era:opEnd;
    era:affectedClass era:SectionOfLine;
    era:scope "global";   
    rdfs:comment "Each SoL may have only one end OP, and each OP has unique OP ID within the MS. The “uniqueOPID” is defined in parameter 1.2.0.0.0.2. Each SoL has the principal direction of the traffic defined by increasing kilometres running from the start OP to the end OP. That is why the start OP is always located at lowest kilometre of the line within the SoL. Data collected in the UK in miles will be transformed to km for uploading to the RINF application. The OP ID must exist in the MS file of RINF. The value of this parameter must be different from 1.1.0.0.0.3. No validation will be performed by RINF application regarding which is the start and which the end OP. This requires national verification. "@en ;
    era:rinfIndex "1.1.0.0.0.4" ;
    sh:path era:opEnd ; 
    sh:disjoint era:opStart ; # value must be different to opStart
    sh:minCount 1 ; 
    sh:maxCount 1 ;
    sh:nodeKind sh:IRI ;
    sh:class era:OperationalPoint ; 
    sh:severity sh:Violation ;
    sh:message "opEnd (1.1.0.0.0.4): There must be exactly one OP end for this section of line and it must be different from the OP start."@en .


#lengthOfSectionOfLine: # 1.1.0.0.0.5
era-sh:SectionOfLineShape sh:property era-sh:SolLength .
era-sh:SolLength
    a sh:PropertyShape ;
    era:affectedProperty era:lengthOfSectionOfLine;
    era:affectedClass era:SectionOfLine;
    era:scope "local";
    
    rdfs:comment "General description: The length of SoL is theoretical distance between centre points of Ops which are selected in such a way to represent the average value for all tracks within the SoL. It is advised to include distances applied by IM for commercial purposes.  Validation: No validation will be performed by RINF application regarding the length of SoL. This requires national verification. "@en ;
    era:rinfIndex "1.1.0.0.0.5" ;
    sh:path era:lengthOfSectionOfLine ; 
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:double ;
    sh:severity sh:Violation ;
    sh:message "lengthOfSectionOfLine (1.1.0.0.0.5): Each SoL has exactly one length. This error is due to that either there is no length for the specified SoL, more than one length has been defined, or the datatype cannot be converted into an xsd:double."@en .

#solNature: # 1.1.0.0.0.6
era-sh:SectionOfLineShape sh:property era-sh:SolNature .
era-sh:SolNature
    a sh:PropertyShape ;
    era:affectedProperty era:solNature;
    era:affectedClass era:SectionOfLine;
    era:scope "local";   
    rdfs:comment "General description: Validation: If the value of this parameter is 'Link', then for all tracks belonging to this SoL, all the parameters of the following groups of parameters are not applicable: 1.1.1.1 Infrastructure subsystem, 1.1.1.2 Energy subsystem, 1.1.1.3 Control-command and signalling subsystem. "@en ;
    era:rinfIndex "1.1.0.0.0.6" ;
    sh:path era:solNature ; 
    sh:minCount 1;
    sh:maxCount 1 ;
    sh:nodeKind sh:IRI ;
    sh:severity sh:Violation ;
    sh:message "SoL nature (1.1.0.0.0.6): Either no SOL nature is specified for this SoL, or more than one SoL nature has been specified."@en .


#solNature: # 1.1.0.0.0.6
era-sh:SectionOfLineShape sh:sparql era-sh:SolNatureSKOS .
era-sh:SolNatureSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:solNature;
    era:affectedClass era:SectionOfLine;
    era:scope "local";
    
	rdfs:comment "Indication of the SOL nature. "@en ;
	era:rinfIndex "1.1.0.0.0.6" ;
	# sh:path era:solNature ;
	# sh:nodeKind sh:IRI ; # Already checked in era-sh:SolNature
	sh:message "SoL nature (1.1.0.0.0.6): The SOL {$this} with label {?label} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/sol-natures/SoLNatures."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?concept ?label (era:solNature AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:solNature ?concept .
        era:solNature era:inSkosConceptScheme ?conceptScheme .
        FILTER NOT EXISTS { ?concept skos:inScheme ?conceptScheme }
    }
""" .





# solNature: # 1.1.0.0.0.6
era-sh:SectionOfLineShape sh:sparql era-sh:SolNatureApplicability .
era-sh:SolNatureApplicability
    a sh:SPARQLConstraint ; 
    era:affectedProperty era:solNature;
    era:affectedClass era:SectionOfLine;
    era:scope "global";
    
    rdfs:comment "If the value of this parameter is “Link”, then for all tracks belonging to this SoL, all the parameters of the following groups of parameters are not applicable: 1.1.1.1 Infrastructure subsystem; 1.1.1.2 Energy subsystem; 1.1.1.3 Control-command and signalling subsystem. "@en ;
    era:rinfIndex "1.1.0.0.0.6" ;
    sh:message "SoL nature (1.1.0.0.0.6): The SoL {$this} ({?solLabel}), with opStart {?opStartID} and opEnd {?opEndID}, has a SOLnature of type Link, and at least one of its tracks has values for at least one of the groups of parameters 1.1.1.1, 1.1.1.2 or 1.1.1.3. This happens at least with the track {?track} ({?trackLabel}), with property {?p} (RINF index {?index})."@en ;
    sh:prefixes era:;
    sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?solLabel ?opStartID ?opEndID ?p ?index ?track ?trackLabel (era:solNature AS ?path)
    WHERE {
        $this era:solNature <http://data.europa.eu/949/concepts/sol-natures/20> .
        OPTIONAL { $this rdfs:label ?solLabel0 } .
        BIND(COALESCE(?solLabel0, "unknown label") AS ?solLabel)
        { $this era:hasPart ?track } UNION { $this era:track ?track }
				?track a era:Track .
        $this era:opStart ?opStart . ?opStart era:uopid ?opStartID .
        $this era:opEnd ?opEnd . ?opEnd era:uopid ?opEndID .
        OPTIONAL { ?track rdfs:label ?trackLabel0 } .
        BIND(COALESCE(?trackLabel0, "unknown label") AS ?trackLabel)
        ?track ?p ?y .
        ?p era:rinfIndex ?index .
        FILTER EXISTS { ?track ?p ?value } .
        FILTER(strstarts(?index,'1.1.1.1') || strstarts(?index,'1.1.1.2') || strstarts(?index,'1.1.1.3'))
    }
    """ .

# netReference for SectionOfLine
era-sh:SectionOfLineShape sh:property era-sh:NetReferenceSOL .
era-sh:NetReferenceSOL
    a sh:PropertyShape ;
    era:affectedProperty era:netReference ;
    era:affectedClass era:SectionOfLine ;
    era:scope "local" ;
    rdfs:comment "The reference that a SectionOfLine has on the topology. It must point to an instance of NetBasicReference."@en ;
    sh:path era:netReference ;
    # sh:minCount 1 ; # to be added later
    sh:class era:NetBasicReference ;
    sh:nodeKind sh:IRI ;
    sh:severity sh:Violation ;
    sh:message "netReference: Each SectionOfLine must have at least one netReference pointing to an instance of NetBasicReference. This error is due to not having a value or having a value that is not a NetBasicReference."@en .

# existRestrictedPeriodOfTimeDangerousGood
era-sh:SectionOfLineShape sh:property era-sh:ExistRestrictedPeriodOfTimeDangerousGood .
era-sh:ExistRestrictedPeriodOfTimeDangerousGood
	a sh:PropertyShape ;
	era:affectedProperty era:existRestrictedPeriodOfTimeDangerousGood ;
	era:affectedClass era:SectionOfLine ;
	era:scope "local" ;
	rdfs:comment "Indicate, if there are any limits on specific time of a day for transport of dangerous goods."@en ;
	sh:path era:existRestrictedPeriodOfTimeDangerousGood ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Warning ;
	sh:message "existRestrictedPeriodOfTimeDangerousGood: A SectionOfLine may have at most one value indicating if there are limits on specific time of a day for transport of dangerous goods. This error may be due to having more than one value or having a value that is not Y/N (boolean)."@en .

# restrictedPeriodOfTimeDangerousGood
era-sh:SectionOfLineShape sh:property era-sh:RestrictedPeriodOfTimeDangerousGood .
era-sh:RestrictedPeriodOfTimeDangerousGood
	a sh:PropertyShape ;
	era:affectedProperty era:restrictedPeriodOfTimeDangerousGood ;
	era:affectedClass era:SectionOfLine ;
	era:scope "local" ;
	rdfs:comment "Describes the period of time for which the transport of dangerous goods is not allowed in the Section of Line."@en ;
	sh:path era:restrictedPeriodOfTimeDangerousGood ;
	sh:datatype xsd:string ;
	sh:severity sh:Warning ;
	sh:message "restrictedPeriodOfTimeDangerousGood: A SectionOfLine may have values describing the period of time for which the transport of dangerous goods is not allowed. This error may be due to having a value that is not a string."@en .

# hasConnectingIM
era-sh:SectionOfLineShape sh:property era-sh:HasConnectingIM .
era-sh:HasConnectingIM
	a sh:PropertyShape ;
	era:affectedProperty era:hasConnectingIM ;
	era:affectedClass era:SectionOfLine ;
	era:scope "local" ;
	rdfs:comment "Indicates whether any neighbouring section of line belongs to different Infrastructure Manager."@en ;
	sh:path era:hasConnectingIM ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Warning ;
	sh:message "hasConnectingIM: A SectionOfLine may have at most one value indicating whether any neighbouring section of line belongs to different Infrastructure Manager. This error may be due to having more than one value or having a value that is not Y/N (boolean)."@en .

# maximumPermittedMeterLoad
era-sh:SectionOfLineShape sh:property era-sh:MaximumPermittedMeterLoad .
era-sh:MaximumPermittedMeterLoad
	a sh:PropertyShape ;
	era:affectedProperty era:maximumPermittedMeterLoad ;
	era:affectedClass era:SectionOfLine ;
	era:scope "local" ;
	rdfs:comment "Maximum permitted meter load, given in tons."@en ;
	sh:path era:maximumPermittedMeterLoad ;
	sh:maxCount 1 ;
	sh:datatype xsd:double ;
	sh:severity sh:Warning ;
	sh:message "maximumPermittedMeterLoad: A SectionOfLine may have at most one maximum permitted meter load value expressed in tons. This error may be due to having more than one value or having a value that is not a double (real) number."@en .

# maximumTrainLength
era-sh:SectionOfLineShape sh:property era-sh:MaximumTrainLength .
era-sh:MaximumTrainLength
	a sh:PropertyShape ;
	era:affectedProperty era:maximumTrainLength ;
	era:affectedClass era:SectionOfLine ;
	era:scope "local" ;
	rdfs:comment "Maximum train length allowed on a line or section."@en ;
	sh:path era:maximumTrainLength ;
	sh:maxCount 1 ;
	sh:datatype xsd:integer ;
	sh:severity sh:Warning ;
	sh:message "maximumTrainLength: A SectionOfLine may have at most one maximum train length value. This error may be due to having more than one value or having a value that is not an integer."@en .

# specializedInfrastructure
era-sh:SectionOfLineShape sh:property era-sh:SpecializedInfrastructure .
era-sh:SpecializedInfrastructure
	a sh:PropertyShape ;
	era:affectedProperty era:specializedInfrastructure ;
	era:affectedClass era:SectionOfLine ;
	era:scope "local" ;
	rdfs:comment "Special type of service on a line or a section of a line."@en ;
	sh:path era:specializedInfrastructure ;
	sh:datatype xsd:string ;
	sh:severity sh:Warning ;
	sh:message "specializedInfrastructure: A SectionOfLine may have values describing special type of service on the line. This error may be due to having a value that is not a string."@en .

# hasNoiseLevelLimit
era-sh:SectionOfLineShape sh:property era-sh:HasNoiseLevelLimit .
era-sh:HasNoiseLevelLimit
	a sh:PropertyShape ;
	era:affectedProperty era:hasNoiseLevelLimit ;
	era:affectedClass era:SectionOfLine ;
	era:scope "local" ;
	rdfs:comment "Indicate, if there are any limits on noise levels."@en ;
	sh:path era:hasNoiseLevelLimit ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Warning ;
	sh:message "hasNoiseLevelLimit: A SectionOfLine may have at most one value indicating if there are limits on noise levels. This error may be due to having more than one value or having a value that is not Y/N (boolean)."@en .

# maxNoiseLevelOfSoL
era-sh:SectionOfLineShape sh:property era-sh:MaxNoiseLevelOfSoL .
era-sh:MaxNoiseLevelOfSoL
	a sh:PropertyShape ;
	era:affectedProperty era:maxNoiseLevelOfSoL ;
	era:affectedClass era:SectionOfLine ;
	era:scope "local" ;
	rdfs:comment "Maximum allowed noise level in decibels (dB)."@en ;
	sh:path era:maxNoiseLevelOfSoL ;
	sh:maxCount 1 ;
	sh:datatype xsd:integer ;
	sh:severity sh:Warning ;
	sh:message "maxNoiseLevelOfSoL: A SectionOfLine may have at most one maximum noise level value expressed in decibels. This error may be due to having more than one value or having a value that is not an integer."@en .

# loadingGauge
era-sh:SectionOfLineShape sh:property era-sh:LoadingGauge .
era-sh:LoadingGauge
	a sh:PropertyShape ;
	era:affectedProperty era:loadingGauge ;
	era:affectedClass era:SectionOfLine ;
	era:scope "local" ;
	rdfs:comment "Maximum physical dimensions (height and width) to which an open rail wagon can be loaded."@en ;
	sh:path era:loadingGauge ;
	sh:maxCount 1 ;
	sh:datatype xsd:integer ;
	sh:severity sh:Warning ;
	sh:message "loadingGauge: A SectionOfLine may have at most one loading gauge value. This error may be due to having more than one value or having a value that is not an integer."@en .

# maxAxleLoadOfSoL
era-sh:SectionOfLineShape sh:property era-sh:MaxAxleLoadOfSoL .
era-sh:MaxAxleLoadOfSoL
	a sh:PropertyShape ;
	era:affectedProperty era:maxAxleLoadOfSoL ;
	era:affectedClass era:SectionOfLine ;
	era:scope "local" ;
	rdfs:comment "Maximum permitted axle load, given in tons."@en ;
	sh:path era:maxAxleLoadOfSoL ;
	sh:maxCount 1 ;
	sh:datatype xsd:double ;
	sh:severity sh:Warning ;
	sh:message "maxAxleLoadOfSoL: A SectionOfLine may have at most one maximum axle load value expressed in tons. This error may be due to having more than one value or having a value that is not a double (real) number."@en .


#############################
# Rules for sidings
#############################

#
# sidings
#
era-sh:SidingShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:Siding .   # Applies to all Sidings

era-sh:CommonCharacteristicsSubsetShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:CommonCharacteristicsSubset .  # Applies to all Common Characteritics Subset  with sidings parameters 

era-sh:OperationalPointShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:OperationalPoint .   # Applies to all Operational points with sidings

era-sh:MinimumVerticalRadiusShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:MinimumVerticalRadius .   

# sidingId: #1.2.2.0.0.2 
era-sh:SidingShape sh:property era-sh:SidingId .
era-sh:SidingId
	a sh:PropertyShape ;
    era:affectedProperty era:sidingId ;
    era:affectedClass era:Siding;
    era:scope "local";
	rdfs:comment "Unique siding identification or unique siding number within OP "@en ;
	era:rinfIndex "1.2.2.0.0.2" ;
	sh:path era:sidingId ;
	sh:minCount 1 ;
	sh:maxCount 1 ;
	sh:datatype xsd:string ;
	sh:severity sh:Violation ;
	sh:message "sidingId (1.2.2.0.0.2): Each siding must have a unique siding identification that is a character string. This error is due to not having a sidingId value, having more than one sidingId value or having a value that is not a string."@en.
	
# sidingId: #1.2.2.0.0.2
era-sh:OperationalPointShape sh:sparql  era-sh:NoRepeatedSidingIds.
era-sh:NoRepeatedSidingIds 
    a sh:SPARQLConstraint ;   
    era:affectedProperty era:sidingId ;
    era:affectedClass era:Siding;
    era:affectedClass era:OperationalPoint;
    era:scope "global";
    rdfs:comment "Each siding shall have unique identification or number within the OP. This number cannot be used for naming any other siding in the same OP. "@en ;
    era:rinfIndex "1.2.2.0.0.2" ;
    sh:message "sidingId (1.2.2.0.0.2):: Each siding shall have unique identification or number within the OP. This number cannot be used for naming any other siding in the same OP. There is a problem with the OP {$this} ({?opLabel}) and sidings {?siding1} ({?siding1Label}) and {?siding2} ({?siding2Label}), since they have the same identifier: {?value}."@en ;
    sh:prefixes era:;
    sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?opLabel ?siding1 ?siding1Label ?siding2 ?siding2Label ?value (era:sidingId AS ?path)
    WHERE {
				$this era:hasPart ?siding1 ;
							era:hasPart ?siding2 .
				?siding1 a era:Siding ;
								era:sidingId ?value .
				?siding2 a era:Siding ;
								era:sidingId ?value .
				FILTER(?siding1 != ?siding2) .

        OPTIONAL { $this rdfs:label ?opLabel0 } .
        BIND(COALESCE(?opLabel0, "unknown label") AS ?opLabel)
        OPTIONAL { ?siding1 rdfs:label ?siding1Label0 } .
        BIND(COALESCE(?siding1Label0, "unknown label") AS ?siding1Label)
        OPTIONAL { ?siding2 rdfs:label ?siding2Label0 } .
        BIND(COALESCE(?siding2Label0, "unknown label") AS ?siding2Label)
    }
    """ .


# tenClassification: # 1.1.1.1.2.1, 1.2.1.0.2.1, 1.2.1.0.6.3, 1.2.2.0.0.3
era-sh:SidingShape sh:property era-sh:TenClassificationS .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:TenClassificationS .
era-sh:TenClassificationS
	a sh:PropertyShape;
    era:affectedProperty era:tenClassification;
    era:affectedClass era:Siding;
    era:scope "local";   
    rdfs:comment "Indicates the part of the trans-European network the platform belongs to. "@en ;
	era:rinfIndex "1.1.1.1.2.1", "1.2.1.0.2.1", "1.2.1.0.6.3", "1.2.2.0.0.3" ;
	sh:path era:tenClassification ;
	sh:nodeKind sh:IRI;
	sh:severity sh:Violation ;
	sh:message "TEN classification (1.1.1.1.2.1, 1.2.1.0.2.1, 1.2.1.0.6.3, 1.2.2.0.0.3): This error may be due to having a Platform with a TEN classification that is not an URI."@en .

# tenClassification: # 1.1.1.1.2.1, 1.2.1.0.2.1, 1.2.1.0.6.3, 1.2.2.0.0.3
 era-sh:SidingShape sh:sparql era-sh:TenClassificationSKOSS .
 era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:TenClassificationSKOSS .
 era-sh:TenClassificationSKOSS
 	a sh:SPARQLConstraint ;
    era:affectedProperty era:tenClassification ;
    era:affectedClass era:Siding;
    era:scope "local";
 	rdfs:comment "Indication of the part of the trans-European network the line belongs to. "@en ;	era:rinfIndex "1.2.2.0.0.3" ;
	era:rinfIndex "1.1.1.1.2.1", "1.2.1.0.2.1", "1.2.1.0.6.3", "1.2.2.0.0.3" ;
 	sh:nodeKind sh:IRI ;
 	sh:message "TEN classification (1.1.1.1.2.1, 1.2.1.0.2.1, 1.2.1.0.6.3, 1.2.2.0.0.3): The siding {$this} with label {?sidingLabel} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/ten-classifications/TENClassifications."@en ;
     sh:prefixes era:;
 	sh:select """
     PREFIX era: <http://data.europa.eu/949/>
     PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
     PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?concept ?sidingLabel (era:tenClassification AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?sidingLabel0 } .
        BIND(COALESCE(?sidingLabel0, "unknown label") AS ?sidingLabel)
        $this era:tenClassification ?concept .
        era:tenClassification era:inSkosConceptScheme ?conceptScheme .
        FILTER NOT EXISTS { ?concept skos:inScheme ?conceptScheme }
    }
""" .



# lengthOfSiding: # 1.2.2.0.2.1
era-sh:SidingShape sh:property era-sh:LengthS .
era-sh:LengthS
	a sh:PropertyShape;
    era:affectedProperty era:lengthOfSiding ;
    era:affectedClass era:Siding;
    era:scope "local";
	rdfs:comment "Total length of the siding/stabling track expressed in meters where trains can be parked safely "@en ;
	era:rinfIndex "1.2.2.0.2.1" ;
	sh:path era:lengthOfSiding ;
	sh:maxCount 1 ;
	sh:datatype xsd:double ;
	sh:pattern "^([1-9]\\d{1,3}|[0-9])(\\.0+)?$" ;
	sh:severity sh:Violation ;
	sh:message "lengthOfSiding (1.2.2.0.2.1): Each siding may have a length in meters. This error is due to having more than one length value or having a length that is not a double (real) number or not following the pattern [NNNN]."@en .

# gradient: # 1.2.2.0.3.1
era-sh:SidingShape sh:property era-sh:Gradient .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:Gradient .
era-sh:Gradient
	a sh:PropertyShape;
    era:affectedProperty era:gradient ;
    era:affectedClass era:Siding;
    era:scope "local";
	rdfs:comment "Maximum value of the gradient expressed in millimeters per meter "@en ;
	era:rinfIndex "1.2.2.0.3.1" ;
	sh:path era:gradient ;
	sh:maxCount 1 ;
	sh:datatype xsd:double ;
	sh:pattern "^([1-9]\\d{1}|[0-9])(\\.[0-9])?$";
	sh:severity sh:Violation ;
	sh:message "gradient (1.2.2.0.3.1): Each siding may have a gradient in millimeters per meter. This error is due to having more than one gradient value or having a gradient that is not a double (real) number."@en .



# minimumVerticalRadius 1.2.2.0.3.3: 
era-sh:SidingShape sh:property era-sh:MinimumVerticalRadius.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:MinimumVerticalRadius.
era-sh:MinimumVerticalRadius
	a sh:PropertyShape ;
    era:affectedProperty era:minimumVerticalRadius ;
    era:affectedClass era:Siding ;
    era:scope "local" ;
	rdfs:comment "Indication of types of appearance of track lineside distance indications. "@en ;
	sh:path era:minimumVerticalRadius;
    sh:class era:MinimumVerticalRadius;
    # sh:node era-sh:MinimumVerticalRadiusShape; not implemented in the shacl engine
    sh:maxCount 1;
    era:rinfIndex "1.2.2.0.3.3";
	sh:nodeKind sh:IRI;
	sh:severity sh:Violation ;
	sh:message "minimumVerticalRadius (1.2.2.0.3.3) : The siding must have at most one value of minimum vertical radius that must be an instace of MinimumVerticalRadius. This error may be due to the track having more than one value or having a value that is not an instance of the class MinimumVerticalRadius."@en .

# minimumVerticalRadiusCrest: 
era-sh:MinimumVerticalRadiusShape sh:property era-sh:MinimumVerticalRadiusCrest .
era-sh:MinimumVerticalRadiusCrest
	a sh:PropertyShape;
    era:affectedProperty era:minimumVerticalRadiusCrest ;
    era:affectedClass era:MinimumVerticalRadius ;
    era:scope "local";
	rdfs:comment "Radius of the smallest vertical curve expressed in meters, part that indicates the crest "@en ;
	sh:path era:minimumVerticalRadiusCrest ;
    sh:minCount 1;
	sh:maxCount 1 ;
	sh:datatype xsd:integer ;
	sh:severity sh:Violation ;
	sh:message "minimumVerticalRadiusCrest : Each siding may have a minimumVerticalRadiusCrest in meters. This error is due to having no value, having more than one value or having a value that is not an integer number."@en .

# minimumVerticalRadiusHollow: 
era-sh:MinimumVerticalRadiusShape sh:property era-sh:MinimumVerticalRadiusHollow .
era-sh:MinimumVerticalRadiusHollow
	a sh:PropertyShape;
    era:affectedProperty era:minimumVerticalRadiusHollow ;
    era:affectedClass era:MinimumVerticalRadius ;
    era:scope "local";
	rdfs:comment "Radius of the smallest vertical curve expressed in meters, part that indicates the hollow "@en ;
	sh:path era:minimumVerticalRadiusHollow ;
    sh:minCount 1;
	sh:maxCount 1 ;
	sh:datatype xsd:integer ;
	sh:severity sh:Violation ;
	sh:message "minimumVerticalRadiusHollow: Each siding may have a minimumVerticalRadiusHollow in meters. This error is due to having no value, having more than one value or having a value that is not an integer number."@en .




# hasToiletDischarge: # 1.2.2.0.4.1
era-sh:SidingShape sh:property era-sh:HasToiletDischarge .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:HasToiletDischarge .
era-sh:HasToiletDischarge
	a sh:PropertyShape;
    era:affectedProperty era:hasToiletDischarge ;
    era:affectedClass era:Siding;
    era:scope "local";
	rdfs:comment "Indication whether exists and installation for toilet discharge (fixed installation for servicing trains) as defined in INF TSIs "@en ; 
	era:rinfIndex "1.2.2.0.4.1" ;
	sh:path era:hasToiletDischarge ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "hasToiletDischarge (1.2.2.0.4.1): Each siding may define the existence of a toilet discharge. This error is due to having more than one has toilet discharge value or having a has has toilet discharge value that is not Y/N (boolean)."@en .

# hasExternalCleaning: # 1.2.2.0.4.2
era-sh:SidingShape sh:property era-sh:HasExternalCleaning .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:HasExternalCleaning .
era-sh:HasExternalCleaning
	a sh:PropertyShape;
    era:affectedProperty era:hasExternalCleaning ;
    era:affectedClass era:Siding;
    era:scope "local";
	rdfs:comment "Indication whether exists and installation for external cleaning facility (fixed installation for servicing trains) as defined in INF TSIs "@en ; 
	era:rinfIndex "1.2.2.0.4.2" ;
	sh:path era:hasExternalCleaning ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "hasExternalCleaning (1.2.2.0.4.2): Each siding may define the existence of an external cleaning facility. This error is due to having more than one has external cleaning value or having a has external cleaning value that is not Y/N (boolean)."@en .

# hasWaterRestocking: # 1.2.2.0.4.3
era-sh:SidingShape sh:property era-sh:HasWaterRestocking .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:HasWaterRestocking .
era-sh:HasWaterRestocking
	a sh:PropertyShape;
    era:affectedProperty era:hasWaterRestocking ;
    era:affectedClass era:Siding;
    era:scope "local";
	rdfs:comment "Indication whether exists and installation for water restocking (fixed installation for servicing trains) as defined in INF TSIs "@en ; 
	era:rinfIndex "1.2.2.0.4.3" ;
	sh:path era:hasWaterRestocking ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "hasWaterRestocking (1.2.2.0.4.3): Each siding may define the existence of a water restocking facility. This error is due to having more than one has water restocking value or having a has  water restocking value that is not Y/N (boolean)."@en .

# hasRefuelling: # 1.2.2.0.4.4
era-sh:SidingShape sh:property era-sh:HasRefuelling .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:HasRefuelling .
era-sh:HasRefuelling
	a sh:PropertyShape;
    era:affectedProperty era:hasRefuelling ;
    era:affectedClass era:Siding;
    era:scope "local";
	rdfs:comment "Indication whether exists and installation for refuelling (fixed installation for servicing trains) as defined in INF TSIs "@en ; 
	era:rinfIndex "1.2.2.0.4.4" ;
	sh:path era:hasRefuelling ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "hasRefuelling (1.2.2.0.4.4): Each siding may define the existence of a refuelling facility. This error is due to having more than one has refuelling value or having a  has refuelling value that is not Y/N (boolean)."@en .

# hasSandRestocking: # 1.2.2.0.4.5
era-sh:SidingShape sh:property era-sh:HasSandRestocking .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:HasSandRestocking .
era-sh:HasSandRestocking
	a sh:PropertyShape;
     era:affectedProperty era:hasSandRestocking ;
    era:affectedClass era:Siding;
    era:scope "local";
	rdfs:comment "Indication whether an installation for sand restocking exists(fixed installation for servicing trains) "@en ; 
	era:rinfIndex "1.2.2.0.4.5" ;
	sh:path era:hasSandRestocking ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "hasSandRestocking (1.2.2.0.4.5): Each siding may define the existence of a sand restocking facility. This error is due to having more than one has sand restocking value or having a  has sand restocking value that is not Y/N (boolean)."@en .

# hasElectricShoreSupply: # 1.2.2.0.4.6
era-sh:SidingShape sh:property era-sh:HasElectricShoreSupply .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:HasElectricShoreSupply .
era-sh:HasElectricShoreSupply
	a sh:PropertyShape;
    era:affectedProperty era:hasElectricShoreSupply ;
    era:affectedClass era:Siding;
    era:scope "local";
	rdfs:comment "Indication whether an installation for electric shore supply exists (fixed installation for servicing trains) "@en ; 
	era:rinfIndex "1.2.2.0.4.6" ;
	sh:path era:hasElectricShoreSupply ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "hasElectricShoreSupply (1.2.2.0.4.6): Each siding may define the existence of an electric shore supply facility. This error is due to having more than one has electric shore supply value or having a  has electric shore supply value that is not Y/N (boolean)."@en .


# maxCurrentStandstillPantograph: # 1.1.1.2.2.3, 1.2.2.0.6.1
era-sh:SidingShape sh:property era-sh:MaxCurrentStandstillPantographS .
era-sh:MaxCurrentStandstillPantographS
	a sh:PropertyShape;
    era:affectedProperty era:maxCurrentStandstillPantograph ;
    era:affectedClass era:Siding;
    era:scope "local";
	rdfs:comment "Indication of the maximum allowable train current at standstill for DC systems expressed in amperes "@en ;
	era:rinfIndex "1.1.1.2.2.3" , "1.2.2.0.6.1" ;
	sh:path era:maxCurrentStandstillPantograph ;
	sh:datatype xsd:integer ;
	sh:pattern "^([1-9]\\d{1,2}|[0-9])$" ;
	sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "maxCurrentStandstillPantograph (1.1.1.2.2.3, 1.2.2.0.6.1): Each siding may define the maximum allowable train current at standstill for DC systems expressed in amperes. This error is due to having a max current standstill pantograph value that is not a double (real) number."@en .



era-sh:SignalShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:Signal.

# relativeDistanceDangerPoint: # 1.1.1.3.14.4, 1.2.1.0.8.4
era-sh:SignalShape  sh:property era-sh:RelativeDistanceDangerPoint .
era-sh:RelativeDistanceDangerPoint
	a sh:PropertyShape;
    era:affectedClass era:Signal;
    era:affectedProperty era:relativeDistanceDangerPoint ;
    era:scope "local";
	rdfs:comment "Distance in meters to the danger point."@en ;
	era:rinfIndex "1.1.1.3.14.4" ;
    era:rinfIndex "1.2.1.0.8.4" ;
	sh:path era:relativeDistanceDangerPoint ;
	sh:datatype xsd:integer ;
    sh:pattern "^([1-9]\\d{1,2}|[0-9])$";
	sh:severity sh:Violation ;
	sh:message "relativeDistanceDangerPoint (1.1.1.3.14.4, 1.2.1.0.8.4): The distance in meters to the danger point must be represented as an integer and follow the pattern [NNN].This error may be due to having a value that is not an integer or that does not follow the pattern."@en .


# signalId: # 1.1.1.3.14.1, 1.2.1.0.8.1
era-sh:SignalShape  sh:property era-sh:SignalId .
era-sh:SignalId
	a sh:PropertyShape;
    era:affectedClass era:Signal;
    era:affectedProperty era:signalId ;
    era:scope "local";
	rdfs:comment "Operational identifier of the signal (on the track or in OP), as in the operational and maintenance provisions."@en ;
	era:rinfIndex "1.1.1.3.14.1" ;
    era:rinfIndex "1.2.1.0.8.1" ;
	sh:path era:signalId ;
	sh:datatype xsd:string ;
    sh:maxCount 1;
	sh:severity sh:Violation ;
	sh:message "signalId (1.1.1.3.14.1, 1.2.1.0.8.1): A Signal may have at most one signal id and it must be represented as a String. This error may be due to having more than one value or having a value that is not a string"@en .

# signalType: # 1.1.1.3.14.2, 1.2.1.0.8.2
era-sh:SignalShape  sh:property era-sh:SignalType .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:SignalType .
era-sh:SignalType
	a sh:PropertyShape;
    era:affectedClass era:Signal;
    era:affectedProperty era:signalType ;
    era:scope "local";
	rdfs:comment "Signalling information for Route Book compilation."@en ;
	era:rinfIndex "1.1.1.3.14.2" ;
    era:rinfIndex "1.2.1.0.8.2" ;
	sh:path era:signalType ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "signalType (1.1.1.3.14.2, 1.2.1.0.8.2): The signal type must be represented as an IRI.This error may be due to having a value that is not an IRI."@en .


# signalType: # 1.1.1.3.14.2, 1.2.1.0.8.2
era-sh:SignalShape  sh:sparql era-sh:SignalTypeSKOS.
era-sh:SignalTypeSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:signalType;
    era:affectedClass  era:Signal;
    era:scope "local";
    rdfs:comment "Signalling information for Route Book compilation."@en ;
	era:rinfIndex "1.1.1.3.14.2" ;
    era:rinfIndex "1.2.1.0.8.2" ;
    sh:message "Indication of the signalType (1.1.1.3.14.2, 1.2.1.0.8.2): The signal {$this}  has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/signal-types/."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept (era:signalType AS ?path)
    WHERE {
        $this era:signalType ?concept .
        era:signalType era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# signalOrientation: # 1.1.1.3.14.3, 1.2.1.0.8.3 
era-sh:SignalShape  sh:property era-sh:SignalOrientation .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:SignalOrientation .
era-sh:SignalOrientation
	a sh:PropertyShape;
    era:affectedClass era:Signal;
    era:affectedProperty era:signalOrientation ;
    era:scope "local";
	rdfs:comment "Indication if the signal (on the track or in OP) is applicable for operation on normal, opposite track direction or if it contains bidirectionally valid information (radio-based system only)."@en ;
	era:rinfIndex "1.1.1.3.14.3" ;
    era:rinfIndex "1.2.1.0.8.3" ;
	sh:path era:signalOrientation ;
	sh:nodeKind sh:IRI ;
	sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "signalOrientation (1.1.1.3.14.3, 1.2.1.0.8.3): A Signal may have an orientation and it must be represented as an IRI. This error may be due to having a value that is not an IRI."@en .

# hasOrientation
era-sh:SignalShape sh:property era-sh:HasOrientation .
era-sh:HasOrientation
	a sh:PropertyShape ;
    era:affectedProperty era:hasOrientation ;
    era:affectedClass era:Signal ;
    era:scope "local" ;
	rdfs:comment "The orientation of a signal."@en ;
	sh:path era:hasOrientation ;
	sh:class era:Orientation ;
	sh:severity sh:Violation ;
	sh:message "hasOrientation: A Signal may have an orientation and it must be an instance of Orientation. This error may be due to having a value that is not an instance of Orientation."@en .

# signalOrientation: # 1.1.1.3.14.3, 1.2.1.0.8.3
era-sh:SignalShape  sh:sparql era-sh:SignalOrientationSKOS.
era-sh:SignalOrientationSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:signalOrientation;
    era:affectedClass  era:Signal;
    era:scope "local";
    rdfs:comment "Indication if the signal (on the track or in OP) is applicable for operation on normal, opposite track direction or if it contains bidirectionally valid information (radio-based system only)."@en ;
	era:rinfIndex "1.1.1.3.14.3" ;
    era:rinfIndex "1.2.1.0.8.3 " ;
    sh:message "Indication of the signalOrientation (1.1.1.3.14.3, 1.2.1.0.8.3 ):): The signal {$this}  has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/orientations/OrientationDirections."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept (era:signalOrientation AS ?path)
    WHERE {
        $this era:signalOrientation ?concept .
        era:signalOrientation era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

########################
## Track shape ##
########################

era-sh:TrackShape
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:Track .

# connectedTo: # 1.1.1.0.1.2, 1.2.4.1
era-sh:TrackShape sh:property era-sh:ConnectedTo .
era-sh:ConnectedTo
	a sh:PropertyShape ;
    era:affectedProperty era:connectedTo ;
    era:affectedClass era:Track ;
    era:scope "local" ;
	rdfs:comment "Represents a bidirectional connection between two Track instances."@en ;
	era:rinfIndex "1.1.1.0.1.2" ;
    era:rinfIndex "1.2.4.1" ;
	sh:path era:connectedTo ;
	sh:class era:Track ;
	sh:severity sh:Violation ;
	sh:message "connectedTo (1.1.1.0.1.2, 1.2.4.1): The track may be connected to other tracks and each value must be an instance of Track. This error may be due to having a value that is not an instance of Track."@en .

########################
## RunningTrack shape ##
########################

era-sh:RunningTrackShape  
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:RunningTrack .

era-sh:RunningTrackShapeSPARQLWarning
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:RunningTrack ;
    sh:severity sh:Warning .


era-sh:CommonCharacteristicsSubsetShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:CommonCharacteristicsSubset .  # Applies to all Common Characteritics Subset  with track parameters in SOLs and OPs

# verificationINF: # 1.1.1.1.1.1, 1.2.1.0.1.1, 1.2.2.0.1.1
era-sh:RunningTrackShape sh:property era-sh:VerificationINF.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:VerificationINF.
era-sh:SidingShape sh:property era-sh:VerificationINF.
era-sh:VerificationINF
	a sh:PropertyShape ;
    era:affectedProperty era:verificationINF;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Unique number for EC declarations following format requirements specified in the 'Document about practical arrangements for transmitting interoperability documents'. "@en ;
	era:rinfIndex "1.1.1.1.1.1 " ;
    era:rinfIndex "1.2.1.0.1.1" ;
    era:rinfIndex "1.2.2.0.1.1" ;
	sh:path era:verificationINF ;
	#sh:minCount 0 ; #TODO: Not yet applicable
	sh:datatype xsd:string ;
	sh:pattern "^[A-Z]{2}\\/.{14}\\/(19[0-9][0-9]|20[0-9][0-9]|2100)\\/[0-9]{6}$";
	sh:severity sh:Violation ;
	sh:message "verificationINF (1.1.1.1.1.1, 1.2.1.0.1.1, 1.2.2.0.1.1): The verificationINF must be a string following the format 'XX/XXXXXXXXXXXXXX/YYYY/DDDDDD' where XX is the country code, XXXXXXXXXXXXXX is the unique number for EC declarations, YYYY is the year of the declaration (1900-2100) and DDDDDD is the sequential number of the declaration. This error is due to the value not following the pattern."@en .

# demonstrationINF: # 1.1.1.1.1.2, 1.2.1.0.1.2, 1.2.2.0.1.2
era-sh:RunningTrackShape sh:property era-sh:DemonstrationINF.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:DemonstrationINF.
era-sh:SidingShape sh:property era-sh:DemonstrationINF.
era-sh:DemonstrationINF
	a sh:PropertyShape ;
    era:affectedProperty era:demonstrationINF;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Unique number for EI declarations following format requirements specified in the 'Document about practical arrangements for transmitting interoperability documents'. "@en ;
	era:rinfIndex "1.1.1.1.1.2" ;
    era:rinfIndex "1.2.1.0.1.2" ;
    era:rinfIndex "1.2.2.0.1.2" ;
	sh:path era:demonstrationINF ;
	sh:datatype xsd:string ;
	sh:pattern "^[A-Z]{2}\\/.{14}\\/(19[0-9][0-9]|20[0-9][0-9]|2100)\\/[0-9]{6}$";
	sh:severity sh:Violation ;
	sh:message "demonstrationINF (1.1.1.1.1.2, 1.2.1.0.1.2, 1.2.2.0.1.2): The demonstrationINF must be a string following the format 'XX/XXXXXXXXXXXXXX/YYYY/DDDDDD' where XX is the country code, XXXXXXXXXXXXXX is the unique number for EI declarations, YYYY is the year of the declaration (1900-2100) and DDDDDD is the sequential number of the declaration. This error is due to the value not following the pattern."@en .

# tenClassification: # 1.1.1.1.2.1, 1.2.1.0.2.1
era-sh:RunningTrackShape sh:property era-sh:TenClassificationT.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:TenClassificationT.
era-sh:TenClassificationT
	a sh:PropertyShape ;
    era:affectedProperty era:tenClassification;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication of the part of the trans-European network the line belongs to. "@en ;	
    sh:path era:tenClassification ;
	#sh:minCount 1 ; #TODO: Not yet applicable    
    era:rinfIndex "1.1.1.1.2.1" ;
    era:rinfIndex "1.2.1.0.2.1" ;
	sh:nodeKind sh:IRI ; 	
	sh:severity sh:Violation ;	sh:message "tenClassification (1.1.1.1.2.1, 1.2.1.0.2.1): The track has a TEN classificaion value (Indication of the part of the trans-European network the line belongs to) that must be an IRI."@en .

#tenClassification: # 1.1.1.1.2.1, 1.2.1.0.2.1
era-sh:RunningTrackShape sh:sparql era-sh:TenClassificationSKOST.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:TenClassificationSKOST.
era-sh:TenClassificationSKOST
	a sh:SPARQLConstraint ;
    era:affectedProperty era:tenClassification;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication of the TEN classification of track. "@en ;
	era:rinfIndex "1.1.1.1.2.1" ;
    era:rinfIndex "1.2.1.0.2.1" ;
	sh:nodeKind sh:IRI ;
	sh:message "TEN classification (1.1.1.1.2.1, 1.2.1.0.2.1): The track {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/ten-classifications/TENClassifications."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?concept ?label (era:tenClassification AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:tenClassification ?concept .
        era:tenClassification era:inSkosConceptScheme ?conceptScheme .
        FILTER NOT EXISTS { ?concept skos:inScheme ?conceptScheme }
    }
""" .

# gaugingProfile: # 1.1.1.1.3.1.1, 1.2.1.0.3.4
era-sh:RunningTrackShape sh:property era-sh:GaugingProfile.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:GaugingProfile.
 era-sh:GaugingProfile
	a sh:PropertyShape ;
    era:affectedProperty era:gaugingProfile;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Gauges as defined in European standard or other local gauges, including lower or upper part. "@en ;
    era:rinfIndex "1.1.1.1.3.1.1" ;
    era:rinfIndex "1.2.1.0.3.4" ;
	sh:path era:gaugingProfile ;
	sh:nodeKind sh:IRI ;
	#sh:minCount 1 ; #TODO: Not yet applicable        
	sh:severity sh:Violation ;
	sh:message "gaugingProfile (1.1.1.1.3.1.1, 1.2.1.0.3.4): The track must define a value that is an IRI. The error is due to having a value that is not an IRI."@en .

# gaugingProfile: # 1.1.1.1.3.1.1, 1.2.1.0.3.4
era-sh:RunningTrackShape sh:sparql era-sh:GaugingProfileSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:GaugingProfileSKOS.
era-sh:GaugingProfileSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:gaugingProfile;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication of the gauging profile of track. "@en ;
	era:rinfIndex "1.1.1.1.3.1.1" ;
    era:rinfIndex "1.2.1.0.3.4" ;
	sh:message "Gauging profile (1.1.1.1.3.1.1, 1.2.1.0.3.4): The track {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/gaugings/GaugingProfiles."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:gaugingProfile AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:gaugingProfile ?concept .
        era:gaugingProfile era:inSkosConceptScheme ?conceptScheme .
        FILTER (NOT EXISTS {?concept skos:inScheme ?conceptScheme} || REGEX(STR(?concept), "/eratv/"))
	}
""" .

# gaugingCheckLocation: # 1.1.1.1.3.1.2, 1.2.1.0.3.5
era-sh:RunningTrackShape sh:property era-sh:GaugingCheckLocation.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:GaugingCheckLocation.
era-sh:GaugingCheckLocation
	a sh:PropertyShape ;
    era:affectedProperty era:gaugingCheckLocation;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Location of particular points requiring specific checks due to deviations from gauging referred to in 1.1.1.1.3.1.1. "@en ;
	era:rinfIndex "1.1.1.1.3.1.2" ;
    era:rinfIndex "1.2.1.0.3.5" ;
	sh:path era:gaugingCheckLocation ;
	sh:datatype xsd:string ;
	sh:pattern "^([1-9]\\d{1,3}|[0-9])(\\.\\d{1,3})?(\\s.*)?$" ;
    #sh:minCount 1 ; 
	sh:severity sh:Violation ;
	sh:message "gaugingCheckLocation (1.1.1.1.3.1.2, 1.2.1.0.3.5): The track has a location of the gauging check that must be a string and follow the format [±NNNN.NNN]. The error is due to the value not following the pattern."@en .

# gaugingTransversalDocument: # 1.1.1.1.3.1.3, 1.2.1.0.3.6
era-sh:RunningTrackShape sh:property era-sh:GaugingTransversalDocument.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:GaugingTransversalDocument.
era-sh:GaugingTransversalDocument
	a sh:PropertyShape ;
    era:affectedProperty era:gaugingTransversalDocument;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Document with the transversal section of the particular points requiring specific checks." ;
	era:rinfIndex "1.1.1.1.3.1.3", "1.2.1.0.3.6" ;
	sh:path era:gaugingTransversalDocument ;
	sh:class era:Document ;
	sh:severity sh:Violation ;
	sh:message "gaugingTransversalDocument (1.1.1.1.3.1.3, 1.2.1.0.3.6): The track has a transversal document of the gauging check value that must be a Document."@en .

# wheelSetGauge: # 1.1.1.1.4.1, 1.2.1.0.4.1
era-sh:RunningTrackShape sh:property era-sh:WheelSetGauge.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:WheelSetGauge.
era-sh:WheelSetGauge
	a sh:PropertyShape ;
    era:affectedProperty era:wheelSetGauge;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "A single value expressed in millimeters that identifies the track gauge. "@en ;
	era:rinfIndex "1.1.1.1.4.1", "1.2.1.0.4.1" ;
	sh:path era:wheelSetGauge ;
    # sh:minCount 1; #TODO: Not yet applicable
    sh:maxCount 1 ;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "wheelSetGauge (1.1.1.1.4.1, 1.2.1.0.4.1): The track must have at most one wheel set gauge value that is an IRI."@en .	

# wheelSetGauge: # 1.1.1.1.4.1, 1.2.1.0.4.1
era-sh:RunningTrackShape sh:sparql era-sh:WheelSetGaugeSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:WheelSetGaugeSKOS.
era-sh:WheelSetGaugeSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:wheelSetGauge;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "A single value expressed in millimeters that identifies The track gauge. "@en ;
	era:rinfIndex "1.1.1.1.4.1", "1.2.1.0.4.1" ;
	sh:message "Nominal track gauge (1.1.1.1.4.1, 1.2.1.0.4.1): The track {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/nominal-track-gauges/NominalTrackGauges."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:wheelSetGauge AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:wheelSetGauge ?concept .
        era:wheelSetGauge era:inSkosConceptScheme ?conceptScheme .
        FILTER (NOT EXISTS {?concept skos:inScheme ?conceptScheme} || REGEX(STR(?concept), "/eratv/"))
	}
""" .


# gsmRAdditionalInfo: 1.1.1.3.3.3.1, 1.2.1.1.2.3.1
era-sh:RunningTrackShape sh:property era-sh:GsmRAdditionalInfo.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:GsmRAdditionalInfo.
era-sh:GsmRAdditionalInfo
	a sh:PropertyShape ;
    era:affectedProperty era:gsmRAdditionalInfo;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Any additional information on network characteristics or corresponding document available from the IM and stored by the Agency, e.g.; interference level, leading to the recommendation of additional on-board protection. "@en ;
	era:rinfIndex "1.1.1.3.3.3.1" , "1.2.1.1.2.3.1" ;
	sh:path era:gsmRAdditionalInfo ;
	sh:class era:Document ;
	sh:severity sh:Violation ;
	sh:message "gsmRAdditionalInfo (1.1.1.3.3.3.1 , 1.2.1.1.2.3.1): The track has additional information on network characteristics that must be a Document."@en .

# gsmRAdditionalInfo: 1.1.1.3.3.3.1, 1.2.1.1.2.3.1
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:GsmRAdditionalInfoApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:GsmRAdditionalInfoApplicability .
era-sh:GsmRAdditionalInfoApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:gsmRAdditionalInfo;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "GSM-R (parameter 1.1.1.3.3.1) must be installed for this parameter to be applicable. "@en ;
	era:rinfIndex "1.1.1.3.3.3.1" , "1.2.1.1.2.3.1" ;
	sh:message "gsmRAdditionalInfo (1.1.1.3.3.3.1, 1.2.1.1.2.3.1):The track {$this} ({?label}), has a 'GSM-R version' defined which makes the gsmRAdditionalInfo parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:gsmRAdditionalInfo AS ?path)
			WHERE {
                 $this era:gsmRVersion ?gsmRVersion.
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
                FILTER NOT EXISTS {$this era:gsmRAdditionalInfo ?value} . 
				FILTER NOT EXISTS {$this era:notYetAvailable era:gsmRAdditionalInfo} .
            }
			""" .

# gprsImplementationArea: 1.1.1.3.3.3.3, 1.2.1.1.2.3.3
era-sh:RunningTrackShape sh:property era-sh:GprsImplementationArea.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:GprsImplementationArea.
era-sh:GprsImplementationArea
	a sh:PropertyShape ;
    era:affectedProperty era:gprsImplementationArea;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication of the area in which GPRS can be used for ETCS, expressed as a list of GPRS-enabled RBC's. "@en ;
	era:rinfIndex "1.1.1.3.3.3.3" , "1.2.1.1.2.3.3" ;
	sh:path era:gprsImplementationArea ;
	sh:datatype xsd:string ;
	sh:severity sh:Violation ;
	sh:message "gprsImplementationArea (1.1.1.3.3.3.3, 1.2.1.1.2.3.3): The gprsImplementationArea must be a string. This error is due to the value not being a string."@en .

# gprsImplementationArea: 1.1.1.3.3.3.3, 1.2.1.1.2.3.3
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:GprsImplementationAreaApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:GprsImplementationAreaApplicability .
era-sh:GprsImplementationAreaApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:gprsImplementationArea;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "GSM-R (parameter 1.1.1.3.3.1), ETCS L2 (parameter 1.1.1.3.2.1) and GPRS for ETCS (parameter 1.1.1.3.3.3.2) must be installed for this parameter to be applicable. "@en ;
	era:rinfIndex "1.1.1.3.3.3.3" , "1.2.1.1.2.3.3" ;
	sh:message "gprsImplementationArea (1.1.1.3.3.3.3, 1.2.1.1.2.3.3):The track {$this} ({?label}), has a 'GSM-R version' defined and a 'ETCS level' type selected which makes the gprsImplementationArea parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:gprsImplementationArea AS ?path)
			WHERE {
                 $this era:gsmRVersion ?gsmRVersion;
				 	   era:gprsForETCS true;
				 	   era:etcs ?etcs.
				 ?etcs era:etcsLevelType ?etcsType.
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
                FILTER NOT EXISTS {$this era:gprsImplementationArea ?value} . 
            }
			""" .

# atoCommunicationSystem: 1.1.1.3.13.3, 1.2.1.1.10.3
era-sh:RunningTrackShape sh:property era-sh:AtoCommunicationSystem.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:AtoCommunicationSystem.
era-sh:AtoCommunicationSystem
	a sh:PropertyShape ;
    era:affectedProperty era:atoCommunicationSystem;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Supported ATO communication systems from trackside. "@en ;
	era:rinfIndex "1.1.1.3.13.3", "1.2.1.1.10.3" ;
	sh:path era:atoCommunicationSystem ;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "atoCommunicationSystem (1.1.1.3.13.3, 1.2.1.1.10.3): The track must have a ATO communication system value that is an IRI."@en .	

# atoCommunicationSystem: 1.1.1.3.13.3, 1.2.1.1.10.3
era-sh:RunningTrackShape sh:sparql era-sh:AtoCommunicationSystemSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:AtoCommunicationSystemSKOS.
era-sh:AtoCommunicationSystemSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:atoCommunicationSystem;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Supported ATO communication systems from trackside. "@en ;
	era:rinfIndex "1.1.1.3.13.3", "1.2.1.1.10.3" ;
	sh:message "atoCommunicationSystem (1.1.1.3.13.3, 1.2.1.1.10.3): The track {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/ato-commsys/ATOCommSystem."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:atoCommunicationSystem AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:atoCommunicationSystem ?concept .
        era:atoCommunicationSystem era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# atoGradeAutomation: 1.1.1.3.13.1, 1.2.1.1.10.1
era-sh:RunningTrackShape sh:property era-sh:AtoGradeAutomation.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:AtoGradeAutomation.
era-sh:AtoGradeAutomation
	a sh:PropertyShape ;
    era:affectedProperty era:atoGradeAutomation;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "ATO grade of automation installed lineside. "@en ;
	era:rinfIndex "1.1.1.3.13.1", "1.2.1.1.10.1" ;
	sh:path era:atoGradeAutomation ;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "atoGradeAutomation (1.1.1.3.13.1, 1.2.1.1.10.1): The track must have a ATO grade of automation installed lineside value that is an IRI."@en .

# atoGradeAutomation: 1.1.1.3.13.1, 1.2.1.1.10.1
era-sh:RunningTrackShape sh:sparql era-sh:AtoGradeAutomationSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:AtoGradeAutomationSKOS.
era-sh:AtoGradeAutomationSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:atoGradeAutomation;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "ATO grade of automation installed lineside. "@en ;
	era:rinfIndex "1.1.1.3.13.1", "1.2.1.1.10.1" ;
	sh:message "atoGradeAutomation (1.1.1.3.13.1, 1.2.1.1.10.1): The track {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/ato-grades-automation/ATOGradeOfAutomation."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:atoGradeAutomation AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:atoGradeAutomation ?concept .
        era:atoGradeAutomation era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# atoSystemVersion: 1.1.1.3.13.2, 1.2.1.1.10.2
era-sh:RunningTrackShape sh:property era-sh:AtoSystemVersion.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:AtoSystemVersion.
era-sh:AtoSystemVersion
	a sh:PropertyShape ;
    era:affectedProperty era:atoSystemVersion;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "ATO system version according to the specification referenced in TSI CCS (4.2.19). "@en ;
	era:rinfIndex "1.1.1.3.13.2", "1.2.1.1.10.2" ;
	sh:path era:atoSystemVersion ;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "atoSystemVersion (1.1.1.3.13.1, 1.2.1.1.10.1): The track must have a ATO system version value that is an IRI."@en .

# atoSystemVersion: 1.1.1.3.13.2, 1.2.1.1.10.2
era-sh:RunningTrackShape sh:sparql era-sh:AtoSystemVersionSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:AtoSystemVersionSKOS.
era-sh:AtoSystemVersionSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:atoSystemVersion;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "ATO system version according to the specification referenced in TSI CCS (4.2.19). "@en ;
	era:rinfIndex "1.1.1.3.13.2", "1.2.1.1.10.2" ;
	sh:message "atoSystemVersion (1.1.1.3.13.1, 1.2.1.1.10.1): The track {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/ato-s-versions/ATOSystemVersions."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:atoSystemVersion AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:atoSystemVersion ?concept .
        era:atoSystemVersion era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# bigMetalMass: 1.1.1.3.2.18, 1.2.1.1.1.18
era-sh:RunningTrackShape sh:property era-sh:BigMetalMass.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:BigMetalMass.
era-sh:BigMetalMass
	a sh:PropertyShape;
    era:affectedProperty era:bigMetalMass ;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication of existence of metal mass in the vicinity of the location, susceptible of perturbating the reading of balises by the on-board system. "@en ; 
	era:rinfIndex "1.1.1.3.2.18", "1.2.1.1.1.18" ;
	sh:path era:bigMetalMass ;
	sh:maxCount 1 ; # Functional property
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "bigMetalMass (1.1.1.3.2.18, 1.2.1.1.1.18): Each track may define the existence of a metal mass in the vicinity of the location. This error is due to having more than one indication of existence of big metal mass value or having an indication of big metal mass value that is not Y/N (boolean)."@en .

# bigMetalMass: 1.1.1.3.2.18, 1.2.1.1.1.18
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:BigMetalMassApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:BigMetalMassApplicability .
era-sh:BigMetalMassApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:bigMetalMass;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.18", "1.2.1.1.1.18" ;
	sh:message "bigMetalMass (1.1.1.3.2.18, 1.2.1.1.1.18):The track {$this} ({?label}), has an  'ETCS Level Type' defined which makes the bigMetalMass parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:bigMetalMass AS ?path)
			WHERE {
                 $this era:etcs ?etcs.
				 ?etcs era:etcsLevelType ?etcsType.
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
                FILTER NOT EXISTS {$this era:bigMetalMass ?value} .
				FILTER NOT EXISTS {$this era:notYetAvailable era:bigMetalMass} . 
            }
			""" .

# cantDeficiencyBasicSSP 1.1.1.3.2.14, 1.2.1.1.1.14
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:CantDeficiencyBasicSSP.
era-sh:RunningTrackShape sh:property era-sh:CantDeficiencyBasicSSP.
era-sh:CantDeficiencyBasicSSP
	a sh:PropertyShape ;
    era:affectedProperty era:cantDeficiencyBasicSSP;
    era:affectedClass era:RunningTrack ;
    era:scope "local";
	rdfs:comment "Essential information for drivers of trains with a worse (lower) tolerated cant deficiency than those for which the ETCS trackside provides SSP (Static Speed Profiles) in conjunction with  parameter \"Other Cant Deficiency train categories for which the ETCS trackside is configured to provide SSP\". "@en ;
	era:rinfIndex "1.1.1.3.2.14", "1.2.1.1.1.14" ;
	sh:path era:cantDeficiencyBasicSSP ;
    sh:maxCount 1; # Functional property
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "cantDeficiencyBasicSSP (1.1.1.3.2.14, 1.2.1.1.1.14): The ETCS or subset must have a cant deficiency used for the basis SSP value that is an IRI."@en .

# cantDeficiencyBasicSSP 1.1.1.3.2.14, 1.2.1.1.1.14
era-sh:ETCSShape sh:sparql era-sh:CantDeficiencyBasicSSPSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:CantDeficiencyBasicSSPSKOS.
era-sh:CantDeficiencyBasicSSPSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:cantDeficiencyBasicSSP;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Essential information for drivers of trains with a worse (lower) tolerated cant deficiency than those for which the ETCS trackside provides SSP (Static Speed Profiles) in conjunction with  parameter \"Other Cant Deficiency train categories for which the ETCS trackside is configured to provide SSP\". "@en ;
	era:rinfIndex "1.1.1.3.2.14", "1.2.1.1.1.14" ;
	sh:message "cantDeficiencyBasicSSP (1.1.1.3.2.14, 1.2.1.1.1.14): The ETCS {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/cant-deficiencies/CantDeficiencies."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:cantDeficiencyBasicSSP AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:cantDeficiencyBasicSSP ?concept .
        era:cantDeficiencyBasicSSP era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# cantDeficiencyBasicSSP 1.1.1.3.2.14, 1.2.1.1.1.14
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:CantDeficiencyBasicSSPApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:CantDeficiencyBasicSSPApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:CantDeficiencyBasicSSPApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:CantDeficiencyBasicSSPApplicability .
era-sh:CantDeficiencyBasicSSPApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:cantDeficiencyBasicSSP;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.14", "1.2.1.1.1.14" ;
	sh:message "cantDeficiencyBasicSSP (1.1.1.3.2.14, 1.2.1.1.1.14):The ETCS or subset {$this} ({?thisLabel}), has a 'ETCS Level Type' defined which makes the cantDeficiencyBasicSSP parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:cantDeficiencyBasicSSP AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:cantDeficiencyBasicSSP ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:cantDeficiencyBasicSSP } .
    }
    """ .

# lineCategory: 1.1.1.1.2.2, 1.2.1.0.2.2
era-sh:RunningTrackShape sh:property era-sh:LineCategory.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:LineCategory.
era-sh:LineCategory
	a sh:PropertyShape ;
    era:affectedProperty era:lineCategory;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Classification of a line according to the TSI INF. "@en ;
	era:rinfIndex "1.1.1.1.2.2", "1.2.1.0.2.2" ;
	sh:path era:lineCategory ;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "lineCategory (1.1.1.1.2.2, 1.2.1.0.2.2): The track must have a classification of a line value that is an IRI."@en .

# lineCategory: 1.1.1.1.2.2, 1.2.1.0.2.2
era-sh:RunningTrackShape sh:sparql era-sh:LineCategorySKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:LineCategorySKOS.
era-sh:LineCategorySKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:lineCategory;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Classification of a line according to the TSI INF. "@en ;
	era:rinfIndex "1.1.1.1.2.2", "1.2.1.0.2.2" ;
	sh:message "lineCategory (1.1.1.1.2.2, 1.2.1.0.2.2): The track {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/line-category/LineCategories."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:lineCategory AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:lineCategory ?concept .
        era:lineCategory era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# dNvovtrp: 1.1.1.3.2.16.5, 1.2.1.1.1.16.5
era-sh:ETCSShape sh:property era-sh:DNvovtrp.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:DNvovtrp.
era-sh:DNvovtrp
	a sh:PropertyShape;
    era:affectedProperty era:dNvovtrp ;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Maximum distance for overriding the train trip in metres. "@en ;
	era:rinfIndex "1.1.1.3.2.16.5", "1.2.1.1.1.16.5" ;
	sh:path era:dNvovtrp ;
    sh:maxCount 1; # Functional property
    sh:minInclusive 0.0;
    sh:maxExclusive 327670.0;
	sh:datatype xsd:decimal ;
	#sh:pattern "^([1-9]\\d{1,5}|[0-9])(\\.\\d{1})?(\\s.*)?$" ;
	sh:pattern "^(([1-9]{0,1}[0-9]{0,3}\\.{1}[0-9]{1})|([1-9]\\d{1,4}0)|([1-9]\\d{0,4}))$" ;
	sh:severity sh:Violation ;
	sh:message "dNvovtrp (1.1.1.3.2.16.5, 1.2.1.1.1.16.5): Each ETCS or subset must define the maximum distance for overriding the train trip expressed in metres. This error is due to having maximum distance for overriding the train trip value that is not a double (real) number."@en .

# dNvovtrp: 1.1.1.3.2.16.5, 1.2.1.1.1.16.5
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:DNvovtrpApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:DNvovtrpApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:DNvovtrpApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:DNvovtrpApplicability .
era-sh:DNvovtrpApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:dNvovtrp;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present)"@en;
	era:rinfIndex "1.1.1.3.2.16.5", "1.2.1.1.1.16.5" ;
	sh:message "dNvovtrp (1.1.1.3.2.16.5, 1.2.1.1.1.16.5):The ETCS or subset {$this} ({?thisLabel}), has an  'ETCS Level Type' defined which makes the dNvovtrp parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:dNvovtrp AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:dNvovtrp ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:dNvovtrp } .
    }
    """ .

# dNvpotrp: 1.1.1.3.2.16.7, 1.2.1.1.1.16.7
era-sh:ETCSShape sh:property era-sh:DNvpotrp.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:DNvpotrp.
era-sh:DNvpotrp
	a sh:PropertyShape;
    era:affectedProperty era:dNvpotrp ;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Maximum distance for reversing in Post Trip mode in metres"@en;
	era:rinfIndex "1.1.1.3.2.16.7", "1.2.1.1.1.16.7" ;
	sh:path era:dNvpotrp ;
    sh:maxCount 1; # Functional property
    sh:minInclusive 0.0;
    sh:maxExclusive 327670.0;
	sh:datatype xsd:decimal ;
	#sh:pattern "^([1-9]\\d{1,5}|[0-9])(\\.\\d{1})?(\\s.*)?$" ;
	sh:pattern "^(([1-9]{0,1}[0-9]{0,3}\\.{1}[0-9]{1})|([1-9]\\d{1,4}0)|([1-9]\\d{0,4}))$" ;
	sh:severity sh:Violation ;
	sh:message "dNvpotrp (1.1.1.3.2.16.7, 1.2.1.1.1.16.7): Each ETCS must define the maximum distance for reversing in Post Trip mode in metres. This error is due to having maximum distance for reversing in Post Trip mode value that is not a double (real) number."@en .

# dNvpotrp: 1.1.1.3.2.16.7, 1.2.1.1.1.16.7
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:DNvpotrpApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:DNvpotrpApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:DNvpotrpApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:DNvpotrpApplicability .
era-sh:DNvpotrpApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:dNvpotrp;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.16.7", "1.2.1.1.1.16.7" ;
	sh:message "dNvpotrp (1.1.1.3.2.16.7, 1.2.1.1.1.16.7):The ETCS or subset {$this} ({?thisLabel}), has an  'ETCS Level Type' defined which makes the dNvpotrp parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:dNvpotrp AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:dNvpotrp ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:dNvpotrp } .
    }
    """ .

# dNvroll: 1.1.1.3.2.16.1, 1.2.1.1.1.16.1
era-sh:ETCSShape sh:property era-sh:DNvroll.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:DNvroll.
era-sh:DNvroll
	a sh:PropertyShape;
    era:affectedProperty era:dNvroll ;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Parameter used by the ETCS on-board to supervise the distance allowed to be travelled under the roll-away protection and the reverse movement protection, in metres. "@en ;
	era:rinfIndex "1.1.1.3.2.16.1", "1.2.1.1.1.16.1" ;
	sh:path era:dNvroll ;
    sh:maxCount 1; # Functional property
	sh:datatype xsd:double ;
	#sh:pattern "^([1-9]\\d{1,5}|[0-9])(\\.\\d{1})?(\\s.*)?$" ;
	sh:pattern "^(([1-9]{0,1}[0-9]{0,3}\\.{1}[0-9]{1})|([1-9]\\d{1,4}0)|([1-9]\\d{0,4}))$" ;
	sh:severity sh:Violation ;
	sh:message "dNvroll (1.1.1.3.2.16.1, 1.2.1.1.1.16.1): Each ETCS or subset must define the parameter used by the ETCS on-board to supervise the distance allowed to be travelled under the roll-away protection and the reverse movement protection expressed in metres. This error is due to having more than one value or having a value that is not a double (real) number."@en .

# dNvroll: 1.1.1.3.2.16.1, 1.2.1.1.1.16.1
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:DNvrollApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:DNvrollApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:DNvrollApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:DNvrollApplicability .
era-sh:DNvrollApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:dNvroll;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.16.1", "1.2.1.1.1.16.1" ;
	sh:message "dNvroll (1.1.1.3.2.16.7, 1.2.1.1.1.16.7):The ETCS or subset {$this} ({?thisLabel}), has an  'ETCS Level Type' defined which makes the dNvroll parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:dNvroll AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:dNvroll ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:dNvroll } .
    }
    """ .

# publicNetworkRoamingDetails: 1.1.1.3.3.7, 1.2.1.1.2.7
era-sh:RunningTrackShape sh:property era-sh:PublicNetworkRoamingDetails.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:PublicNetworkRoamingDetails.
era-sh:PublicNetworkRoamingDetails
	a sh:PropertyShape ;
    era:affectedProperty era:publicNetworkRoamingDetails ;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment """If roaming to public networks is configured, please:
1. indicate to which networks, for which users and in which areas.
2. list if any GSM-R functionality is not available when roaming to a public network (e.g. REC, Functional Addressing, Group Calls). 
3. also add if there is any operational restriction for vehicles that cannot roam into any of the available public networks."""@en ;
	era:rinfIndex "1.1.1.3.3.7", "1.2.1.1.2.7" ;
	sh:path era:publicNetworkRoamingDetails ;
	sh:maxCount 1 ;
	sh:datatype xsd:string ;
	sh:severity sh:Violation ;
	sh:message "publicNetworkRoamingDetails (1.1.1.3.3.7, 1.2.1.1.2.7): Each track may have details on GSM-R roaming to public networks that is a character string. This error is due to having more than one publicNetworkRoamingDetails value or having a value that is not a string."@en.

# publicNetworkRoamingDetails: 1.1.1.3.3.7, 1.2.1.1.2.7
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:PublicNetworkRoamingDetailsApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:PublicNetworkRoamingDetailsApplicability .
era-sh:PublicNetworkRoamingDetailsApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:publicNetworkRoamingDetails;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "GSM-R (parameter 1.1.1.3.3.1) must be installed for this parameter to be applicable. "@en ;
	era:rinfIndex "1.1.1.3.3.7", "1.2.1.1.2.7" ;
	sh:message "publicNetworkRoamingDetails (1.1.1.3.3.7, 1.2.1.1.2.7):The track {$this} ({?label}), has a 'GSM-R version' defined which makes the publicNetworkRoamingDetails parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
    sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:publicNetworkRoamingDetails AS ?path)
			WHERE {
                 $this era:gsmRVersion ?gsmRVersion.
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
                FILTER NOT EXISTS {$this era:publicNetworkRoamingDetails ?value} . 
            }
			""" .
	

# localRulesOrRestrictionsDoc: 1.1.1.4.2, 1.2.3.2
era-sh:RunningTrackShape sh:property era-sh:LocalRulesOrRestrictionsDoc.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:LocalRulesOrRestrictionsDoc.
era-sh:OperationalPointShape sh:property era-sh:LocalRulesOrRestrictionsDoc.
era-sh:LocalRulesOrRestrictionsDoc
	a sh:PropertyShape ;
    era:affectedProperty era:localRulesOrRestrictionsDoc;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Electronic document available from the IM stored by the Agency providing additional information. "@en ;
	era:rinfIndex "1.1.1.4.2", "1.2.3.2" ;
	sh:path era:localRulesOrRestrictionsDoc ;
    # sh:maxCount 1 ; # Functional property
	sh:class era:Document ;
	sh:severity sh:Violation ;
	sh:message "localRulesOrRestrictionsDoc (1.1.1.4.2, 1.2.3.2): The track has a value of the document regarding the rules or restrictions of a strictly local nature available by the IM, that must be a Document."@en .

# errorCorrectionsOnboard: 1.1.1.3.1.2, 1.2.1.1.1.19
era-sh:RunningTrackShape sh:property era-sh:ErrorCorrectionsOnboard.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:ErrorCorrectionsOnboard.
era-sh:ErrorCorrectionsOnboard
	a sh:PropertyShape ;
    era:affectedProperty era:errorCorrectionsOnboard;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "List of applicable CR's required to be solved in the on-board according to the TSI CCS point 7.2.10.3 specification maintenance point (ETCS, GSM-R and/or ATO). "@en ;
	era:rinfIndex "1.1.1.3.1.2", "1.2.1.1.1.19" ;
	sh:path era:errorCorrectionsOnboard ;
    sh:nodeKind sh:IRI ;
    sh:maxCount 1; 
	sh:severity sh:Violation ;
	sh:message "errorCorrectionsOnboard (1.1.1.3.1.2, 1.2.1.1.1.19): The track may have an error correction required for the on-board ETCS, GSM-R and/or ATO function value that is an IRI. This error is due to having more than one value or having a value that is not an IRI."@en .

# errorCorrectionsOnboard: 1.1.1.3.1.2, 1.2.1.1.1.19
era-sh:RunningTrackShape sh:sparql era-sh:ErrorCorrectionsOnboardSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:ErrorCorrectionsOnboardSKOS.
era-sh:ErrorCorrectionsOnboardSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:errorCorrectionsOnboard;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "List of applicable CR's required to be solved in the on-board according to the TSI CCS point 7.2.10.3 specification maintenance point (ETCS, GSM-R and/or ATO). "@en ;
	era:rinfIndex "1.1.1.3.1.2", "1.2.1.1.1.19" ;
	sh:message "errorCorrectionsOnboard (1.1.1.3.1.2, 1.2.1.1.1.19): The track {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/error-corrections/OnboardErrorCorrections."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:errorCorrectionsOnboard AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:errorCorrectionsOnboard ?concept .
        era:errorCorrectionsOnboard era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# etcsInfillLineAccess: 1.1.1.3.2.3, 1.2.1.1.1.3
era-sh:ETCSShape sh:property era-sh:EtcsInfillLineAccess.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:EtcsInfillLineAccess.
era-sh:EtcsInfillLineAccess
	a sh:PropertyShape;
    era:affectedProperty era:etcsInfillLineAccess ;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Indication whether infill is required to access the line for safety reasons. "@en ; 
	era:rinfIndex "1.1.1.3.2.3", "1.2.1.1.1.3" ;
	sh:path era:etcsInfillLineAccess ;
	sh:maxCount 1 ; # Functional property
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "etcsInfillLineAccess (1.1.1.3.2.3, 1.2.1.1.1.3): Each ETCS or subset may define the existence of a ETCS infill necessary for line access. This error is due to having more than one indication of ETCS infill necessary for line access value or having an indication of ETCS infill necessary for line access value that is not Y/N (boolean)."@en .

# etcsInfillLineAccess: 1.1.1.3.2.3, 1.2.1.1.1.3
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:EtcsInfillLineAccessApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:EtcsInfillLineAccessApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:EtcsInfillLineAccessApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:EtcsInfillLineAccessApplicability .
era-sh:EtcsInfillLineAccessApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsInfillLineAccess;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.3", "1.2.1.1.1.3" ;
	sh:message "etcsInfillLineAccess (1.1.1.3.2.3, 1.2.1.1.1.3):The ETCS or subset {$this} ({?thisLabel}), has a 'ETCS Level Type' defined which makes the etcsInfillLineAccess parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:etcsInfillLineAccess AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:etcsInfillLineAccess ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:etcsInfillLineAccess } .
    }
    """ .

# etcsDegradedSituation: 1.1.1.3.10.1, 1.2.1.1.9.1
era-sh:RunningTrackShape sh:property era-sh:EtcsDegradedSituation.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:EtcsDegradedSituation.
era-sh:EtcsDegradedSituation
	a sh:PropertyShape ;
    era:affectedProperty era:etcsDegradedSituation;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "ERTMS / ETCS application level for degraded situation related to the track side equipment. "@en ;
	era:rinfIndex "1.1.1.3.10.1", "1.2.1.1.9.1" ;
	sh:path era:etcsDegradedSituation ;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "etcsDegradedSituation (1.1.1.3.10.1, 1.2.1.1.9.1): The track must have an ETCS level for degraded situation value that is an IRI."@en .

# etcsDegradedSituation: 1.1.1.3.10.1, 1.2.1.1.9.1
era-sh:RunningTrackShape sh:sparql era-sh:EtcsDegradedSituationSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:EtcsDegradedSituationSKOS.
era-sh:EtcsDegradedSituationSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsDegradedSituation;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "ERTMS / ETCS application level for degraded situation related to The track side equipment. "@en ;
	era:rinfIndex "1.1.1.3.10.1", "1.2.1.1.9.1" ;
	sh:message "etcsDegradedSituation (1.1.1.3.10.1, 1.2.1.1.9.1): The track {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/etcs-situation/ETCSSituations."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:etcsDegradedSituation AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:etcsDegradedSituation ?concept .
        era:etcsDegradedSituation era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# etcsDegradedSituation: 1.1.1.3.10.1, 1.2.1.1.9.1
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:EtcsDegradedSituationApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:EtcsDegradedSituationApplicability .
era-sh:EtcsDegradedSituationApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsDegradedSituation;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.10.1", "1.2.1.1.9.1" ;
	sh:message "etcsDegradedSituation (1.1.1.3.10.1, 1.2.1.1.9.1):The track {$this} ({?label}), has an 'ETCS Level Type' defined that makes the etcsDegradedSituation parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:etcsDegradedSituation AS ?path)
			WHERE {
                 $this era:etcs ?etcs.
				 ?etcs era:etcsLevelType ?etcsType.
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
                FILTER NOT EXISTS {$this era:etcsDegradedSituation ?value} . 
				FILTER NOT EXISTS {$this era:notYetAvailable era:etcsDegradedSituation} .
            }
			""" .

# hasEtcsNationalPacket44: 1.1.1.3.2.5, 1.2.1.1.1.5
era-sh:ETCSShape sh:property era-sh:HasEtcsNationalPacket44.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:HasEtcsNationalPacket44.
era-sh:HasEtcsNationalPacket44
	a sh:PropertyShape;
    era:affectedProperty era:hasEtcsNationalPacket44 ;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Indication whether data for national packet 44 applications is transmitted between track and train."@en ; 
	era:rinfIndex "1.1.1.3.2.5", "1.2.1.1.1.5" ;
	sh:path era:hasEtcsNationalPacket44 ;
	sh:maxCount 1 ; # Functional property
    sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "hasEtcsNationalPacket44 (1.1.1.3.2.5, 1.2.1.1.1.5): Each ETCS or subset may define the existence of an ETCS national packet 44 application. This error is due to having more than one indication of ETCS national packet 44 application value or having an indication of ETCS national packet 44 application value that is not Y/N (boolean)."@en .

# hasEtcsNationalPacket44: 1.1.1.3.2.5, 1.2.1.1.1.5
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:HasEtcsNationalPacket44Applicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:HasEtcsNationalPacket44Applicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:HasEtcsNationalPacket44Applicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:HasEtcsNationalPacket44Applicability .
era-sh:HasEtcsNationalPacket44Applicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:hasEtcsNationalPacket44;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.5", "1.2.1.1.1.5" ;
	sh:message "hasEtcsNationalPacket44 (1.1.1.3.2.5, 1.2.1.1.1.5):The ETCS {$this} ({?thisLabel}), has an  'ETCS Level Type' defined that makes the hasEtcsNationalPacket44 parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:hasEtcsNationalPacket44 AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:hasEtcsNationalPacket44 ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:hasEtcsNationalPacket44 } .
    }
    """ .

# etcsNationalPacket44Function: 1.1.1.3.2.5, 1.2.1.1.1.5
era-sh:TrackShape sh:property era-sh:EtcsNationalPacket44Function.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:EtcsNationalPacket44Function.
era-sh:EtcsNationalPacket44Function
	a sh:PropertyShape ;
    era:affectedProperty era:etcsNationalPacket44Function;
    era:affectedClass era:Track ;
    era:scope "local";
	rdfs:comment "Link to the implemented functions for national packet 44 applications that are transmitted between track and train. "@en ;
	era:rinfIndex "1.1.1.3.2.5" , "1.2.1.1.1.5" ;
	sh:path era:etcsNationalPacket44Function ;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "etcsNationalPacket44Function (1.1.1.3.2.5, 1.2.1.1.1.5): The ETCS or subset must have a ETCS national packet 44 application implemented function value that is an IRI."@en .	

# etcsNationalPacket44Function: 1.1.1.3.2.5, 1.2.1.1.1.5
era-sh:ETCSShape sh:sparql era-sh:EtcsNationalPacket44FunctionSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:EtcsNationalPacket44FunctionSKOS.
era-sh:EtcsNationalPacket44FunctionSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsNationalPacket44Function;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Link to the implemented functions for national packet 44 applications that are transmitted between track and train. "@en ;
	era:rinfIndex "1.1.1.3.2.5" , "1.2.1.1.1.5" ;
	sh:message "etcsNationalPacket44Function (1.1.1.3.2.5, 1.2.1.1.1.5): The ETCS or subset {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/etcs-national-packet-444-functions/ETCSNationalPacket444Functions/."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:etcsNationalPacket44Function AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:etcsNationalPacket44Function ?concept .
        era:etcsNationalPacket44Function era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
"""  .

# etcsNationalPacket44Function: 1.1.1.3.2.5 , 1.2.1.1.1.5
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:EtcsNationalPacket44FunctionApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:EtcsNationalPacket44FunctionApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:EtcsNationalPacket44FunctionApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:EtcsNationalPacket44FunctionApplicability .
era-sh:EtcsNationalPacket44FunctionApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsNationalPacket44Function;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.5" , "1.2.1.1.1.5" ;
	sh:message "etcsNationalPacket44Function (1.1.1.3.2.5 , 1.2.1.1.1.5): The ETCS or subset {$this} ({?thisLabel}), has a ETCS level type which makes the etcsNationalPacket44Function parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
	sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:etcsNationalPacket44Function AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:etcsNationalPacket44Function ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:etcsNationalPacket44Function } .
    }
    """ .

# etcsImplementsLevelCrossingProcedure: 1.1.1.3.2.13, 1.2.1.1.1.13
era-sh:ETCSShape sh:property era-sh:EtcsImplementsLevelCrossingProcedure.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:EtcsImplementsLevelCrossingProcedure.
era-sh:EtcsImplementsLevelCrossingProcedure
	a sh:PropertyShape;
    era:affectedProperty era:etcsImplementsLevelCrossingProcedure ;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "If the trackside does not implement any solution to cover defective LXs (which are normally protected by means of a technical system), then drivers will be required to comply with instructions received from other sources."@en ;
	era:rinfIndex "1.1.1.3.2.13", "1.2.1.1.1.13" ;
	sh:path era:etcsImplementsLevelCrossingProcedure ;
	sh:maxCount 1 ; # Functional property
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "etcsImplementsLevelCrossingProcedure (1.1.1.3.2.13, 1.2.1.1.1.13): Each ETCS or subset may define the existence of level crossing procedure or an equivalent solution for ETCS trackside. This error is due to having more than one value or having a value that is not Y/N (boolean)."@en .

# etcsImplementsLevelCrossingProcedure: 1.1.1.3.2.13, 1.2.1.1.1.13
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:EtcsImplementsLevelCrossingProcedureApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:EtcsImplementsLevelCrossingProcedureApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:EtcsImplementsLevelCrossingProcedureApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:EtcsImplementsLevelCrossingProcedureApplicability .
era-sh:EtcsImplementsLevelCrossingProcedureApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsImplementsLevelCrossingProcedure;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.13", "1.2.1.1.1.13" ;
	sh:message "etcsImplementsLevelCrossingProcedure (1.1.1.3.2.13, 1.2.1.1.1.13):The ETCS or subset {$this} ({?thisLabel}), has an  'ETCS Level Type' defined that makes the etcsImplementsLevelCrossingProcedure parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:etcsImplementsLevelCrossingProcedure AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:etcsImplementsLevelCrossingProcedure ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:etcsImplementsLevelCrossingProcedure } .
    }
    """ .

# tsiTractionHarmonics: 1.1.1.3.9.2, 1.2.1.1.8.2
era-sh:RunningTrackShape sh:property era-sh:TsiTractionHarmonics.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:TsiTractionHarmonics.
era-sh:TsiTractionHarmonics
	a sh:PropertyShape;
    era:affectedProperty era:tsiTractionHarmonics ;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication whether rules exist and are compliant with the TSI. "@en ; 
	era:rinfIndex "1.1.1.3.9.2", "1.2.1.1.8.2" ;
	sh:path era:tsiTractionHarmonics ;
	sh:maxCount 1 ; # Functional property
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "tsiTractionHarmonics (1.1.1.3.9.2, 1.2.1.1.8.2): Each track may define the existence and TSI compliance of limits in harmonics in the traction current of vehicles. This error is due to having more than one value or having a value that is not Y/N (boolean)."@en .

# tsiTractionHarmonics: 1.1.1.3.9.2, 1.2.1.1.8.2
era-sh:RunningTrackShape sh:sparql era-sh:TsiTractionHarmonicsApplicability .
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:TsiTractionHarmonicsApplicability.
era-sh:TsiTractionHarmonicsApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:tsiTractionHarmonics;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Applicable ('Y') only when for parameter 1.1.1.3.7.1.1 the selected option is 'wheel detector' or 'track circuit'. "@en ;
	era:rinfIndex "1.1.1.3.9.2", "1.2.1.1.8.2" ;
	sh:message "tsiTractionHarmonics (1.1.1.3.9.2, 1.2.1.1.8.2): The track {$this} ({?label}), has a 'train detection system' type ('wheel detector' or 'track circuit')  that makes the tsiTractionHarmonics parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:tsiTractionHarmonics AS ?path)
			WHERE {
                 {$this era:trainDetectionSystemType <http://data.europa.eu/949/concepts/train-detection/rinf/10>}
				 UNION
                 {$this era:trainDetectionSystemType <http://data.europa.eu/949/concepts/train-detection/rinf/20>}
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
                FILTER NOT EXISTS {$this era:tsiTractionHarmonics ?value} . 
            }
			""" .

# tsiMagneticFields:  1.1.1.3.9.1, 1.2.1.1.8.1
era-sh:RunningTrackShape sh:property era-sh:TsiMagneticFields.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:TsiMagneticFields.
era-sh:TsiMagneticFields
	a sh:PropertyShape;
    era:affectedProperty era:tsiMagneticFields ;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication whether rules exist and are compliant with the TSI. "@en ; 
	era:rinfIndex "1.1.1.3.9.1", "1.2.1.1.8.1" ;
	sh:path era:tsiMagneticFields ;
	sh:maxCount 1 ; # Functional property
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "tsiMagneticFields (1.1.1.3.9.1, 1.2.1.1.8.1): Each track may define the existence and TSI compliance of rules for magnetic fields emitted by a vehicle. This error is due to having more than one value or having a value that is not Y/N (boolean)."@en .

# tsiMagneticFields:  1.1.1.3.9.1, 1.2.1.1.8.1
era-sh:RunningTrackShape sh:sparql era-sh:TsiMagneticFieldsApplicability .
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:TsiMagneticFieldsApplicability.
era-sh:TsiMagneticFieldsApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:tsiMagneticFields;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Applicable ('Y') only when for parameter 1.1.1.3.7.1.1 the selected option is 'wheel detector'. "@en ;
	era:rinfIndex "1.1.1.3.9.1", "1.2.1.1.8.1" ;
	sh:message "tsiMagneticFields (1.1.1.3.9.1, 1.2.1.1.8.1):The track {$this} ({?label}), has a 'train detection system' type ('wheel detector') that makes the tsiMagneticFields parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:tsiMagneticFields AS ?path)
			WHERE {
                 $this era:trainDetectionSystemType <http://data.europa.eu/949/concepts/train-detection/rinf/20>.
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
                FILTER NOT EXISTS {$this era:tsiMagneticFields ?value} . 
            }
			""" .


# publicNetworkRoaming: 1.1.1.3.3.6, 1.2.1.1.2.6
era-sh:RunningTrackShape sh:property era-sh:PublicNetworkRoaming.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:PublicNetworkRoaming.
era-sh:PublicNetworkRoaming
	a sh:PropertyShape;
    era:affectedProperty era:publicNetworkRoaming ;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Existence of roaming to a public network. "@en ; 
	era:rinfIndex "1.1.1.3.3.6", "1.2.1.1.2.6" ;
	sh:path era:publicNetworkRoaming ;
	sh:maxCount 1 ; # Functional property
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "publicNetworkRoaming (1.1.1.3.3.6, 1.2.1.1.2.6): Each track may define the existence of GSM-R roaming to public networks. This error is due to having more than one value or having a value that is not Y/N (boolean)."@en .

# publicNetworkRoaming: 1.1.1.3.3.6, 1.2.1.1.2.6
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:PublicNetworkRoamingApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:PublicNetworkRoamingApplicability .
era-sh:PublicNetworkRoamingApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:publicNetworkRoaming;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "GSM-R (parameter 1.1.1.3.3.1) must be installed for this parameter to be applicable. "@en ;
	era:rinfIndex "1.1.1.3.3.6", "1.2.1.1.2.6" ;
	sh:message "publicNetworkRoaming (1.1.1.3.3.6, 1.2.1.1.2.6):The track {$this} ({?label}), has a 'GSM-R version' defined which makes the publicNetworkRoaming parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:publicNetworkRoaming AS ?path)
			WHERE {
                 $this era:gsmRVersion ?gsmRVersion.
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
                FILTER NOT EXISTS {$this era:publicNetworkRoaming ?value} . 
            }
			""" .

# hasETCSRestrictionsConditions: 1.1.1.3.2.6, 1.2.1.1.1.6
era-sh:ETCSShape sh:property era-sh:HasETCSRestrictionsConditions.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:HasETCSRestrictionsConditions.
era-sh:HasETCSRestrictionsConditions
	a sh:PropertyShape;
    era:affectedProperty era:hasETCSRestrictionsConditions ;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Indication whether restrictions or conditions due to partial compliance with the TSI CCS exist. "@en ; 
	era:rinfIndex "1.1.1.3.2.6", "1.2.1.1.1.6" ;
	sh:path era:hasETCSRestrictionsConditions ;
	sh:maxCount 1 ; # Functional property
	sh:datatype xsd:boolean;
	sh:severity sh:Violation ;
	sh:message "hasETCSRestrictionsConditions (1.1.1.3.2.6, 1.2.1.1.1.6): Each ETCS or subset may define the existence of operating restrictions or conditions. This error is due to having more than one value or having a value that is not Y/N (boolean)."@en .

# hasETCSRestrictionsConditions: 1.1.1.3.2.6, 1.2.1.1.1.6
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:HasETCSRestrictionsConditionsApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:HasETCSRestrictionsConditionsApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:HasETCSRestrictionsConditionsApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:HasETCSRestrictionsConditionsApplicability .
era-sh:HasETCSRestrictionsConditionsApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:hasETCSRestrictionsConditions;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable (true) when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.6", "1.2.1.1.1.6" ;
	sh:message "hasETCSRestrictionsConditions (1.1.1.3.2.6, 1.2.1.1.1.6):The ETCS or subset {$this} ({?thisLabel}), has a 'ETCS level' type selected which makes the hasETCSRestrictionsConditions parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:hasETCSRestrictionsConditions AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:hasETCSRestrictionsConditions ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:hasETCSRestrictionsConditions } .
    }
    """ .

# etcsRestrictionsConditionsDoc: 1.1.1.3.2.6, 1.2.1.1.1.6
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:EtcsRestrictionsConditionsDoc.
era-sh:TrackShape sh:property era-sh:EtcsRestrictionsConditionsDoc.
era-sh:EtcsRestrictionsConditionsDoc
	a sh:PropertyShape ;
    era:affectedProperty era:etcsRestrictionsConditionsDoc;
    era:affectedClass era:Track ;
    era:scope "local";
	rdfs:comment "Indication of the document where restrictions or conditions due to partial compliance with the TSI CCS are described. "@en ;
	era:rinfIndex "1.1.1.3.2.6" , "1.2.1.1.1.6" ;
	sh:path era:etcsRestrictionsConditionsDoc ;
    sh:maxCount 1 ; # Functional property
	sh:class era:Document ;
	sh:severity sh:Violation ;
	sh:message "etcsRestrictionsConditionsDoc (1.1.1.3.2.6, 1.2.1.1.1.6): The ETCS or subset has a document regarding the rules or restrictions of a strictly local nature available by the IM value that must be a Document."@en .

# etcsRestrictionsConditionsDoc: 1.1.1.3.2.6, 1.2.1.1.1.6
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:EtcsRestrictionsConditionsDocApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:EtcsRestrictionsConditionsDocApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:EtcsRestrictionsConditionsDocApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:EtcsRestrictionsConditionsDocApplicability .
era-sh:EtcsRestrictionsConditionsDocApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsRestrictionsConditionsDoc;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when hasETCSRestricionsConditions is true. "@en ;
	era:rinfIndex "1.1.1.3.2.6" , "1.2.1.1.1.6" ;
	sh:message "etcsRestrictionsConditionsDoc (1.1.1.3.2.6, 1.2.1.1.1.6):The ETCS or subset {$this} ({?label}), has a 'has ETCS Restricions Condition' value 'true' which makes the etcsRestrictionsConditionsDoc parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:etcsRestrictionsConditionsDoc AS ?path)
    WHERE {
        $this era:hasETCSRestrictionsConditions true .
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        FILTER NOT EXISTS { $this era:etcsRestrictionsConditionsDoc ?value } .
    }
    """ .


# localRulesOrRestrictions: 1.1.1.4.1, 1.2.3.1
era-sh:RunningTrackShape sh:property era-sh:LocalRulesOrRestrictions.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:LocalRulesOrRestrictions.
era-sh:OperationalPointShape sh:property era-sh:LocalRulesOrRestrictions.
era-sh:LocalRulesOrRestrictions
	a sh:PropertyShape;
    era:affectedProperty era:localRulesOrRestrictions ;
    era:affectedClass era:RunningTrack, era:OperationalPoint, era:CommonCharacteristicsSubset ;
    era:scope "local";
	rdfs:comment "Existence of rules and restrictions of a strictly local nature. "@en ; 
	era:rinfIndex "1.1.1.4.1", "1.2.3.1" ;
	sh:path era:localRulesOrRestrictions ;
	sh:maxCount 1 ; # Functional property
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "localRulesOrRestrictions (1.1.1.4.1, 1.2.3.1): Each track may define the existence of rules and restrictions of a strictly local nature. This error is due to having more than one value or having a value that is not Y/N (boolean)."@en .

# switchProtectControlWarning: 1.2.1.1.7.1, 1.1.1.3.8.1
era-sh:TrackShape sh:property era-sh:SwitchProtectControlWarning.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:SwitchProtectControlWarning.
era-sh:SwitchProtectControlWarning
	a sh:PropertyShape;
    era:affectedProperty era:switchProtectControlWarning ;
    era:affectedClass era:Track;
    era:scope "local";
	rdfs:comment "Indication whether a switch over between different systems whilst running exists. "@en ; 
	era:rinfIndex "1.2.1.1.7.1", "1.1.1.3.8.1" ;
	sh:path era:switchProtectControlWarning ;
	sh:maxCount 1 ; # Functional property
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "switchProtectControlWarning (1.2.1.1.7.1, 1.1.1.3.8.1): Each track may define the existence of switch over between different protection, control and warning systems while running. This error is due to having more than one value or having a value that is not Y/N (boolean)."@en .

# switchProtectControlWarning: 1.2.1.1.7.1, 1.1.1.3.8.1
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:SwitchProtectControlWarningApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:SwitchProtectControlWarningApplicability .
era-sh:SwitchProtectControlWarningApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:switchProtectControlWarning;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Applicable ('Y') when at least two different class of protection systems exist. "@en ;
	era:rinfIndex "1.2.1.1.7.1", "1.1.1.3.8.1" ;
	sh:message "switchProtectControlWarning (1.2.1.1.7.1, 1.1.1.3.8.1):The track {$this} ({?label}), has  more than one protection system defined which makes the switchProtectControlWarning parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label ?count (era:switchProtectControlWarning AS ?path)
			WHERE {
				{
				SELECT $this (COUNT(?system) AS ?count) WHERE{
					{$this era:protectionLegacySystem ?system}
					UNION
					{$this era:otherTrainProtection ?system}					
					} GROUP BY $this
				}
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
				FILTER ( ?count > 1) .
                FILTER NOT EXISTS {$this era:switchProtectControlWarning ?value} . 
            }
			""" .

# switchRadioSystem: 1.2.1.1.7.2, 1.1.1.3.8.2
era-sh:TrackShape sh:property era-sh:SwitchRadioSystem.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:SwitchRadioSystem.
era-sh:SwitchRadioSystem
	a sh:PropertyShape;
    era:affectedProperty era:switchRadioSystem ;
    era:affectedClass era:Track;
    era:scope "local";
	rdfs:comment "Indication whether a switch over between different radio systems and no communication system whilst running exists. "@en ; 
	era:rinfIndex "1.2.1.1.7.2", "1.1.1.3.8.2" ;
	sh:path era:switchRadioSystem ;
	sh:maxCount 1 ; # Functional property
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "switchRadioSystem (1.2.1.1.7.2, 1.1.1.3.8.2): Each track may define the existence of switch over between different radio systems. This error is due to having more than one value or having a value that is not Y/N (boolean)."@en .

# switchRadioSystem: 1.2.1.1.7.2, 1.1.1.3.8.2
era-sh:RunningTrackShape sh:sparql era-sh:SwitchRadioSystemApplicability .
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:SwitchRadioSystemApplicability.
era-sh:SwitchRadioSystemApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:switchRadioSystem;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Applicable ('Y') when at least two different radio systems exist. "@en ;
	era:rinfIndex "1.2.1.1.7.2", "1.1.1.3.8.2" ;
	sh:message "switchRadioSystem (1.2.1.1.7.2, 1.1.1.3.8.2):The track {$this} ({?label}), has more than one radio system defined which makes the switchRadioSystem parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label ?countRS (era:switchRadioSystem AS ?path)
			WHERE {
				{
				SELECT $this (COUNT(?radioSystem) AS ?countRS) WHERE{
	            	$this era:legacyRadioSystem ?radioSystem					
					} GROUP BY $this
				}
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
				FILTER ( ?countRS > 1) .
                FILTER NOT EXISTS {$this era:switchRadioSystem ?value} . 
            }
			""" .

# hasTSITrainDetection: 1.1.1.3.4.1, 1.2.1.1.3.1
era-sh:RunningTrackShape sh:property era-sh:HasTSITrainDetection.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:HasTSITrainDetection.
era-sh:HasTSITrainDetection
	a sh:PropertyShape;
    era:affectedProperty era:hasTSITrainDetection ;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication if there is any train detection system installed and fully compliant with the TSI CCS (Annex I, Appendix A, Table A.2 -Index 77). "@en ; 
	era:rinfIndex "1.1.1.3.4.1", "1.2.1.1.3.1" ;
	sh:path era:hasTSITrainDetection ;
    # sh:minCount 1 ; # TODO not yet applicable
	sh:maxCount 1 ; # Functional property
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "hasTSITrainDetection (1.1.1.3.4.1, 1.2.1.1.3.1): Each track may define the existence of train detection system fully compliant with the TSI. This error is due to having more than one value or having a value that is not Y/N (boolean)."@en .

# gprsForETCS: 1.1.1.3.3.3.2, 1.2.1.1.2.3.2
era-sh:RunningTrackShape sh:property era-sh:GprsForETCS.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:GprsForETCS.
era-sh:GprsForETCS
	a sh:PropertyShape;
    era:affectedProperty era:gprsForETCS ;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication if GPRS can be used for ETCS. "@en ; 
	era:rinfIndex "1.1.1.3.3.3.2", "1.2.1.1.2.3.2" ;
	sh:path era:gprsForETCS ;
	sh:maxCount 1 ; # Functional property
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "gprsForETCS (1.1.1.3.3.3.2, 1.2.1.1.2.3.2): Each track may define the existence of GPRS for ETCS. This error is due to having more than one value or having a value that is not Y/N (boolean)."@en .

# gprsForETCS: 1.1.1.3.3.3.2, 1.2.1.1.2.3.2
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:GprsForETCSApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:GprsForETCSApplicability .
era-sh:GprsForETCSApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:gprsForETCS;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "GSM-R (parameter 1.1.1.3.3.1) and ETCS L2 (parameter 1.1.1.3.2.1) must be installed for this parameter to be applicable. "@en ;
	era:rinfIndex "1.1.1.3.3.3.2", "1.2.1.1.2.3.2" ;
	sh:message "gprsForETCS (1.1.1.3.3.3.2, 1.2.1.1.2.3.2):The track {$this} ({?label}), has a 'GSM-R version' defined and a 'ETCS level' type selected which makes the gprsForETCS parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:gprsForETCS AS ?path)
			WHERE {
                 $this era:gsmRVersion ?gsmRVersion;
				 	   era:etcs ?etcs.
				 ?etcs era:etcsLevelType ?etcsType.
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
                FILTER NOT EXISTS {$this era:gprsForETCS ?value} .
				FILTER NOT EXISTS {$this era:notYetAvailable era:gprsForETCS} . 
            }
			""" .

# gsmrNetworkCoverage: 1.1.1.3.3.5, 1.2.1.1.2.5
era-sh:RunningTrackShape sh:property era-sh:GsmrNetworkCoverage.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:GsmrNetworkCoverage.
era-sh:GsmrNetworkCoverage
	a sh:PropertyShape ;
    era:affectedProperty era:gsmrNetworkCoverage;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "List of GSM-R networks which are covered by a roaming agreement. "@en ;
	era:rinfIndex "1.1.1.3.3.5", "1.2.1.1.2.5" ;
	sh:path era:gsmrNetworkCoverage ;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "gsmrNetworkCoverage (1.1.1.3.3.5, 1.2.1.1.2.5): The track must have a GSM-R networks covered by a roaming agreement value that is an IRI."@en .	

# gsmrNetworkCoverage: 1.1.1.3.3.5, 1.2.1.1.2.5
era-sh:RunningTrackShape sh:sparql era-sh:GsmrNetworkCoverageSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:GsmrNetworkCoverageSKOS.
era-sh:GsmrNetworkCoverageSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:gsmrNetworkCoverage;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "List of GSM-R networks which are covered by a roaming agreement. "@en ;
	era:rinfIndex "1.1.1.3.3.5", "1.2.1.1.2.5" ;
	sh:message "gsmrNetworkCoverage (1.1.1.3.3.5, 1.2.1.1.2.5): The track {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/gsmr-networks/GSMRNetworks."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:gsmrNetworkCoverage AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:gsmrNetworkCoverage ?concept .
        era:gsmrNetworkCoverage era:inSkosConceptScheme ?conceptScheme .
        FILTER (NOT EXISTS {?concept skos:inScheme ?conceptScheme} || REGEX(STR(?concept), "/eratv/"))
	}
""" .

# gsmrNetworkCoverage: 1.1.1.3.3.5, 1.2.1.1.2.5
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:GsmrNetworkCoverageApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:GsmrNetworkCoverageApplicability .
era-sh:GsmrNetworkCoverageApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:gsmrNetworkCoverage;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "GSM-R (parameter 1.1.1.3.3.1) must be installed for this parameter to be applicable. "@en ;
	era:rinfIndex "1.1.1.3.3.5", "1.2.1.1.2.5" ;
	sh:message "gsmrNetworkCoverage (1.1.1.3.3.5, 1.2.1.1.2.5):The track {$this} ({?label}), has a 'GSM-R version' defined which makes the gsmrNetworkCoverage parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:gsmrNetworkCoverage AS ?path)
			WHERE {
                 $this era:gsmRVersion ?gsmRVersion.
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
                FILTER NOT EXISTS {$this era:gsmrNetworkCoverage ?value} . 
            }
			""" .

# usesGroup555: 1.1.1.3.3.4, 1.2.1.1.2.4
era-sh:RunningTrackShape sh:property era-sh:UsesGroup555.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:UsesGroup555.
era-sh:UsesGroup555
	a sh:PropertyShape;
    era:affectedProperty era:usesGroup555 ;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication if group 555 is used. "@en ; 
	era:rinfIndex "1.1.1.3.3.4", "1.2.1.1.2.4" ;
	sh:path era:usesGroup555 ;
	sh:maxCount 1 ; # Functional property
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "usesGroup555 (1.1.1.3.3.4, 1.2.1.1.2.4): Each track may define the existence of GSM-R use of group 555. This error is due to having more than one value or having a value that is not Y/N (boolean)."@en .

# usesGroup555: 1.1.1.3.3.4, 1.2.1.1.2.4
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:UsesGroup555Applicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:UsesGroup555Applicability .
era-sh:UsesGroup555Applicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:usesGroup555;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "GSM-R (parameter 1.1.1.3.3.1) and ETCS L2 (parameter 1.1.1.3.2.1) must be installed for this parameter to be applicable. "@en ;
	era:rinfIndex "1.1.1.3.3.4", "1.2.1.1.2.4" ;
	sh:message "usesGroup555 (1.1.1.3.3.4, 1.2.1.1.2.4):The track {$this} ({?label}), has a 'GSM-R version' defined and a 'ETCS level' type selected which makes the usesGroup555 parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:usesGroup555 AS ?path)
			WHERE {
                 $this era:gsmRVersion ?gsmRVersion;
				 	   era:etcs ?etcs.
				 ?etcs era:etcsLevelType ?etcsType.
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
                FILTER NOT EXISTS {$this era:usesGroup555 ?value} . 
            }
			""" .

# gsmRVersion: 1.1.1.3.3.1, 1.2.1.1.2.1
era-sh:RunningTrackShape sh:property era-sh:GsmRVersion.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:GsmRVersion.
era-sh:GsmRVersion
	a sh:PropertyShape ;
    era:affectedProperty era:gsmRVersion;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "GSM-R functional requirements specification and system requirements specification in accordance with the specification respectively referenced in TSI CCS (Annex ), version number installed lineside. "@en ;
	era:rinfIndex "1.1.1.3.3.1", "1.2.1.1.2.1" ;
	sh:path era:gsmRVersion ;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "gsmRVersion (1.1.1.3.3.1, 1.2.1.1.2.1): The track must have a GSM-R version value that is an IRI."@en .	

# gsmRVersion: 1.1.1.3.3.1, 1.2.1.1.2.1
era-sh:RunningTrackShape sh:sparql era-sh:GsmRVersionSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:GsmRVersionSKOS.
era-sh:GsmRVersionSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:gsmRVersion;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "GSM-R functional requirements specification and system requirements specification in accordance with the specification respectively referenced in TSI CCS (Annex ), version number installed lineside. "@en ;
	era:rinfIndex "1.1.1.3.3.1", "1.2.1.1.2.1" ;
	sh:message "gsmRVersion (1.1.1.3.3.1, 1.2.1.1.2.1): The track {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/gsmr-versions/GSMRVersions."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:gsmRVersion AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:gsmRVersion ?concept .
        era:gsmRVersion era:inSkosConceptScheme ?conceptScheme .
        FILTER (NOT EXISTS {?concept skos:inScheme ?conceptScheme} || REGEX(STR(?concept), "/eratv/"))
	}
""" .

# trackId: 1.1.1.0.0.1, 1.2.1.0.0.2
era-sh:RunningTrackShape sh:property era-sh:TrackId.
era-sh:TrackId
	a sh:PropertyShape ;
    era:affectedProperty era:trackId;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Unique track identification or unique track number within an OP or a section of line. "@en ;
	era:rinfIndex "1.1.1.0.0.1", "1.2.1.0.0.2" ;
    sh:minCount 1;
    sh:maxCount 1;
	sh:path era:trackId ;
	sh:datatype xsd:string ;
	sh:severity sh:Violation ;
	sh:message "trackId (1.1.1.3.3.3.3, 1.2.1.1.2.3.3): The identification of a track must be a string. This error may be due to having a track with no identification or with more than one value as identification, or having a value that is not a string."@en .

# gsmrForcedDeregistrationFunctionalNumber: 1.1.1.3.3.11, 1.2.1.1.2.11
era-sh:RunningTrackShape sh:property era-sh:GsmrForcedDeregistrationFunctionalNumber.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:GsmrForcedDeregistrationFunctionalNumber.
era-sh:GsmrForcedDeregistrationFunctionalNumber
	a sh:PropertyShape;
    era:affectedProperty era:gsmrForcedDeregistrationFunctionalNumber;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "This feature will determine the applicable operational rules for drivers and signallers when dealing with cab radios registered under wrong numbers. "@en ; 
	era:rinfIndex "1.1.1.3.3.11" , "1.2.1.1.2.11" ;
	sh:path era:gsmrForcedDeregistrationFunctionalNumber ;
	sh:maxCount 1 ; # Functional property
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "gsmrForcedDeregistrationFunctionalNumber (1.1.1.3.3.11, 1.2.1.1.2.11): Each track may define the existence of GSM-R network configured to allow forced de-registration of a functional number by another driver. This error is due to having more than one value or having a value that is not Y/N (boolean)."@en .

# gsmrForcedDeregistrationFunctionalNumber: 1.1.1.3.3.11, 1.2.1.1.2.11
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:GsmrForcedDeregistrationFunctionalNumberApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:GsmrForcedDeregistrationFunctionalNumberApplicability .
era-sh:GsmrForcedDeregistrationFunctionalNumberApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:gsmrForcedDeregistrationFunctionalNumber;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "GSM-R (parameter 1.1.1.3.3.1) and ETCS L2 (parameter 1.1.1.3.2.1) must be installed for this parameter to be applicable. "@en ;
	era:rinfIndex "1.1.1.3.3.11" , "1.2.1.1.2.11" ;
	sh:message "gsmrForcedDeregistrationFunctionalNumber (1.1.1.3.3.11, 1.2.1.1.2.11):The track {$this} ({?label}), has a 'GSM-R version' defined and a 'ETCS level' type selected which makes the gsmrForcedDeregistrationFunctionalNumber parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:gsmrForcedDeregistrationFunctionalNumber AS ?path)
			WHERE {
                 $this era:gsmRVersion ?gsmRVersion;
				 	   era:etcs ?etcs.
				 ?etcs era:etcsLevelType ?etcsType.
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
                FILTER NOT EXISTS {$this era:gsmrForcedDeregistrationFunctionalNumber ?value} . 
				FILTER NOT EXISTS {$this era:notYetAvailable era:gsmrForcedDeregistrationFunctionalNumber} .
            }
			""" .

# mNvcontact: 1.1.1.3.2.16.9, 1.2.1.1.1.16.9
era-sh:ETCSShape sh:property era-sh:MNvcontact.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:MNvcontact.
era-sh:MNvcontact
	a sh:PropertyShape ;
    era:affectedProperty era:mNvcontact;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "On-Board system reaction when T_NVCONTACT expires. "@en ;
	era:rinfIndex "1.1.1.3.2.16.9" , "1.2.1.1.1.16.9" ;
	sh:path era:mNvcontact ;
    sh:nodeKind sh:IRI ;
    sh:maxCount 1 ; # Functional property
	sh:severity sh:Violation ;
	sh:message "mNvcontact (1.1.1.3.2.16.9, 1.2.1.1.1.16.9): The ETCS or subset may have an M_NVCONTACT value that is an IRI. This error is due to having more than one value or having a value that is not an IRI"@en .	

# mNvcontact: 1.1.1.3.2.16.9, 1.2.1.1.1.16.9
era-sh:ETCSShape sh:sparql era-sh:MNvcontactSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:MNvcontactSKOS.
era-sh:MNvcontactSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:mNvcontact;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "On-Board system reaction when T_NVCONTACT expires. "@en ;
	era:rinfIndex "1.1.1.3.2.16.9" , "1.2.1.1.1.16.9" ;
	sh:message "mNvcontact (1.1.1.3.2.16.9, 1.2.1.1.1.16.9): The ETCS or subset {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/etcs-reactions-contact/ETCSReactionsNVContact."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:mNvcontact AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:mNvcontact ?concept .
        era:mNvcontact era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# mNvcontact: 1.1.1.3.2.16.9, 1.2.1.1.1.16.9
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:MNvcontactApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:MNvcontactApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:MNvcontactApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:MNvcontactApplicability .
era-sh:MNvcontactApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:mNvcontact;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.16.9" , "1.2.1.1.1.16.9" ;
	sh:message "mNvcontact (1.1.1.3.2.16.9, 1.2.1.1.1.16.9):The ETCS or subset {$this} ({?thisLabel}), has an  'ETCS Level Type' defined which makes the mNvcontact parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:mNvcontact AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:mNvcontact ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:mNvcontact } .
    }
    """ .

# mNvderun: 1.1.1.3.2.16.10, 1.2.1.1.1.16.10
era-sh:ETCSShape sh:property era-sh:MNvderun.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:MNvderun.
era-sh:MNvderun
	a sh:PropertyShape;
    era:affectedProperty era:mNvderun ;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Entry of Driver ID permitted while running. "@en ; 
	era:rinfIndex "1.1.1.3.2.16.10" , "1.2.1.1.1.16.10" ;
	sh:path era:mNvderun ;
	sh:maxCount 1 ; # Functional property
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "mNvderun (1.1.1.3.2.16.10, 1.2.1.1.1.16.10): Each ETCS or subset may define the M_NVDERUN value. This error is due to having more than one value or having a value that is not Y/N (boolean)."@en .

# mNvderun: 1.1.1.3.2.16.10, 1.2.1.1.1.16.10
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:MNvderunApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:MNvderunApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:MNvderunApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:MNvderunApplicability .
era-sh:MNvderunApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:mNvderun;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.16.10" , "1.2.1.1.1.16.10" ;
	sh:message "mNvderun (1.1.1.3.2.16.10, 1.2.1.1.1.16.10):The ETCS or subset {$this} ({?thisLabel}), has an  'ETCS Level Type' defined which makes the mNvderun parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:mNvderun AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:mNvderun ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:mNvderun } .
    }
    """ .

# minimumHorizontalRadius: 1.1.1.1.3.7, 1.2.2.0.3.2
era-sh:RunningTrackShape sh:property era-sh:MinimumHorizontalRadius.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:MinimumHorizontalRadius.
era-sh:SidingShape sh:property era-sh:MinimumHorizontalRadius.
era-sh:MinimumHorizontalRadius
	a sh:PropertyShape ;
    era:affectedProperty era:minimumHorizontalRadius;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Radius of the smallest horizontal curve of The track in metres. "@en ;
	era:rinfIndex "1.1.1.1.3.7" , "1.2.2.0.3.2" ;
	sh:path era:minimumHorizontalRadius ;
    # sh:minCount 1 ; # TODO not yet applicable
    sh:maxCount 1 ; # Functional property
	sh:datatype xsd:integer ;
	sh:pattern "^([1-9]\\d{0,5}|0)$" ;
	sh:severity sh:Violation ;
	sh:message "minimumHorizontalRadius (1.1.1.1.3.7, 1.2.2.0.3.2): The track defines a minimum radius of horizontal curve. This error is due to having more than one value, having a value that is not an integer or having an integer that does not follow the pattern [NNNNNN]."@en .

# nationalValuesBrakeModel: 1.1.1.3.2.16.13, 1.2.1.1.1.16.13
era-sh:ETCSShape sh:property era-sh:NationalValuesBrakeModel.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:NationalValuesBrakeModel.
era-sh:NationalValuesBrakeModel
	a sh:PropertyShape ;
    era:affectedProperty era:nationalValuesBrakeModel;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Set of parameters for adapting the braking curves calculated by the ETCS on-board system to match accuracy, performance and safety margins imposed by the infrastructure manager." ;
	era:rinfIndex "1.1.1.3.2.16.13" , "1.2.1.1.1.16.13" ;
	sh:path era:nationalValuesBrakeModel ;
	sh:datatype xsd:string ;
    sh:maxCount 1 ; # Functional property
	sh:severity sh:Violation ;
	sh:message "nationalValuesBrakeModel (1.1.1.3.2.16.13, 1.2.1.1.1.16.13): The ETCS or subset has a National Value used for the brake model that must be a string and follow the format [±NNNN.NNN]. The error is due to having more than one value, having a vaalue that is not a string, or it is due to the value not following the pattern."@en .

# nationalValuesBrakeModel: 1.1.1.3.2.16.13, 1.2.1.1.1.16.13
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:NationalValuesBrakeModelApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:NationalValuesBrakeModelApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:NationalValuesBrakeModelApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:NationalValuesBrakeModelApplicability .
era-sh:NationalValuesBrakeModelApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:nationalValuesBrakeModel;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.16.13" , "1.2.1.1.1.16.13" ;
	sh:message "nationalValuesBrakeModel (1.1.1.3.2.16.13, 1.2.1.1.1.16.13):The ETCS or subset {$this} ({?thisLabel}), has an  'ETCS Level Type' defined which makes the nationalValuesBrakeModel parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:nationalValuesBrakeModel AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:nationalValuesBrakeModel ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:nationalValuesBrakeModel } .
    }
    """ .

# gsmRNoCoverage: 1.1.1.3.3.8, 1.2.1.1.2.8
era-sh:RunningTrackShape sh:property era-sh:GsmRNoCoverage.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:GsmRNoCoverage.
era-sh:GsmRNoCoverage
	a sh:PropertyShape;
    era:affectedProperty era:gsmRNoCoverage ;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication if there is no GSMR coverage. "@en ; 
	era:rinfIndex "1.1.1.3.3.8", "1.2.1.1.2.8" ;
	sh:path era:gsmRNoCoverage ;
	sh:maxCount 1 ; # Functional property
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "gsmRNoCoverage (1.1.1.3.3.8, 1.2.1.1.2.8): Each track may define the indication of existence of GSMR coverage. This error is due to having more than one  value or having a value that is not Y/N (boolean)."@en .

# gsmRNoCoverage: 1.1.1.3.3.8, 1.2.1.1.2.8
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:GsmRNoCoverageApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:GsmRNoCoverageApplicability .
era-sh:GsmRNoCoverageApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:gsmRNoCoverage;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "GSM-R (parameter 1.1.1.3.3.1) must be installed for this parameter to be applicable. "@en ;
	era:rinfIndex "1.1.1.3.3.8", "1.2.1.1.2.8" ;
	sh:message "gsmRNoCoverage (1.1.1.3.3.8, 1.2.1.1.2.8):The track {$this} ({?label}), has a 'GSM-R version' defined which makes the gsmRNoCoverage parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:gsmRNoCoverage AS ?path)
			WHERE {
                 $this era:gsmRVersion ?gsmRVersion.
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
                FILTER NOT EXISTS {$this era:gsmRNoCoverage ?value} . 
            }
			""" .

# gsmRActiveMobiles: 1.1.1.3.3.2, 1.2.1.1.2.2
era-sh:RunningTrackShape sh:property era-sh:GsmRActiveMobiles.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:GsmRActiveMobiles.
era-sh:GsmRActiveMobiles
	a sh:PropertyShape ;
    era:affectedProperty era:gsmRActiveMobiles;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Number of simultaneous communication session on board for ETCS level 2 required for a smooth running of the train. This relates to the radio block centre (RBC) handling of communication sessions. Not safety critical and no matter of interoperability. "@en ;
	era:rinfIndex "1.1.1.3.3.2" , "1.2.1.1.2.2" ;
	sh:path era:gsmRActiveMobiles ;
    sh:nodeKind sh:IRI ;
    sh:maxCount 1 ; # Functional property
	sh:severity sh:Violation ;
	sh:message "gsmRActiveMobiles (1.1.1.3.3.2, 1.2.1.1.2.2): The track must have a number of active GSM-R mobiles (EDOR) or simultaneous communication session on-board for ETCS Level 2 needed to perform radio block centre handovers without having an operational disruption value that is a single IRI. This error is due to having more than one value or having a value that is  not an IRI."@en .	

# gsmRActiveMobiles: 1.1.1.3.3.2, 1.2.1.1.2.2
era-sh:RunningTrackShape sh:sparql era-sh:GsmRActiveMobilesSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:GsmRActiveMobilesSKOS.
era-sh:GsmRActiveMobilesSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:gsmRActiveMobiles;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Number of simultaneous communication session on board for ETCS level 2 required for a smooth running of the train. This relates to the radio block centre (RBC) handling of communication sessions. Not safety critical and no matter of interoperability. "@en ;
	era:rinfIndex "1.1.1.3.3.2" , "1.2.1.1.2.2" ;
	sh:message "gsmRActiveMobiles (1.1.1.3.3.2, 1.2.1.1.2.2): The track {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/gsmr-number-active-mobiles/NumberActiveMobiles."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:gsmRActiveMobiles AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:gsmRActiveMobiles ?concept .
        era:gsmRActiveMobiles era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# gsmRActiveMobiles: 1.1.1.3.3.2, 1.2.1.1.2.2
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:GsmRActiveMobilesApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:GsmRActiveMobilesApplicability .
era-sh:GsmRActiveMobilesApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:gsmRActiveMobiles;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "GSM-R (parameter 1.1.1.3.3.1) and ETCS L2 (parameter 1.1.1.3.2.1) must be installed for this parameter to be applicable. "@en ;
	era:rinfIndex "1.1.1.3.3.2" , "1.2.1.1.2.2" ;
	sh:message "gsmRActiveMobiles (1.1.1.3.3.2, 1.2.1.1.2.2):The track {$this} ({?label}), has a 'GSM-R version' defined and a 'ETCS level' type selected which makes the gsmRActiveMobiles parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:gsmRActiveMobiles AS ?path)
			WHERE {
                 $this era:gsmRVersion ?gsmRVersion;
				 	   era:etcs ?etcs.
				 ?etcs era:etcsLevelType ?etcsType.
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
                FILTER NOT EXISTS {$this era:gsmRActiveMobiles ?value} . 
				FILTER NOT EXISTS {$this era:notYetAvailable era:gsmRActiveMobiles} .
            }
			""" .

# gsmROptionalFunctions: 1.1.1.3.3.3, 1.2.1.1.2.3
era-sh:RunningTrackShape sh:property era-sh:GsmROptionalFunctions.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:GsmROptionalFunctions.
era-sh:GsmROptionalFunctions
	a sh:PropertyShape ;
    era:affectedProperty era:gsmROptionalFunctions;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Use of optional GSM-R functions which might improve operation on the line. They are for information only and not for network access criteria. "@en ;
	era:rinfIndex "1.1.1.3.3.3, 1.2.1.1.2.3" ;
	sh:path era:gsmROptionalFunctions ;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "gsmROptionalFunctions (1.1.1.3.3.3, 1.2.1.1.2.3): The track must have optional GSM-R functions value that is an IRI. This error is due to having a avalue that is not an IRI"@en .	

# gsmROptionalFunctions: 1.1.1.3.3.2, 1.2.1.1.2.2
era-sh:RunningTrackShape sh:sparql era-sh:GsmROptionalFunctionsSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:GsmROptionalFunctionsSKOS.
era-sh:GsmROptionalFunctionsSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:gsmROptionalFunctions;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Use of optional GSM-R functions which might improve operation on the line. They are for information only and not for network access criteria. "@en ;
	era:rinfIndex "1.1.1.3.3.2" , "1.2.1.1.2.2" ;
	sh:message "gsmROptionalFunctions (1.1.1.3.3.2, 1.2.1.1.2.2): The track {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/gsmr-optional-functions/OptionalFunctions."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:gsmROptionalFunctions AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:gsmROptionalFunctions ?concept .
        era:gsmROptionalFunctions era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# gsmROptionalFunctions: 1.1.1.3.3.2, 1.2.1.1.2.2
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:GsmROptionalFunctionsApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:GsmROptionalFunctionsApplicability .
era-sh:GsmROptionalFunctionsApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:gsmROptionalFunctions;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "GSM-R (parameter 1.1.1.3.3.1) must be installed for this parameter to be applicable. "@en ;
	era:rinfIndex "1.1.1.3.3.2" , "1.2.1.1.2.2" ;
	sh:message "gsmROptionalFunctions (1.1.1.3.3.2, 1.2.1.1.2.2):The track {$this} ({?label}), has a 'GSM-R version' defined which makes the gsmROptionalFunctions parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:gsmROptionalFunctions AS ?path)
			WHERE {
                 $this era:gsmRVersion ?gsmRVersion.
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
                FILTER NOT EXISTS {$this era:gsmROptionalFunctions ?value} . 
            }
			""" .

# otherCantDeficiencyBasicSSP: 1.1.1.3.2.14.1, 1.2.1.1.1.14.1
era-sh:RunningTrackShape sh:property era-sh:OtherCantDeficiencyBasicSSP.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:OtherCantDeficiencyBasicSSP.
era-sh:OtherCantDeficiencyBasicSSP
	a sh:PropertyShape ;
    era:affectedProperty era:otherCantDeficiencyBasicSSP;
    era:affectedClass era:RunningTrack ;
    era:scope "local";
	rdfs:comment "Essential information for drivers of trains with a worse (lower) tolerated cant deficiency than those for which the ETCS trackside provides SSP (Static Speed Profiles) in conjunction with parameter 'Cant Deficiency used for the basic SSP'. "@en ;
	era:rinfIndex "1.1.1.3.2.14.1" , "1.2.1.1.1.14.1" ;
	sh:path era:otherCantDeficiencyBasicSSP ;
    sh:maxCount 1 ; # Functional property
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "otherCantDeficiencyBasicSSP (1.1.1.3.2.14.1, 1.2.1.1.1.14.1): The ETCS or subset must have other Cant Deficiency train categories basic SSP value that is an IRI. This error is due to having more than one value or having a value that is not an IRI"@en .	

# otherCantDeficiencyBasicSSP: 1.1.1.3.2.14.1, 1.2.1.1.1.14.1
era-sh:ETCSShape sh:sparql era-sh:OtherCantDeficiencyBasicSSPSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:OtherCantDeficiencyBasicSSPSKOS.
era-sh:OtherCantDeficiencyBasicSSPSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:otherCantDeficiencyBasicSSP;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Essential information for drivers of trains with a worse (lower) tolerated cant deficiency than those for which the ETCS trackside provides SSP (Static Speed Profiles) in conjunction with parameter 'Cant Deficiency used for the basic SSP'. "@en ;
	era:rinfIndex "1.1.1.3.2.14.1" , "1.2.1.1.1.14.1" ;
	sh:message "otherCantDeficiencyBasicSSP (1.1.1.3.2.14.1, 1.2.1.1.1.14.1): The ETCS or subset {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/cant-deficiencies/CantDeficiencies."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:otherCantDeficiencyBasicSSP AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:otherCantDeficiencyBasicSSP ?concept .
        era:otherCantDeficiencyBasicSSP era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# otherCantDeficiencyBasicSSP: 1.1.1.3.2.14.1, 1.2.1.1.1.14.1
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:OtherCantDeficiencyBasicSSPApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:OtherCantDeficiencyBasicSSPApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:OtherCantDeficiencyBasicSSPApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:OtherCantDeficiencyBasicSSPApplicability .
era-sh:OtherCantDeficiencyBasicSSPApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:otherCantDeficiencyBasicSSP;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.14.1" , "1.2.1.1.1.14.1" ;
	sh:message "otherCantDeficiencyBasicSSP (1.1.1.3.2.14.1, 1.2.1.1.1.14.1):The ETCS or subset {$this} ({?thisLabel}), has an  'ETCS Level Type' defined which makes the otherCantDeficiencyBasicSSP parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:otherCantDeficiencyBasicSSP AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:otherCantDeficiencyBasicSSP ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:otherCantDeficiencyBasicSSP } .
    }
    """ .

# legacyRadioSystem: 1.1.1.3.6.1, 1.2.1.1.5.1
era-sh:RunningTrackShape sh:property era-sh:LegacyRadioSystem.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:LegacyRadioSystem.
era-sh:LegacyRadioSystem
	a sh:PropertyShape ;
    era:affectedProperty era:legacyRadioSystem;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication of radio legacy systems installed. "@en ;
	era:rinfIndex "1.1.1.3.6.1" ,"1.2.1.1.5.1" ;
	sh:path era:legacyRadioSystem ;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "legacyRadioSystem (1.1.1.3.6.1, 1.2.1.1.5.1): The track may have other radio systems installed (Radio Legacy Systems) value that is an IRI. This error is due to having a value that is not an IRI"@en .	

# legacyRadioSystem: 1.1.1.3.6.1, 1.2.1.1.5.1
era-sh:RunningTrackShape sh:sparql era-sh:LegacyRadioSystemSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:LegacyRadioSystemSKOS.
era-sh:LegacyRadioSystemSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:legacyRadioSystem;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication of radio legacy systems installed. "@en ;
	era:rinfIndex "1.1.1.3.6.1" , "1.2.1.1.5.1" ;
	sh:message "legacyRadioSystem (1.1.1.3.6.1, 1.2.1.1.5.1): The track {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/legacy-radio-systems/LegacyRadioSystems."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:legacyRadioSystem AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:legacyRadioSystem ?concept .
        era:legacyRadioSystem era:inSkosConceptScheme ?conceptScheme .
        FILTER (NOT EXISTS {?concept skos:inScheme ?conceptScheme} || REGEX(STR(?concept), "/eratv/"))
	}
""" .

# otherTrainProtection: 1.1.1.3.10.2, 1.2.1.1.9.2
era-sh:RunningTrackShape sh:property era-sh:OtherTrainProtection.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:OtherTrainProtection.
era-sh:OtherTrainProtection
	a sh:PropertyShape ;
    era:affectedProperty era:otherTrainProtection;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication of existence of other system than ETCS for degraded situation. "@en ;
	era:rinfIndex "1.1.1.3.10.2" , "1.2.1.1.9.2" ;
	sh:path era:otherTrainProtection ;
    sh:maxCount 1 ; # Functional property
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "otherTrainProtection (1.1.1.3.10.2, 1.2.1.1.9.2): The track may have other train protection, control and warning systems for degraded situation value that is an IRI. This error is due to having more than one value or having a value that is not an IRI."@en .	

# otherTrainProtection: 1.1.1.3.10.2, 1.2.1.1.9.2
era-sh:RunningTrackShape sh:sparql era-sh:OtherTrainProtectionSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:OtherTrainProtectionSKOS.
era-sh:OtherTrainProtectionSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:otherTrainProtection;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication of existence of other system than ETCS for degraded situation. "@en ;
	era:rinfIndex "1.1.1.3.10.2" , "1.2.1.1.9.2" ;
	sh:message "otherTrainProtection (1.1.1.3.10.2, 1.2.1.1.9.2): The track {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/other-protection-control-warning/OtherProtectionControlWarnings."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:otherTrainProtection AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:otherTrainProtection ?concept .
        era:otherTrainProtection era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# otherTrainProtection: 1.1.1.3.10.2, 1.2.1.1.9.2
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:OtherTrainProtectionApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:OtherTrainProtectionApplicability .
era-sh:OtherTrainProtectionApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:otherTrainProtection;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.10.2" , "1.2.1.1.9.2" ;
	sh:message "otherTrainProtection (1.1.1.3.10.2, 1.2.1.1.9.2):The track {$this} ({?label}), has an  'ETCS Level Type' defined which makes the otherTrainProtection parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:otherTrainProtection AS ?path)
			WHERE {
                 $this era:etcs ?etcs.
				 ?etcs era:etcsLevelType ?etcsType.
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
                FILTER NOT EXISTS {$this era:otherTrainProtection ?value} . 
				FILTER NOT EXISTS {$this era:notYetAvailable era:otherTrainProtection} .
            }
			""" .

# freightCorridor: # 1.1.1.1.2.3, 1.2.1.0.2.3 
era-sh:RunningTrackShape sh:property era-sh:FreightCorridorShape.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:FreightCorridorShape.
era-sh:FreightCorridorShape
	a sh:PropertyShape ;
    era:affectedProperty era:freightCorridor;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication whether the line is designated to a Railway Freight Corridor "@en ;
	era:rinfIndex "1.1.1.1.2.3", "1.2.1.0.2.3" ;
	sh:path era:freightCorridor ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "freightCorridor (1.1.1.1.2.3, 1.2.1.0.2.3): Each track may have an indication whether the line is designated to a Railway Freight Corridor that is an IRI. This error is due to having a value that is not an IRI."@en .

# freightCorridor: # 1.1.1.1.2.3, 1.2.1.0.2.3 
era-sh:RunningTrackShape sh:sparql era-sh:FreightCorridorSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:FreightCorridorSKOS.
era-sh:FreightCorridorSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:freightCorridor;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication whether the line is designated to a Railway Freight Corridor "@en ;
	era:rinfIndex "1.1.1.1.2.3", "1.2.1.0.2.3" ;
	sh:message "Indication whether the line is designated to a Railway Freight Corridor (1.1.1.1.2.3, 1.2.1.0.2.3): The National Line {$this} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/freight-corridor/FreightCorridors."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    SELECT $this ?concept (era:freightCorridor AS ?path)
    WHERE {
 		$this era:freightCorridor ?concept .
        era:freightCorridor era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# qNvdriverAdhes: 1.1.1.3.2.16.11, 1.2.1.1.1.16.11
era-sh:ETCSShape sh:property era-sh:QNvdriverAdhes.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:QNvdriverAdhes.
era-sh:QNvdriverAdhes
	a sh:PropertyShape ;
    era:affectedProperty era:qNvdriverAdhes;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Qualifier determining whether the driver is allowed to modify the adhesion factor used by the ETCS on-board to calculate the braking curves. "@en ;
	era:rinfIndex "1.1.1.3.2.16.11" , "1.2.1.1.1.16.11" ;
	sh:path era:qNvdriverAdhes ;
    sh:maxCount 1 ; # Functional property
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "qNvdriverAdhes (1.1.1.3.2.16.11, 1.2.1.1.1.16.11): The ETCS or subset must have a single Q_NVDRIVER_ADHES value that is an IRI. This error is due to having more than one value or having a value that is not an IRI."@en .	

# qNvdriverAdhes: 1.1.1.3.2.16.11, 1.2.1.1.1.16.11
era-sh:ETCSShape sh:sparql era-sh:QNvdriverAdhesSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:QNvdriverAdhesSKOS.
era-sh:QNvdriverAdhesSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:qNvdriverAdhes;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Qualifier determining whether the driver is allowed to modify the adhesion factor used by the ETCS on-board to calculate the braking curves. "@en ;
	era:rinfIndex "1.1.1.3.2.16.11" , "1.2.1.1.1.16.11" ;
	sh:message "qNvdriverAdhes (1.1.1.3.2.16.11, 1.2.1.1.1.16.11): The ETCS or subset {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/adhf-qualifier/AdhesionFactorChange."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:qNvdriverAdhes AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:qNvdriverAdhes ?concept .
        era:qNvdriverAdhes era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# qNvdriverAdhes: 1.1.1.3.2.16.11, 1.2.1.1.1.16.11
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:QNvdriverAdhesApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:QNvdriverAdhesApplicability .
era-sh:ETCSShapeWarning   sh:sparql era-sh:QNvdriverAdhesApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:QNvdriverAdhesApplicability .
era-sh:QNvdriverAdhesApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:qNvdriverAdhes;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.16.11" , "1.2.1.1.1.16.11" ;
	sh:message "qNvdriverAdhes (1.1.1.3.2.16.11, 1.2.1.1.1.16.11):The ETCS or subset {$this} ({?thisLabel}), has an  'ETCS Level Type' defined which makes the qNvdriverAdhes parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:qNvdriverAdhes AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:qNvdriverAdhes ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:qNvdriverAdhes } .
    }
    """ .

# qNvemrrls: 1.1.1.3.2.16.2, 1.2.1.1.1.16.2
era-sh:ETCSShape sh:property era-sh:QNvemrrls.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:QNvemrrls.
era-sh:QNvemrrls
	a sh:PropertyShape ;
    era:affectedProperty era:qNvemrrls;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Qualifier defining whether the application of the emergency brake for reasons other than a trip can be revoked as soon as the conditions for it have disappeared or after the train has come to a complete standstill. "@en ;
	era:rinfIndex "1.1.1.3.2.16.2" , "1.2.1.1.1.16.2" ;
	sh:path era:qNvemrrls ;
    sh:maxCount 1 ; # Functional property
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "qNvemrrls (1.1.1.3.2.16.2, 1.2.1.1.1.16.2): The ETCS or subset must have a single Q_NVEMRRLS value that is an IRI. This error is due to having more than one value or having a value that is not an IRI."@en .	

# qNvemrrls: 1.1.1.3.2.16.2, 1.2.1.1.1.16.2
era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:QNvemrrlsSKOS .
era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:QNvemrrlsSKOS .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:QNvemrrlsSKOS .
era-sh:QNvemrrlsSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:qNvemrrls;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Qualifier defining whether the application of the emergency brake for reasons other than a trip can be revoked as soon as the conditions for it have disappeared or after the train has come to a complete standstill. "@en ;
	era:rinfIndex "1.1.1.3.2.16.2" , "1.2.1.1.1.16.2" ;
	sh:message "qNvemrrls (1.1.1.3.2.16.2, 1.2.1.1.1.16.2): The ETCS or subset {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/ebr-qualifier/EBReleaseQualifier."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:qNvemrrls AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:qNvemrrls ?concept .
        era:qNvemrrls era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# qNvemrrls: 1.1.1.3.2.16.2, 1.2.1.1.1.16.2
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:QNvemrrlsApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:QNvemrrlsApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:QNvemrrlsApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:QNvemrrlsApplicability .
era-sh:QNvemrrlsApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:qNvemrrls;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when parameter 1.1.1.3.2.1 is applicable (its Applicable: 'Y'). "@en ;
	era:rinfIndex "1.1.1.3.2.16.2" , "1.2.1.1.1.16.2" ;
	sh:message "qNvemrrls (1.1.1.3.2.16.2, 1.2.1.1.1.16.2):The ETCS or subset {$this} ({?thisLabel}), has an  'ETCS Level Type' defined which makes the qNvemrrls parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:qNvemrrls AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:qNvemrrls ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:qNvemrrls } .
    }
    """ .


# qNvsbtsmperm: 1.1.1.3.2.16.12, 1.2.1.1.1.16.12
era-sh:ETCSShape sh:property era-sh:QNvsbtsmperm.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:QNvsbtsmperm.
era-sh:QNvsbtsmperm
	a sh:PropertyShape;
    era:affectedProperty era:qNvsbtsmperm ;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Permission to use service brake in target speed monitoring. "@en ; 
	era:rinfIndex "1.1.1.3.2.16.12" , "1.2.1.1.1.16.12" ;
	sh:path era:qNvsbtsmperm ;
	sh:maxCount 1 ; # Functional property
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "qNvsbtsmperm (1.1.1.3.2.16.12, 1.2.1.1.1.16.12): Each ETCS or subset may define the Q_NVSBTSMPERM value. This error is due to having more than one  value or having a value that is not Y/N (boolean)."@en .

# qNvsbtsmperm: 1.1.1.3.2.16.12, 1.2.1.1.1.16.12
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:QNvsbtsmpermApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:QNvsbtsmpermApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:QNvsbtsmpermApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:QNvsbtsmpermApplicability .
era-sh:QNvsbtsmpermApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:qNvsbtsmperm;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.16.12" , "1.2.1.1.1.16.12" ;
	sh:message "qNvsbtsmperm (1.1.1.3.2.16.12, 1.2.1.1.1.16.12):The ETCS or subset {$this} ({?thisLabel}), has an  'ETCS Level Type' defined which makes the qNvsbtsmperm parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:qNvsbtsmperm AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:qNvsbtsmperm ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:qNvsbtsmperm } .
    }
    """ .

# radioNetworkId: 1.1.1.3.3.12, 1.2.1.1.2.13
era-sh:RunningTrackShape sh:property era-sh:RadioNetworkId.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:RadioNetworkId.
era-sh:RadioNetworkId
	a sh:PropertyShape ;
    era:affectedProperty era:radioNetworkId;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Unique identification of the GSM-R network the calling mobile station has to register with, as defined in the specification referenced in TSI CCS. "@en ;
	era:rinfIndex "1.1.1.3.3.12" , "1.2.1.1.2.13" ;
	sh:path era:radioNetworkId ;
	sh:datatype xsd:string ;
	sh:pattern "^([1-9]\\d{0,5}|0)$" ; 
	sh:severity sh:Violation ;
	sh:message "radioNetworkId (1.1.1.3.3.12, 1.2.1.1.2.13): The track has a Radio Network ID that must be a string and follow the format [NNNNNN]. The error is due to the value not being a string or not following the pattern."@en .

# radioNetworkId: 1.1.1.3.3.12, 1.2.1.1.2.13
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:RadioNetworkIdApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:RadioNetworkIdApplicability .
era-sh:RadioNetworkIdApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:radioNetworkId;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "GSM-R (parameter 1.1.1.3.3.1) must be installed for this parameter to be applicable. "@en ;
	era:rinfIndex "1.1.1.3.3.12" , "1.2.1.1.2.13" ;
	sh:message "radioNetworkId (1.1.1.3.3.12, 1.2.1.1.2.13):The track {$this} ({?label}), has a 'GSM-R version' defined which makes the radioNetworkId parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:radioNetworkId AS ?path)
			WHERE {
                 $this era:gsmRVersion ?gsmRVersion.
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
                FILTER NOT EXISTS {$this era:radioNetworkId ?value} . 
				FILTER NOT EXISTS {$this era:notYetAvailable era:radioNetworkId} .
            }
			""" .

# dataRadioCompatible: 1.1.1.3.3.10, 1.2.1.1.2.10
era-sh:RunningTrackShape sh:property era-sh:DataRadioCompatible.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:DataRadioCompatible.
era-sh:DataRadioCompatible
	a sh:PropertyShape ;
    era:affectedProperty era:dataRadioCompatible;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Radio requirements used for demonstrating technical compatibility data. "@en ;
	era:rinfIndex "1.1.1.3.3.10" , "1.2.1.1.2.10" ;
	sh:path era:dataRadioCompatible ;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "dataRadioCompatible (1.1.1.3.3.10, 1.2.1.1.2.10): The track may have a radio system compatibility data value that is an IRI. This error is due to having a  value that is not an IRI."@en .	

# dataRadioCompatible: 1.1.1.3.3.10, 1.2.1.1.2.10
era-sh:RunningTrackShape sh:sparql era-sh:DataRadioCompatibleSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:DataRadioCompatibleSKOS.
era-sh:DataRadioCompatibleSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:dataRadioCompatible;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Radio requirements used for demonstrating technical compatibility data. "@en ;
	era:rinfIndex "1.1.1.3.3.10" , "1.2.1.1.2.10" ;
	sh:message "dataRadioCompatible (1.1.1.3.3.10, 1.2.1.1.2.10): The track {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/radio-system-compatibilities-data/RadioSystemCompatibilitiesData."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:dataRadioCompatible AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:dataRadioCompatible ?concept .
        era:dataRadioCompatible era:inSkosConceptScheme ?conceptScheme .
        FILTER (NOT EXISTS {?concept skos:inScheme ?conceptScheme} || REGEX(STR(?concept), "/eratv/"))
	}
""" .

# dataRadioCompatible: 1.1.1.3.3.10, 1.2.1.1.2.10
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:DataRadioCompatibleApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:DataRadioCompatibleApplicability .
era-sh:DataRadioCompatibleApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:dataRadioCompatible;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "GSM-R (parameter 1.1.1.3.3.1) and ETCS L2 (parameter 1.1.1.3.2.1) must be installed for this parameter to be applicable. "@en ;
	era:rinfIndex "1.1.1.3.3.10" , "1.2.1.1.2.10" ;
	sh:message "dataRadioCompatible (1.1.1.3.3.10, 1.2.1.1.2.10):The track {$this} ({?label}), has a 'GSM-R version' defined and a 'ETCS level' type selected which makes the dataRadioCompatible parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:dataRadioCompatible AS ?path)
			WHERE {
                 $this era:gsmRVersion ?gsmRVersion;
				 	   era:etcs ?etcs.
				 ?etcs era:etcsLevelType ?etcsType.
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
                FILTER NOT EXISTS {$this era:dataRadioCompatible ?value} . 
				FILTER NOT EXISTS {$this era:notYetAvailable era:dataRadioCompatible} .
            }
			""" .

# voiceRadioCompatible: 1.1.1.3.3.9, 1.2.1.1.2.9
era-sh:RunningTrackShape sh:property era-sh:VoiceRadioCompatible.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:VoiceRadioCompatible.
era-sh:VoiceRadioCompatible
	a sh:PropertyShape ;
    era:affectedProperty era:voiceRadioCompatible;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Radio requirements used for demonstrating technical compatibility voice. "@en ;
	era:rinfIndex "1.1.1.3.3.9" , "1.2.1.1.2.9" ;
	sh:path era:voiceRadioCompatible ;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "voiceRadioCompatible (1.1.1.3.3.9, 1.2.1.1.2.9): The track may have a radio system compatibility voice value that is an IRI. This error is due to having a  value that is not an IRI."@en .	

# voiceRadioCompatible: 1.1.1.3.3.9, 1.2.1.1.2.9
era-sh:RunningTrackShape sh:sparql era-sh:VoiceRadioCompatibleSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:VoiceRadioCompatibleSKOS.
era-sh:VoiceRadioCompatibleSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:voiceRadioCompatible;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Radio requirements used for demonstrating technical compatibility voice. "@en ;
	era:rinfIndex "1.1.1.3.3.9" , "1.2.1.1.2.9" ;
	sh:message "voiceRadioCompatible (1.1.1.3.3.9, 1.2.1.1.2.9): The track {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/radio-system-compatibilities-voice/RadioSystemCompatibilitiesVoice."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:voiceRadioCompatible AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:voiceRadioCompatible ?concept .
        era:voiceRadioCompatible era:inSkosConceptScheme ?conceptScheme .
        FILTER (NOT EXISTS {?concept skos:inScheme ?conceptScheme} || REGEX(STR(?concept), "/eratv/"))
	}
""" .

# voiceRadioCompatible: 1.1.1.3.3.9, 1.2.1.1.2.9
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:VoiceRadioCompatibleApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:VoiceRadioCompatibleApplicability .
era-sh:VoiceRadioCompatibleApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:voiceRadioCompatible;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "GSM-R (parameter 1.1.1.3.3.1) must be installed for this parameter to be applicable. "@en ;
	era:rinfIndex "1.1.1.3.3.9" , "1.2.1.1.2.9" ;
	sh:message "voiceRadioCompatible (1.1.1.3.3.9, 1.2.1.1.2.9):The track {$this} ({?label}), has a 'GSM-R version' defined which makes the voiceRadioCompatible parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:voiceRadioCompatible AS ?path)
			WHERE {
                 $this era:gsmRVersion ?gsmRVersion.
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
                FILTER NOT EXISTS {$this era:voiceRadioCompatible ?value} . 
            }
			""" .

# errorCorrectionsOnboardExplanation: 1.1.1.3.1.2, 1.2.1.1.1.19
era-sh:RunningTrackShape sh:property era-sh:ErrorCorrectionsOnboardExplanation.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:ErrorCorrectionsOnboardExplanation.
era-sh:ErrorCorrectionsOnboardExplanation
	a sh:PropertyShape ;
    era:affectedProperty era:errorCorrectionsOnboardExplanation;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Explanation on why a mandatory onboard CR required to be solved in the on-board (ETCS, GSM-R and/or ATO) was accepted by the IM. "@en ;
	era:rinfIndex "1.1.1.3.1.2" , "1.2.1.1.1.19" ;
	sh:path era:errorCorrectionsOnboardExplanation ;
    sh:maxCount 1 ; 
	sh:datatype xsd:string ;
	sh:severity sh:Violation ;
	sh:message "errorCorrectionsOnboardExplanation (1.1.1.3.1.2, 1.2.1.1.1.19): The errorCorrectionsOnboardExplanation must be a string. This error is due to having more than one value or having a value that is not a string."@en .

# reasonsEtcsRadioBlockCenterReject: 1.1.1.3.2.15, 1.2.1.1.1.15
era-sh:ETCSShape sh:property era-sh:ReasonsEtcsRadioBlockCenterReject.
era-sh:ReasonsEtcsRadioBlockCenterReject
	a sh:PropertyShape ;
    era:affectedProperty era:reasonsEtcsRadioBlockCenterReject;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "List of cases subject to system design choices made by the infrastructure manager according to the specification referenced in TSI CCS. "@en ;
	era:rinfIndex "1.1.1.3.2.15" , "1.2.1.1.1.15" ;
	sh:path era:reasonsEtcsRadioBlockCenterReject ;
    sh:maxCount 1 ; # Functional property
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "reasonsEtcsRadioBlockCenterReject (1.1.1.3.2.15, 1.2.1.1.1.15): The ETCS or subset must have a single reasons for which an ETCS Radio Block Center can reject a train value that is an IRI. This error is due to having more than one value or having a value that is not an IRI."@en .	

# reasonsEtcsRadioBlockCenterReject: 1.1.1.3.2.15, 1.2.1.1.1.15
era-sh:ETCSShape sh:sparql era-sh:ReasonsEtcsRadioBlockCenterRejectSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:ReasonsEtcsRadioBlockCenterRejectSKOS.
era-sh:ReasonsEtcsRadioBlockCenterRejectSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:reasonsEtcsRadioBlockCenterReject;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "List of cases subject to system design choices made by the infrastructure manager according to the specification referenced in TSI CCS. "@en ;
	era:rinfIndex "1.1.1.3.2.15" , "1.2.1.1.1.15" ;
	sh:message "reasonsEtcsRadioBlockCenterReject (1.1.1.3.2.15, 1.2.1.1.1.15): The ETCS or subset {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/etcs-rbc-reject-reasons/ETCSRBCRejectionReasons."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:reasonsEtcsRadioBlockCenterReject AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:reasonsEtcsRadioBlockCenterReject ?concept .
        era:reasonsEtcsRadioBlockCenterReject era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# reasonsEtcsRadioBlockCenterReject: 1.1.1.3.2.15 , 1.2.1.1.1.15
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:ReasonsEtcsRadioBlockCenterRejectApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:ReasonsEtcsRadioBlockCenterRejectApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:ReasonsEtcsRadioBlockCenterRejectApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:ReasonsEtcsRadioBlockCenterRejectApplicability .
era-sh:ReasonsEtcsRadioBlockCenterRejectApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:reasonsEtcsRadioBlockCenterReject;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.15" , "1.2.1.1.1.15" ;
	sh:message "reasonsEtcsRadioBlockCenterReject (1.1.1.3.2.15 , 1.2.1.1.1.15): The ETCS or subset {$this} ({?thisLabel}), has a ETCS level type which makes the reasonsEtcsRadioBlockCenterReject parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
	sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:reasonsEtcsRadioBlockCenterReject AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:reasonsEtcsRadioBlockCenterReject ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:reasonsEtcsRadioBlockCenterReject } .
    }
    """ .

# safeConsistLengthInformationNecessary: 1.1.1.3.2.11, 1.2.1.1.1.11
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:SafeConsistLengthInformationNecessary.
era-sh:RunningTrackShape sh:property era-sh:SafeConsistLengthInformationNecessary.
era-sh:SafeConsistLengthInformationNecessary
	a sh:PropertyShape ;
    era:affectedProperty era:safeConsistLengthInformationNecessary;
    era:affectedClass era:RunningTrack ;
    era:scope "local";
	rdfs:comment "Indication whether safe consist train length information from on-board is required to access the line for safety reasons and the required safety integrity level. "@en ;
	era:rinfIndex "1.1.1.3.2.11" , "1.2.1.1.1.11" ;
	sh:path era:safeConsistLengthInformationNecessary ;
    sh:maxCount 1 ; # Functional property
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "safeConsistLengthInformationNecessary (1.1.1.3.2.11, 1.2.1.1.1.11): The ETCS or subset must have a single Safe consist length information from on-board necessary for access the line and SIL value that is an IRI. This error is due to having more than one value or having a value that is not an IRI."@en .	

# safeConsistLengthInformationNecessary: 1.1.1.3.2.11, 1.2.1.1.1.11
era-sh:ETCSShape sh:sparql era-sh:SafeConsistLengthInformationNecessarySKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:SafeConsistLengthInformationNecessarySKOS.
era-sh:SafeConsistLengthInformationNecessarySKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:safeConsistLengthInformationNecessary;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Indication whether safe consist train length information from on-board is required to access the line for safety reasons and the required safety integrity level. "@en ;
	era:rinfIndex "1.1.1.3.2.11" , "1.2.1.1.1.11" ;
	sh:message "safeConsistLengthInformationNecessary (1.1.1.3.2.11, 1.2.1.1.1.11): The ETCS or subset {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/safe-consist-length/SafeConsistLengthNecessary."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:safeConsistLengthInformationNecessary AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:safeConsistLengthInformationNecessary ?concept .
        era:safeConsistLengthInformationNecessary era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# safeConsistLengthInformationNecessary: 1.1.1.3.2.11, 1.2.1.1.1.11
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:SafeConsistLengthInformationNecessaryApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:SafeConsistLengthInformationNecessaryApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:SafeConsistLengthInformationNecessaryApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:SafeConsistLengthInformationNecessaryApplicability .
era-sh:SafeConsistLengthInformationNecessaryApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:safeConsistLengthInformationNecessary;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when parameter 1.1.1.3.2.1 is applicable (its Applicable: 'Y'). "@en ;
	era:rinfIndex "1.1.1.3.2.11" , "1.2.1.1.1.11" ;
	sh:message "safeConsistLengthInformationNecessary (1.1.1.3.2.11, 1.2.1.1.1.11):The ETCS or subset {$this} ({?thisLabel}), has an  'ETCS Level Type' defined which makes the safeConsistLengthInformationNecessary parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:safeConsistLengthInformationNecessary AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:safeConsistLengthInformationNecessary ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:safeConsistLengthInformationNecessary } .
    }
    """ .

# conditionsSwitchTrainProtectionSystems: 1.1.1.3.8.1.1, 1.2.1.1.7.1.1
era-sh:RunningTrackShape sh:property era-sh:ConditionsSwitchTrainProtectionSystems.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:ConditionsSwitchTrainProtectionSystems.
era-sh:ConditionsSwitchTrainProtectionSystems
	a sh:PropertyShape ;
    era:affectedProperty era:conditionsSwitchTrainProtectionSystems;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Conditions to switch over between different class B train protection, control and warning systems. "@en ;
	era:rinfIndex "1.1.1.3.8.1.1", "1.2.1.1.7.1.1" ;
	sh:path era:conditionsSwitchTrainProtectionSystems ;
	sh:datatype xsd:string ;
	# sh:pattern "[1-9]\\d{0,2}|0" ; # Non-harmonisable
    sh:maxCount 1 ; # Functional property
	sh:severity sh:Violation ;
	sh:message "conditionsSwitchTrainProtectionSystems (1.1.1.3.8.1.1, 1.2.1.1.7.1.1): The track has a Special conditions to switch over between different class B train protection, control and warning systems value that must be a string and follow the format [NNN]. The error is due to having more than one value, having a value that is not a string, or it is due to the value not following the pattern."@en .

# instructionsSwitchRadioSystems: 1.1.1.3.8.2.1, 1.2.1.1.7.2.1
era-sh:RunningTrackShape sh:property era-sh:InstructionsSwitchRadioSystems.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:InstructionsSwitchRadioSystems.
era-sh:InstructionsSwitchRadioSystems
	a sh:PropertyShape ;
    era:affectedProperty era:instructionsSwitchRadioSystems;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Name and/or reference of the document specifying the Special instructions to switch over between different radio systems. "@en ;
	era:rinfIndex "1.1.1.3.8.2.1" , "1.2.1.1.7.2.1" ;
	sh:path era:instructionsSwitchRadioSystems ;
	sh:class era:Document ;
    # sh:maxCount 1 ; # Functional property?
	sh:severity sh:Violation ;
	sh:message "instructionsSwitchRadioSystems (1.1.1.3.8.2.1, 1.2.1.1.7.2.1): The track has Special instructions to switch over between different radio systems value that must be a Document."@en .

# instructionsSwitchRadioSystems: 1.1.1.3.8.2.1, 1.2.1.1.7.2.1
# era-sh:RunningTrackShape sh:sparql era-sh:InstructionsSwitchRadioSystemsApplicability .
era-sh:RunningTrackShapeWarning sh:sparql era-sh:InstructionsSwitchRadioSystemsApplicability .
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:InstructionsSwitchRadioSystemsApplicability.
era-sh:InstructionsSwitchRadioSystemsApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:instructionsSwitchRadioSystems;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Applicable ('Y') when at least two different radio systems exist. "@en ;
	era:rinfIndex "1.1.1.3.8.2.1" , "1.2.1.1.7.2.1" ;
	sh:message "instructionsSwitchRadioSystems (1.1.1.3.8.2.1, 1.2.1.1.7.2.1):The track {$this} ({?label}), has a more than one radio system defined which makes the instructionsSwitchRadioSystems parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label ?countRS (era:instructionsSwitchRadioSystems AS ?path)
			WHERE {
				{
				SELECT $this (COUNT(?radioSystem) AS ?countRS) WHERE{
	            	$this era:legacyRadioSystem ?radioSystem					
					} GROUP BY $this
				}
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
				FILTER ( ?countRS > 1) .
                FILTER NOT EXISTS {$this era:instructionsSwitchRadioSystems ?value} . 
            }
			""" .

# conditionsSwitchClassBSystems: 1.1.1.3.8.3, 1.2.1.1.7.3
era-sh:RunningTrackShape sh:property era-sh:ConditionsSwitchClassBSystems.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:ConditionsSwitchClassBSystems.
era-sh:ConditionsSwitchClassBSystems
	a sh:PropertyShape ;
    era:affectedProperty era:conditionsSwitchClassBSystems;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Name and/or reference of the document specifying the Special technical conditions required to switch over between ERTMS/ETCS and Class B systems. "@en ;
	era:rinfIndex "1.1.1.3.8.3" , "1.2.1.1.7.3" ;
	sh:path era:conditionsSwitchClassBSystems ;
	sh:class era:Document ;
    sh:maxCount 1 ; 
	sh:severity sh:Violation ;
	sh:message "conditionsSwitchClassBSystems (1.1.1.3.8.3, 1.2.1.1.7.3): The track has Special technical conditions required to switch over between ERTMS/ETCS and Class B systems value that must be a Document.  This error is due to having more than one value or having a value that is not an instance of Document."@en .

# conditionsSwitchClassBSystems: 1.1.1.3.8.3, 1.2.1.1.7.3
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:ConditionsSwitchClassBSystemsApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:ConditionsSwitchClassBSystemsApplicability .
era-sh:ConditionsSwitchClassBSystemsApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:conditionsSwitchClassBSystems;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Applicable ('Y') when at least two different class of protection systems exist. "@en ;
	era:rinfIndex "1.1.1.3.8.3" , "1.2.1.1.7.3" ;
	sh:message "conditionsSwitchClassBSystems (1.1.1.3.8.3, 1.2.1.1.7.3):The track {$this} ({?label}), has a more than one protection system defined which makes the conditionsSwitchClassBSystems parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label ?count (era:conditionsSwitchClassBSystems AS ?path)
			WHERE {
				{
				SELECT $this (COUNT(?system) AS ?count) WHERE{
					{$this era:protectionLegacySystem ?system}
					UNION
					{$this era:otherTrainProtection ?system}					
					} GROUP BY $this
				}
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
				FILTER ( ?count > 1) .
                FILTER NOT EXISTS {$this era:conditionsSwitchClassBSystems ?value} . 
				FILTER NOT EXISTS {$this era:notYetAvailable era:conditionsSwitchClassBSystems} .
            }
			""" .





# tNvovtrp: 1.1.1.3.2.16.6, 1.2.1.1.1.16.6
era-sh:ETCSShape sh:property era-sh:TNvovtrp.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:TNvovtrp.
era-sh:TNvovtrp
	a sh:PropertyShape ;
    era:affectedProperty era:tNvovtrp;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Maximum time for overriding the train trip in seconds. "@en ;
	era:rinfIndex "1.1.1.3.2.16.6" , "1.2.1.1.1.16.6" ;
	sh:path era:tNvovtrp ;
    sh:maxCount 1 ; # Functional property
	sh:datatype xsd:integer ;
	sh:pattern "^([1-9]\\d{0,2}|0)$" ;
	sh:severity sh:Violation ;
	sh:message "tNvovtrp (1.1.1.3.2.16.6 , 1.2.1.1.1.16.6): The ETCS or subset defines a T_NVOVTRP. This error is due to having more than one value, having a value that is not an integer or having an integer that does not follow the pattern [NNN]."@en .

# tNvovtrp: 1.1.1.3.2.16.6, 1.2.1.1.1.16.6
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:TNvovtrpApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:TNvovtrpApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:TNvovtrpApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:TNvovtrpApplicability .
era-sh:TNvovtrpApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:tNvovtrp;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.16.6" , "1.2.1.1.1.16.6" ;
	sh:message "tNvovtrp (1.1.1.3.2.16.6, 1.2.1.1.1.16.6):The ETCS or subset {$this} ({?thisLabel}), has an  'ETCS Level Type' defined which makes the tNvovtrp parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:tNvovtrp AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:tNvovtrp ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:tNvovtrp } .
    }
    """ .

# trainIntegrityOnBoardRequired: 1.1.1.3.2.8, 1.2.1.1.1.8
era-sh:ETCSShape sh:property era-sh:TrainIntegrityOnBoardRequired.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:TrainIntegrityOnBoardRequired.
era-sh:TrainIntegrityOnBoardRequired
	a sh:PropertyShape ;
    era:affectedProperty era:trainIntegrityOnBoardRequired;
    era:affectedClass era:ETCS;
    era:scope "local";
    rdfs:comment "Indication whether train confirmation from on-board is required to access the line for safety reasons."@en ;
    era:rinfIndex "1.1.1.3.2.8" , "1.2.1.1.1.8" ;
	sh:path era:trainIntegrityOnBoardRequired ;
    sh:datatype xsd:boolean ;
    sh:maxCount 1 ; # Functional property
	sh:severity sh:Violation ;
    sh:message "trainIntegrityOnBoardRequired (1.1.1.3.2.8, 1.2.1.1.1.8): value must be xsd:boolean (true/false) and at most one value is allowed."@en .

# trainIntegrityOnBoardRequired: 1.1.1.3.2.8 , 1.2.1.1.1.8
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:TrainIntegrityOnBoardRequiredApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:TrainIntegrityOnBoardRequiredApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:TrainIntegrityOnBoardRequiredApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:TrainIntegrityOnBoardRequiredApplicability .
era-sh:TrainIntegrityOnBoardRequiredApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:trainIntegrityOnBoardRequired;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.8" , "1.2.1.1.1.8" ;
	sh:message "trainIntegrityOnBoardRequired (1.1.1.3.2.8 , 1.2.1.1.1.8): The ETCS or subset {$this} ({?thisLabel}), has a ETCS level type which makes the trainIntegrityOnBoardRequired parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
	sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:trainIntegrityOnBoardRequired AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:trainIntegrityOnBoardRequired ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:trainIntegrityOnBoardRequired } .
    }
    """ .


# eddyCurrentBraking: 1.1.1.1.6.2, 1.2.1.0.4.2
era-sh:RunningTrackShape sh:property era-sh:EddyCurrentBraking.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:EddyCurrentBraking.
era-sh:EddyCurrentBraking
	a sh:PropertyShape ;
    era:affectedProperty era:eddyCurrentBraking;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication of limitations on the use of eddy current brakes. "@en ;
	era:rinfIndex "1.1.1.1.6.2" , "1.2.1.0.4.2" ;
	sh:path era:eddyCurrentBraking ;
    # sh:minCount 1 ; # TODO: Not yet applicable
    sh:maxCount 1 ; # Functional property
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "eddyCurrentBraking (1.1.1.1.6.2, 1.2.1.0.4.2): The track must have a single use of eddy current brakes value that is an IRI. This error is due to having more than one value or having a value that is not an IRI."@en .	

# eddyCurrentBraking: 1.1.1.1.6.2, 1.2.1.0.4.2
era-sh:RunningTrackShape sh:sparql era-sh:EddyCurrentBrakingSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:EddyCurrentBrakingSKOS.
era-sh:EddyCurrentBrakingSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:eddyCurrentBraking;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication of limitations on the use of eddy current brakes. "@en ;
	era:rinfIndex "1.1.1.1.6.2" , "1.2.1.0.4.2" ;
	sh:message "eddyCurrentBraking (1.1.1.1.6.2, 1.2.1.0.4.2): The track {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/eddy-current-braking/EddyCurrentBraking."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:eddyCurrentBraking AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:eddyCurrentBraking ?concept .
        era:eddyCurrentBraking era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# magneticBraking: 1.1.1.1.6.3, 1.2.1.0.4.3
era-sh:RunningTrackShape sh:property era-sh:MagneticBraking.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:MagneticBraking.
era-sh:MagneticBraking
	a sh:PropertyShape ;
    era:affectedProperty era:magneticBraking;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication of limitations on the use of magnetic brakes. "@en ;
	era:rinfIndex "1.1.1.1.6.3" , "1.2.1.0.4.3" ;
	sh:path era:magneticBraking ;
    # sh:minCount 1 ; # TODO: Not yet applicable
    sh:maxCount 1 ; # Functional property
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "magneticBraking (1.1.1.1.6.3, 1.2.1.0.4.3): The track must have a single use of magnetic brakes value that is an IRI. This error is due to having more than one value or having a value that is not an IRI."@en .	

# magneticBraking: 1.1.1.1.6.3, 1.2.1.0.4.3
era-sh:RunningTrackShape sh:sparql era-sh:MagneticBrakingSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:MagneticBrakingSKOS.
era-sh:MagneticBrakingSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:magneticBraking;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication of limitations on the use of magnetic brakes. "@en ;
	era:rinfIndex "1.1.1.1.6.3" , "1.2.1.0.4.3" ;
	sh:message "magneticBraking (1.1.1.1.6.3, 1.2.1.0.4.3): The track {$this} (label {?label}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/magnetic-braking/MagneticBraking."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept ?label (era:magneticBraking AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        $this era:magneticBraking ?concept .
        era:magneticBraking era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# vNvallowovtrp: 1.1.1.3.2.16.3, 1.2.1.1.1.16.3
era-sh:ETCSShape sh:property era-sh:VNvallowovtrp.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:VNvallowovtrp.
era-sh:VNvallowovtrp
	a sh:PropertyShape ;
    era:affectedProperty era:vNvallowovtrp;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Speed limit allowing the driver to select the “override” function in km/h. "@en ;
	era:rinfIndex "1.1.1.3.2.16.3" , "1.2.1.1.1.16.3" ;
	sh:path era:vNvallowovtrp ;
    sh:maxCount 1 ; # Functional property
    sh:minInclusive 0;
	sh:maxInclusive 600 ;
	sh:datatype xsd:unsignedInt ;
	sh:pattern "^([1-9]\\d{0,1}[0,5]|[0,5])$" ;
	sh:severity sh:Violation ;
	sh:message "vNvallowovtrp (1.1.1.3.2.16.3, 1.2.1.1.1.16.3): The ETCS or subset defines a speed limit allowing the driver to select the “override” function (V_NVALLOWOVTRP). This error is due to having more than one value, having a value that is not an integer or having an integer that does not follow the pattern [NNF], with N a decimal number (0÷9), F=(0|5), max. `600`."@en .

# vNvallowovtrp: 1.1.1.3.2.16.3, 1.2.1.1.1.16.3
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:VNvallowovtrpApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:VNvallowovtrpApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:VNvallowovtrpApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:VNvallowovtrpApplicability .
era-sh:VNvallowovtrpApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:vNvallowovtrp;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.16.3" , "1.2.1.1.1.16.3" ;
	sh:message "vNvallowovtrp (1.1.1.3.2.16.3, 1.2.1.1.1.16.3):The ETCS or subset {$this} ({?thisLabel}), has an  'ETCS Level Type' defined which makes the vNvallowovtrp parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:vNvallowovtrp AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:vNvallowovtrp ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:vNvallowovtrp } .
    }
    """ .

# vNvsupovtrp: 1.1.1.3.2.16.4, 1.2.1.1.1.16.4
era-sh:ETCSShape sh:property era-sh:VNvsupovtrp.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:VNvsupovtrp.
era-sh:VNvsupovtrp
	a sh:PropertyShape ;
    era:affectedProperty era:vNvsupovtrp;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Override speed limit to be supervised when the “override” function is active in km/h. "@en ;
	era:rinfIndex "1.1.1.3.2.16.4" , "1.2.1.1.1.16.4" ;
	sh:path era:vNvsupovtrp ;
    sh:maxCount 1 ; # Functional property
    sh:minInclusive 0;
	sh:maxInclusive 600 ;
	sh:datatype xsd:unsignedInt ;
	sh:pattern "^([1-9]\\d{0,1}[0,5]|[0,5])$" ;
	sh:severity sh:Violation ;
	sh:message "vNvsupovtrp (1.1.1.3.2.16.4, 1.2.1.1.1.16.4): The ETCS or subset defines a override speed limit to be supervised when the “override” function is active (V_NVSUPOVTRP). This error is due to having more than one value, having a value that is not an integer or having an integer that does not follow the pattern [NNF], with N a decimal number (0÷9), F=(0|5), max. `600`."@en .

# vNvsupovtrp: 1.1.1.3.2.16.4, 1.2.1.1.1.16.4
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:VNvsupovtrpApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:VNvsupovtrpApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:VNvsupovtrpApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:VNvsupovtrpApplicability .
era-sh:VNvsupovtrpApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:vNvsupovtrp;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.16.4" , "1.2.1.1.1.16.4" ;
	sh:message "vNvsupovtrp (1.1.1.3.2.16.4, 1.2.1.1.1.16.4):The ETCS or subset {$this} ({?thisLabel}), has an  'ETCS Level Type' defined which makes the vNvsupovtrp parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:vNvsupovtrp AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:vNvsupovtrp ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:vNvsupovtrp } .
    }
    """ .

# gsmrConstraintsOperateOnlyInCircuitSwitch: 1.2.1.1.2.12
era-sh:RunningTrackShape sh:property era-sh:GsmrConstraintsOperateOnlyInCircuitSwitch .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:GsmrConstraintsOperateOnlyInCircuitSwitch .
era-sh:GsmrConstraintsOperateOnlyInCircuitSwitch
	a sh:PropertyShape ;
    era:affectedProperty era:gsmrConstraintsOperateOnlyInCircuitSwitch ;
    era:affectedClass era:RunningTrack ;
    era:scope "local" ;
	rdfs:comment "Specific constraints imposed by the GSM-R network operator on ETCS on-board units only able to operate in circuit-switch."@en ;
	era:rinfIndex "1.2.1.1.2.12" ;
	sh:path era:gsmrConstraintsOperateOnlyInCircuitSwitch ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "gsmrConstraintsOperateOnlyInCircuitSwitch (1.2.1.1.2.12): The track may have GSM-R constraints values and each must be an IRI. This error may be due to having a value that is not an IRI."@en .

era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:GsmrConstraintsOperateOnlyInCircuitSwitchApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:GsmrConstraintsOperateOnlyInCircuitSwitchApplicability .
era-sh:GsmrConstraintsOperateOnlyInCircuitSwitchApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:gsmrConstraintsOperateOnlyInCircuitSwitch;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "GSM-R (parameter 1.1.1.3.3.1) and ETCS L2 (parameter 1.1.1.3.2.1) must be installed for this parameter to be applicable. "@en ;
	era:rinfIndex "1.2.1.1.2.12" ;
	sh:message "gsmrConstraintsOperateOnlyInCircuitSwitch (1.2.1.1.2.12):The track {$this} ({?label}), has a 'GSM-R version' defined and a 'ETCS level' type selected which makes the gsmrConstraintsOperateOnlyInCircuitSwitch parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:gsmrConstraintsOperateOnlyInCircuitSwitch AS ?path)
			WHERE {
                 $this era:gsmRVersion ?gsmRVersion;
				 	   era:etcs ?etcs.
				 ?etcs era:etcsLevelType ?etcsType.
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
                FILTER NOT EXISTS {$this era:gsmrConstraintsOperateOnlyInCircuitSwitch ?value} . 
				FILTER NOT EXISTS {$this era:notYetAvailable era:gsmrConstraintsOperateOnlyInCircuitSwitch} .
            }
			""" .


# tNvcontact: 1.1.1.3.2.16.8, 1.2.1.1.1.16.8
era-sh:ETCSShape sh:property era-sh:TNvcontact.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:TNvcontact.
era-sh:TNvcontact
	a sh:PropertyShape ;
    era:affectedProperty era:tNvcontact;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Maximum time without a safe message from Radio Block Center before train reacts in seconds. "@en ;
	era:rinfIndex "1.1.1.3.2.16.8" , "1.2.1.1.1.16.8" ;
	sh:path era:tNvcontact ;
    sh:maxCount 1 ; # Functional property
	sh:datatype xsd:integer ;
	sh:pattern "^([1-9]\\d{0,2}|0)$" ; 
	sh:severity sh:Violation ;
	sh:message "tNvcontact (1.1.1.3.2.16.8, 1.2.1.1.1.16.8): The ETCS or subset defines a maximum time without a safe message from Radio Block Center. This error is due to having more than one value, having a value that is not an integer or having an integer that does not follow the pattern [NNN]."@en .

# tNvcontact: 1.1.1.3.2.16.8, 1.2.1.1.1.16.8
# era-sh:ETCS70ShapeSPARQLWarning sh:sparql era-sh:TNvcontactApplicability .
# era-sh:ETCSNon70ShapeSPARQLViolation sh:sparql era-sh:TNvcontactApplicability .
era-sh:ETCSShapeWarning sh:sparql era-sh:TNvcontactApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:TNvcontactApplicability .
era-sh:TNvcontactApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:tNvcontact;
    era:affectedClass era:ETCS;
    era:scope "local";
	rdfs:comment "Only applicable when selected value for 1.1.1.3.2.1 (ETCS present). "@en ;
	era:rinfIndex "1.1.1.3.2.16.8" , "1.2.1.1.1.16.8" ;
	sh:message "tNvcontact (1.1.1.3.2.16.8, 1.2.1.1.1.16.8):The ETCS or subset {$this} ({?thisLabel}), has an  'ETCS Level Type' defined which makes the tNvcontact parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?thisLabel (era:tNvcontact AS ?path)
    WHERE {
        $this era:etcsLevelType ?type .
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        FILTER NOT EXISTS { $this era:tNvcontact ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:tNvcontact } .
    }
    """ .

# hasBridge: 
era-sh:RunningTrackShape sh:property era-sh:HasBridge.
era-sh:HasBridge
	a sh:PropertyShape ;
    era:affectedProperty era:hasBridge;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Whether or not a track is associated with a bridge. "@en ;
	sh:path era:hasBridge ;
	sh:datatype xsd:boolean ;
	sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "hasBridge: The track  specifies if it is associated with a bridge and the value must be boolean. This error is due to the value not being Y/N (boolean)"@en .

# contactLineSystem 1.1.1.2.2, 1.2.2.0.6.1, : 
era-sh:RunningTrackShape sh:property era-sh:ContactLineSystem.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:ContactLineSystem.
era-sh:ContactLineSystem
	a sh:PropertyShape ; era:affectedProperty era:contactLineSystem  ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
	rdfs:comment "Contact line system present in the section of line." ;
	sh:path era:contactLineSystem;
    sh:class era:ContactLineSystem;
    era:rinfIndex "1.1.1.2.2", "1.2.2.0.6.1";
    # sh:maxCount 1;
	sh:nodeKind sh:IRI;
	sh:severity sh:Violation ;
	sh:message "contactLineSystem (1.2.2.0.6.1, 1.1.1.2.2) : The track may have a value of a contact line system that must be an instance of ContactLineSystem. This error may be due to having a value that is not an instance of the class ContactLineSystem."@en .



####################################
# Rules for Sections of Line - tracks
####################################

era-sh:SectionOfLineShape  
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:SectionOfLine .

era-sh:RunningTrackShape  
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:RunningTrack .

# Created for recent properties that will be required in the future. i.e. "12 months after publication of Article 7 Guide"
era-sh:RunningTrackShapeWarning
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:severity sh:Warning ;
    sh:targetClass era:RunningTrack .

era-sh:CommonCharacteristicsSubsetShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:CommonCharacteristicsSubset .  

era-sh:LoadCapabilityShape  
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:LoadCapability .

era-sh:RaisedPantographsDistanceAndSpeedShape
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:RaisedPantographsDistanceAndSpeed .

era-sh:PhaseInfoShape
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:PhaseInfo .

era-sh:SystemSeparationInfoShape
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:SystemSeparationInfo .

era-sh:LinesideDistanceIndicationShape
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:LinesideDistanceIndication .

era-sh:SectionOfLineShape sh:property era-sh:HasPartSoL .
era-sh:HasPartSoL
	a sh:PropertyShape;
    era:affectedClass era:SectionOfLine;
    era:affectedProperty era:hasPart ;
    era:scope "local";
	rdfs:comment "Indicates that a SectionOfLine hasPart at least one Track."@en ;
	sh:path [
        sh:alternativePath (
            era:hasPart
            [ sh:inversePath era:isPartOf ] #TODO: check that this works as expected 
        )
    ] ;
    sh:qualifiedValueShape [
       sh:class era:Track
     ] ;
    sh:qualifiedMinCount 1 ;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
    sh:message "hasPart: The SectionOfLine must have at least one hasPart reference to an instance of Track."@en .

# trackId: # 1.1.1.0.0.1  
era-sh:SectionOfLineShape sh:sparql era-sh:NoRepeatedTrackIdsSoL.
era-sh:NoRepeatedTrackIdsSoL 
    a sh:SPARQLConstraint ; 
    era:affectedProperty era:trackId;
    era:affectedClass  era:SectionOfLine;
    era:affectedClass  era:RunningTrack;
    era:scope "global";
    rdfs:comment "Each track shall have unique identification or number within the SoL. This number cannot be used for naming any other track in the same SoL."@en ;
    era:rinfIndex "1.1.1.0.0.1" ;
    sh:message "trackId (1.1.1.0.0.1): Each track shall have unique identification or number within the SoL. This number cannot be used for naming any other track in the same SoL. There is a problem with SoL {$this} ({?solLabel}) and tracks {?track1} ({?track1Label}) and {?track2} ({?track2Label}), since they have the same identifier: {?value}."@en ;
    sh:prefixes era:;
    sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?opLabel ?track1 ?track1Label ?track2 ?track2Label ?value (era:trackId AS ?path)
    WHERE {
        $this era:hasPart ?track1 ;
				      era:canonicalURI ?cano1 .
        $this era:hasPart ?track2 ;
              era:canonicalURI ?cano2 .

        ?track1 era:trackId ?value .
        ?track2 era:trackId ?value .
        FILTER(?track1 != ?track2) .
        FILTER(?cano1 != ?cano2) .
        OPTIONAL { $this rdfs:label ?opLabel0 } .
        BIND(COALESCE(?opLabel0, "unknown label") AS ?opLabel)
        OPTIONAL { ?track1 rdfs:label ?track1Label0 } .
        BIND(COALESCE(?track1Label0, "unknown label") AS ?track1Label)
        OPTIONAL { ?track2 rdfs:label ?track2Label0 } .
        BIND(COALESCE(?track2Label0, "unknown label") AS ?track2Label)
    }
    """ .

# trackDirection: # 1.1.1.0.0.2
era-sh:RunningTrackShape sh:property era-sh:TrackDirection .
era-sh:TrackDirection
	a sh:PropertyShape ;
    era:affectedProperty era:trackDirection ;
    era:affectedClass era:RunningTrack ;
    era:scope "local" ;
	rdfs:comment "The normal running direction of the track."@en ;
	era:rinfIndex "1.1.1.0.0.2" ;
	sh:path era:trackDirection ;
	sh:maxCount 1 ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "trackDirection (1.1.1.0.0.2): The track must have at most one running direction value and it must be an IRI. This error may be due to having more than one value or having a value that is not an IRI."@en .

 era-sh:SectionOfLineShape sh:sparql era-sh:SoLTrackDirectionMinCount.
 era-sh:SoLTrackDirectionMinCount
    a sh:SPARQLConstraint ; 
    era:affectedProperty era:trackDirection;
    era:affectedClass era:RunningTrack;
    era:affectedClass era:SectionOfLine;
    era:scope "local";   
    rdfs:comment "The normal running direction is: 1) the same as the direction defined by the start and end of the SoL 2) the opposite to the direction defined by the start and end of the SoL 3) both directions defined for SoL."@en ;
    era:rinfIndex "1.1.1.0.0.2" ;
     sh:message "There should be at least one Track Direction. There is a problem with SoL {$this} ({?solLabel}) and its track {?track} ({?trackLabel}). This track has no values for this property"@en ;
     sh:prefixes era:;
     sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?solLabel ?track ?trackLabel (era:trackDirection AS ?path)
    WHERE {
        $this era:hasPart ?track .
        OPTIONAL { ?track rdfs:label ?trackLabel0 } .
        BIND(COALESCE(?trackLabel0, "unknown label") AS ?trackLabel)
        OPTIONAL { $this rdfs:label ?solLabel0 } .
        BIND(COALESCE(?solLabel0, "unknown label") AS ?solLabel)
        FILTER NOT EXISTS { ?track era:trackDirection ?value } .
    }
    """ .
# 1.1.1.0.0.2 trackDirection
era-sh:SectionOfLineShape sh:sparql era-sh:SoLTrackDirectionMaxCount.
era-sh:SoLTrackDirectionMaxCount 
   a sh:SPARQLConstraint ;
   era:affectedProperty era:trackDirection;
    era:affectedClass era:RunningTrack;
    era:affectedClass era:SectionOfLine;
    era:scope "local";   
   rdfs:comment "The normal running direction is: 1) the same as the direction defined by the start and end of the SoL 2) the opposite to the direction defined by the start and end of the SoL 3) both directions defined for SoL."@en ;
   era:rinfIndex "1.1.1.0.0.2" ;
     sh:message "There should be at most one Track Direction. There is a problem with SoL {$this} ({?solLabel}) and its track {?track} ({?trackLabel}). This track has at least two different values for this property: {?value1} and {?value2}"@en ;
     sh:prefixes era:;
     sh:select """
       PREFIX era: <http://data.europa.eu/949/>
       PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

			 SELECT DISTINCT $this ?solLabel ?track ?trackLabel ?value1 ?value2 (era:trackDirection AS ?path)
       WHERE {
         $this era:hasPart ?track .
         OPTIONAL { ?track rdfs:label ?trackLabel0 } .
         BIND(COALESCE(?trackLabel0, "unknown label") AS ?trackLabel)
         OPTIONAL { $this rdfs:label ?solLabel0 } .
         BIND(COALESCE(?solLabel0, "unknown label") AS ?solLabel)
         ?track era:trackDirection ?value1 .
         ?track era:trackDirection ?value2 .
         FILTER(STR(?value1) < STR(?value2)) .
      }
    """ .


# trackDirection: # 1.1.1.0.0.2
era-sh:SectionOfLineShape sh:sparql era-sh:TrackDirectionSKOS.
era-sh:TrackDirectionSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:trackDirection;
    era:affectedClass  era:RunningTrack;
    era:scope "local";  
    rdfs:comment "The normal running direction is: 1) the same as the direction defined by the start and end of the SoL 2) the opposite to the direction defined by the start and end of the SoL 3) both directions defined for SoL."@en ;
	era:rinfIndex "1.1.1.0.0.2" ;
    sh:message "Indication of the trackDirection (1.1.1.0.0.2):): The track {?track} in the Section of Line {$this}  has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/track-running-directions/TrackRunningDirections."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept (era:trackDirection AS ?path)
    WHERE {
        $this era:hasPart ?track .
        ?track era:trackDirection ?concept .
        era:trackDirection era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .


#  1.1.1.1.2.4 trackLoadCapability
era-sh:RunningTrackShape sh:property era-sh:TrackLoadCapability.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:TrackLoadCapability.
era-sh:TrackLoadCapability
	a sh:PropertyShape ; era:affectedProperty era:trackLoadCapability  ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
	rdfs:comment "Relates the track with the class LoadCapability. A combination of the line category and speed at the weakest point of the track."@en ;
	era:rinfIndex "1.1.1.1.2.4" ;
	sh:path era:trackLoadCapability ;
    sh:class era:LoadCapability;
    # sh:node era-sh:LoadCapabilityShape; not implemented in the shacl engine
	sh:severity sh:Violation ;
	sh:message "trackLoadCapability (1.1.1.1.2.4): The track defines a load capability value that must be an instance of LoadCapability."@en .


# loadCapabilitySpeed: # 1.1.1.1.2.4
 era-sh:LoadCapabilityShape sh:property era-sh:LoadCapabilitySpeed.
 era-sh:LoadCapabilitySpeed
	a sh:PropertyShape ; 
    era:affectedProperty era:loadCapabilitySpeed;
    era:affectedClass  era:LoadCapability;
    era:scope "local";   
	rdfs:comment "Load capability is a combination of the line category and speed at the weakest point of the track.";
	era:rinfIndex "1.1.1.1.2.4" ;
	sh:path era:loadCapabilitySpeed ;	
	sh:datatype xsd:integer ;
    sh:minCount 1;
    sh:maxCount 1;
	sh:severity sh:Violation ;
	sh:message "loadCapabilitySpeed (1.1.1.1.2.4): The track must have a load capability with a value of speed that is an integer. This error may be due to having an instance of LoadCapability with no value of speed, more than one value of speed, or that the value is not an integer."@en .

# loadCapabilityLineCategory: # 1.1.1.1.2.4
 era-sh:LoadCapabilityShape sh:property era-sh:LoadCapabilityLineCategory.
 era-sh:LoadCapabilityLineCategory
	a sh:PropertyShape ; 
    era:affectedProperty era:loadCapabilityLineCategory;
    era:affectedClass  era:LoadCapability;
    era:scope "local";   
	rdfs:comment "Load capability is a combination of the line category and speed at the weakest point of the track."@en;
	era:rinfIndex "1.1.1.1.2.4" ;
	sh:path era:loadCapabilityLineCategory ;
	sh:nodeKind sh:IRI ;
    sh:minCount 1;
    sh:maxCount 1;
	sh:severity sh:Violation ;
	sh:message "loadCapabilityLineCategory (1.1.1.1.2.4): The track must have a load capability with a value of line category that is an URI. This error may be due to having an instance of Load capability with no value of a line category, more than one value of a line category, or a value that is not an IRI."@en .

# loadCapabilityLineCategory: # 1.1.1.1.2.4
era-sh:RunningTrackShape sh:sparql era-sh:LoadCapabilityLineCategorySKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:LoadCapabilityLineCategorySKOS.
era-sh:LoadCapabilityLineCategorySKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:loadCapabilityLineCategory;
    era:affectedClass  era:LoadCapability;
    era:scope "local";   
    rdfs:comment "Load capability is a combination of the line category and speed at the weakest point of the track."@en;
	era:rinfIndex "1.1.1.1.2.4" ;
    sh:message "Indication of the load capability line category (1.1.1.1.2.4):): The track {$this}  has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/load-capability-line-categories/LoadCapabilityLineCategories."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept (era:loadCapabilityLineCategory AS ?path)
    WHERE {
        $this era:trackLoadCapability ?loadCapability .
        ?loadCapability era:loadCapabilityLineCategory ?concept .
        era:loadCapabilityLineCategory era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .


# nationalLoadCapability: # 1.1.1.1.2.4.1
era-sh:RunningTrackShape sh:property era-sh:NationalLoadCapability.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:NationalLoadCapability.
era-sh:NationalLoadCapability
	a sh:PropertyShape ; 
    era:affectedProperty era:nationalLoadCapability;
    era:affectedClass  era:RunningTrack;
    era:scope "local";   
	rdfs:comment "National classification for load capability"@en ;
	era:rinfIndex "1.1.1.1.2.4.1" ;
	sh:path era:nationalLoadCapability ;
	sh:datatype xsd:string ;
	sh:severity sh:Violation ;
	sh:message "nationalLoadCapability (1.1.1.1.2.4.1): The track has a national load capability value that must be  a string. This error may be due to the track having a value of national load capability that is not a character string."@en .



# highSpeedLoadModelCompliance: # 1.1.1.1.2.4.2
era-sh:RunningTrackShape sh:property era-sh:HighSpeedLoadModelCompliance.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:HighSpeedLoadModelCompliance.
era-sh:HighSpeedLoadModelCompliance
	a sh:PropertyShape ; 
    era:affectedProperty era:highSpeedLoadModelCompliance;
    era:affectedClass  era:RunningTrack;
    era:scope "local";    
	rdfs:comment "National classification for load capability"@en;
	rdfs:comment "For sections of line with a maximum permitted speed of 200km/h or more information regarding the procedure to be used to perform the dynamic compatibility check"@en;
	era:rinfIndex "1.1.1.1.2.4.2" ;
	sh:path era:highSpeedLoadModelCompliance ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "highSpeedLoadModelCompliance (1.1.1.1.2.4.2): The track must have at most one high speed load model compliance value that must be Y/N (boolean). This error may be due to the track having more than one value or having a value of high speed load model compliance that is not Y/N."@en .

# structureCheckLocation: # 1.1.1.1.2.4.3
era-sh:RunningTrackShape sh:property era-sh:StructureCheckLocation.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:StructureCheckLocation.
era-sh:StructureCheckLocation
	a sh:PropertyShape ; 
    era:affectedProperty era:structureCheckLocation;
    era:affectedClass  era:RunningTrack;
    era:scope "local";  
	rdfs:comment "Localisation of structures requiring specific checks."@en ;
	era:rinfIndex "1.1.1.1.2.4.3" ;
	sh:path era:structureCheckLocation ;
	sh:datatype xsd:double ;
	sh:pattern "^(\\+|\\-)?([1-9]\\d{1,3}|[0-9])\\.\\d{1,3}$" ;
	sh:severity sh:Violation ;
	sh:message "structureCheckLocation (1.1.1.1.2.4.3): The track has a location of the structure check value that must be a double (real) number and follow the format [±NNNN.NNN]. This error may be due to the track having a value that does not follow the pattern or is not a double (real) number."@en .

# compatibilityProcedureDocument: # 1.1.1.1.2.4.4
era-sh:RunningTrackShape sh:property era-sh:CompatibilityProcedureDocument.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:CompatibilityProcedureDocument.
era-sh:CompatibilityProcedureDocument
	a sh:PropertyShape ; 
    era:affectedProperty era:compatibilityProcedureDocument;
    era:affectedClass  era:RunningTrack;
    era:scope "local";  
	rdfs:comment "Document with the procedure for static and dynamic compatibility checks."@en ;
	era:rinfIndex "1.1.1.1.2.4.4" ;
	sh:path era:compatibilityProcedureDocument ;
    sh:class era:Document ;
	sh:severity sh:Violation ;
	sh:message "compatibilityProcedureDocument (1.1.1.1.2.4.4): The track has a name of the compatibility procedure document that must be a Document."@en .

# maximumPermittedSpeed: # 1.1.1.1.2.5
era-sh:RunningTrackShape sh:property era-sh:MaximumPermittedSpeed.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:MaximumPermittedSpeed.
era-sh:MaximumPermittedSpeed
	a sh:PropertyShape ; 
    era:affectedProperty era:maximumPermittedSpeed;
    era:affectedClass  era:RunningTrack;
    era:scope "local";   
	rdfs:comment "Maximum permitted speed."@en ;
	era:rinfIndex "1.1.1.1.2.5" ;
	sh:path era:maximumPermittedSpeed ;
	sh:maxCount 1 ;
	sh:datatype xsd:integer ;
	sh:minInclusive 0 ;
	sh:maxInclusive 500 ;
	sh:severity sh:Warning ;
	sh:message "maximumPermittedSpeed (1.1.1.1.2.5): The track must have at most one value of maximum permitted speed that is  an integer that lies within the range 0 to 500. This error may be due to the track having more than one value of maximum permitted speed, that the value does not lie within the range, or that the value is not an integer."@en .

#temperatureRange: # 1.1.1.1.2.6
era-sh:RunningTrackShape sh:property era-sh:TemperatureRange.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:TemperatureRange.
era-sh:TemperatureRange
	a sh:PropertyShape ; 
    era:affectedProperty era:temperatureRange;
    era:affectedClass  era:RunningTrack;
    era:scope "local";   
	rdfs:comment "Indication of the temperature range of track."@en ;
	era:rinfIndex "1.1.1.1.2.6" ;
	sh:path era:temperatureRange ;
    sh:nodeKind sh:IRI ;
    sh:maxCount 1;
	sh:severity sh:Violation ;
	sh:message "temperatureRange (1.1.1.1.2.6): Each track may have exactly one temperature range value that must be an IRI. This error may be due to the track not having a temperature range, or having more than one temperature range."@en .

#temperatureRange: # 1.1.1.1.2.6
era-sh:RunningTrackShape sh:sparql era-sh:TemperatureRangeSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:TemperatureRangeSKOS.
era-sh:TemperatureRangeSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:temperatureRange;
    era:affectedClass  era:RunningTrack;
    era:scope "local";    
    rdfs:comment "Indication of the temperature range of track."@en ;
	era:rinfIndex "1.1.1.1.2.6" ;
    sh:message "Indication of the temperature range (1.1.1.1.2.6):): The track {$this} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/temperature-ranges/TemperatureRanges."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept (era:temperatureRange AS ?path)
    WHERE {
        $this era:temperatureRange ?concept .
        era:temperatureRange era:inSkosConceptScheme ?conceptScheme .
        FILTER (NOT EXISTS {?concept skos:inScheme ?conceptScheme} || REGEX(STR(?concept), "/eratv/"))
	}
""" .



# maximumAltitude: # 1.1.1.1.2.7
era-sh:RunningTrackShape sh:property era-sh:MaximumAltitude.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:MaximumAltitude.
era-sh:MaximumAltitude
	a sh:PropertyShape ; 
    era:affectedProperty era:maximumAltitude;
    era:affectedClass  era:RunningTrack;
    era:scope "local";    
	rdfs:comment "Highest point of the section of line above sea level in reference to Normal Amsterdam's Peil (NAP)."@en ;
	era:rinfIndex "1.1.1.1.2.7" ;
	sh:path era:maximumAltitude ;
	
	sh:maxCount 1 ;
	#sh:datatype xsd:double ; Pending fix in mappings
	sh:pattern "^(\\+|\\-)?\\d{1,4}(\\.0*)?$" ;
	sh:severity sh:Violation ;
	sh:message "maximumAltitude (1.1.1.1.2.7): The track must define at most one maximum altitude value that must be a double (real) number with format[±NNNN]. This error may be due to the track having more than one value of maximum altitude or that the value is not a double (real) number."@en .

# hasSevereWeatherConditions: # 1.1.1.1.2.8
era-sh:RunningTrackShape sh:property era-sh:HasSevereWeatherConditions.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:HasSevereWeatherConditions.
era-sh:HasSevereWeatherConditions
	a sh:PropertyShape ; 
    era:affectedProperty era:hasSevereWeatherConditions;
    era:affectedClass  era:RunningTrack;
    era:scope "local";    
	rdfs:comment "Climatic conditions on the line are severe according to European standard."@en ;
	era:rinfIndex "1.1.1.1.2.8" ;
	sh:path era:hasSevereWeatherConditions ;
	sh:datatype xsd:boolean ;
	sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "hasSevereWeatherConditions (1.1.1.1.2.8): The track must have at most one existence of severe weather conditions value that must be Y/N (boolean). This error may be due to the track having more than one value of has severe weather conditions or that the value is not Y/N (boolean)."@en .


# profileNumberSwapBodies: # 1.1.1.1.3.4
era-sh:RunningTrackShape sh:property era-sh:ProfileNumberSwapBodies .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:ProfileNumberSwapBodies .
era-sh:ProfileNumberSwapBodies
	a sh:PropertyShape ;
    era:affectedProperty era:profileNumberSwapBodies ;
    era:affectedClass era:RunningTrack ;
    era:scope "local" ;
	rdfs:comment "Coding for combined transport with swap bodies as defined in UIC Code."@en ;
	era:rinfIndex "1.1.1.1.3.4" ;
	sh:path era:profileNumberSwapBodies ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "profileNumberSwapBodies (1.1.1.1.3.4): The track must have values for profile number swap bodies that are IRIs. This error may be due to having a value that is not an IRI."@en .

era-sh:RunningTrackShape sh:sparql era-sh:ProfileNumberSwapBodiesSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:ProfileNumberSwapBodiesSKOS.
era-sh:ProfileNumberSwapBodiesSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:profileNumberSwapBodies;
    era:affectedClass  era:RunningTrack;
    era:scope "local";
    rdfs:comment "Coding for combined transport with swap bodies as defined in UIC Code."@en ;
	era:rinfIndex "1.1.1.1.3.4" ;
    sh:message "Indication of the profileNumberSwapBodies(1.1.1.1.3.4):): The track {$this}  has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/profile-num-swap-bodies/ProfileNumbersSwapBodies."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept (era:profileNumberSwapBodies AS ?path)
    WHERE {
        $this era:profileNumberSwapBodies ?concept .
        era:profileNumberSwapBodies era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .


# profileNumberSemiTrailers: # 1.1.1.1.3.5
era-sh:RunningTrackShape sh:property era-sh:ProfileNumberSemiTrailers .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:ProfileNumberSemiTrailers .
era-sh:ProfileNumberSemiTrailers
	a sh:PropertyShape ;
    era:affectedProperty era:profileNumberSemiTrailers ;
    era:affectedClass era:RunningTrack ;
    era:scope "local" ;
	rdfs:comment "Coding for combined transport with semi-trailers as defined in UIC Code."@en ;
	era:rinfIndex "1.1.1.1.3.5" ;
	sh:path era:profileNumberSemiTrailers ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "profileNumberSemiTrailers (1.1.1.1.3.5): The track must have values for profile number semi-trailers that are IRIs. This error may be due to having a value that is not an IRI."@en .

era-sh:RunningTrackShape sh:sparql era-sh:ProfileNumberSemiTrailersSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:ProfileNumberSemiTrailersSKOS.
era-sh:ProfileNumberSemiTrailersSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:profileNumberSemiTrailers;
    era:affectedClass  era:RunningTrack;
    era:scope "local";  
    rdfs:comment "Coding for combined transport with semi-trailers as defined in UIC Code."@en ;
	era:rinfIndex "1.1.1.1.3.5" ;
    sh:message "Indication of the profileNumberSemiTrailers(1.1.1.1.3.5):): The track {$this} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/profile-num-semi-trailers/ProfileNumbersSemiTrailers."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept (era:profileNumberSemiTrailers AS ?path)
    WHERE {
	    $this era:profileNumberSemiTrailers ?concept .
        era:profileNumberSemiTrailers era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .



# specificInformation: #  1.1.1.1.3.5.1
era-sh:RunningTrackShape sh:property era-sh:SpecificInformation.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:SpecificInformation.
era-sh:SpecificInformation
	a sh:PropertyShape ; 
    era:affectedProperty era:specificInformation;
    era:affectedClass  era:RunningTrack;
    era:scope "local";
    
	rdfs:comment "Any specific information from the IM."@en ;
	era:rinfIndex "1.1.1.1.3.5.1" ;
	sh:path era:specificInformation; 
	sh:datatype xsd:string ;
	sh:severity sh:Violation ;
	sh:message "specificInformation (1.1.1.1.3.5.1): The track has a specific information value that must be a  string. This error may be due to having a value of specific information from the IM that is not a character string."@en .

# gradientProfile: # 1.1.1.1.3.6
era-sh:RunningTrackShape sh:property era-sh:GradientProfile.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:GradientProfile.
era-sh:GradientProfile
	a sh:PropertyShape ; 
    era:affectedProperty era:gradientProfile;
    era:affectedClass  era:RunningTrack;
    era:scope "local";    
	rdfs:comment "Sequence of gradient values and locations of change in gradient."@en ;
	era:rinfIndex "1.1.1.1.3.6" ;
	sh:path era:gradientProfile ;
	sh:datatype xsd:string ;
  	sh:pattern "^((\\+|\\-)\\d{1,2}(\\.\\d{1})?(\\((\\+|\\-)?\\d{1,4}(\\.\\d{1,3})?\\))?)(,\\s?(\\+|\\-)\\d{1,2}(\\.\\d{1})?(\\((\\+|\\-)?\\d{1,4}(\\.\\d{1,3})?\\))?)*$" ;
	sh:severity sh:Violation ;
	sh:message "gradientProfile (1.1.1.1.3.6): The track has a gradient profile value that must be a string with a sequence of comma-separated values in the format [+/-][NN.N]([+/-][NNNN.NNN]). This error may be due to having a sequence of values that are not a string or that do not follow the pattern."@en .





# cantDeficiency: # 1.1.1.1.4.2 
era-sh:RunningTrackShape sh:property era-sh:CantDeficiency.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:CantDeficiency.
era-sh:CantDeficiency
	a sh:PropertyShape ; 
    era:affectedProperty era:cantDeficiency;
    era:affectedClass  era:RunningTrack;
    era:scope "local";
    
	rdfs:comment "Maximum cant deficiency expressed in millimeters defined as difference between the applied cant and a higher equilibrium cant the line has been designed for."@en ;
	era:rinfIndex "1.1.1.1.4.2" ;
	sh:path era:cantDeficiency ;
	sh:maxCount 1 ;
	sh:datatype xsd:integer ;
	sh:pattern "^(\\+|\\-)?([0-9]\\d{0,3})$" ;
	sh:severity sh:Violation ;
	sh:message "cantDeficiency (1.1.1.1.4.2): The track must have at most one cant deficiency value that is an integer. This error may be due to the track having more than one cant deficiency value or to having a value that is not an int."@en .


# railInclination: #1.1.1.1.4.3
era-sh:RunningTrackShape sh:property era-sh:RailInclination.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:RailInclination.
era-sh:RailInclination
	a sh:PropertyShape ; 
    era:affectedProperty era:railInclination;
    era:affectedClass  era:RunningTrack;
    era:scope "local";
    
	rdfs:comment "An angle defining the inclination of the head of a rail relatie to the running surface."@en ;
	era:rinfIndex "1.1.1.1.4.3" ;
	sh:path era:railInclination ;
	sh:maxCount 1 ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "railInclination (1.1.1.1.4.3): The track must have at most one rail inclination measurement value that is an IRI. This error may be due to the track having more than one rail inclination measurement value or to having a value that is not an IRI."@en .

# railInclination: #1.1.1.1.4.3
era-sh:RunningTrackShape sh:sparql era-sh:RailInclinationSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:RailInclinationSKOS.
era-sh:RailInclinationSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:railInclination;
    era:affectedClass  era:RunningTrack;
    era:scope "local";
    
    rdfs:comment "An angle defining the inclination of the head of a rail relatie to the running surface."@en ;
	era:rinfIndex "1.1.1.1.4.3" ;
    sh:message "Indication of the rail inclination (1.1.1.1.4.3):): The track {$this} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/rail-inclinations/RailInclinations."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept (era:railInclination AS ?path)
    WHERE {
        $this era:railInclination ?concept .
        era:railInclination era:inSkosConceptScheme ?conceptScheme .
        FILTER (NOT EXISTS {?concept skos:inScheme ?conceptScheme} || REGEX(STR(?concept), "/eratv/"))
	}
""" .


# hasBallast: # 1.1.1.1.4.4
era-sh:RunningTrackShape sh:property era-sh:HasBallast.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:HasBallast.
era-sh:HasBallast
	a sh:PropertyShape ; 
    era:affectedProperty era:hasBallast ;
    era:affectedClass  era:RunningTrack;
    era:scope "local";    
	rdfs:comment "Specifies whether the track construction is with sleepers embedded in ballast or not."@en ;
	era:rinfIndex "1.1.1.1.4.4" ;
	sh:path era:hasBallast ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "hasBallast (1.1.1.1.4.4): The track must have at most one existence of ballast value that is Y/N (boolean). This error may be due to the track having more than one has ballast value or to having a value that is not Y/N (boolean)."@en .

# tsiSwitchCrossing: # 1.1.1.1.5.1
era-sh:RunningTrackShape sh:property era-sh:TSISwitchCrossing.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:TSISwitchCrossing.
era-sh:TSISwitchCrossing
	a sh:PropertyShape ; 
    era:affectedProperty era:tsiSwitchCrossing ;
    era:affectedClass  era:RunningTrack;
    era:scope "local";    
	rdfs:comment "Switches and crossings are maintained to in service limit dimension as specified in TSI."@en ;
	era:rinfIndex "1.1.1.1.5.1" ;
	sh:path era:tsiSwitchCrossing ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "tsiSwitchCrossing (1.1.1.1.5.1): The track must have at most one existence of TSI switches and crossing value that is Y/N (boolean). This error may be due to the track having more than one tsi swith crossing value or to having a value that is not Y/N (boolean)."@en .

# minimumWheelDiameter: # 1.1.1.1.5.2
era-sh:RunningTrackShape sh:property era-sh:MinimumWheelDiameter.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:MinimumWheelDiameter.
era-sh:MinimumWheelDiameter
	a sh:PropertyShape ; 
    era:affectedProperty era:minimumWheelDiameter ;
    era:affectedClass  era:RunningTrack;
    era:scope "local";   
	rdfs:comment "Maximum unguided length of fixed obtuse crossings is based on a minimum wheel diameter in service expressed in millimiters."@en ;
	era:rinfIndex "1.1.1.1.5.2" ;
	sh:path era:minimumWheelDiameter ;
	sh:maxCount 1 ;
	sh:minInclusive 330 ;
	sh:datatype xsd:integer ;
	sh:pattern "^([1-9]\\d{1,2}|[0-9])$" ;
	sh:severity sh:Warning ;
	sh:message """minimumWheelDiameter (1.1.1.1.5.2): The track must have at most one minimum wheel diameter value that is an integer.
	 This error may be due to the track having more than one minimum wheel diameter value or to having a value that is not an integer.
	 If the value of the wheel diameter is bigger than 330 mm, it has to be specified.
	 """@en .

# maximumTrainDeceleration: # 1.1.1.1.6.1
era-sh:RunningTrackShape sh:property era-sh:MaximumTrainDeceleration.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:MaximumTrainDeceleration.
era-sh:MaximumTrainDeceleration
	a sh:PropertyShape ; 
    era:affectedProperty era:maximumTrainDeceleration ;
    era:affectedClass  era:RunningTrack;
    era:scope "local";   
	rdfs:comment "Limit for longitudinal track resistance given as a maximum allowed train deceleration and expressed in m/s2."@en ;
	era:rinfIndex "1.1.1.1.6.1" ;
	sh:path era:maximumTrainDeceleration ;
	sh:maxCount 1 ;
	sh:datatype xsd:double ;
	sh:pattern "^[0-9]\\.[0-9]$" ;
	sh:severity sh:Violation ;
	sh:message "maximumTrainDeceleration (1.1.1.1.6.1): The track must have at most one maximum train deceleration value that is a double (real) number . This error may be due to the track having more than one maximum train deceleration value or to having a value that is not a real (double) number."@en .






# eddyCurrentBrakingConditionsDocument: # 1.1.1.1.6.4
era-sh:RunningTrackShape sh:property era-sh:EddyCurrentBrakingConditionsDocument.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:EddyCurrentBrakingConditionsDocument.
era-sh:EddyCurrentBrakingConditionsDocument
	a sh:PropertyShape ; 
    era:affectedProperty era:eddyCurrentBrakingConditionsDocument ;
    era:affectedClass  era:RunningTrack;
    era:scope "local";   
	rdfs:comment "Electronic document available in two EU languages from the IM stored by the Agency with conditions for the use of eddy current brakes identified in 1.1.1.1.6.2."@en ;
	era:rinfIndex "1.1.1.1.6.4" ;
	sh:path era:eddyCurrentBrakingConditionsDocument ;
    sh:class era:Document;
	sh:severity sh:Violation ;
	sh:message "eddyCurrentBrakingConditionsDocument (1.1.1.1.6.4): The track has an eddy current braking conditions document value that must be a Document."@en .

# magneticBrakingConditionsDocument: # 1.1.1.1.6.5
era-sh:RunningTrackShape sh:property era-sh:MagneticBrakingConditionsDocument.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:MagneticBrakingConditionsDocument.
era-sh:MagneticBrakingConditionsDocument
	a sh:PropertyShape ; 
    era:affectedProperty era:magneticBrakingConditionsDocument ;
    era:affectedClass  era:RunningTrack;
    era:scope "local";   
	rdfs:comment "Electronic documents available in two EU languages from the IM stored by the Agency with conditions for the use of magnetic brakes identified in 1.1.1.1.6.3."@en ;
	era:rinfIndex "1.1.1.1.6.5" ;
	sh:path era:magneticBrakingConditionsDocument ;
    sh:class era:Document;
	sh:severity sh:Violation ;
	sh:message "magneticBrakingConditionsDocument (1.1.1.1.6.5): The track has a magnetic braking conditions document value that must be a Document."@en .

# flangeLubeForbidden: # 1.1.1.1.7.1
era-sh:RunningTrackShape sh:property era-sh:FlangeLubeForbidden.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:FlangeLubeForbidden.
era-sh:FlangeLubeForbidden
	a sh:PropertyShape ; 
    era:affectedProperty era:flangeLubeForbidden ;
    era:affectedClass  era:RunningTrack;
    era:scope "local";  
	rdfs:comment "Indication whether the use of on-board device for flange lubrication is forbidden."@en ;
	era:rinfIndex "1.1.1.1.7.1" ;
	sh:path era:flangeLubeForbidden ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "flangeLubeForbidden (1.1.1.1.7.1): The track must have at most one flange lube forbidden value that is Y/N (boolean). This error may be due to having more than one value or having a value that is not Y/N (boolean)."@en .

# hasLevelCrossings: # 1.1.1.1.7.2
era-sh:RunningTrackShape sh:property era-sh:HasLevelCrossings.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:HasLevelCrossings.
era-sh:HasLevelCrossings
	a sh:PropertyShape ; 
    era:affectedProperty era:hasLevelCrossings ;
    era:affectedClass  era:RunningTrack;
    era:scope "local";  
	rdfs:comment "Indication whether level crossings (including pedestrian track crossing) exist onf the section line."@en ;
	era:rinfIndex "1.1.1.1.7.2" ;
	sh:path era:hasLevelCrossings ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "hasLevelCrossings (1.1.1.1.7.2): The track must have at most one existence of level crossings value that is Y/N (boolean). This error may be due to having more than one value or having a value that is not Y/N (boolean)."@en .

# accelerationLevelCrossing: # 1.1.1.1.7.3
era-sh:TrackShape sh:property era-sh:AccelerationLevelCrossing.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:AccelerationLevelCrossing.
era-sh:AccelerationLevelCrossing
	a sh:PropertyShape ; 
    era:affectedProperty era:accelerationLevelCrossing ;
    era:affectedClass  era:Track;
    era:scope "local";   
	rdfs:comment "Existence of limit for acceleration of train if stopping or recovering speed close to a level crossing expressed in a specific reference acceleration curve."@en ;
	era:rinfIndex "1.1.1.1.7.3" ;
	sh:path era:accelerationLevelCrossing ;
	sh:maxCount 1 ;
	sh:nodeKind sh:IRI ;
    sh:class era:Document;
	sh:severity sh:Violation ;
	sh:message "accelerationLevelCrossing (1.1.1.1.7.3): The track must have at most one acceleration level crossing value that is a Document. This error may be due to having more than one value or having a value that is not an instance of Document."@en .

# hasHotAxleBoxDetector: # 1.1.1.1.7.4
era-sh:RunningTrackShape sh:property era-sh:HasHotAxleBoxDetector.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:HasHotAxleBoxDetector.
era-sh:HasHotAxleBoxDetector
	a sh:PropertyShape ; 
    era:affectedProperty era:hasHotAxleBoxDetector ;
    era:affectedClass  era:RunningTrack;
    era:scope "local";    
	rdfs:comment "Existence of trackside hot axle box detector."@en ;
	era:rinfIndex "1.1.1.1.7.4" ;
	sh:path era:hasHotAxleBoxDetector ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "hasHotAxleBoxDetector (1.1.1.1.7.4): The track must have at most one existence of hot axle box detector value that is Y/N (boolean)."@en .

# redLightsRequired: # 1.1.1.1.7.10 
era-sh:RunningTrackShape sh:property era-sh:RedLightsRequired.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:RedLightsRequired.
era-sh:RedLightsRequired
	a sh:PropertyShape ; 
    era:affectedProperty era:redLightsRequired  ;
    era:affectedClass  era:RunningTrack;
    era:scope "local";   
	rdfs:comment "Sections where two steady red lights are required in accordance with Implementing Regulations (EU) 2019/773."@en ;
	era:rinfIndex "1.1.1.1.7.10" ;
	sh:path era:redLightsRequired ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "redLightsRequired (1.1.1.1.7.10): The track must have at most one value that defines if two steady red lights are required and the value must be Y/N (boolean). This error may be due to having more than one value or having a value that is not Y/N (boolean)."@en .

era-sh:RunningTrackShape sh:sparql era-sh:RedLightsRequiredCountryApplicability .
era-sh:RedLightsRequiredCountryApplicability
    a sh:SPARQLConstraint ;
	era:affectedProperty era:redLightsRequired ;
	era:affectedClass  era:RunningTrack ;
    sh:message "redLightsRequired: This property may only be used for RunningTracks located in Belgium, France, Italy, Portugal, or Spain. This error may be due to applying it to a country other that these, or not having an inCountry annotation in the parent element of the RunningTrack."@en ;
    sh:select """
		PREFIX era: <http://data.europa.eu/949/>
		PREFIX eu-country: <http://publications.europa.eu/resource/authority/country/> 
        SELECT ?this (era:redLightsRequired AS ?path) WHERE {
          ?this a era:RunningTrack ;
                 era:redLightsRequired true  . # before ?val

          {
            ?parent era:hasPart ?this ;
                  era:inCountry ?country .
          }
          UNION
          {
            ?this era:isPartOf ?parent .
            ?parent era:inCountry ?country .
          }

          FILTER (?country NOT IN (
            eu-country:BEL,
            eu-country:FRA,
            eu-country:ITA,
            eu-country:PRT,
            eu-country:ESP
          ))
        }
    """ .

# isQuietRoute: # 1.1.1.1.7.11
era-sh:RunningTrackShape sh:property era-sh:IsQuietRoute.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:IsQuietRoute.
era-sh:IsQuietRoute
	a sh:PropertyShape ; era:affectedProperty era:isQuietRoute  ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
	rdfs:comment "Belonging to a 'quiet route' in accordance with Article 5b of Regulation (EU) 1304/2014."@en ;
	era:rinfIndex "1.1.1.1.7.11" ;
	sh:path era:isQuietRoute ;	
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "isQuietRoute (1.1.1.1.7.11): The track must have at most one value that defines if it belongs to a 'quiet route' and the value must be Y/N (boolean). This error may be due to having more than one value or having a value that is not Y/N (boolean)."@en .

# verificationENE: # 1.1.1.2.1.1
era-sh:RunningTrackShape sh:property era-sh:VerificationENE.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:VerificationENE.
era-sh:VerificationENE
	a sh:PropertyShape ; era:affectedProperty era:verificationENE  ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
	rdfs:comment "Unique number for EC declarations following format requirements specified in the 'Document about practical arrangents for transmitting interoperability documents' ."@en ;
	era:rinfIndex "1.1.1.2.1.1" ;
	sh:path era:verificationENE ;
	
	sh:datatype xsd:string ;
	sh:pattern "^[A-Z]{2}\\/.{14}\\/(19[0-9][0-9]|20[0-9][0-9]|2100)\\/[0-9]{6}$";
	sh:severity sh:Violation ;
	sh:message "verificationENE (1.1.1.2.1.1): The track has a number for EC declarations that must follow format CC/XXXXXXXXXXXXXX/YYYY/NNNNNN where CC is country code, XXXXX... is a number, YYYY is a year between 1900 and 2100, NNNNNN is the number for the EC declaration. This error may be due to the track having a value that does not follow the pattern."@en .

# demonstrationENE: #1.1.1.2.1.2
era-sh:RunningTrackShape sh:property era-sh:DemonstrationENE.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:DemonstrationENE.
era-sh:DemonstrationENE
	a sh:PropertyShape ; era:affectedProperty era:demonstrationENE  ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
	rdfs:comment "Unique number for EI declarations following the same format requirements as specified in the 'Document about practical arrangents for transmitting interoperability documents'."@en ;
	era:rinfIndex "1.1.1.2.1.2" ;
	sh:path era:demonstrationENE ;
	sh:datatype xsd:string ;
	sh:pattern "^[A-Z]{2}\\/.{14}\\/(19[0-9][0-9]|20[0-9][0-9]|2100)\\/[0-9]{6}$";
	sh:severity sh:Violation ;
	sh:message "demonstrationENE (1.1.1.2.1.2): The track has a number for EI declarations that must follow format CC/XXXXXXXXXXXXXX/YYYY/NNNNNN where CC is country code, XXXXX... is a number, YYYY is a year between 1900 and 2100, NNNNNN is the number for the EI declaration. This error may be due to the track having a value that is not a tring or that does not follow the pattern."@en .


# tsiPantographHead: # 1.1.1.2.3.1
era-sh:RunningTrackShape sh:property era-sh:TsiPantographHead .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:TsiPantographHead .
era-sh:TsiPantographHead
	a sh:PropertyShape ;
    era:affectedProperty era:tsiPantographHead ;
    era:affectedClass era:RunningTrack ;
    era:scope "local" ;
	rdfs:comment "Indication of TSI compliant pantograph heads which are allowed to be used."@en ;
	era:rinfIndex "1.1.1.2.3.1" ;
	sh:path era:tsiPantographHead ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "tsiPantographHead (1.1.1.2.3.1): The track may have TSI compliant pantograph head values and each must be an IRI. This error may be due to having a value that is not an IRI."@en .

era-sh:RunningTrackShape sh:sparql era-sh:TsiPantographHeadSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:TsiPantographHeadSKOS.
era-sh:TsiPantographHeadSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:tsiPantographHead ;
    era:affectedClass  era:RunningTrack ;
    era:scope "local" ;
    rdfs:comment "Accepted TSI compliant pantograph heads."@en ;
	era:rinfIndex "1.1.1.2.3.1" ;
    sh:message "Indication of the tsiPantographHead (1.1.1.2.3.1):): The track {$this} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/compliant-pantograph-heads/CompliantPantographHeads."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept (era:tsiPantographHead AS ?path)
    WHERE {
        $this era:tsiPantographHead ?concept .
        era:tsiPantographHead era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# otherPantographHead: # 1.1.1.2.3.2
era-sh:RunningTrackShape sh:property era-sh:OtherPantographHead .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:OtherPantographHead .
era-sh:OtherPantographHead
	a sh:PropertyShape ;
    era:affectedProperty era:otherPantographHead ;
    era:affectedClass era:RunningTrack ;
    era:scope "local" ;
	rdfs:comment "Indication of pantograph heads which are allowed to be used."@en ;
	era:rinfIndex "1.1.1.2.3.2" ;
	sh:path era:otherPantographHead ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "otherPantographHead (1.1.1.2.3.2): The track may have other pantograph head values and each must be an IRI. This error may be due to having a value that is not an IRI."@en .

era-sh:RunningTrackShape sh:sparql era-sh:OtherPantographHeadSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:OtherPantographHeadSKOS.
era-sh:OtherPantographHeadSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:otherPantographHead  ;     era:affectedClass  era:RunningTrack;     era:scope "local";
    rdfs:comment "Indication of which other pantograph heads are allowed to be used."@en ;
    era:rinfIndex "1.1.1.2.3.2" ;
    sh:severity sh:Warning ;
    sh:message "Indication of the otherPantographHead (1.1.1.2.3.2):): The track {$this} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/other-pantograph-heads/OtherPantographHeads."@en ;
    sh:prefixes era:;
    sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?concept (era:otherPantographHead AS ?path)
    WHERE {
        $this era:otherPantographHead ?concept .
        era:otherPantographHead era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# trackRaisedPantographsDistanceAndSpeed: # 1.1.1.2.3.3
era-sh:RunningTrackShape sh:property era-sh:TrackRaisedPantographsDistanceAndSpeed.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:TrackRaisedPantographsDistanceAndSpeed.
era-sh:TrackRaisedPantographsDistanceAndSpeed
	a sh:PropertyShape ; era:affectedProperty era:trackRaisedPantographsDistanceAndSpeed  ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
	rdfs:comment "Relates the track with the class RaisedPantporaphsDistanceAndSpeed. Indication of maximum number of raised pantographs per train allowed and minimum spacing centre line to centre line of adjacent pantograph heads, expressed in metres, at the given speed."@en ;
	era:rinfIndex "1.1.1.2.3.3" ;
	sh:path era:trackRaisedPantographsDistanceAndSpeed ;
    sh:class era:RaisedPantographsDistanceAndSpeed;
    # sh:node era-sh:RaisedPantographsDistanceAndSpeedShape; not implemented in the shacl engine
	sh:severity sh:Violation ;
	sh:message "trackRaisedPantographsDistanceAndSpeed (1.1.1.2.3.3): The track defines a raised pantographs distance and speed value that must be an instance of RaisedPantographsDistanceAndSpeed."@en .

# raisedPantographsDistance: # 1.1.1.2.3.3
era-sh:RaisedPantographsDistanceAndSpeedShape sh:property era-sh:RaisedPantographsDistance.
era-sh:RaisedPantographsDistance
	a sh:PropertyShape ; era:affectedProperty era:raisedPantographsDistance  ;     era:affectedClass  era:RaisedPantographsDistanceAndSpeed;     era:scope "local";     
	rdfs:comment "Indication of maximum number of raised pantographs per train allowed and minumum spacing centre line to centre line of adjacent pantograph heads, expressed in meters, at the given speed."@en ;
	era:rinfIndex "1.1.1.2.3.3" ;
	sh:path era:raisedPantographsDistance ;
    sh:minCount 1;
	sh:maxCount 1;
	sh:datatype xsd:integer ;
	sh:severity sh:Violation ;
	sh:message "Raised pantographs distance  (1.1.1.2.3.3): The track must have a raised pantographs distance and speed with a value of distance that is an integer. This error is due to the track having a RaisedPantographDistanceAndSpeed with no value of distance, more than one value of distance or having a value that is not an integer."@en .

# raisedPantographsSpeed: # 1.1.1.2.3.3
 era-sh:RaisedPantographsDistanceAndSpeedShape sh:property era-sh:RaisedPantographsSpeed.
 era-sh:RaisedPantographsSpeed
	a sh:PropertyShape ; era:affectedProperty era:raisedPantographsSpeed  ;        era:scope "local";     
    era:affectedClass  era:RaisedPantographsDistanceAndSpeed;
	rdfs:comment "Indication of maximum number of raised pantographs per train allowed and minumum spacing centre line to centre line of adjacent pantograph heads, expressed in meters, at the given speed."@en ;
	era:rinfIndex "1.1.1.2.3.3" ;
    sh:minCount 1;
    sh:maxCount 1;
	sh:path era:raisedPantographsSpeed ;
	sh:datatype xsd:integer ;
	sh:severity sh:Violation ;
	sh:message "raised pantographs speed (1.1.1.2.3.3): The track must have a raised pantographs distance and speed with a value of speed that is an integer. This error is due to having a RaisedPantographDistanceAndSpeed with no value of speed, more than one value of speed or having a value that is not an integer."@en .

# raisedPantographsNumber: # 1.1.1.2.3.3
 era-sh:RaisedPantographsDistanceAndSpeedShape sh:property era-sh:RaisedPantographsNumber.
 era-sh:RaisedPantographsNumber
	a sh:PropertyShape ; era:affectedProperty era:raisedPantographsNumber ;     era:scope "local";   
    era:affectedClass  era:RaisedPantographsDistanceAndSpeed;
	rdfs:comment "Indication of maximum number of raised pantographs per train allowed and minumum spacing centre line to centre line of adjacent pantograph heads, expressed in meters, at the given speed."@en ;
	era:rinfIndex "1.1.1.2.3.3" ;
	sh:path era:raisedPantographsNumber ;
    sh:minCount 1;
	sh:maxCount 1;
	sh:datatype xsd:integer ;
	sh:severity sh:Violation ;
	sh:message "Raised pantographs number (1.1.1.2.3.3): The track must have a raised pantographs distance and number with a value of number that is an integer. This error is due to having a RaisedPantographDistanceAndSpeed with no value of number, more than one value of number or having a value that is not an integer."@en .



 
# contactStripMaterial: # 1.1.1.2.3.4
era-sh:RunningTrackShape sh:property era-sh:ContactStripMaterial.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:ContactStripMaterial.
era-sh:ContactStripMaterial
	a sh:PropertyShape ;
    era:affectedProperty era:contactStripMaterial;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication of the material of the contact strip."@en ;
	era:rinfIndex "1.1.1.2.3.4" ;
	sh:path era:contactStripMaterial ;
	sh:nodeKind sh:IRI ;
	#sh:maxCount 1 ; # removed Functional property
	sh:severity sh:Violation ;
	sh:message "contactStripMaterial (1.1.1.2.3.4): The track has an indication of the material of the contact strip that must be an IRI."@en .

era-sh:RunningTrackShape sh:sparql era-sh:ContactStripMaterialSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:ContactStripMaterialSKOS.
era-sh:ContactStripMaterialSKOS
	a sh:SPARQLConstraint ;
era:affectedProperty era:contactStripMaterial  ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
   rdfs:comment "Indication of the material of the contact strip."@en ;
	era:rinfIndex "1.1.1.2.3.4" ;
    sh:message "Indication of the contactStripMaterial (1.1.1.2.3.4):): The track {$this} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/contact-strip-materials/ContactStripMaterials."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept (era:contactStripMaterial AS ?path)
    WHERE {
        $this era:contactStripMaterial ?concept .
        era:contactStripMaterial era:inSkosConceptScheme ?conceptScheme .
        FILTER (NOT EXISTS {?concept skos:inScheme ?conceptScheme} || REGEX(STR(?concept), "/eratv/"))
	}
""" .


# contactStripMaterialMetallicContent: # 1.1.1.2.3.4
era-sh:RunningTrackShape sh:property era-sh:ContactStripMaterialMetallicContent.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:ContactStripMaterialMetallicContent.
era-sh:ContactStripMaterialMetallicContent
	a sh:PropertyShape ; era:affectedProperty era:contactStripMaterialMetallicContent  ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
	rdfs:comment "In case that the value of the property era:contactStripMaterial is impregnated carbon, it is the metallic content, the maximum percentage allowed."@en ;
	era:rinfIndex "1.1.1.2.3.4" ;
	sh:path era:contactStripMaterialMetallicContent ;
	sh:datatype xsd:integer ;
	sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "contactStripMaterialMetallicContent (1.1.1.2.3.4): The track has an indication of the material of the contact strip that must be an integer. This error may be due to the track having a value that is not an integer."@en .

# phaseSeparation: # 1.1.1.2.4.1.1
 era-sh:RunningTrackShape sh:property era-sh:HasPhaseSeparation.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:HasPhaseSeparation.
 era-sh:HasPhaseSeparation
    a sh:PropertyShape ; era:affectedProperty era:hasPhaseSeparation ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
	rdfs:comment "Indication of existence of phase separation and required information."@en ;
	era:rinfIndex "1.1.1.2.4.1.1" ;
	sh:path era:hasPhaseSeparation ;
    sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "hasPhaseSeparation (1.1.1.2.4.1.1): The track defines at most one existence of phase separation and required information value that is Y/N (boolean). This error may be due to the track having more than one value or having a value that is not Y/N (boolean). "@en .



# trackPhaseInfo: # 1.1.1.2.4.1.2
era-sh:RunningTrackShape sh:property era-sh:TrackPhaseInfo.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:TrackPhaseInfo.
era-sh:TrackPhaseInfo
	a sh:PropertyShape ; era:affectedProperty era:trackPhaseInfo  ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
	rdfs:comment "Relates the Track with PhaseInfo. Indication of required several information on phase separation."@en ;
	era:rinfIndex "1.1.1.2.4.1.2" ;
	sh:path era:trackPhaseInfo ;
    sh:class era:PhaseInfo;
    # sh:node era-sh:PhaseInfoShape; not implemented in the shacl engine
	sh:severity sh:Violation ;
	sh:message "trackPhaseInfo (1.1.1.2.4.1.2): The track defines a track phase info value that must be an instance of PhaseInfo."@en .




# phaseInfoKm: 
era-sh:PhaseInfoShape sh:property era-sh:PhaseInfoKm.
 era-sh:PhaseInfoKm
	a sh:PropertyShape ; era:affectedProperty era:phaseInfoKm  ;     era:scope "local";     
    era:affectedClass  era:PhaseInfo;
	rdfs:comment "Indication of existence of phase separation and required information." ;
	sh:path era:phaseInfoKm ;
    sh:minCount 1;
    sh:maxCount 1;
 	sh:datatype xsd:double ;
 	sh:severity sh:Warning ;
 	sh:message "Phase info km : The track has a phase info with the location from the start of the line value (km), that must be a double. This error may be due to the track having a PhaseInfo with no value of km, more than one value of km, or a value that is not a double (real) number."@en .


# phaseInfoDistanceType: 
 era-sh:PhaseInfoShape sh:property era-sh:PhaseInfoDistanceType.
 era-sh:PhaseInfoDistanceType 
  a sh:PropertyShape ; era:affectedProperty era:phaseInfoDistanceType  ;
	era:scope "local";     
  era:affectedClass  era:PhaseInfo;
	rdfs:comment "Indication of existence of phase separation and required information."@en ;
	sh:path era:phaseInfoDistanceType ;
  sh:minCount 1;
  sh:maxCount 1;
 	sh:datatype xsd:string ;
  sh:in ( "MIN" "MAX" );
 	sh:severity sh:Warning ;
 	sh:message "Phase info distance type : The track has a phase info with the single selection of 'MIN=minimum' or 'MAX=maximum' to show whether the length is a minimum distance between the inner contact strips of the pantographs or a maximum distance between the outer contact strips of the pantographs, that must be the string MIN or MAX. This error may be due to the track having a PhaseInfo with no value of distancetype, more than one value of distance type, or having a value that is not one of the strings MIN or MAX."@en .



# phaseInfoLength: 
 era-sh:PhaseInfoShape sh:property era-sh:PhaseInfoLength.
 era-sh:PhaseInfoLength
	a sh:PropertyShape ; era:affectedProperty era:phaseInfoLength  ;          era:scope "local";     
    era:affectedClass  era:PhaseInfo;
	rdfs:comment "Indication of existence of phase separation and required information."@en ;
	sh:path era:phaseInfoLength ;
	sh:datatype xsd:integer ;
    sh:minCount 1;
    sh:maxCount 1;
	sh:severity sh:Violation ;
	sh:message "Phase infolength (): The track has a phase info with the length of the phase separation value (length), that must be an integer. This error may be due to the track having a PhaseInfo with no value of length, more than one value of length,  or having a value that is not an integer."@en .

# phaseInfoPantographLowered: 
 era-sh:PhaseInfoShape sh:property era-sh:PhaseInfoPantographLowered.
 era-sh:PhaseInfoPantographLowered
	a sh:PropertyShape ; era:affectedProperty era:phaseInfoPantographLowered  ;         era:scope "local";     
    era:affectedClass  era:PhaseInfo;
	rdfs:comment "Indication of existence of phase separation and required information."@en ;
	sh:path era:phaseInfoPantographLowered ;
	sh:datatype xsd:boolean ;
    sh:minCount 1;
    sh:maxCount 1;
	sh:severity sh:Violation ;
	sh:message "Phase info (1.1.1.2.4.1.2): The track has the phase info with the indication whether the pantograph is lowered value, that must be Y/N (boolean).  This error may be due to the track having a PhaseInfo with no value of phaseInfoPantographLowered, more than one value of phaseInfoPantographLowered, or having a value that is not Y/N (boolean)."@en .

# phaseInfoSwitchOffBreaker: 
 era-sh:PhaseInfoShape sh:property era-sh:PhaseInfoSwitchOffBreaker.
 era-sh:PhaseInfoSwitchOffBreaker
	a sh:PropertyShape ; era:affectedProperty era:phaseInfoSwitchOffBreaker  ;         era:scope "local";     
    era:affectedClass  era:PhaseInfo;
	rdfs:comment "Indication of existence of phase separation and required information."@en ;
	sh:path era:phaseInfoSwitchOffBreaker ;
	sh:datatype xsd:boolean ;
	sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "Phase info switchOffBreaker : The track has the phase info with the indication whether the breaker may be switched off value, that must be Y/N (boolean). This error may be due to the track having a PhaseInfo with no value of phaseInfoSwitchOffBreaker, more than one value of phaseInfoSwitchOffBreaker, or having a value that is not Y/N (boolean)."@en .
 

# hasSystemSeparation: # 1.1.1.2.4.2.1
era-sh:RunningTrackShape sh:property era-sh:HasSystemSeparation.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:HasSystemSeparation.
era-sh:HasSystemSeparation
	a sh:PropertyShape ; era:affectedProperty era:hasSystemSeparation  ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
	rdfs:comment "Indication of existence of system separation."@en ;
	era:rinfIndex "1.1.1.2.4.2.1" ;
	sh:path era:hasSystemSeparation ;	
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "hasSystemSeparation (1.1.1.2.4.2.1): The track has at most one existence of system separation value that must be Y/N (boolean). This error may be due to the track having more than one value or to having a value that is not Y/N (boolean)."@en .

# trackSystemSeparationInfo: # 1.1.1.2.4.2.2
era-sh:RunningTrackShape sh:property era-sh:TrackSystemSeparationInfo.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:TrackSystemSeparationInfo.
era-sh:TrackSystemSeparationInfo
	a sh:PropertyShape ; era:affectedProperty era:trackSystemSeparationInfo  ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
	rdfs:comment "Relates the Track with the SystemSeparationInfo. Indication of required several information on system separation."@en ;
	era:rinfIndex "1.1.1.2.4.2.2" ;
	sh:path era:trackSystemSeparationInfo ;
    sh:class era:SystemSeparationInfo;
    # sh:node era-sh:SystemSeparationInfoShape; not implemented in the shacl engine
	sh:severity sh:Violation ;
	sh:message "trackSystemSeparationInfo (1.1.1.2.4.2.2): The track defines a system separation info value that must be an instance of SystemSeparationInfo."@en .

# systemSeparationInfoKm: 
 era-sh:SystemSeparationInfoShape sh:property era-sh:SystemSeparationInfoKm.
 era-sh:SystemSeparationInfoKm
	a sh:PropertyShape ; era:affectedProperty era:systemSeparationInfoKm  ;          era:scope "local";     
    era:affectedClass  era:SystemSeparationInfo;
	rdfs:comment "Indication of required several information on system separation."@en ;
	sh:path era:systemSeparationInfoKm ;
    sh:minCount 1;
    sh:maxCount 1;
	sh:datatype xsd:double ;
	sh:severity sh:Warning ;
	sh:message "System separation info km : The track has a system separation info with the location from the start of the line value (km), that must be a double.This error may be due to the track having a SystemSeparationInfo with no value, more than one value, or  a value that is not a double (real) number. "@en .

# systemSeparationInfoLength: 
 era-sh:SystemSeparationInfoShape sh:property era-sh:SystemSeparationInfoLength.
era-sh:SystemSeparationInfoLength
	a sh:PropertyShape ; era:affectedProperty era:systemSeparationInfoLength  ;          era:scope "local";     
    era:affectedClass  era:SystemSeparationInfo;
	rdfs:comment "Indication of required several information on system separation."@en ;
	sh:path era:systemSeparationInfoLength ;
    sh:minCount 1;
    sh:maxCount 1;
	sh:datatype xsd:integer ;
	sh:severity sh:Violation ;
	sh:message "System separation info length: The track has a system separatione info with the length of the system separation value (length), that must be an integer. This error may be due to the track having a SystemSeparationInfo with no value, more than one value, or  a value that is not an integer."@en .

 # systemSeparationInfoPantographLowered: 
 era-sh:SystemSeparationInfoShape sh:property era-sh:SystemSeparationInfoPantographLowered.
 era-sh:SystemSeparationInfoPantographLowered
	a sh:PropertyShape ; era:affectedProperty era:systemSeparationInfoPantographLowered  ;          era:scope "local";     
    era:affectedClass  era:SystemSeparationInfo;
	rdfs:comment "Indication of required several information on system separation."@en ;
	sh:path era:systemSeparationInfoPantographLowered ;
    sh:minCount 1;
    sh:maxCount 1;
	sh:datatype xsd:boolean ;
	sh:severity sh:Warning;
	sh:message "System separation info pantograph lowered: The track has the system separation info with the indication whether the pantograph is lowered value, that must be Y/N (boolean). This error may be due to the track having a SystemSeparationInfo with no value, more than one value, or  a value that is not Y/N (boolean)."@en .

# systemSeparationInfoSwitchOffBreaker: 
 era-sh:SystemSeparationInfoShape sh:property era-sh:SystemSeparationInfoSwitchOffBreaker.
 era-sh:SystemSeparationInfoSwitchOffBreaker
	a sh:PropertyShape ; era:affectedProperty era:systemSeparationInfoSwitchOffBreaker  ;        era:scope "local";     
	rdfs:comment "Indication of required several information on system separation."@en ;
	sh:path era:systemSeparationInfoSwitchOffBreaker ;
    sh:minCount 1;
    sh:maxCount 1;
    era:affectedClass  era:SystemSeparationInfo;
	sh:datatype xsd:boolean ;
	sh:severity sh:Warning ;
	sh:message "System separation info switchOffBreaker : The track has the system separation info with the indication wether the breaker may be switched off value, that must be Y/N (boolean). This error is due to the track having a SystemSeparationInfo with no value, more than one value, or a value that is not Y/N (boolean)."@en .


# distSignToPhaseEnd: 
era-sh:RunningTrackShape sh:property era-sh:DistSignToPhaseEnd.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:DistSignToPhaseEnd.
era-sh:DistSignToPhaseEnd
	a sh:PropertyShape ; era:affectedProperty era:distSignToPhaseEnd  ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
	rdfs:comment "Specific for route compatibility check on French network. Distance between the signboard authorizing the driver to 'raise pantograph' or 'close the circuit breaker' after passing the phase separation and the end of the phase separation section."@en ;
	sh:path era:distSignToPhaseEnd ;	
	sh:maxCount 1 ;
	sh:datatype xsd:integer ;
	sh:pattern "^([1-9]\\d{1,2}|[0-9])$" ;
	sh:severity sh:Violation ;
	sh:message "distSignToPhaseEnd: The track must have at most one value of the distance between the signboard authorizing the driver to 'raise pantograph' or 'close the circuit breaker' after passing the phase separation and the end of the phase separation section, and the value is an integer. This error is due to the track having more than one value or to having a value that is not an integer."@en .




# permittedContactForce: # 1.1.1.2.5.2
era-sh:RunningTrackShape sh:property era-sh:PermittedContactForce.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:PermittedContactForce.
era-sh:PermittedContactForce
	a sh:PropertyShape ; era:affectedProperty era:permittedContactForce  ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
	rdfs:comment "Indication of contact force allowed expressed in newtons."@en ;
	era:rinfIndex "1.1.1.2.5.2" ;
	sh:path era:permittedContactForce ;
	
	sh:maxCount 1 ;
	sh:datatype xsd:string ;
	sh:severity sh:Violation ;
	sh:message "permittedContactForce (1.1.1.2.5.2): The track must have at most one value of the contact force allowed expressed in newtons. This error is due to the track having more than one value or to having a value that is not a character string."@en .

# automaticDroppingDeviceRequired: # 1.1.1.2.5.3
era-sh:RunningTrackShape sh:property era-sh:AutomaticDroppingDeviceRequired.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:AutomaticDroppingDeviceRequired.
era-sh:AutomaticDroppingDeviceRequired
	a sh:PropertyShape ; era:affectedProperty era:automaticDroppingDeviceRequired  ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
	rdfs:comment "Indication of the requirement of automatic dropping device."@en ;
	era:rinfIndex "1.1.1.2.5.3" ;
	sh:path era:automaticDroppingDeviceRequired ;
	
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "automaticDroppingDeviceRequired (1.1.1.2.5.3): The track must have at most one value of the requirement of automatic dropping device and it is Y/N (boolean). This error is due to the track having more than one value or to having a value that is not Y/N (boolean)."@en .

# verificationCCS: # 1.1.1.3.1.1
era-sh:RunningTrackShape sh:property era-sh:VerificationCCS.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:VerificationCCS.
era-sh:VerificationCCS
	a sh:PropertyShape ; era:affectedProperty era:verificationCCS  ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
	rdfs:comment "Unique number for EC declarations following format requirements specified in the 'Document about practical arrangements for transmitting interoperability documents'."@en ;
	era:rinfIndex "1.1.1.3.1.1" ;
	sh:path era:verificationCCS ;
	sh:datatype xsd:string ;
	sh:pattern "^[A-Z]{2}\\/.{14}\\/(19[0-9][0-9]|20[0-9][0-9]|2100)\\/[0-9]{6}$";
	sh:severity sh:Violation ;
	sh:message "verificationCCS (1.1.1.3.1.1): The track defines the unique number for EC declarations following format requirements specified in the 'Document about practical arrangements for transmitting interoperability documents; the value must be a string that follows the pattern [CC/RRRRRRRRRRRRRR/YYYY/NNNNNN] where the YYYY characters must be a number between 1900 and 2100, and the NNNNNN characters must be digits. This error is due to having a value that does not follow the pattern."@en .






# protectionLegacySystem: # 1.1.1.3.5.3
era-sh:RunningTrackShape sh:property era-sh:ProtectionLegacySystem.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:ProtectionLegacySystem.
era-sh:ProtectionLegacySystem
	a sh:PropertyShape ;
    era:affectedProperty era:protectionLegacySystem;
    era:affectedClass era:RunningTrack;
    era:scope "local";
    rdfs:comment "Indication of which class B system is installed."@en ;
	era:rinfIndex "1.1.1.3.5.3" ;
	sh:path era:protectionLegacySystem ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "protectionLegacySystem (1.1.1.3.5.3): The track has an indication of the class B system that must be an IRI."@en .

era-sh:RunningTrackShape sh:sparql era-sh:ProtectionLegacySystemSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:ProtectionLegacySystemSKOS.
era-sh:ProtectionLegacySystemSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:protectionLegacySystem  ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
    rdfs:comment "Indication of which class B system is installed."@en ;
	era:rinfIndex "1.1.1.3.5.3" ;
    sh:message "Indication of the protectionLegacySystem (1.1.1.3.5.3): The track {$this}  has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list:  http://data.europa.eu/949/concepts/train-protection-legacy-systems/TrainProtectionLegacySystems."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept (era:protectionLegacySystem AS ?path)
    WHERE {
        $this era:protectionLegacySystem ?concept .
        era:protectionLegacySystem era:inSkosConceptScheme ?conceptScheme .
        FILTER (NOT EXISTS {?concept skos:inScheme ?conceptScheme} || REGEX(STR(?concept), "/eratv/"))
	}
""" .







# etcsDegradedSituation: # 1.1.1.3.10.1
era-sh:RunningTrackShape sh:sparql era-sh:EtcsDegradedSituationSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:EtcsDegradedSituationSKOS.


# maximumBrakingDistance: # 1.1.1.3.11.1
era-sh:RunningTrackShape sh:property era-sh:MaximumBrakingDistance.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:MaximumBrakingDistance.
era-sh:MaximumBrakingDistance
	a sh:PropertyShape ; era:affectedProperty era:maximumBrakingDistance  ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
	rdfs:comment "The maximum value of the braking distance [in metres] of a train shall be given for the maximum line speed."@en ;
	era:rinfIndex "1.1.1.3.11.1" ;
	sh:path era:maximumBrakingDistance ;
	sh:maxCount 1 ;
	sh:datatype xsd:integer ;
	sh:pattern "^([1-9]\\d{1,4}|[0-9])$" ;
	sh:severity sh:Violation ;
	sh:message "maximumBrakingDistance (1.1.1.3.11.1): The track must define at most one value of the maximum value of the braking distance [in metres] of a train and it is an integer. This error may be due to the track having more than one value or to having a value that is not an integer."@en .

# hasAdditionalBrakingInformation: # 1.1.1.3.11.2
era-sh:RunningTrackShape sh:property era-sh:HasAdditionalBrakingInformation.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:HasAdditionalBrakingInformation.
era-sh:HasAdditionalBrakingInformation
	a sh:PropertyShape ; era:affectedProperty era:hasAdditionalBrakingInformation  ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
	rdfs:comment "Availability by the IM of additional information as defined in 4.2.2.6.2 (2) Regulation XXX-OPE TSI."@en ;
	era:rinfIndex "1.1.1.3.11.2" ;
	sh:path era:hasAdditionalBrakingInformation ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "hasAdditionalBrakingInformation (1.1.1.3.11.2): The track must define at most one value of the availability by the IM of additional information and it is Y/N (boolean). This error may be due to the track having more than one value or to having a value that is not Y/N (boolean)."@en .

# additionalBrakingInformationDocument: # 1.1.1.3.11.3
era-sh:RunningTrackShape sh:property era-sh:AdditionalBrakingInformationDocument.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:AdditionalBrakingInformationDocument.
era-sh:AdditionalBrakingInformationDocument
	a sh:PropertyShape ; era:affectedProperty era:additionalBrakingInformationDocument  ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
	rdfs:comment "Documents available by the IM relating to braking performance."@en ;
	era:rinfIndex "1.1.1.3.11.3" ;
	sh:path era:additionalBrakingInformationDocument ;		
    sh:class era:Document;
	sh:severity sh:Violation ;
	sh:message "additionalBrakingInformationDocument (1.1.1.3.11.3): The track defines the documents available by the IM relating to braking performance value and it must be a Document."@en .



# currentLimitationRequired: # 1.1.1.2.5.1
era-sh:ContactLineSystemShape sh:property era-sh:CurrentLimitationRequired.
era-sh:CurrentLimitationRequired
	a sh:PropertyShape ;
    era:affectedProperty era:currentLimitationRequired;
    era:affectedClass era:ContactLineSystem ;
    era:scope "local";
	rdfs:comment "Indication of whether an on board current or power limitation function on vehicles is required."@en ;
	era:rinfIndex "1.1.1.2.5.1" ;
	sh:path era:currentLimitationRequired ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "currentLimitationRequired (1.1.1.2.5.1): The track may have a current limitation required value that is a boolean. This error may be due to the track having a value that is not a boolean."@en .

# documentRestrictionPositionContactLineSeparation: # 1.1.1.2.5.5
era-sh:RunningTrackShape sh:property era-sh:DocumentRestrictionPositionContactLineSeparation.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:DocumentRestrictionPositionContactLineSeparation.
era-sh:DocumentRestrictionPositionContactLineSeparation
	a sh:PropertyShape ; 
    era:affectedProperty era:documentRestrictionPositionContactLineSeparation;
    era:affectedClass  era:RunningTrack;
    era:scope "local";
	rdfs:comment "Document with restriction related to the position of Multiple Traction unit(s) to comply with contact line separation."@en ;
	era:rinfIndex "1.1.1.2.5.5" ;
	sh:path era:documentRestrictionPositionContactLineSeparation ;
	sh:class era:Document;
	sh:severity sh:Violation ;
	sh:message "documentRestrictionPositionContactLineSeparation (1.1.1.2.5.5): The track may have a Document with restriction related to the position of Multiple Traction unit(s) to comply with contact line separation value that is a Document. This error may be due to the track having a value that is not a Document."@en .

# documentRestrictionPowerConsumption: # 1.1.1.2.5.4
era-sh:RunningTrackShape sh:property era-sh:DocumentRestrictionPowerConsumption.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:DocumentRestrictionPowerConsumption.
era-sh:DocumentRestrictionPowerConsumption
	a sh:PropertyShape ; 
    era:affectedProperty era:documentRestrictionPowerConsumption;
    era:affectedClass  era:RunningTrack;
    era:scope "local";
	rdfs:comment "Document with restriction related to power consumption of specific electric traction unit(s)."@en ;
	era:rinfIndex "1.1.1.2.5.4" ;
	sh:path era:documentRestrictionPowerConsumption ;
	sh:class era:Document;
	sh:severity sh:Violation ;
	sh:message "documentRestrictionPowerConsumption (1.1.1.2.5.4): The track may have a Document with restriction related to power consumption of specific electric traction unit(s) value that is a Document. This error may be due to the track having a value that is not a Document."@en .
			 
###########################################
# Rules for LinesideDistanceIndication
###########################################

# linesideDistanceIndication 1.1.1.0.0.3
era-sh:RunningTrackShape sh:property era-sh:LinesideDistanceIndication.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:LinesideDistanceIndication.
era-sh:LinesideDistanceIndication
	a sh:PropertyShape ;
    era:affectedProperty era:linesideDistanceIndication ;
	era:affectedClass era:RunningTrack;
	era:scope "local";
	rdfs:comment "Indication of types of appearance of track lineside distance indications."@en ;
	sh:path era:linesideDistanceIndication;
    sh:class era:LinesideDistanceIndication;
    # sh:node era-sh:LinesideDistanceIndicationShape; not implemented in the shacl engine
    sh:maxCount 1;
    era:rinfIndex "1.1.1.0.0.3";
	sh:nodeKind sh:IRI;
	sh:severity sh:Warning ;
	sh:message "linesideDistanceIndication (1.1.1.0.0.3) : The track must have exactly one value of a lineside distance indication that must be an instance of LinesideDistanceIndication. This error may be due to the track having no value, having more than one value or having a value that is not an instance of the class LinesideDistanceIndication."@en .

# linesideDistanceIndication required when RunningTrack is connected to a SectionOfLine
era-sh:RunningTrackShapeWarning sh:sparql era-sh:LinesideDistanceIndicationRequiredForSoL .
era-sh:LinesideDistanceIndicationRequiredForSoL
  a sh:SPARQLConstraint ;
  era:affectedProperty era:linesideDistanceIndication ;
  era:affectedClass era:RunningTrack ;
  era:scope "local" ;
  rdfs:comment "linesideDistanceIndication is required on RunningTrack instances that are connected to a SectionOfLine via era:isPartOf or era:hasPart."@en ;
  sh:message "linesideDistanceIndication (1.1.1.0.0.3): The running track {$this} is connected to a SectionOfLine but does not have a linesideDistanceIndication value. A RunningTrack that is part of a SectionOfLine (via era:isPartOf or era:hasPart) must have exactly one era:linesideDistanceIndication."@en ;
  sh:prefixes era: ;
  sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    SELECT $this (era:linesideDistanceIndication AS ?path)
    WHERE {
        $this a era:RunningTrack .
        {
            $this era:isPartOf ?sol .
            ?sol a era:SectionOfLine .
        }
        UNION
        {
            ?sol a era:SectionOfLine ;
                 era:hasPart $this .
        }
        FILTER NOT EXISTS { $this era:linesideDistanceIndication ?ldi }
    }
""" .

			 
# linesideDistanceIndicationPositioning: 
era-sh:LinesideDistanceIndicationShape sh:property era-sh:LinesideDistanceIndicationPositioning.
era-sh:LinesideDistanceIndicationPositioning
	a sh:PropertyShape ;
    era:affectedProperty era:linesideDistanceIndicationPositioning ;
    era:affectedClass era:LinesideDistanceIndication ;
	era:scope "local" ;
	rdfs:comment "Indication of the side along the track where the lineside indication is positioned (left or right)."@en ;
	sh:path era:linesideDistanceIndicationPositioning ;
    #sh:minCount 1 ;
	sh:maxCount 1 ;
	sh:nodeKind sh:IRI;
	sh:severity sh:Violation ;
	sh:message "LinesideDistanceIndicationPositioning: The track must have at most one value of the lineside distance indication positioning. This error may be due to the track having no value, more than one value or to having a value that is not an IRI."@en .

# linesideDistanceIndicationPositioning: 
era-sh:RunningTrackShape sh:sparql era-sh:LinesideDistanceIndicationPositioningSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:LinesideDistanceIndicationPositioningSKOS.
era-sh:LinesideDistanceIndicationPositioningSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:linesideDistanceIndicationPositioning  ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
   rdfs:comment "Indication of the side along the track where the lineside indication is positioned (left or right)."@en ;
    sh:message "Indication of the linesideDistanceIndicationPositioning: The track {$this} has a LinesideDistanceIndication {?linesideDistanceIndication}  with a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list:  http://data.europa.eu/949/concepts/lineside-distance-indication-positioning/LinesideDistanceIndicationPositioning."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?linesideDistanceIndication  ?concept (era:linesideDistanceIndicationPositioning AS ?path)
    WHERE {
        $this era:linesideDistanceIndication ?linesideDistanceIndication .
        ?linesideDistanceIndication era:linesideDistanceIndicationPositioning ?concept .
        era:linesideDistanceIndicationPositioning era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# linesideDistanceIndicationAppearance: 
era-sh:LinesideDistanceIndicationShape sh:property era-sh:LinesideDistanceIndicationAppearance.
era-sh:LinesideDistanceIndicationAppearance
	a sh:PropertyShape ;
    era:affectedProperty era:linesideDistanceIndicationAppearance ;
    era:affectedClass era:LinesideDistanceIndication;
    era:scope "local" ;
	rdfs:comment "Indication of types of appearance of track lineside distance indications."@en ;
	sh:path era:linesideDistanceIndicationAppearance ;
    sh:minCount 1 ;
	# sh:maxCount 1 ;
	sh:nodeKind sh:IRI;
	sh:severity sh:Violation ;
	sh:message "linesideDistanceIndicationAppearance: The track must have at least one value of the lineside distance indication appearance. This error may be due to the track having no value, or to having a value that is not an IRI."@en .

# linesideDistanceIndicationAppearance: 
era-sh:RunningTrackShape sh:sparql era-sh:LinesideDistanceIndicationAppearanceSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:LinesideDistanceIndicationAppearanceSKOS.
era-sh:LinesideDistanceIndicationAppearanceSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:linesideDistanceIndicationAppearance  ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
   rdfs:comment "Indication of types of appearance of track lineside distance indications."@en ;
    sh:message "Indication of the linesideDistanceIndicationAppearance: The track {$this} has a LinesideDistanceIndication {?linesideDistanceIndication} that has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list:  http://data.europa.eu/949/concepts/lineside-distance-indication-appearance/LinesideDistanceIndicationAppearance."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?linesideDistanceIndication ?concept (era:linesideDistanceIndicationAppearance AS ?path)
    WHERE {
        $this era:linesideDistanceIndication ?linesideDistanceIndication .
        ?linesideDistanceIndication era:linesideDistanceIndicationAppearance ?concept .
        era:linesideDistanceIndicationAppearance era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# linesideDistanceIndicationFrequency: 
era-sh:LinesideDistanceIndicationShape sh:property era-sh:LinesideDistanceIndicationFrequency.
era-sh:LinesideDistanceIndicationFrequency
	a sh:PropertyShape ; 
    era:affectedProperty era:linesideDistanceIndicationFrequency ;
    era:affectedClass era:LinesideDistanceIndication ;
    era:scope "local" ;
	rdfs:comment "Frequency of track lineside distance indications.."@en ;
	sh:path era:linesideDistanceIndicationFrequency ;
    sh:minCount 1 ;
	sh:maxCount 1 ;
	sh:datatype xsd:integer;
	sh:severity sh:Violation ;
	sh:message "linesideDistanceIndicationFrequency: The track must have at most one value of the lineside distance indication frequency. This error may be due to the track having a LineDistanceIndication with no value, more than one value or to having a value that is not an integer."@en .

# 1.1.1.1.7.3	accelerationLevelCrossing applicability
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:AccelerationLevelCrossingApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:AccelerationLevelCrossingApplicability .
era-sh:AccelerationLevelCrossingApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:accelerationLevelCrossing;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Existence of limit for acceleration of train if stopping or recovering speed close to a level crossing expressed in a specific reference acceleration curve."@en;
	era:rinfIndex "1.1.1.1.7.3" ;
    sh:message "accelerationLevelCrossing (1.1.1.1.7.3): This error is due to the track {?trackLabel} , violating the rule: Applicable only when selected value of parameter 1.1.1.1.7.2 is ‘Y’"@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    SELECT DISTINCT $this ?trackLabel (era:accelerationLevelCrossing AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?trackLabel0 } .
        BIND(COALESCE(?trackLabel0, "unknown label") AS ?trackLabel)
        FILTER EXISTS { $this era:hasLevelCrossings ?value } .
        FILTER NOT EXISTS { $this era:accelerationLevelCrossing ?value } .
    }
    """ .

# 1.1.1.2.4.1.2	trackPhaseInfo applicability
era-sh:RunningTrackShapeWarning sh:sparql era-sh:TrackPhaseInfoApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:TrackPhaseInfoApplicability.
era-sh:TrackPhaseInfoApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:trackPhaseInfo;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Relates the Track with PhaseInfo. Indication of required several information on phase separation."@en;
	era:rinfIndex "1.1.1.2.4.1.2" ;
    sh:message "trackPhaseInfo (1.1.1.2.4.1.2): This error is due to the track {?trackLabel} , violating the rule: Applicable when in parameter 1.1.1.2.4.1.1 selected option is ‘Y’"@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    SELECT DISTINCT $this ?trackLabel (era:trackPhaseInfo AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?trackLabel0 } .
        BIND(COALESCE(?trackLabel0, "unknown label") AS ?trackLabel)
        $this era:hasPhaseSeparation true .
        FILTER NOT EXISTS { $this era:trackPhaseInfo ?value } .
    }
    """ .



# 1.1.1.2.4.2.2	trackSystemSeparationInfo applicability
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:TrackSystemSeparationInfoApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:TrackSystemSeparationInfoApplicability .
era-sh:TrackSystemSeparationInfoApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:trackSystemSeparationInfo;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Relates the Track with the SystemSeparationInfo. Indication of required several information on system separation."@en;
	era:rinfIndex "1.1.1.2.4.2.2" ;
    sh:message "trackSystemSeparationInfo (1.1.1.2.4.2.2): This error is due to the track {?trackLabel} , violating the rule: Applicable when in parameter 1.1.1.2.4.2.1 selected option is ‘Y’"@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    SELECT DISTINCT $this ?trackLabel (era:trackSystemSeparationInfo AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?trackLabel0 } .
        BIND(COALESCE(?trackLabel0, "unknown label") AS ?trackLabel)
        $this era:hasSystemSeparation true .
        FILTER NOT EXISTS { $this era:trackSystemSeparationInfo ?value } .
    }
    """ .
   
# 1.1.1.2.3.1	tsiPantographHead applicability
era-sh:RunningTrackShape sh:sparql era-sh:TsiPantographHeadApplicability .
era-sh:CommonCharacteristicsSubsetShape  sh:sparql era-sh:TsiPantographHeadApplicability.
era-sh:TsiPantographHeadApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:tsiPantographHead;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication of TSI compliant pantograph heads which are allowed to be used."@en;
	era:rinfIndex "1.1.1.2.3.1" ;
    sh:message "tsiPantographHead (1.1.1.2.3.1): This error is due to the track {?trackLabel} , violating the rule: This parameter is applicable ('Y') only if “Overhead contact line (OCL)” is selected for 1.1.1.2.2.1.1."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    SELECT DISTINCT $this ?trackLabel (era:tsiPantographHead AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?trackLabel0 } .
        BIND(COALESCE(?trackLabel0, "unknown label") AS ?trackLabel)
        $this era:contactLineSystem ?cls .
        ?cls era:contactLineSystemType ?clsType .
        FILTER (?clsType != <http://data.europa.eu/949/concepts/contact-line-systems/10>)
        FILTER EXISTS { $this era:tsiPantographHead ?value } .
    }
    """ .


# 1.1.1.2.3.3	trackRaisedPantographsDistanceAndSpeed applicability
era-sh:RunningTrackShape sh:sparql era-sh:TrackRaisedPantographDistanceAndSpeedApplicability .
era-sh:CommonCharacteristicsSubsetShape  sh:sparql era-sh:TrackRaisedPantographDistanceAndSpeedApplicability.
era-sh:TrackRaisedPantographDistanceAndSpeedApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:trackRaisedPantographsDistanceAndSpeed;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Relates the track with the class RaisedPantographsDistanceAndSpeed. Indication of maximum number of raised pantographs per train allowed and minimum spacing centre line to centre line of adjacent pantograph heads, expressed in metres, at the given speed."@en;
	era:rinfIndex "1.1.1.2.3.3" ;
    sh:message "trackRaisedPantographsDistanceAndSpeed (1.1.1.2.3.3): This error is due to the track {?trackLabel} , violating the rule: This parameter is applicable ('Y') only if “Overhead contact line (OCL)” is selected for 1.1.1.2.2.1.1."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    SELECT DISTINCT $this ?trackLabel (era:trackRaisedPantographsDistanceAndSpeed AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?trackLabel0 } .
        BIND(COALESCE(?trackLabel0, "unknown label") AS ?trackLabel)
        $this era:contactLineSystem ?cls .
        ?cls era:contactLineSystemType ?clsType .
        FILTER (?clsType != <http://data.europa.eu/949/concepts/contact-line-systems/10>) .
        FILTER EXISTS { $this era:trackRaisedPantographsDistanceAndSpeed ?value } .
    }
    """ .

# 1.1.1.2.4.1.1	hasPhaseSeparation applicability
era-sh:RunningTrackShape sh:sparql era-sh:HasPhaseSeparationApplicability .
era-sh:CommonCharacteristicsSubsetShape  sh:sparql era-sh:HasPhaseSeparationApplicability.
era-sh:HasPhaseSeparationApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:hasPhaseSeparation;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication of existence of phase separation and required information."@en;
	era:rinfIndex "1.1.1.2.4.1.1" ;
    sh:message "hasPhaseSeparation (1.1.1.2.4.1.1): This error is due to the track {?trackLabel} , violating the rule: This parameter is applicable ('Y') only if “Overhead contact line (OCL)” is selected for 1.1.1.2.2.1.1."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    SELECT DISTINCT $this ?trackLabel (era:hasPhaseSeparation AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?trackLabel0 } .
        BIND(COALESCE(?trackLabel0, "unknown label") AS ?trackLabel)
        $this era:contactLineSystem ?cls .
        ?cls era:contactLineSystemType ?clsType .
        FILTER (?clsType != <http://data.europa.eu/949/concepts/contact-line-systems/10>) .
        FILTER EXISTS { $this era:hasPhaseSeparation ?value } .
    }
    """ .

# 1.1.1.2.3.4	contactStripMaterial applicability
era-sh:RunningTrackShape sh:sparql era-sh:ContactStripMaterialApplicability .
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:ContactStripMaterialApplicability.
era-sh:ContactStripMaterialApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:contactStripMaterial;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication of which contact strip materials are permitted to be used."@en;
	era:rinfIndex "1.1.1.2.3.4" ;
    sh:message "contactStripMaterial (1.1.1.2.3.4): This error is due to the track {?trackLabel} , violating the rule: This parameter is applicable ('Y') only if “Overhead contact line (OCL)” is selected for 1.1.1.2.2.1.1."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    SELECT DISTINCT $this ?trackLabel (era:contactStripMaterial AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?trackLabel0 } .
        BIND(COALESCE(?trackLabel0, "unknown label") AS ?trackLabel)
        $this era:contactLineSystem ?cls .
        ?cls era:contactLineSystemType ?clsType .
        FILTER (?clsType != <http://data.europa.eu/949/concepts/contact-line-systems/10>) .
        FILTER EXISTS { $this era:contactStripMaterial ?value } .
    }
    """ .

# 1.1.1.2.3.2	otherPantographHead applicability
era-sh:RunningTrackShape sh:sparql era-sh:OtherPantographHeadApplicability .
era-sh:CommonCharacteristicsSubsetShape sh:sparql  era-sh:OtherPantographHeadApplicability.
era-sh:OtherPantographHeadApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:otherPantographHead;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication of pantograph heads which are allowed to be used."@en;
	era:rinfIndex "1.1.1.2.3.2" ;
    sh:message "otherPantographHead (1.1.1.2.3.2): This error is due to the track {?trackLabel} , violating the rule: This parameter is applicable ('Y') only if “Overhead contact line (OCL)” is selected for 1.1.1.2.2.1.1."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    SELECT DISTINCT $this ?cls ?trackLabel (era:otherPantographHead AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?trackLabel0 } .
        BIND(COALESCE(?trackLabel0, "unknown label") AS ?trackLabel)
        $this era:contactLineSystem ?cls .
        ?cls era:contactLineSystemType ?clsType .
        FILTER (?clsType != <http://data.europa.eu/949/concepts/contact-line-systems/10>) .
        FILTER EXISTS { $this era:otherPantographHead ?value } .
    }
    """ .

# 1.1.1.2.4.2.1	hasSystemSeparation applicability
era-sh:RunningTrackShape sh:sparql era-sh:HasSystemSeparationApplicability .
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:HasSystemSeparationApplicability.
era-sh:HasSystemSeparationApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:hasSystemSeparation;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication of existence of system separation."@en;
	era:rinfIndex "1.1.1.2.4.2.1" ;
    sh:message "hasSystemSeparation (1.1.1.2.4.2.1): This error is due to the track {?trackLabel} , violating the rule: This parameter is applicable ('Y') only if “Overhead contact line (OCL)” is selected for 1.1.1.2.2.1.1."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    SELECT DISTINCT $this ?trackLabel (era:hasSystemSeparation AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?trackLabel0 } .
        BIND(COALESCE(?trackLabel0, "unknown label") AS ?trackLabel)
        $this era:contactLineSystem ?cls .
        ?cls era:contactLineSystemType ?clsType .
        FILTER (?clsType != <http://data.europa.eu/949/concepts/contact-line-systems/10>) .
        FILTER EXISTS { $this era:hasSystemSeparation ?value } .
    }
    """ .

# 1.1.1.2.5.2	permittedContactForce applicability
era-sh:RunningTrackShape sh:sparql era-sh:PermittedContactForceApplicability .
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:PermittedContactForceApplicability.
era-sh:PermittedContactForceApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:permittedContactForce;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication of contact force allowed expressed in newton."@en;
	era:rinfIndex "1.1.1.2.5.2" ;
    sh:message "permittedContactForce (1.1.1.2.5.2): This error is due to the track {?trackLabel} , violating the rule: This parameter is applicable ('Y') only if “Overhead contact line (OCL)” is selected for 1.1.1.2.2.1.1."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    SELECT DISTINCT $this ?trackLabel (era:permittedContactForce AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?trackLabel0 } .
        BIND(COALESCE(?trackLabel0, "unknown label") AS ?trackLabel)
        $this era:contactLineSystem ?cls .
        ?cls era:contactLineSystemType ?clsType .
        FILTER (?clsType != <http://data.europa.eu/949/concepts/contact-line-systems/10>) .
        FILTER EXISTS { $this era:permittedContactForce ?value } .
    }
    """ .

# 1.1.1.2.5.3	automaticDroppingDeviceRequired applicability
era-sh:RunningTrackShape sh:sparql era-sh:AutomaticDroppingDeviceRequiredApplicability .
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:AutomaticDroppingDeviceRequiredApplicability.
era-sh:AutomaticDroppingDeviceRequiredApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:automaticDroppingDeviceRequired;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication of whether an automatic dropping device (ADD) required on the vehicle."@en;
	era:rinfIndex "1.1.1.2.5.3" ;
    sh:message "automaticDroppingDeviceRequired (1.1.1.2.5.3): This error is due to the track {?trackLabel} , violating the rule: This parameter is applicable ('Y') only if “Overhead contact line (OCL)” is selected for 1.1.1.2.2.1.1."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    SELECT DISTINCT $this ?trackLabel (era:automaticDroppingDeviceRequired AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?trackLabel0 } .
        BIND(COALESCE(?trackLabel0, "unknown label") AS ?trackLabel)
        $this era:contactLineSystem ?cls .
        ?cls era:contactLineSystemType ?clsType .
        FILTER (?clsType != <http://data.europa.eu/949/concepts/contact-line-systems/10>) .
        FILTER EXISTS { $this era:automaticDroppingDeviceRequired ?value } .
    }
    """ .

# 1.1.1.2.5.1	currentLimitationRequired applicability
era-sh:RunningTrackShape sh:sparql era-sh:CurrentLimitationRequiredApplicability .
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:CurrentLimitationRequiredApplicability.
era-sh:CurrentLimitationRequiredApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:currentLimitationRequired;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication of whether an on board current or power limitation function on vehicles is required."@en;
	era:rinfIndex "1.1.1.2.5.1" ;
    sh:message "currentLimitationRequired (1.1.1.2.5.1): This error is due to the track {?trackLabel} , violating the rule: When 'not electrified' is chosen in parameter 1.1.1.2.2.1.1, then this parameter is not applicable selection ‘N’."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    SELECT DISTINCT $this ?trackLabel (era:currentLimitationRequired AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?trackLabel0 } .
        BIND(COALESCE(?trackLabel0, "unknown label") AS ?trackLabel)
        $this era:contactLineSystem ?cls .
        ?cls era:contactLineSystemType ?clsType .
        FILTER (?clsType = <http://data.europa.eu/949/concepts/contact-line-systems/40>) .
        FILTER EXISTS { $this era:currentLimitationRequired ?value } .
    }
    """ .

# 1.1.1.1.4.4	hasBallast aaplicability
era-sh:RunningTrackShape sh:sparql era-sh:HasBallastApplicability .
era-sh:CommonCharacteristicsSubsetShape sh:sparql  era-sh:HasBallastApplicability.
era-sh:HasBallastApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:hasBallast;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Specifies whether track construction is with sleepers embedded in ballast or not."@en;
	era:rinfIndex "1.1.1.1.4.4" ;
    sh:message "hasBallast (1.1.1.1.4.4): This error is due to the track {?trackLabel} , violating the rule: Y for tracks with permitted speed (parameter 1.1.1.1.2.5) greater than 250km/h."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    SELECT DISTINCT $this ?trackLabel (era:hasBallast AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?trackLabel0 } .
        BIND(COALESCE(?trackLabel0, "unknown label") AS ?trackLabel)
        $this era:maximumPermittedSpeed ?mps .
        FILTER (?mps > 250) .
        FILTER NOT EXISTS { $this era:hasBallast ?value } .
    }
    """ .

# 1.1.1.1.6.5	magneticBrakingConditionsDocument applicability
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:MagneticBrakingConditionsDocumentApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:MagneticBrakingConditionsDocumentApplicability .
era-sh:MagneticBrakingConditionsDocumentApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:magneticBrakingConditionsDocument;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Electronic document available in two EU languages from the IM stored by the Agency with conditions for the use of magnetic brakes identified in 1.1.1.1.6.3."@en;
	era:rinfIndex "1.1.1.1.6.5" ;
    sh:message "magneticBrakingConditionsDocument (1.1.1.1.6.5): This error is due to the track {?trackLabel} , violating the rule: Y if the answer to 1.1.1.1.6.3 / Use of magnetic brakes is “allowed under conditions” or “allowed under conditions only for emergency brake”."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    SELECT DISTINCT $this ?trackLabel (era:magneticBrakingConditionsDocument AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?trackLabel0 } .
        BIND(COALESCE(?trackLabel0, "unknown label") AS ?trackLabel)
        $this era:magneticBraking ?mb .
        FILTER (?mb = <http://data.europa.eu/949/concepts/magnetic-braking/20> || ?mb = <http://data.europa.eu/949/concepts/magnetic-braking/30>) .
        FILTER NOT EXISTS { $this era:magneticBrakingConditionsDocument ?value } .
    }
    """ .


# 1.1.1.3.11.3	additionalBrakingInformationDocument applicability
era-sh:RunningTrackShape sh:sparql era-sh:AdditionalBrakingInformationDocumentApplicability .
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:AdditionalBrakingInformationDocumentApplicability.
era-sh:AdditionalBrakingInformationDocumentApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:additionalBrakingInformationDocument;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Electronic document available in two EU languages from the IM stored by the Agency providing additional information as defined in point (2) of point 4.2.2.6.2 of TSI OPE."@en;
	era:rinfIndex "1.1.1.3.11.3" ;
    sh:message "additionalBrakingInformationDocument (1.1.1.3.11.3): This error is due to the track {?trackLabel} , violating the rule: Y in case of Y for 1.1.1.3.11.2."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    SELECT DISTINCT $this ?trackLabel (era:additionalBrakingInformationDocument AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?trackLabel0 } .
        BIND(COALESCE(?trackLabel0, "unknown label") AS ?trackLabel)
        $this era:hasAdditionalBrakingInformation true .
        FILTER NOT EXISTS { $this era:additionalBrakingInformationDocument ?value } .
    }
    """ .

# 1.1.1.1.6.4	eddyCurrentBrakingConditionsDocument applicability
era-sh:RunningTrackShape sh:sparql era-sh:EddyCurrentBrakingConditionsDocumentApplicability .
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:EddyCurrentBrakingConditionsDocumentApplicability.
era-sh:EddyCurrentBrakingConditionsDocumentApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:eddyCurrentBrakingConditionsDocument;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Electronic document available in two EU languages from the IM stored by the Agency with conditions for the use of eddy current brakes identified in 1.1.1.1.6.2."@en;
	era:rinfIndex "1.1.1.1.6.4" ;
    sh:message "eddyCurrentBrakingConditionsDocument (1.1.1.1.6.4): This error is due to the track {?trackLabel} , violating the rule: Y in case of Y for 1.1.1.1.6.2 Use of eddy current brakes is “allowed under conditions” or “allowed under conditions only for emergency brake””."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    SELECT DISTINCT $this ?trackLabel (era:eddyCurrentBrakingConditionsDocument AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?trackLabel0 } .
        BIND(COALESCE(?trackLabel0, "unknown label") AS ?trackLabel)
        $this era:eddyCurrentBraking ?ecb .
        FILTER (?ecb = <http://data.europa.eu/949/concepts/eddy-current-braking/20> || ?ecb = <http://data.europa.eu/949/concepts/eddy-current-braking/40>) .
        FILTER NOT EXISTS { $this era:eddyCurrentBrakingConditionsDocument ?value } .
    }
    """ .




# conditionalRegenerativeBrake: # 1.1.1.2.2.4
era-sh:ContactLineSystemShape sh:property era-sh:ConditionalRegenerativeBrake .
era-sh:ConditionalRegenerativeBrake
	a sh:PropertyShape ;
    era:affectedProperty era:conditionalRegenerativeBrake;
    era:affectedClass era:ContactLineSystem ;
    era:scope "local";
	rdfs:comment "Indication whether regenerative braking is permitted, not permitted, or permitted under specific conditions."@en ;
	era:rinfIndex "1.1.1.2.2.4" ;
	sh:path era:conditionalRegenerativeBrake ;
	sh:nodeKind sh:IRI ;
    sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "conditionalRegenerativeBrake (1.1.1.2.2.4): The track defines if the regenerative brake is permitted. This error is due to having more than one value for this property or having a value that is not  an IRI."@en .

# conditionalRegenerativeBrake: # 1.1.1.2.2.4
era-sh:RunningTrackShape sh:sparql era-sh:ConditionalRegenerativeBrakeSKOS .
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:ConditionalRegenerativeBrakeSKOS .
era-sh:ConditionalRegenerativeBrakeSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:conditionalRegenerativeBrake;
    era:affectedClass  era:RunningTrack;
    era:scope "local";  
    rdfs:comment "Indication whether regenerative braking is permitted, not permitted, or permitted under specific conditions. "@en ;
	era:rinfIndex ".1.1.2.2.4" ;
    sh:message "conditionalRegenerativeBrake (1.1.1.2.2.4):): The track {$this} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/regenerative-braking/RegenerativeBraking."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept (era:conditionalRegenerativeBrake AS ?path)
    WHERE {
        $this era:conditionalRegenerativeBrake ?concept .
        era:conditionalRegenerativeBrake era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# conditionsUseReflectivePlates: # 1.1.1.1.7.12.1
era-sh:RunningTrackShape sh:property era-sh:ConditionsUseReflectivePlates.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:ConditionsUseReflectivePlates.
era-sh:ConditionsUseReflectivePlates
    a sh:PropertyShape ; era:affectedProperty era:conditionsUseReflectivePlates  ;     era:affectedClass  era:RunningTrack, era:CommonCharacteristicsSubset;     era:scope "local";
    rdfs:comment "Details of any conditions for using the reflective plates on freight corridors. Specific case for Portugal and Spain until 1.1.2025 and Belgium and France until 1.1.2026."@en ;
    era:rinfIndex "1.1.1.1.7.12.1" ;
    sh:path era:conditionsUseReflectivePlates;
    sh:nodeKind sh:IRI;
    sh:severity sh:Violation ;
    sh:message "conditionsUseReflectivePlates (1.1.1.1.7.12.1): The track may have a value of the conditions for use of reflective plates. This error may be due to the track having a value that is not an IRI."@en .


# conditionsUseReflectivePlates: # 1.1.1.1.7.12.1
era-sh:RunningTrackShape sh:sparql era-sh:ConditionsUseReflectivePlatesSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:ConditionsUseReflectivePlatesSKOS.
era-sh:ConditionsUseReflectivePlatesSKOS
    a sh:SPARQLConstraint ;
    era:affectedProperty era:conditionsUseReflectivePlates  ;     era:affectedClass  era:RunningTrack, era:CommonCharacteristicsSubset;     era:scope "local";
    rdfs:comment "Details of any conditions for using the reflective plates on freight corridors. Specific case for Portugal and Spain until 1.1.2025 and Belgium and France until 1.1.2026."@en ;
    era:rinfIndex "1.1.1.1.7.12.1" ;
    sh:severity sh:Violation ;
    sh:message "Indication of the conditionsUseReflectivePlates (1.1.1.1.7.12.1): The track {$this} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list:  http://data.europa.eu/949/concepts/conditions-use-reflective-plates/ConditionsUseReflectivePlates."@en ;
    sh:prefixes era:;
    sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?concept (era:conditionsUseReflectivePlates AS ?path)
    WHERE {
        $this era:conditionsUseReflectivePlates ?concept .
        era:conditionsUseReflectivePlates era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .



# etcs 1.1.1.3.2: 
era-sh:RunningTrackShape sh:property era-sh:Etcs.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:Etcs.
era-sh:Etcs
	a sh:PropertyShape ; era:affectedProperty era:etcs  ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
	rdfs:comment "European Train Control System (ETCS) application level supported by the track side equipment."@en ;
	sh:path era:etcs;
    sh:class era:ETCS;
    # sh:maxCount 1;
    era:rinfIndex "1.1.1.3.2";
	sh:nodeKind sh:IRI;
	sh:severity sh:Violation ;
	sh:message "etcs (1.1.1.3.2) : The track may have a value of a European Train Control System (ETCS) that must be an instance of ETCS. This error may be due to the track having a value that is not an instance of the class ETCS."@en .



# standardCombinedTransportContainers: # 1.1.1.1.3.8
era-sh:RunningTrackShape sh:property era-sh:StandardCombinedTransportContainers .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:StandardCombinedTransportContainers .
era-sh:StandardCombinedTransportContainers
	a sh:PropertyShape ;
    era:affectedProperty era:standardCombinedTransportContainers;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Coding for combined transport for containers (for all freight and mixed-traffic lines) in accordance with the specification referenced in Appendix A-1, index [B]."@en ;
	era:rinfIndex "1.1.1.1.3.8" ;
	sh:path era:standardCombinedTransportContainers ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "standardCombinedTransportContainers (1.1.1.1.3.8): The track defines a standard combined transport profile number for containers. This error is due to having  a value that is not  an IRI."@en .

# standardCombinedTransportContainers: # 1.1.1.1.3.8
era-sh:RunningTrackShape sh:sparql era-sh:StandardCombinedTransportContainersSKOS .
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:StandardCombinedTransportContainersSKOS .
era-sh:StandardCombinedTransportContainersSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:standardCombinedTransportContainers;
    era:affectedClass  era:RunningTrack;
    era:scope "local";  
    rdfs:comment "Coding for combined transport for containers (for all freight and mixed-traffic lines) in accordance with the specification referenced in Appendix A-1, index [B]."@en ;
	era:rinfIndex ".1.1.1.1.3.8" ;
    sh:message "standardCombinedTransportContainers (1.1.1.1.3.8):): The track {$this} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/standard-combined-transport-containers/StandardCombinedTransportContainers."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept (era:standardCombinedTransportContainers AS ?path)
    WHERE {
        $this era:standardCombinedTransportContainers ?concept .
        era:standardCombinedTransportContainers era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# standardCombinedTransportRollerUnits: # 1.1.1.1.3.9
era-sh:RunningTrackShape sh:property era-sh:StandardCombinedRollerUnits .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:StandardCombinedRollerUnits .
era-sh:StandardCombinedRollerUnits
	a sh:PropertyShape ;
    era:affectedProperty era:standardCombinedTransportRollerUnits;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Coding for combined transport for roller units (for all freight and mixed-traffic lines) in accordance with the specification referenced in Appendix A-1, index [B]."@en ;
	era:rinfIndex "1.1.1.1.3.9" ;
	sh:path era:standardCombinedTransportRollerUnits ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "standardCombinedTransportRollerUnits (1.1.1.1.3.9): The track defines a standard combined transport profile number for roller units. This error is due to having  or having a value that is not  an IRI."@en .

# standardCombinedTransportRollerUnits: # 1.1.1.1.3.9
era-sh:RunningTrackShape sh:sparql era-sh:StandardCombinedRollerUnitsSKOS .
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:StandardCombinedRollerUnitsSKOS .
era-sh:StandardCombinedRollerUnitsSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:standardCombinedTransportRollerUnits;
    era:affectedClass  era:RunningTrack;
    era:scope "local";  
    rdfs:comment "Coding for combined transport for roller units (for all freight and mixed-traffic lines) in accordance with the specification referenced in Appendix A-1, index [B]."@en ;
	era:rinfIndex "1.1.1.1.3.9" ;
    sh:message "standardCombinedTransportRollerUnits (1.1.1.1.3.9):): The track {$this} in the Section of Line {$this}  has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/standard-combined-transport-roller-units/StandardCombinedTransportRollerUnits."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept (era:standardCombinedTransportRollerUnits AS ?path)
    WHERE {
        $this era:standardCombinedTransportRollerUnits ?concept .
        era:standardCombinedTransportRollerUnits era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# trainDetectionSystem 1.1.1.3.4
era-sh:RunningTrackShape sh:property era-sh:TrainDetectionSystem.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:TrainDetectionSystem.
era-sh:TrainDetectionSystem
	a sh:PropertyShape ; era:affectedProperty era:trainDetectionSystem  ;     era:affectedClass  era:RunningTrack;     era:scope "local";     
	rdfs:comment "Train detection systems installed in the section of line."@en ;
	sh:path era:trainDetectionSystem;
    sh:class era:TrainDetectionSystem;
    # sh:maxCount 1;
    era:rinfIndex "1.1.1.3.4";
	sh:nodeKind sh:IRI;
	sh:severity sh:Violation ;
	sh:message "trainDetectionSystem (1.1.1.3.4) : The track may have a value of a train detection system that must be an instance of TrainDetectionSystem. This error may be due to the track having a value that is not an instance of the class TrainDetectionSystem."@en .

###############################
### SubsidiaryLocation shape ##
###############################

era-sh:SubsidiaryLocationShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:SubsidiaryLocation.



# allocationCompany
era-sh:SubsidiaryLocationShape sh:property era-sh:AllocationCompany .
era-sh:AllocationCompany
	a sh:PropertyShape;
    era:affectedClass era:SubsidiaryLocation;
    era:affectedProperty era:allocationCompany ;
    era:scope "local";
	rdfs:comment "The organisation in charge to allocate the code for the subsidiary location. "@en ;
	sh:path era:allocationCompany ;
    sh:nodeKind sh:IRI ;
    sh:class era:OrganisationRole;
	sh:severity sh:Violation ;
	sh:message "allocationCompany: An instance of subsidiary location may have a value for allocation company. This error may be due to having a value that is not an IRI or that does not point to an instance of OrganisationRole."@en .

# linkedToPrimaryLocation
era-sh:SubsidiaryLocationShape sh:property era-sh:LinkedToPrimaryLocation .
era-sh:LinkedToPrimaryLocation
	a sh:PropertyShape;
    era:affectedClass era:SubsidiaryLocation;
    era:affectedProperty era:linkedToPrimaryLocation ;
    era:scope "local";
	rdfs:comment "Linked to primary location."@en ;
	sh:path era:linkedToPrimaryLocation ;
    sh:nodeKind sh:IRI ;
    sh:class era:PrimaryLocation;
	sh:severity sh:Violation ;
	sh:message "linkedToPrimaryLocation: An instance of subsidiary location may have a value for linkedToPrimaryLocation. This error may be due to having a value that is not an IRI or that does not point to an instance of PrimaryLocation."@en .

# subsidiaryLocationType
era-sh:SubsidiaryLocationShape sh:property era-sh:SubsidiaryLocationType .
era-sh:SubsidiaryLocationType
	a sh:PropertyShape;
    era:affectedClass era:SubsidiaryLocation;
    era:affectedProperty era:subsidiaryLocationType ;
    era:scope "local";
	rdfs:comment "Subsidiary location type."@en ;
	sh:path era:subsidiaryLocationType ;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "subsidiaryLocationType: An instance of subsidiary location may have a value for subsidiary location type. This error may be due to having a value that is not an IRI."@en .

# subsidiaryLocationType
era-sh:SubsidiaryLocationShape sh:sparql era-sh:SubsidiaryLocationTypeSKOS .
era-sh:SubsidiaryLocationTypeSKOS
	a sh:SPARQLConstraint ;
    era:affectedClass era:SubsidiaryLocation;
    era:affectedProperty era:subsidiaryLocationType ;
    era:scope "local";
	rdfs:comment "Subsidiary location type."@en ;
	sh:message "subsidiaryLocationType: The Subsidiary Location {$this} (label {?slLabel}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/subsidiary-location-types/SubsidiaryLocationTypes."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

    SELECT $this ?concept ?slLabel (era:subsidiaryLocationType AS ?path)
    WHERE {
      OPTIONAL { $this rdfs:label ?slLabel0 } .
      BIND(COALESCE(?slLabel0, "unknown label") AS ?slLabel)
 	    $this era:subsidiaryLocationType ?concept .
      era:subsidiaryLocationType era:inSkosConceptScheme ?conceptScheme .
      FILTER NOT EXISTS { ?concept skos:inScheme ?conceptScheme . }
	}
""" .

# subsidiaryLocationName
# subsidiaryLocationName can be multilingual 
era-sh:SubsidiaryLocationShape sh:property era-sh:SubsidiaryLocationName .
era-sh:SubsidiaryLocationName
	a sh:PropertyShape;
    era:affectedClass era:SubsidiaryLocation;
    era:affectedProperty era:subsidiaryLocationName ;
    era:scope "local";
	rdfs:comment "The common name given to the subsidiary location"@en ;
	sh:path era:subsidiaryLocationName ;
	sh:datatype rdf:langString ;
    sh:nodeKind sh:Literal ;
    sh:uniqueLang true ;
	sh:severity sh:Violation ;
	sh:message "subsidiaryLocationName: Each Subsidiary Location may have a name. If it does, there should be at least one name in English (@en). Additional multilingual names are allowed, but only one value per language tag is permitted. All values must be language-tagged string literals."@en ;
	sh:sparql era-sh:LangStringEnRequiredIfPresent .

#############################
# Rules for train detection system
#############################

era-sh:TrainDetectionSystemShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:TrainDetectionSystem .

era-sh:TrainDetectionSystemShapeSPARQLWarning
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:TrainDetectionSystem ;
    sh:severity sh:Warning .

era-sh:FrenchTrainDetectionSystemLimitationShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:FrenchTrainDetectionSystemLimitation .  

era-sh:MaximumMagneticFieldShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:MaximumMagneticField .  

# trainDetectionSystemType: # 1.1.1.3.7.1.1, 1.2.1.1.3.1.1
era-sh:TrainDetectionSystemShape sh:property era-sh:TrainDetectionSystemType.
era-sh:TrainDetectionSystemType
	a sh:PropertyShape ;     
	era:affectedProperty era:trainDetectionSystemType;     
	era:affectedClass era:TrainDetectionSystem;     
	era:scope "local"; 
	rdfs:comment "Indication of types of train detection system installed."@en ;
	era:rinfIndex "1.1.1.3.7.1.1", "1.2.1.1.3.1.1" ;
	sh:path era:trainDetectionSystemType ;
	sh:maxCount 1 ; # Functional property
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "trainDetectionSystemType (1.1.1.3.7.1.1, 1.2.1.1.3.1.1): The train detection system has a train detection system type that must be a single IRI. This error may be due to having more than one value or having a value that is not an IRI."@en.

# trainDetectionSystemType: # 1.1.1.3.7.1.1, 1.2.1.1.3.1.1
era-sh:TrainDetectionSystemShape sh:sparql era-sh:TrainDetectionSystemTypeSKOS .
era-sh:TrainDetectionSystemTypeSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:trainDetectionSystemType;     
	era:affectedClass era:TrainDetectionSystem;     
	era:scope "local"; 
	rdfs:comment "Indication of types of train detection system installed."@en ;
	era:rinfIndex "1.1.1.3.7.1.1", "1.2.1.1.3.1.1" ;
	sh:message "Indication of types of train detection system installed (1.1.1.3.7.1.1, 1.2.1.1.3.1.1): The train detection system {$this} (label {?tdsLabel}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/train-detection/TrainDetectionSystems."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?concept ?tdsLabel (era:trainDetectionSystemType AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?tdsLabel0 } .
        BIND(COALESCE(?tdsLabel0, "unknown label") AS ?tdsLabel)
        $this era:trainDetectionSystemType ?concept .
        era:trainDetectionSystemType era:inSkosConceptScheme ?conceptScheme .
        FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme } || REGEX(STR(?concept), "/eratv/"))
    }
""" .

# trainDetectionSystemSpecificCheck. : 1.1.1.3.7.1.2, 1.2.1.1.6.1
era-sh:TrainDetectionSystemShape sh:property era-sh:TrainDetectionSystemSpecificCheck.
era-sh:TrainDetectionSystemSpecificCheck
	a sh:PropertyShape ;     
	era:affectedProperty era:trainDetectionSystemSpecificCheck;     
	era:affectedClass era:TrainDetectionSystem;     
	era:scope "local"; 
	rdfs:comment "Reference to the technical specification of train detection system."@en ;
	era:rinfIndex "1.1.1.3.7.1.2", "1.2.1.1.6.1" ;
	sh:path era:trainDetectionSystemSpecificCheck ;
	sh:maxCount 1 ; # Functional property
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "trainDetectionSystemSpecificCheck (1.1.1.3.7.1.2, 1.2.1.1.6.1): The train detection system has a train detection system specific check that must be a single IRI. This error may be due to having more than one value or having a value that is not an IRI."@en.

# trainDetectionSystemSpecificCheck. : 1.1.1.3.7.1.2, 1.2.1.1.6.1
era-sh:TrainDetectionSystemShape sh:sparql era-sh:TrainDetectionSystemSpecificCheckSKOS .
era-sh:TrainDetectionSystemSpecificCheckSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:trainDetectionSystemSpecificCheck;     
	era:affectedClass era:TrainDetectionSystem;     
	era:scope "local"; 
	rdfs:comment "Reference to the technical specification of train detection system."@en ;
	era:rinfIndex "1.1.1.3.7.1.2", "1.2.1.1.6.1" ;
	sh:message "Indication of specific checks of train detection system installed (1.1.1.3.7.1.2, 1.2.1.1.6.1): The train detection system {$this} (label {?tdsLabel}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/train-detection-specific-checks."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?concept ?tdsLabel (era:trainDetectionSystemSpecificCheck AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?tdsLabel0 } .
        BIND(COALESCE(?tdsLabel0, "unknown label") AS ?tdsLabel)
        $this era:trainDetectionSystemSpecificCheck ?concept .
        era:trainDetectionSystemSpecificCheck era:inSkosConceptScheme ?conceptScheme .
        FILTER NOT EXISTS { ?concept skos:inScheme ?conceptScheme }
    }
""" .

# trainDetectionSystemSpecificCheck: 1.1.1.3.7.1.2, 1.2.1.1.6.1
era-sh:TrainDetectionSystemShapeSPARQLWarning sh:sparql era-sh:TrainDetectionSystemSpecificCheckApplicability .
era-sh:TrainDetectionSystemSpecificCheckApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:trainDetectionSystemSpecificCheck;
    era:affectedClass era:TrainDetectionSystem;
    era:scope "local";
	rdfs:comment "Only applicable when 1.1.1.3.7.1.1 is applicable and the declared type is a track circuit or axle counter (per Appendix A-1, index [D]). Not applicable for loops. A value of era-tdssc:NotApplicable is accepted when the system is fully TSI CCS compliant and no specific check is required."@en ;
	era:rinfIndex "1.1.1.3.7.1.2", "1.2.1.1.6.1" ;
	sh:message "trainDetectionSystemSpecificCheck (1.1.1.3.7.1.2, 1.2.1.1.6.1):The Train Detection System {$this} ({?clsLabel}) has a type (track circuit or axle counter) that makes the trainDetectionSystemSpecificCheck parameter applicable. This error is due to {$this} not having a value for such a parameter. Use era-tdssc:NotApplicable when no specific check is required."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX era-tds: <http://data.europa.eu/949/concepts/train-detection/>
    SELECT DISTINCT $this ?clsLabel (era:trainDetectionSystemSpecificCheck AS ?path)
    WHERE {
        $this era:trainDetectionSystemType ?tdsType .
        FILTER (?tdsType != era-tds:30)
        OPTIONAL { $this rdfs:label ?clsLabel0 } .
        BIND(COALESCE(?clsLabel0, "unknown label") AS ?clsLabel)
        FILTER NOT EXISTS { $this era:trainDetectionSystemSpecificCheck ?value } .
    }
    """ .

# trainDetectionSystemSpecificCheckDocument: # 1.1.1.3.7.1.3, 1.2.1.1.6.2
era-sh:TrainDetectionSystemShape sh:property era-sh:TrainDetectionSystemSpecificCheckDocument.
era-sh:TrainDetectionSystemSpecificCheckDocument
	a sh:PropertyShape ;     
	era:affectedProperty era:trainDetectionSystemSpecificCheckDocument;     
	era:affectedClass era:TrainDetectionSystem;     
	era:scope "local"; 
	rdfs:comment "Electronic document available in two EU languages from the IM stored by the Agency with precise procedures for the specific check to be performed for train detection systems identified in 1.1.1.3.7.1.2."@en ;
	era:rinfIndex "1.1.1.3.7.1.3", "1.2.1.1.6.2" ;
	sh:path era:trainDetectionSystemSpecificCheckDocument ;
	sh:maxCount 1 ; # Functional property
	sh:class era:Document; 
	sh:severity sh:Violation ;
	sh:message "trainDetectionSystemSpecificCheckDocument (1.1.1.3.7.1.3, 1.2.1.1.6.2): The track defines the electronic document available in two EU languages value and it must be a Document. This error may be due to having more than one value or having a value that is not a Document."@en .

# trainDetectionSystemSpecificCheckDocument: # 1.1.1.3.7.1.3, 1.2.1.1.6.2
era-sh:TrainDetectionSystemShapeSPARQLWarning sh:sparql era-sh:TrainDetectionSystemSpecificCheckDocumentApplicability .
era-sh:TrainDetectionSystemSpecificCheckDocumentApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:trainDetectionSystemSpecificCheckDocument;
    era:affectedClass era:TrainDetectionSystem;
    era:scope "local";
	rdfs:comment "Only applicable when 1.1.1.3.7.1.1 is applicable and the declared type is a track circuit or axle counter (per Appendix A-1, index [D]). Not applicable for loops, nor when 1.1.1.3.7.1.2 is set to era-tdssc:NotApplicable."@en ;
	era:rinfIndex "1.1.1.3.7.1.3", "1.2.1.1.6.2" ;
	sh:message "trainDetectionSystemSpecificCheckDocument (1.1.1.3.7.1.3, 1.2.1.1.6.2):The Train Detection System {$this} ({?clsLabel}) has a type (track circuit or axle counter) and a specific check that makes the trainDetectionSystemSpecificCheckDocument parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX era-tds: <http://data.europa.eu/949/concepts/train-detection/>
    PREFIX era-tdssc: <http://data.europa.eu/949/concepts/train-detection-specific-checks/>
    SELECT DISTINCT $this ?clsLabel (era:trainDetectionSystemSpecificCheckDocument AS ?path)
    WHERE {
        $this era:trainDetectionSystemType ?tdsType .
        FILTER (?tdsType != era-tds:30)
        OPTIONAL { $this rdfs:label ?clsLabel0 } .
        BIND(COALESCE(?clsLabel0, "unknown label") AS ?clsLabel)
        FILTER NOT EXISTS { $this era:trainDetectionSystemSpecificCheck era-tdssc:NotApplicable } .
        FILTER NOT EXISTS { $this era:trainDetectionSystemSpecificCheckDocument ?value } .
    }
    """ .

# maximumInterferenceCurrentEvaluation: 1.1.1.3.4.2.1,  1.2.1.1.3.2.1
era-sh:TrainDetectionSystemShape sh:property era-sh:MaximumInterferenceCurrentEvaluation .
era-sh:MaximumInterferenceCurrentEvaluation
	a sh:PropertyShape ;     
	era:affectedProperty era:maximumInterferenceCurrentEvaluation;     
	era:affectedClass era:TrainDetectionSystem;     
	era:scope "local";
	rdfs:comment "If the preferred frequency bands are not used, (mandatory) description of the parameters for evaluation of compliance. If the preferred frequency bands are used, this parameter is optional."@en ;
	era:rinfIndex "1.1.1.3.4.2.1", "1.2.1.1.3.2.1" ;
	sh:path era:maximumInterferenceCurrentEvaluation ;
	sh:maxCount 1 ; # Functional property
	sh:datatype xsd:string ;
	sh:severity sh:Violation ;
	sh:message "maximumInterferenceCurrentEvaluation (1.1.1.3.4.2.1,  1.2.1.1.3.2.1): Each TrainDetectionSystem may have a single value for maximumInterferenceCurrentEvaluation that is a character string. This error is due to having more than one maximumInterferenceCurrentEvaluation value or having a value that is not a string."@en .

# frequencyBandsForDetection: 1.1.1.3.4.2, 1.2.1.1.3.2
era-sh:TrainDetectionSystemShape sh:property era-sh:FrequencyBandsForDetection .
era-sh:FrequencyBandsForDetection
	a sh:PropertyShape ;     
	era:affectedProperty era:frequencyBandsForDetection;     
	era:affectedClass era:TrainDetectionSystem;     
	era:scope "local";
	rdfs:comment "Bands of the frequency management of the train detection systems as defined in the TSI CCS (Annex I, Appendix A, Table A.2 -Index 77), and in the specific cases or technical documents referred to in Article 13 of TSI CCS when they are available."@en ;
	era:rinfIndex "1.1.1.3.4.2", "1.2.1.1.3.2" ;
	sh:path era:frequencyBandsForDetection ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "frequencyBandsForDetection (1.1.1.3.4.2.1, 1.2.1.1.3.2): The train detection system has a frequency band for detection that must be an IRI. This error may be due to having more than one value or having a value that is not a Document."@en .

# frequencyBandsForDetection: 1.1.1.3.4.2, 1.2.1.1.3.2
era-sh:TrainDetectionSystemShape sh:sparql era-sh:FrequencyBandsForDetectionSKOS .
era-sh:FrequencyBandsForDetectionSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:frequencyBandsForDetection;
    era:affectedClass era:TrainDetectionSystem;
    era:scope "local";
	rdfs:comment "Indication of the frequency band for detection of the train detection system"@en ;
	era:rinfIndex "1.1.1.3.4.2", "1.2.1.1.3.2" ;
	sh:message "Indication of the frequency band for detection of the train detection system (1.1.1.3.4.2, 1.2.1.1.3.2): The train detection system {$this}  has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/train-detection/FrequencyBandsForDetection."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    SELECT $this  ?concept (era:frequencyBandsForDetection AS ?path)
    WHERE {
        $this era:frequencyBandsForDetection ?concept .
        era:frequencyBandsForDetection era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# maximumInterferenceCurrent: 1.1.1.3.4.2.1, 1.2.1.1.3.2.1
era-sh:TrainDetectionSystemShape sh:property era-sh:MaximumInterferenceCurrent .
era-sh:MaximumInterferenceCurrent
	a sh:PropertyShape ;     
	era:affectedProperty era:maximumInterferenceCurrent;     
	era:affectedClass era:TrainDetectionSystem;     
	era:scope "local";
	rdfs:comment "Maximum interference current limits allowed for track circuits for a defined frequency band (to be expressed in A/m)."@en ;
	era:rinfIndex "1.1.1.3.4.2.1" , "1.2.1.1.3.2.1" ;
	sh:path era:maximumInterferenceCurrent ;
	sh:datatype xsd:double ;
	sh:pattern "^([1-9]\\d{0,2}|[0-9])(\\.\\d+)?$" ;
	sh:maxCount 1 ; # Functional property
	sh:severity sh:Violation ;
	sh:message "maximumInterferenceCurrent (1.1.1.3.4.2.1, 1.2.1.1.3.2.1): Each train detection system must define the maximum interference current in Amperes. This error may be due to having more than one value or having a value that is not a double (real) number."@en .

###########################################
# Rules for MaximumMagneticField
###########################################
# tdsMaximumMagneticField: 1.1.1.3.4.2.3, 1.2.1.1.3.2.3
era-sh:TrainDetectionSystemShape sh:property era-sh:TdsMaximumMagneticField .
era-sh:TdsMaximumMagneticField
	a sh:PropertyShape;
    era:affectedClass era:TrainDetectionSystem;
    era:affectedProperty era:tdsMaximumMagneticField ;
    era:scope "local";
	rdfs:comment "Relates the Axle Counter TrainDetectionSystem with its MaximumMagneticField in (X,Y,Z). The maximum magnetic field limits allowed for axle counters (in dB µA/m) for a defined frequency band. It should be provided in 3 directions."@en ;
	era:rinfIndex "1.1.1.3.4.2.3" , "1.2.1.1.3.2.3" ;
	sh:path era:tdsMaximumMagneticField ;
	sh:class era:MaximumMagneticField;
    # sh:node era-sh:MaximumMagneticFieldShape; not implemented in the shacl engine
	sh:maxCount 1 ; # As functional
	sh:severity sh:Violation ;
	sh:message "tdsMaximumMagneticField (1.1.1.3.4.2.3, 1.2.1.1.3.2.3): The train detection system has a train detection system maximum magnetic field reference that must be a maximum magnetic field. This error may be due to having more than one value or having a value that is not an instance of a MaximumMagnaticField."@en .

# tdsMaximumMagneticField: 1.1.1.3.4.2.3, 1.2.1.1.3.2.3
era-sh:TrainDetectionSystemShape sh:sparql era-sh:TdsMaximumMagneticFieldApplicability .
era-sh:TdsMaximumMagneticFieldApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:tdsMaximumMagneticField;
    era:affectedClass era:TrainDetectionSystem;
    era:scope "local";
	rdfs:comment "Y, for parameter 1.1.1.3.7.1.1 “Axle Counters” only."@en ;
	era:rinfIndex "1.1.1.3.4.2.3" , "1.2.1.1.3.2.3" ;
	sh:message "tdsMaximumMagneticField (1.1.1.3.4.2.3, 1.2.1.1.3.2.3):The Train Detection System {$this} ({?clsLabel}), has an 'axle counters' type that makes the tdsMaximumMagneticField parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?clsLabel (era:tdsMaximumMagneticField AS ?path)
    WHERE {
        $this era:trainDetectionSystemType <http://data.europa.eu/949/concepts/train-detection/eratv/axle-counters> .
        OPTIONAL { $this rdfs:label ?clsLabel0 } .
        BIND(COALESCE(?clsLabel0, "unknown label") AS ?clsLabel)
        FILTER NOT EXISTS { $this era:tdsMaximumMagneticField ?value } .
    }
    """ .

# maximumMagneticFieldDirectionX: 
era-sh:MaximumMagneticFieldShape sh:property era-sh:MaximumMagneticFieldDirectionX .
era-sh:MaximumMagneticFieldDirectionX
	a sh:PropertyShape ;     
	era:affectedProperty era:maximumMagneticFieldDirectionX;     
	era:affectedClass era:MaximumMagneticField;     
	era:scope "local";
	rdfs:comment "The maximum magnetic field limits allowed for axle counters (in dB µA/m) for a defined frequency band. Direction X."@en ;
	sh:path era:maximumMagneticFieldDirectionX ;
    sh:minCount 1;
	sh:maxCount 1 ; # Functional property
	sh:datatype xsd:integer ;
	sh:severity sh:Violation ;
	sh:message "maximumMagneticFieldDirectionX : Each MaximumMagneticField may have a single value for maximum magnetic field direction X that is an integer. This error is due to not having a value, having more than one  value or having a value that is not an integer."@en .

# maximumMagneticFieldDirectionY: 
era-sh:MaximumMagneticFieldShape sh:property era-sh:MaximumMagneticFieldDirectionY .
era-sh:MaximumMagneticFieldDirectionY
	a sh:PropertyShape ;     
	era:affectedProperty era:maximumMagneticFieldDirectionY;     
	era:affectedClass era:MaximumMagneticField;     
	era:scope "local";
	rdfs:comment "The maximum magnetic field limits allowed for axle counters (in dB µA/m) for a defined frequency band. Direction Y."@en ;
	sh:path era:maximumMagneticFieldDirectionY ;
    sh:minCount 1;
	sh:maxCount 1 ; # Functional property
	sh:datatype xsd:integer ;
	sh:severity sh:Violation ;
	sh:message "maximumMagneticFieldDirectionY : Each MaximumMagneticField may have a single value for maximum magnetic field direction Y that is an integer. This error is due to not having a value, having more than one  value or having a value that is not an integer."@en .

# maximumMagneticFieldDirectionZ: 
era-sh:MaximumMagneticFieldShape sh:property era-sh:MaximumMagneticFieldDirectionZ .
era-sh:MaximumMagneticFieldDirectionZ
	a sh:PropertyShape ;     
	era:affectedProperty era:maximumMagneticFieldDirectionZ;     
	era:affectedClass era:MaximumMagneticField;     
	era:scope "local";
	rdfs:comment "The maximum magnetic field limits allowed for axle counters (in dB µA/m) for a defined frequency band. Direction Z."@en ;
	sh:path era:maximumMagneticFieldDirectionZ ;
    sh:minCount 1;
	sh:maxCount 1 ; # Functional property
	sh:datatype xsd:integer ;
	sh:severity sh:Violation ;
	sh:message "maximumMagneticFieldDirectionZ : Each MaximumMagneticField may have a single value for maximum magnetic field direction Z that is an integer. This error is due to not having a value, having more than one  value or having a value that is not an integer."@en .



###########################################
# Rules for FrenchTrainDetectionSystemLimitation
###########################################
# tdsFrenchTrainDetectionSystemLimitation: 1.1.1.3.7.1.4, 1.2.1.1.6.3
era-sh:TrainDetectionSystemShape sh:property era-sh:TdsFrenchTrainDetectionSystemLimitation .
era-sh:TdsFrenchTrainDetectionSystemLimitation
	a sh:PropertyShape;
    era:affectedClass era:TrainDetectionSystem;
    era:affectedProperty era:tdsFrenchTrainDetectionSystemLimitation ;
    era:scope "local";
	rdfs:comment "Relates the class train detection system with the class that represents the section with train detection limitation. Specific for route compatibility check on French network."@en ;
	era:rinfIndex "1.1.1.3.7.1.4" , "1.2.1.1.6.3" ;
	sh:path era:tdsFrenchTrainDetectionSystemLimitation ;
    # sh:node era-sh:FrenchTrainDetectionSystemLimitationShape; not implemented in the shacl engine
	sh:class era:FrenchTrainDetectionSystemLimitation;
	sh:maxCount 1 ; # As functional
	sh:severity sh:Violation ;
	sh:message "tdsFrenchTrainDetectionSystemLimitation (1.1.1.3.7.1.4, 1.2.1.1.6.3): The train detection system has a tds french train detection system limitation reference that must be a french train detection system limitation. This error may be due to having more than one value or having a value that is not an instance of a FrenchTrainDetectionSystemLimitation"@en .

# frenchTrainDetectionSystemLimitationNumber: 
era-sh:FrenchTrainDetectionSystemLimitationShape sh:property era-sh:FrenchTrainDetectionSystemLimitationNumber .
era-sh:FrenchTrainDetectionSystemLimitationNumber
	a sh:PropertyShape ;
	era:affectedProperty era:frenchTrainDetectionSystemLimitationNumber ;
    era:affectedClass era:FrenchTrainDetectionSystemLimitation ;
	era:scope "local";
	rdfs:comment "Part of the section with train detection limitation that indicates the type of train detection limitation. Only for the French network"@en ;
	sh:path era:frenchTrainDetectionSystemLimitationNumber ;
	sh:nodeKind sh:IRI ;
    sh:minCount 1;
	sh:maxCount 1 ; # Functional property
	sh:severity sh:Violation ;
	sh:message "frenchTrainDetectionSystemLimitationNumber : The train detection system has a french train detection limitation number that must be an IRI. This error may be due to not having a value, having more than one value or having a value that is not an IRI."@en .

# frenchTrainDetectionSystemLimitationNumber: 
era-sh:FrenchTrainDetectionSystemLimitationShape sh:sparql era-sh:FrenchTrainDetectionSystemLimitationNumberSKOS.
era-sh:FrenchTrainDetectionSystemLimitationNumberSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:frenchTrainDetectionSystemLimitationNumber  ;     era:affectedClass  era:FrenchTrainDetectionSystemLimitation;     era:scope "local";     
    rdfs:comment "Part of the section with train detection limitation that indicates the type of train detection limitation. Only for the French network"@en ;
    sh:message "Indication of the frenchTrainDetectionSystemLimitationNumber: The train detection system {$this}  has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list:   http://data.europa.eu/949/concepts/train-detection-numbers/FrenchTrainDetectionSystemLimitationNumbers."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this  ?concept (era:frenchTrainDetectionSystemLimitationNumber AS ?path)
    WHERE {
        $this era:frenchTrainDetectionSystemLimitationNumber ?concept .
        era:frenchTrainDetectionSystemLimitationNumber era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# frenchTrainDetectionSystemLimitationApplicable: 
era-sh:FrenchTrainDetectionSystemLimitationShape sh:property era-sh:FrenchTrainDetectionSystemLimitationApplicable .
era-sh:FrenchTrainDetectionSystemLimitationApplicable
	a sh:PropertyShape ;
	era:affectedProperty era:frenchTrainDetectionSystemLimitationApplicable ;
    era:affectedClass era:FrenchTrainDetectionSystemLimitation ; 
	era:scope "local";
	rdfs:comment "Part of the section with train detection limitation that indicates if it is applicable. Only for the French network."@en ;
	sh:path era:frenchTrainDetectionSystemLimitationApplicable ;
	sh:datatype xsd:boolean ;
    sh:minCount 1;
	sh:maxCount 1 ; # Functional property
	sh:severity sh:Violation ;
	sh:message "frenchTrainDetectionSystemLimitationApplicable : The train detection system has a french train detection limitation applicable value that must be a boolean. This error may be due to not having a value, having more than one value or having a value that is not a boolean."@en .


#############################
# Rules for MinVehicleImpedance
#############################

era-sh:MinVehicleImpedanceShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:MinVehicleImpedance .

era-sh:MinVehicleImpedanceShapeSPARQLWarning
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:MinVehicleImpedance ;
    sh:severity sh:Warning .

# minVehicleImpedance: 1.1.1.3.4.2.2
era-sh:TrainDetectionSystemShape sh:property era-sh:MinVehicleImpedance .
era-sh:MinVehicleImpedance
	a sh:PropertyShape;
    era:affectedClass era:TrainDetectionSystem;
    era:affectedProperty era:minVehicleImpedance;
    era:scope "local";
	# rdfs:comment "." ; # TODO not available in the ontology
	era:rinfIndex "1.1.1.3.4.2.2" ;
	sh:path era:minVehicleImpedance ;
	sh:class era:MinVehicleImpedance;
    # sh:node era-sh:MinVehicleImpedanceShape; not implemented in the shacl engine
	sh:maxCount 1 ; # As functional
	sh:severity sh:Violation ;
	sh:message "minVehicleImpedance (1.1.1.3.4.2.2): The train detection system has a minimum vehicle impedance reference that must be a minimum vehicle impedance. This error may be due to having more than one value or having a value that is not an instance of a MinVehicleImpedance."@en .

# minVehicleImpedance 1.1.1.3.4.2.2: 
era-sh:TrainDetectionSystemShapeSPARQLWarning sh:sparql era-sh:MinVehicleImpedanceApplicability .
era-sh:MinVehicleImpedanceApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:minVehicleImpedance;
    era:affectedClass era:MinVehicleImpedance;
    era:scope "local";
    era:rinfIndex "1.1.1.3.4.2.2" ;
	rdfs:comment "The parameter minVehicleImpedance is applicable for track circuits."@en ;
	sh:message "minVehicleImpedance (1.1.1.3.4.2.2):The Train Detection System {$this} ({?tdsLabel}), has a 'track circuit' type that makes the minVehicleImpedance parameter applicable. This error is due to not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?tdsLabel (era:minVehicleImpedance AS ?path)
    WHERE {
        $this era:trainDetectionSystemType <http://data.europa.eu/949/concepts/train-detection/rinf/10> .
        OPTIONAL { $this rdfs:label ?tdsLabel0 } .
        BIND(COALESCE(?tdsLabel0, "unknown label") AS ?tdsLabel)
        FILTER NOT EXISTS { $this era:minVehicleImpedance ?value } .
        FILTER NOT EXISTS { $this era:notYetAvailable era:minVehicleImpedance } .
    }
    """ .



# minVehicleImpedanceVoltages: 
era-sh:MinVehicleImpedanceShape sh:property era-sh:MinVehicleImpedanceVoltages .
era-sh:MinVehicleImpedanceVoltages
	a sh:PropertyShape ;     
	era:affectedProperty era:minVehicleImpedanceVoltages;     
	era:affectedClass era:MinVehicleImpedance;     
	era:scope "local";
	rdfs:comment "Indication of the voltage system valid for the minimal impedance value (track circuits)."@en ;
	sh:path era:minVehicleImpedanceVoltages ;
	sh:nodeKind sh:IRI ;
	sh:maxCount 1 ; # Functional property
    sh:minCount 1;
	sh:severity sh:Violation ;
	sh:message "minVehicleImpedanceVoltages: The MinVehicleImpedance has a minVehicleImpedanceVoltage that must be an IRI. This error may be due to not having a value, having more than one value or having a value that is not an IRI."@en .

# minVehicleImpedanceVoltages: 
era-sh:MinVehicleImpedanceShape sh:sparql era-sh:MinVehicleImpedanceVoltagesSKOS .
era-sh:MinVehicleImpedanceVoltagesSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:minVehicleImpedanceVoltages;
    era:affectedClass era:MinVehicleImpedance;
    era:scope "local";
	rdfs:comment "Indication of the voltage system valid for the minimal impedance value (track circuits)."@en ;
	sh:message "minVehicleImpedanceVoltages: The minVehicleImpedance {$this}  has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/energy-supply-systems/EnergySupplySystems."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    SELECT $this  ?concept (era:minVehicleImpedanceVoltages AS ?path)
    WHERE {
        $this era:minVehicleImpedanceVoltages ?concept .
        era:minVehicleImpedanceVoltages era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
	""" .

# minVehicleImpedanceVoltages: 
era-sh:MinVehicleImpedanceShapeSPARQLWarning sh:sparql era-sh:MinVehicleImpedanceVoltagesApplicability .
era-sh:MinVehicleImpedanceVoltagesApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:minVehicleImpedanceVoltages;
    era:affectedClass era:MinVehicleImpedance;
    era:scope "local";
	rdfs:comment "The parameter minVehicleImpedanceVoltages is applicable for track circuits."@en ;
	era:rinfIndex "1.2.1.1.3.2.2", "1.1.1.3.4.2.2" ;
	sh:message "minVehicleImpedanceVoltages (1.1.1.3.4.2.2, 1.2.1.1.3.2.2):The Train Detection System {$this} ({?clsLabel}), has a 'track circuit' type that makes the minVehicleImpedanceVoltages parameter applicable. This error is due to {?minVehicleImpedance} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?clsLabel (era:minVehicleImpedanceVoltages AS ?path)
    WHERE {
        $this era:trainDetectionSystemType <http://data.europa.eu/949/concepts/train-detection/rinf/10> ;
            era:minVehicleImpedance ?minVehicleImpedance .
        OPTIONAL { $this rdfs:label ?clsLabel0 } .
        BIND(COALESCE(?clsLabel0, "unknown label") AS ?clsLabel)
        FILTER NOT EXISTS { ?minVehicleImpedance era:minVehicleImpedanceVoltages ?value } .
    }
    """ .


# minVehicleInputCapacitance: 
era-sh:MinVehicleImpedanceShape sh:property era-sh:MinVehicleInputCapacitance .
era-sh:MinVehicleInputCapacitance
	a sh:PropertyShape ;     
	era:affectedProperty era:minVehicleInputCapacitance;     
	era:affectedClass era:MinVehicleImpedance;     
	era:scope "local";
	rdfs:comment "For the selected DC voltage: [CCCC], as input capacitance [CCCC](Cin)."@en ;
	sh:path era:minVehicleInputCapacitance ;
	sh:datatype xsd:double ;
    sh:minCount 1;
	sh:maxCount 1 ; # Functional property
	sh:severity sh:Violation ;
	sh:message "minVehicleInputCapacitance: Each MinVehicleImpedance must define the minVehicleInputCapacitance. This error may be due to not having a value, having more than one value or having a value that is not a double (real) number."@en .

# minVehicleInputCapacitance: 
era-sh:MinVehicleImpedanceShapeSPARQLWarning sh:sparql era-sh:MinVehicleInputCapacitanceApplicability .
era-sh:MinVehicleInputCapacitanceApplicability
	a sh:SPARQLConstraint ;     
	era:affectedProperty era:minVehicleInputCapacitance;     
	era:affectedClass era:MinVehicleImpedance;     
	era:scope "local";
	rdfs:comment "The parameter minVehicleInputCapacitance is applicable for track circuits."@en ;
	era:rinfIndex "1.2.1.1.3.2.2", "1.1.1.3.4.2.2" ;
	sh:message "minVehicleInputCapacitance (1.1.1.3.4.2.2, 1.2.1.1.3.2.2):The Train Detection System {$this} ({?clsLabel}), has a 'track circuit' type that makes the minVehicleInputCapacitance parameter applicable. This error is due to {?minVehicleImpedance} not having a value for such a parameter."@en ;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?clsLabel (era:minVehicleInputCapacitance AS ?path)
    WHERE {
        $this era:trainDetectionSystemType <http://data.europa.eu/949/concepts/train-detection/rinf/10> ;
            era:minVehicleImpedance ?minVehicleImpedance .
        OPTIONAL { $this rdfs:label ?clsLabel0 } .
        BIND(COALESCE(?clsLabel0, "unknown label") AS ?clsLabel)
        FILTER NOT EXISTS { ?minVehicleImpedance era:minVehicleInputCapacitance ?value } .
    }
    """ .

# minVehicleInputImpedance: 
era-sh:MinVehicleImpedanceShape sh:property era-sh:MinVehicleInputImpedance .
era-sh:MinVehicleInputImpedance
	a sh:PropertyShape ;     
	era:affectedProperty era:minVehicleInputImpedance;     
	era:affectedClass era:MinVehicleImpedance;     
	era:scope "local";
	rdfs:comment "For the selected DC voltage: [ZZZZ], as input impedance [ZZZZ](Zin)."@en ;
	sh:path era:minVehicleInputImpedance ;
	sh:datatype xsd:double ;
    sh:minCount 1;
	sh:maxCount 1 ; # Functional property
	sh:severity sh:Violation ;
	sh:message "minVehicleInputImpedance: Each MinVehicleImpedance must define the minVehicleInputImpedance. This error may be due to not having a value, having more than one value or having a value that is not a double (real) number."@en .


# minVehicleInputImpedance: 
era-sh:MinVehicleImpedanceShapeSPARQLWarning sh:sparql era-sh:MinVehicleInputImpedanceApplicability .
era-sh:MinVehicleInputImpedanceApplicability
	a sh:SPARQLConstraint ;     
	era:affectedProperty era:minVehicleInputImpedance;     
	era:affectedClass era:MinVehicleImpedance;     
	era:scope "local";
	rdfs:comment "The parameter minVehicleInputImpedance is applicable for track circuits."@en ;
	era:rinfIndex "1.2.1.1.3.2.2", "1.1.1.3.4.2.2" ;
	sh:message "minVehicleInputImpedance (1.1.1.3.4.2.2, 1.2.1.1.3.2.2):The Train Detection System {$this} ({?clsLabel}), has a 'track circuit' type that makes the minVehicleInputImpedance parameter applicable. This error is due to {?minVehicleImpedance} not having a value for such a parameter."@en ;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?clsLabel (era:minVehicleInputImpedance AS ?path)
    WHERE {
        $this era:trainDetectionSystemType <http://data.europa.eu/949/concepts/train-detection/rinf/10> ;
            era:minVehicleImpedance ?minVehicleImpedance .
        OPTIONAL { $this rdfs:label ?clsLabel0 } .
        BIND(COALESCE(?clsLabel0, "unknown label") AS ?clsLabel)
        FILTER NOT EXISTS { ?minVehicleImpedance era:minVehicleInputImpedance ?value } .
    }
    """ .

#############################
# Rules for tunnels
#############################

era-sh:SectionOfLineShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:SectionOfLine.

#
# tunnels
#
era-sh:TunnelShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:Tunnel .

era-sh:TunnelShapeSPARQLWarning
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:Tunnel ;
    sh:severity sh:Warning .


era-sh:CommonCharacteristicsSubsetShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:CommonCharacteristicsSubset .  # Applies to all Common Characteritics Subset  with tunnels parameters 
	

# tunnelIdentification: # 1.1.1.1.8.2, 1.2.1.0.5.2, 1.2.2.0.5.2
era-sh:TunnelShape sh:property era-sh:TunnelIdentification .
era-sh:TunnelIdentification
    a sh:PropertyShape ;
    era:affectedProperty era:tunnelIdentification;
    era:affectedClass era:Tunnel;
    era:scope "local";  
    rdfs:comment "Unique tunnel identification or unique number within Member State."@en ;
    era:rinfIndex "1.1.1.1.8.2", "1.2.1.0.5.2", "1.2.2.0.5.2" ;
    sh:path era:tunnelIdentification ;           
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:severity sh:Warning ;
    sh:message "tunnelIdentification (1.1.1.1.8.2, 1.2.1.0.5.2, 1.2.2.0.5.2): Each Tunnel can be referred with only one identification. This error may be due to having a Tunnel with no identification, with more than one identification or with an identification that is not a character string."@en .




# verificationSRT: # 1.1.1.1.8.5, 1.2.1.0.5.3, 1.2.2.0.5.3
era-sh:TunnelShape sh:property era-sh:VerificationSRT .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:VerificationSRT .
era-sh:VerificationSRT
	a sh:PropertyShape ;
    era:affectedProperty era:verificationSRT;
    era:affectedClass era:Tunnel;
    era:scope "local";  
	rdfs:comment "Unique number for EC declarations following format requirements specified in the 'Document about practical arrangements for transmitting interoperability documents'"@en ;
	era:rinfIndex "1.1.1.1.8.5", "1.2.1.0.5.3" , "1.2.2.0.5.3" ;
	sh:path era:verificationSRT ;
	#sh:minCount 0 ;
	sh:datatype xsd:string ;
    sh:pattern "^[A-Z]{2}\\/.{14}\\/(19[0-9][0-9]|20[0-9][0-9]|2100)\\/[0-9]{6}$";
	sh:severity sh:Violation ;
	sh:message "verificationSRT (1.1.1.1.8.5, 1.2.1.0.5.3, 1.2.2.0.5.3): Each Tunnel may have one or more verificationSRT following this pattern country code/national registration number/year between 1900 and 2100/progressive counter. This error may be due to having a value that does not follow the pattern or that is not a character string."@en .


# demonstrationSRT: # 1.1.1.1.8.6, 1.2.1.0.5.4, 1.2.2.0.5.4
era-sh:TunnelShape sh:property era-sh:DemonstrationSRT .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:DemonstrationSRT.
era-sh:DemonstrationSRT
	a sh:PropertyShape ;
    era:affectedProperty era:demonstrationSRT;
    era:affectedClass era:Tunnel;
    era:scope "local";
	rdfs:comment "Unique number for EI declarations following the same format requirements as specified in the 'Document about practical arrangements for transmitting interoperability documents'"@en ;
	era:rinfIndex "1.1.1.1.8.6", "1.2.1.0.5.4" , "1.2.2.0.5.4" ;
	sh:path era:demonstrationSRT ;
	#sh:minCount 0 ;
	sh:datatype xsd:string ;
	sh:pattern "^[A-Z]{2}\\/.{14}\\/(19[0-9][0-9]|20[0-9][0-9]|2100)\\/[0-9]{6}$";
	sh:severity sh:Violation ;
	sh:message "demonstrationSRT (1.1.1.1.8.6, 1.2.1.0.5.4, 1.2.2.0.5.4): Each Tunnel may have one or more demonstrationSRT following this pattern country code/national registration number/year between 1900 and 2100/progressive counter. This error may be due to having a value that does not follow the pattern or that is not a character string."@en .


# lengthOfTunnel: # 1.1.1.1.8.7, 1.2.1.0.5.5, 1.2.2.0.5.5
era-sh:TunnelShape sh:property era-sh:LengthOfTunnel .
era-sh:LengthOfTunnel
	a sh:PropertyShape ;
    era:affectedProperty era:lengthOfTunnel;
    era:affectedClass era:Tunnel;
    era:scope "local";
	rdfs:comment "Length of a tunnel in metres from entrance portal to exit portal."@en ;
	era:rinfIndex "1.1.1.1.8.7", "1.2.1.0.5.5", "1.2.2.0.5.5" ;
	sh:path era:lengthOfTunnel ;
	sh:maxCount 1 ;
	sh:datatype xsd:double ;
	sh:severity sh:Warning ;
	sh:message "length (1.1.1.1.8.7, 1.2.1.0.5.5, 1.2.2.0.5.5): A Tunnel must have at most one length declaration. This error may be due to having a tunnel with more than one length or to having a value that is not a double (real) number."@en .

# crossSectionArea: # 1.1.1.1.8.8 
era-sh:TunnelShape sh:property era-sh:CrossSectionAreaT .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:CrossSectionAreaT.
era-sh:CrossSectionAreaT
	a sh:PropertyShape ;
    era:affectedProperty era:crossSectionArea;
    era:affectedClass era:Tunnel;
    era:scope "local";  
	rdfs:comment "Smallest cross section area in square metres of the tunnel."@en ;
	era:rinfIndex "1.1.1.1.8.8" ;
	sh:path era:crossSectionArea ;
	sh:maxCount 1 ;
	sh:datatype xsd:integer ; 
	sh:severity sh:Violation ;
	sh:message "crossSectionArea (1.1.1.1.8.8): A Tunnel can have at most one crossSectionArea. This error may be due to having a tunnel with more than one crossSectionArea or having a value  that is not an integer number."@en .

# crossSectionArea: # 1.1.1.1.8.8 
era-sh:TunnelShape sh:sparql era-sh:CrossSectionAreaApplicability .
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:CrossSectionAreaApplicability .
era-sh:CrossSectionAreaApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:crossSectionArea;
    era:affectedClass era:Tunnel;
    era:scope "local";   
	rdfs:comment "Y (applicable) if is speed of the line equal or greater than 200km/h."@en ;
	era:rinfIndex "1.1.1.1.8.8.8" ;
	sh:message "crossSectionArea (1.1.1.1.8.8): The Tunnel {$this} ({?label}) has a maximum permitted speed of {?tunnelSpeed} Km/h . For any tunnel with a speed of the line equal or greater than 200km/h the crossSectionArea parameter is applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:crossSectionArea AS ?path)
			WHERE {
                 $this era:maximumPermittedSpeed ?tunnelSpeed .
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
				FILTER (?tunnelSpeed >= 200).
                FILTER NOT EXISTS {$this era:crossSectionArea ?value} . 
            }
			""" .

# complianceInfTsi: # 1.1.1.1.8.8.1 
era-sh:TunnelShape sh:property era-sh:ComplianceInfTsiP .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:ComplianceInfTsiP .
era-sh:ComplianceInfTsiP
	a sh:PropertyShape ;
    era:affectedProperty era:complianceInfTsi;
    era:affectedClass era:Tunnel;
    era:scope "local";  
	rdfs:comment "Compliance of the tunnel with INF TSI at the maximum permitted speed."@en ;
	era:rinfIndex "1.1.1.1.8.8.1" ;
	sh:path era:complianceInfTsi ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "complianceInfTsi (1.1.1.1.8.8.1): A Tunnel can have at most one complianceInfTsi. This error may be due to having a tunnel with more than one complianceInfTsi or having a value type different than Y/N (boolean)."@en .

# complianceInfTsi: # 1.1.1.1.8.8.1 
era-sh:TunnelShape sh:sparql era-sh:ComplianceInfTsiApplicability .
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:ComplianceInfTsiApplicability .
era-sh:ComplianceInfTsiApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:complianceInfTsi;
    era:affectedClass era:Tunnel;
    era:scope "local";   
	rdfs:comment "Y (applicable) if is speed of the line equal or greater than 200km/h."@en ;
	era:rinfIndex "1.1.1.1.8.8.1" ;
	sh:message "complianceInfTsi (1.1.1.1.8.9, 1.2.1.0.5.6, 1.2.2.0.5.6): The Tunnel {$this} ({?label}) has a maximum permitted speed of {?tunnelSpeed} Km/h . For any tunnel with a speed of the line equal or greater than 200km/h the complianceInfTsi parameter is applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:complianceInfTsi AS ?path)
			WHERE {
                 $this era:maximumPermittedSpeed ?tunnelSpeed .
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
				FILTER (?tunnelSpeed >= 200).
                FILTER NOT EXISTS {$this era:complianceInfTsi ?value} . 
            }
			""" .

# tunnelDocRef: # 1.1.1.1.8.8.2
era-sh:TunnelShape sh:property era-sh:TunnelDocRef .
era-sh:TunnelDocRef
	a sh:PropertyShape ;
    era:affectedProperty era:tunnelDocRef;
    era:affectedClass era:Tunnel;
    era:scope "local";  
	rdfs:comment "Electronic document available from the IM stored by the Agency with precise description of the clearance gauge and geometry of the tunnel"@en ;
	era:rinfIndex "1.1.1.1.8.8.2" ;
	sh:path era:tunnelDocRef ;
	sh:class era:Document;
	sh:severity sh:Violation ;
	sh:message "tunnelDocRef (1.1.1.1.8.8.2): A Tunnel has a tunnelDocRef with precise description of the clearance gauge and geometry of the tunnel, and it must be a Document. This error a due to having a value that is not an instance of Document"@en .



# hasEmergencyPlan: # 1.1.1.1.8.9, 1.2.1.0.5.6, 1.2.2.0.5.6
era-sh:TunnelShape sh:property era-sh:HasEmergencyPlan .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:HasEmergencyPlan .
era-sh:HasEmergencyPlan
	a sh:PropertyShape ;
    era:affectedProperty era:hasEmergencyPlan;
    era:affectedClass era:Tunnel;
    era:scope "local";   
	rdfs:comment "Indication whether emergency plan exists."@en ;
	era:rinfIndex "1.1.1.1.8.9", "1.2.1.0.5.6", "1.2.2.0.5.6" ;
	sh:path era:hasEmergencyPlan ;
    sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "hasEmergencyPlan (1.1.1.1.8.9, 1.2.1.0.5.6, 1.2.2.0.5.6): A Tunnel has an indication about the existence of an emergency plan. This error may be due to having a tunnel with more than one value for hasEmergencyPlan or having a value type different than Y/N (boolean)."@en .

# hasEmergencyPlan: # 1.1.1.1.8.9, 1.2.1.0.5.6, 1.2.2.0.5.6
era-sh:TunnelShapeSPARQLWarning sh:sparql era-sh:HasEmergencyPlanApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:HasEmergencyPlanApplicability .
era-sh:HasEmergencyPlanApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:hasEmergencyPlan;
    era:affectedClass era:Tunnel;
    era:scope "local";   
	rdfs:comment "Applicable for tunnels longer than 1 km."@en ;
	era:rinfIndex "1.1.1.1.8.9", "1.2.1.0.5.6", "1.2.2.0.5.6" ;
	sh:message "hasEmergencyPlan (1.1.1.1.8.9, 1.2.1.0.5.6, 1.2.2.0.5.6): The Tunnel {$this} ({?label}) has a length of {?tunnelLength} meters. Any tunnel longer than 1 Km makes the hasEmergencyPlan parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:hasEmergencyPlan AS ?path)
			WHERE {
                 $this era:lengthOfTunnel ?tunnelLength .
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
				FILTER (?tunnelLength > 1000).
                FILTER NOT EXISTS {$this era:hasEmergencyPlan ?value} . 
            }
			""" .

# hasEvacuationAndRescuePoints: # 1.1.1.1.8.13, 1.2.1.0.5.11, 1.2.2.0.5.10
era-sh:TunnelShape sh:property era-sh:HasEvacuationAndRescuePoints .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:HasEvacuationAndRescuePoints .
era-sh:HasEvacuationAndRescuePoints
	a sh:PropertyShape ;
    era:affectedProperty era:hasEvacuationAndRescuePoints;
    era:affectedClass era:Tunnel;
    era:scope "local";   
	rdfs:comment "Indication of existence of evacuation and rescue points."@en ;
	era:rinfIndex "1.1.1.1.8.13", "1.2.1.0.5.11", "1.2.2.0.5.10" ;
	sh:path era:hasEvacuationAndRescuePoints ;
    sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "hasEvacuationAndRescuePoints (1.1.1.1.8.13, 1.2.1.0.5.11, 1.2.2.0.5.10): A Tunnel has an indication about the existence of an evacuation and rescue points. This error may be due to having a tunnel with more than one value for hasEvacuationAndRescuePoints or having a value type different than Y/N (boolean)."@en .

# hasEvacuationAndRescuePoints: # 1.1.1.1.8.13, 1.2.1.0.5.11, 1.2.2.0.5.10
era-sh:TunnelShapeSPARQLWarning sh:sparql era-sh:HasEvacuationAndRescuePointsApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:HasEvacuationAndRescuePointsApplicability .
era-sh:HasEvacuationAndRescuePointsApplicability
  a sh:SPARQLConstraint ;
  era:affectedProperty era:hasEvacuationAndRescuePoints;
  era:affectedClass era:Tunnel;
  era:scope "local";
  rdfs:comment "Applicable for tunnels longer than 500 meters."@en ;
  era:rinfIndex "1.1.1.1.8.13", "1.2.1.0.5.11", "1.2.2.0.5.10" ;
  sh:message "hasEvacuationAndRescuePoints (1.1.1.1.8.13, 1.2.1.0.5.11, 1.2.2.0.5.10): The Tunnel {$this} ({?label}) has a length of {?tunnelLength} meters. Any tunnel longer than 500 meters makes the hasEvacuationAndRescuePoints parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
  sh:prefixes era:;
  sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

    SELECT DISTINCT $this ?label ?tunnelLength (era:hasEvacuationAndRescuePoints AS ?path)
    WHERE {
        $this era:lengthOfTunnel ?tunnelLength .
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        FILTER (?tunnelLength > 500) .
        FILTER NOT EXISTS { $this era:hasEvacuationAndRescuePoints ?value } .
    }
    """ .

# rollingStockFireCategory: # 1.1.1.1.8.10, 1.2.1.0.5.7, 1.2.2.0.5.7
era-sh:TunnelShape sh:property era-sh:RollingStockFireCategory .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:RollingStockFireCategory .
era-sh:RollingStockFireCategory
	a sh:PropertyShape ;
    era:affectedProperty era:rollingStockFireCategory;
    era:affectedClass era:Tunnel;
    era:scope "local";  
	rdfs:comment "Categorisation on how a passenger train with a fire on board will continue to operate for a defined time period"@en ;
	era:rinfIndex "1.1.1.1.8.10", "1.2.1.0.5.7", "1.2.2.0.5.7" ;
	sh:path era:rollingStockFireCategory ;
    sh:maxCount 1 ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "rollingStockFireCategory (1.1.1.1.8.10, 1.2.1.0.5.7, 1.2.2.0.5.7): A Tunnel may have an indication about the rollingStockFireCategory. This error may be due to having a tunnel without a rollingStockFireCategory declaration or having a literal as value. This error may be due to a tunnel having more than one value or having a value that is not an IRI."@en .

# rollingStockFireCategory: # 1.1.1.1.8.10, 1.2.1.0.5.7, 1.2.2.0.5.7
era-sh:TunnelShape sh:sparql era-sh:RollingStockFireCategorySKOS .
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:RollingStockFireCategorySKOS .
era-sh:RollingStockFireCategorySKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:rollingStockFireCategory;
    era:affectedClass era:Tunnel;
    era:scope "local";   
	rdfs:comment "Categorisation on how a passenger train with a fire on board will continue to operate for a defined time period"@en ;
	era:rinfIndex "1.1.1.1.8.10", "1.2.1.0.5.7", "1.2.2.0.5.7" ;
	sh:message "Categorisation on how a passenger train with a fire on board will continue to operate (1.1.1.1.8.10, 1.2.1.0.5.7, 1.2.2.0.5.7): The tunnel {$this} (label {?tunnelLabel}) has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/rolling-stock-fire/Categories."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?concept ?tunnelLabel (era:rollingStockFireCategory AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?tunnelLabel0 } .
        BIND(COALESCE(?tunnelLabel0, "unknown label") AS ?tunnelLabel)
        $this era:rollingStockFireCategory ?concept .
        era:rollingStockFireCategory era:inSkosConceptScheme ?conceptScheme .
        FILTER (NOT EXISTS { ?concept skos:inScheme ?conceptScheme } || REGEX(STR(?concept), "/eratv/"))
    }
""" .

# rollingStockFireCategory: # 1.1.1.1.8.10, 1.2.1.0.5.7, 1.2.2.0.5.7
era-sh:TunnelShapeSPARQLWarning sh:sparql era-sh:RollingStockFireCategoryApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:RollingStockFireCategoryApplicability .
era-sh:RollingStockFireCategoryApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:rollingStockFireCategory;
    era:affectedClass era:Tunnel;
    era:scope "local";   
	rdfs:comment "Applicable for tunnels longer than 1 km."@en ;
	era:rinfIndex "1.1.1.1.8.10", "1.2.1.0.5.7", "1.2.2.0.5.7" ;
	sh:message "rollingStockFireCategory (1.1.1.1.8.10, 1.2.1.0.5.7, 1.2.2.0.5.7): The Tunnel {$this} ({?label}) has a length of {?tunnelLength} meters. Any tunnel longer than 1 Km makes the rollingStockFireCategory parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label ?tunnelLength (era:rollingStockFireCategory AS ?path)
    WHERE {
        $this era:lengthOfTunnel ?tunnelLength .
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
        FILTER (?tunnelLength > 1000) .
        FILTER NOT EXISTS { $this era:rollingStockFireCategory ?value } .
    }
    """ .


## nationalRollingStockFireCategory: # 1.1.1.1.8.11, 1.2.1.0.5.8, 1.2.2.0.5.8
era-sh:TunnelShape sh:property era-sh:NationalRollingStockFireCategory .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:NationalRollingStockFireCategory .
era-sh:NationalRollingStockFireCategory
	a sh:PropertyShape ;
    era:affectedProperty era:nationalRollingStockFireCategory;
    era:affectedClass era:Tunnel;
    era:scope "local";   
	rdfs:comment "Categorisation on how a passenger train with a fire on board will continue to operate for a defined time period - according to national rules if they exist."@en ;
	era:rinfIndex "1.1.1.1.8.11", "1.2.1.0.5.8", "1.2.2.0.5.8" ;
	sh:path era:nationalRollingStockFireCategory ;
	#sh:minCount 0 ;
    sh:maxCount 1 ;
	sh:datatype xsd:string ;
	sh:severity sh:Violation ;
	sh:message "nationalRollingStockFireCategory (1.1.1.1.8.11, 1.2.1.0.5.8, 1.2.2.0.5.8): A Tunnel may have an indication about the nationalRollingStockFireCategory. This error may be due to having a tunnel with more than one value or having a value type different than string."@en .

# nationalRollingStockFireCategory: # 1.1.1.1.8.11, 1.2.1.0.5.8, 1.2.2.0.5.8
era-sh:TunnelShapeSPARQLWarning sh:sparql era-sh:NationalRollingStockFireCategoryApplicability .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:NationalRollingStockFireCategoryApplicability .
era-sh:NationalRollingStockFireCategoryApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:nationalRollingStockFireCategory;
    era:affectedClass era:Tunnel;
    era:scope "local";   
	rdfs:comment "Applicable only for tunnels when for the parameter 1.1.1.1.8.10 the option 'none' was selected and national rules exist."@en ;
	era:rinfIndex "1.1.1.1.8.11", "1.2.1.0.5.8", "1.2.2.0.5.8" ;
	sh:message "nationalRollingStockFireCategory (1.1.1.1.8.11, 1.2.1.0.5.8, 1.2.2.0.5.8): The Tunnel {$this} ({?clsLabel}), has a 'rolling stock fire' category that makes the nationalRollingStockFireCategory parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?clsLabel (era:nationalRollingStockFireCategory AS ?path)
    WHERE {
        $this era:rollingStockFireCategory <http://data.europa.eu/949/concepts/rolling-stock-fire/rinf/30> .
        OPTIONAL { $this rdfs:label ?clsLabel0 } .
        BIND(COALESCE(?clsLabel0, "unknown label") AS ?clsLabel)
        FILTER NOT EXISTS { $this era:nationalRollingStockFireCategory ?value } .
    }
    """ .

# dieselThermalAllowed: # 1.2.1.0.5.9
era-sh:TunnelShape sh:property era-sh:DieselThermalAllowed .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:DieselThermalAllowed .
era-sh:DieselThermalAllowed
	a sh:PropertyShape ;
    era:affectedProperty era:dieselThermalAllowed;
    era:affectedClass era:Tunnel;
    era:scope "local";   
	rdfs:comment "Indication whether it is allowed to use diesel or other thermal traction in the tunnel."@en ;
	era:rinfIndex "1.2.1.0.5.9" ;
	sh:path era:dieselThermalAllowed ;
    sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "dieselThermalAllowed (1.2.1.0.5.9): A Tunnel may have an indication about the permission of thermal traction. This error may be due to having a tunnel with more than one dieselThermalAllowed declaration or having a value type different than Y/N (boolean)."@en .

# startLocation: 1.1.1.1.8.3
era-sh:TunnelShape sh:property era-sh:StartLocation .
era-sh:StartLocation
	a sh:PropertyShape;
	era:affectedClass era:Tunnel;
	era:affectedProperty era:startLocation ;
	era:scope "local";
	rdfs:comment "Part of the Start of tunnel that indicates the Geographical coordinates according to the standard World Geodetic System (WGS)."@en ;
	sh:path era:startLocation ;
	sh:nodeKind sh:IRI ;
	sh:maxCount 1; # Functional property
    sh:class sf:Point ;
	sh:severity sh:Violation ;
	sh:message "startLocation (1.1.1.1.8.3): The Tunnel may have a start location (startLocation) reference that is a Geometry object or a Point. This error mey be due to a startLocation relationship from a Tunnel that is not a Geometry nor a Point."@en .

# endLocation: 1.1.1.1.8.4
era-sh:TunnelShape sh:property era-sh:EndLocation .
era-sh:EndLocation
	a sh:PropertyShape;
	era:affectedClass era:Tunnel;
	era:affectedProperty era:endLocation ;
	era:scope "local";
	rdfs:comment "Geographical coordinates in decimal degrees and km of the line at the end of a tunnel."@en ;
	sh:path era:endLocation ;
	sh:nodeKind sh:IRI ;
	sh:maxCount 1; # Functional property
    sh:class sf:Point ;
	sh:severity sh:Violation ;
	sh:message "endLocation (1.1.1.1.8.4): The Tunnel may have an end location (endLocation) reference that is a Geometry object or a Point. This error mey be due to an endLocation relationship from a Tunnel that is not a Geometry nor a Point."@en .

# hasWalkway: # 1.1.1.1.8.12, 1.2.1.0.5.10, 1.2.2.0.5.9
era-sh:TunnelShape sh:property era-sh:HasWalkway .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:HasWalkway .
era-sh:HasWalkway
	a sh:PropertyShape ;
    era:affectedProperty era:hasWalkway;
    era:affectedClass era:Tunnel;
    era:scope "local";  
	rdfs:comment "Indication of existence of walkways."@en ;
	era:rinfIndex "1.1.1.1.8.12" , "1.2.1.0.5.10" , "1.2.2.0.5.9" ;
	sh:path era:hasWalkway ;
	sh:maxCount 1 ; # Functional property
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "hasWalkway (1.1.1.1.8.12, 1.2.1.0.5.10, 1.2.2.0.5.9): A Tunnel can have at most one hasWalkway. This error may be due to having a tunnel with more than one hasWalkway or having a value type different than Y/N (boolean)."@en .

# lineReferenceTunnelEnd: 1.1.1.1.8.4
era-sh:TunnelShape sh:property era-sh:LineReferenceTunnelEnd .
era-sh:LineReferenceTunnelEnd
	a sh:PropertyShape;
	era:affectedClass era:Tunnel;
	era:affectedProperty era:lineReferenceTunnelEnd ;
	era:scope "local";
	rdfs:comment "Part of the End of tunnel that indicates the km of the line at the end of a tunnel."@en ;
	sh:path era:lineReferenceTunnelEnd ;
	sh:nodeKind sh:IRI ;
	sh:class era:NetPointReference ;
	sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "lineReferenceTunnelEnd (1.1.1.1.8.4): A Tunnel may have an end of tunnel location (lineReferenceTunnelEnd). This error may be due to a value that is not an IRI, more than one value being provided, or a value that is not a NetPointReference."@en .

# lineReferenceTunnelStart: 1.1.1.1.8.3
era-sh:TunnelShape sh:property era-sh:LineReferenceTunnelStart .
era-sh:LineReferenceTunnelStart
	a sh:PropertyShape;
	era:affectedClass era:Tunnel;
	era:affectedProperty era:lineReferenceTunnelStart ;
	era:scope "local";
	rdfs:comment "Part of the Start of tunnel that indicates the km of the line at the beginning of a tunnel."@en ;
	sh:path era:lineReferenceTunnelStart ;
	sh:nodeKind sh:IRI ;
	sh:class era:NetPointReference ;
	sh:severity sh:Violation ;
	sh:message "lineReferenceTunnelStart (1.1.1.1.8.3): A Tunnel may have a start of tunnel location (lineReferenceTunnelStart). This error may be due to a value that is not an IRI, more than one value being provided, or a value that is not a NetPointReference."@en .

# existRestrictedTypeOfVehicleOfTunnel
era-sh:TunnelShape sh:property era-sh:ExistRestrictedTypeOfVehicleOfTunnel .
era-sh:ExistRestrictedTypeOfVehicleOfTunnel
	a sh:PropertyShape ;
	era:affectedProperty era:existRestrictedTypeOfVehicleOfTunnel ;
	era:affectedClass era:Tunnel ;
	era:scope "local" ;
	rdfs:comment "Indicate, if there are any limits on specific type of vehicle in the tunnel."@en ;
	sh:path era:existRestrictedTypeOfVehicleOfTunnel ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Warning ;
	sh:message "existRestrictedTypeOfVehicleOfTunnel: A Tunnel may have at most one value indicating if there are limits on specific type of vehicle in the tunnel. This error may be due to having more than one value or having a value that is not Y/N (boolean)."@en .

# restrictedTypeOfVehicleInTunnel
era-sh:TunnelShape sh:property era-sh:RestrictedTypeOfVehicleInTunnel .
era-sh:RestrictedTypeOfVehicleInTunnel
	a sh:PropertyShape ;
	era:affectedProperty era:restrictedTypeOfVehicleInTunnel ;
	era:affectedClass era:Tunnel ;
	era:scope "local" ;
	rdfs:comment "Specific types of vehicles restricted in the tunnel."@en ;
	sh:path era:restrictedTypeOfVehicleInTunnel ;
	sh:datatype xsd:string ;
	sh:severity sh:Warning ;
	sh:message "restrictedTypeOfVehicleInTunnel: A Tunnel may have values describing specific types of vehicles restricted in the tunnel. This error may be due to having a value that is not a string."@en .

# existTrainExclusionOfSimultaneity
era-sh:TunnelShape sh:property era-sh:ExistTrainExclusionOfSimultaneity .
era-sh:ExistTrainExclusionOfSimultaneity
	a sh:PropertyShape ;
	era:affectedProperty era:existTrainExclusionOfSimultaneity ;
	era:affectedClass era:Tunnel ;
	era:scope "local" ;
	rdfs:comment "Indicate, if passenger and freight trains meeting together in a tunnel is allowed."@en ;
	sh:path era:existTrainExclusionOfSimultaneity ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Warning ;
	sh:message "existTrainExclusionOfSimultaneity: A Tunnel may have at most one value indicating if passenger and freight trains meeting together in the tunnel is allowed. This error may be due to having more than one value or having a value that is not Y/N (boolean)."@en .

# maxTunnelSpeed
era-sh:TunnelShape sh:property era-sh:MaxTunnelSpeed .
era-sh:MaxTunnelSpeed
	a sh:PropertyShape ;
	era:affectedProperty era:maxTunnelSpeed ;
	era:affectedClass era:Tunnel ;
	era:scope "local" ;
	rdfs:comment "Indicate the speed limit in a tunnel."@en ;
	sh:path era:maxTunnelSpeed ;
	sh:maxCount 1 ;
	sh:datatype xsd:integer ;
	sh:severity sh:Warning ;
	sh:message "maxTunnelSpeed: A Tunnel may have at most one speed limit value expressed in km/h. This error may be due to having more than one value or having a value that is not an integer."@en .

# existOpeningHoursLimitation (applies to Tunnel, SectionOfLine, Bridge)
era-sh:TunnelShape sh:property era-sh:ExistOpeningHoursLimitation .
era-sh:SectionOfLineShape sh:property era-sh:ExistOpeningHoursLimitation .
era-sh:BridgeShape sh:property era-sh:ExistOpeningHoursLimitation .
era-sh:ExistOpeningHoursLimitation
	a sh:PropertyShape ;
	era:affectedProperty era:existOpeningHoursLimitation ;
	era:affectedClass era:Tunnel, era:SectionOfLine, era:Bridge ;
	era:scope "local" ;
	rdfs:comment "Indicate, if there are any opening hours limitations for the section of line, tunnel or bridge."@en ;
	sh:path era:existOpeningHoursLimitation ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Warning ;
	sh:message "existOpeningHoursLimitation: The element may have at most one value indicating if there are opening hours limitations. This error may be due to having more than one value or having a value that is not Y/N (boolean)."@en .

# openingHoursLimitation (applies to Tunnel, SectionOfLine, Bridge)
era-sh:TunnelShape sh:property era-sh:OpeningHoursLimitation .
era-sh:SectionOfLineShape sh:property era-sh:OpeningHoursLimitation .
era-sh:BridgeShape sh:property era-sh:OpeningHoursLimitation .
era-sh:OpeningHoursLimitation
	a sh:PropertyShape ;
	era:affectedProperty era:openingHoursLimitation ;
	era:affectedClass era:Tunnel, era:SectionOfLine, era:Bridge ;
	era:scope "local" ;
	rdfs:comment "Opening hours of the section of line, tunnel or bridge."@en ;
	sh:path era:openingHoursLimitation ;
	sh:datatype xsd:string ;
	sh:severity sh:Warning ;
	sh:message "openingHoursLimitation: The element may have values describing opening hours limitations. This error may be due to having a value that is not a string."@en .

# existRestrictedDangerousGood (applies to Tunnel, SectionOfLine)
era-sh:TunnelShape sh:property era-sh:ExistRestrictedDangerousGood .
era-sh:SectionOfLineShape sh:property era-sh:ExistRestrictedDangerousGood .
era-sh:ExistRestrictedDangerousGood
	a sh:PropertyShape ;
	era:affectedProperty era:existRestrictedDangerousGood ;
	era:affectedClass era:Tunnel, era:SectionOfLine ;
	era:scope "local" ;
	rdfs:comment "Indicate, if there are any limits on transportation of dangerous goods."@en ;
	sh:path era:existRestrictedDangerousGood ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Warning ;
	sh:message "existRestrictedDangerousGood: The element may have at most one value indicating if there are limits on transportation of dangerous goods. This error may be due to having more than one value or having a value that is not Y/N (boolean)."@en .

# restrictedDangerousGood (applies to Tunnel, SectionOfLine)
era-sh:TunnelShape sh:property era-sh:RestrictedDangerousGood .
era-sh:SectionOfLineShape sh:property era-sh:RestrictedDangerousGood .
era-sh:RestrictedDangerousGood
	a sh:PropertyShape ;
	era:affectedProperty era:restrictedDangerousGood ;
	era:affectedClass era:Tunnel, era:SectionOfLine ;
	era:scope "local" ;
	rdfs:comment "Description of the type of dangerous goods that are not allowed."@en ;
	sh:path era:restrictedDangerousGood ;
	sh:datatype xsd:string ;
	sh:severity sh:Warning ;
	sh:message "restrictedDangerousGood: The element may have values describing the types of dangerous goods that are not allowed. This error may be due to having a value that is not a string."@en .

# specialTunnelArea
era-sh:TunnelShape sh:property era-sh:SpecialTunnelArea .
era-sh:SpecialTunnelArea
	a sh:PropertyShape ;
    era:affectedProperty era:specialTunnelArea ;
    era:affectedClass era:Tunnel ;
    era:scope "local" ;
	rdfs:comment "Relates a tunnel with a special area or location."@en ;
	era:tsiOPEAppendixD2Index "3.2.3" ;
	sh:path era:specialTunnelArea ;
	sh:class era:SpecialTunnelArea ;
	sh:severity sh:Violation ;
	sh:message "specialTunnelArea (3.2.3): A Tunnel may have special tunnel areas and each must be an instance of SpecialTunnelArea. This error may be due to having a value that is not an instance of SpecialTunnelArea."@en .

# vehicleTypesCompatibleTrafficLoad: # 1.1.1.5.1
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:VehicleTypesCompatibleTrafficLoad .
era-sh:VehicleTypesCompatibleTrafficLoad
	a sh:PropertyShape ;
    era:affectedProperty era:vehicleTypesCompatibleTrafficLoad ;
    era:affectedClass era:CommonCharacteristicsSubset ;
    era:scope "local" ;
	rdfs:comment "List of vehicle types already identified as compatible with Traffic load and load carrying capacity of infrastructure and train detection systems."@en ;
	era:rinfIndex "1.1.1.5.1" ;
	sh:path era:vehicleTypesCompatibleTrafficLoad ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
    sh:or (
        [sh:class era:Document ;]
        [sh:class era:VehicleType ;]
    ) ;
	sh:message "vehicleTypesCompatibleTrafficLoad (1.1.1.5.1): The subset with common characteristics may have values for vehicle types compatible with traffic load and each must be an IRI (a Document or VehicleType). This error may be due to having a value that is not an IRI."@en .

# vehiclesCompatibleTrafficLoad: # 1.1.1.5.2
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:VehiclesCompatibleTrafficLoad .
era-sh:VehiclesCompatibleTrafficLoad
	a sh:PropertyShape ;
    era:affectedProperty era:vehiclesCompatibleTrafficLoad ;
    era:affectedClass era:CommonCharacteristicsSubset ;
    era:scope "local" ;
	rdfs:comment "List of vehicles already identified as compatible with Traffic load and load carrying capacity of infrastructure and train detection systems."@en ;
	era:rinfIndex "1.1.1.5.2" ;
	sh:path era:vehiclesCompatibleTrafficLoad ;
    sh:or (
        [sh:class era:Document ;]
        [sh:class era:Vehicle ;]
    ) ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "vehiclesCompatibleTrafficLoad (1.1.1.5.2): The subset with common characteristics may have values for vehicles compatible with traffic load and each must be an IRI (a Document or Vehicle). This error may be due to having a value that is not an IRI."@en .

###################################
# NEW CONTENT FROM CURRENT FILE
###################################


# ========== INSTANCES ========== 

# Rule 1: Detect instances without rdf:type (Warnings)
era-sh:InstancesMustHaveTypeShape
    a sh:NodeShape ;
    sh:target [
        a sh:SPARQLTarget ;
		    sh:prefixes era:;
        sh:select """
            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
            PREFIX era: <http://data.europa.eu/949/>

            SELECT DISTINCT $this
            WHERE {
                $this ?p ?o .
                FILTER(isIRI($this))
                FILTER(STRSTARTS(STR($this), STR(era:)))
				# we are not checking concepts, those are checked in other shapes anyway
                FILTER(!STRSTARTS(STR($this), STR(era:concepts)))
                # exclude URIs that already have an rdf:type
                FILTER NOT EXISTS { $this rdf:type ?type }
            }
        """ ;
    ] ;
    sh:property [
        sh:path rdf:type ;
        sh:minCount 1 ;
        sh:severity sh:Warning ;
        sh:message "Resource must have at least one rdf:type"@en ;
    ] .
	



#############################
# Rules for Bridge
#############################

era-sh:BridgeShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:Bridge .


# existBridgeWindRestriction
era-sh:BridgeShape sh:property era-sh:ExistBridgeWindRestriction .
era-sh:ExistBridgeWindRestriction
	a sh:PropertyShape ;
	era:affectedProperty era:existBridgeWindRestriction ;
	era:affectedClass era:Bridge ;
	era:scope "local" ;
	rdfs:comment "Indicate, if there are any wind restrictions for a bridge."@en ;
	sh:path era:existBridgeWindRestriction ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Warning ;
	sh:message "existBridgeWindRestriction: A Bridge may have at most one value indicating if there are wind restrictions for the bridge. This error may be due to having more than one value or having a value that is not Y/N (boolean)."@en .

# maxbridgeWind
era-sh:BridgeShape sh:property era-sh:MaxbridgeWind .
era-sh:MaxbridgeWind
	a sh:PropertyShape ;
	era:affectedProperty era:maxbridgeWind ;
	era:affectedClass era:Bridge ;
	era:scope "local" ;
	rdfs:comment "Indicates the maximum wind speed for which the bridge can operate."@en ;
	sh:path era:maxbridgeWind ;
	sh:maxCount 1 ;
	sh:datatype xsd:integer ;
	sh:severity sh:Warning ;
	sh:message "maxbridgeWind: A Bridge may have at most one maximum bridge wind value expressed in km/h. This error may be due to having more than one value or having a value that is not an integer."@en .

#############################
# Rules for contact-line-systems
#############################


era-sh:NotYetAvailableShape
    a sh:NodeShape ;
    sh:target era-sh:NotYetAvailableSPARQLTarget .

# Added because era:InfrastructureElement has its own shape for this, to avoid duplication in validation reports
era-sh:NotYetAvailableSPARQLTarget a sh:SPARQLTarget ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT DISTINCT $this {
            $this era:notYetAvailable ?o .
            FILTER NOT EXISTS {
                $this a ?type .
                ?type rdfs:subClassOf* era:InfrastructureElement .
            }
        }""" .

era-sh:NotApplicableShape
    a sh:NodeShape ;
    sh:target era-sh:NotApplicableSPARQLTarget .

# Added because era:InfrastructureElement has its own shape for this, to avoid duplication in validation reports
era-sh:NotApplicableSPARQLTarget a sh:SPARQLTarget ;
    sh:prefixes era: ;
    sh:select """
        PREFIX era: <http://data.europa.eu/949/>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT DISTINCT $this {
            $this era:notApplicable ?o .
            FILTER NOT EXISTS {
                $this a ?type .
                ?type rdfs:subClassOf* era:InfrastructureElement .
            }
        }""" .

#
# not yet available (notYetAvailable)
#
era-sh:NotYetAvailableShape sh:property era-sh:NotYetAvailable .
era-sh:NotYetAvailable
        a sh:PropertyShape;
        era:affectedProperty era:notYetAvailable;
        era:affectedClass era:InfrastructureElement;
        era:scope "local";
		sh:path era:notYetAvailable ;  
        rdfs:comment "Reference to a property that is not provided."@en ;
		sh:nodeKind sh:IRI ;
        sh:or (
 		[sh:class owl:ObjectProperty ;]
		[sh:class owl:DatatypeProperty ;]
		);
        sh:severity sh:Violation ;
		sh:message "The value of this property is a reference to an ontology property that is not provided and it must be an IRI. The error may be due to the property not belonging to the ERA ontology or the property not being an IRI."@en .

#
# not applicable (notApplicable)
#
era-sh:NotApplicableShape sh:property era-sh:NotApplicable .
era-sh:NotApplicable
        a sh:PropertyShape;
        era:affectedProperty era:notApplicable;
        era:affectedClass era:InfrastructureElement;
        era:scope "local";
		sh:path era:notApplicable ;  
        rdfs:comment "Reference to a property that is not applicable."@en ;
		sh:nodeKind sh:IRI ;
        sh:or (
 		[sh:class owl:ObjectProperty ;]
		[sh:class owl:DatatypeProperty ;]
		);
        sh:severity sh:Violation ;
		sh:message "The value of this property is a reference to an ontology property that is not provided and it must be an IRI. The error may be due to the property not belonging to the ERA ontology or the property not being an IRI."@en .



#############################
# Rules for LevelCrossing
#############################

era-sh:LevelCrossingShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:LevelCrossing .



#########################################
# Rules for Border point valid coordinates
##########################################


era-sh:OperationalPointShape sh:sparql era-sh:BorderPointValidCoordinatesViaNetReference .
era-sh:BorderPointValidCoordinatesViaNetReference
    a sh:SPARQLConstraint ;
    era:affectedClass era:OperationalPoint ;
    era:affectedProperty geosparql:asWKT ;
    era:scope "local" ;
    rdfs:comment "Coordinates of topology must be sufficiently similar (within tolerance) to the referenced border point."@en ;
    sh:message """   
    Coordinates: The OperationalPoint {$this} with label {?opLabel} is a border point that references a ReferenceBorderPoint, whose topology coordinates are too far from the referenced ReferenceBorderPoint (distance: {?distance} degrees, max allowed: 0.0001 degrees ≈ 11 meters).
OP coordinates: {?opWKT}
Reference coordinates: {?refWKT}
    
    """@en ;
    sh:prefixes era: ;
    sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX geo: <http://www.opengis.net/ont/geosparql#>
    PREFIX geof: <http://www.opengis.net/def/function/geosparql/>
    PREFIX uom: <http://www.opengis.net/def/uom/OGC/1.0/>
    SELECT DISTINCT $this ?opWKT ?refWKT ?opLabel (geo:asWKT AS ?path)
    WHERE {
        $this era:opType <http://data.europa.eu/949/concepts/op-types/90> ;
            era:referenceBorderPoint ?refBP ;
            era:netReference ?netRef .
        ?refBP a era:ReferenceBorderPoint ;
            geo:hasGeometry/geo:asWKT ?refWKT .
        ?netRef geo:hasGeometry/geo:asWKT ?opWKT .
        OPTIONAL { $this rdfs:label ?opLabel0 } .
        BIND(COALESCE(?opLabel0, "unknown label") AS ?opLabel)

				# Calculate distance between the two point geometries
        # Using geof:distance in degrees (default for WGS84)
				BIND(geof:distance(?opWKT, ?refWKT, uom:degree) AS ?distance)

				# Allow tolerance of 0.0001 degrees (approximately 11 meters at equator)
        # Adjust this threshold based on your data quality requirements
        FILTER (?distance > 0.0001)
    }
    """ .

## Body shape 
era-sh:BodyShape
	a sh:NodeShape ;
	sh:targetClass era:Body ;
	sh:nodeKind sh:IRI ;
	sh:pattern "^http://data\\.europa\\.eu/949/" ;
	sh:message "Body URI: The instance has a URI that does not follow the required pattern '^http://data.europa.eu/949/'. All instances of era:Body must have URIs starting with http://data.europa.eu/949/."@en .

# role
era-sh:BodyShape sh:property era-sh:Role .

# changeActivity
era-sh:BodyShape sh:property era-sh:ChangeActivity .
era-sh:ChangeActivity
  a sh:PropertyShape ;
  era:affectedProperty era:changeActivity ;
  era:affectedClass era:Body ;
  era:scope "local" ;
  rdfs:comment "Links a Body to an activity representing a change affecting that resource."@en ;
  sh:path era:changeActivity ;
  sh:class era:Activity ;
  sh:severity sh:Violation ;
  sh:message "changeActivity: A Body may have changeActivity values that must be instances of era:Activity. This error may be due to having a value that is not an instance of Activity."@en .

# alternativeCode
era-sh:BodyShape sh:property era-sh:AlternativeCode .
era-sh:AlternativeCode
  a sh:PropertyShape ;
  era:affectedClass era:Body ;
  era:affectedProperty era:alternativeCode ;
  era:scope "local" ;
  rdfs:comment "Alternative code resulting of the integration of RISC into SRMO for managing organisation code."@en ;
  sh:path era:alternativeCode ;
  sh:datatype xsd:string ;
  sh:maxCount 1 ;
  sh:severity sh:Violation ;
  sh:message "alternativeCode: A Body may have at most one alternativeCode, and it must be a string. This error may be due to having a value that is not a string or having more than one alternativeCode."@en .

# passengerFlag
era-sh:PrimaryLocationShape sh:property era-sh:PassengerFlag .
era-sh:PassengerFlag
	a sh:PropertyShape ; 
    era:affectedProperty era:passengerFlag ;
    era:affectedClass  era:PrimaryLocation;
    era:scope "local";
    rdfs:comment "Indicates whether a passenger train can perform commercial passenger activity at a primary location."@en ;
	sh:path era:passengerFlag ;
	sh:datatype xsd:boolean;
	sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "passengerFlag : The PrimaryLocation may have a passengerFlag value that is a boolean. This error may be due to the Primary Location having  a value that is not a boolean or more than one value for this property."@en .


# tenClassification: Pre Deprecation Warning
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:TenClassificationPreDeprecationWarning .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:TenClassificationPreDeprecationWarning .
era-sh:TenClassificationPreDeprecationWarning
	a sh:SPARQLConstraint ;
    era:affectedProperty era:tenClassification;
    era:affectedClass era:RunningTrack, era:CommonCharacteristicsSubset;
    era:scope "local";
	rdfs:comment "Warning that tentNetworkLevel is to be preferred over the tenClassification." ;
	sh:message "tenClassification (Warning): The track {$this} uses the property 'tenClassification'. Please use 'tentNetworkLevel' and 'typeOfTraffic' with the respective SKOS concepts instead."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    SELECT $this (era:tenClassification AS ?path)
    WHERE {
 		$this era:tenClassification ?value .
	}
""" .


# localRulesOrRestrictionsDoc: 1.1.1.4.2, 1.2.3.2
era-sh:RunningTrackShape sh:sparql era-sh:LocalRulesOrRestrictionsDocApplicability .
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:LocalRulesOrRestrictionsDocApplicability.
era-sh:OperationalPointShape sh:sparql era-sh:LocalRulesOrRestrictionsDocApplicability .
era-sh:LocalRulesOrRestrictionsDocApplicability
	a sh:SPARQLConstraint ;
    era:affectedProperty era:localRulesOrRestrictionsDoc;
    era:affectedClass era:RunningTrack, era:CommonCharacteristicsSubset, era:OperationalPoint;
    era:scope "local";
	rdfs:comment "Only applicable when localRulesOrRestrictions is true. "@en ;
	era:rinfIndex "1.1.1.4.2" , "1.2.3.2" ;
	sh:message "localRulesOrRestrictionsDoc (1.1.1.4.2, 1.2.3.2): The track, subset with common characteristics or operational point {$this} ({?label}), has 'localRulesOrRestrictions' value 'true' which makes the localRulesOrRestrictionsDoc parameter applicable. This error is due to {$this} not having a value for such a parameter."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?label (era:localRulesOrRestrictionsDoc AS ?path)
			WHERE {
                $this era:localRulesOrRestrictions true.
        OPTIONAL { $this rdfs:label ?label0 } .
        BIND(COALESCE(?label0, "unknown label") AS ?label)
                FILTER NOT EXISTS {$this era:localRulesOrRestrictionsDoc ?value} . 
            }
			""" .


# freightCorridor: # 1.1.1.1.2.3, 1.2.1.0.2.3 
era-sh:RunningTrackShape sh:property era-sh:FreightCorridor.
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:FreightCorridor.
era-sh:FreightCorridor
	a sh:PropertyShape ;
    era:affectedProperty era:freightCorridor;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication whether the line is designated to a Railway Freight Corridor "@en ;
	era:rinfIndex "1.1.1.1.2.3", "1.2.1.0.2.3" ;
	sh:path era:freightCorridor ;
	sh:class skos:Concept ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "freightCorridor (1.1.1.1.2.3, 1.2.1.0.2.3): Each track may have an indication whether the line is designated to a Railway Freight Corridor that is an IRI. This error is due to having a value that is not an IRI."@en .

# freightCorridor: # 1.1.1.1.2.3, 1.2.1.0.2.3 
era-sh:RunningTrackShape sh:sparql era-sh:FreightCorridorSKOS.
era-sh:CommonCharacteristicsSubsetShape sh:sparql era-sh:FreightCorridorSKOS.
era-sh:FreightCorridorSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:freightCorridor;
    era:affectedClass era:RunningTrack;
    era:scope "local";
	rdfs:comment "Indication whether the line is designated to a Railway Freight Corridor "@en ;
	era:rinfIndex "1.1.1.1.2.3", "1.2.1.0.2.3" ;
	sh:message "Indication whether the line is designated to a Railway Freight Corridor (1.1.1.1.2.3, 1.2.1.0.2.3): The National Line {$this} has a value {?concept} that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/freight-corridor/FreightCorridors."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    SELECT $this ?concept (era:freightCorridor AS ?path)
    WHERE {
 		$this era:freightCorridor ?concept .
        era:freightCorridor era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# freightCorridor: Pre Deprecation Warning
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:FreightCorridorPreDeprecationWarning .
era-sh:CommonCharacteristicsSubsetShapeSPARQLWarning sh:sparql era-sh:FreightCorridorPreDeprecationWarning .
era-sh:FreightCorridorPreDeprecationWarning
	a sh:SPARQLConstraint ;
    era:affectedProperty era:freightCorridor;
    era:affectedClass era:RunningTrack, era:CommonCharacteristicsSubset;
    era:scope "local";
	rdfs:comment "Warning that europeanTransportCorridor is to be preferred over the freightCorridor." ;
	sh:message "freightCorridor (Warning): The track {$this} uses the property 'freightCorridor'. Please use 'europeanTransportCorridor' with the respective SKOS concepts instead."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    SELECT $this (era:freightCorridor AS ?path)
    WHERE {
 		$this era:freightCorridor ?value .
	}
""" .

# era-sh:TENTCorridorShape
era-sh:TENTCorridorShape
    a sh:NodeShape ;
    sh:nodeKind sh:IRI ;
    sh:targetClass era:TENTCorridor .

era-sh:RunningTrackShape sh:property era-sh:PartOfTENT .
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:PartOfTENT .
era-sh:PartOfTENT
    a sh:PropertyShape ;
    era:affectedProperty era:partOfTENT ;
    era:affectedClass era:RunningTrack, era:CommonCharacteristicsSubset ;
    era:scope "local" ;
    rdfs:comment "Links an element to its TEN-T network classification, which includes network level, type of traffic, and European transport corridor information."@en ;
    sh:path era:partOfTENT ;
    sh:nodeKind sh:IRI ;
    sh:class era:TENTCorridor ;
    sh:severity sh:Warning ;
    sh:message "partOfTENT: The running track {$this} must link to a TEN-T corridor classification (era:TENTCorridor) using an IRI. This error is due to having a value that is not an IRI or not an instance of era:TENTCorridor."@en .


# tentNetworkLevel:
era-sh:TENTCorridorShape sh:property era-sh:TentNetworkLevel .
era-sh:TentNetworkLevel
	a sh:PropertyShape ;
    era:affectedProperty era:tentNetworkLevel;
    era:affectedClass era:TENTCorridor ;
    era:scope "local";
    rdfs:comment "Classification of the element according to its level in the Trans-European Transport Network (TEN-T)."@en ;
    sh:path era:tentNetworkLevel ;
    sh:minCount 1 ;
	sh:nodeKind sh:IRI ;
	sh:class skos:Concept ;
	sh:severity sh:Violation ;
    sh:message "tentNetworkLevel: Each TEN-T corridor classification (era:TENTCorridor) may have a TEN-T network level that is an IRI and a SKOS concept. This error is due to having a value that is not an IRI or not a SKOS concept."@en .

# tentNetworkLevel:
era-sh:TENTCorridorShape sh:sparql era-sh:TentNetworkLevelSKOS .
era-sh:TentNetworkLevelSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:tentNetworkLevel;
    era:affectedClass era:TENTCorridor ;
    era:scope "local";
    rdfs:comment "Classification of the element according to its level in the Trans-European Transport Network (TEN-T)."@en ;
    sh:message "TEN-T network level: The TEN-T corridor classification {$this} has a value {?concept} that is not one of the predefined values in the scheme http://data.europa.eu/949/concepts/ten-t-network-levels/TENTNetworkLevels."@en ;    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    SELECT $this ?concept (era:tentNetworkLevel AS ?path)
    WHERE {
 		$this era:tentNetworkLevel ?concept .
        era:tentNetworkLevel era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# typeOfTraffic:
era-sh:TENTCorridorShape sh:property era-sh:TypeOfTraffic .
era-sh:TypeOfTraffic
	a sh:PropertyShape ;
    era:affectedProperty era:typeOfTraffic;
    era:affectedClass era:TENTCorridor ;
    era:scope "local";
	rdfs:comment "Classification of the type of traffic carried on the railway line"@en ;
	sh:path era:typeOfTraffic ;
    sh:minCount 1 ;
	sh:nodeKind sh:IRI ;
	sh:class skos:Concept ;
	sh:severity sh:Violation ;
    sh:message "typeOfTraffic: Each TEN-T corridor classification (era:TENTCorridor) may have a type of traffic that is an IRI and a SKOS concept. This error is due to having a value that is not an IRI or not a SKOS concept."@en .

# typeOfTraffic:
era-sh:TENTCorridorShape sh:sparql era-sh:TypeOfTrafficSKOS .
era-sh:TypeOfTrafficSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:typeOfTraffic;
    era:affectedClass era:TENTCorridor ;
    era:scope "local";
	rdfs:comment "Classification of the type of traffic carried on the railway line"@en ;
    sh:message "Type of traffic: The TEN-T corridor classification {$this} has a value {?concept} that is not one of the predefined values in the scheme http://data.europa.eu/949/concepts/traffic-types/TrafficTypes."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    SELECT $this ?concept (era:typeOfTraffic AS ?path)
    WHERE {
 		$this era:typeOfTraffic ?concept .
        era:typeOfTraffic era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# europeanTransportCorridor:
era-sh:TENTCorridorShape sh:property era-sh:EuropeanTransportCorridor .
era-sh:EuropeanTransportCorridor
	a sh:PropertyShape ;
    era:affectedProperty era:europeanTransportCorridor;
    era:affectedClass era:TENTCorridor ;
    era:scope "local";
	rdfs:comment "Indication of which European Transport Corridor the railway line belongs to"@en ;
	sh:path era:europeanTransportCorridor ;
	sh:nodeKind sh:IRI ;
	sh:class skos:Concept ;
	sh:severity sh:Violation ;
    sh:message "europeanTransportCorridor: Each TEN-T corridor classification (era:TENTCorridor) may indicate a European Transport Corridor using an IRI that is a SKOS concept. This error is due to having a value that is not an IRI or not a SKOS concept."@en .

# europeanTransportCorridor:
era-sh:TENTCorridorShape sh:sparql era-sh:EuropeanTransportCorridorSKOS .
era-sh:EuropeanTransportCorridorSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:europeanTransportCorridor;
    era:affectedClass era:TENTCorridor ;
    era:scope "local";
	rdfs:comment "Indication of which European Transport Corridor the railway line belongs to"@en ;
    sh:message "European Transport Corridor: The TEN-T corridor classification {$this} has a value {?concept} that is not one of the predefined values in the scheme http://data.europa.eu/949/concepts/european-transport-corridors/EuropeanTransportCorridors."@en ;
    sh:prefixes era:;
	sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    SELECT $this ?concept (era:europeanTransportCorridor AS ?path)
    WHERE {
 		$this era:europeanTransportCorridor ?concept .
        era:europeanTransportCorridor era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

			 
###########################################
# Rules for LinesideDistanceIndication
###########################################

# linesideDistanceIndication 1.1.1.0.0.3
era-sh:CommonCharacteristicsSubsetShape sh:property era-sh:LinesideDistanceIndicationCCS.
era-sh:LinesideDistanceIndicationCCS
	a sh:PropertyShape ; era:affectedProperty era:linesideDistanceIndication  ;     era:affectedClass  era:CommonCharacteristicsSubset;     era:scope "local";     
	rdfs:comment "Indication of types of appearance of track lineside distance indications."@en ;
	sh:path era:linesideDistanceIndication;
    sh:class era:LinesideDistanceIndication;
    # sh:node era-sh:LinesideDistanceIndicationShape; not implemented in the shacl engine
    sh:maxCount 1;
    era:rinfIndex "1.1.1.0.0.3";
	sh:nodeKind sh:IRI;
	sh:severity sh:Violation ;
	sh:message "linesideDistanceIndication (1.1.1.0.0.3) : The common characteristics subset may have at most one value of a lineside distance indication that must be an instance of LinesideDistanceIndication. This error may be due to the subset having more than one value or having a value that is not an instance of the class LinesideDistanceIndication."@en .

# linesideDistanceIndication 1.1.1.0.0.3
era-sh:RunningTrackShape sh:property era-sh:LinesideDistanceIndicationRT.
era-sh:LinesideDistanceIndicationRT
	a sh:PropertyShape ; era:affectedProperty era:linesideDistanceIndication  ;    
	 era:affectedClass  era:RunningTrack;     era:scope "local";     
	rdfs:comment "Indication of types of appearance of track lineside distance indications."@en ;
	sh:path era:linesideDistanceIndication;
    sh:class era:LinesideDistanceIndication;
    sh:maxCount 1;
    era:rinfIndex "1.1.1.0.0.3";
	sh:nodeKind sh:IRI;
	sh:severity sh:Violation ;
	sh:message "linesideDistanceIndication (1.1.1.0.0.3) : The track must have exactly one value of a lineside distance indication that must be an instance of LinesideDistanceIndication. This error may be due to the track having no value, having more than one value or having a value that is not an instance of the class LinesideDistanceIndication."@en .




# maxPermittedTrainLength
era-sh:RunningTrackShape sh:property era-sh:MaxPermittedTrainLength.
era-sh:MaxPermittedTrainLength
	a sh:PropertyShape ;
	era:affectedProperty era:maxPermittedTrainLength ;
	era:affectedClass era:RunningTrack;
	era:scope "local";
	rdfs:comment "Maximum train length permitted on the track."@en ;
	sh:path era:maxPermittedTrainLength ;
	sh:maxCount 1 ;
	sh:datatype xsd:double ;
	sh:minInclusive 0 ;
	sh:severity sh:Violation ;
	sh:message "maxPermittedTrainLength: The track must have at most one maximum train length value that is a double (real) number greater than or equal to 0. This error may be due to the track having more than one value, a negative value, or a value that is not a double (real) number."@en .

# maxPermittedTrainLength applicability for freight corridors
era-sh:RunningTrackShapeSPARQLWarning sh:sparql era-sh:MaxPermittedTrainLengthApplicability .
era-sh:MaxPermittedTrainLengthApplicability
	a sh:SPARQLConstraint ;
	era:affectedProperty era:maxPermittedTrainLength;
	era:affectedClass era:RunningTrack;
	era:scope "local";
	rdfs:comment "Maximum train length permitted on the track is mandatory for tracks that are part of a SectionOfLine and belong to freight corridors."@en;
	sh:message "maxPermittedTrainLength: This error is due to the track {?trackLabel} being part of a SectionOfLine and belonging to a freight corridor, violating the rule: Maximum train length is mandatory for tracks that are part of a SectionOfLine and part of freight corridors."@en ;
	sh:prefixes era:;
	sh:select """
	PREFIX era: <http://data.europa.eu/949/>
	PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
	PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    SELECT DISTINCT $this ?trackLabel (era:maxPermittedTrainLength AS ?path)
    WHERE {
        $this a era:RunningTrack .
        {
            $this era:isPartOf ?sol .
            ?sol a era:SectionOfLine .
        }
        UNION
        {
            ?sol a era:SectionOfLine ;
                 era:hasPart $this .
        }
        OPTIONAL { $this rdfs:label ?trackLabel0 } .
        BIND(COALESCE(?trackLabel0, "unknown label") AS ?trackLabel)
        {
            $this era:partOfTENT ?tenT .
            ?tenT era:typeOfTraffic <http://data.europa.eu/949/concepts/traffic-types/02> .
        }
        UNION
        {
            $this era:freightCorridor ?freightCorridor .
        }
        FILTER NOT EXISTS { $this era:maxPermittedTrainLength ?mtl }
    }
    """  .

#############################
# Rules for SpecialArea
#############################

era-sh:SpecialAreaShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:SpecialArea .

# SpecialTunnelArea is a subclass of SpecialArea
era-sh:SpecialTunnelAreaShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:SpecialTunnelArea .


# specialAreaType: # 1.1.0.0.1.1
era-sh:SpecialAreaShape sh:property era-sh:SpecialAreaType .


# specialAreaType SKOS constraint
era-sh:SpecialAreaShape sh:sparql era-sh:SpecialAreaTypeSKOS .

# specialAreaType: # 1.1.0.0.1.1
era-sh:SpecialAreaShape sh:property era-sh:SpecialAreaType .
era-sh:SpecialAreaType
	a sh:PropertyShape ;
	era:affectedProperty era:specialAreaType ;
	era:affectedClass era:SpecialArea ;
	era:scope "local" ;
	rdfs:comment "Indicates the special area or location types such as safe areas and restricted area types."@en ;
	era:rinfIndex "1.1.0.0.1.1" ;
	sh:path era:specialAreaType ;
	sh:class skos:Concept ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "specialAreaType (1.1.0.0.1.1): The special area type must be a valid IRI from the SpecialAreaTypes concept scheme."@en .

# specialAreaType SKOS constraint
era-sh:SpecialAreaShape sh:sparql era-sh:SpecialAreaTypeSKOS .
era-sh:SpecialAreaTypeSKOS
	a sh:SPARQLConstraint ;
	era:affectedProperty era:specialAreaType ;
	era:affectedClass era:SpecialArea ;
	era:scope "local" ;
	rdfs:comment "Validates that the special area type is from the correct SKOS concept scheme."@en ;
	era:rinfIndex "1.1.0.0.1.1" ;
	sh:message "specialAreaType (1.1.0.0.1.1): The value {$concept} for special area type must be from the SpecialAreaTypes concept scheme."@en ;
	sh:prefixes era: ;
	sh:select """
	PREFIX era: <http://data.europa.eu/949/>
	PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
	SELECT $this ?concept (era:specialAreaType AS ?path)
	WHERE {
		$this era:specialAreaType ?concept .
		era:specialAreaType era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS { ?concept skos:inScheme ?conceptScheme }
	}
	""" .


# subsidiaryLocationCode
era-sh:SubsidiaryLocationShape sh:property era-sh:SubsidiaryLocationCode .

era-sh:SubsidiaryLocationCode
	a sh:PropertyShape;
    era:affectedClass era:SubsidiaryLocation;
    era:affectedProperty era:subsidiaryLocationCode ;
    era:scope "local";
	rdfs:comment "Subsidiary location code."@en ;
	sh:path era:subsidiaryLocationCode ;
    sh:datatype xsd:string ;
    sh:minLength 1 ;
    sh:maxLength 10 ;
    sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "subsidiaryLocationCode: An instance of subsidiary location may have a value for subsidiary location code. This error may be due to having more than one value or a length grather than 10"@en .
	

#############################
# Rules for Switch
#############################

era-sh:SwitchShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:Switch .



#############################
# Rules for OWL-Time classes
#############################

# TemporalEntity is the base class for temporal intervals and instants
era-sh:TemporalEntityShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass time:TemporalEntity .

# Instant - a temporal entity with zero extent or duration
era-sh:InstantShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass time:Instant .

# TemporalDuration - time extent; duration of a time interval
era-sh:TemporalDurationShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass time:TemporalDuration .

#############################
# Temporal position properties for time:Instant
#############################

# inXSDDate - Position of an instant, expressed using xsd:date
era-sh:InstantShape sh:property era-sh:InXSDDate .


# inXSDDateTimeStamp - Position of an instant, expressed using xsd:dateTimeStamp
era-sh:InstantShape sh:property era-sh:InXSDDateTimeStamp .


# inXSDgYear - Position of an instant, expressed using xsd:gYear
era-sh:InstantShape sh:property era-sh:InXSDgYear .


# inXSDgYearMonth - Position of an instant, expressed using xsd:gYearMonth
era-sh:InstantShape sh:property era-sh:InXSDgYearMonth .


# inDateTime - Position of an instant, expressed using a structured description
era-sh:InstantShape sh:property era-sh:InDateTime .


# inTimePosition - Position of a time instant expressed as a TimePosition
era-sh:InstantShape sh:property era-sh:InTimePosition .


# inTemporalPosition - Position of a time instant
era-sh:InstantShape sh:property era-sh:InTemporalPosition .


#############################
# Duration properties for GeneralDurationDescription
#############################

# days - length of temporal extent expressed in days
era-sh:TemporalDurationShape sh:property era-sh:Days .


# months - length of temporal extent expressed in months
era-sh:TemporalDurationShape sh:property era-sh:Months .


# weeks - length of temporal extent expressed in weeks
era-sh:TemporalDurationShape sh:property era-sh:Weeks .


# years - length of temporal extent expressed in years
era-sh:TemporalDurationShape sh:property era-sh:Years .

#############################
# Temporal position properties for time:Instant
#############################

# inXSDDate - Position of an instant, expressed using xsd:date
era-sh:InstantShape sh:property era-sh:InXSDDate .
era-sh:InXSDDate
	a sh:PropertyShape ;
	era:affectedProperty time:inXSDDate ;
	era:affectedClass time:Instant ;
	era:scope "local" ;
	rdfs:comment "Position of an instant, expressed using xsd:date."@en ;
	sh:path time:inXSDDate ;
	sh:datatype xsd:date ;
	sh:severity sh:Violation ;
	sh:message "time:inXSDDate: The instant position must be expressed as an xsd:date."@en .

# inXSDDateTimeStamp - Position of an instant, expressed using xsd:dateTimeStamp
era-sh:InstantShape sh:property era-sh:InXSDDateTimeStamp .
era-sh:InXSDDateTimeStamp
	a sh:PropertyShape ;
	era:affectedProperty time:inXSDDateTimeStamp ;
	era:affectedClass time:Instant ;
	era:scope "local" ;
	rdfs:comment "Position of an instant, expressed using xsd:dateTimeStamp."@en ;
	sh:path time:inXSDDateTimeStamp ;
	sh:datatype xsd:dateTimeStamp ;
	sh:severity sh:Violation ;
	sh:message "time:inXSDDateTimeStamp: The instant position must be expressed as an xsd:dateTimeStamp."@en .

# inXSDgYear - Position of an instant, expressed using xsd:gYear
era-sh:InstantShape sh:property era-sh:InXSDgYear .
era-sh:InXSDgYear
	a sh:PropertyShape ;
	era:affectedProperty time:inXSDgYear ;
	era:affectedClass time:Instant ;
	era:scope "local" ;
	rdfs:comment "Position of an instant, expressed using xsd:gYear."@en ;
	sh:path time:inXSDgYear ;
	sh:datatype xsd:gYear ;
	sh:severity sh:Violation ;
	sh:message "time:inXSDgYear: The instant position must be expressed as an xsd:gYear."@en .

# inXSDgYearMonth - Position of an instant, expressed using xsd:gYearMonth
era-sh:InstantShape sh:property era-sh:InXSDgYearMonth .
era-sh:InXSDgYearMonth
	a sh:PropertyShape ;
	era:affectedProperty time:inXSDgYearMonth ;
	era:affectedClass time:Instant ;
	era:scope "local" ;
	rdfs:comment "Position of an instant, expressed using xsd:gYearMonth."@en ;
	sh:path time:inXSDgYearMonth ;
	sh:datatype xsd:gYearMonth ;
	sh:severity sh:Violation ;
	sh:message "time:inXSDgYearMonth: The instant position must be expressed as an xsd:gYearMonth."@en .

# inDateTime - Position of an instant, expressed using a structured description
era-sh:InstantShape sh:property era-sh:InDateTime .
era-sh:InDateTime
	a sh:PropertyShape ;
	era:affectedProperty time:inDateTime ;
	era:affectedClass time:Instant ;
	era:scope "local" ;
	rdfs:comment "Position of an instant, expressed using a structured description."@en ;
	sh:path time:inDateTime ;
	sh:class time:GeneralDateTimeDescription ;
	sh:nodeKind sh:BlankNodeOrIRI ;
	sh:severity sh:Violation ;
	sh:message "time:inDateTime: The instant position must be a time:GeneralDateTimeDescription."@en .

# inTimePosition - Position of a time instant expressed as a TimePosition
era-sh:InstantShape sh:property era-sh:InTimePosition .
era-sh:InTimePosition
	a sh:PropertyShape ;
	era:affectedProperty time:inTimePosition ;
	era:affectedClass time:Instant ;
	era:scope "local" ;
	rdfs:comment "Position of a time instant expressed as a TimePosition."@en ;
	sh:path time:inTimePosition ;
	sh:class time:TimePosition ;
	sh:nodeKind sh:BlankNodeOrIRI ;
	sh:severity sh:Violation ;
	sh:message "time:inTimePosition: The instant position must be a time:TimePosition."@en .

# inTemporalPosition - Position of a time instant
era-sh:InstantShape sh:property era-sh:InTemporalPosition .
era-sh:InTemporalPosition
	a sh:PropertyShape ;
	era:affectedProperty time:inTemporalPosition ;
	era:affectedClass time:Instant ;
	era:scope "local" ;
	rdfs:comment "Position of a time instant."@en ;
	sh:path time:inTemporalPosition ;
	sh:class time:TemporalPosition ;
	sh:nodeKind sh:BlankNodeOrIRI ;
	sh:severity sh:Violation ;
	sh:message "time:inTemporalPosition: The instant position must be a time:TemporalPosition."@en .

#############################
# Duration properties for GeneralDurationDescription
#############################

# days - length of temporal extent expressed in days
era-sh:TemporalDurationShape sh:property era-sh:Days .
era-sh:Days
	a sh:PropertyShape ;
	era:affectedProperty time:days ;
	era:affectedClass time:TemporalDuration ;
	era:scope "local" ;
	rdfs:comment "Length of, or element of the length of, a temporal extent expressed in days."@en ;
	sh:path time:days ;
	sh:datatype xsd:decimal ;
	sh:severity sh:Violation ;
	sh:message "time:days: The days duration must be expressed as a decimal number (xsd:decimal)."@en .

# months - length of temporal extent expressed in months
era-sh:TemporalDurationShape sh:property era-sh:Months .
era-sh:Months
	a sh:PropertyShape ;
	era:affectedProperty time:months ;
	era:affectedClass time:TemporalDuration ;
	era:scope "local" ;
	rdfs:comment "Length of, or element of the length of, a temporal extent expressed in months."@en ;
	sh:path time:months ;
	sh:datatype xsd:decimal ;
	sh:severity sh:Violation ;
	sh:message "time:months: The months duration must be expressed as a decimal number (xsd:decimal)."@en ;
	skos:note "In the Gregorian calendar the length of the month is not fixed. Therefore, a value like '2.5 months' cannot be exactly compared with a similar duration expressed in terms of weeks or days."@en .

# weeks - length of temporal extent expressed in weeks
era-sh:TemporalDurationShape sh:property era-sh:Weeks .
era-sh:Weeks
	a sh:PropertyShape ;
	era:affectedProperty time:weeks ;
	era:affectedClass time:TemporalDuration ;
	era:scope "local" ;
	rdfs:comment "Length of, or element of the length of, a temporal extent expressed in weeks."@en ;
	sh:path time:weeks ;
	sh:datatype xsd:decimal ;
	sh:severity sh:Violation ;
	sh:message "time:weeks: The weeks duration must be expressed as a decimal number (xsd:decimal)."@en .

# years - length of temporal extent expressed in years
era-sh:TemporalDurationShape sh:property era-sh:Years .
era-sh:Years
	a sh:PropertyShape ;
	era:affectedProperty time:years ;
	era:affectedClass time:TemporalDuration ;
	era:scope "local" ;
	rdfs:comment "Length of, or element of the length of, a temporal extent expressed in years."@en ;
	sh:path time:years ;
	sh:datatype xsd:decimal ;
	sh:severity sh:Violation ;
	sh:message "time:years: The years duration must be expressed as a decimal number (xsd:decimal)."@en .

## Activity shape
era-sh:ActivityShape
	a sh:NodeShape ;
	sh:nodeKind sh:IRI ;
	sh:targetClass era:Activity .

# revokedCode
era-sh:ActivityShape sh:property era-sh:RevokedCode .
era-sh:RevokedCode
	a sh:PropertyShape ;
	era:affectedProperty era:revokedCode ;
	era:affectedClass era:Activity ;
	era:scope "local" ;
	rdfs:comment "Organisation code value that was revoked."@en ;
	sh:path era:revokedCode ;
	sh:datatype xsd:string ;
	sh:severity sh:Violation ;
	sh:message "revokedCode: An Activity may have at most one revokedCode value that must be a string. This error may be due to having more than one value or having a value that is not a string."@en .

# dct:valid
era-sh:ActivityShape sh:property era-sh:ValidDate .
era-sh:ValidDate
	a sh:PropertyShape ;
	era:affectedProperty dct:valid ;
	era:affectedClass era:Activity ;
	era:scope "local" ;
	rdfs:comment "The effective date of the activity (e.g. revocation date)."@en ;
	sh:path dct:valid ;
	sh:datatype xsd:dateTimeStamp ;
	sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "dct:valid: An Activity may have at most one valid date that must be an xsd:date. This error may be due to having more than one value or having a value that is not a date."@en .

# rdfs:label
era-sh:ActivityShape sh:property era-sh:ActivityLabel .
era-sh:ActivityLabel
	a sh:PropertyShape ;
	era:affectedProperty rdfs:label ;
	era:affectedClass era:Activity ;
	era:scope "local" ;
	rdfs:comment "The label of the activity."@en ;
	sh:path rdfs:label ;
	sh:datatype rdf:langString ;
	sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "rdfs:label: An Activity may have at most one label that must be a language-tagged string literal. This error may be due to having more than one value or having a value that is not a language-tagged string literal."@en .

# dct:creator
era-sh:BodyShape sh:property era-sh:Creator .
era-sh:ActivityShape sh:property era-sh:Creator .
era-sh:Creator
	a sh:PropertyShape ;
	era:affectedProperty dct:creator ;
	era:affectedClass era:Activity ;
	era:scope "local" ;
	rdfs:comment "The creator of the activity."@en ;
	sh:path dct:creator ;
	sh:nodeKind sh:IRI ;
	sh:in ( <http://publications.europa.eu/resource/authority/corporate-body/ERA> <https://www.wikidata.org/entity/450896602> ) ;
	sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "dct:creator: An Activity may have at most one creator that must be an IRI. This error may be due to having more than one value or having a value that is not an IRI."@en .

# dct:type
era-sh:ActivityShape sh:property era-sh:ActivityType .
era-sh:ActivityType
	a sh:PropertyShape ;
	era:affectedProperty dct:type ;
	era:affectedClass era:Activity ;
	era:scope "local" ;
	rdfs:comment "The type of the activity."@en ;
	sh:path dct:type ;
	sh:nodeKind sh:IRI ;
	sh:maxCount 1 ;
	sh:severity sh:Violation ;
	sh:message "dct:type: An Activity may have at most one type that must be an IRI. This error may be due to having more than one value or having a value that is not an IRI."@en .

era-sh:ActivityShape sh:sparql era-sh:ActivityTypeSKOS .
era-sh:ActivityTypeSKOS
	a sh:SPARQLConstraint ;
	era:affectedProperty dct:type ;
	era:affectedClass era:Activity ;
	era:scope "local" ;
	rdfs:comment "The type of the activity must be a valid IRI from the Activities concept scheme."@en ;
  sh:message "dct:type: The type of the activity must be a valid IRI from the Activities concept scheme. This error may be due to having a value that is not an IRI or a value that is not one of the predefined values and cannot be converted into a SKOS concept on this list: http://data.europa.eu/949/concepts/activities/Activities."@en ;
  sh:prefixes era:;
	sh:select """
    PREFIX dct: <http://purl.org/dc/terms/>
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?thisLabel ?concept (dct:type AS ?path)
    WHERE {
        OPTIONAL { $this rdfs:label ?thisLabel0 } .
        BIND(COALESCE(?thisLabel0, "unknown label") AS ?thisLabel)
        $this dct:type ?concept .
        FILTER NOT EXISTS {
            ?concept skos:inScheme <http://data.europa.eu/949/concepts/activities/Activities>
        }
    }
""" .

# era-sh:LangStringEnRequired - Property must have at least one value with language tag @en.
era-sh:LangStringEnRequired
    a sh:SPARQLConstraint ;
    sh:select """
      SELECT $this (<http://www.w3.org/2000/01/rdf-schema#label> AS ?path)
      WHERE {
        FILTER NOT EXISTS {
          $this $PATH ?value .
          FILTER (LANGMATCHES(lang(?value), "en"))
        }
      }
    """ ;
.

# era-sh:LangStringEnRequiredIfPresent - Property must have at least one value has language tag @en.
era-sh:LangStringEnRequiredIfPresent
    a sh:SPARQLConstraint ;
    sh:select """
    SELECT $this (<http://data.europa.eu/949/primaryLocationName> AS ?path)
         WHERE {
             # If the property exists
             $this $PATH ?anyName .

             # then there should exist at least one English value
             FILTER NOT EXISTS {
             $this $PATH ?value .
             FILTER (LANGMATCHES(lang(?value), "en") )
         }
     }
  """ ;
.

# ERA-ONTO part, to be extracted + smart merge in the future

era-sh:AllEraTypesTarget
    a sh:SPARQLTarget ;
    era:scope "local" ;
    sh:select """
        SELECT DISTINCT ?this
        WHERE { 
          ?s a ?this .
          FILTER(STRSTARTS(STR(?this), "http://data.europa.eu/949/")) .
        }
    """ .

era-sh:AllEraPropertiesTarget
    a sh:SPARQLTarget ;
    era:scope "local" ;
    sh:select """
        SELECT DISTINCT ?this
        WHERE { 
          ?s ?this ?o .
          FILTER(STRSTARTS(STR(?this), "http://data.europa.eu/949/")) .
        }
    """ .

##############################################################
# ERA class validation
##############################################################

era-sh:EraOntologyClassShape
    a sh:NodeShape ;
    sh:target era-sh:AllEraTypesTarget ;
    sh:severity sh:Violation ;
.

##############################################################
# 1. ERA classes must exist in ontology
##############################################################

era-sh:EraOntologyClassShape sh:sparql era-sh:EraOntologyClassSPARQL .
era-sh:EraOntologyClassSPARQL
        a sh:SPARQLConstraint ;
        sh:message "Invalid ERA class {$this}. The class is not defined in the ERA ontology (possible typo)."@en ;
        sh:select """
            PREFIX owl:  <http://www.w3.org/2002/07/owl#>
            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

            SELECT $this (rdf:type AS ?path)
            WHERE {
              FILTER NOT EXISTS {
                { $this a owl:Class }
                UNION
                { $this a rdfs:Class }
              }
            }
        """
    .

##############################################################
# 2. Deprecated ERA classes
##############################################################

era-sh:EraOntologyClassShape sh:sparql era-sh:EraOntologyDeprecatedClassSPARQL .
era-sh:EraOntologyDeprecatedClassSPARQL
        a sh:SPARQLConstraint ;
        sh:message "Deprecated ERA class {$this} used. Suggested replacement: {$replacement}"@en ;
        sh:select """
            PREFIX owl:  <http://www.w3.org/2002/07/owl#>
            PREFIX vs:   <http://www.w3.org/2003/06/sw-vocab-status/ns#>
            PREFIX dct: <http://purl.org/dc/terms/>
            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

            SELECT $this ?replacement (rdf:type AS ?path)
            WHERE {
              {
                $this owl:deprecated true
              }
              UNION
              {
                $this vs:term_status "archaic"
              }

              OPTIONAL {
                $this dct:isReplacedBy ?replacement0
              }
              BIND(COALESCE(?replacement0, "?") AS ?replacement)
            }
        """
    .

##############################################################
# ERA property validation
##############################################################

era-sh:EraOntologyPropertyShape
    a sh:NodeShape ;
    sh:target era-sh:AllEraPropertiesTarget ;
    sh:severity sh:Violation ;
.

##############################################################
# 3. ERA predicates must exist and be defined properties
# (robust typo detection)
##############################################################

era-sh:EraOntologyPropertyShape sh:sparql era-sh:EraOntologyPredicateSPARQL .
era-sh:EraOntologyPredicateSPARQL
        a sh:SPARQLConstraint ;
        sh:message "Invalid ERA predicate {$this}. The term is not defined as a property in the ERA ontology (possible typo)."@en ;
        sh:select """
            PREFIX rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
            PREFIX owl:  <http://www.w3.org/2002/07/owl#>

            SELECT $this  ($this AS ?path)
            WHERE {
              FILTER NOT EXISTS {
                { $this a rdf:Property }
                UNION
                { $this a owl:ObjectProperty }
                UNION
                { $this a owl:DatatypeProperty }
                UNION
                { $this a owl:AnnotationProperty }
              }
            }
        """
    .

##############################################################
# 4. Deprecated ERA predicates
##############################################################

era-sh:EraOntologyPropertyShape sh:sparql era-sh:EraOntologyDeprecatedPropertySPARQL .
era-sh:EraOntologyDeprecatedPropertySPARQL
        a sh:SPARQLConstraint ;
        sh:message "Deprecated ERA property {$this} used. Suggested replacement: {$replacement}"@en ;
        sh:select """
            PREFIX owl: <http://www.w3.org/2002/07/owl#>
            PREFIX vs:  <http://www.w3.org/2003/06/sw-vocab-status/ns#>
            PREFIX dct: <http://purl.org/dc/terms/>

            SELECT $this ?replacement ($this AS ?path)
            WHERE {
              {
                $this owl:deprecated true
              }
              UNION
              {
                $this vs:term_status "archaic"
              }

              OPTIONAL {
                $this dct:isReplacedBy ?replacement0
              }
              BIND(COALESCE(?replacement0, "?") AS ?replacement)
            }
        """
    .


