@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix loze: <https://loze-ontology.org/> .
@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 skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<https://loze-ontology.org/temporal-relations> a owl:Ontology ;
    rdfs:label "Temporal Relations" ;
    dcterms:license <https://creativecommons.org/licenses/by/4.0/> ;
    skos:definition "An extension of loze-foundation.ttl that consists of relations for modelling temporal location, coordinates, and duration" ;
    owl:imports loze: .

##########################
# Temporal mereotopology #
##########################

loze:isSubperiodOf a owl:TransitiveProperty ;
    rdfs:label "is Subperiod Of" ;
    skos:definition "The relation that obtains between two periods of time of which the former is a part or segment of the latter" ;
    skos:example "The year 1969 is a sub-period of the 20th century, the period 1740-1751 is a sub-period of the period 1740-1789, June 1816 is a sub-period of the year 1816" ;
    rdfs:domain loze:PeriodOfTime ;
    rdfs:range loze:PeriodOfTime .

loze:hasSubperiod a owl:TransitiveProperty ;
    rdfs:label "has Subperiod" ;
    skos:definition "The relation that obtains between two periods of time when the former has as part or segment the latter" ;
    rdfs:domain loze:PeriodOfTime ;
    rdfs:range loze:PeriodOfTime ;
    owl:inverseOf loze:isSubperiodOf .

loze:isLaterThanPeriod a owl:TransitiveProperty ;
    rdfs:label "is Later Than Period" ;
    skos:definition "The relation that obtains between a period of time p and another period of time p' if and only if p is entirely posterior to p' along the temporal axis" ;
    skos:example "The year 2008 is later than 1972, the early modern period is later than classical antiquity, the 16th century is later than the 13th century" ;
    skos:note "This relation does not obtain in those cases in which one period is only partly posterior to another one - for example, it does not obtain between the 1800-1850 period and the 1815-1870 period" ;
    rdfs:domain loze:PeriodOfTime ;
    rdfs:range loze:PeriodOfTime .

loze:isEarlierThanPeriod a owl:TransitiveProperty ;
    rdfs:label "is Earlier Than Period" ;
    skos:definition "The relation that obtains between a period of time p and another period of time p' if and only if p is entirely anterior to p' along the temporal axis" ;
    rdfs:domain loze:PeriodOfTime ;
    rdfs:range loze:PeriodOfTime ;
    owl:inverseOf loze:isLaterThanPeriod .

loze:isSubsequentPeriodTo a owl:ObjectProperty ;
    rdfs:label "is Subsequent Period To" ;
    skos:definition "The relation that obtains between a period of time p and another period of time p' if and only if p immediately follows the end of p' along the temporal axis" ;
    skos:example "The 19th century is subsequent to the 18th century, 4 May 1999 is subsequent to 3 May 1999, the year 1768 is subsequent to the year 1767" ;
    skos:note "Since 4 May 1999 starts when 3 May ends, one could argue that there is actually an instant of time that belongs to both the 3rd and the 4th; these are complex issues at the interface of metaphysics and mathematics that we cannot address here; however, their practical relevance is nil, since we will never need to refer to instants, but only to extended, non-instantaneous periods of time" ;
    rdfs:domain loze:PeriodOfTime ;
    rdfs:range loze:PeriodOfTime ;
    rdfs:subPropertyOf loze:isLaterThanPeriod .

loze:hasSubsequentPeriod a owl:ObjectProperty ;
    rdfs:label "has Subsequent Period" ;
    skos:definition "The relation that obtains between a period of time p and another period of time p' if and only if p' immediately follows the end of p along the temporal axis" ;
    rdfs:domain loze:PeriodOfTime ;
    rdfs:range loze:PeriodOfTime ;
    owl:inverseOf loze:isSubsequentPeriodTo .



#####################
# Temporal Location #
#####################

loze:atTime a owl:ObjectProperty ;
    rdfs:label "at Time" ;
    skos:definition "The relation that obtains between an eventuality e and a period of time t if and only if e is the case or is occurring at t" ;
    skos:example "WWII was happening at 1943, the French Revolution was happening at 1790, the Italian Renaissance was happening at 1513" ;
    skos:note "This relation doesn't necessarily relate an eventuality to the entire period of time when it occurs; for example, WWII started in 1939 and ended in 1945, but it was still under way in 1943, so it also holds loze:atTime with 1943" ;
    rdfs:domain loze:Eventuality ;
    rdfs:range loze:PeriodOfTime .

