@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 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-time: <https://w3id.org/itsdata/time/v1/> .
@prefix vann: <http://purl.org/vocab/vann/> .

:TrafficRegulationPattern
    dcterms:creator               "Kenneth Vaughn"@en ;
    dcterms:license               <http://creativecommons.org/licenses/by/4.0/> ;
    dcterms:modified              "2026-05-06T19:57:16Z"^^xsd:dateTime ;
    dcterms:title                 "The Traffic Regulation Pattern of the Traffic Regulation Ontology"@en ;
    its-core:draft                true ;
    owl:imports                   :CorePattern ;
    owl:imports                   :ConditionPattern ;
    rdf:type                      owl:Ontology ;
    skos:definition               "This ontology defines concepts related to traffic regulations."@en ;
    vann:preferredNamespacePrefix "its-regulation" ;
    vann:preferredNamespaceUri    "https://w3id.org/itsdata/regulation/v1/" .

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

:ActivationStatusCode
    rdf:type        owl:Class ;
    rdfs:subClassOf :RegulationThing ;
    rdfs:subClassOf its-core:Code ;
    skos:definition "A code indicating the activation status of an object"@en ;
    skos:example    "active, beingSetUp, beingShutDown, inactive, scheduled"@en .

:RegulationContextCode
    rdf:type        owl:Class ;
    rdfs:subClassOf :RegulationThing ;
    rdfs:subClassOf its-core:Code ;
    skos:definition "A code indicating the context of a regulation that is associated with a code pair."@en ;
    skos:example    "lane, carriageway, road"@en .

:FeeRestrictionCode
    rdf:type        owl:Class ;
    rdfs:subClassOf :RestrictionCode ;
    rdfs:subClassOf its-core:Code ;
    skos:definition "A code indicating the type of regulation that is associated with a fee schedule."@en ;
    skos:example    "StandingOrParkingControl (for fees)"@en .

:ReasonCode
    rdf:type        owl:Class ;
    rdfs:subClassOf :RegulationThing ;
    rdfs:subClassOf its-core:Code ;
    skos:definition "A code indicating the reason for the traffic regulation order."@en ;
    skos:example    "construction, maintenance, special event, emergency, weather"@en .

:RegulationCategoryCode
    rdf:type        owl:Class ;
    rdfs:subClassOf :RegulationThing ;
    rdfs:subClassOf its-core:Code ;
    skos:definition "A code used to identify a category of regulation." ;
    skos:example    "vehicle code rules, right-of-way rules, speed restrictions, vehicle usage restrictions, parking restrictions, toll rules, commercial or regulated vehicle rules, supplemental rules, equipment regulations, etc."@en .

:RegulationCategoryCodeList
    rdf:type        owl:Class;
    rdfs:subClassOf :RegulationThing;
    rdfs:subClassOf [
        rdf:type                    owl:Restriction;
        owl:onProperty              cdm1:hasComponent;
        owl:onClass                 :RegulationCategoryCode;
    ] ;
    skos:definition "A list of rule categories that are defined by an authority." .

:RegulatoryScopeCode
    rdf:type        owl:Class ;
    rdfs:subClassOf :RegulationThing ;
    rdfs:subClassOf cdm2:Code ;
    skos:definition "A code indicating the regulatory scope of a rule maker role."@en ;
    skos:example    "general traffic regulations, parking regulations, commercial vehicle regulations, special event regulations"@en .

:RestrictionCode
    rdf:type        owl:Class ;
    rdfs:subClassOf :RegulationThing ;
    rdfs:subClassOf cdm2:Code ;
    skos:definition "A code indicating the specific type of restriction or requirements imposed by the regulation."@en ;
    skos:example    "closed, deviatedToLeft, mergedToLeft"@en .

:StandAloneRestrictionCode
    rdf:type        owl:Class ;
    rdfs:subClassOf :RestrictionCode ;
    rdfs:subClassOf cdm2:Code ;
    skos:definition "A code indicating the type of regulation that does not require any supplemental information."@en .

