@prefix : <https://w3id.org/mobilitydcat-ap/releases/3.0.0/shacl/ranges#> .
@prefix mobilitydcatap: <https://w3id.org/mobilitydcat-ap#> .
@prefix adms: <http://www.w3.org/ns/adms#> .
@prefix cnt: <http://www.w3.org/2011/content#> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix dcatap: <http://data.europa.eu/r5r/> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix dqv: <http://www.w3.org/ns/dqv#> .
@prefix eli: <http://data.europa.eu/eli/ontology#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix geodcatap: <http://data.europa.eu/930/> .
@prefix org: <http://www.w3.org/ns/org#> .
@prefix locn: <http://www.w3.org/ns/locn#> .
@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix oa: <http://www.w3.org/ns/oa#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix bibo: <http://purl.org/ontology/bibo/> .
#===========================================================================
# mobilityDCAT-AP 3.0.0 - SHACL Range Constraints (range.ttl)
# Extends DCAT-AP 3.0.1.
#
# STRUCTURE (import + deltas):
#   This file owl:imports the DCAT-AP 3.0.1 range.ttl and contains ONLY the
#   mobilityDCAT-AP-specific node-kind / class constraints. Ranges that
#   DCAT-AP already constrains identically are NOT restated (inherited via
#   the import), per the "inherit, do not re-encode" rule.
#
# DESIGN NOTE on sh:nodeKind vs sh:class:
#   Properties whose values are IRI references into EXTERNAL vocabularies
#   (controlled-vocabulary codes, EU authority tables, agent/scheme IRIs)
#   are constrained with sh:nodeKind sh:IRI, NOT sh:class. The referenced
#   resource's rdf:type lives in the external vocabulary, not in the
#   instance data, so sh:class would wrongly reject every real-world file
#   that references a code by IRI without inlining its type. Actual CV
#   membership is checked in mdr-vocabularies.shape.ttl (via skos:inScheme
#   / sh:hasValue), not here. sh:class is used ONLY where the value is an
#   inline-typed blank-node structure in normal data (RightsStatement,
#   MobilityDataStandard, Assessment, QualityAnnotation, vCard structures,
#   Address, Organisation).
#
# INHERITED from DCAT-AP 3.0.1 range.ttl (NOT restated here):
#   Dataset distribution, contactPoint, publisher, temporal, inSeries,
#   hasVersion, language, theme, accrualPeriodicity, applicableLegislation,
#   source, relation, adms:identifier; Distribution format, license,
#   conformsTo, language, status, applicableLegislation, accessURL,
#   downloadURL; Location geometry (locn:Geometry - DCAT-AP 3.0.1
#   changelog issues 177/247).
#===========================================================================
<https://w3id.org/mobilitydcat-ap/releases/3.0.0/shacl/ranges>
  a owl:Ontology ;
  owl:imports <https://semiceu.github.io/DCAT-AP/releases/3.0.1/html/shacl/range.ttl> ;
  owl:versionInfo "3.0.0" ;
  dct:modified "2026-07-23"^^xsd:date ;
  dct:title "mobilityDCAT-AP 3.0.0 SHACL - Range Constraints"@en ;
  dct:description "Adds mobilityDCAT-AP-specific node-kind / class range constraints, extending DCAT-AP 3.0.1. CV-code and external-IRI references use sh:nodeKind sh:IRI; CV membership is checked in the MDR file. DCAT-AP ranges are inherited via owl:imports and not restated."@en ;
  bibo:editor [
    a foaf:Person ;
    owl:sameAs <https://orcid.org/0000-0003-1867-4428> ;
    foaf:name "Daham Mustafa"
  ] , [
    a foaf:Person ;
    owl:sameAs <https://orcid.org/0000-0001-5446-6947> ;
    foaf:name "Lina Molinas Comet"
  ] , [
    a foaf:Person ;
    owl:sameAs <https://orcid.org/0000-0002-8235-7331> ;
    foaf:name "Mario Scrocca"
  ] ;
  dct:creator [
    a foaf:Group ;
    foaf:name "NAPCORE Task 4.4" ;
    foaf:page <https://github.com/mobilityDCAT-AP/mobilityDCAT-AP>
  ] ;
  dct:publisher <https://napcore.eu/> ;
  dct:rightsHolder <https://napcore.eu/> ;
  dcat:distribution [
    a adms:AssetDistribution ;
    dct:format <http://publications.europa.eu/resource/authority/file-type/RDF_TURTLE> ,
               <http://www.w3.org/ns/formats/data/Turtle> ;
    dct:title "SHACL Range Constraints (Turtle)"@en ;
    dcat:downloadURL <https://w3id.org/mobilitydcat-ap/releases/3.0.0/shacl/ranges.ttl> ;
    dcat:mediaType "text/turtle"
  ] .