loze:afterTime a owl:ObjectProperty ;
    rdfs:label "after Time" ;
    skos:definition "The relation that obtains between an eventuality e and a period of time t if and only if e occurs entirely after t" ;
    skos:example "WWII occurred after 1900, the birth of Napoleon occurred after 1700" ;
    skos:note "The relation obtains even if the eventuality does not occur immediately after the period of time: for example, WWII occurred after 1900, even though it only started in 1939" ;
    rdfs:domain loze:Eventuality ;
    rdfs:range loze:PeriodOfTime .

loze:beforeTime a owl:ObjectProperty ;
    rdfs:label "before Time" ;
    skos:definition "The relation that obtains between an eventuality e and a period of time t if and only if e occurs entirely before t" ;
    skos:example "WWII occurred before 1960, the birth of Napoleon occurred before 1800" ;
    skos:note "The relation obtains even if the eventuality does not occur right before the period of time: for example, WWII occurred before 1970, even though over two decades passed between the end of WWII and 1970" ;
    rdfs:domain loze:Eventuality ;
    rdfs:range loze:PeriodOfTime .

loze:fromTime a owl:ObjectProperty ;
    rdfs:label "from Time" ;
    skos:definition "The relation that obtains between an eventuality e and a period of time t if and only if e starts occurring at t" ;
    skos:example "WWII occurred from 1939, the Thirty Years' War occurred from 1618, Napoleon's life occurred from 1769" ;
    rdfs:domain loze:Eventuality ;
    rdfs:range loze:PeriodOfTime .

loze:untilTime a owl:ObjectProperty ;
    rdfs:label "until Time" ;
    skos:definition "The relation that obtains between an eventuality e and a period of time t if and only if e ends at t" ;
    skos:example "WWII occurred until 1945, the Thirty Years' War occurred until 1648, Napoleon's life occurred until 1821" ;
    rdfs:domain loze:Eventuality ;
    rdfs:range loze:PeriodOfTime .

loze:throughoutTime a owl:ObjectProperty ;
    rdfs:label "throughout Time" ;
    skos:definition "The relation that obtains between an eventuality e and a period t if and only if e occurs starting from the beginning of t and until the end of t" ;
    skos:example "WWII occurred throughout the 1939-1945 period, the Thirty Years' War occurred throughout the 1618-1648 period, Napoleon's life occurred throughout the 1769-1821 period" ;
    skos:note "The function of this relation is to specify the temporal location of an eventuality as a whole" ;
    rdfs:domain loze:Eventuality ;
    rdfs:range loze:PeriodOfTime .

loze:withinTime a owl:ObjectProperty ;
    rdfs:label "within Time" ;
    skos:definition "The relation that obtains between an eventuality e and a period of time t if and only if e occurs throughout a sub-period of t" ;
    skos:example "WWII occurred within the 20th century, the Thirty Years' War occurred within the 1620-1650 period, the Italian Renaissance occurred within the second millennium" ;
    rdfs:domain loze:Eventuality ;
    rdfs:range loze:PeriodOfTime .


#####################################
# Temporal Coordinates and Duration #
#####################################

loze:hasTemporalCoordinate a owl:DatatypeProperty ;
    rdfs:label "has Temporal Coordinate" ;
    skos:definition "The relation that assigns a temporal coordinates representation to a period of time" ;
    rdfs:domain loze:PeriodOfTime ;
    rdfs:range [ a rdfs:Datatype ; 
                owl:unionOf ( xsd:dateTime xsd:dateTimeStamp xsd:date xsd:time xsd:gYear xsd:gYearMonth xsd:gMonth xsd:gMonthDay xsd:gDay ) ] .

loze:hasDuration a owl:DatatypeProperty ;
    rdfs:label "has Duration" ;
    skos:definition "The relation that assigns a duration to an eventuality or a period of time" ;
    rdfs:domain [ a owl:Class ;
                owl:unionOf ( loze:Eventuality loze:PeriodOfTime ) ] ;
    rdfs:range xsd:duration .