:SupplementalDataTypeCode
    rdf:type        owl:Class ;
    rdfs:subClassOf :RegulationThing ;
    rdfs:subClassOf cdm2:Code ;
    skos:definition "A code indicating the type of supplemental data required to interpret the current applicability of a regulation."@en ;
    skos:example    "date, time, location, weather, construction status"@en .

:ThresholdRestrictionCode
    rdf:type        owl:Class ;
    rdfs:subClassOf :RestrictionCode ;
    rdfs:subClassOf cdm2:Code ;
    skos:definition "A code indicating the type of regulation that requires a threshold value."@en ;
    skos:example    "Speed limit, minimum distance, maximum clearance"@en .

:TroStatusCode
    rdf:type        owl:Class ;
    rdfs:subClassOf :RegulationThing ;
    rdfs:subClassOf cdm2:Code ;
    skos:definition "A code indicating the lifecycle status of a traffic regulation order"@en ;
    skos:example    "madeAndImplemented, madeAndPartiallyImplemented, madeAndNotImplemented"@en .

:TrustworthinessCode
    rdf:type        owl:Class ;
    rdfs:subClassOf :RegulationThing ;
    rdfs:subClassOf cdm2:Code ;
    skos:definition "A code indicating the trustworthiness of the supplemental data source."@en ;
    skos:example    "trusted, untrusted"@en .

:Trustworthiness
    rdf:type        owl:Class ;
    rdfs:subClassOf :RegulationThing ;
    skos:definition "The trustworthiness of the supplemental data source."@en ;
    skos:note       "Trustworthiness can be defined by a summary code or through a set of detailed attributes, such as the type of data source, the verification method used, provenance, and whether any discrepancy reports are outstanding."@en ;
    skos:editorialNote    "The trustworthiness of the supplemental data source is not part of the DATEX-II model."@en .

:SuspectStatusCode
    rdf:type           owl:Class ;
    rdfs:subClassOf :RegulationThing ;
    rdfs:subClassOf cdm2:Code ;
    skos:definition "A code indicating if any information about the traffic regulation has been flagged as suspect."@en ;
    skos:example    "valid, missing traffic control device - still in effect, missing traffic control device - not in effect until installed, under investigation - additional reports accepted, under investigation - do not report, etc."@en .

:hasTrustworthiness
    rdf:type           owl:ObjectProperty ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    schema:domainIncludes        :TrafficRegulation ;
    schema:rangeIncludes         :Trustworthiness ;
    skos:definition    "The trustworthiness of the object."@en .

:hasOverallTrustworthiness
    rdf:type           owl:ObjectProperty ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    schema:domainIncludes        :Trustworthiness ;
    schema:rangeIncludes         :TrustworthinessCode ;
    skos:definition    "A code indicating the overall trustworthiness of the object."@en .

# ================================================
#                 Regulation Classes
# ================================================

:TrafficRegulation
    rdf:type        owl:Class ;
    rdfs:subClassOf :RegulationThing ;
    rdfs:subClassOf its-core:OfficialThing ;
    rdfs:subClassOf [
        rdf:type                    owl:Restriction ;
        owl:onProperty              :hasLegalBasis ;
        owl:onClass                 :LegalBasis ;
        owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger ;
    ] ;
    dash:abstract true ;
    skos:definition "A traffic regulation is a rule having the force of law that is established by a regulator through a traffic regulation order."@en ;
    skos:editorialNote "The latest release of DATEX-II assigns a legalBasis to each condition rather than to the regulation. This seems odd; I have added a link for both in this model."@en ;
    skos:editorsNote "It is unclear if PermitInformation needs to be associated directly with TrafficRegulation and why. It seems as if PermitCondition is a more appropriate way to describe the association."@en .