#---------------------------------------------------------------------------
# AGENT  (geoDCAT additions; address/affiliation are inline-typed structures)
#---------------------------------------------------------------------------
:Agent_Shape_ranges
  a sh:NodeShape ;
  sh:targetClass foaf:Agent ;
  sh:name "Agent (mobilityDCAT-AP) - Range Constraints"@en ;
  sh:property
    :Agent_Shape_address_range ,
    :Agent_Shape_affiliation_range .
:Agent_Shape_address_range
  a sh:PropertyShape ;
  sh:path locn:address ; sh:class locn:Address ;
  sh:name "address (range)"@en ;
  sh:message "Address must be a locn:Address instance"@en ;
  sh:severity sh:Info .
:Agent_Shape_affiliation_range
  a sh:PropertyShape ;
  sh:path org:memberOf ; sh:class org:Organization ;
  sh:name "affiliation (range)"@en ;
  sh:message "Affiliation must be an org:Organization instance"@en ;
  sh:severity sh:Info .
#---------------------------------------------------------------------------
# ASSESSMENT  (no DCAT-AP shape)
#---------------------------------------------------------------------------
:Assessment_Shape
  a sh:NodeShape ;
  sh:targetClass mobilitydcatap:Assessment ;
  sh:name "Assessment (mobilityDCAT-AP) - Range Constraints"@en ;
  sh:property :Assessment_Shape_assessmentResult_range .
:Assessment_Shape_assessmentResult_range
  a sh:PropertyShape ;
  sh:path oa:hasBody ; sh:nodeKind sh:BlankNodeOrIRI ;
  sh:severity sh:Info .
#---------------------------------------------------------------------------
# CATALOGUE
# spatial nodeKind raised to Violation (spatial mandatory). homepage range
# is foaf:Document per the v3 changelog, but enforced as sh:nodeKind sh:IRI
# because homepages are referenced as bare IRIs in instance data.
#---------------------------------------------------------------------------
:Catalogue_Shape
  a sh:NodeShape ;
  sh:targetClass dcat:Catalog ;
  sh:name "Catalogue (mobilityDCAT-AP) - Range Constraints"@en ;
  sh:property
    :Catalogue_Shape_spatial_range ,
    :Catalogue_Shape_homepage_range .
:Catalogue_Shape_spatial_range
  a sh:PropertyShape ;
  sh:path dct:spatial ; sh:nodeKind sh:BlankNodeOrIRI ;
  sh:message "Catalogue geographical coverage must be a blank node or an IRI (e.g. country code from EU authority table or Geonames)."@en ;
  sh:severity sh:Violation .
:Catalogue_Shape_homepage_range
  a sh:PropertyShape ;
  sh:path foaf:homepage ; sh:nodeKind sh:IRI ;
  sh:name "homepage (range)"@en ;
  sh:description "Homepage range is foaf:Document in mobilityDCAT-AP (v3 changelog), enforced here as sh:nodeKind sh:IRI since homepages are referenced as bare IRIs, not inline-typed in instance data."@en ;
  sh:message "Homepage must be an IRI"@en ;
  sh:severity sh:Warning .
