@prefix : <https://w3id.org/itsdata/regulation/v1/> .
@prefix dash: <http://datashapes.org/dash#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <http://schema.org/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix vann: <http://purl.org/vocab/vann/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix cdm1: <https://w3id.org/citydata/part1/v1/> .
@prefix cdm2: <https://w3id.org/citydata/part2/v1/> .
@prefix i72: <https://w3id.org/citydata/21972/v1/> .
@prefix its-agent: <https://w3id.org/itsdata/agent/v1/> .
@prefix its-core: <https://w3id.org/itsdata/core/v1/> .
@prefix its-location: <https://w3id.org/itsdata/location/v1/> .
@prefix its-t-user: <https://w3id.org/itsdata/t-user/v1/> .
@prefix its-time: <https://w3id.org/itsdata/time/v1/> .
@prefix its-weather: <https://w3id.org/itsdata/weather/v1/> .

:ConditionPattern
    rdf:type                      owl:Ontology ;
    dcterms:creator               "Kenneth Vaughn" ;
    dcterms:license               <http://creativecommons.org/licenses/by/4.0/> ;
    dcterms:modified              "2026-07-20T15:00:00Z"^^xsd:dateTime ;
    dcterms:title                 "Traffic Regulation Ontology"@en ;
    its-core:draft                true ;
    owl:imports                   cdm1: ;
    owl:imports                   its-agent: ;
    owl:imports                   its-location: ;
    owl:imports                   its-time: ;
    owl:imports                   its-t-user: ;
    owl:imports                   :CorePattern ;
    owl:imports                   :PermitPattern ;
    skos:definition               "This ontology defines concepts related to traffic regulations."@en ;
    vann:preferredNamespacePrefix "its-regulation" ;
    vann:preferredNamespaceUri    "https://w3id.org/itsdata/regulation/v1/" .

# ================================================
#                 Condition Code classes
# ================================================

:ConditionCode
    rdf:type        owl:Class ;
    dash:abstract   true ;
    rdfs:subClassOf its-core:Code ;
    skos:definition "A code that indicates the enumerated types of conditions that affect the applicability of a regulation."@en .
    
:AccessCategoryCode
    rdf:type        owl:Class ;
    rdfs:subClassOf :ConditionCode ;
    skos:definition "A code that indicates categories of access to a location that can affect the applicability of a regulation."@en ;
    skos:example "local access, loading and unloading, etc."@en ;
    rdfs:seeAlso "DATEX-II AccessConditionTypeEnum" ;
    skos:editorialNote "DATEX-II AccessCondition also includes an otherAccessRestriction, which is handled by the EnumeratedCondition.otherCondition, and an applicableLocation, which can be handled by including a separate LocationCondition."@en .

:DriverCategoryCode
    rdf:type        owl:Class ;
    rdfs:subClassOf :ConditionCode ;
    skos:definition "A code that indicates categories of drivers that can affect the applicability of a regulation."@en ;
    skos:example "learners, provisional (underage), commercial, etc."@en ;
    rdfs:seeAlso "DATEX-II DriverCondition" ;
    skos:editorialNote "DATEX-II DriverCondition seems to have multiple ways to convey the same information (e.g., learner as either a license characteristic or a driver characteristic). This proposed to move most of the 'driver characteristic' information to the PermitCondition class."@en .

:RoadTypeCode
    rdf:type        owl:Class ;
    rdfs:subClassOf :ConditionCode ;
    skos:definition "A code that indicates categories of roads that can affect the applicability of a regulation."@en ;
    skos:example "gravel, paved, urban, rural, motorway, etc."@en ;
    rdfs:seeAlso "DATEX-II RoadTypeEnum".

:StandingOrParkingCategoryCode
    rdf:type        owl:Class ;
    rdfs:subClassOf :ConditionCode ;
    skos:definition "A code that indicates categories of standing or parking that can affect the applicability of a regulation."@en ;
    skos:example "electric vehicle charging, loading and unloading, kerbside only, verge also, etc."@en ;
    rdfs:seeAlso "DATEX-II StandingOrParkingConditionTypeEnum".

:TunnelCategoryCode
    rdf:type        owl:Class ;
    rdfs:subClassOf :ConditionCode ;
    skos:definition "A code that indicates categories of tunnels that can affect the applicability of a regulation."@en ;
    skos:example "no restrictions, restrictions for materials with very explosive properties, etc."@en ;
    rdfs:seeAlso "DATEX-II ADRTunnelCategoryTypeEnum".