:CodedPairRegulation
    rdf:type        owl:Class ;
    rdfs:subClassOf :TrafficRegulation ;
    rdfs:subClassOf [
        rdf:type                    owl:Restriction ;
        owl:onProperty              :hasContext ;
        owl:onClass                 :RegulationContextCode ;
        owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger ;
    ] ;
    rdfs:subClassOf [
        rdf:type                    owl:Restriction ;
        owl:onProperty              :hasRestriction ;
        owl:onClass                 :RestrictionCode ;
        owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger ;
    ] ;
    skos:definition "A restriction defined by a code."@en ;
    rdfs:seeAlso "DATEX-II AlternateRoadOrCarriagewayOrLaneLayout"@en ;
    skos:editorsNote "The type of temporary markings and locations are defined by the associated traffic control devices."@en .

:CodedRegulation
    rdf:type        owl:Class ;
    rdfs:subClassOf :TrafficRegulation ;
    rdfs:subClassOf [
        rdf:type                    owl:Restriction ;
        owl:onProperty              :hasRegulation ;
        owl:onClass                 :StandAloneRestrictionCode ;
        owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger ;
    ] ;
    skos:definition "A restriction defined by a code."@en ;
    rdfs:seeAlso "DATEX-II RushHourLaneRestriction, HardShoulderRunningRestriction, AccessRestriction, DirectionRestriction, WalkingSpeed, MandatoryRoadOrCarriagewayOrLaneUsage, ProhibitionOfOvertaking, PriorityRule, StandingOrParkingControl, TrafficAhead, RoadWarning, AmbientWarning"@en ;
    skos:editorsNote "DATEX-II also has attributes for respect bicycle, motorized personal transport devices, and pedestrians. These can be handled with associated traffic regulations."@en .

:CodedRegulationWithFee
    rdf:type        owl:Class ;
    rdfs:subClassOf :TrafficRegulation ;
    rdfs:subClassOf [
        rdf:type                    owl:Restriction ;
        owl:onProperty              :hasRestriction ;
        owl:onClass                 :FeeRestrictionCode ;
        owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger ;
    ] ;
    rdfs:subClassOf [
        rdf:type                    owl:Restriction ;
        owl:onProperty              :hasFeeSchedule ;
        owl:onClass                 :FeeSchedule ;
        owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger ;
    ] ;
    skos:definition "A condition defined by a code."@en ;
    rdfs:seeAlso "DATEX-II StandingOrParkingControl (for fees)"@en .

:CodedRegulationWithThreshold
    rdf:type        owl:Class ;
    rdfs:subClassOf :TrafficRegulation ;
    rdfs:subClassOf [
        rdf:type                    owl:Restriction ;
        owl:onProperty              :hasRestriction ;
        owl:onClass                 :ThresholdRestrictionCode ;
        owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger ;
    ] ;
    rdfs:subClassOf [
        rdf:type                    owl:Restriction ;
        owl:onProperty              :hasThreshold ;
        owl:onClass                 i72:Measure ;
        owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger ;
    ] ;
    skos:definition "A restriction defined by a code coupled with a threshold value."@en ;
    rdfs:seeAlso "DATEX-II MinimumDistanceRestriction, NumericalSpeedValue, StandingOrParkingControl (for durations), SteepHill"@en .

:TextualRegulation
    rdf:type        owl:Class ;
    rdfs:subClassOf :TrafficRegulation ;
    rdfs:subClassOf its-core:OfficialThing ;
    rdfs:subClassOf [
        rdf:type                    owl:Restriction ;
        owl:onProperty              cdm1:hasDescription ;
        owl:datatypeProperty        rdf:langString ;
        owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger ;
    ] ;
    skos:definition "A textual regulation is a rule having the force of law that is established by a regulator through a traffic regulation order."@en ;
    rdfs:seeAlso "DATEX-II TextualRegulation"@en .

