An Ontology of Time for the Semantic Web
Jerry R. Hobbs and Feng Pan
University of Southern California
/ Information Sciences Institute ________________________________________________________________________
In connection with the DAML project for bringing about the Semantic Web, an ontology of time is being developed for describing the temporal content of Web pages and the temporal properties of Web services. The bulk of information on the Web is in natural language, and this information will be easier to encode for the Semantic Web insofar as community-wide annotation and automatic tagging schemes and the DAML time ontology are compatible with each other.
Categories and Subject
Descriptors: I.2.4 [Artificial Intelligence]: Knowledge Representation Formalisms and Methods - Representations
(procedural and rule-based); Temporal logic; I.2.7
[Artificial Intelligence]: Natural Language Processing - Text
analysis; H.3.5
[Information Storage and Retrieval]: Online
Information Services - Web-based services; H.3.1 [Information Storage and
Retrieval]: Content Analysis and Indexing - Linguistic processing
General Terms: Design, Documentation, Languages, Theory
Additional Key Words and Phrases: ontology, time, semantic web, temporal information, temporal relation, duration, clock and calendar, time zone
________________________________________________________________________
The DARPA Agent Markup Language
(DAML) project is DARPA¹s effort to bring into reality the Semantic Web, in
which Web users and automatic agents will be able to access information on the
Web via descriptions of the content and capabilities of Web resources rather
than via key words. An important part of this effort is the development of
representative ontologies of the most commonly used domains. We have developed
such an ontology of temporal concepts, for describing the temporal content of
Web pages and the temporal properties of Web services. This effort has been
informed by temporal ontologies developed at a number of sites and is intended
to capture the essential features of all of them and make them easily available
to a large group of Web developers and users, embedded in the ontology mark-up
language OWL[1].
The bulk of information on the Web is in natural
language, and this information will be easier to encode for the Semantic Web
insofar as community-wide annotation and automatic tagging schemes and the DAML
time ontology are compatible with each other. Indeed, this compatibility was
explored by Hobbs and Pustejovsky [2003].
In this paper we outline the temporal ontology.
Five categories of temporal concepts are considered, and for each the principal
predicates and their associated properties are described.
A note on notation before we begin: Conjunction
(
) takes
precedence over implication ( É ) and
equivalence ( º ). Formulas are assumed
to be universally quantified on the variables appearing in the antecedent of
the highest-level implication. Thus,
p
(x)
p
(y) É q
(x,y)
q
(y)
is to be interpreted as
(" x,y)[[p
(x)
p
(y)] É [q
(x,y)
q
(y)]]
2. Topological Temporal Relations
2.1 Instants and Intervals
There are two subclasses of TemporalEntity: Instant and Interval.
Instant(t) É TemporalEntity(t)
Interval(T) É TemporalEentity(T)
These are the only two subclasses of temporal entities.
(" T)[TemporalEntity(T) É Interval(T) Ú Instant(T)
As we will see, intervals are, intuitively, things with extent and instants are, intuitively, point-like in that they have no interior points. (In what follows, lower case t is used for instants, upper case T for intervals and for temporal-entities unspecified as to subtype. This is strictly for the reader¹s convenience, and has no formal significance.)
The predicates begins and ends are relations between instants and temporal entities.
begins(t,T) É
Instant(t)
TemporalEntity(T)
ends(t,T) É
Instant(t)
TemporalEntity(T)
For convenience, we can say that the beginning and end of an instant is itself. The converses of these rules are also true.
Instant(t) É begins(t,t)
Instant(t) É ends(t,t)
The beginnings and ends of temporal entities, if they exist, are unique.
TemporalEntity(T)
begins(t
,T)
begins(t
,T) É t
= t
TemporalEntity(T)
ends(t
,T)
ends(t
,T) É t
= t![]()
In one approach to infinite intervals, a positively infinite interval has no end, and a negatively infinite interval has no beginning. Hence, we use the relations begins and ends in the core ontology, rather than defining functions beginningOf and endOf, since the functions would not be total. They can be defined in an extension of the core ontology that posits instants at positive and negative infinity.
The predicate inside is a relation between an instant and an interval.
inside(t,T) É
Instant(t)
Interval(T)
This concept of inside is not intended to include beginnings and ends of intervals, as will be seen below.
It will be useful in characterizing clock and calendar terms to have a relation between instants and intervals that says that the instant is inside or the beginning of the interval.
(" t,T)[beginsOrIn(t,T) º [begins(t,T) Ú inside(t,T)]]
The predicate timeBetween is a relation among a temporal entity and two instants.
timeBetween(T,t
,t
) É TemporalEntity(T)
Instant(t
)
Instant(t
)
The two instants are the beginning and end points of the temporal entity.
(" t
,t
)[t
¹ t
É (" T)[timeBetween(T,t
,t
) º begins(t
,T)
ends(t
,T)]]
The ontology is silent about whether the interval from t to t, if it exists, is identical to the instant t.
The ontology is silent about whether intervals consist of instants.
The ontology is silent about whether intervals are uniquely determined by their starts and ends.
The core ontology is silent about whether intervals are uniquely determined by their beginnings and ends.
We can define a proper interval as one whose start and end are not identical.
(" T)ProperInterval(T)
º Interval(T)
(" t
,t
)[begins(t
,T)
ends(t
,T) É t
¹ t
]]
The ontology is silent about whether there are any intervals that are not proper intervals.
2.2 Before
There is a before relation on temporal entities, which gives
directionality to time. If temporal entity T
is before temporal entity T
, then the end of T
is before the start of T
. Thus, before
can be considered to be basic to instants and derived for intervals.
(" T
,T
)[before(T
,T
)
º ($ t
,t
)[ends(t
,T
)
begins(t
,T
)
before(t
,t
)]]
The before relation is anti-reflexive, anti-symmetric and
transitive.
before(T
,T
) É T
¹ T
before(T
,T
) É Øbefore(T
,T
)
before(T
,T
)
before(T
,T
) É before(T
,T
)
The end of an interval is not
before the beginning of the interval.
Interval(T)
begins(t
,T)
ends(t
,T) É Øbefore(t
,t
)
The beginning of a proper
interval is before the end of the interval.
ProperInterval(T)
begins(t
,T)
ends(t
,T) É before(t
,t
)
If one instant is before another,
there is a time between them.
Instant(t
)
Instant(t
)
before(t
,t
) É ($ T) timeBetween(T,t
,t
)
The ontology is silent about
whether there is a time from t to t.
If an
instant is inside a proper interval, then the beginning of the interval is
before the instant, which is before the end of the interval. This is the
principal property of inside.
inside(t,T)
begins(t
,T)
ends(t
,T)
ProperInterval(T)
É before(t
,t)
before(t,t
)
The relation after is defined in terms of before.
after(T
,T
) º before(T
,T
)
The ontology is silent about
whether time is linearly ordered. Thus it supports theories of time, such as
the branching futures theory, which conflate time and possibility or knowledge.
The basic ontology is silent about whether time
is dense, that is, whether between any two instants there is a third instant.
Thus it supports theories in which time consists of discrete instants.
2.3 Interval Relations
The relations between intervals
defined in Allen¹s temporal interval calculus [Allen and Kautz 1985; Allen and
Ferguson 1997] can be defined in a straightforward fashion in terms of before and identity on the beginning and end points. It is
a bit more complicated than the reader might at first suspect, because
allowance has to be made for the possibility of infinite intervals. Where one
of the intervals could be infinite, the relation between the end points has to
be conditionalized on their existence.
The standard interval calculus assumes all
intervals are proper, and we will do that here too. The definitions of the
interval relations in terms of before
relations among their beginning and end points, when they exist, are given by
the following axioms. In these axioms, t
and t
are the beginning and end of interval T
; t
and t
are the beginning and end of T
.
(" T
,T
)[intEquals(T
,T
)
º [ProperInterval(T
)
ProperInterval(T
)
(" t
)[begins(t
,T
) º begins(t
,T
)]
(" t
)[ends(t
,T
) º ends(t
,T
)]]]
(" T
,T
)[intBefore(T
,T
)
º ProperInterval(T
)
ProperInterval(T
)
before(T
,T
)]
(" T
,T
)[intMeets(T
,T
)
º [ProperInterval(T
)
ProperInterval(T
)
($ t)[ends(t,T
)
begins(t,T
)]]]
(" T
,T
)[intOverlaps(T
,T
)
º [ProperInterval(T
)
ProperInterval(T
)
($ t
,t
)[ends(t
,T
)
begins(t
,T
)
before(t
,t
)
(" t
)[begins(t
,T
) É before(t
,t
)]
(" t
)[ends(t
,T
) É before(t
,t
)]]]]
(" T
,T
)[intStarts(T
,T
)
º [ProperInterval(T
)
ProperInterval(T
)
($ t
)[ends(t
,T
)
(" t
)[begins(t
,T
) º begins(t
,T
)]
(" t
)[ends(t
,T
) É before(t
,t
)]]]]
(" T
,T
)[intDuring(T
,T
)
º [ProperInterval(T
)
ProperInterval(T
)
($ t
,t
)[begins(t
,T
)
ends(t
,T
)
(" t
)[begins(t
,T
) É before(t
,t
)]
(" t
)[ends(t
,T
) É before(t
,t
)]]]]
(" T
,T
)[intFinishes(T
,T
)
º [ProperInterval(T
)
ProperInterval(T
)
($ t
)[begins(t
,T
)
(" t
)[begins(t
,T
) É before(t
,t
)]
(" t
)[ends(t
,T
) º ends(t
,T
)]]]]
The inverse interval relations
can be defined in terms of these relations.
intAfter(T
,T
) º intBefore(T
,T
)
intMetBy(T
,T
) º intMeets(T
,T
)
intOverlappedBy(T
,T
) º intOverlaps(T
,T
)
intStartedBy(T
,T
) º intStarts(T
,T
)
intContains(T
,T
) º intDuring(T
,T
)
intFinishedBy(T
,T
) º intFinishes(T
,T
)
In addition, it will be useful
below to have a single predicate for intervals intersecting in at most an
instant.
nonoverlap(T
,T
)
º [intBefore(T
,T
) Ú intAfter(T
,T
) Ú intMeets(T
,T
)
Ú intMetBy(T
,T
)]
We could have as easily defined
this in terms of before relations on the
beginnings and ends of the intervals.
So far, the concepts and axioms in the ontology of time would be appropriate for scalar phenomena in general.
2.4 Linking Time and Events
The time ontology links to other
things in the world through four predicates — atTime, during,
holds, and timeSpan. We assume that another ontology provides for the
description of events—either a general ontology of event structure
abstractly conceived, or specific, domain-dependent ontologies for specific domains.
The term ³eventuality" will be used to
cover events, states, processes, propositions, states of affairs, and anything
else that can be located with respect to time. The possible natures of
eventualities would be spelled out in the event ontologies. The term
³eventuality" in this paper is only an expositional convenience and has no
formal role in the time ontology.
The predicate atTime relates an eventuality to an instant, and is
intended to say that the eventuality holds, obtains, or is taking place at that
time.
atTime(e,t) É Instant(t)
The predicate during relates an eventuality to an interval, and is
intended to say that the eventuality holds, obtains, or is taking place during
that interval.
during(e,T) É Interval(T)
If an eventuality obtains during
an interval, it obtains at every instant inside the interval and during every
subinterval.
during(e,T)
inside(t,T) É atTime(e,t)
during(e,T)
intDuring(T
,T) É during(e,T
)
Note that this means that an
intermittant activity, like writing a book, does not hold ³during" the
interval from the beginning to the end of the activity. Rather the ³convex
hull" of the activity holds ³during" the interval.
Whether a particular process is viewed as
instantaneous or as occuring over an interval is a granularity decision that
may vary according to the context of use, and is assumed to be provided by the
event ontology.
Often the eventualities in the event ontology
are best thought of as propositions, and the relation between these and times
is most naturally called holds. The
predication holds(e,T)
would say that e holds at instant
T or during interval T. The predicate holds would be part of the event ontology, not part of the
time ontology, although its second argument would be be provided by the time
ontology. The designers of the event ontology may or may not want to relate holds to atTime
and during by axioms such as the
following:
holds(e,t)
Instant(t) º atTime(e,t)
holds(e,T)
Interval(T) º during(e,T)
Similarly, the event ontology may
provide other ways of linking events with times, for example, by including a
time parameter in predications.
p(x,t)
This time ontology provides ways
of reasoning about the t¹s; their use as
arguments of predicates from another domain would be a feature of the ontology
of the other domain.
The predicate timeSpan relates eventualities to instants or intervals (or
temporal sequences of instants and intervals). For contiguous states and
processes, it tells the entire instant or interval for which the state or
process obtains or takes place.
timeSpan(T,e) É TemporalEntity(T) Ú tseq(T)[2]
timeSpan(T,e)
Interval(T) É during(e,T)
timeSpan(t,e)
Instant(t) É atTime(e,t)
timeSpan(T,e)
Interval(T)
Øinside(t,T)
Øbegins(t,T)
Øends(t,T)
É ØatTime(e,t)
timeSpan(t,e)
Instant(t)
t
¹ t É ØatTime(e,t
)
Whether the eventuality obtains
at the start and end points of its time span is a matter for the event ontology
to specify. The silence here on this issue is the reason timeSpan is not defined in terms of necessary and sufficient
conditions.
In an extension of the time ontology, we also
allow temporal predicates to apply directly to events, should the user wish.
Thus, begins(t,e)
says that the instant t begins
the interval that is the time span of eventuality e; see the documentation[3]
for details.
Different communities have different ways of representing the times and durations of states and events (or processes). In one approach, states and events can both have durations, and at least events can be instantaneous. In another approach, events can only be instantaneous and only states can have durations. In the latter approach, events that one might consider as having duration (e.g., heating water) are modeled as a state of the system that is initiated and terminated by instantaneous events. That is, there is the instantaneous event of the start of the heating at the start of an interval, that transitions the system into a state in which the water is heating. The state continues until another instantaneous event occurs—the stopping of the heating at the end of the interval. These two perspectives on events are straightforwardly interdefinable in terms of the ontology we have provided. This is a matter for the event ontology to specify. This time ontology is neutral with respect to the choice.
3. Measuring Durations
3.1 Temporal Units
This development assumes ordinary
arithmetic is available.
There are at least two approaches that can be
taken toward measuring intervals. The first is to consider units of time as
functions from Intervals to Reals. Because of infinite intervals, the range
must also include Infinity.
minutes: Intervals Reals È {Infinity}
minutes([5:14,5:17]) = 3
The other approach is to consider
temporal units to constitute a set of entities — call it TemporalUnits —
and have a single function duration
mapping Intervals ´
TemporalUnits into the Reals.
duration: Intervals ´
TemporalUnits Reals È {Infinity}
duration([5:14,5:17],*Minute*) = 3
The two approaches are
interdefinable:
seconds(T) = duration(T,*Second*)
minutes(T) = duration(T,*Minute*)
hours(T) = duration(T,*Hour*)
days(T) = duration(T,*Day*)
weeks(T) = duration(T,*Week*)
months(T) = duration(T,*Month*)
years(T) = duration(T,*Year*)
Ordinarily, the first is more
convenient for stating specific facts about particular units. The second is
more convenient for stating general facts about all units.
The arithmetic relations among the various units
are as follows:
seconds(T) = 60*minutes(T)
minutes(T) = 60*hours(T)
hours(T) = 24*days(T)
days(T) = 7*weeks(T)
months(T) = 12*years(T)
The relation between days and months (and, to a lesser extent, years) will be specified as part of the ontology of clock and calendar below. On their own, however, month and year are legitimate temporal units.
3.2 Concatenation and Hath
The multiplicative relations
above don¹t tell the whole story of the relations among temporal units.
Temporal units are composed of smaller
temporal units. A larger temporal unit is a concatenation of smaller temporal
units. We will first define a general relation of concatenation between an
interval and a set of smaller intervals. Then we will introduce a predicate Hath that specifies the number of smaller unit intervals
that concatenate to a larger interval.
Concatenation: A proper interval x is a concatenation of a set S of proper intervals if and only if S covers all of x, and all members of S
are subintervals of x and are
mutually disjoint. (The third conjunct on the right side of º is because beginsOrIn only covers instants that begin or are inside x.)
concatenation(x,S)
º ProperInterval(x)
(" z)[beginsOrIn(z,x) É ($ y)[member(y,S)
beginsOrIn(z,y)]]
(" z)[ends(z,x) É ($ y)[member(y,S)
ends(z,y)]]
(" y)[member(y,S)
É [intStarts(y,x) Ú intDuring(y,x) Ú intFinishes(y,x)
Ú intEquals(y,x)]]
(" y
,y
)[member(y
,S)
member(y
,S)
É [y
= y
Ú nonoverlap(y
,y
)]]
The following properties of concatenation can be proved as theorems:
There are elements in S that start and finish x:
concatenation(x,S) É ($ ! y
)[member(y
,S)
intStarts(y
,x)]
concatenation(x,S) É ($ ! y
)[member(y
,S)
intFinishes(y
,x)]
If S is a singleton set, its single element is x.
concatenation(x,S)
card(S) = 1
É S = {x}
The property of convexity holds
in the ontology if and only if the end points of an interval uniquely determine
it. This is an assumption the user can make for any application and will
normally want to.
Convex() º (" T
,T
)[intEquals(T
,T
) º T
= T
]
If convexity holds, then except
for the first and last elements of S,
every element of S has elements
that precede and follow it.
Convex() É
[concatenation(x,S)
É (" y
)[member(y
,S)
É [intFinishes(y
,x)
Ú ($ ! y
)[member(y
,S)
intMeets(y
,y
)]]]]
Convex() É
[concatenation(x,S)
É (" y
)[member(y
,S)
É [intStarts(y
,x)
Ú ($ ! y
)[member(y
,S)
intMeets(y
,y
)]]]]
The uniqueness ($ !) follows from nonoverlap.
Hath: The
basic predicate used here for expressing the composition of larger intervals
out of smaller clock and calendar intervals is Hath, from statements like ³30 days hath September"
and ³60 minutes hath an hour." Its structure is
Hath(N,u,x)
meaning ³N proper intervals of
duration one unit u hath the proper interval
x." That is, if Hath(N,u,x)
holds, then x is the
concatenation of N unit intervals
where the unit is u. For example,
if x is some month of September
then Hath(30,*Day*,x)
would be true.
Hath
is defined as follows:
Hath(N,u,x) º ($ S)[card(S) = N
(" z)[member(z,S) É duration(z,u) = 1]
concatenation(x,S)]
That is, x is the concatenation of a set S of N
proper intervals of duration one unit u.
The type constraints on its arguments can be
proved as a theorem: N is an integer
(assuming that is the constraint on the value of card), u is
a temporal unit, and x is a
proper interval:
Hath(N,u,x) É integer(N)
TemporalUnit(u)
ProperInterval(x)
This treatment of concatenation will work for scalar phenomena in general. This
treatment of Hath will work for
measurable quantities in general.
3.3 The Structure of Temporal Units
We now define predicates true of
intervals that are one temporal unit long. For example, week is a predicate true of intervals whose duration is
one week.
second(T) º seconds(T) = 1
minute(T) º minutes(T) = 1
hour(T) º hours(T) = 1
day(T) º days(T) = 1
week(T) º weeks(T) = 1
month(T) º months(T) = 1
year(T) º years(T) = 1
We are now in a position to state
the relations between successive temporal units.
minute(T) É Hath(60,*Second*,T)
hour(T) É Hath(60,*Minute*,T)
day(T) É Hath(24,*Hour*,T)
week(T) É Hath(7,*Day*,T)
year(T) É Hath(12,*Month*,T)
The relations between months and days are discussed in Section 4.5.
4. Clock and Calendar
4.1 Time Zones
What hour of the day an instant
is in is relative to the time zone. This is also true of minutes, since there
are regions in the world, e.g., central Australia, where the hours are not
aligned with GMT hours, but are, e.g., offset half an hour. To our knowledge, seconds
are not relative to the time zone.
Days, weeks, months and years are also relative
to the time zone, since, e.g., 2004 began in the Eastern Standard time zone
three hours before it began in the Pacific Standard time zone. Thus,
predications about all clock and calendar intervals except seconds are relative
to a time zone.
This can be carried to what seems like a
ridiculous extreme, but turns out to yield a very concise treatment. The Common
Era (C.E. or A.D.) is also relative to a time zone, since 2004 years ago, it
began three hours earlier in what is now the Eastern Standard time zone than in
what is now the Pacific Standard time zone. What we think of as the Common Era
is in fact 24 (actually more) slightly displaced half-infinite intervals. (We
leave B.C.E. to specialized ontologies.)
The principal functions and predicates will
specify a clock or calendar unit interval to be the nth such unit in a larger interval. The time zone need
not be specified in this predication if it is already built into the nature of
the larger interval. That means that the time zone only needs to be specified
in the largest interval, that is, the Common Era; that time zone will be
inherited by all smaller intervals. Thus, the Common Era can be considered as a
function from time zones to intervals.
CE(z) = T
Fortunately, this
counterintuitive conceptualization will usually be invisible and, for example,
will not be evident in the most useful expressions for time, in Section 4.5
below. In fact, the CE predication functions as a good place to hide
considerations of time zone when they are not relevant.
We have been refering to time zones, but in fact
it is more convenient to work in terms of what we might call the ³time
standard" that is used in a time zone. That is, it is better to work with
*PST* as a legal entity than with the *PST* zone as a geographical region. A
time standard is a way of computing the time, relative to a world-wide system
of computing time. For each time standard, there is a zone, or geographical
region, and a time of the year in which it is used for describing local times.
Where and when a time standard is used have to be axiomatized, and this
involves interrelating a time ontology and at least a simple geographical
ontology. These relations can be quite complex. We have done this for the
entire world; see Section 4.2.
If we were to conflate time zones (i.e.,
geographical regions) and time standards, it would likely result in problems in
several situations. For example, the Eastern Standard zone and the Eastern
Daylight zone are not identical, since most of Indiana is on Eastern Standard
time all year. The state of Arizona and the Navajo Indian Reservation, two
overlapping geopolitical regions, have different time standards – one is
Pacific and one is Mountain.
Time standards that seem equivalent, like
Eastern Standard and Central Daylight, should be thought of as separate
entities. Whereas they function the same in the time ontology, they do not
function the same in the ontology that articulates time and geography. For
example, it would be false to say those parts of Indiana shift in April from
Eastern Standard to Central Daylight time.
4.2 Time Zone Data in OWL
We have developed a time zone
resource in OWL for not only the US but also the entire world[4],
including three parts: the time ontology file, the US time zone instance file,
and the world time zone instance file.
The time zone ontology links a simple geographic
ontology with our time ontology. It defines a vocabulary about regions,
political regions (countries, states, counties, reservations, and cities), time
zones, daylight savings policies, and the relationships among these concepts.
Its instances also link to other existing data on the Web, such as Terry
Payne¹s US states instances[5],
FIPS 55 county instances[6],
and ISO country instances[7].
It can handle all the usual time zone and
daylight savings cases. For example, Los Angles uses PST, the time offset from
Greenwich Mean Time (GMT) is -8 hours, and it observed daylight savings from
April 4 to October 31 in 2004. But it handles unusual cases as well. For
example, in Idaho the northern part is in the Pacific zone, the southern part
in the Mountain. The city of West Wendover, Nevada is in the Mountain time
zone, while the rest of Nevada is in the Pacific.
For the details, see the documentation[8] which includes an outline of the ontology and examples of anticipated use.
4.3 Clock and Calendar Units
The aim of this section is to
explicate the various standard clock and calendar intervals. A day as a
calender interval begins at and includes midnight and goes until but does not
include the next midnight. By contrast, a day as a duration is any interval
that is 24 hours in length. The day as a duration was dealt with in Section 3.
This section deals with the day as a calendar interval.
Including the beginning but not the end of a
calendar interval in the interval may strike some as arbitrary. But we get a
cleaner treatment if, for example, all times of the form 12:xx a.m., including
12:00 a.m. are part of the same hour and day, and all times of the form
10:15:xx, including 10:15:00, are part of the same minute.
It is useful to have three ways of saying the
same thing: the clock or calendar interval y is the nth clock or
calendar interval of type u in a
larger interval x in time zone z. This can be expressed as follows for minutes:
min(y,n,x)
Under the reasonable assumption
that there is only one such y, this can
also be expressed as follows:
minFn(n,x) = y
For stating general properties
about clock intervals, it is useful also to have the following way to express
the same thing:
clockInt(y,n,u,x)
This expression says that y is the nth
clock interval of type u in x. For example, the proposition clockInt(10:03,3,*Minute*,[10:00,11:00]) holds.
Here u is
a member of the set of clock units, that is, one of *Second*, *Minute*, or
*Hour*.
The larger interval x may not line up exactly with clock intervals. In
this case we take y to be the nth complete clock interval of type u
in x.
In addition, there is a calendar unit function
with similar structure:
calInt(y,n,u,x)
This says that y is the nth
calendar interval of type u in x. For example, the proposition calInt(12Mar2002,12,*Day*,Mar2002)
holds. Here u is one of the
calendar units *Day*, *Week*, *Month*, and *Year*.
The unit *DayOfWeek* will be introduced below in
Section 4.4.
The relations among these modes of expression
are as follows:
sec(y,n,x) º clockInt(y,n,*Second*,x)
secFn(n,x) = y º
clockInt(y,n,*Second*,x)
min(y,n,x) º clockInt(y,n,*Minute*,x)
minFn(n,x) = y º
clockInt(y,n,*Minute*,x)
hr(y,n,x) º clockInt(y,n,*Hour*,x)
hrFn(n,x) = y º
clockInt(y,n,*Hour*,x)
da(y,n,x) º calInt(y,n,*Day*,x)
daFn(n,x) = y º
calInt(y,n,*Day*,x)
mon(y,n,x) º calInt(y,n,*Month*,x)
monFn(n,x) = y º
calInt(y,n,*Month*,x)
yr(y,n,x) º calInt(y,n,*Year*,x)
yrFn(n,x) = y º
calInt(y,n,*Year*,x)
Weeks and months are dealt with
separately below.
The am/pm designation of hours is represented by
the function hr12.
hr12(y,n,*am*,x) º hr(y,n,x)
hr12(y,n,*pm*,x) º hr(y,n+12,x)
A distinction is made above
between clocks and calendars because they differ in how they number their unit
intervals. The first minute of an hour is labelled with 0; for example, the
first minute of the hour [10:00,11:00] is 10:00. The first day of a month is
labelled with 1; the first day of March is March 1. We number minutes for the
number just completed; we number days for the day we are working on. Thus, if
the larger unit has N smaller units, the
argument n in clockInt runs from 0 to N-1, whereas in calInt n runs
from 1 to N. To state properties
true of both clock and calendar intervals, we can use the predicate calInt and relate the two notions with the axiom
calInt(y,n,u,x) º clockInt(y,n-1,u,x)
Note that the Common Era is a
calendar interval in this sense, since it begins with 1 C.E. and not 0 C.E.
The type constraints on the arguments of calInt are as follows:
calInt(y,n,u,x) É Interval(y)
integer(n)
TemporalUnit(u)
Interval(x)
Each of the calendar intervals is
that unit long; for example, a calendar year is a year long.
calInt(y,n,u,x) É duration(y,u) = 1
There are properties relating to
the labelling of clock and calendar intervals. If N u¹s
hath x and y is the nth
u in x, then n
is between 1 and N.
calInt(y,n,u,x)
Hath(N,u,x) É 0 < n £ N
The larger interval x need not line up with calendar intervals. For
example, it might go from 12:36 pm, February 1, to 12:36 pm, February 3; this
interval Hath two days, but not
two calendar days. However, if x
is itself a calendar interval, and u
is a unit other than *Week*, then there is a 1st small interval, and it starts
the large interval.
Hath(N,u,x)
calInt(x,n
,u
,x
)
u ¹ *Week* É ($ ! y)
calInt(y,1,u,x)
Hath(N,u,x)
calInt(x,n
,u
,x
)
u ¹ *Week*
calInt(y,1,u,x)
É intStarts(y,x)
Under the same conditions, there
is an Nth small interval, and it
finishes the large interval.
Hath(N,u,x)
calInt(x,n
,u
,x
)
u ¹ *Week* É ($ ! y)
calInt(y,N,u,x)]
Hath(N,u,x)
calInt(x,n
,u
,x
)
u ¹ *Week*
calInt(y,N,u,x)
É intFinishes(y,x)
Under these conditions, all but
the last small interval have a small interval that succeeds and is met by it.
calInt(y
,n,u,x)
calInt(x,n
,u
,x
)
u ¹ *Week*
Hath(N,u,x)
n < N
É ($
! y
)[calInt(y
,n+1,u,x)
intMeets(y
,y
)]
Moreover, all but the first small
interval have a small interval that precedes and meets it.
calInt(y
,n,u,x)
calInt(x,n
,u
,x
)
u ¹ *Week*
Hath(N,u,x)
1 < n
É ($
! y
)[calInt(y
,n-1,u,x)
intMeets(y
,y
)]
4.4 Weeks
A week is any seven consecutive
days. A calendar week, by contrast, according to a commonly adopted convention,
starts at midnight, Saturday night, and goes to the next midnight, Saturday
night. That is, weeks start with Sunday. (By contrast, the ISO 8061 standard week
starts with Monday.) There are 52 weeks in a year, but there are not usually 52
calendar weeks in a year.
Weeks are independent of months and years.
However, we can still talk about the nth
week in some larger period of time, e.g., the third week of the month or the
fifth week of the semester.[9] So the same three modes of
representation are appropriate for weeks as well.
wk(y,n,x) º calInt(y,n,*Week*,x)
wkFn(n,x) = y º
calInt(y,n,*Week*,x)
As it happens, the n and x
arguments will often be irrelevant, when we only want to say that some period
is a calendar week.
The day of the week is a calendar interval of
type *Day*. The nth day-of-the-week in a
week is the nth day in that
interval.
dayofweek(y,n,x) º da(y,n,x)
($ n
,x
) wk(x,n
,x
)
The days of the week have special
names in English.
dayofweek(y,1,x) º Sunday(y,x)
dayofweek(y,2,x) º Monday(y,x)
dayofweek(y,3,x) º Tuesday(y,x)
dayofweek(y,4,x) º Wednesday(y,x)
dayofweek(y,5,x) º Thursday(y,x)
dayofweek(y,6,x) º Friday(y,x)
dayofweek(y,7,x) º Saturday(y,x)
For example, Sunday(y,x) says that y is the Sunday of week x.
Since a day of the week is also a calendar day,
it is a theorem that it is a day long.
dayofweek(y,n,x) É day(y)
One correspondence will anchor
the cycle of weeks to the rest of the calendar, for example, saying that
January 1, 2002 was the Tuesday of some week x.
(" z)($ x)Tuesday(dayFn(1,monFn(1,yrFn(2002,CE(z)))),x)
We can define weekdays and
weekend days as follows:
weekday(y,x) º [Monday(y,x) Ú Tuesday(y,x) Ú Wednesday(y,x)
Ú Thursday(y,x) Ú Friday(y,x)]
weekendday(y,x) º [Saturday(y,x) Ú Sunday(y,x)]
4.5 Months and Years
The months have special names in
English. In these rules we specify that the larger interval is a calendar year.
[yr(x,n
,x
)
mon(y,1,x)] º January(y,x)
[yr(x,n
,x
)
mon(y,2,x)] º February(y,x)
[yr(x,n
,x
)
mon(y,3,x)] º March(y,x)
[yr(x,n
,x
)
mon(y,4,x)] º April(y,x)
[yr(x,n
,x
)
mon(y,5,x)] º May(y,x)
[yr(x,n
,x
)
mon(y,6,x)] º June(y,x)
[yr(x,n
,x
)
mon(y,7,x)] º July(y,x)
[yr(x,n
,x
)
mon(y,8,x)] º August(y,x)
[yr(x,n
,x
)
mon(y,9,x)] º September(y,x)
[yr(x,n
,x
)
mon(y,10,x)] º October(y,x)
[yr(x,n
,x
)
mon(y,11,x)] º November(y,x)
[yr(x,n
,x
)
mon(y,12,x)] º December(y,x)
The number of days in a month
have to be spelled out for individual months.
January(m,y) É Hath(31,*Day*,m)
March(m,y) É Hath(31,*Day*,m)
April(m,y) É Hath(30,*Day*,m)
May(m,y) É Hath(31,*Day*,m)
June(m,y) É Hath(30,*Day*,m)
July(m,y) É Hath(31,*Day*,m)
August(m,y) É Hath(31,*Day*,m)
September(m,y) É Hath(30,*Day*,m)
October(m,y) É Hath(31,*Day*,m)
November(m,y) É Hath(30,*Day*,m)
December(m,y) É Hath(31,*Day*,m)
The definition of a leap year is
as follows:
(" z)[leapYear(y) º ($ n,x)[yr(y,n,CE(z))
[divides(400,n)
Ú [divides(4,n)
Ødivides(100,n)]]]
We leave leap seconds to
specialized ontologies.
Now the number of days in February can be
specified.
February(m,y)
leapYear(y) É Hath(29,*Day*,m)
February(m,y)
ØleapYear(y) É Hath(28,*Day*,m)
A reasonable approach to defining
month as a unit of temporal measure would be to specify that the start and end
points have to be on the same days of successive months. The following rather
ugly axiom captures this.
month(T)
º ($ t
,t
,d
,d
,n
,n
,n
,n
,m
,m
,y
,y
,e,h
,h
,j
,j
,s
,s
)
[begins(t
,T)
ends(t
,T)
beginsOrIn(t
,d
)
beginsOrIn(t
,d
)
da(d
,n
,m
)
mon(m
,n
,y
)
yr(y
,n
,e)
da(d
,n
,m
)
[mon(m
,n
+1,y
)
Ú ($ y
)[n
= 12
mon(m
,1,y
)
yr(y
,n
+1,e)]]
Hath(n,*Day*,m
)
[[n ³ n
n
= n
]
Ú [n <
n
n
= n]]
beginsOrIn(t
,h
)
beginsOrIn(t
,h
)
($ i)[hr(h
,i,d
)
hr(h
,i,d