# ================================================
#                Other Code Classes
# ================================================

:LogicalOperatorCode
    rdf:type        owl:Class ;
    rdfs:subClassOf its-core:Code  ;
    skos:definition "A code that indicates how the members of a ConditionSet are combined (for example AND, OR, XOR, NOT, etc.)."@en .
        
:MeasurableConditionCode
    rdf:type        owl:Class ;
    rdfs:subClassOf its-core:Code ;
    skos:definition "A code that indicates the type of measurable condition that is assessed, including both the type of measure and the type of entity being measured."@en ;
    skos:example "vehicle gross weight, vehicle height, vehicle speed, wind speed, number of occupants, driver age, time driver's license held, etc."@en ;
    rdfs:seeAlso "DATEX-II WeightCharacteristic, HeightCharacteristic, LengthCharacteristic, WidthCharacteristic, HeaviestAxleWeightCharacteristic, NumberOfAxelsCharacteristic, OccupantCondition.".

# ================================================
#                Condition Classes
# ================================================

:Condition
    rdf:type        owl:Class ;
    dash:abstract   true ;
    rdfs:subClassOf :RegulationThing ;
    skos:definition "A boolean condition that must evaluate to true for the associated regulation(s) to currently apply. Even if the condition is true, it is not active if it is currently overridden. The condition may be multi-part."@en .

:ConditionSet
    rdf:type        owl:Class ;
    rdfs:subClassOf :Condition ;
    rdfs:subClassOf [
        rdf:type                    owl:Restriction ;
        owl:onProperty              cdm1:hasComponent ;
        owl:onClass                 :Condition ;
        owl:minQualifiedCardinality "2"^^xsd:nonNegativeInteger
    ] ;
    rdfs:subClassOf [
        rdf:type                 owl:Restriction ;
        owl:onProperty           :logicalOperator ;
        owl:onClass              :LogicalOperatorCode ;
        owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger
    ] ;
    skos:definition "A composite condition that consists of two or more Conditions combined by a logical operator; the set must evaluate to true for the associated regulation(s) to currently apply."@en .

:EnumeratedCondition
    rdf:type        owl:Class ;
    rdfs:subClassOf :Condition ;
    rdfs:subClassOf [
        rdf:type                    owl:Restriction ;
        owl:onProperty              :forEnumeratedCondition ;
        owl:onClass                 :ConditionCode ;
        owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger
    ] ;
    rdfs:subClassOf [
        rdf:type                    owl:Restriction ;
        owl:onProperty              :otherCondition ;
        owl:onDataRange             rdf:langString ;
    ] ;
    skos:definition "A condition that is based on an enumerated value in a known code list."@en .

:LocationCondition
    rdf:type        owl:Class ;
    rdfs:subClassOf :Condition ;
    rdfs:subClassOf [
        rdf:type                    owl:Restriction ;
        owl:onProperty              :locationByOrder ;
        owl:onClass                 its-location:Feature ;
        owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger ;
        rdfs:seeAlso "DATEX-II LocationCondition.locationByOrder" ;
        skos:editorialNote "Within the ontology, this is mandatory (i.e., there has to be a location in the regulation for this to apply). Interface standards, such as DATEX-II, may allow for a more flexible approach, such only providing the implemented location."@en
    ] ;
    skos:definition "A condition that applies to a specific location."@en ;
    rdfs:seeAlso "DATEX-II LocationCondition".

:MeasurableCondition
    rdf:type        owl:Class ;
    rdfs:subClassOf :Condition ;
    rdfs:subClassOf [
        rdf:type                    owl:Restriction ;
        owl:onProperty              :forMeasurableCondition ;
        owl:onClass                 :MeasurableConditionCode ;
        owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger
    ] ;
    rdfs:subClassOf [
        rdf:type                    owl:Restriction ;
        owl:onProperty              :comparisonOperator ;
        owl:onClass                 its-core:ComparisonOperatorCode ;
        owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger
    ] ;
    rdfs:subClassOf [
        rdf:type                    owl:Restriction ;
        owl:onProperty              :valueToCompare ;
        owl:onClass                 i72:Measure ;
        owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger
    ] ;
    skos:definition "A condition that is based on a comparison between a measurable value and a threshold value."@en .