:TrafficRegulationOrder
    rdf:type        owl:Class ;
    rdfs:subClassOf :RegulationThing ;
    rdfs:subClassOf its-core:OfficialThing ;
    rdfs:subClassOf its-core:VersionedThing ;
    rdfs:subClassOf [
        rdf:type                    owl:Restriction ;
        owl:onProperty              :memberTrafficRegulation ;
        owl:onClass                 :TrafficRegulation ;
        owl:minQualifiedCardinality "1"^^xsd:nonNegativeInteger ;
    ] ;
    skos:definition "A legally recognized document or publication issued to enact a specific traffic regulation or regulations by a competent authority."@en .

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

:RuleMakerRole
    rdf:type        owl:Class ;
    rdfs:subClassOf :RegulationThing ;
    rdfs:subClassOf its-agent:Role ;
    skos:definition "A Role that includes the responsibility for creating and maintaining rules of the road or regulations for a geographic and operational scope as defined by the parent jurisdictional entity."@en .

:RequiredSupplementalData a owl:Class;
    rdf:type owl:Class;
    rdfs:subClassOf :MetrThing;
    rdfs:subClassOf [
        rdf:type                    owl:Restriction;
        owl:onProperty              :type;
        owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger;
        owl:onClass                 :SupplementalDataTypeCode;
    ] ;
    skos:definition "Data that a METR user system needs from a supplemental data provider to determine the current applicability of a regulation."@en ;
    skos:example "To determine if a time-based parking restriction is currently active, a METR user system needs to know the current date and time."@en .

# ================================================
#                 Object properties
# ================================================

:associatedTrafficControlDevice
    rdf:type           owl:ObjectProperty ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    skos:definition    "A traffic control device associated with the instance of the traffic regulation."@en ;
    schema:rangeIncludes         :TrafficControlDevice .

:authorizingTrafficRegulation
    rdf:type           owl:ObjectProperty ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    rdfs:inverseOf :associatedTrafficControlDevice ;
    schema:domainIncludes        :TrafficControlDevice ;
    schema:rangeIncludes         :TrafficRegulation ;
    skos:definition    "A traffic regulation that authorizes the instance of the traffic control device."@en .

:hasActivationStatus
    rdf:type           owl:ObjectProperty ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    rdfs:domain        :TrafficRegulation ;
    rdfs:range         :ActivationStatusCode ;
    skos:definition    "A code indicating the activation status of the traffic regulation."@en ;
    rdfs:seeAlso "DATEX II TrafficRegulation.status"@en ;
    skos:editorsNote "DATEX II indicates max 1 rather than exactly 1; the ontology proposes that the value always conceptually exists but realizations may omit in a message or database."@en .

:hasAssociatedRestriction
    rdf:type           owl:ObjectProperty ;
    rdfs:domain        :TrafficRegulation ;
    rdfs:range         :TrafficRegulation ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    skos:definition    "A restriction associated with the traffic regulation."@en .

:hasContext
    rdf:type           owl:ObjectProperty ;
    rdfs:domain        :TrafficRegulation ;
    rdfs:range         :RegulationContextCode ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    skos:definition    "A context associated with the traffic regulation."@en .

:hasFeeSchedule
    rdf:type           owl:ObjectProperty ;
    rdfs:domain        :TrafficRegulation ;
    rdfs:range         :FeeSchedule ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    skos:definition    "A fee schedule associated with the traffic regulation."@en .

:hasThreshold
    rdf:type           owl:ObjectProperty ;
    rdfs:domain        :TrafficRegulation ;
    rdfs:range         i72:Measure ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    skos:definition    "A threshold associated with the traffic regulation."@en .

:hasPermitType
    rdf:type           owl:ObjectProperty ;
    rdfs:domain        :TrafficRegulation ;
    rdfs:range         :PermitType ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    skos:definition    "A type of permit associated with the traffic regulation."@en ;
    rdfs:seeAlso "DATEX II TrafficRegulation.permitInformation"@en ;
    skos:editorsNote "It is unclear if this is needed; it seems as if the PermitCondition addresses permits in a more complete way."@en .

