@prefix era-sh: <http://data.europa.eu/949/shapes/> .
@prefix ex: <http://example.org/ns#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix era: <http://data.europa.eu/949/> .
@prefix  era-cls: <http://data.europa.eu/949/concepts/contact-line-systems/> .
@prefix  era-ess: <http://data.europa.eu/949/concepts/energy-supply-systems/> .
@prefix skos:<http://www.w3.org/2004/02/skos/core#> .
#############################
# Rules for contact-line-systems
#############################

era-sh:contactLineSystemShape  
    a sh:NodeShape ;
    sh:targetClass era:ContactLineSystem .

# 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";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the type of the contact line system" ;
	era:rinfIndex "1.1.1.2.2.1.1" ;
	sh:path era:contactLineSystemType ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "contactLineSystemType (1.1.1.2.2.1.1): The contact line system has a contact line system type that must be 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";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the type of the contact line system" ;
	era:rinfIndex "1.1.1.2.2.1.1" ;
	sh:severity sh:Violation ;
	sh:message "Indication of the type of the contact line system (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
    WHERE {
        $this era:contactLineSystemType ?concept .
        era:contactLineSystemType era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# 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";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the traction supply system" ;
	era:rinfIndex "1.1.1.2.2.1.2" ;
	sh:path era:energySupplySystem ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "energySupplySystem (1.1.1.2.2.1.2): The contact line system defines the energy supply system and it must be an IRI."@en .

# energySupplySystem: # 1.1.1.2.2.1.2
era-sh:contactLineSystemShape sh:sparql era-sh:EnergySupplySystemSKOS .
era-sh:EnergySupplySystemSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:energySupplySystem;
    era:affectedClass era:ContactLineSystem;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the traction supply system" ;
	era:rinfIndex "1.1.1.2.2.1.2" ;
	sh:severity sh:Violation ;
	sh:message "Indication of the traction supply system (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
    WHERE {
        $this era:energySupplySystem ?concept .
        era:energySupplySystem era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# energySupplySystemTSICompliant: # 1.1.1.2.2.1.2.1
era-sh:contactLineSystemShape sh:property era-sh:energySupplySystemTSICompliant .
era-sh:energySupplySystemTSICompliant
	a sh:PropertyShape ;
    era:affectedProperty era:energySupplySystemTSICompliant;
    era:affectedClass era:ContactLineSystem;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication if the traction supply system is fully compliant with TSI" ;
	era:rinfIndex "1.1.1.2.2.1.2.1" ;
	sh:path era:energySupplySystemTSICompliant ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "energySupplySystemTSICompliant (1.1.1.2.2.1.2.1): The contact line system defines if the energy supply system is fully compliant with TSI. This error is due to having a value that is not Y/N (boolean)."@en .



# 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";
    era:validationAfterXML "false"^^xsd:boolean;
	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" ;
	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: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 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";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the maximum allowable train current" ;
	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:severity sh:Violation ;
	sh:message "maxTrainCurrent (1.1.1.2.2.2): The contact line system defines the maximum allowable train current . This error is due to 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
era-sh:contactLineSystemShape sh:property era-sh:maxCurrentStandstillPantographCLS .
era-sh:maxCurrentStandstillPantographCLS
	a sh:PropertyShape ;
    era:affectedProperty era:maxCurrentStandstillPantograph;
    era:affectedClass era:ContactLineSystem;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the maximum allowable current at standstill per pantograph" ;
	era:rinfIndex "1.1.1.2.2.3" ;
	sh:path era:maxCurrentStandstillPantograph ;
	sh:datatype xsd:double ;
	sh:pattern "[1-9]\\d{0,2}|0" ; #TODO check pattern, it is defined as double
	sh:severity sh:Violation ;
	sh:message "maxCurrentStandstillPantograph (1.1.1.2.2.3): The contact line system defines the maximum allowable current at standstill per pantograph . This error is due to having a value that is not a double (real) number or having a number that does not follow the pattern [NNN] (with 0 decimals)."@en .

# 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";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication if the regenerative brake is permitted" ;
	era:rinfIndex "1.1.1.2.2.4" ;
	sh:path era:conditionalRegenerativeBrake ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "conditionalRegenerativeBrake (1.1.1.2.2.4): The contact line system defines if the regenerative brake is permitted. This error is due to having a value that is not  Y/N (boolean)."@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";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the current or power limitation on board required" ;
	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 contact line system defines the current or power limitation on board required . This error is due to having a value that is not Y/N (boolean)."@en .@prefix ex: <http://example.org/ns#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix era: <http://data.europa.eu/949/> .
#############################
# Rules for meso-net-elements
#############################

#
# meso-net-elements: Meso NetElements from Operational Points and from Sections of Line
#
sh:mesonetelementShape
	a sh:NodeShape ;
	sh:targetClass era:NetElement .

# Applies to all MesoNetElements

sh:mesonetelementShape sh:property sh:hasImplementation. 
sh:hasImplementation
		sh:path era:hasImplementation ; 
        era:affectedProperty era:hasImplementation;
        era:affectedClass era:NetElement;
        era:scope "local";
        era:validationAfterXML "true"^^xsd:boolean;
		#sh:minCount 1 ; Some net elements do not have a corresponding element in the infrastructure
        sh:maxCount 1 ;
		sh:nodeKind sh:IRI ;
		sh:message "This error is due to the net element instance not having a value or having more than one value for the property has implementation"@en .
	
	@prefix ex: <http://example.org/ns#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix era: <http://data.europa.eu/949/> .
#############################
# Rules for meso-net-relations
#############################

#
# meso-net-relations: Meso NetRelations from Operational Points and from Sections of Line
#
sh:mesonetrelationShape
	a sh:NodeShape ;
	sh:targetClass era:NetRelation .    # Applies to all NetRelation
	
sh:mesonetrelationShape sh:property sh:elementA. 
sh:elementA
		sh:path era:elementA ; 
        era:affectedProperty era:elementA;
        era:affectedClass era:NetRelation;
        era:scope "local";
        era:validationAfterXML "true"^^xsd:boolean;
		sh:minCount 1 ;
        sh:maxCount 1 ;
		sh:nodeKind sh:IRI ;
		sh:message "This error is due to the net relation instance not having a value or having more than one value for the property element A"@en .

sh:mesonetrelationShape sh:property sh:elementB.
sh:elementB
		sh:path era:elementB ; 
        era:affectedProperty era:elementB;
        era:affectedClass era:NetRelation;
        era:scope "local";
        era:validationAfterXML "true"^^xsd:boolean;
		sh:minCount 1 ;
        sh:maxCount 1 ;
		sh:nodeKind sh:IRI ;
		sh:message "This error is due to the net relation instance or having more than one value for the property element B"@en .
	
	@prefix era-sh: <http://data.europa.eu/949/shapes/> .
@prefix ex: <http://example.org/ns#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix era: <http://data.europa.eu/949/> .
@prefix era-linecat: <http://data.europa.eu/949/concepts/line-category/> .
@prefix era-fc: <http://data.europa.eu/949/concepts/freight-corridor/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .

#############################
# Rules for national-lines
#############################

#
# national-lines
#
era-sh:nationallinesShape
	a sh:NodeShape ;
	sh:targetClass era:NationalRailwayLine .

# inCountry 
era-sh:nationallinesShape sh:property era-sh:inCountryNL .
era-sh:inCountryNL
	a sh:PropertyShape;
    era:affectedProperty era:inCountry;
    era:affectedClass era:NationalRailwayLine;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indicates the country to which the national line belongs" ; 
	sh:path era:inCountry ;
	sh:maxCount 1 ;
	sh:nodeKind sh:IRI;
	sh:severity sh:Violation ;
	sh:message "inCountry:  Each national line must have exactly one country. This error may be due to having an OP without or with more than one country or it value is not a Concept."@en .

# inCountry
era-sh:nationallinesShape sh:sparql era-sh:inCountrySKOSNL .
era-sh:inCountrySKOSNL
	a sh:SPARQLConstraint ;
    era:affectedProperty era:inCountry;
    era:affectedClass era:NationalRailwayLine;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indicates the country to which the national line belongs" ; 
	sh:severity sh:Violation ;
	sh:message "Country in which the national line belongs: 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://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
    WHERE {
 		$this era:inCountry ?concept .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme <http://publications.europa.eu/resource/authority/country> .
		}
	}
""" .

# lineCategory: # 1.1.1.1.2.2, 1.2.1.0.2.2
era-sh:nationallinesShape sh:property era-sh:lineCategoryShape .
era-sh:lineCategoryShape
	a sh:PropertyShape ;
    era:affectedProperty era:lineCategory;
    era:affectedClass era:NationalRailwayLine;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Classification of a line according to the INF TSI" ;
	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): Each track has a classification of a line according to the INF TSI and the value must be an IRI"@en .

# lineCategory: # 1.1.1.1.2.2, 1.2.1.0.2.2
era-sh:nationallinesShape sh:sparql era-sh:lineCategorySKOS .
era-sh:lineCategorySKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:lineCategory;
    era:affectedClass era:NationalRailwayLine;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Classification of a line according to the INF TSI" ;
	era:rinfIndex "1.1.1.1.2.2", "1.2.1.0.2.2" ;
	sh:severity sh:Violation ;
	sh:message "Classification of a line according to the INF TSI (1.1.1.1.2.2, 1.2.1.0.2.2): 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/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#>
    SELECT $this ?concept
    WHERE {
 		$this era:lineCategory ?concept .
        era:lineCategory era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .


# freightCorridor: # 1.1.1.1.2.3, 1.2.1.0.2.3
era-sh:nationallinesShape sh:property era-sh:freightCorridorShape .
era-sh:freightCorridorShape
	a sh:PropertyShape ;
    era:affectedProperty era:lineCategory;
    era:affectedClass era:freightCorridor;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication whether the line is designated to a Railway Freight Corridor" ;
	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 must have an indication whether the line is designated to a Railway Freight Corridor"@en .

# freightCorridor: # 1.1.1.1.2.3, 1.2.1.0.2.3
era-sh:nationallinesShape sh:sparql era-sh:freightCorridorSKOS .
era-sh:freightCorridorSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:lineCategory;
    era:affectedClass era:freightCorridor;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication whether the line is designated to a Railway Freight Corridor" ;
	era:rinfIndex "1.1.1.1.2.3", "1.2.1.0.2.3" ;
	sh:severity sh:Violation ;
	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
    WHERE {
 		$this era:freightCorridor ?concept .
        era:freightCorridor era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .
@prefix era-sh: <http://data.europa.eu/949/shapes/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix era: <http://data.europa.eu/949/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
#############################
# Rules for sol-not-yet-available
#############################

#
# not yet available (notYetAvailable)
#
era-sh:notYetavAilableNodeShape
	a sh:NodeShape ;
    sh:targetClass era:Track, era:OperationalPoint, era:ContactLineSystem, era:era:TrainDetectionSystem, era:ETCSLevel, era:Siding, era:Tunnel, era:PlatformEdge.

era-sh:notYetavAilableNodeShape sh:property era-sh:notYetAvailablePropertyShape .
era-sh:notYetAvailablePropertyShape
        a sh:PropertyShape;
        era:affectedProperty era:notYetAvailable;
        era:affectedClass era:SectionOfLine, era:Track, era:OperationalPoint, era:Platform, era:TrainDetectionSystem, era:ContactLineSystem, era:NationalRaiwayLine, era:Tunnel, era:Platform, era:Siding;
        era:scope "local";
        era:validationAfterXML "false"^^xsd:boolean;
		sh:path era:notYetAvailable ;  
        rdfs:comment "Reference to a property that is not provided."@en ;
		sh:nodeKind sh:IRI ;
        #sh:class owl:ObjectProperty, 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:notApplicableNodeShape
	a sh:NodeShape ;
    sh:targetClass era:Track, era:OperationalPoint, era:ContactLineSystem, era:era:TrainDetectionSystem, era:ETCSLevel, era:Siding, era:Tunnel, era:PlatformEdge.

era-sh:notApplicableNodeShape sh:property era-sh:notApplicablePropertyShape .
era-sh:notApplicablePropertyShape
        a sh:PropertyShape;
        era:affectedProperty era:notApplicable;
        era:affectedClass era:SectionOfLine, era:Track, era:OperationalPoint, era:Platform, era:TrainDetectionSystem, era:ContactLineSystem, era:NationalRaiwayLine, era:Tunnel, era:Platform, era:Siding;
        era:scope "local";
        era:validationAfterXML "false"^^xsd:boolean;
		sh:path era:notApplicable ;  
        rdfs:comment "Reference to a property that is not applicable."@en ;
		sh:nodeKind sh:IRI ;
        #sh:class owl:ObjectProperty, 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 .@prefix era-sh: <http://data.europa.eu/949/shapes/> .
@prefix ex: <http://example.org/ns#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix era: <http://data.europa.eu/949/> .
@prefix era-sn: <http://data.europa.eu/949/concepts/sol-natures/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix wgs: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix geosparql: <http://www.opengis.net/ont/geosparql#> .
@prefix era-ph: <http://data.europa.eu/949/concepts/platform-heights/> .
@prefix era-tenclass: <http://data.europa.eu/949/concepts/ten-classifications/> .
@prefix era-gaugings: <http://data.europa.eu/949/concepts/gaugings/> .
@prefix era-ntg: <http://data.europa.eu/949/concepts/nominal-track-gauges/> .
@prefix era-linecat: <http://data.europa.eu/949/concepts/line-category/> .
@prefix era-frecorr: <http://data.europa.eu/949/concepts/freight-corridor/> .

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

#
# op-track
#

era-sh:operationalPointShape
	a sh:NodeShape ;
	sh:targetClass era:OperationalPoint .



era-sh:operationalPointShape sh:sparql era-sh:OPTrackIdsMaxCount.
era-sh:OPTrackIdsMaxCount 
   a sh:SPARQLConstraint ;
   era:affectedProperty era:trackId;
    era:affectedClass era:Track;
    era:affectedClass era:OperationalPoint;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
   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." ;
   era:rinfIndex "1.2.1.0.0.2" ;
     sh:severity sh:Violation ;
     sh:message "There should be at most one Track ID. There is a problem with OP {$this} ({?opLabel}) 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
	 		WHERE {
                $this era:track ?track .
     			OPTIONAL{?track rdfs:label ?trackLabel} .
	 			OPTIONAL{$this rdfs:label ?opLabel} .
                ?track era:trackId ?value1 .
                 ?track era:trackId ?value2 .
                 FILTER(?value1 < ?value2) .
   	 	}
		 	""" .

 era-sh:operationalPointShape sh:sparql era-sh:OPTrackIdsMinCount.
 era-sh:OPTrackIdsMinCount
    a sh:SPARQLConstraint ; 
    era:affectedProperty era:trackId;
    era:affectedClass era:Track;
    era:affectedClass era:OperationalPoint;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    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." ;
    era:rinfIndex "1.2.1.0.0.2" ;
    sh:severity sh:Violation ;
     sh:message "There should be at least one Track Id. There is a problem with OP {$this} ({?opLabel}) 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 ?opLabel ?track ?trackLabel ?value
	 		WHERE {
                 $this era:track ?track .
     			OPTIONAL{?track rdfs:label ?trackLabel} .
	 			OPTIONAL{$this rdfs:label ?solLabel} .
                FILTER NOT EXISTS{?track era:trackId ?value} .
   	 		}
	 		""" .

# 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:Track;
    era:affectedClass era:OperationalPoint;
    era:scope "global";
    era:validationAfterXML "false"^^xsd:boolean;
    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." ;
    era:rinfIndex "1.2.1.0.0.2" ;
    sh:severity sh:Violation ;
    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
			WHERE {
                $this era:track ?track1 .
                $this era:track ?track2 .
                ?track1 era:trackId ?value .
                ?track2 era:trackId ?value .
                FILTER(?track1 != ?track2) . 
				OPTIONAL{$this rdfs:label ?opLabel} .
				OPTIONAL{?track1 rdfs:label ?track1Label} .
				OPTIONAL{?track2 rdfs:label ?track2Label} .
			}
			""" .

era-sh:operationalPointShape sh:sparql era-sh:imCodeOPTMaxCount.
era-sh:imCodeOPTMaxCount 
   a sh:SPARQLConstraint ;
   era:affectedProperty era:imCode;
    era:affectedClass era:Track;
    era:affectedClass era:OperationalPoint;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
   rdfs:comment "Infrastructure manager means any body or undertaking that is responsible in particular for establishing and maintaining railway infrastructure or a part thereof" ;
   era:rinfIndex "1.2.1.0.0.1" ;
     sh:severity sh:Violation ;
     sh:message "Each track in an OP must refer to exactly one infrastructure manager. There is a problem with OP {$this} ({?opLabel}) 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 ?opLabel ?track ?trackLabel ?value1 ?value2
	 		WHERE {
                $this era:track ?track .
     			OPTIONAL{?track rdfs:label ?trackLabel} .
	 			OPTIONAL{$this rdfs:label ?opLabel} .
                ?track era:imCode ?value1 .
                ?track era:imCode ?value2 .
                FILTER(?value1 < ?value2) .
   	 	}
		 	""" .

 era-sh:operationalPointShape sh:sparql era-sh:imCodeOPTMinCount.
 era-sh:imCodeOPTMinCount
    a sh:SPARQLConstraint ; 
    era:affectedProperty era:imCode;
    era:affectedClass era:Track;
    era:affectedClass era:OperationalPoint;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Infrastructure manager means any body or undertaking that is responsible in particular for establishing and maintaining railway infrastructure or a part thereof" ;
    era:rinfIndex "1.2.1.0.0.1" ;
    sh:severity sh:Violation ;
     sh:message "Each track in an OP must refer to exactly one infrastructure manager. There is a problem with OP {$this} ({?opLabel}) 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 ?opLabel ?track ?trackLabel ?value
	 		WHERE {
                 $this era:track ?track .
     			OPTIONAL{?track rdfs:label ?trackLabel} .
	 			OPTIONAL{$this rdfs:label ?opLabel} .
                FILTER NOT EXISTS{?track era:imCode ?value} .
   	 		}
	 		""" .



# imCode: #1.2.1.0.0.1
era-sh:operationalpointsShape sh:property era-sh:imCodeOPT .
era-sh:imCodeOPT
	a sh:PropertyShape ;
    era:affectedProperty era:imCode;
    era:affectedClass era:Track;
    era:affectedClass era:OperationalPoint;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Infrastructure manager means any body or undertaking that is responsible in particular for establishing and maintaining railway infrastructure or a part thereof" ;
	era:rinfIndex "1.2.1.0.0.1" ;
	sh:path (era:track era:imCode) ;
	sh:datatype xsd:string ;
	sh:pattern "^[A-Za-z0-9]{4}$" ;
	sh:severity sh:Violation ;
	sh:message "imCode (1.2.1.0.0.1): Each OPTrack MUST be represented with a four-digit code."@en .






@prefix era-sh: <http://data.europa.eu/949/shapes/> .
@prefix ex: <http://example.org/ns#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix era: <http://data.europa.eu/949/> .
@prefix era-sn: <http://data.europa.eu/949/concepts/sol-natures/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix wgs: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix geosparql: <http://www.opengis.net/ont/geosparql#> .

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

#
# operational-points
#
era-sh:operationalpointsShape
	a sh:NodeShape ;
	sh:targetClass era:OperationalPoint.




# opName: # 1.2.0.0.0.1
era-sh:operationalpointsShape sh:property era-sh:opName .
era-sh:opName
	a sh:PropertyShape;
    era:affectedClass era:OperationalPoint;
    era:affectedProperty era:opName ;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Name normally related to the town or village or to traffic control purpose." ;
	era:rinfIndex "1.2.0.0.0.1" ;
	sh:path era:opName ;
	sh:minCount 1 ;
    sh:maxCount 1 ;
	sh:datatype xsd:string ;
	sh:severity sh:Violation ;
	sh:message "opName (1.2.0.0.0.1): There has to be one opName as most, and it must be represented as a String."@en .

# uopid: # 1.2.0.0.0.2 #TODO check pattern of ID for Border points
era-sh:operationalpointsShape sh:property era-sh:uopidP .
era-sh:uopidP
	a sh:PropertyShape;
    era:affectedClass era:OperationalPoint;
    era:affectedProperty era:uopid ;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Code composed of country code and alphanumeric OP code." ;
	era:rinfIndex "1.2.0.0.0.2" ;
	sh:path era:uopid ;
    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 UOPID or to having a value that is not a string."@en .

# uopid: # 1.2.0.0.0.2 
 era-sh:operationalpointsShape sh:sparql era-sh:uopidMin .
 era-sh:uopidMin
 	a sh:SPARQLConstraint;
    era:affectedClass era:OperationalPoint;
    era:affectedProperty era:uopid ;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
 	rdfs:comment "Code composed of country code and alphanumeric OP code." ;
 	era:rinfIndex "1.2.0.0.0.2" ;
 	#sh:targetClass era:OperationalPoint ;
 	sh:severity sh:Violation ;
 	sh:message "uopid (1.2.0.0.0.2):  The OperationalPoint {$this} with label {?opLabel} does not have a value for uopid."@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 ?opLabel ?propertyValue 		
    WHERE {
               OPTIONAL {$this rdfs:label ?opLabel} .
               FILTER NOT EXISTS {$this era:uopid ?propertyValue} .
               FILTER NOT EXISTS {?otherOP era:borderPointOf $this} .
			}
			""" .


# tafTAPCode: # 1.2.0.0.0.3
era-sh:operationalpointsShape sh:property era-sh:tafTAPCode .
era-sh:tafTAPCode
	a sh:PropertyShape;
    era:affectedClass era:OperationalPoint;
    era:affectedProperty era:tafTAPCode ;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Primary code developed for TAF/TAP." ;
	era:rinfIndex "1.2.0.0.0.3" ;
	sh:path era:tafTAPCode ;
	sh:datatype xsd:string ;
	sh:pattern "^[A-Z]{2}\\d{5}$" ;
	sh:severity sh:Violation ;
	sh:message "tafTAPCode (1.2.0.0.0.3): Primary code developed for TAF/TAP. This error is due to having a value that is not a string that follows the pattern [AANNNNN]."@en .


# opType: # 1.2.0.0.0.4
era-sh:operationalpointsShape sh:property era-sh:opTypeP .
era-sh:opTypeP
	a sh:PropertyShape;
    era:affectedClass era:OperationalPoint;
    era:affectedProperty era:opType ;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	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." ;
	era:rinfIndex "1.2.0.0.0.4" ;
	sh:path era:opType; 
    sh:minCount 1 ;
	sh:maxCount 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 more than one type."@en .




# opType: # 1.2.0.0.0.4
era-sh:operationalpointsShape sh:sparql era-sh:opTypeSKOS .
era-sh:opTypeSKOS
	a sh:SPARQLConstraint ;
    era:affectedClass era:OperationalPoint;
    era:affectedProperty era:opType ;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	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." ;
	era:rinfIndex "1.2.0.0.0.4" ;
	sh:severity sh:Violation ;
	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
    WHERE {
         OPTIONAL {$this rdfs:label ?opLabel} .
 		$this era:opType ?concept .
        era:opType era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .




# hasGeometry: # 1.2.0.0.0.5
era-sh:operationalpointsShape sh:property era-sh:hasGeometry .
era-sh:hasGeometry
	a sh:PropertyShape;
    era:affectedClass era:OperationalPoint;
    era:affectedProperty geosparql:hasGeometry ;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Geographical coordinates in decimal degrees normally given for the centre of the OP." ;
	era:rinfIndex "1.2.0.0.0.5" ;
	sh:path geosparql:hasGeometry ;
	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 OP must have exactly one location. This error may be due to having an OP with more than one location or the object of the property is not a geosparql:Geometry."@en .

# hasGeometry: # 1.2.0.0.0.5
 era-sh:operationalpointsShape sh:sparql era-sh:hasGeometryMin .
 era-sh:hasGeometryMin
 	a sh:SPARQLConstraint;
    era:affectedClass era:OperationalPoint;
    era:affectedProperty geosparql:hasGeometry ;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
 	rdfs:comment "Geographical coordinates in decimal degrees normally given for the centre of the OP." ;
 	era:rinfIndex "1.2.0.0.0.5" ;
 	#sh:targetClass era:OperationalPoint ;
 	sh:severity sh:Violation ;
 	sh:message "hasGeometry (1.2.0.0.0.5):  The OperationalPoint {$this} with label {?opLabel} does not have a value for hasGeometry."@en ;
 	sh:prefixes era:;
    sh:select """
    PREFIX era: <http://data.europa.eu/949/>
    PREFIX geosparql: <http://www.opengis.net/ont/geosparql#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT $this ?opLabel ?propertyValue 		
    WHERE {
               OPTIONAL {$this rdfs:label ?opLabel} .
               FILTER NOT EXISTS {$this geosparql:hasGeometry ?propertyValue} .
               FILTER NOT EXISTS {?otherOP era:borderPointOf $this} .
			}
			""" .


# inCountry 
era-sh:operationalpointsShape sh:property era-sh:inCountryOP .
era-sh:inCountryOP
	a sh:PropertyShape;
    era:affectedClass era:OperationalPoint;
    era:affectedProperty era:inCountry ;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indicates the country in which the OP resides" ; 
	sh:path era:inCountry ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
	sh:nodeKind sh:IRI;
	sh:severity sh:Violation ;
	sh:message "inCountry:  Each OperationalPoint must have exactly one country. This error may be due to having an OP without or with more than one country or it value is not a Concept."@en .


# inCountry
era-sh:operationalpointsShape sh:sparql era-sh:inCountrySKOSOP .
era-sh:inCountrySKOSOP
	a sh:SPARQLConstraint ;
    era:affectedClass era:OperationalPoint;
    era:affectedProperty era:inCountry ;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indicates the country in which the OP resides." ;
	sh:severity sh:Violation ;
	sh:message "Country in which the OP resides: The OP {$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#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT $this ?concept
    WHERE {
 		$this era:inCountry ?concept .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme <http://publications.europa.eu/resource/authority/country> .
		}
	}
""" .

# lineReference - kilometer: 
era-sh:operationalpointsShape sh:property era-sh:kilometerP .
era-sh:kilometerP
	a sh:PropertyShape;
    era:affectedClass era:OperationalPoint;
    era:affectedClass era:LineReference;
    era:affectedProperty era:kilometer ;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "A reference to the distance measured in kilometers from the origin of a national railway line." ;
	sh:path (era:lineReference era:kilometer) ;
	sh:minCount 1 ;
    sh:datatype xsd:double;
	sh:severity sh:Violation ;
	sh:message "lineReference (1.2.0.0.0.6):  The OperationalPoint either does not have a value for kilometer that defines its location in the line, or the value of the kilometer is not a double (real) number."@en .

# lineReference - lineNationalId: 
era-sh:operationalpointsShape sh:property era-sh:lineNationalIdP .
era-sh:lineNationalIdP
	a sh:PropertyShape;
    era:affectedClass era:OperationalPoint;
    era:affectedClass era:LineReference;
    era:affectedClass era:NationalRailwayLine;
    era:affectedProperty era:lineNationalId ;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "A reference to a specific national railway line." ;
	sh:path (era:lineReference era:lineNationalId) ;
	sh:minCount 1 ;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "lineReference (1.2.0.0.0.6):  The OperationalPoint must have at least one reference to a specific national railway line."@en .




# opTypeGaugeChangeover: # 1.2.0.0.0.4.1 
era-sh:operationalpointsShape sh:property era-sh:opTypeGaugeChangeover .
era-sh:opTypeGaugeChangeover
	a sh:PropertyShape;
    era:affectedClass era:OperationalPoint;
    era:affectedProperty era:opTypeGaugeChangeover ;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Type of track gauge changeover facility." ;
	era:rinfIndex "1.2.0.0.0.4.1" ;
	sh:targetClass era:OperationalPoint ;
	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 one opTypeGaugeChangeover at most and the type must be a string."@en .

# localRulesOrRestrictions: # 1.2.3.1 
era-sh:operationalpointsShape sh:property era-sh:localRulesOrRestrictions .
era-sh:localRulesOrRestrictions
	a sh:PropertyShape;
    era:affectedClass era:OperationalPoint;
    era:affectedProperty era:localRulesOrRestrictions ;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Existence of rules and restrictions of a strictly local nature." ;
	era:rinfIndex "1.2.3.1" ;
	sh:targetClass era:OperationalPoint ;
	sh:path era:localRulesOrRestrictions ;
	sh:maxCount 1 ;
	sh:datatype xsd:boolean;
	sh:severity sh:Violation ;
	sh:message "localRulesOrRestrictions (1.2.3.1): The Operational Point must have one localRulesOrRestrictions at most and the type must be Y/N (boolean)."@en .

# localRulesOrRestrictionsDoc: # 1.2.3.2 todo revisar Y/N/NYA
era-sh:operationalpointsShape sh:property era-sh:localRulesOrRestrictionsDoc .
era-sh:localRulesOrRestrictionsDoc
	a sh:PropertyShape;
    era:affectedClass era:OperationalPoint;
    era:affectedProperty era:localRulesOrRestrictionsDoc ;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Reference of the documents regarding the rules or restrictions of a strictly local nature available by the IM." ;
	era:rinfIndex "1.2.3.2" ;
	sh:targetClass era:OperationalPoint ;
	sh:path era:localRulesOrRestrictionsDoc ;
	# # sh:minCount 0 ;
	sh:class era:Document;
	sh:severity sh:Violation ;
	sh:message "localRulesOrRestrictionsDoc (1.2.3.2): The Operational Point has a localRulesOrRestrictionsDoc reference that must be a Document."@en .



#
# location #todo es posible comprobar la precisión de decimales?
#
era-sh:locationShape
	a sh:NodeShape ;
	sh:targetClass geosparql:Geometry .

# wgs:lat
era-sh:locationShape sh:property era-sh:lat .
era-sh:lat
	a sh:PropertyShape;
    era:affectedClass geosparql:Geometry;
    era:affectedProperty wgs:lat ;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Latitude following the spatial reference system WGS84." ;
	sh:targetClass geosparql:Geometry ;
	sh:path wgs:lat ;
	sh:minCount 1 ;
	sh:maxCount 1 ;
	sh:minInclusive 34;
	sh:maxExclusive 73;
	sh:datatype xsd:double ;
	sh:severity sh:Violation ;
	sh:message "wgs:lat property. This error may be due to having a Geometry without or with more than one lat property or it value is out of the latitude range of Europe." .

# wgs:long
era-sh:locationShape sh:property era-sh:long .
era-sh:long
	a sh:PropertyShape;
    era:affectedClass geosparql:Geometry;
    era:affectedProperty wgs:long ;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Longitude following the spatial reference system WGS84." ;
	sh:targetClass geosparql:Geometry ;
	sh:path wgs:long ;
	sh:minCount 1 ;
	sh:maxCount 1 ;
	sh:minInclusive -25;
	sh:maxExclusive 46;
	sh:datatype xsd:double ;
	sh:severity sh:Violation ;
	sh:message "wgs:long property. This error may be due to having a Geometry without or with more than one long property or it value is out of the longitude range of Europe." .

# geosparql:asWKT
era-sh:locationShape sh:property era-sh:wkt .
era-sh:wkt
	a sh:PropertyShape;
    era:affectedClass geosparql:Geometry;
    era:affectedProperty geosparql:asWKT ;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Geometry coordinates in WKT serialization format." ;
	sh:targetClass geosparql:Geometry ;
	sh:path geosparql:asWKT ;
	sh:minCount 1 ;
	sh:maxCount 1 ;
	sh:datatype geosparql:wktLiteral ;
	sh:severity sh:Violation ;
	sh:message "geosparql:Geometry. This error may be due to having a Geometry without or with more than one asWKT property or it value is not from the wktLiteral type." .

@prefix era-sh: <http://data.europa.eu/949/shapes/> .
@prefix ex: <http://example.org/ns#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix era: <http://data.europa.eu/949/> .
@prefix era-sn: <http://data.europa.eu/949/concepts/sol-natures/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix wgs: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix geosparql: <http://www.opengis.net/ont/geosparql#> .
@prefix era-ph: <http://data.europa.eu/949/concepts/platform-heights/> .
#############################
# Rules for platform
#############################

#
# platform
#
era-sh:platformsShape
	a sh:NodeShape ;
	sh:targetClass era:Platform .

# platformId: # 1.2.1.0.6.2
era-sh:platformsShape sh:property era-sh:platformId .
era-sh:platformId
	a sh:PropertyShape;
    era:affectedProperty era:platformId;
    era:affectedClass era:Platform;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Unique platform identification or unique platform number within OP." ;
	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 .







# imCode: # 1.2.1.0.6.1
era-sh:platformsShape sh:property era-sh:imCodeP .
era-sh:imCodeP
	a sh:PropertyShape;
    era:affectedProperty era:imCode;
    era:affectedClass era:Platform;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Each Platform can only be submitted by one infrastructure manager, represented by a four-digit code." ;
	era:rinfIndex "1.2.1.0.6.1" ;
	sh:path era:imCode ;
	sh:minCount 1 ;
    sh:maxCount 1 ;
	sh:datatype xsd:string ;
	sh:minLength 4 ;
    sh:maxLength 4 ;
	sh:severity sh:Violation ;
	sh:message "imCode (1.2.1.0.6.1): Each Platform must refer to only one infrastructure manager, which MUST be represented with a four-digit code. This error may be due to having a Platform with no infrastructure manager associated, with more than one infrastructure managers, or with a code that has a different length."@en .

# tenClassification: # 1.2.1.0.6.3
era-sh:platformsShape sh:property era-sh:tenClassificationP .
era-sh:tenClassificationP
	a sh:PropertyShape;
    era:affectedProperty era:tenClassification;
    era:affectedClass era:Platform;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Indicates the part of the trans-European network the platform belongs to." ;
	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:platformsShape sh:sparql era-sh:TenClassificationSKOSP .
era-sh:TenClassificationSKOSP
	a sh:SPARQLConstraint ;
    era:affectedProperty era:tenClassification;
    era:affectedClass era:Platform;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indicates the part of the trans-European network the platform belongs to." ;
	era:rinfIndex "1.2.1.0.6.3" ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	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
    WHERE {
        OPTIONAL {$this rdfs:label ?label} .
        $this era:tenClassification ?concept .
        era:tenClassification era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .


# length: # 1.2.1.0.6.4
era-sh:platformsShape sh:property era-sh:lengthP .
era-sh:lengthP
	a sh:PropertyShape;
    era:affectedProperty era:length;
    era:affectedClass era:Platform;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    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." ;
	era:rinfIndex "1.2.1.0.6.4" ;
	sh:path era:length ;
	sh:maxCount 1 ;
	sh:datatype xsd:double ;
	sh:minInclusive 0 ;
	sh:maxExclusive 10000 ;
	sh:severity sh:Violation ;
	sh:message "length (1.2.1.0.6.4): Each Platform must have exactly one length. This error may be caused due to having a platform with no length, having a platform with more than one length, or its value is not correct( not being double or not in range [0,10000))."@en .
	


# platformHeight: # 1.2.1.0.6.5
era-sh:platformsShape sh:property era-sh:platformHeightP .
era-sh:platformHeightP
	a sh:PropertyShape;
    era:affectedProperty era:platformHeight;
    era:affectedClass era:Platform;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Distance between the upper surface of platform and running surface of the neighbouring track. It is the nominal value expressed in millimetres." ;
	era:rinfIndex "1.2.1.0.6.5" ;
	sh:path era:platformHeight ;
	sh:maxCount 1 ;
	sh:nodeKind sh:IRI;
	sh:severity sh:Violation ;
	sh:message "platformHeight (1.2.1.0.6.5): Each Platform must have exactly one height. This error may be due to having a platform with no height, having a platform with more than one height, or having an illegal height value."@en .

# platformHeight: # 1.2.1.0.6.5
era-sh:platformsShape sh:sparql era-sh:PlatformHeightSKOS .
era-sh:PlatformHeightSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:platformHeight;
    era:affectedClass era:Platform;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Distance between the upper surface of platform and running surface of the neighbouring track. It is the nominal value expressed in millimetres." ;
	era:rinfIndex "1.2.1.0.6.5" ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	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
    WHERE {
        OPTIONAL {$this rdfs:label ?label} .
        $this era:platformHeight ?concept .
        era:platformHeight era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .


# assistanceStartingTrain: # 1.2.1.0.6.6
era-sh:platformsShape sh:property era-sh:assistanceStartingTrain .
era-sh:assistanceStartingTrain
	a sh:PropertyShape;
    era:affectedProperty era:assistanceStartingTrain;
    era:affectedClass era:Platform;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    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." ;
	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 exactly one assistanceStartingTrain declaration. This error may be caused due to having a platform with no assistanceStartingTrain, having more than one assistanceStartingTrain,   or its value is not Y/N (boolean)."@en .
	
# areaBoardingAid: # 1.2.1.0.6.7
era-sh:platformsShape sh:property era-sh:areaBoardingAid .
era-sh:areaBoardingAid
	a sh:PropertyShape;
    era:affectedProperty era:areaBoardingAid;
    era:affectedClass era:Platform;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Information of the train access level for which the boarding aid can be used." ;
	era:rinfIndex "1.2.1.0.6.7" ;
	sh:path era:areaBoardingAid ;
	sh:maxCount 1 ;
	sh:datatype xsd:integer ;#todo no hay datos, es posible que deba ser double
	sh:minInclusive 0 ;
	sh:maxExclusive 10000 ;
	sh:severity sh:Violation ;
	sh:message "areaBoardingAid (1.2.1.0.6.7): Each Platform may have one areaBoardingAid value. This error may be caused due to having a platform with multiple areaBoardingAid or its value is not correct( not being integer or not in range [0,10000)."@en .
	
@prefix era-sh: <http://data.europa.eu/949/shapes/> .
@prefix ex: <http://example.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix era: <http://data.europa.eu/949/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix wgs: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix geosparql: <http://www.opengis.net/ont/geosparql#> .
@prefix era-sn: <http://data.europa.eu/949/concepts/sol-natures/> .
@prefix era-ph: <http://data.europa.eu/949/concepts/platform-heights/> .
@prefix era-tenclass: <http://data.europa.eu/949/concepts/ten-classifications/> .
@prefix era-gaugings: <http://data.europa.eu/949/concepts/gaugings/> .
@prefix era-ntg: <http://data.europa.eu/949/concepts/nominal-track-gauges/> .
@prefix era-tds: <http://data.europa.eu/949/concepts/train-detection/> .
@prefix era-tdssc: <http://data.europa.eu/949/concepts/train-detection-specific-checks/> .
@prefix era-tsi: <http://data.europa.eu/949/concepts/tsi-compliances/> .
@prefix era-malvc: <http://data.europa.eu/949/concepts/min-axle-loads-per-vehicle-category/> .
@prefix era-mas: <http://data.europa.eu/949/concepts/max-amount-sandings/> .
@prefix era-lc: <http://data.europa.eu/949/concepts/load-capabilities/> .
@prefix era-pnsb: <http://data.europa.eu/949/concepts/profile-num-swap-bodies/> .
@prefix era-pnst: <http://data.europa.eu/949/concepts/profile-num-semi-trailers/> .
@prefix era-ri: <http://data.europa.eu/949/concepts/rail-inclinations/> .
@prefix era-mb: <http://data.europa.eu/949/concepts/magnetic-braking/> .
@prefix era-pth: <http://data.europa.eu/949/concepts/pantograph-heads/> .
@prefix era-csm: <http://data.europa.eu/949/concepts/contact-strip-materials/> .
@prefix era-etcsinfill: <http://data.europa.eu/949/concepts/etcs-infills/> .
@prefix era-esc: <http://data.europa.eu/949/concepts/etcs-system-compatibilities/> .
@prefix era-etcsmvers: <http://data.europa.eu/949/concepts/etcs-m-versions/> .
@prefix era-gsmrv: <http://data.europa.eu/949/concepts/gsmr-versions/> .
@prefix era-gsmrnumactivemob: <http://data.europa.eu/949/concepts/gsmr-number-active-mobiles/> .
@prefix era-gsmroptfunc: <http://data.europa.eu/949/concepts/gsmr-optional-functions/> .
@prefix era-gsmr: <http://data.europa.eu/949/concepts/gsmr-networks/> .
@prefix era-rsc: <http://data.europa.eu/949/concepts/radio-system-compatibilities/> .
@prefix era-tpls: <http://data.europa.eu/949/concepts/train-protection-legacy-systems/> .
@prefix era-lrs: <http://data.europa.eu/949/concepts/legacy-radio-systems/> .
@prefix era-etcssituation: <http://data.europa.eu/949/concepts/etcs-situation/> .
@prefix era-opcw: <http://data.europa.eu/949/concepts/other-protection-control-warning/> .
@prefix era-trd: <http://data.europa.eu/949/concepts/track-running-directions/> .


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

# Missing constaint checks:

# 1.1	SECTION OF LINE.
## If ValidityDateStart is greater than the date of the validation, the Section of Line will be considered a FUTURE planning; otherwise, it is considered a CURRENT item.  

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

#imCode: # 1.1.0.0.0.1
era-sh:SectionOfLineShape sh:property era-sh:infrastructureManager-imCode .
era-sh:infrastructureManager-imCode
    a sh:PropertyShape ;
    era:affectedProperty era:imCode;
    era:affectedClass era:SectionOfLine;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Each SoL can only be submitted by one infrastructure manager, represented by a four-digit code" ;
    era:rinfIndex "1.1.0.0.0.1" ;          
    sh:path era:imCode ;           
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:minLength 4 ;
    sh:maxLength 4 ;
    sh:severity sh:Violation ;
    sh:message "imCode (1.1.0.0.0.1): Each SoL must refer to only one infrastructure manager, which MUST be represented with a four-digit code. This error may be due to having a SoL with no infrastructure manager associated, with more than one infrastructure managers, or with a code that has a different length"@en .

#lineNationalId: # 1.1.0.0.0.2
era-sh:SectionOfLineShape sh:property era-sh:lineNationalId .
era-sh:lineNationalId
    a sh:PropertyShape ;
    era:affectedProperty era:lineNationalId;
    era:affectedClass era:SectionOfLine;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Each SoL can belong to only one national line. In case the SoL is the track connecting OPs within a big node (resulting from the division of a big station into several smaller ones) the line can be identified using the name of this track." ;
    era:rinfIndex "1.1.0.0.0.2" ;
    sh:path era:lineNationalId ;           
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:nodeKind sh:IRI ;
    sh:severity sh:Violation ;
    sh:message "lineNationalId (1.1.0.0.0.2): Each SoL can belong to only one national line."@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";
    era:validationAfterXML "false"^^xsd:boolean;
    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. \n 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." ;
    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 ; checked in ea-sh:opStartExists
    sh:maxCount 1 ;
    sh:nodeKind sh:IRI ;
    sh:severity sh:Violation ;
    sh:message "opStart (1.1.0.0.0.3): There must be at most one OP start for this section of line and it must be different from the OP end."@en .

#opStart: # 1.1.0.0.0.3
era-sh:SectionOfLineShape sh:sparql era-sh:opStartExists .
era-sh:opStartExists
    a sh:SPARQLConstraint ;   
    era:affectedProperty era:opStart;
    era:affectedClass era:SectionOfLine;
    era:scope "global";
    era:validationAfterXML "false"^^xsd:boolean;
    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.\n 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." ;
    era:rinfIndex "1.1.0.0.0.3" ;
    sh:severity sh:Violation ;
    sh:message "opStart (1.1.0.0.0.3): There is an error with the SoL {$this} ({?solLabel}) and its OP start which does not exist."@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 ?opStart
			WHERE {
				OPTIONAL{$this rdfs:label ?solLabel} .
                FILTER NOT EXISTS {$this era:opStart ?opStart} .
   			}
			""" .

#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";
    era:validationAfterXML "false"^^xsd:boolean;
    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. \n 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." ;
    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 ; #checked in era-sh:opEndExists
    sh:maxCount 1 ;
    sh:nodeKind sh:IRI ;
    sh:severity sh:Violation ;
    sh:message "opEnd (1.1.0.0.0.4): There must be at most one OP end for this section of line and it must be different from the OP start."@en .

#opEnd: # 1.1.0.0.0.4
era-sh:SectionOfLineShape sh:sparql era-sh:opEndExists .
era-sh:opEndExists
    a sh:SPARQLConstraint ;  
    era:affectedProperty era:opEnd;
    era:affectedClass era:SectionOfLine;
    era:scope "global";
    era:validationAfterXML "false"^^xsd:boolean;
    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.\n 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." ;
    era:rinfIndex "1.1.0.0.0.4" ;
    sh:severity sh:Violation ;
    sh:message "opEnd (1.1.0.0.0.4): The OP must exist. here is an error with the SoL {$this} ({?solLabel}) and its OP end which does not exist."@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 ?opEnd
			WHERE {
				OPTIONAL{$this rdfs:label ?solLabel} .
                FILTER NOT EXISTS { $this era:opEnd ?opEnd} .
   			}
			""" .



#length: # 1.1.0.0.0.5
era-sh:SectionOfLineShape sh:property era-sh:solLength .
era-sh:solLength
    a sh:PropertyShape ;
    era:affectedProperty era:length;
    era:affectedClass era:SectionOfLine;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    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. \n Validation: No validation will be performed by RINF application regarding the length of SoL. This requires national verification." ;
    era:rinfIndex "1.1.0.0.0.5" ;
    sh:path era:length ; 
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:double ;
    sh:severity sh:Violation ;
    sh:message "SOL length (1.1.0.0.0.5): Although no validation is done by the RINF application, either there is no length for the specified SoL, or 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";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "General description: -- \n 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:\n 1.1.1.1 Infrastructure subsystem \n 1.1.1.2 Energy subsystem \n 1.1.1.3 Control-command and signalling subsystem" ;
    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";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the SOL nature." ;
	era:rinfIndex "1.1.0.0.0.6" ;
	# sh:path era:solNature ;
	# sh:nodeKind sh:IRI ; # Already checked in era-sh:solNature
	sh:severity sh:Violation ;
	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
    WHERE {
 		OPTIONAL {$this rdfs:label ?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";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "No general description provided \n 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:\n 1.1.1.1 Infrastructure subsystem \n 1.1.1.2 Energy subsystem \n 1.1.1.3 Control-command and signalling subsystem" ;
    era:rinfIndex "1.1.0.0.0.6" ;
    sh:severity sh:Violation ;
    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
			WHERE {
                 $this era:solNature <http://data.europa.eu/949/concepts/sol-natures/rinf/20> .
				OPTIONAL{$this rdfs:label ?solLabel} .
                $this era:track ?track .
                $this era:opStart ?opStart . ?opStart era:uopid ?opStartID .
                $this era:opEnd ?opEnd . ?opEnd era:uopid ?opEndID .
				OPTIONAL{?track rdfs:label ?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'))
            }
			""" .

@prefix era-sh: <http://data.europa.eu/949/shapes/> .
@prefix ex: <http://example.org/ns#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix era: <http://data.europa.eu/949/> .
@prefix era-sn: <http://data.europa.eu/949/concepts/sol-natures/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix wgs: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix geosparql: <http://www.opengis.net/ont/geosparql#> .
@prefix era-ph: <http://data.europa.eu/949/concepts/platform-heights/> .
@prefix era-tenclass: <http://data.europa.eu/949/concepts/ten-classifications/> .
@prefix era-gaugings: <http://data.europa.eu/949/concepts/gaugings/> .
@prefix era-ntg: <http://data.europa.eu/949/concepts/nominal-track-gauges/> .


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

#
# sidings
#
era-sh:sidingsShape
	a sh:NodeShape ;
	sh:targetClass era:Siding .   # Applies to all Siding

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

# imCode: #1.2.2.0.0.1
era-sh:sidingsShape sh:property era-sh:imCodeS .
era-sh:imCodeS
	a sh:PropertyShape ;
    era:affectedProperty era:imCode ;
    era:affectedClass era:Siding;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Infrastructure manager means any body or undertaking that is responsible in particular for establishing and maintaining railway infrastructure or a part thereof" ;
	era:rinfIndex "1.2.2.0.0.1" ;
	sh:path era:imCode ;
	sh:minCount 1 ;
	sh:maxCount 1 ;
	sh:datatype xsd:string ;
	sh:pattern "^[0-9]{4}$" ;
	sh:severity sh:Violation ;
	sh:message "imCode (1.2.2.0.0.1): Each Siding must refer to exactly one infrastructure manager, which MUST be represented with a four-digit code."@en .

# sidingId: #1.2.2.0.0.2
era-sh:sidingsShape sh:property era-sh:sidingId .
era-sh:sidingId
	a sh:PropertyShape ;
    era:affectedProperty era:sidingId ;
    era:affectedClass era:Siding;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Unique siding identification or unique siding number within OP" ;
	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:OPShape 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";
    era:validationAfterXML "false"^^xsd:boolean;
    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." ;
    era:rinfIndex "1.2.2.0.0.2" ;
    sh:severity sh:Violation ;
    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
			WHERE {
                $this era:siding ?siding1 .
                $this era:siding ?siding2 .
                ?siding1 era:sidingId ?value .
                ?siding2 era:sidingId ?value .
                FILTER(?siding1 != ?siding2) . 
				OPTIONAL{$this rdfs:label ?opLabel} .
				OPTIONAL{?siding1 rdfs:label ?siding1Label} .
				OPTIONAL{?siding2 rdfs:label ?siding2Label} .
			}
			""" .



# tenClassification: # 1.2.2.0.0.3
era-sh:sidingsShape sh:property era-sh:TenClassificationS.
era-sh:TenClassificationS
	a sh:PropertyShape ;
    era:affectedProperty era:tenClassification ;
    era:affectedClass era:Siding;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the part of the trans-European network the line belongs to." ;	era:rinfIndex "1.2.2.0.0.3" ;	
    sh:path era:tenClassification ;
	sh:nodeKind sh:IRI ; 	
	sh:severity sh:Violation ;	sh:message "tenClassification (1.1.1.1.2.1): The siding must have at least one TEN classificaion value (Indication of the part of the trans-European network the line belongs to) that must be an IRI."@en .

#tenClassification: # 1.2.2.0.0.3
era-sh:sidingsShape sh:sparql era-sh:TenClassificationSKOSS .
era-sh:TenClassificationSKOSS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:tenClassification ;
    era:affectedClass era:Siding;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the part of the trans-European network the line belongs to." ;	era:rinfIndex "1.2.2.0.0.3" ;
	era:rinfIndex "1.2.2.0.0.3" ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "TEN classification (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
    WHERE {
        OPTIONAL{$this rdfs:label ?sidingLabel}
        $this era:tenClassification ?concept .
        era:tenClassification era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .


# verificationINF: # 1.2.2.0.1.1
era-sh:sidingsShape sh:property era-sh:verificationINF .
era-sh:verificationINF
	a sh:PropertyShape;
    era:affectedProperty era:verificationINF ;
    era:affectedClass era:Siding;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the verification of the infrastructure manager" ;
	era:rinfIndex "1.2.2.0.1.1" ;
	sh:path era:verificationINF ;
    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.2.2.0.1.1): Each Siding may have one or more verificationINF. This error is due to the value not being a string or the value not following this pattern: country code/national registration number/year between 1900 and 2100/progressive counter."@en .

# demonstrationINF: # # 1.2.2.0.1.2
era-sh:sidingsShape sh:property era-sh:demonstrationINF .
era-sh:demonstrationINF
	a sh:PropertyShape;
    era:affectedProperty era:demonstrationINF ;
    era:affectedClass era:Siding;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Unique number for EI declarations following the same format requirements as specified in the 'Documents about practical arrangements for transmitting interoperability documents'" ;
	era:rinfIndex "1.2.2.0.1.2" ;
	sh:path era:demonstrationINF ;
	# 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 "demonstrationINF (1.2.2.0.1.2): Each Siding may have one or more demonstrationINF.  This error is due to the value not being a string or the value not following this pattern: country code/national registration number/year between 1900 and 2100/progressive counter."@en .

# length: # 1.2.2.0.2.1
era-sh:sidingsShape sh:property era-sh:lengthS .
era-sh:lengthS
	a sh:PropertyShape;
    era:affectedProperty era:length ;
    era:affectedClass era:Siding;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Total length of the siding/stabling track expressed in meters where trains can be parked safely" ;
	era:rinfIndex "1.2.2.0.2.1" ;
	sh:path era:length ;
	sh:maxCount 1 ;
	sh:datatype xsd:double ;
	sh:pattern "([1-9]\\d{3}|[1-9]\\d{2}|[1-9]\\d{1}|[0-9])" ;
	sh:severity sh:Violation ;
	sh:message "length (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."@en .

# gradient: # 1.2.2.0.3.1
era-sh:sidingsShape sh:property era-sh:gradient .
era-sh:gradient
	a sh:PropertyShape;
    era:affectedProperty era:gradient ;
    era:affectedClass era:Siding;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Maximum value of the gradient expressed in millimeters per meter" ;
	era:rinfIndex "1.2.2.0.3.1" ;
	sh:path era:gradient ;
	# sh:minCount 0 ; #TODO: Not yet applicable
	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 .

# minimumHorizontalRadius: # 1.2.2.0.3.2
era-sh:sidingsShape sh:property era-sh:minimumHorizontalRadius .
era-sh:minimumHorizontalRadius
	a sh:PropertyShape;
    era:affectedProperty era:minimumHorizontalRadius ;
    era:affectedClass era:Siding;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Radius of the smallest horizontal curve expressed in meters" ;
	era:rinfIndex "1.2.2.0.3.2" ;
	sh:path era:minimumHorizontalRadius ;
	sh:maxCount 1 ;
	sh:datatype xsd:integer ;
	#sh:pattern "([1-9]\\d{2}|[1-9]\\d{1}|[0-9])" ;
	sh:severity sh:Violation ;
	sh:message "minimumHorizontalRadius (1.2.2.0.3.2): Each Siding may have a minimumHorizontalRadius in meters. This error is due to having more than one minimum horizontal radius value or having a minimum horizontal radius that is not an integer number."@en .


# minimumVerticalRadiusCrest: # 1.2.2.0.3.3
era-sh:sidingsShape sh:property era-sh:minimumVerticalRadiusCrest .
era-sh:minimumVerticalRadiusCrest
	a sh:PropertyShape;
    era:affectedProperty era:minimumVerticalRadiusCrest ;
    era:affectedClass era:Siding;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Radius of the smallest vertical curve expressed in meters, part that indicates the crest" ;
	era:rinfIndex "1.2.2.0.3.3" ;
	sh:path era:minimumVerticalRadiusCrest ;
	sh:maxCount 1 ;
	sh:datatype xsd:integer ;
	sh:severity sh:Violation ;
	sh:message "minimumVerticalRadiusCrest (1.2.2.0.3.3): Each Siding may have a minimumVerticalRadiusCrest in meters. This error is due to having more than one minimum vertical radius crest value or having a minimum vertical radius crest that is not an integer number."@en .

# minimumVerticalRadiusHollow: # 1.2.2.0.3.3
era-sh:sidingsShape sh:property era-sh:minimumVerticalRadiusHollow .
era-sh:minimumVerticalRadiusHollow
	a sh:PropertyShape;
    era:affectedProperty era:minimumVerticalRadiusHollow ;
    era:affectedClass era:Siding;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Radius of the smallest vertical curve expressed in meters, part that indicates the hollow" ;
	era:rinfIndex "1.2.2.0.3.3" ;
	sh:path era:minimumVerticalRadiusHollow ;
	sh:maxCount 1 ;
	sh:datatype xsd:integer ;
	sh:severity sh:Violation ;
	sh:message "minimumVerticalRadiusHollowt (1.2.2.0.3.3): Each Siding may have a minimumVerticalRadiusHollow in meters. This error is due to having more than one minimum vertical radius hollow value or having a minimum vertical radius hollow that is not an integer number."@en .


# hasToiletDischarge: # 1.2.2.0.4.1
era-sh:sidingsShape sh:property era-sh:hasToiletDischarge .
era-sh:hasToiletDischarge
	a sh:PropertyShape;
    era:affectedProperty era:hasToiletDischarge ;
    era:affectedClass era:Siding;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication whether exists and installation for toilet discharge (fixed installation for servicing trains) as defined in INF TSIs" ; 
	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:sidingsShape sh:property era-sh:hasExternalCleaning .
era-sh:hasExternalCleaning
	a sh:PropertyShape;
    era:affectedProperty era:hasExternalCleaning ;
    era:affectedClass era:Siding;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication whether exists and installation for external cleaning facility (fixed installation for servicing trains) as defined in INF TSIs" ; 
	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 must 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:sidingsShape sh:property era-sh:hasWaterRestocking .
era-sh:hasWaterRestocking
	a sh:PropertyShape;
    era:affectedProperty era:hasWaterRestocking ;
    era:affectedClass era:Siding;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication whether exists and installation for water restocking (fixed installation for servicing trains) as defined in INF TSIs" ; 
	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:sidingsShape sh:property era-sh:hasRefuelling .
era-sh:hasRefuelling
	a sh:PropertyShape;
    era:affectedProperty era:hasRefuelling ;
    era:affectedClass era:Siding;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication whether exists and installation for refuelling (fixed installation for servicing trains) as defined in INF TSIs" ; 
	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 must 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:sidingsShape sh:property era-sh:hasSandRestocking .
era-sh:hasSandRestocking
	a sh:PropertyShape;
     era:affectedProperty era:hasSandRestocking ;
    era:affectedClass era:Siding;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication whether an installation for sand restocking exists(fixed installation for servicing trains)" ; 
	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 must 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:sidingsShape sh:property era-sh:hasElectricShoreSupply .
era-sh:hasElectricShoreSupply
	a sh:PropertyShape;
    era:affectedProperty era:hasElectricShoreSupply ;
    era:affectedClass era:Siding;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication whether an installation for electric shore supply exists (fixed installation for servicing trains)" ; 
	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 must 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.2.2.0.6.1
era-sh:sidingsShape sh:property era-sh:maxCurrentStandstillPantographS .
era-sh:maxCurrentStandstillPantographS
	a sh:PropertyShape;
    era:affectedProperty era:maxCurrentStandstillPantograph ;
    era:affectedClass era:Siding;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the maximum allowable train current at standstill for DC systems expressed in amperes" ;
	era:rinfIndex "1.2.2.0.6.1" ;
	sh:path era:maxCurrentStandstillPantograph ;
	sh:datatype xsd:double ;
	sh:pattern "([1-9]\\d{2}|[1-9]\\d{1}|[0-9])" ;
	sh:severity sh:Violation ;
	sh:message "maxCurrentStandstillPantograph (1.2.2.0.6.1): Each Siding must define the maximum allowable train current at standstill for DC systems expressed in amperes. This error is due to having max current standstill pantograph value that is not a double (real) number."@en .
@prefix era-sh: <http://data.europa.eu/949/shapes/> .
@prefix ex: <http://example.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix era: <http://data.europa.eu/949/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix wgs: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix geosparql: <http://www.opengis.net/ont/geosparql#> .
@prefix era-sn: <http://data.europa.eu/949/concepts/sol-natures/> .
@prefix era-ph: <http://data.europa.eu/949/concepts/platform-heights/> .
@prefix era-tenclass: <http://data.europa.eu/949/concepts/ten-classifications/> .
@prefix era-gaugings: <http://data.europa.eu/949/concepts/gaugings/> .
@prefix era-ntg: <http://data.europa.eu/949/concepts/nominal-track-gauges/> .
@prefix era-tds: <http://data.europa.eu/949/concepts/train-detection/> .
@prefix era-tdssc: <http://data.europa.eu/949/concepts/train-detection-specific-checks/> .
@prefix era-tsi: <http://data.europa.eu/949/concepts/tsi-compliances/> .
@prefix era-malvc: <http://data.europa.eu/949/concepts/min-axle-loads-per-vehicle-category/> .
@prefix era-mas: <http://data.europa.eu/949/concepts/max-amount-sandings/> .
@prefix era-lc: <http://data.europa.eu/949/concepts/load-capabilities/> .
@prefix era-pnsb: <http://data.europa.eu/949/concepts/profile-num-swap-bodies/> .
@prefix era-pnst: <http://data.europa.eu/949/concepts/profile-num-semi-trailers/> .
@prefix era-ri: <http://data.europa.eu/949/concepts/rail-inclinations/> .
@prefix era-mb: <http://data.europa.eu/949/concepts/magnetic-braking/> .
@prefix era-pth: <http://data.europa.eu/949/concepts/pantograph-heads/> .
@prefix era-csm: <http://data.europa.eu/949/concepts/contact-strip-materials/> .
@prefix era-etcsinfill: <http://data.europa.eu/949/concepts/etcs-infills/> .
@prefix era-esc: <http://data.europa.eu/949/concepts/etcs-system-compatibilities/> .
@prefix era-etcsmvers: <http://data.europa.eu/949/concepts/etcs-m-versions/> .
@prefix era-gsmrv: <http://data.europa.eu/949/concepts/gsmr-versions/> .
@prefix era-gsmrnumactivemob: <http://data.europa.eu/949/concepts/gsmr-number-active-mobiles/> .
@prefix era-gsmroptfunc: <http://data.europa.eu/949/concepts/gsmr-optional-functions/> .
@prefix era-gsmr: <http://data.europa.eu/949/concepts/gsmr-networks/> .
@prefix era-rsc: <http://data.europa.eu/949/concepts/radio-system-compatibilities/> .
@prefix era-vrsc: <http://data.europa.eu/949/concepts/voice-radio-system-compatibilities/> .
@prefix era-rscd: <http://data.europa.eu/949/concepts/radio-system-compatibilities-data/> .
@prefix era-tpls: <http://data.europa.eu/949/concepts/train-protection-legacy-systems/> .
@prefix era-lrs: <http://data.europa.eu/949/concepts/legacy-radio-systems/> .
@prefix era-etcssituation: <http://data.europa.eu/949/concepts/etcs-situation/> .
@prefix era-opcw: <http://data.europa.eu/949/concepts/other-protection-control-warning/> .
@prefix era-trd: <http://data.europa.eu/949/concepts/track-running-directions/> .
@prefix era-ec: <http://data.europa.eu/949/concepts/eddy-current-braking/> .
@prefix era-ha: <http://data.europa.eu/949/concepts/hot-axle/> .
@prefix era-cls: <http://data.europa.eu/949/concepts/contact-line-systems/> .
@prefix era-cph: <http://data.europa.eu/949/concepts/compliant-pantograph-heads/> .
@prefix era-oph: <http://data.europa.eu/949/concepts/other-pantograph-heads/> .








era-sh:trackShape  
    a sh:NodeShape ;
    sh:targetClass era:Track .




# verificationINF: # 1.1.1.1.1.1, 1.2.1.0.1.1
era-sh:trackShape sh:property era-sh:VerificationINF.
era-sh:VerificationINF
	a sh:PropertyShape ;
    era:affectedProperty era:verificationINF;
    era:affectedClass era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Unique number for EC declarations following format requirements specified in the 'Document about practical arrangements for transmitting interoperability documents'." ;
	era:rinfIndex "1.1.1.1.1.1" ;
    era:rinfIndex "1.2.1.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): 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
era-sh:trackShape sh:property era-sh:DemonstrationINF.
era-sh:DemonstrationINF
	a sh:PropertyShape ;
    era:affectedProperty era:demonstrationINF;
    era:affectedClass era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Unique number for EI declarations following format requirements specified in the 'Document about practical arrangements for transmitting interoperability documents'." ;
	era:rinfIndex "1.1.1.1.1.2" ;
    era:rinfIndex "1.2.1.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): 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:trackShape sh:property era-sh:TenClassificationT.
era-sh:TenClassificationT
	a sh:PropertyShape ;
    era:affectedProperty era:tenClassification;
    era:affectedClass era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the part of the trans-European network the line belongs to." ;	era:rinfIndex "1.1.1.1.2.1" ;	
    sh:path era:tenClassification ;
    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:trackShape sh:sparql era-sh:TenClassificationSKOST .
era-sh:TenClassificationSKOST
	a sh:SPARQLConstraint ;
    era:affectedProperty era:tenClassification;
    era:affectedClass era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the TEN classification of track." ;
	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 "TEN classification (1.1.1.1.2.1, 1.2.1.0.2.1): The track {$this} (label {?trackLabel}) 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 ?trackLabel
    WHERE {
        OPTIONAL {$this rdfs:label ?trackLabel} .
        $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:trackShape sh:property era-sh:GaugingProfile.
 era-sh:GaugingProfile
	a sh:PropertyShape ;
    era:affectedProperty era:gaugingProfile;
    era:affectedClass era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Gauges as defined in European standard or other local gauges, including lower or upper part." ;
    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: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:trackShape sh:sparql era-sh:GaugingProfileSKOS .
era-sh:GaugingProfileSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:gaugingProfile;
    era:affectedClass era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the gauging profile of track." ;
	era:rinfIndex "1.1.1.1.3.1.1" ;
    era:rinfIndex "1.2.1.0.3.4" ;
	sh:severity sh:Violation ;
	sh:message "Gauging profile (1.1.1.1.3.1.1, 1.2.1.0.3.4): The track {$this} (label {?trackLabel}) 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 ?trackLabel
    WHERE {
        OPTIONAL {$this rdfs:label ?trackLabel} .
        $this era:gaugingProfile ?concept .
        era:gaugingProfile era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# gaugingCheckLocation: # 1.1.1.1.3.1.2, 1.2.1.0.3.5
era-sh:trackShape sh:property era-sh:GaugingCheckLocation.
era-sh:GaugingCheckLocation
	a sh:PropertyShape ;
    era:affectedProperty era:gaugingCheckLocation;
    era:affectedClass era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Location of particular points requiring specific checks due to deviations from gauging referred to in 1.1.1.1.3.1.1." ;
	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: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:trackShape sh:property era-sh:GaugingTransversalDocument.
era-sh:GaugingTransversalDocument
	a sh:PropertyShape ;
    era:affectedProperty era:gaugingTransversalDocument;
    era:affectedClass era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	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:trackShape sh:property era-sh:WheelSetGauge.
era-sh:WheelSetGauge
	a sh:PropertyShape ;
    era:affectedProperty era:wheelSetGauge;
    era:affectedClass era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "A single value expressed in millimeters that identifies the track gauge." ;
	era:rinfIndex "1.1.1.1.4.1", "1.2.1.0.4.1" ;
	sh:path era:wheelSetGauge ;
    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:trackShape sh:sparql era-sh:WheelSetGaugeSKOS .
era-sh:WheelSetGaugeSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:wheelSetGauge;
    era:affectedClass era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	#rdfs:comment "A single value expressed in millimeters that identifies the track gauge." ;
	era:rinfIndex "1.1.1.1.4.1", "1.2.1.0.4.1" ;
	sh:severity sh:Violation ;
	sh:message "Nominal track gauge (1.1.1.1.4.1, 1.2.1.0.4.1): The track {$this} (label {?trackLabel}) 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 ?trackLabel
    WHERE {
        OPTIONAL {$this rdfs:label ?trackLabel} .
        $this era:wheelSetGauge ?concept .
        era:wheelSetGauge era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .




@prefix era-sh: <http://data.europa.eu/949/shapes/> .
@prefix ex: <http://example.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix era: <http://data.europa.eu/949/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix wgs: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix geosparql: <http://www.opengis.net/ont/geosparql#> .
@prefix era-sn: <http://data.europa.eu/949/concepts/sol-natures/> .
@prefix era-ph: <http://data.europa.eu/949/concepts/platform-heights/> .
@prefix era-tenclass: <http://data.europa.eu/949/concepts/ten-classifications/> .
@prefix era-gaugings: <http://data.europa.eu/949/concepts/gaugings/> .
@prefix era-ntg: <http://data.europa.eu/949/concepts/nominal-track-gauges/> .
@prefix era-tds: <http://data.europa.eu/949/concepts/train-detection/> .
@prefix era-tdssc: <http://data.europa.eu/949/concepts/train-detection-specific-checks/> .
@prefix era-tsi: <http://data.europa.eu/949/concepts/tsi-compliances/> .
@prefix era-malvc: <http://data.europa.eu/949/concepts/min-axle-loads-per-vehicle-category/> .
@prefix era-mas: <http://data.europa.eu/949/concepts/max-amount-sandings/> .
@prefix era-lc: <http://data.europa.eu/949/concepts/load-capabilities/> .
@prefix era-pnsb: <http://data.europa.eu/949/concepts/profile-num-swap-bodies/> .
@prefix era-pnst: <http://data.europa.eu/949/concepts/profile-num-semi-trailers/> .
@prefix era-ri: <http://data.europa.eu/949/concepts/rail-inclinations/> .
@prefix era-mb: <http://data.europa.eu/949/concepts/magnetic-braking/> .
@prefix era-pth: <http://data.europa.eu/949/concepts/pantograph-heads/> .
@prefix era-csm: <http://data.europa.eu/949/concepts/contact-strip-materials/> .
@prefix era-etcsinfill: <http://data.europa.eu/949/concepts/etcs-infills/> .
@prefix era-esc: <http://data.europa.eu/949/concepts/etcs-system-compatibilities/> .
@prefix era-etcsmvers: <http://data.europa.eu/949/concepts/etcs-m-versions/> .
@prefix era-gsmrv: <http://data.europa.eu/949/concepts/gsmr-versions/> .
@prefix era-gsmrnumactivemob: <http://data.europa.eu/949/concepts/gsmr-number-active-mobiles/> .
@prefix era-gsmroptfunc: <http://data.europa.eu/949/concepts/gsmr-optional-functions/> .
@prefix era-gsmr: <http://data.europa.eu/949/concepts/gsmr-networks/> .
@prefix era-rsc: <http://data.europa.eu/949/concepts/radio-system-compatibilities/> .
@prefix era-vrsc: <http://data.europa.eu/949/concepts/voice-radio-system-compatibilities/> .
@prefix era-rscd: <http://data.europa.eu/949/concepts/radio-system-compatibilities-data/> .
@prefix era-tpls: <http://data.europa.eu/949/concepts/train-protection-legacy-systems/> .
@prefix era-lrs: <http://data.europa.eu/949/concepts/legacy-radio-systems/> .
@prefix era-etcssituation: <http://data.europa.eu/949/concepts/etcs-situation/> .
@prefix era-opcw: <http://data.europa.eu/949/concepts/other-protection-control-warning/> .
@prefix era-trd: <http://data.europa.eu/949/concepts/track-running-directions/> .
@prefix era-ec: <http://data.europa.eu/949/concepts/eddy-current-braking/> .
@prefix era-ha: <http://data.europa.eu/949/concepts/hot-axle/> .
@prefix era-cls: <http://data.europa.eu/949/concepts/contact-line-systems/> .
@prefix era-cph: <http://data.europa.eu/949/concepts/compliant-pantograph-heads/> .
@prefix era-oph: <http://data.europa.eu/949/concepts/other-pantograph-heads/> .
@prefix era-lclc: <http://data.europa.eu/949/concepts/load-capability-line-categories/> .

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

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


era-sh:trackShape  
    a sh:NodeShape ;
    sh:targetClass era:Track .


# 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:Track;
    era:scope "global";
    era:validationAfterXML "false"^^xsd:boolean;
    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." ;
    era:rinfIndex "1.1.1.0.0.1" ;
    sh:severity sh:Violation ;
    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 ?solLabel ?track1 ?track1Label ?track2 ?track2Label ?value
			WHERE {
                $this era:track ?track1 .
                $this era:track ?track2 .
                ?track1 era:trackId ?value .
                ?track2 era:trackId ?value .
                FILTER(?track1 != ?track2) . 
				OPTIONAL{$this rdfs:label ?solLabel} .
				OPTIONAL{?track1 rdfs:label ?track1Label} .
				OPTIONAL{?track2 rdfs:label ?track2Label} .
			}
			""" .

era-sh:SectionOfLineShape sh:sparql era-sh:SoLTrackIdsMinCount.
 era-sh:SoLTrackIdsMinCount 
    a sh:SPARQLConstraint ; 
    era:affectedProperty era:trackId;
    era:affectedClass era:Track;
    era:affectedClass era:SectionOfLine;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
     rdfs:comment "Each track shall have unique identification or number within the SoL." ;
    era:rinfIndex "1.1.1.0.0.1" ;
    sh:severity sh:Violation ;
     sh:message "There should be at least one Track Id. 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 ?value
	 		WHERE {
                 $this era:track ?track .
     			OPTIONAL{?track rdfs:label ?trackLabel} .
	 			OPTIONAL{$this rdfs:label ?solLabel} .
                FILTER NOT EXISTS{?track era:trackId ?value} .
   	 		}
	 		""" .


era-sh:SectionOfLineShape sh:sparql era-sh:SoLTrackIdsMaxCount.
era-sh:SoLTrackIdsMaxCount 
   a sh:SPARQLConstraint ;
   era:affectedProperty era:trackId;
   era:affectedClass era:Track;
    era:affectedClass era:SectionOfLine;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
   rdfs:comment "Each track shall have unique identification or number within the SoL." ;
   era:rinfIndex "1.1.1.0.0.1" ;
     sh:severity sh:Violation ;
     sh:message "There should be at most one Track ID. 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
	 		WHERE {
                $this era:track ?track .
     			OPTIONAL{?track rdfs:label ?trackLabel} .
	 			OPTIONAL{$this rdfs:label ?solLabel} .
                ?track era:trackId ?value1 .
                 ?track era:trackId ?value2 .
                 FILTER(?value1 < ?value2) .
   	 	}
		 	""" .

 era-sh:SectionOfLineShape sh:sparql era-sh:SoLTrackDirectionMinCount.
 era-sh:SoLTrackDirectionMinCount 
    a sh:SPARQLConstraint ; 
    era:affectedProperty era:trackDirection;
    era:affectedClass era:Track;
    era:affectedClass era:SectionOfLine;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    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." ;
    era:rinfIndex "1.1.1.0.0.2" ;
    sh:severity sh:Violation ;
     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 ?value
	 		WHERE {
                 $this era:track ?track .
     			OPTIONAL{?track rdfs:label ?trackLabel} .
	 			OPTIONAL{$this rdfs:label ?solLabel} .
                FILTER NOT EXISTS{?track era:trackDirection ?value} .
   	 		}
	 		""" .

era-sh:SectionOfLineShape sh:sparql era-sh:SoLTrackDirectionMaxCount.
era-sh:SoLTrackDirectionMaxCount 
   a sh:SPARQLConstraint ;
   era:affectedProperty era:trackDirection;
    era:affectedClass era:Track;
    era:affectedClass era:SectionOfLine;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
   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." ;
   era:rinfIndex "1.1.1.0.0.2" ;
     sh:severity sh:Violation ;
     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
	 		WHERE {
                $this era:track ?track .
     			OPTIONAL{?track rdfs:label ?trackLabel} .
	 			OPTIONAL{$this rdfs:label ?solLabel} .
                ?track era:trackDirection ?value1 .
                 ?track era:trackDirection ?value2 .
                 FILTER(?value1 < ?value2) .
   	 	}
		 	""" .


# trackDirection: # 1.1.1.0.0.2
era-sh:trackShape sh:sparql era-sh:TrackDirectionSKOS.
era-sh:TrackDirectionSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:trackDirection;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    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." ;
	era:rinfIndex "1.1.1.0.0.2" ;
	sh:severity sh:Violation ;
    sh:message "Indication of the trackDirection (1.1.1.0.0.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/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
    WHERE {
        $this era:trackDirection ?concept .
        era:trackDirection era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .







# tenGISId: # 1.1.1.1.2.1.2
era-sh:trackShape sh:property era-sh:TenGISId.
era-sh:TenGISId
	a sh:PropertyShape ; 
    era:affectedProperty era:tenGISId;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the GIS identity (GIS ID) of the section of TEN-T database to which the track belongs." ;
	era:rinfIndex "1.1.1.1.2.1.2" ;
	sh:path era:tenGISId ;
	sh:maxCount 1 ;
	sh:datatype xsd:string ;
	sh:severity sh:Violation ;
	sh:message "tenGISId (1.1.1.1.2.1.2): The track must have at most one character string value (GIS Id) of the section of TEN-T database to which the track belongs. This error may be due to having a track with more than one TEN GIS identity."@en .

# loadCapabilitySpeed: # 1.1.1.1.2.4
 era-sh:trackShape sh:property era-sh:LoadCapabilitySpeed.
 era-sh:LoadCapabilitySpeed
	a sh:PropertyShape ; 
    era:affectedProperty era:loadCapabilitySpeed;
    era:affectedClass  era:Track;
    era:affectedClass  era:LoadCapability;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	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:trackLoadCapability era:loadCapabilitySpeed) ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:datatype xsd:integer ;
	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 havong a load capability speed that is not an integer."@en .

# loadCapabilityLineCategory: # 1.1.1.1.2.4
 era-sh:trackShape sh:property era-sh:LoadCapabilityLineCategory.
 era-sh:LoadCapabilityLineCategory
	a sh:PropertyShape ; 
    era:affectedProperty era:loadCapabilityLineCategory;
    era:affectedClass  era:Track;
    era:affectedClass  era:LoadCapability;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	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:trackLoadCapability era:loadCapabilityLineCategory) ;
	sh:nodeKind sh:IRI ;
	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 a load capability line category that is not an URI."@en .

# loadCapabilityLineCategory: # 1.1.1.1.2.4
era-sh:trackShape sh:sparql era-sh:LoadCapabilityLineCategorySKOS.
era-sh:LoadCapabilityLineCategorySKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:loadCapabilityLineCategory;
    era:affectedClass  era:Track;
    era:affectedClass  era:LoadCapability;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    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:severity sh:Violation ;
    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
    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:trackShape sh:property era-sh:NationalLoadCapability.
era-sh:NationalLoadCapability
	a sh:PropertyShape ; 
    era:affectedProperty era:nationalLoadCapability;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "National classification for load capability." ;
	era:rinfIndex "1.1.1.1.2.4.1" ;
	sh:path era:nationalLoadCapability ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	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:trackShape sh:property era-sh:HighSpeedLoadModelCompliance.
era-sh:HighSpeedLoadModelCompliance
	a sh:PropertyShape ; 
    era:affectedProperty era:highSpeedLoadModelCompliance;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "National classification for load capability." ;
	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" ;
	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 a value of high speed load model compliance that is not Y/N."@en .

# structureCheckLocation: # 1.1.1.1.2.4.3
era-sh:trackShape sh:property era-sh:StructureCheckLocation.
era-sh:StructureCheckLocation
	a sh:PropertyShape ; 
    era:affectedProperty era:structureCheckLocation;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Localisation of structures requiring specific checks." ;
	era:rinfIndex "1.1.1.1.2.4.3" ;
	sh:path era:structureCheckLocation ;
	sh:datatype xsd:double ;
	sh:pattern "^([1-9]\\d{1,2}|[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:trackShape sh:property era-sh:CompatibilityProcedureDocument.
era-sh:CompatibilityProcedureDocument
	a sh:PropertyShape ; 
    era:affectedProperty era:compatibilityProcedureDocument;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Document with the procedure for static and dynamic compatibility checks." ;
	era:rinfIndex "1.1.1.1.2.4.4" ;
	sh:path era:compatibilityProcedureDocument ;
	# #sh:minCount 0 ; #TODO: Not yet applicable
	#sh:datatype xsd:anyURI ;
    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:trackShape sh:property era-sh:MaximumPermittedSpeed.
era-sh:MaximumPermittedSpeed
	a sh:PropertyShape ; 
    era:affectedProperty era:maximumPermittedSpeed;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Maximum permitted speed." ;
	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:Violation ;
	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 .

# minimumTemperature: # 1.1.1.1.2.6
era-sh:trackShape sh:property era-sh:MinimumTemperature.
era-sh:MinimumTemperature
	a sh:PropertyShape ; 
    era:affectedProperty era:minimumTemperature;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Maximum permitted speed." ;
	rdfs:comment "Minimum temperature for unrestricted access to the line according European standard." ;
	era:rinfIndex "1.1.1.1.2.6" ;
	sh:path era:minimumTemperature ;
	sh:maxCount 1 ;
	sh:datatype xsd:integer ;
	sh:severity sh:Violation ;
	sh:message "minimumTemperature (1.1.1.1.2.6): The track must have at most one value of minimum temperature value that is an integer. This error may be due to the track having more than one value of minimum temperature or that the value is not an integer."@en .

# maximumTemperature: # 1.1.1.1.2.6
era-sh:trackShape sh:property era-sh:MaximumTemperature.
era-sh:MaximumTemperature
	a sh:PropertyShape ; 
    era:affectedProperty era:maximumTemperature;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Maximum temperature for unrestricted access to the line according European standard." ;
	era:rinfIndex "1.1.1.1.2.6" ;
	sh:path era:maximumTemperature ;
	sh:maxCount 1 ;
	sh:datatype xsd:integer ;
	sh:severity sh:Violation ;
	sh:message "The track must have at most one value of maximum temperature value that is an integer. This error may be due to the track having more than one value of maximum temperature or that the value is not an integer."@en .



#temperatureRange: # 1.1.1.1.2.6
era-sh:trackShape sh:property era-sh:TemperatureRange.
era-sh:TemperatureRange
	a sh:PropertyShape ; 
    era:affectedProperty era:temperatureRange;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the temperature range of track." ;
	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, to having more than one temperature range."@en .

#temperatureRange: # 1.1.1.1.2.6
era-sh:trackShape sh:sparql era-sh:TemperatureRangeSKOS.
era-sh:TemperatureRangeSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:temperatureRange;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Indication of the temperature range of track." ;
	era:rinfIndex "1.1.1.1.2.6" ;
	sh:severity sh:Violation ;
    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
    WHERE {
        $this era:temperatureRange ?concept .
        era:temperatureRange era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .



# maximumAltitude: # 1.1.1.1.2.7
era-sh:trackShape sh:property era-sh:MaximumAltitude.
era-sh:MaximumAltitude
	a sh:PropertyShape ; 
    era:affectedProperty era:maximumAltitude;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Highest point of the section of line above sea level in reference to Normal Amsterdam's Peil (NAP)." ;
	era:rinfIndex "1.1.1.1.2.7" ;
	sh:path era:maximumAltitude ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:maxCount 1 ;
	#sh:datatype xsd:double ; Pending fix in mappings
	sh:pattern "^(\\+|\\-)\\d{1,4}$" ;
	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:trackShape sh:property era-sh:HasSevereWeatherConditions.
era-sh:HasSevereWeatherConditions
	a sh:PropertyShape ; 
    era:affectedProperty era:hasSevereWeatherConditions;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Climatic conditions on the line are severe according to European standard." ;
	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:trackShape sh:sparql era-sh:ProfileNumberSwapBodiesSKOS.
era-sh:ProfileNumberSwapBodiesSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:profileNumberSwapBodies;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Coding for combined transport with swap bodies as defined in UIC Code." ;
	era:rinfIndex "1.1.1.1.3.4" ;
	sh:severity sh:Violation ;
    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
    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:trackShape sh:sparql era-sh:ProfileNumberSemiTrailersSKOS.
era-sh:ProfileNumberSemiTrailersSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:profileNumberSemiTrailers;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Coding for combined transport with semi-trailers as defined in UIC Code." ;
	era:rinfIndex "1.1.1.1.3.5" ;
	sh:severity sh:Violation ;
    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
    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:trackShape sh:property era-sh:SpecificInformation.
era-sh:SpecificInformation
	a sh:PropertyShape ; 
    era:affectedProperty era:specificInformation;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Any specific information from the IM." ;
	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:trackShape sh:property era-sh:GradientProfile.
era-sh:GradientProfile
	a sh:PropertyShape ; 
    era:affectedProperty era:gradientProfile;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Sequence of gradient values and locations of change in gradient." ;
	era:rinfIndex "1.1.1.1.3.6" ;
	sh:path era:gradientProfile ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:datatype xsd:string ;
	#sh:pattern "^((\\+|\\-)([1-9]\\d{1}|[0-9]|00)\\.\\d{1,3}(\\((\\+|\\-)?([1-9]\\d{1,2}|[0-9])\\.\\d{1,3}\\))?)(\\s\\s(\\+|\\-)([1-9]\\d{1}|[0-9])\\.\\d{1,3}(\\((\\+|\\-)?([1-9]\\d{1,2}|[0-9])\\.\\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 values in the format [+/-][NN.N]([+/-][NNNN.NNN]). This error may be due to having a sequence of values that do not follow the pattern."@en .

# minimumHorizontalRadius: # 1.1.1.1.3.7
era-sh:trackShape sh:property era-sh:MinimumHorizontalRadius.
era-sh:MinimumHorizontalRadius
	a sh:PropertyShape ; 
    era:affectedProperty era:minimumHorizontalRadius;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Radius of the smallest horizontal curve of the track in meters." ;
	era:rinfIndex "1.1.1.1.3.7" ;
	sh:path era:minimumHorizontalRadius ;
	sh:maxCount 1 ;
	sh:datatype xsd:integer;
	sh:pattern "^([0-9]\\d{1,4}|[0-9])$" ;
	sh:severity sh:Violation ;
	sh:message "minimumHorizontalRadius (1.1.1.1.3.7): The track must have at most one minimum horizontal radius value that is an integer. This error may be due to the track having more than one minimum horizontal radius value or to having a value that is not an integer."@en .



# cantDeficiency: # 1.1.1.1.4.2
era-sh:trackShape sh:property era-sh:CantDeficiency.
era-sh:CantDeficiency
	a sh:PropertyShape ; 
    era:affectedProperty era:cantDeficiency;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	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." ;
	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:trackShape sh:property era-sh:RailInclination.
era-sh:RailInclination
	a sh:PropertyShape ; 
    era:affectedProperty era:railInclination;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "An angle defining the inclination of the head of a rail relatie to the running surface." ;
	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:trackShape sh:sparql era-sh:RailInclinationSKOS.
era-sh:RailInclinationSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:railInclination;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "An angle defining the inclination of the head of a rail relatie to the running surface." ;
	era:rinfIndex "1.1.1.1.4.3" ;
	sh:severity sh:Violation ;
    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
    WHERE {
        $this era:railInclination ?concept .
        era:railInclination era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .


# hasBallast: # 1.1.1.1.4.4
era-sh:trackShape sh:property era-sh:HasBallast.
era-sh:HasBallast
	a sh:PropertyShape ; 
    era:affectedProperty era:hasBallast ;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Specifies whether the track construction is with sleepers embedded in ballast or not." ;
	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:trackShape sh:property era-sh:TSISwitchCrossing.
era-sh:TSISwitchCrossing
	a sh:PropertyShape ; 
    era:affectedProperty era:tsiSwitchCrossing ;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Switches and crossings are maintained to in service limit dimension as specified in TSI." ;
	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:trackShape sh:property era-sh:MinimumWheelDiameter.
era-sh:MinimumWheelDiameter
	a sh:PropertyShape ; 
    era:affectedProperty era:minimumWheelDiameter ;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Maximum unguided length of fixed obtuse crossings is based on a minimum wheel diameter in service expressed in millimiters." ;
	era:rinfIndex "1.1.1.1.5.2" ;
	sh:path era:minimumWheelDiameter ;
	sh:maxCount 1 ;
	sh:datatype xsd:integer ;
	sh:pattern "^([1-9]\\d{1,2}|[0-9])$" ;
	sh:severity sh:Violation ;
	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."@en .

# maximumTrainDeceleration: # 1.1.1.1.6.1
era-sh:trackShape sh:property era-sh:MaximumTrainDeceleration.
era-sh:MaximumTrainDeceleration
	a sh:PropertyShape ; 
    era:affectedProperty era:maximumTrainDeceleration ;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Limit for longitudinal track resistance given as a maximum allowed train deceleration and expressed in m/s2." ;
	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 .


# eddyCurrentBraking: # 1.1.1.1.6.2
era-sh:trackShape sh:property era-sh:EddyCurrentBraking.
era-sh:EddyCurrentBraking
	a sh:PropertyShape ; 
    era:affectedProperty era:eddyCurrentBraking ;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of limitations on the use of eddy current brakes." ;	
    era:rinfIndex "1.1.1.1.6.2" ;	sh:path era:eddyCurrentBraking ;
	sh:maxCount 1 ;	
    sh:nodeKind sh:IRI ;
 	sh:severity sh:Violation ;
 	sh:message "eddyCurrentBraking (1.1.1.1.6.2): The track must have at most one eddy current braking value that is an IRI. This error may be due to the track having more than one eddy current braking value."@en .

# eddyCurrentBraking: # 1.1.1.1.6.2
era-sh:trackShape sh:sparql era-sh:EddyCurrentBrakingSKOS.
era-sh:EddyCurrentBrakingSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:eddyCurrentBraking ;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Indication of limitations on the use of eddy current brakes." ;
	era:rinfIndex "1.1.1.1.6.2" ;
	sh:severity sh:Violation ;
    sh:message "Indication of the eddyCurrentBraking (1.1.1.1.6.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/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
    WHERE {
        $this era:eddyCurrentBraking ?concept .
        era:eddyCurrentBraking era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .







# magneticBraking: # 1.1.1.1.6.3
era-sh:trackShape sh:property era-sh:MagneticBraking.
era-sh:MagneticBraking
	a sh:PropertyShape ; 
    era:affectedProperty era:magneticBraking ;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of limitations of the use of magnetic brakes." ;
	era:rinfIndex "1.1.1.1.6.3" ;
	sh:path era:magneticBraking ;
    sh:maxCount 1 ;
	sh:nodeKind sh:IRI ;   
	sh:severity sh:Violation ;
	sh:message "magneticBraking (1.1.1.1.6.3): The track must have at most  one magnetic braking value that is an IRI. This error may be due to the track having more than one magnetic braking value."@en .

# magneticBraking: # 1.1.1.1.6.3
era-sh:trackShape sh:sparql era-sh:MagneticBrakingSKOS.
era-sh:MagneticBrakingSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:magneticBraking ;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Indication of limitations of the use of magnetic brakes" ;
	era:rinfIndex "1.1.1.1.6.3" ;
	sh:severity sh:Violation ;
    sh:message "Indication of the magneticBraking (1.1.1.1.6.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/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
    WHERE {
        $this era:magneticBraking ?concept .
        era:magneticBraking era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .



# eddyCurrentBrakingConditionsDocument: # 1.1.1.1.6.4
era-sh:trackShape sh:property era-sh:EddyCurrentBrakingConditionsDocument.
era-sh:EddyCurrentBrakingConditionsDocument
	a sh:PropertyShape ; 
    era:affectedProperty era:eddyCurrentBrakingConditionsDocument ;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	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." ;
	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:trackShape sh:property era-sh:MagneticBrakingConditionsDocument.
era-sh:MagneticBrakingConditionsDocument
	a sh:PropertyShape ; 
    era:affectedProperty era:magneticBrakingConditionsDocument ;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	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." ;
	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:trackShape sh:property era-sh:FlangeLubeForbidden.
era-sh:FlangeLubeForbidden
	a sh:PropertyShape ; 
    era:affectedProperty era:flangeLubeForbidden ;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication whether the use of on-board device for flange lubrication is forbidden." ;
	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:trackShape sh:property era-sh:HasLevelCrossings.
era-sh:HasLevelCrossings
	a sh:PropertyShape ; 
    era:affectedProperty era:hasLevelCrossings ;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication whether level crossings (including pedestrian track crossing) exist onf the section line." ;
	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:AccelerationLevelCrossing
	a sh:PropertyShape ; 
    era:affectedProperty era:accelerationLevelCrossing ;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	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." ;
	era:rinfIndex "1.1.1.1.7.3" ;
	sh:path era:accelerationLevelCrossing ;
	sh:maxCount 1 ;
	sh:datatype xsd:string ;
	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 character string. This error may be due to having more than one value or having a value that is not a string."@en .

# hasHotAxleBoxDetector: # 1.1.1.1.7.4
era-sh:trackShape sh:property era-sh:HasHotAxleBoxDetector.
era-sh:HasHotAxleBoxDetector
	a sh:PropertyShape ; 
    era:affectedProperty era:hasHotAxleBoxDetector ;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Existence of trackside hot axle box detector." ;
	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 .

# hotAxleBoxDetectorTSICompliant: # 1.1.1.1.7.5
era-sh:trackShape sh:property era-sh:HotAxleBoxDetectorTSICompliant.
era-sh:HotAxleBoxDetectorTSICompliant
	a sh:PropertyShape ; 
    era:affectedProperty era:hotAxleBoxDetectorTSICompliant ;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Trackside HABD compilant to TSI means that the HABD is compliant with EN 15437:2009 and specific cases mentioned in TSIs." ;
	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 track 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 .

# hotAxleBoxDetectorIdentification: # 1.1.1.1.7.6
era-sh:trackShape sh:property era-sh:HotAxleBoxDetectorIdentification.
era-sh:HotAxleBoxDetectorIdentification
	a sh:PropertyShape ; 
    era:affectedProperty era:hotAxleBoxDetectorIdentification ;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Applicable if trackside HABD is not TSI compliant. Identification of the trackside HABD." ;
	era:rinfIndex "1.1.1.1.7.6" ;
	sh:path era:hotAxleBoxDetectorIdentification ;
	sh:maxCount 1 ;
	sh:datatype xsd:string ;
	sh:severity sh:Violation ;
	sh:message "hotAxleBoxDetectorIdentification (1.1.1.1.7.6): The track 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 .

# hotAxleBoxDetectorGeneration: # 1.1.1.1.7.7
era-sh:trackShape sh:property era-sh:HotAxleBoxDetectorGeneration.
era-sh:HotAxleBoxDetectorGeneration
	a sh:PropertyShape ; 
    era:affectedProperty era:hotAxleBoxDetectorGeneration ;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Applicable if trackside HABD is not TSI compliant. Generation of the trackside HABD." ;
	era:rinfIndex "1.1.1.1.7.7" ;
	sh:path era:hotAxleBoxDetectorGeneration ;
	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 track must have at most one generation of the hot axle box detector 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 .

# hotAxleBoxDetectorLocation: # 1.1.1.1.7.8
era-sh:trackShape sh:property era-sh:HotAxleBoxDetectorLocation.
era-sh:HotAxleBoxDetectorLocation
	a sh:PropertyShape ; 
    era:affectedProperty era:hotAxleBoxDetectorLocation  ;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Applicable if trackside HABD is not TSI compliant. Location of the trackside HABD." ;
	era:rinfIndex "1.1.1.1.7.8" ;
	sh:path era:hotAxleBoxDetectorLocation ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	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 track has a location of the hot axle box detector(s) vallue that must be a double (real) number with format [±NNNN.NNN]. This error may be due to having more than one value or having a value that is not a double (real) number."@en .

# hotAxleBoxDetectorDirection: # 1.1.1.1.7.9
era-sh:trackShape sh:property era-sh:HotAxleBoxDetectorDirection.
era-sh:HotAxleBoxDetectorDirection
	a sh:PropertyShape ; 
    era:affectedProperty era:hotAxleBoxDetectorDirection  ;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Direction of measurement of the trackside HABD." ;
	era:rinfIndex "1.1.1.1.7.9" ;
	sh:path era:hotAxleBoxDetectorDirection ;
	sh:maxCount 1 ;
	sh:nodeKind sh:IRI ;
    sh:severity sh:Violation ;
	sh:message "hotAxleBoxDetectorDirection (1.1.1.1.7.9): The track 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 the track having more than one value of hot axle box detector direction."@en .

# hotAxleBoxDetectorDirection: # 1.1.1.1.7.9
era-sh:trackShape sh:sparql era-sh:HotAxleBoxDetectorDirectionSKOS.
era-sh:HotAxleBoxDetectorDirectionSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:hotAxleBoxDetectorDirection  ;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Direction of measurement of the trackside HABD." ;
	era:rinfIndex "1.1.1.1.7.9" ;
	sh:severity sh:Violation ;
    sh:message "Indication of the hotAxleBoxDetectorDirection (1.1.1.1.7.9):): 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/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
    WHERE {
        $this era:hotAxleBoxDetectorDirection ?concept .
        era:hotAxleBoxDetectorDirection era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .




# redLightsRequired: # 1.1.1.1.7.10 
era-sh:trackShape sh:property era-sh:RedLightsRequired.
era-sh:RedLightsRequired
	a sh:PropertyShape ; 
    era:affectedProperty era:redLightsRequired  ;
    era:affectedClass  era:Track;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Sections where two steady red lights are required in accordance with Implementing Regulations (EU) 2019/773." ;
	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 .

# isQuietRoute: # 1.1.1.1.7.11
era-sh:trackShape sh:property era-sh:IsQuietRoute.
era-sh:IsQuietRoute
	a sh:PropertyShape ; era:affectedProperty era:isQuietRoute  ;     era:affectedClass  era:Track;     era:scope "local";     
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Belonging to a 'quiet route' in accordance with Article 5b of Regulation (EU) 1304/2014." ;
	era:rinfIndex "1.1.1.1.7.11" ;
	sh:path era:isQuietRoute ;
	# #sh:minCount 0 ; #TODO: Not yet applicable
	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:trackShape sh:property era-sh:VerificationENE.
era-sh:VerificationENE
	a sh:PropertyShape ; era:affectedProperty era:verificationENE  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Unique number for EC declarations following format requirements specified in the 'Document about practical arrangents for transmitting interoperability documents' ." ;
	era:rinfIndex "1.1.1.2.1.1" ;
	sh:path era:verificationENE ;
	# #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 "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:trackShape sh:property era-sh:DemonstrationENE.
era-sh:DemonstrationENE
	a sh:PropertyShape ; era:affectedProperty era:demonstrationENE  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Unique number for EI declarations following the same format requirements as specified in the 'Document about practical arrangents for transmitting interoperability documents'." ;
	era:rinfIndex "1.1.1.2.1.2" ;
	sh:path era:demonstrationENE ;
	# #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 "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 does not follow the pattern."@en .


# maximumContactWireHeight: # 1.1.1.2.2.5 
era-sh:trackShape sh:property era-sh:MaximumContactWireHeight.
era-sh:MaximumContactWireHeight
	a sh:PropertyShape ; era:affectedProperty era:maximumContactWireHeight  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the maximum contact wire height expressed in meters." ;
	era:rinfIndex "1.1.1.2.2.5" ;
	sh:path era:maximumContactWireHeight ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:maxCount 1 ;
	sh:datatype xsd:double ;
	sh:pattern "^[0-9]\\.\\d{1,2}$" ;
	sh:severity sh:Violation ;
	sh:message "maximumContactWireHeight (1.1.1.2.2.5): The track must have at most one indication of the maximum contact wire height expressed in meters value that is a double (real) number with format [N.NN]. This error may be due to having more than one value or having a value that is not a doucle (real) number."@en .


# minimumContactWireHeight: # 1.1.1.2.2.6
era-sh:trackShape sh:property era-sh:MinimumContactWireHeight.
era-sh:MinimumContactWireHeight
	a sh:PropertyShape ; era:affectedProperty era:minimumContactWireHeight  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the minimum contact wire height expressed in meters." ;
	era:rinfIndex "1.1.1.2.2.6" ;
	sh:path era:minimumContactWireHeight ;
#	#sh:minCount 0 ; #TODO: Not yet applicable
	sh:maxCount 1 ;
	sh:datatype xsd:double ;
	sh:pattern "^[0-9]\\.\\d{1,2}$" ;
	sh:severity sh:Violation ;
	sh:message "minimumContactWireHeight (1.1.1.2.2.6): The track must have at most one indication of the minimum contact wire height expressed in meters value that is a double (real) number with format [N.NN]. This error may be due to having more than one value or having a value that is not a doucle (real) number."@en .

# tsiPantographHead: # 1.1.1.2.3.1
era-sh:trackShape sh:sparql era-sh:TsiPantographHeadSKOS.
era-sh:TsiPantographHeadSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:tsiPantographHead  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Accepted TSI compliant pantograph heads." ;
	era:rinfIndex "1.1.1.2.3.1" ;
	sh:severity sh:Violation ;
    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
    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:trackShape sh:sparql era-sh:OtherPantographHeadSKOS.
era-sh:OtherPantographHeadSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:otherPantographHea  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Indication of which other pantograph heads are allowed to be used." ;
	era:rinfIndex "1.1.1.2.3.2" ;
	sh:severity sh:Violation ;
    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
    WHERE {
        $this era:otherPantographHead ?concept .
        era:otherPantographHead era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .


# raisedPantographsDistance: # 1.1.1.2.3.3
 era-sh:trackShape sh:property era-sh:RaisedPantographsDistance.
 era-sh:RaisedPantographsDistance
	a sh:PropertyShape ; era:affectedProperty era:raisedPantographsDistance  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    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." ;
	era:rinfIndex "1.1.1.2.3.3" ;
	sh:path (era:trackRaisedPantographsDistanceAndSpeed era:raisedPantographsDistance) ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	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 value that is not an integer."@en .

# raisedPantographsSpeed: # 1.1.1.2.3.3
 era-sh:trackShape sh:property era-sh:RaisedPantographsSpeed.
 era-sh:RaisedPantographsSpeed
	a sh:PropertyShape ; era:affectedProperty era:raisedPantographsSpeed  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    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." ;
	era:rinfIndex "1.1.1.2.3.3" ;
	sh:path (era:trackRaisedPantographsDistanceAndSpeed era:raisedPantographsSpeed) ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	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 the track having a value that is not an integer."@en .

# raisedPantographsNumber: # 1.1.1.2.3.3
 era-sh:trackShape sh:property era-sh:RaisedPantographsNumber.
 era-sh:RaisedPantographsNumber
	a sh:PropertyShape ; era:affectedProperty era:raisedPantographsNumber  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    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." ;
	era:rinfIndex "1.1.1.2.3.3" ;
	sh:path (era:trackRaisedPantographsDistanceAndSpeed era:raisedPantographsNumber) ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	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 speed that is an integer. This error is due to the track having a value that is not an integer."@en .

 
# contactStripMaterial: # 1.1.1.2.3.4
era-sh:trackShape sh:sparql era-sh:ContactStripMaterialSKOS.
era-sh:ContactStripMaterialSKOS
	a sh:SPARQLConstraint ;
era:affectedProperty era:contactStripMaterial  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
   rdfs:comment "Indication of the material of the contact strip." ;
	era:rinfIndex "1.1.1.2.3.4" ;
	sh:severity sh:Violation ;
    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
    WHERE {
        $this era:contactStripMaterial ?concept .
        era:contactStripMaterial era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .


# contactStripMaterialMetallicContent: # 1.1.1.2.3.4
era-sh:trackShape sh:property era-sh:ContactStripMaterialMetallicContent.
era-sh:ContactStripMaterialMetallicContent
	a sh:PropertyShape ; era:affectedProperty era:contactStripMaterialMetallicContent  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "In case that the value of the property era:contactStripMaterial is impregnated carbon, it is the metallic content, the maximum percentage allowed." ;
	era:rinfIndex "1.1.1.2.3.4" ;
	sh:path era:contactStripMaterialMetallicContent ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:datatype xsd:integer ;
	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:trackShape sh:property era-sh:PhaseSeparation.
 era-sh:PhaseSeparation
    a sh:PropertyShape ; era:affectedProperty era:phaseSeparation ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of existence of phase separation and required information." ;
	era:rinfIndex "1.1.1.2.4.1.1" ;
	sh:path era:phaseSeparation ;
    # #sh:minCount 0 ; #TODO: Not yet applicable
    sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "phaseSeparation (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 .




# phaseInfoKm: # 1.1.1.2.4.1.2 
era-sh:trackShape sh:property era-sh:PhaseInfoKm.
 era-sh:PhaseInfoKm
	a sh:PropertyShape ; era:affectedProperty era:phaseInfoKm  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    era:affectedClass  era:PhaseInfo;
	rdfs:comment "Indication of existence of phase separation and required information." ;
	sh:path (era:trackPhaseInfo era:phaseInfoKm) ;
    era:rinfIndex "1.1.1.2.4.1.2" ;
	##sh:minCount 0 ; #TODO: Not yet applicable
 	sh:datatype xsd:double ;
 	sh:severity sh:Violation ;
 	sh:message "Phase info km (1.1.1.2.4.1.2): 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 value that is not a double (real) number."@en .

# phaseInfoDistanceType: # 1.1.1.2.4.1.2 
 era-sh:trackShape sh:property era-sh:PhaseInfoDistanceType.
 era-sh:PhaseInfoDistanceType 
    a sh:PropertyShape ; era:affectedProperty era:phaseInfoDistanceType  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    era:affectedClass  era:PhaseInfo;
	rdfs:comment "Indication of existence of phase separation and required information." ;
	sh:path (era:trackPhaseInfo era:phaseInfoDistanceType) ;
    era:rinfIndex "1.1.1.2.4.1.2" ;
	##sh:minCount 0 ; #TODO: Not yet applicable
 	sh:datatype xsd:string ;
    sh:or (
        [sh:hasValue "MIN"]
        [sh:hasValue "MAX"]
    );
 	sh:severity sh:Violation ;
 	sh:message "Phase info distance type (1.1.1.2.4.1.2): 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 value that is not one of the strings MIN or MAX."@en .



# phaseInfoLength: # 1.1.1.2.4.1.2
 era-sh:trackShape sh:property era-sh:PhaseInfoLength.
 era-sh:PhaseInfoLength
	a sh:PropertyShape ; era:affectedProperty era:phaseInfoLength  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    era:affectedClass  era:PhaseInfo;
	rdfs:comment "Indication of existence of phase separation and required information." ;
    era:rinfIndex "1.1.1.2.4.1.2" ;
	sh:path (era:trackPhaseInfo era:phaseInfoLength) ;
	sh:datatype xsd:integer ;
	sh:severity sh:Violation ;
	sh:message "Phase infolength (1.1.1.2.4.1.2): 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 value that is not an integer."@en .

# phaseInfoPantographLowered: # 1.1.1.2.4.1.2
 era-sh:trackShape sh:property era-sh:PhaseInfoPantographLowered.
 era-sh:PhaseInfoPantographLowered
	a sh:PropertyShape ; era:affectedProperty era:phaseInfoPantographLowered  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    era:affectedClass  era:PhaseInfo;
	rdfs:comment "Indication of existence of phase separation and required information." ;
	sh:path (era:trackPhaseInfo era:phaseInfoPantographLowered) ;
	##sh:minCount 0 ; #TODO: Not yet applicable
    era:rinfIndex "1.1.1.2.4.1.2" ;
	sh:datatype xsd:boolean ;
	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 value that is not Y/N (boolean)."@en .

# phaseInfoSwitchOffBreaker: # 1.1.1.2.4.1.2
 era-sh:trackShape sh:property era-sh:PhaseInfoSwitchOffBreaker.
 era-sh:PhaseInfoSwitchOffBreaker
	a sh:PropertyShape ; era:affectedProperty era:phaseInfoSwitchOffBreaker  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    era:affectedClass  era:PhaseInfo;
	rdfs:comment "Indication of existence of phase separation and required information." ;
	sh:path (era:trackPhaseInfo era:phaseInfoSwitchOffBreaker) ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "Phase info switchOffBreaker (1.1.1.2.4.1.2): 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 value that is not Y/N (boolean)."@en .

# hasSystemSeparation: # 1.1.1.2.4.2.1
era-sh:trackShape sh:property era-sh:HasSystemSeparation.
era-sh:HasSystemSeparation
	a sh:PropertyShape ; era:affectedProperty era:hasSystemSeparation  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of existence of system separation." ;
	era:rinfIndex "1.1.1.2.4.2.1" ;
	sh:path era:hasSystemSeparation ;
	# #sh:minCount 0 ; #TODO: Not yet applicable
	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 .


# systemSeparationInfoKm: # 1.1.1.2.4.2.2
 era-sh:trackShape sh:property era-sh:SystemSeparationInfoKm.
 era-sh:SystemSeparationInfoKm
	a sh:PropertyShape ; era:affectedProperty era:SystemSeparationInfoKm  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    era:affectedClass  era:SystemSeparationInfo;
	rdfs:comment "Indication of required several information on system separation." ;
	sh:path (era:trackSystemSeparationInfo era:SystemSeparationInfoKm) ;
	##sh:minCount 0 ; #TODO: Not yet applicable
    era:rinfIndex "1.1.1.2.4.2.2" ;
	sh:datatype xsd:double ;
	sh:severity sh:Violation ;
	sh:message "System separation info km (1.1.1.2.4.2.2): 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 value that is not a double (real) number. "@en .

# systemSeparationInfoLength: # 1.1.1.2.4.2.2
 era-sh:trackShape sh:property era-sh:SystemSeparationInfoLength.
 era-sh:SystemSeparationInfoLength
	a sh:PropertyShape ; era:affectedProperty era:SystemSeparationInfoLength  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    era:affectedClass  era:SystemSeparationInfo;
	rdfs:comment "Indication of required several information on system separation." ;
	sh:path (era:trackSystemSeparationInfo era:SystemSeparationInfoLength) ;
	##sh:minCount 0 ; #TODO: Not yet applicable
    era:rinfIndex "1.1.1.2.4.2.2" ;
	sh:datatype xsd:integer ;
	sh:severity sh:Violation ;
	sh:message "System separation info length (1.1.1.2.4.2.2): 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 value that is not an integer."@en .

 # systemSeparationInfoPantographLowered: # 1.1.1.2.4.2.2
 era-sh:trackShape sh:property era-sh:SystemSeparationInfoPantographLowered.
 era-sh:SystemSeparationInfoPantographLowered
	a sh:PropertyShape ; era:affectedProperty era:SystemSeparationInfoPantographLowered  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    era:affectedClass  era:SystemSeparationInfo;
	rdfs:comment "Indication of required several information on system separation." ;
	sh:path (era:trackSystemSeparationInfo era:SystemSeparationInfoPantographLowered) ;
	##sh:minCount 0 ; #TODO: Not yet applicable
    era:rinfIndex "1.1.1.2.4.2.2" ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "System separation info pantograph lowered (1.1.1.2.4.2.2): 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 value that is not Y/N (boolean)."@en .

# systemSeparationInfoSwitchOffBreaker: # 1.1.1.2.4.2.2
 era-sh:trackShape sh:property era-sh:SystemSeparationInfoSwitchOffBreaker.
 era-sh:SystemSeparationInfoSwitchOffBreaker
	a sh:PropertyShape ; era:affectedProperty era:SystemSeparationInfoSwitchOffBreaker  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of required several information on system separation." ;
	sh:path (era:trackSystemSeparationInfo era:SystemSeparationInfoSwitchOffBreaker) ;
    era:affectedClass  era:SystemSeparationInfo;
	##sh:minCount 0 ; #TODO: Not yet applicable
    era:rinfIndex "1.1.1.2.4.2.2" ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "System separation info switchOffBreaker (1.1.1.2.4.2.2): The track has the system separation info with the indication whther the breaker may be switched off value, that must be Y/N (boolean). This error is due to the track having a value that is not Y/N (boolean)."@en .

# systemSeparationInfoChangeSupplySystem: # 1.1.1.2.4.2.2
 era-sh:trackShape sh:property era-sh:SystemSeparationInfoChangeSupplySystem.
 era-sh:SystemSeparationInfoChangeSupplySystem
	a sh:PropertyShape ; era:affectedProperty era:SystemSeparationInfoChangeSupplySystem  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    era:affectedClass  era:SystemSeparationInfo;
	rdfs:comment "Indication of required several information on system separation." ;
	sh:path (era:trackSystemSeparationInfo era:SystemSeparationInfoChangeSupplySystem) ;
	##sh:minCount 0 ; #TODO: Not yet applicable
    era:rinfIndex "1.1.1.2.4.2.2" ;
	sh:datatype xsd:string ;
	sh:severity sh:Violation ;
	sh:message "System separation info changeSupplySystem (1.1.1.2.4.2.2): The track has the system separation info with the indication whether the supply system has to be changed value, that must be a character string. This error is due to the track having a value that is not a string."@en .


# distSignToPhaseEnd: # 1.1.1.2.4.3
era-sh:trackShape sh:property era-sh:DistSignToPhaseEnd.
era-sh:DistSignToPhaseEnd
	a sh:PropertyShape ; era:affectedProperty era:distSignToPhaseEnd  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	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." ;
	era:rinfIndex "1.1.1.2.4.3" ;
	sh:path era:distSignToPhaseEnd ;
	# #sh:minCount 0 ; #TODO: Not yet applicable
	sh:maxCount 1 ;
	sh:datatype xsd:integer ;
	sh:pattern "^([1-9]\\d{1,2}|[0-9])$" ;
	sh:severity sh:Violation ;
	sh:message "distSignToPhaseEnd (1.1.1.2.4.3): 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:trackShape sh:property era-sh:PermittedContactForce.
era-sh:PermittedContactForce
	a sh:PropertyShape ; era:affectedProperty era:permittedContactForce  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of contact force allowed expressed in newtons." ;
	era:rinfIndex "1.1.1.2.5.2" ;
	sh:path era:permittedContactForce ;
	# #sh:minCount 0 ; #TODO: Not yet applicable
	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:trackShape sh:property era-sh:AutomaticDroppingDeviceRequired.
era-sh:AutomaticDroppingDeviceRequired
	a sh:PropertyShape ; era:affectedProperty era:automaticDroppingDeviceRequired  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the requirement of automatic dropping device." ;
	era:rinfIndex "1.1.1.2.5.3" ;
	sh:path era:automaticDroppingDeviceRequired ;
	# #sh:minCount 0 ; #TODO: Not yet applicable
	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:trackShape sh:property era-sh:VerificationCCS.
era-sh:VerificationCCS
	a sh:PropertyShape ; era:affectedProperty era:verificationCCS  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Unique number for EC declarations following format requirements specified in the 'Document about practical arrangements for transmitting interoperability documents'." ;
	era:rinfIndex "1.1.1.3.1.1" ;
	sh:path era:verificationCCS ;
	##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 "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 .

# etcsInfillLineAccess: # 1.1.1.3.2.3
era-sh:trackShape sh:property era-sh:EtcsInfillLineAccess.
era-sh:EtcsInfillLineAccess
	a sh:PropertyShape ; era:affectedProperty era:etcsInfillLineAccess  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the access to the ETCS infill line." ;
	era:rinfIndex "1.1.1.3.2.3" ;
	sh:path era:etcsInfillLineAccess ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "etcsInfillLineAccess (1.1.1.3.2.3): The track has at most one value of the access to the ETCS infill line and it must be 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 .

# etcsInfill: # 1.1.1.3.2.4
era-sh:trackShape sh:property era-sh:EtcsInfill.
era-sh:EtcsInfill
	a sh:PropertyShape ; era:affectedProperty era:etcsInfill  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Information about installed trackside equipment capable to transmit infill information by loop or GSM-R for level 1 installation." ;
	era:rinfIndex "1.1.1.3.2.4" ;
	sh:path era:etcsInfill ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:maxCount 1 ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "etcsInfill (1.1.1.3.2.4): The track has at most one value the information about installed trackside equipment capable to transmit infill information by loop or GSM-R for level 1 installation and the value is aan IRI. This error is due to the track having more than one value."@en .

# etcsInfill: # 1.1.1.3.2.4
era-sh:trackShape sh:sparql era-sh:EtcsInfillSKOS.
era-sh:EtcsInfillSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsInfill  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Information about installed trackside equipment capable to transmit infill information by loop or GSM-R for level 1 installation." ;
	era:rinfIndex "1.1.1.3.2.4" ;
	sh:severity sh:Violation ;
    sh:message "Indication of the etcsInfill (1.1.1.3.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/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  ?concept
    WHERE {
        $this era:etcsInfill ?concept .
        era:etcsInfill era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .



# etcsNationalPacket44: # 1.1.1.3.2.5
era-sh:trackShape sh:property era-sh:EtcsNationalPacket44.
era-sh:EtcsNationalPacket44
	a sh:PropertyShape ; era:affectedProperty era:etcsNationalPacket44  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication whether data for national application is transmitted between track and train." ;
	era:rinfIndex "1.1.1.3.2.5" ;
	sh:path era:etcsNationalPacket44 ;
#	#sh:minCount 0 ; #TODO: Not yet applicable
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "etcsNationalPacket44 (1.1.1.3.2.5): The track has at most one value of the indication whether data for national application is transmitted between track and train and it must be truye/false (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 .

# hasETCSRestrictionsConditions: # 1.1.1.3.2.6
era-sh:trackShape sh:property era-sh:HasETCSRestrictionsConditions.
era-sh:HasETCSRestrictionsConditions
	a sh:PropertyShape ; era:affectedProperty era:hasETCSRestrictionsConditions  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication whether restrictions or conditions due to partial compilance with the CCS TSI exist." ;
	era:rinfIndex "1.1.1.3.2.6" ;
	sh:path era:hasETCSRestrictionsConditions ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "hasETCSRestrictionsConditions (1.1.1.3.2.6): The track has at most one value of the indication whether restrictions or conditions due to partial compliance with the CCS TSI exist and the value 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 .

# trainIntegrityOnBoardRequired: # 1.1.1.3.2.8
era-sh:trackShape sh:property era-sh:TrainIntegrityOnBoardRequired.
era-sh:TrainIntegrityOnBoardRequired
	a sh:PropertyShape ; era:affectedProperty era:trainIntegrityOnBoardRequired ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication whether TIMS is required to access the line for safety reasons." ;
	era:rinfIndex "1.1.1.3.2.8" ;
	sh:path era:trainIntegrityOnBoardRequired ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "trainIntegrityOnBoardRequired (1.1.1.3.2.8): The track has at most one value of the indication whether TIMS is required to access the line for safety reasons and the vaalue 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 .

# etcsSystemCompatibility: # 1.1.1.3.2.9
era-sh:trackShape sh:property era-sh:EtcsSystemCompatibility.
era-sh:EtcsSystemCompatibility
	a sh:PropertyShape ; era:affectedProperty era:etcsSystemCompatibility  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "ETCS requirements used for demonstrating technical compatibility." ;
	era:rinfIndex "1.1.1.3.2.9" ;
	sh:path era:etcsSystemCompatibility ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "etcsSystemCompatibility (1.1.1.3.2.9): The track defines at most one value of the requirements of the ETCS system compatibility and the value is an IRI. This error is due to the track having more than one value."@en .

# etcsSystemCompatibility: # 1.1.1.3.2.9
era-sh:trackShape sh:sparql era-sh:EtcsSystemCompatibilitySKOS.
era-sh:EtcsSystemCompatibilitySKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsSystemCompatibility  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "ETCS requirements used for demonstrating technical compatibility." ;
	era:rinfIndex "1.1.1.3.2.9" ;
	sh:severity sh:Violation ;
    sh:message "Indication of the etcsSystemCompatibility (1.1.1.3.2.9):): 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/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
    WHERE {
        $this era:etcsSystemCompatibility ?concept .
        era:etcsSystemCompatibility era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .



# etcsMVersion: # 1.1.1.3.2.10
era-sh:trackShape sh:property era-sh:EtcsMVersion.
era-sh:EtcsMVersion
	a sh:PropertyShape ; era:affectedProperty era:etcsMVersion  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "ETCS_M version according to SRS 7.5.1.9" ;
	era:rinfIndex "1.1.1.3.2.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): The track has at most one ETCS_M version value and it must be an IRI. This error is due to the track having more than one value."@en .

# etcsMVersion: # 1.1.1.3.2.10
era-sh:trackShape sh:sparql era-sh:EtcsMVersionSKOS.
era-sh:EtcsMVersionSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsMVersion  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "ETCS_M version according to SRS 7.5.1.9" ;
	era:rinfIndex "1.1.1.3.2.10" ;
	sh:severity sh:Violation ;
    sh:message "Indication of the etcsMVersion (1.1.1.3.2.101.1.1.3.2.10):): 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/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
    WHERE {
        $this era:etcsMVersion ?concept .
        era:etcsMVersion era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# gsmRVersion: # 1.1.1.3.3.1
era-sh:trackShape sh:sparql era-sh:GsmRVersionSKOS.
era-sh:GsmRVersionSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:gsmRVersion  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "GSM-R version installed lineside" ;
	era:rinfIndex "1.1.1.3.2.10" ;
	sh:severity sh:Violation ;
    sh:message "Indication of the gsmRVersion (1.1.1.3.2.10): 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/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
    WHERE {
        $this era:gsmRVersion ?concept .
        era:gsmRVersion era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .



# gsmRActiveMobiles: # 1.1.1.3.3.2
era-sh:trackShape sh:property era-sh:GsmRActiveMobiles.
era-sh:GsmRActiveMobiles
	a sh:PropertyShape ; era:affectedProperty era:gsmRActiveMobiles  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Number of active mobiles in GSM-R network" ;
	era:rinfIndex "1.1.1.3.3.2" ;
	sh:path era:gsmRActiveMobiles ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:maxCount 1 ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "gsmRActiveMobiles (1.1.1.3.3.2): The track has at most a number of active mobiles in GSM-R network value and it is an IRI. This error may be due to the track having more than one value."@en .

# gsmRActiveMobiles: # 1.1.1.3.3.2
era-sh:trackShape sh:sparql era-sh:GsmRActiveMobilesSKOS.
era-sh:GsmRActiveMobilesSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:gsmRActiveMobiles  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Number of active mobiles in GSM-R network" ;
	era:rinfIndex "1.1.1.3.3.2" ;
	sh:severity sh:Violation ;
    sh:message "Indication of the gsmRActiveMobiles (1.1.1.3.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/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
    WHERE {
        $this era:gsmRActiveMobiles ?concept .
        era:gsmRActiveMobiles era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .


# gsmROptionalFunctions: # 1.1.1.3.3.3
era-sh:trackShape sh:sparql era-sh:GsmROptionalFunctionsSKOS.
era-sh:GsmROptionalFunctionsSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:gsmROptionalFunctions  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    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." ;
	era:rinfIndex "1.1.1.3.3.3" ;
	sh:severity sh:Violation ;
    sh:message "Indication of the gsmROptionalFunctions (1.1.1.3.3.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/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
    WHERE {
        $this era:gsmROptionalFunctions ?concept .
        era:gsmROptionalFunctions era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .


# gsmRAdditionalInfo: # 1.1.1.3.3.3.1
era-sh:trackShape sh:property era-sh:GsmRAdditionalInfo.
era-sh:GsmRAdditionalInfo
	a sh:PropertyShape ; era:affectedProperty era:gsmRAdditionalInfo  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Additional information on network characteristics." ;
	era:rinfIndex "1.1.1.3.3.3.1" ;
	sh:path era:gsmRAdditionalInfo ;
#	#sh:minCount 0 ; #TODO: Not yet applicable
	#sh:datatype xsd:string ;
    sh:class era:Document;
	sh:severity sh:Violation ;
	sh:message "gsmRAdditionalInfo (1.1.1.3.3.3.1): The track defines an additional information on network characteristics value that must be a Document."@en .

# gprsForETCS: # 1.1.1.3.3.3.2
era-sh:trackShape sh:property era-sh:GprsForETCS.
era-sh:GprsForETCS
	a sh:PropertyShape ; era:affectedProperty era:gprsForETCS  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication if GPRS can be used for ETCS." ;
	era:rinfIndex "1.1.1.3.3.3.2" ;
	sh:path era:gprsForETCS ;
#	#sh:minCount 0 ; #TODO: Not yet applicable
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "gprsForETCS (1.1.1.3.3.3.2): The track must define at most one  use of GPRS for ETCS value that 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 .

# gprsImplementationArea: # 1.1.1.3.3.3.3
era-sh:trackShape sh:property era-sh:GprsImplementationArea.
era-sh:GprsImplementationArea
	a sh:PropertyShape ; era:affectedProperty era:gprsImplementationArea  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the area in which GPRS can be used for ETCS." ;
	era:rinfIndex "1.1.1.3.3.3.3" ;
	sh:path era:gprsImplementationArea ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:datatype xsd:string ;
	sh:severity sh:Violation ;
	sh:message "gprsImplementationArea (1.1.1.3.3.3.3): The track defines the area in which GPRS can be used for ETCS value that must be a string. This error may be due to the track having  a value that is not a string."@en .

# usesGroup555: # 1.1.1.3.3.4
era-sh:trackShape sh:property era-sh:UsesGroup555.
era-sh:UsesGroup555
	a sh:PropertyShape ; era:affectedProperty era:usesGroup555  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication if group 555 is needed." ;
	era:rinfIndex "1.1.1.3.3.4" ;
	sh:path era:usesGroup555 ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "usesGroup555 (1.1.1.3.3.3.4): The track defines at most one use of group 555 value that 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 .

# gsmrNetworkCoverage: # 1.1.1.3.3.5
era-sh:trackShape sh:sparql era-sh:GsmrNetworkCoverageSKOS.
era-sh:GsmrNetworkCoverageSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:gsmrNetworkCoverage  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Name of the own GSM-R network and list of GSM-R networks which are covered by a roaming agreement (for CS services)." ;
	era:rinfIndex "1.1.1.3.3.5" ;
	sh:severity sh:Violation ;
    sh:message "Indication of the gsmrNetworkCoverage (1.1.1.3.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/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
    WHERE {
        $this era:gsmrNetworkCoverage ?concept .
        era:gsmrNetworkCoverage era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .



# publicNetworkRoaming: # 1.1.1.3.3.6
era-sh:trackShape sh:property era-sh:PublicNetworkRoaming.
era-sh:PublicNetworkRoaming
	a sh:PropertyShape ; era:affectedProperty era:publicNetworkRoaming  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Existence of roaming to a public network (if roaming to a public network is configured, please indicate so)." ;
	era:rinfIndex "1.1.1.3.3.6" ;
	sh:path era:publicNetworkRoaming ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "publicNetworkRoaming (1.1.1.3.3.6): The track has at most one existence of roaming to a public network value 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 .

# publicNetworkRoamingDetails: # 1.1.1.3.3.7
era-sh:trackShape sh:property era-sh:PublicNetworkRoamingDetails.
era-sh:PublicNetworkRoamingDetails
	a sh:PropertyShape ; era:affectedProperty era:publicNetworkRoamingDetails ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "If roaming to public networks is configured, please indicate to which networks, for which users and in which areas." ;
	era:rinfIndex "1.1.1.3.3.7" ;
	sh:path era:publicNetworkRoamingDetails ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:maxCount 1 ;
	sh:datatype xsd:string ;
	sh:severity sh:Violation ;
	sh:message "publicNetworkRoamingDetails (1.1.1.3.3.7): The track has at most one existence of roaming to a public network value and it is a string. This error may be due to the track having more than one value or to having a value that is not a string."@en .

# gsmRNoCoverage: # 1.1.1.3.3.8
era-sh:trackShape sh:property era-sh:GsmRNoCoverage.
era-sh:GsmRNoCoverage
	a sh:PropertyShape ; era:affectedProperty era:gsmRNoCoverage  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication if there is a no GSM-R coverage." ;
	era:rinfIndex "1.1.1.3.3.8" ;
	sh:path era:gsmRNoCoverage ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "gsmRNoCoverage (1.1.1.3.3.8): The track has at most one indication if there is a no GSM-R coverage value 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 .

# voiceRadioCompatible: # 1.1.1.3.3.9
era-sh:trackShape sh:sparql era-sh:VoiceRadioCompatibleSKOS.
era-sh:VoiceRadioCompatibleSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:voiceRadioCompatible  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Radio requirements used for demonstrating technical compatibility voice." ;
	era:rinfIndex "1.1.1.3.3.9" ;
	sh:severity sh:Violation ;
    sh:message "Indication of the voiceRadioCompatible (1.1.1.3.3.9): 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/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
    WHERE {
        $this era:voiceRadioCompatible ?concept .
        era:voiceRadioCompatible era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .



# dataRadioCompatible: # 1.1.1.3.3.10
era-sh:trackShape sh:sparql era-sh:DataRadioCompatibleSKOS.
era-sh:DataRadioCompatibleSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:dataRadioCompatible  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Radio requirements used for demonstrating technical compatibility data." ;
	era:rinfIndex "1.1.1.3.3.10" ;
	sh:severity sh:Violation ;
    sh:message "Indication of the dataRadioCompatible (1.1.1.3.3.10): 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/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
    WHERE {
        $this era:dataRadioCompatible ?concept .
        era:dataRadioCompatible era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .



# hasTSITrainDetection: # 1.1.1.3.4.1
era-sh:trackShape sh:property era-sh:HasTSITrainDetection.
era-sh:HasTSITrainDetection
	a sh:PropertyShape ; era:affectedProperty era:hasTSITrainDetection  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication if there is any train detection system installed and fully compilant with the CCS TSI requirements." ;
	era:rinfIndex "1.1.1.3.4.1" ;
	sh:path era:hasTSITrainDetection ;
	##sh:minCount 0 ;	#TODO: Not yet applicable
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "hasTSITrainDetection (1.1.1.3.4.1): The track has at most one value of the indication if there is any train detection system installed and fully compilant with the CCS TSI requirements and the value 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 .


# protectionLegacySystem: # 1.1.1.3.5.3
era-sh:trackShape sh:sparql era-sh:ProtectionLegacySystemSKOS.
era-sh:ProtectionLegacySystemSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:protectionLegacySystem  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Indication of which class B system is installed." ;
	era:rinfIndex "1.1.1.3.5.3" ;
	sh:severity sh:Violation ;
    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
    WHERE {
        $this era:protectionLegacySystem ?concept .
        era:protectionLegacySystem era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .


# frenchTrainDetectionSystemLimitationNumber: # 1.1.1.3.7.1.4
era-sh:trackShape sh:sparql era-sh:FrenchTrainDetectionSystemLimitationNumberSKOS.
era-sh:FrenchTrainDetectionSystemLimitationNumberSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:frenchTrainDetectionSystemLimitationNumber  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Section with train detection limitation." ;
	era:rinfIndex "1.1.1.3.7.1.4" ;
	sh:severity sh:Violation ;
    sh:message "Indication of the frenchTrainDetectionSystemLimitationNumber (1.1.1.3.7.1.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:   ttp://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
    WHERE {
        $this era:frenchTrainDetectionSystemLimitationNumber ?concept .
        era:frenchTrainDetectionSystemLimitationNumber era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .



# switchProtectControlWarning: # 1.1.1.3.8.1
era-sh:trackShape sh:property era-sh:SwitchProtectControlWarning.
era-sh:SwitchProtectControlWarning
	a sh:PropertyShape ; era:affectedProperty era:switchProtectControlWarning  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication whether a switch over between different systems whilst running exist." ;
	era:rinfIndex "1.1.1.3.8.1" ;
	sh:path era:switchProtectControlWarning ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "switchProtectControlWarning (1.1.1.3.8.1): The track must define at most one value of the indication whether a switch over between different systems whilst running exist and the value 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 .

# switchRadioSystem: # 1.1.1.3.8.2
era-sh:trackShape sh:property era-sh:SwitchRadioSystem.
era-sh:SwitchRadioSystem
	a sh:PropertyShape ; era:affectedProperty era:switchRadioSystem  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication whether a switch over between different radio systems and no communication system whilst running exist." ;
	era:rinfIndex "1.1.1.3.8.2" ;
	sh:path era:switchRadioSystem ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "switchRadioSystem (1.1.1.3.8.2): The track must define at most one value of the indication whether a switch over between different radio systems and no communication system whilst running exist, and the value 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 .

# TSIMagneticFields: # 1.1.1.3.9.1
era-sh:trackShape sh:property era-sh:TSIMagneticFields.
era-sh:TSIMagneticFields
	a sh:PropertyShape ; era:affectedProperty  era:TSIMagneticFields  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the magnetic fields of the TSI." ;
	era:rinfIndex "1.1.1.3.9.1" ;
	sh:path era:TSIMagneticFields ;
	sh:maxCount 1 ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "TSIMagneticFields (1.1.1.3.9.1): The track defines at most one value of the indication of the magnetic fields of the TSI and it is an IRI. This error may be due to the track having more than one value."@en .

# TSIMagneticFields: # 1.1.1.3.9.1
era-sh:trackShape sh:sparql era-sh:TSIMagneticFieldsSKOS.
era-sh:TSIMagneticFieldsSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty  era:TSIMagneticFields  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Indication of the magnetic fields of the TSI." ;
	era:rinfIndex "1.1.1.3.9.1" ;
	sh:severity sh:Violation ;
    sh:message "Indication of the TSIMagneticFields (1.1.1.3.9.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/tsi-existence-and-compliances/TSIExistenceAndCompliances."@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
    WHERE {
        $this era:TSIMagneticFields ?concept .
        era:TSIMagneticFields era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .



# TSITractionHarmonics: # 1.1.1.3.9.2
era-sh:trackShape sh:property era-sh:TSITractionHarmonics.
era-sh:TSITractionHarmonics
	a sh:PropertyShape ; era:affectedProperty era:TSITractionHarmonics  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of the traction harmonics of the TSI." ;
	era:rinfIndex "1.1.1.3.9.2" ;
	sh:path era:TSITractionHarmonics ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:maxCount 1 ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "TSITractionHarmonics (1.1.1.3.9.2): The track must define at most one value of the indication of the traction harmonics of the TSI. This error may be due to the track having more than one value."@en .

# TSITractionHarmonics: # 1.1.1.3.9.2
era-sh:trackShape sh:sparql era-sh:TSITractionHarmonicsSKOS.
era-sh:TSITractionHarmonicsSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:TSITractionHarmonics  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Indication of the traction harmonics of the TSI." ;
	era:rinfIndex "1.1.1.3.9.2" ;
	sh:severity sh:Violation ;
    sh:message "Indication of the TSITractionHarmonics (1.1.1.3.9.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/tsi-existence-and-compliances/TSIExistenceAndCompliances."@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
    WHERE {
        $this era:TSITractionHarmonics ?concept .
        era:TSITractionHarmonics era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# etcsDegradedSituation: # 1.1.1.3.10.1
era-sh:trackShape sh:sparql era-sh:EtcsDegradedSituationSKOS.
era-sh:EtcsDegradedSituationSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:etcsDegradedSituation  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "ERTMS/ ETCS application level for degraded situation related to the track side equipment." ;
	era:rinfIndex "1.1.1.3.10.1" ;
	sh:severity sh:Violation ;
    sh:message "Indication of the etcsDegradedSituation (1.1.1.3.10.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/tsi-existence-and-compliances/TSIExistenceAndCompliances."@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
    WHERE {
        $this era:etcsDegradedSituation ?concept .
        era:etcsDegradedSituation era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .


# otherTrainProtection: # 1.1.1.3.10.2
era-sh:trackShape sh:property era-sh:OtherTrainProtection.
era-sh:OtherTrainProtection
	a sh:PropertyShape ; era:affectedProperty era:otherTrainProtection  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of existence of other systems than ETCS for degraded situation." ;
	era:rinfIndex "1.1.1.3.10.2" ;
	sh:path era:otherTrainProtection ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:maxCount 1 ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "otherTrainProtection (1.1.1.3.10.2): The track must define at most one value of the indication of existence of other systems than ETCS for degraded situation and it is an IRI. This error may be due to the track having more than one value."@en .

# otherTrainProtection: # 1.1.1.3.10.2
era-sh:trackShape sh:sparql era-sh:OtherTrainProtectionSKOS.
era-sh:OtherTrainProtectionSKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:otherTrainProtection  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
   rdfs:comment "Indication of existence of other systems than ETCS for degraded situation." ;
	era:rinfIndex "1.1.1.3.10.2" ;
	sh:severity sh:Violation ;
    sh:message "Indication of the otherTrainProtection (1.1.1.3.10.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-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
    WHERE {
        $this era:otherTrainProtection ?concept .
        era:otherTrainProtection era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .



# maximumBrakingDistance: # 1.1.1.3.11.1
era-sh:trackShape sh:property era-sh:MaximumBrakingDistance.
era-sh:MaximumBrakingDistance
	a sh:PropertyShape ; era:affectedProperty era:maximumBrakingDistance  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "The maximum value of the braking distance [in metres] of a train shall be given for the maximum line speed." ;
	era:rinfIndex "1.1.1.3.11.1" ;
	sh:path era:maximumBrakingDistance ;
#	#sh:minCount 0 ; #TODO: Not yet applicable
	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:trackShape sh:property era-sh:HasAdditionalBrakingInformation.
era-sh:HasAdditionalBrakingInformation
	a sh:PropertyShape ; era:affectedProperty era:hasAdditionalBrakingInformation  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Availability by the IM of additional information as defined in 4.2.2.6.2 (2) Regulation XXX-OPE TSI." ;
	era:rinfIndex "1.1.1.3.11.2" ;
	sh:path era:hasAdditionalBrakingInformation ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	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:trackShape sh:property era-sh:AdditionalBrakingInformationDocument.
era-sh:AdditionalBrakingInformationDocument
	a sh:PropertyShape ; era:affectedProperty era:additionalBrakingInformationDocument  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Documents available by the IM relating to braking performance." ;
	era:rinfIndex "1.1.1.3.11.3" ;
	sh:path era:additionalBrakingInformationDocument ;	
	##sh:minCount 0 ; #TODO: Not yet applicable
	#sh:datatype xsd:string ;
    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 .

# tiltingSupported: # 1.1.1.3.12.1
era-sh:trackShape sh:property era-sh:TiltingSupported.
era-sh:TiltingSupported
	a sh:PropertyShape ; era:affectedProperty era:tiltingSupported  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication whether tilting functions are supported by the track." ;
	era:rinfIndex "1.1.1.3.12.1" ;
	sh:path era:tiltingSupported ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "tiltingSupported (1.1.1.3.12.1): The track must define at most one value of the indication whether tilting functions are supported by the track 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 .

# localRulesOrRestrictions: # 1.1.1.4.1
era-sh:trackShape sh:property era-sh:LocalRulesOrRestrictions.
era-sh:LocalRulesOrRestrictions
	a sh:PropertyShape ; era:affectedProperty era:localRulesOrRestrictions  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Existence of rules and restrictions of a strictly local nature." ;
	era:rinfIndex "1.1.1.4.1" ;
	sh:path era:localRulesOrRestrictions ;
#	#sh:minCount 0 ; #TODO: Not yet applicable
	sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "localRulesOrRestrictions (1.1.1.4.1): The track must define t most one value of the existence of rules and restrictions of a strictly local nature and it 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 .

# localRulesOrRestrictionsDoc: # 1.1.1.4.2
era-sh:trackShape sh:property era-sh:LocalRulesOrRestrictionsDoc.
era-sh:LocalRulesOrRestrictionsDoc
	a sh:PropertyShape ; era:affectedProperty era:localRulesOrRestrictionsDoc  ;     era:affectedClass  era:Track;     era:scope "local";     era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Documents regarding the rules or restrictions of a strictly local nature available by the IM." ;
	era:rinfIndex "1.1.1.4.2" ;
	sh:path era:localRulesOrRestrictionsDoc ;
#	#sh:minCount 0 ; #TODO: Not yet applicable
	#sh:datatype xsd:string ;
    sh:class era:Document;
	sh:severity sh:Violation ;
	sh:message "localRulesOrRestrictionsDoc (1.1.1.4.2): The track defines the value of the documents regarding the rules or restrictions of a strictly local nature available by the IM and this value must be a Document."@en .





@prefix era-sh: <http://data.europa.eu/949/shapes/> .
@prefix ex: <http://example.org/ns#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix era: <http://data.europa.eu/949/> .
@prefix era-sn: <http://data.europa.eu/949/concepts/sol-natures/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix wgs: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix geosparql: <http://www.opengis.net/ont/geosparql#> .
@prefix era-ph: <http://data.europa.eu/949/concepts/platform-heights/> .
@prefix era-tenclass: <http://data.europa.eu/949/concepts/ten-classifications/> .
@prefix era-gaugings: <http://data.europa.eu/949/concepts/gaugings/> .
@prefix era-ntg: <http://data.europa.eu/949/concepts/nominal-track-gauges/> .
@prefix era-tds: <http://data.europa.eu/949/concepts/train-detection/> .
@prefix era-tdssc: <http://data.europa.eu/949/concepts/train-detection-specific-checks/> .
@prefix era-tsi: <http://data.europa.eu/949/concepts/tsi-compliances/> .
@prefix era-malvc: <http://data.europa.eu/949/concepts/min-axle-loads-per-vehicle-category/> .
@prefix era-mas: <http://data.europa.eu/949/concepts/max-amount-sandings/> .

#############################
# Rules for train detection system
#############################

era-sh:TrainDetectionSystemShape
	a sh:NodeShape ;
	sh:targetClass era:TrainDetectionSystem .    # Applies to all TrainDetectionSystem instances

# trainDetectionSystemType: # 1.1.1.3.7.1.1
era-sh:trackShape sh:property era-sh:TrainDetectionSystemType.
era-sh:TrainDetectionSystemType
	a sh:PropertyShape ;     era:affectedProperty era:trainDetectionSystemType;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of types of train detection system installed." ;
	era:rinfIndex "1.1.1.3.7.1.1" ;
	sh:path era:trainDetectionSystemType ;
	## sh:minCount 0 ; #TODO: Not yet applicable
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "trainDetectionSystem (1.1.1.3.7.1.1): The track must define the indication of types of train detection system installed."@en .

# trainDetectionSystemType: # 1.1.1.3.7.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"; era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of types of train detection system installed." ;
	era:rinfIndex "1.1.1.3.7.1.1" ;
	sh:severity sh:Violation ;
	sh:message "Indication of types of train detection system installed (1.1.1.3.7.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
    WHERE {
        OPTIONAL {$this rdfs:label ?tdsLabel} .
        $this era:trainDetectionSystemType ?concept .
        era:trainDetectionSystemType era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .

# trainDetectionSystemSpecificCheck: # 1.1.1.3.7.1.2
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"; era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of types of train detection system to which specific checks are needed." ;
	era:rinfIndex "1.1.1.3.7.1.2" ;
	sh:path era:trainDetectionSystemSpecificCheck ;
	 sh:minCount 0 ; # TODO: Not yet applicable
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "trainDetectionSystemSpecificCheck (1.1.1.3.7.1.2): Indication of types of train detection system to which specific checks are needed."@en .

# trainDetectionSystemSpecificCheck: # 1.1.1.3.7.1.2
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"; era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of types of train detection system to which specific checks are needed." ;
	era:rinfIndex "1.1.1.3.7.1.2" ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "Indication of types of train detection system to which specific checks are needed (1.1.1.3.7.1.2): 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/TrainDetectionSystemsSpecificChecks."@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 ?tdsLabel
    WHERE {
        OPTIONAL {$this rdfs:label ?tdsLabel} .
        $this era:trainDetectionSystemSpecificCheck ?concept .
        era:trainDetectionSystemSpecificCheck era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .


# trainDetectionSystemSpecificCheckDocument: # 1.1.1.3.7.1.3
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"; era:validationAfterXML "false"^^xsd:boolean;
	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." ;
	era:rinfIndex "1.1.1.3.7.1.3" ;
	sh:path era:trainDetectionSystemSpecificCheckDocument ;
	### sh:minCount 0 ; #TODO: Not yet applicable
	#sh:class era:Document; Commented, pending fix in mappings 
	sh:severity sh:Violation ;
	sh:message "trainDetectionSystemSpecificCheckDocument (1.1.1.3.7.1.3): The track defines the electronic document available in two EU languages value and it must be a Document."@en .


# maxDistConsecutiveAxles: # 1.1.1.3.7.2.2  Parameter no longer in RINF regulation
era-sh:TrainDetectionSystemShape sh:property era-sh:maxDistConsecutiveAxles .
era-sh:maxDistConsecutiveAxles
	a sh:PropertyShape ;     era:affectedProperty era:maxDistConsecutiveAxles;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "true"^^xsd:boolean;
	rdfs:comment "Indication of maximum permitted distance between two consecutive axles in case of TSI non-compliance, given millimetres." ;
	era:rinfIndex "1.1.1.3.7.2.2" ;
	sh:path era:maxDistConsecutiveAxles ;
    sh:maxCount 0 ;
	# sh:minCount 0 ; # TODO: Not yet applicable
	sh:severity sh:Violation ;
	sh:message "maxDistConsecutiveAxles (1.1.1.3.7.2.2): The parameter was deprecated, and its provision is no longer accepted. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_MaxDistConsecutiveAxles."@en .

# minDistConsecutiveAxles: # 1.1.1.3.7.3 Parameter no longer in RINF regulation
era-sh:TrainDetectionSystemShape sh:property era-sh:minDistConsecutiveAxles .
era-sh:minDistConsecutiveAxles
	a sh:PropertyShape ;     era:affectedProperty era:minDistConsecutiveAxles;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "true"^^xsd:boolean;
	rdfs:comment "Indication of minimum permitted distance between two consecutive axles, given millimetres." ;
	era:rinfIndex "1.1.1.3.7.3" ;
	sh:path era:minDistConsecutiveAxles ;
    sh:maxCount 0 ;
	# sh:minCount 0 ; # TODO: Not yet applicable
	sh:severity sh:Violation ;
	sh:message "minDistConsecutiveAxles (1.1.1.3.7.3): The parameter was deprecated, and its provision is no longer accepted. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_MinDistConsecutiveAxles."@en .

# minDistFirstLastAxle: # 1.1.1.3.7.4 Parameter no longer in RINF regulation
era-sh:TrainDetectionSystemShape sh:property era-sh:minDistFirstLastAxle .
era-sh:minDistFirstLastAxle
	a sh:PropertyShape ;     era:affectedProperty era:minDistFirstLastAxle;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of minimum permitted distance between the first and last axles, given millimetres." ;
	era:rinfIndex "1.1.1.3.7.4" ;
	sh:path era:minDistFirstLastAxle ;
    sh:maxCount 0 ;
	# sh:minCount 0 ; # TODO: Not yet applicable
	sh:severity sh:Violation ;
	sh:message "minDistFirstLastAxle (1.1.1.3.7.4): The parameter was deprecated, and its provision is no longer accepted. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_MinDistFirstLastAxles."@en .

# maxDistEndTrainFirstAxle: # 1.1.1.3.7.5 Parameter no longer in RINF regulation
era-sh:TrainDetectionSystemShape sh:property era-sh:maxDistEndTrainFirstAxle .
era-sh:maxDistEndTrainFirstAxle
	a sh:PropertyShape ;     era:affectedProperty era:maxDistEndTrainFirstAxle;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "true"^^xsd:boolean;
	rdfs:comment "Indication of maximum permitted distance between the end of the train and the first axle, given millimetres." ;
	era:rinfIndex "1.1.1.3.7.5" ;
	sh:path era:maxDistEndTrainFirstAxle ;
    sh:maxCount 0 ;
	# sh:minCount 0 ; # TODO: Not yet applicable
	sh:severity sh:Violation ;
	sh:message "maxDistFirstLastAxle (1.1.1.3.7.5): The parameter was deprecated, and its provision is no longer accepted. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_MaxDistEndTrainFirstAxle."@en.

# minRimWidth: # 1.1.1.3.7.6 Parameter no longer in RINF regulation
era-sh:TrainDetectionSystemShape sh:property era-sh:minRimWidth .
era-sh:minRimWidth
	a sh:PropertyShape ;     era:affectedProperty era:minRimWidth;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "true"^^xsd:boolean;
	rdfs:comment "Indication of minimum permitted rim width, given millimetres." ;
	era:rinfIndex "1.1.1.3.7.6" ;
	sh:path era:minRimWidth ;
    sh:maxCount 0 ;
	# sh:minCount 0 ; # TODO: Not yet applicable
	sh:severity sh:Violation ;
	sh:message "minRimWidth (1.1.1.3.7.6): The parameter was deprecated, and its provision is no longer accepted. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_MinRimWidth."@en .
	
# minWheelDiameter: # 1.1.1.3.7.7 Parameter no longer in RINF regulation
era-sh:TrainDetectionSystemShape sh:property era-sh:minWheelDiameter .
era-sh:minWheelDiameter
	a sh:PropertyShape ;     era:affectedProperty era:minWheelDiameter;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "true"^^xsd:boolean;
	rdfs:comment "Indication of minimum permitted wheel diameter, given millimetres." ;
	era:rinfIndex "1.1.1.3.7.7" ;
	sh:path era:minWheelDiameter ;
    sh:maxCount 0 ;
	# sh:minCount 0 ; # TODO: Not yet applicable
	sh:severity sh:Violation ;
	sh:message "minWheelDiameter (1.1.1.3.7.7): The parameter was deprecated, and its provision is no longer accepted. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_MinWheelDiameter."@en .

## minFlangeThickness: # 1.1.1.3.7.8 Parameter no longer in RINF regulation
era-sh:TrainDetectionSystemShape sh:property era-sh:minFlangeThickness .
era-sh:minFlangeThickness
	a sh:PropertyShape ;     era:affectedProperty era:minFlangeThickness;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "true"^^xsd:boolean;
	rdfs:comment "Indication of minimum permitted flange thickness, given millimetres." ;
	era:rinfIndex "1.1.1.3.7.8" ;
	sh:path era:minFlangeThickness ;
    sh:maxCount 0 ;
	# sh:minCount 0 ; # TODO: Not yet applicable
	sh:severity sh:Violation ;
	sh:message "minFlangeThickness (1.1.1.3.7.8): The parameter was deprecated, and its provision is no longer accepted. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_MinFlangeThickness."@en .

# minFlangeHeight: # 1.1.1.3.7.9 Parameter no longer in RINF regulation
era-sh:TrainDetectionSystemShape sh:property era-sh:minFlangeHeight .
era-sh:minFlangeHeight
	a sh:PropertyShape ;     era:affectedProperty era:minFlangeHeight;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "true"^^xsd:boolean;
	rdfs:comment "Indication of minimum permitted flange height, given millimetres." ;
	era:rinfIndex "1.1.1.7.9" ;
	sh:path era:minFlangeHeight ;
    sh:maxCount 0 ;
	# sh:minCount 0 ; # TODO: Not yet applicable
	sh:pattern "^([1-9]{0,1}[0-9]\\.[0-9])$" ;
	sh:severity sh:Violation ;
	sh:message "minFlangeHeight (1.1.1.7.9): The parameter was deprecated, and its provision is no longer accepted. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_MinFlangeHeight."@en .

# maxFlangeHeight: # 1.1.1.3.7.10 Parameter no longer in RINF regulation
era-sh:TrainDetectionSystemShape sh:property era-sh:maxFlangeHeight .
era-sh:maxFlangeHeight
	a sh:PropertyShape ;     era:affectedProperty era:maxFlangeHeight;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "true"^^xsd:boolean;
	rdfs:comment "Indication of maximum permitted flange height, given millimetres." ;
	era:rinfIndex "1.1.1.3.7.10" ;
	sh:path era:maxFlangeHeight ;
    sh:maxCount 0 ;
	# sh:minCount 0 ; # TODO: Not yet applicable
	sh:severity sh:Violation ;
	sh:message "maxFlangeHeight (1.1.1.3.7.10): The parameter was deprecated, and its provision is no longer accepted. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_MaxFlangeHeight."@en .

# minAxleLoad: # 1.1.1.3.7.11.1 Parameter no longer in RINF regulation
 era-sh:TrainDetectionSystemShape sh:property era-sh:minAxleLoad.
 era-sh:minAxleLoad
	a sh:PropertyShape ;     era:affectedProperty  era:minAxleLoad;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "true"^^xsd:boolean;
    era:affectedClass era:MinAxleLoadVehicleCategory;
	rdfs:comment "Represents information that indicates the load given in tons depending of the category of vehicle. Its properties are minAxleLoadVehicleCategory and minAxleLoad. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_MaxDistConsecutiveAxles.";
	era:rinfIndex "1.1.1.3.7.11.1" ;
	sh:path (era:tdsMinAxleLoadVehicleCategory era:minAxleLoad) ;
    sh:maxCount 0 ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:severity sh:Violation ;
	sh:message "Minimum permitted axle load per category of vehicle (1.1.1.3.7.11.1): The parameter was deprecated, and its provision is no longer accepted. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_MinAxleLoadByVehicleCat."@en .

# minAxleLoad: # 1.1.1.3.7.11.1 Parameter no longer in RINF regulation
 era-sh:TrainDetectionSystemShape sh:property era-sh:minAxleLoadVehicleCategory.
 era-sh:minAxleLoadVehicleCategory
	a sh:PropertyShape ;     era:affectedProperty era:minAxleLoadVehicleCategory;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "true"^^xsd:boolean;
    era:affectedClass era:MinAxleLoadVehicleCategory;
	rdfs:comment "Represents information that indicates the load given in tons depending of the category of vehicle. Its properties are minAxleLoadVehicleCategory and minAxleLoad.";
	era:rinfIndex "1.1.1.3.7.11.1" ;
	sh:path (era:tdsMinAxleLoadVehicleCategory era:minAxleLoadVehicleCategory) ;
    sh:maxCount 0 ;
	##sh:minCount 0 ; #TODO: Not yet applicable
	sh:severity sh:Violation ;
	sh:message "Minimum permitted axle load per category of vehicle (1.1.1.3.7.11.1): The parameter was deprecated, and its provision is no longer accepted. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_MinAxleLoadByVehicleCat."@en .



    
 


# tsiCompliantMetalFreeSpace: # 1.1.1.3.7.12 Parameter no longer in RINF regulation
era-sh:TrainDetectionSystemShape sh:property era-sh:tsiCompliantMetalFreeSpace .
era-sh:tsiCompliantMetalFreeSpace
	a sh:PropertyShape ;     era:affectedProperty era:tsiCompliantMetalFreeSpace;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of whether the rules are TSI compliant for metal free space around wheels." ;
	era:rinfIndex "1.1.1.3.7.12" ;
	sh:path era:tsiCompliantMetalFreeSpace ;
    sh:maxCount 0 ;
	sh:severity sh:Violation ;
	sh:message "tsiCompliantMetalFreeSpace (1.1.1.3.7.12): The parameter was deprecated, and its provision is no longer accepted. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_TSIMetalFree."@en .


# tsiCompliantMetalConstruction: # 1.1.1.3.7.13 Parameter no longer in RINF regulation
era-sh:TrainDetectionSystemShape sh:property era-sh:tsiCompliantMetalConstruction .
era-sh:tsiCompliantMetalConstruction
	a sh:PropertyShape ;     era:affectedProperty era:tsiCompliantMetalConstruction;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of whether the rules are TSI compliant for vehicle metal construction." ;
	era:rinfIndex "1.1.1.3.7.13" ;
	sh:path era:tsiCompliantMetalConstruction ;
    sh:maxCount 0 ;
	sh:severity sh:Violation ;
	sh:message "tsiCompliantMetalConstruction (1.1.1.3.7.13): The parameter was deprecated, and its provision is no longer accepted. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_TSIMetalConstruction."@en .




#  tsiCompliantFerromagneticWheel: # 1.1.1.3.7.14 Parameter no longer in RINF regulation
era-sh:TrainDetectionSystemShape sh:property era-sh:tsiCompliantFerromagneticWheel .
era-sh:tsiCompliantFerromagneticWheel
	a sh:PropertyShape ;     era:affectedProperty era:tsiCompliantFerromagneticWheel;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of whether the rules are TSI compliant for ferromagnetic characteristics of wheel material required." ;
	era:rinfIndex "1.1.1.3.7.14" ;
	sh:path era:tsiCompliantFerromagneticWheel ;
	sh:maxCount 0 ;
	sh:severity sh:Violation ;
	sh:message "tsiCompliantFerromagneticWheel (1.1.1.3.7.14): The parameter was deprecated, and its provision is no longer accepted. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_TSIFerroWheelMat."@en .



# tsiCompliantMaxImpedanceWheelset: # 1.1.1.3.7.15.1 Parameter no longer in RINF regulation
era-sh:TrainDetectionSystemShape sh:property era-sh:tsiCompliantMaxImpedanceWheelset .
era-sh:tsiCompliantMaxImpedanceWheelset
	a sh:PropertyShape ;     era:affectedProperty era:tsiCompliantMaxImpedanceWheelset;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of whether the rules are TSI compliant for maximum impedance between opposite wheels of a wheelset." ;
	era:rinfIndex "1.1.1.3.7.15.1" ;
	sh:path era:tsiCompliantMaxImpedanceWheelset ;
	sh:maxCount 0 ;
	sh:severity sh:Violation ;
	sh:message "tsiCompliantMaxImpedanceWheelset (1.1.1.3.7.15.1): The parameter was deprecated, and its provision is no longer accepted. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_TSIMaxImpedanceWheelset."@en .




# maxImpedanceWheelset: # 1.1.1.3.7.15.2 Parameter no longer in RINF regulation
era-sh:TrainDetectionSystemShape sh:property era-sh:maxImpedanceWheelset .
era-sh:maxImpedanceWheelset
	a sh:PropertyShape ;     era:affectedProperty era:maxImpedanceWheelset;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Maximum impedance between opposite wheels of a wheelset when not TSI compilant." ;
	era:rinfIndex "1.1.1.3.7.15.2" ;
	sh:path era:maxImpedanceWheelset ;
	# sh:minCount 0 ; # TODO: Not yet applicable
	sh:maxCount 0 ;
	sh:severity sh:Violation ;
	sh:message "maxImpedanceWheelset (1.1.1.3.7.15.2): The parameter was deprecated, and its provision is no longer accepted. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_MaxImpedanceWheelset."@en .


# maxSandingOutput: # 1.1.1.3.7.17 Parameter no longer in RINF regulation
era-sh:TrainDetectionSystemShape sh:property era-sh:maxSandingOutput .
era-sh:maxSandingOutput
	a sh:PropertyShape ;     era:affectedProperty era:maxSandingOutput;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Maximum amount of sand whithin 30s given in grams accepted on the track." ;
	era:rinfIndex "1.1.1.3.7.17" ;
    sh:path era:maxSandingOutput ;
	sh:maxCount 0 ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "maxSandingOutput (1.1.1.3.7.17): The parameter was deprecated, and its provision is no longer accepted. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_MaxSandOutput."@en .





# requiredSandingOverride: # 1.1.1.3.7.18 Parameter no longer in RINF regulation
era-sh:TrainDetectionSystemShape sh:property era-sh:requiredSandingOverride .
era-sh:requiredSandingOverride
	a sh:PropertyShape ;     era:affectedProperty era:requiredSandingOverride;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of whether sanding override by driver required." ;
	era:rinfIndex "1.1.1.3.7.18" ;
	sh:path era:requiredSandingOverride ;
	# sh:minCount 0 ; # TODO: Not yet applicable
	sh:maxCount 0 ;
	sh:severity sh:Violation ;
	sh:message "requiredSandingOverride (1.1.1.3.7.18): The parameter was deprecated, and its provision is no longer accepted. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_SandDriverOverride."@en .

# tsiCompliantSandCharacteristics: # 1.1.1.3.7.19 Parameter no longer in RINF regulation
era-sh:TrainDetectionSystemShape sh:property era-sh:tsiCompliantSandCharacteristics .
era-sh:tsiCompliantSandCharacteristics
	a sh:PropertyShape ;     era:affectedProperty era:tsiCompliantSandCharacteristics;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of whether the rules are TSI compliant on sand characteristics." ;
	era:rinfIndex "1.1.1.3.7.19" ;
	sh:path era:tsiCompliantSandCharacteristics ;
	sh:maxCount 0 ;
	sh:severity sh:Violation ;
	sh:message "tsiCompliantSandCharacteristics (1.1.1.3.7.19): The parameter was deprecated, and its provision is no longer accepted. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_TSISandCharacteristics."@en .


# flangeLubeRules: # 1.1.1.3.7.20 Parameter no longer in RINF regulation
era-sh:TrainDetectionSystemShape sh:property era-sh:flangeLubeRules .
era-sh:flangeLubeRules
	a sh:PropertyShape ;     era:affectedProperty era:flangeLubeRules;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication whether rules for activation or deactivation of flange lubrication exist." ;
	era:rinfIndex "1.1.1.3.7.20" ;
	sh:path era:flangeLubeRules ;
	# sh:minCount 0 ; # TODO: Not yet applicable
	sh:maxCount 0 ;
	sh:severity sh:Violation ;
	sh:message "flangeLubeRules (1.1.1.3.7.20): The parameter was deprecated, and its provision is no longer accepted. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_FlangeLubeRules."@en .

# tsiCompliantCompositeBrakeBlocks: # 1.1.1.3.7.21 Parameter no longer in RINF regulation
era-sh:TrainDetectionSystemShape sh:property era-sh:tsiCompliantCompositeBrakeBlocks .
era-sh:tsiCompliantCompositeBrakeBlocks
	a sh:PropertyShape ;     era:affectedProperty era:tsiCompliantCompositeBrakeBlocks;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of whether the rules are TSI compliant on composite brake blocks." ;
	era:rinfIndex "1.1.1.3.7.21" ;
	sh:path era:tsiCompliantCompositeBrakeBlocks	 ;
	sh:maxCount 0 ;
	sh:severity sh:Violation ;
	sh:message "tsiCompliantCompositeBrakeBlocks (1.1.1.3.7.21): The parameter was deprecated, and its provision is no longer accepted. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_TSICompositeBrakeBlocks."@en .




# tsiCompliantShuntDevices: # 1.1.1.3.7.22 Parameter no longer in RINF regulation
era-sh:TrainDetectionSystemShape sh:property era-sh:tsiCompliantShuntDevices .
era-sh:tsiCompliantShuntDevices
	a sh:PropertyShape ;     era:affectedProperty era:tsiCompliantShuntDevices;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of whether the rules are TSI compliant on shunt assisting devices." ;
	era:rinfIndex "1.1.1.3.7.22" ;
	sh:path era:tsiCompliantShuntDevices ;
	sh:maxCount 0 ;
	sh:severity sh:Violation ;
	sh:message "tsiCompliantShuntDevices (1.1.1.3.7.22): The parameter was deprecated, and its provision is no longer accepted. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_TSIShuntDevices."@en .



# tsiCompliantRSTShuntImpedance: # 1.1.1.3.7.23 Parameter no longer in RINF regulation
era-sh:TrainDetectionSystemShape sh:property era-sh:tsiCompliantRSTShuntImpedance .
era-sh:tsiCompliantRSTShuntImpedance
	a sh:PropertyShape ;     era:affectedProperty era:tsiCompliantRSTShuntImpedance;     era:affectedClass era:TrainDetectionSystem;     era:scope "local"; era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication of whether the rules are TSI compliant on combination of RST characteristics influencing shunting impedance." ;
	era:rinfIndex "1.1.1.3.7.23" ;
	sh:path era:tsiCompliantRSTShuntImpedance ;
	sh:maxCount 0 ;
	sh:severity sh:Violation ;
	sh:message "tsiCompliantRSTShuntImpedance (1.1.1.3.7.23): The parameter was deprecated, and its provision is no longer accepted. If you have provided a Full XML dataset, in this dataset the XML name for this parameter is CTD_TSIRSTShuntImpedance."@en .

@prefix era-sh: <http://data.europa.eu/949/shapes/> .
@prefix ex: <http://example.org/ns#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix era: <http://data.europa.eu/949/> .
@prefix era-sn: <http://data.europa.eu/949/concepts/sol-natures/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix wgs: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix geosparql: <http://www.opengis.net/ont/geosparql#> .
@prefix era-ph: <http://data.europa.eu/949/concepts/platform-heights/> .
@prefix era-tenclass: <http://data.europa.eu/949/concepts/ten-classifications/> .
@prefix era-gaugings: <http://data.europa.eu/949/concepts/gaugings/> .
@prefix era-ntg: <http://data.europa.eu/949/concepts/nominal-track-gauges/> .
#############################
# Rules for tunnels
#############################
era-sh:sectionOfLineShape
	a sh:NodeShape ;
	sh:targetClass era:SectionOfLine.

#
# tunnels
#
era-sh:tunnelsShape
	a sh:NodeShape ;
	sh:targetClass era:Tunnel .
	
# label

# imCode: # 1.1.1.1.8.1, 1.2.1.0.5.1
era-sh:tunnelsShape sh:property era-sh:imCodeT .
era-sh:imCodeT
    a sh:PropertyShape ;
    era:affectedProperty era:imCode;
    era:affectedClass era:Tunnel;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Each Tunnel can only be submitted by one infrastructure manager, represented by a four-digit code." ;
    era:rinfIndex "1.1.1.1.8.1", "1.2.1.0.5.1" ;
    sh:path era:imCode ;           
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:minLength 4 ;
    sh:maxLength 4 ;
    sh:severity sh:Violation ;
    sh:message "imCode (1.1.1.1.8.1, 1.2.1.0.5.1): Each Tunnel must refer to only one infrastructure manager, which MUST be represented with a four-digit code. This error may be due to having a Tunnel with no infrastructure manager associated, with more than one infrastructure managers, or with a code that has a different length."@en .

# tunnelIdentification: # 1.1.1.1.8.2, 1.2.1.0.5.2
era-sh:tunnelsShape sh:property era-sh:tunnelIdentification .
era-sh:tunnelIdentification
    a sh:PropertyShape ;
    era:affectedProperty era:tunnelIdentification;
    era:affectedClass era:Tunnel;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "Unique tunnel identification or unique number within Member State." ;
    era:rinfIndex "1.1.1.1.8.2", "1.2.1.0.5.2" ;
    sh:path era:tunnelIdentification ;           
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:severity sh:Violation ;
    sh:message "tunnelIdentification (1.1.1.1.8.2, 1.2.1.0.5.2): Each Tunnel can be referred with only one identification. This error may be due to having a Tunnel with no identification or with more than one identification."@en .

# lineReferenceTunnelStart - kilometer: 
era-sh:tunnelsShape sh:property era-sh:tunnelStartKilometer .
era-sh:tunnelStartKilometer
	a sh:PropertyShape;
    era:affectedProperty era:kilometer;
    era:affectedClass era:Tunnel;
    era:affectedClass era:LineReference;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "A reference to the distance measured in kilometers from the origin of a national railway line." ;
	sh:path (era:lineReferenceTunnelStart era:kilometer) ;
    sh:datatype xsd:double;
	sh:severity sh:Violation ;
	sh:message "lineReferenceTunnelStart - kilometer (1.1.1.1.8.3):  The tunnel either does not have a value for kilometer at its beginning , or the value of the kilometer is not a double (real) number."@en .

# lineReferenceTunnelStart - lineNationalId: 
era-sh:tunnelsShape sh:property era-sh:tunnelStartLineNationalId .
era-sh:tunnelStartLineNationalId
	a sh:PropertyShape;
    era:affectedProperty era:lineNationalId;
    era:affectedClass era:Tunnel;
    era:affectedClass era:LineReference;
    era:affectedClass era:NationalRailwayLine;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "A reference to a specific national railway line." ;
	sh:path (era:lineReferenceTunnelStart era:lineNationalId) ;
    sh:class era:NationalRailwayLine;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "lineReferenceTunnelStart - lineNationalId (1.1.1.1.8.3):  The tunnel's kilometer at its beginning must have at least one reference to a specific national railway line and this reference mut be an URI."@en .

era-sh:tunnelsShape sh:property era-sh:tunnelEndKilometer .
era-sh:tunnelEndKilometer
	a sh:PropertyShape;
    era:affectedProperty era:kilometer;
    era:affectedClass era:Tunnel;
    era:affectedClass era:LineReference;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "A reference to the distance measured in kilometers from the origin of a national railway line." ;
	sh:path (era:lineReferenceTunnelEnd era:kilometer) ;
    sh:datatype xsd:double;
	sh:severity sh:Violation ;
	sh:message "lineReferenceTunnelEnd - kilometer (1.1.1.1.8.4):  The tunnel either does not have a value for kilometer at its end , or the value of the kilometer is not a double (real) number."@en .

# lineReferenceTunnelStart - lineNationalId: 
era-sh:tunnelsShape sh:property era-sh:tunnelEndLineNationalId .
era-sh:tunnelEndLineNationalId
	a sh:PropertyShape;
    era:affectedProperty era:lineNationalId;
    era:affectedClass era:Tunnel;
    era:affectedClass era:LineReference;
    era:affectedClass era:NationalRailwayLine;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "A reference to a specific national railway line." ;
	sh:path (era:lineReferenceTunnelEnd era:lineNationalId) ;
    sh:class era:NationalRailwayLine;
    sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "lineReferenceTunnelEnd - lineNationalId (1.1.1.1.8.4):  The tunnel's kilometer at its end must have at least one reference to a specific national railway line and this reference must be an URI."@en .



# hasAbstraction
era-sh:tunnelsShape sh:property era-sh:hasAbstraction .
era-sh:hasAbstraction
    a sh:PropertyShape ;
    era:affectedProperty era:hasAbstraction;
    era:affectedClass era:Tunnel;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
    rdfs:comment "" ; #todo
    sh:path era:hasAbstraction ;           
    #sh:minCount 0 ; #todo ajustar al solucionar problema de netElement
    sh:maxCount 1 ;
    sh:nodeKind sh:IRI ;
	sh:class era:NetElement;
    sh:severity sh:Violation ;
    sh:message "hasAbstraction: Each Tunnel may have one abstraction. This error may be due to having a Tunnel with more than one abtraction or that the abstraction  is not a NetElement."@en .


# verificationSRT: # 1.1.1.1.8.5 TODO: Not yet applicable 
era-sh:tunnelsShape sh:property era-sh:verificationSRT .
era-sh:verificationSRT
	a sh:PropertyShape ;
    era:affectedProperty era:verificationSRT;
    era:affectedClass era:Tunnel;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Unique number for EC declarations following format requirements specified in the 'Document about practical arrangements for transmitting interoperability documents'" ;
	era:rinfIndex "1.1.1.1.8.5" ;
	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): 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 TODO: Not yet applicable 
era-sh:tunnelsShape sh:property era-sh:demonstrationSRT .
era-sh:demonstrationSRT
	a sh:PropertyShape ;
    era:affectedProperty era:demonstrationSRT;
    era:affectedClass era:Tunnel;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Unique number for EI declarations following the same format requirements as specified in the 'Document about practical arrangements for transmitting interoperability documents'" ;
	era:rinfIndex "1.1.1.1.8.6" ;
	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 "demonstrationINF (1.1.1.1.8.6): Each Tunnel may have one or more demonstrationSRT following these 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 .


# length: # 1.1.1.1.8.7
era-sh:tunnelsShape sh:property era-sh:lengthT .
era-sh:lengthT
	a sh:PropertyShape ;
    era:affectedProperty era:length;
    era:affectedClass era:Tunnel;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Length of a tunnel in metres from entrance portal to exit portal." ;
	era:rinfIndex "1.1.1.1.8.7" ;
	sh:path era:length ;
	#sh:minCount 0 ;
	sh:maxCount 1 ;
	sh:datatype xsd:double ;
	#sh:minInclusive 100 ;
	#sh:maxExclusive 100000 ;
	sh:severity sh:Violation ;
	sh:message "length (1.1.1.1.8.7): A Tunnel must have 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:tunnelsShape sh:property era-sh:crossSectionAreaP .
era-sh:crossSectionAreaP
	a sh:PropertyShape ;
    era:affectedProperty era:crossSectionArea;
    era:affectedClass era:Tunnel;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Smallest cross section area in square metres of the tunnel." ;
	era:rinfIndex "1.1.1.1.8.8" ;
	sh:path era:crossSectionArea ;
	#sh:minCount 0 ;
	sh:maxCount 1 ;
	sh:datatype xsd:integer ;
	sh:minInclusive 0 ; #todo realmente 0 es como si no existiera
	sh:maxExclusive 1000 ;
	sh:severity sh:Violation ;
	sh:message "crossSectionArea (1.1.1.1.8.8): A Tunnel can have one crossSectionArea. This error may be due to having a tunnel with more than one crossSectionArea, having a surface out of the range [0,1000) square metres, having more than one value, or having a value  that is not an integer number. "@en .


# complianceInfTsi: # 1.1.1.1.8.8.1 
era-sh:tunnelsShape sh:property era-sh:complianceInfTsiP .
era-sh:complianceInfTsiP
	a sh:PropertyShape ;
    era:affectedProperty era:complianceInfTsi;
    era:affectedClass era:Tunnel;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Compliance of the tunnel with INF TSI at the maximum permitted speed." ;
	era:rinfIndex "1.1.1.1.8.8.1" ;
	sh:path era:complianceInfTsi ;
	#sh:minCount 0 ;
	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 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). This error may be due to the tunnel having more than one value or to having a value that is not T/F (boolean)."@en .


# tunnelDocRef: # 1.1.1.1.8.8.2
era-sh:tunnelsShape sh:property era-sh:tunnelDocRef .
era-sh:tunnelDocRef
	a sh:PropertyShape ;
    era:affectedProperty era:tunnelDocRef;
    era:affectedClass era:Tunnel;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Electronic document available from the IM stored by the Agency with precise description of the clearance gauge and geometry of the tunnel" ;
	era:rinfIndex "1.1.1.1.8.8.2" ;
	sh:path era:tunnelDocRef ;
	# sh:minCount 0 ;
	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."@en .



# hasEmergencyPlan: # 1.1.1.1.8.9
era-sh:tunnelsShape sh:property era-sh:hasEmergencyPlan .
era-sh:hasEmergencyPlan
	a sh:PropertyShape ;
    era:affectedProperty era:hasEmergencyPlan;
    era:affectedClass era:Tunnel;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication whether emergency plan exists." ;
	era:rinfIndex "1.1.1.1.8.9" ;
	sh:path era:hasEmergencyPlan ;
	#sh:minCount 0 ;
    sh:maxCount 1 ;
	sh:datatype xsd:boolean ;
	sh:severity sh:Violation ;
	sh:message "hasEmergencyPlan (1.1.1.1.8.9): A Tunnel has an indication about the existence of an emergency plan. This error may be due to having a tunnel with a value type different than Y/N (boolean)."@en .

# rollingStockFireCategory: # 1.1.1.1.8.10
era-sh:tunnelsShape sh:property era-sh:rollingStockFireCategoryP .
era-sh:rollingStockFireCategoryP
	a sh:PropertyShape ;
    era:affectedProperty era:rollingStockFireCategory;
    era:affectedClass era:Tunnel;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Categorisation on how a passenger train with a fire on board will continue to operate for a defined time period" ;
	era:rinfIndex "1.1.1.1.8.10" ;
	sh:path era:rollingStockFireCategory ;
    sh:maxCount 1 ;
	sh:nodeKind sh:IRI ;
	sh:severity sh:Violation ;
	sh:message "rollingStockFireCategory (1.1.1.1.8.10): 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."@en .

# rollingStockFireCategory: # 1.1.1.1.8.10
era-sh:tunnelsShape sh:sparql era-sh:rollingStockFireCategorySKOS .
era-sh:rollingStockFireCategorySKOS
	a sh:SPARQLConstraint ;
    era:affectedProperty era:rollingStockFireCategory;
    era:affectedClass era:Tunnel;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Categorisation on how a passenger train with a fire on board will continue to operate for a defined time period" ;
	era:rinfIndex "1.1.1.1.8.10" ;
	sh:severity sh:Violation ;
	sh:message "Categorisation on how a passenger train with a fire on board will continue to operate (1.1.1.1.8.10): 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
    WHERE {
        OPTIONAL {$this rdfs:label ?tunnelLabel} .
 		$this era:rollingStockFireCategory ?concept .
        era:rollingStockFireCategory era:inSkosConceptScheme ?conceptScheme .
		FILTER NOT EXISTS{         
  			?concept skos:inScheme ?conceptScheme .
		}
	}
""" .


## nationalRollingStockFireCategory: # 1.1.1.1.8.11
era-sh:tunnelsShape sh:property era-sh:nationalRollingStockFireCategory .
era-sh:nationalRollingStockFireCategory
	a sh:PropertyShape ;
    era:affectedProperty era:nationalRollingStockFireCategory;
    era:affectedClass era:Tunnel;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	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." ;
	era:rinfIndex "1.1.1.1.8.11" ;
	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): 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 .

# dieselThermalAllowed: # 1.2.1.0.5.9
era-sh:tunnelsShape sh:property era-sh:dieselThermalAllowed .
era-sh:dieselThermalAllowed
	a sh:PropertyShape ;
    era:affectedProperty era:dieselThermalAllowed;
    era:affectedClass era:Tunnel;
    era:scope "local";
    era:validationAfterXML "false"^^xsd:boolean;
	rdfs:comment "Indication whether it is allowed to use diesel or other thermal traction in the tunnel." ;
	era:rinfIndex "1.2.1.0.5.9" ;
	sh:path era:dieselThermalAllowed ;
	#sh:minCount 0 ;
    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 woth more than one dieselThermalAllowed declaration or having a value type different than Y/N (boolean)."@en .