:PermitRequiredCondition
    rdf:type        owl:Class ;
    rdfs:subClassOf :Condition ;
    rdfs:subClassOf [
        rdf:type                    owl:Restriction ;
        owl:onProperty              :requiredDesignation ;
        owl:onClass                 :PermitDesignationCode 
    ] ;
    skos:definition "A condition that is based on the possession of a permit."@en ;
    rdfs:seeAlso "DATEX-II RequiredPermitCondition".

:TimeValidityCondition
    rdf:type        owl:Class ;
    rdfs:subClassOf :Condition ;
    rdfs:subClassOf [
        rdf:type                    owl:Restriction ;
        owl:onProperty              :validityByOrder ;
        owl:onClass                 its-time:Schedule ;
        owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger ;
        rdfs:seeAlso "DATEX-II LocationCondition.locationByOrder" ;
        skos:editorialNote "Within the ontology, this is mandatory (i.e., there has to be a validity period in the regulation for this to apply). Interface standards, such as DATEX-II, may allow for a more flexible approach, such only providing the implemented location."@en
    ] ;
    skos:definition "A condition that applies to a specific location."@en ;
    rdfs:seeAlso "DATEX-II LocationCondition".

:VersionedCondition
    rdf:type        owl:Class ;
    dash:abstract   true ;
    rdfs:subClassOf :Condition ;
    rdfs:subClassOf :VersionedThing ;
    skos:definition "A specific version of a condition that can be referenced by a ConditionReference."@en ;
    skos:editorialNote "DATEX-II defines a ConditionReference class, but it seems incomplete as it references a non-existent PredefinedCondition class."@en .

# ================================================
#                Other Classes
# ================================================

:LegalBasis
    rdf:type        owl:Class ;
    rdfs:subClassOf :RegulationThing ;
    skos:definition "A legal basis provides references to the legal documents that authorize an entity to issue the types of regulations covered by a traffic regulation order."@en .

:LegalStatusCode
    rdf:type        owl:Class ;
    rdfs:subClassOf :RegulationThing ;
    rdfs:subClassOf its-core:Code ;
    skos:definition "A code that indicates the legal status of a traffic regulation."@en ;
    skos:example "primary offence (can be enforced as sole offence), secondary offence (can be enforced if another offence is enforceable), private (can be enforced by the private owner of the facility or in the case of a collision), etc."@en .
# ================================================
#                 Object properties
# ================================================

:applicableLocation
    rdf:type           owl:ObjectProperty ;
    rdfs:range         its-location:Feature ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    skos:definition    "The location associated with the condition."@en .

:comparisonOperator
    rdf:type            owl:ObjectProperty ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    rdfs:range          its-core:ComparisonOperatorCode ;
    skos:definition "The operator used to compare the value to the threshold value."@en .

:forAccessCategory
    rdf:type            owl:ObjectProperty ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    rdfs:range          :AccessCategoryCode ;
    skos:definition "The type of restriction that regulates access to a facility."@en .

:forEnumeratedCondition
    rdf:type            owl:ObjectProperty ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    rdfs:range          :ConditionCode ;
    skos:definition "The enumerated condition that affects the applicability of the regulation."@en .

:forMeasurableCondition
    rdf:type            owl:ObjectProperty ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    rdfs:range          :MeasurableConditionCode ;
    skos:definition "The measurable condition that affects the applicability of the regulation."@en .
    
:forNonVehicularRoadUserType
    rdf:type            owl:ObjectProperty ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    rdfs:range          its-t-user:NonVehicularRoadUserCode ;
    skos:definition "The type of non-vehicular road user that is subject to the regulation."@en .

:forRoadType
    rdf:type            owl:ObjectProperty ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    rdfs:range          :RoadTypeCode ;
    skos:definition "The type of road upon which travel is taking place."@en .

:forStandingOrParkingCategory
    rdf:type            owl:ObjectProperty ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    rdfs:range          :StandingOrParkingCategoryCode ;
    skos:definition "The category of standing or parking within which travel is taking place."@en .

:forTunnelCategory
    rdf:type            owl:ObjectProperty ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    rdfs:range          :TunnelCategoryCode ;
    skos:definition "The category of tunnel within which travel is taking place."@en .

:forRoadWeatherConditionType
    rdf:type            owl:ObjectProperty ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    rdfs:range          its-weather:RoadWeatherConditionCode ;
    skos:definition "The type of weather condition that is subject to the regulation."@en .

:hasCondition
    rdf:type           owl:ObjectProperty ;
    rdfs:range         :Condition ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    skos:definition    "A condition associated with the instance (for example a traffic regulation); not used for the part-whole composition of a ConditionSet, which uses cdm1:hasComponent."@en .