:hasRegulationCategory
    rdf:type           owl:ObjectProperty ;
    rdfs:domain        :TrafficRegulation ;
    rdfs:range         :RegulationCategoryCode ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    skos:definition    "A category of regulation associated with the traffic regulation."@en ;
    skos:editorsNote "DATEX II indicates this is optional, but if we decide location or validity is required as a part of the TR, this should become exactly 1."@en .

:hasRestriction
    rdf:type           owl:ObjectProperty ;
    rdfs:domain        :TrafficRegulation ;
    rdfs:range         :RestrictionCode ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    skos:definition    "A restriction associated with the traffic regulation."@en ;
    skos:editorsNote "DATEX II indicates this is optional, but if we decide location or validity is required as a part of the TR, this should become exactly 1."@en .

:issuedTro
    dcterms:description "A traffic regulation order issued by the entity."@en ;
    rdf:type            owl:ObjectProperty ;
    rdfs:range          :TrafficRegulationOrder ;
    rdfs:subPropertyOf  :RegulationObjectProperty .

:memberTrafficRegulation
    rdf:type           owl:ObjectProperty ;
    rdfs:domain        :TrafficRegulationOrder ;
    rdfs:range         :TrafficRegulation ;
    rdfs:subPropertyOf :RegulationObjectProperty ;
    skos:definition    "A traffic regulation enacted by the traffic regulation order."@en .

:reasonCode
    dcterms:description "A reason justifying the existence of the instance of the traffic regulation order"@en ;
    rdf:type            owl:ObjectProperty ;
    rdfs:range          :ReasonCode ;
    rdfs:subPropertyOf  :RegulationObjectProperty .

:regulatoryScope
    dcterms:description "Indication of the types of regulations that can be enacted by the rule maker."@en ;
    rdf:type            owl:ObjectProperty ;
    rdfs:range          :RegulatoryScopeCode ;
    rdfs:subPropertyOf  :RegulationObjectProperty .

:troStatus
    dcterms:description "The current lifecycle status of the instance of the containing class"@en ;
    rdf:type            owl:ObjectProperty ;
    rdfs:domain         :TrafficRegulationOrder ;
    rdfs:range          :TroStatusCode ;
    rdfs:subPropertyOf  :RegulationObjectProperty ;
    rdfs:seeAlso        "DATEX-II TrafficRegulationOrder.status" .

:hasInceptionDate
    rdf:type           owl:DatatypeProperty ;
    rdfs:subPropertyOf :RegulationDatatypeProperty ;
    rdfs:domain        :TrafficRegulation ;
    rdfs:range         xsd:date;
    skos:definition    "The date on which the traffic regulation can first became applicable whenever all defined conditions are met."@en ;
    skos:note          "A missing inception indicates a future regulation (i.e., a regulation that is not yet in effect)."@en .

:hasTerminationDate
    rdf:type           owl:DatatypeProperty ;
    rdfs:subPropertyOf :RegulationDatatypeProperty ;
    rdfs:domain        :TrafficRegulation ;
    rdfs:range         xsd:date;
    skos:definition    "The date after which the traffic regulation became or is expected to become no longer applicable regardless of the current validity of the defined conditions."@en ;
    skos:note          "A missing termination implies a permanent regulation (i.e., a regulation that has no known end date). "@en , 
                       "The date indicates the last date on which the traffic regulation is still applicable."@en .

:hasTextualRestriction
    rdf:type           owl:DatatypeProperty ;
    rdfs:domain        :TrafficRegulation ;
    rdfs:range         rdf:langString ;
    rdfs:subPropertyOf :RegulationDatatypeProperty ;
    skos:definition    "A textual restriction associated with the traffic regulation."@en .

:isSuspect
    rdf:type           owl:DatatypeProperty ;
    rdfs:subPropertyOf :RegulationDatatypeProperty ;
    rdfs:domain        :TrafficRegulation ;
    rdfs:range         :SuspectStatusCode ;
    skos:definition    "A code indicating if the traffic regulation is suspect."@en ;
    skos:note          "A suspect regulation is a regulation that is not yet fully implemented or is not yet in effect."@en .