#---------------------------------------------------------------------------
# CATALOGUE RECORD
# publisher (geoDCAT addition; bare agent IRI -> nodeKind) and conformsTo
# (application profile; CV/standard IRI -> nodeKind).
# NOTE: spec allows conformsTo 0..* but DCAT-AP caps it at maxCount 1; the
# import inherits that cap (looser mobility cardinality cannot be enforced
# via import + deltas). Open item for discussion.
#---------------------------------------------------------------------------
:CatalogueRecord_Shape
  a sh:NodeShape ;
  sh:targetClass dcat:CatalogRecord ;
  sh:name "Catalogue Record (mobilityDCAT-AP) - Range Constraints"@en ;
  sh:property
    :CatalogueRecord_Shape_publisher_range ,
    :CatalogueRecord_Shape_conformsTo_range .
:CatalogueRecord_Shape_publisher_range
  a sh:PropertyShape ;
  sh:path dct:publisher ; sh:nodeKind sh:BlankNodeOrIRI ;
  sh:severity sh:Info .
:CatalogueRecord_Shape_conformsTo_range
  a sh:PropertyShape ;
  sh:path dct:conformsTo ; sh:nodeKind sh:IRI ;
  sh:name "application profile (range)"@en ;
  sh:severity sh:Warning .
#---------------------------------------------------------------------------
# CONCEPT  (relabelled from Category)
#---------------------------------------------------------------------------
:Concept_Shape
  a sh:NodeShape ;
  sh:targetClass skos:Concept ;
  sh:name "Concept (mobilityDCAT-AP) - Range Constraints"@en ;
  sh:property :Concept_Shape_inScheme_range .
:Concept_Shape_inScheme_range
  a sh:PropertyShape ;
  sh:path skos:inScheme ; sh:nodeKind sh:BlankNodeOrIRI ;
  sh:severity sh:Info .
#---------------------------------------------------------------------------
# DATASET  (mobility/geoDCAT property ranges only; CV codes -> nodeKind IRI)
#---------------------------------------------------------------------------
:Dataset_Shape
  a sh:NodeShape ;
  sh:targetClass dcat:Dataset ;
  sh:name "Dataset (mobilityDCAT-AP) - Range Constraints"@en ;
  sh:property
    :Dataset_Shape_mobilityTheme_range ,
    :Dataset_Shape_spatial_range ,
    :Dataset_Shape_georeferencingMethod_range ,
    :Dataset_Shape_networkCoverage_range ,
    :Dataset_Shape_referenceSystem_range ,
    :Dataset_Shape_rightsHolder_range ,
    :Dataset_Shape_transportMode_range ,
    :Dataset_Shape_assessmentResult_range ,
    :Dataset_Shape_intendedInformationService_range ,
    :Dataset_Shape_hasQualityAnnotation_range .
:Dataset_Shape_mobilityTheme_range
  a sh:PropertyShape ;
  sh:path mobilitydcatap:mobilityTheme ; sh:nodeKind sh:IRI ;
  sh:severity sh:Violation .
:Dataset_Shape_spatial_range
  a sh:PropertyShape ;
  sh:path dct:spatial ; sh:nodeKind sh:BlankNodeOrIRI ;
  sh:severity sh:Violation .
:Dataset_Shape_georeferencingMethod_range
  a sh:PropertyShape ;
  sh:path mobilitydcatap:georeferencingMethod ; sh:nodeKind sh:IRI ;
  sh:severity sh:Warning .
:Dataset_Shape_networkCoverage_range
  a sh:PropertyShape ;
  sh:path mobilitydcatap:networkCoverage ; sh:nodeKind sh:IRI ;
  sh:severity sh:Warning .
:Dataset_Shape_referenceSystem_range
  a sh:PropertyShape ;
  sh:path geodcatap:referenceSystem ; sh:nodeKind sh:IRI ;
  sh:name "reference system (range)"@en ;
  sh:description "Spatial reference system (OGC EPSG register). geoDCAT-AP addition. CV/register membership is checked separately."@en ;
  sh:severity sh:Warning .