:hasLegalBasis
    rdf:type            owl:ObjectProperty ;
    rdfs:range          :LegalBasis ;
    rdfs:subPropertyOf  :RegulationObjectProperty ;
    skos:definition "formal authority within the law (e.g., statute, ordinance, administrative rule, constitutional provision) that empowers an entity to create, adopt, or enforce a regulation"@en .

:implementedLocation
    rdf:type            owl:ObjectProperty ;
    rdfs:subPropertyOf  :RegulationObjectProperty ;
    rdfs:range          its-location:Feature ;
    skos:definition "The location where the regulation was implemented (e.g., with traffic control devices)."@en .

:implementedValidity
    rdf:type            owl:ObjectProperty ;
    rdfs:subPropertyOf  :RegulationObjectProperty ;
    rdfs:range          its-time:Schedule ;
    skos:definition "The validity period for the condition as implemented."@en .

:locationByOrder
    rdf:type            owl:ObjectProperty ;
    rdfs:subPropertyOf  :RegulationObjectProperty ;
    rdfs:range          its-location:Feature ;
    skos:definition "The location where the regulation is defined to apply per the traffic regulation order."@en .

:logicalOperator
    rdf:type             owl:ObjectProperty ;
    rdfs:subPropertyOf   :RegulationObjectProperty ;
    schema:domainIncludes :ConditionSet ;
    schema:rangeIncludes :LogicalOperatorCode ;
    skos:definition      "The logical operator used to combine the Conditions in a ConditionSet."@en .

:requiredDesignation
    rdf:type            owl:ObjectProperty ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    rdfs:range          :PermitDesignationCode ;
    skos:definition "The designation of the permit that is required for the instance of the traffic regulation."@en .

:requiredDisplayType
    rdf:type            owl:ObjectProperty ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    rdfs:range          :PermitDisplayTypeCode ;
    skos:definition "The display type of the permit that is required for the instance of the traffic regulation."@en .

:requiredGrantor
    rdf:type            owl:ObjectProperty ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    rdfs:range          cdm2:Organization ;
    skos:definition "The grantor of the permit that is required for the instance of the traffic regulation."@en .

:requiredGrantorType
    rdf:type            owl:ObjectProperty ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    rdfs:range          :PermitGrantorTypeCode ;
    skos:definition "The type of grantor of the permit that is required for the instance of the traffic regulation."@en .

:trafficImpactLocation
    rdf:type            owl:ObjectProperty ;
    rdfs:subPropertyOf  :RegulationObjectProperty ;
    rdfs:range          its-location:Feature ;
    skos:definition "The location where traffic is impacted due to the existence of the regulation."@en .

:validityByOrder
    rdf:type            owl:ObjectProperty ;
    rdfs:subPropertyOf  :RegulationObjectProperty ;
    rdfs:range          its-time:Schedule ;
    skos:definition "The validity period for the condition."@en .

:valueToCompare
    rdf:type            owl:ObjectProperty ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    rdfs:range          i72:Measure ;
    skos:definition "The threshold value to compare against the current value to determine the applicability of the regulation."@en .

# ================================================
#                 Datatype properties
# ================================================

:isActive
    rdf:type        owl:DatatypeProperty ;
    rdfs:subPropertyOf :RegulationDataProperty ;
    rdfs:range xsd:boolean ;
    skos:definition "Indicates whether the condition is currently active."@en .

:negate
    rdf:type        owl:DatatypeProperty ;
    rdfs:subPropertyOf :RegulationDataProperty ;
    rdfs:range xsd:boolean ;
    skos:definition "Indicates whether the condition is negated."@en .

:otherCondition
    rdf:type        owl:DatatypeProperty ;
    rdfs:subPropertyOf :RegulationDataProperty ;
    rdfs:range         rdf:langString;
    skos:definition "A separate condition that determines the applicability of the regulation."@en .

:requiredPermitIdentifier
    rdf:type            owl:DatatypeProperty ;
    rdfs:subPropertyOf :RegulationDataProperty ;
    rdfs:range          xsd:string ;
    skos:definition "The identifier of the permit that is required for the instance of the traffic regulation."@en .

:version
    rdf:type        owl:DatatypeProperty ;
    rdfs:subPropertyOf :RegulationDataProperty ;
    rdfs:range xsd:string ;
    skos:definition "The version of the object."@en .