:Dataset_Shape_rightsHolder_range
  a sh:PropertyShape ;
  sh:path dct:rightsHolder ; sh:nodeKind sh:BlankNodeOrIRI ;
  sh:severity sh:Warning .
:Dataset_Shape_transportMode_range
  a sh:PropertyShape ;
  sh:path mobilitydcatap:transportMode ; sh:nodeKind sh:IRI ;
  sh:severity sh:Warning .
:Dataset_Shape_assessmentResult_range
  a sh:PropertyShape ;
  sh:path mobilitydcatap:assessmentResult ; sh:nodeKind sh:BlankNodeOrIRI ; sh:class mobilitydcatap:Assessment ;
  sh:severity sh:Info .
:Dataset_Shape_intendedInformationService_range
  a sh:PropertyShape ;
  sh:path mobilitydcatap:intendedInformationService ; sh:nodeKind sh:IRI ;
  sh:severity sh:Info .
:Dataset_Shape_hasQualityAnnotation_range
  a sh:PropertyShape ;
  sh:path dqv:hasQualityAnnotation ; sh:nodeKind sh:BlankNodeOrIRI ; sh:class dqv:QualityAnnotation ;
  sh:severity sh:Info .
#---------------------------------------------------------------------------
# DATASET SERIES
#---------------------------------------------------------------------------
:DatasetSeries_Shape
  a sh:NodeShape ;
  sh:targetClass dcat:DatasetSeries ;
  sh:name "Dataset Series (mobilityDCAT-AP) - Range Constraints"@en ;
  sh:property :DatasetSeries_Shape_mobilityTheme_range .
:DatasetSeries_Shape_mobilityTheme_range
  a sh:PropertyShape ;
  sh:path mobilitydcatap:mobilityTheme ; sh:nodeKind sh:IRI ;
  sh:severity sh:Info .
#---------------------------------------------------------------------------
# DISTRIBUTION  (mobility property ranges only)
#---------------------------------------------------------------------------
:Distribution_Shape
  a sh:NodeShape ;
  sh:targetClass dcat:Distribution ;
  sh:name "Distribution (mobilityDCAT-AP) - Range Constraints"@en ;
  sh:property
    :Distribution_Shape_mobilityDataStandard_range ,
    :Distribution_Shape_rights_range ,
    :Distribution_Shape_applicationLayerProtocol_range ,
    :Distribution_Shape_communicationMethod_range .
:Distribution_Shape_mobilityDataStandard_range
  a sh:PropertyShape ;
  sh:path mobilitydcatap:mobilityDataStandard ;
  sh:or (
    [ sh:nodeKind sh:IRI ]
    [ sh:nodeKind sh:BlankNodeOrIRI ; sh:class mobilitydcatap:MobilityDataStandard ]
  ) ;
  sh:name "mobility data standard (range)"@en ;
  sh:message "Mobility data standard must be a CV concept IRI or a mobilitydcatap:MobilityDataStandard instance"@en ;
  sh:severity sh:Violation .
:Distribution_Shape_rights_range
  a sh:PropertyShape ;
  sh:path dct:rights ; sh:nodeKind sh:BlankNodeOrIRI ; sh:class dct:RightsStatement ;
  sh:severity sh:Violation .
:Distribution_Shape_applicationLayerProtocol_range
  a sh:PropertyShape ;
  sh:path mobilitydcatap:applicationLayerProtocol ; sh:nodeKind sh:IRI ;
  sh:severity sh:Warning .
:Distribution_Shape_communicationMethod_range
  a sh:PropertyShape ;
  sh:path mobilitydcatap:communicationMethod ; sh:nodeKind sh:IRI ;
  sh:severity sh:Info .
#---------------------------------------------------------------------------
# KIND  (vCard structures are inline-typed; hasEmail -> vcard:Email)
#---------------------------------------------------------------------------
:Kind_Shape
  a sh:NodeShape ;
  sh:targetObjectsOf dcat:contactPoint ;
  sh:name "Kind (mobilityDCAT-AP) - Range Constraints"@en ;
  sh:property
    :Kind_Shape_email_range ,
    :Kind_Shape_hasURL_range ,
    :Kind_Shape_hasAddress_range ,
    :Kind_Shape_hasTelephone_range .
:Kind_Shape_email_range
  a sh:PropertyShape ;
  sh:path vcard:hasEmail ; sh:nodeKind sh:IRI ;
  sh:severity sh:Violation .
:Kind_Shape_hasURL_range
  a sh:PropertyShape ;
  sh:path vcard:hasURL ; sh:nodeKind sh:IRI ;
  sh:severity sh:Warning .
:Kind_Shape_hasAddress_range
  a sh:PropertyShape ;
  sh:path vcard:hasAddress ; sh:nodeKind sh:BlankNodeOrIRI ; sh:class vcard:Address ;
  sh:severity sh:Info .
:Kind_Shape_hasTelephone_range
  a sh:PropertyShape ;
  sh:path vcard:hasTelephone ; sh:nodeKind sh:IRI ;
  sh:severity sh:Info .
#---------------------------------------------------------------------------
# LOCATION
# gazetteer (inScheme) -> nodeKind (scheme referenced by bare IRI).
# locn:geometry -> locn:Geometry inherited from DCAT-AP 3.0.1 (177/247).
#---------------------------------------------------------------------------
:Location_Shape
  a sh:NodeShape ;
  sh:targetClass dct:Location ;
  sh:name "Location (mobilityDCAT-AP) - Range Constraints"@en ;
  sh:property :Location_Shape_inScheme_range .
:Location_Shape_inScheme_range
  a sh:PropertyShape ;
  sh:path skos:inScheme ; sh:nodeKind sh:BlankNodeOrIRI ;
  sh:severity sh:Warning .
#---------------------------------------------------------------------------
# MOBILITY DATA STANDARD  (conformsTo -> CV/standard IRI -> nodeKind)
#---------------------------------------------------------------------------
:MobilityDataStandard_Shape
  a sh:NodeShape ;
  sh:targetClass mobilitydcatap:MobilityDataStandard ;
  sh:name "Mobility Data Standard (mobilityDCAT-AP) - Range Constraints"@en ;
  sh:property :MobilityDataStandard_Shape_conformsTo_range .
:MobilityDataStandard_Shape_conformsTo_range
  a sh:PropertyShape ;
  sh:path dct:conformsTo ; sh:nodeKind sh:IRI ;
  sh:name "conforms to (range)"@en ;
  sh:severity sh:Info .
#---------------------------------------------------------------------------
# QUALITY ANNOTATION  (no DCAT-AP shape)
#---------------------------------------------------------------------------
:QualityAnnotation_Shape
  a sh:NodeShape ;
  sh:targetClass dqv:QualityAnnotation ;
  sh:name "Quality Annotation (mobilityDCAT-AP) - Range Constraints"@en ;
  sh:property
    :QualityAnnotation_Shape_hasBody_range .
  
:QualityAnnotation_Shape_hasBody_range
  a sh:PropertyShape ;
  sh:path oa:hasBody ; sh:nodeKind sh:BlankNodeOrIRI ;
  sh:severity sh:Info .
#---------------------------------------------------------------------------
# RIGHTS STATEMENT  (conditions-for-access CV -> nodeKind IRI)
#---------------------------------------------------------------------------
:RightsStatement_Shape
  a sh:NodeShape ;
  sh:targetClass dct:RightsStatement ;
  sh:name "Rights Statement (mobilityDCAT-AP) - Range Constraints"@en ;
  sh:property :RightsStatement_Shape_type_range .
:RightsStatement_Shape_type_range
  a sh:PropertyShape ;
  sh:path dct:type ; sh:nodeKind sh:IRI ;
  sh:severity sh:Violation .