Skip to content

SUO‐KIF Time examples

epachamo edited this page Feb 25, 2025 · 10 revisions

SUO-KIF for the beginner

Introduction

Time Taxonomy

TimeMeasure
     TimePosition
          TimeInterval
              Holiday
              AnteMeridiem
              PostMeridiem
...

TemporalRelation

(see James Allen's interval algebra)

earlier
meetsTemporally
overlapsTemporally
starts
during
finishes
equal
...

SpatialRelation

(not (connected ?X ?Y))
meetsSpatially
overlapsSpatially
contains
...

Points in time

before
beforeOrEqual
temporallyBetween
temporallyBetweenOrEqual
TimeIntervalFn 
Epoch
Midnight
Noon
...

"Now"

"Now" has no decontextualized meaning that can be captured in an ontology. It is a "diectic" expression (like "here", "there" etc). This is an instance of a common word that doesn't have an equivalent in an ontology.

Calendar

(YearFn 2007) - a class with only one member
(MonthFn January ?Y) - a class with many members
(MonthFn January (YearFn 2007)) - a class with only one member
(SecondFn 10 (MinuteFn 20 (HoursFn 12 (DayFn 7 (MonthFn March ?X))))) the class of all seconds on 12:20:10 on March 7

holdsDuring

States that something is true at a point or during a period in time. Beyond first order.

If someone is barefoot, then they are not wearing shoes.

(<=>
  (holdsDuring ?T
    (attribute ?A Barefoot))
  (holdsDuring ?T
     (not
       (exists (?S)
         (and
           (and
             (instance ?S Shoe)
             (wears ?A ?S))))))

Limitations

Date math does not currently exist in SUMO. This is a future improvement.

General Time examples

John kicked the ball on Tuesday.

(exists (?K ?J ?B ?T)
  (and
    (instance ?J Human)
    (names ?J "John")
    (instance ?K Kicking)
    (agent ?K ?J)
    (instance ?T Tuesday)
    (during (WhenFn ?K) ?T)))

Mary graduated on May 5, 2012.

(exists (?G ?M ?D)
  (and
    (instance ?G Graduation)
    (instance ?M Woman)
    (names ?M "Mary")
    (patient ?G ?M)
    (instance ?D (DayFn 7 (MonthFn March (YearFn 2007))))
    (during (WhenFn ?G) ?D)))

Bill was fired after he robbed the bank.

(exists (?H ?F ?R ?B)
  (and
    (instance ?H Human)
    (names "Bill" ?H)
    (instance ?F Firing)
    (patient ?F ?H)
    (instance ?R Robbing)
    (agent ?R ?H)
    (instance ?B Bank)
    (origin ?R ?B)
    (before
      (EndFn (WhenFn ?R))
      (BeginFn (WhenFn ?F)) )))

It's cold today.

This sentence seems simple, but it is full of 'diectics'. The words 'today', and 'cold', are all subjective. For the purposes of this example, which was written on 11 February 2025, the statement is re-written as "On 11 February 2025, some human felt cold."

(exists (?D)
  (and
    (instance ?D (DayFn 11 (MonthFn February (YearFn 2025))))
    (attribute ?D FeelingCold)
    (instance ?H Human)
    (holdsDuring ?D (attribute ?H FeelingCold))))

Mark was asleep at the wheel Saturday night.

(exists (?MARK ?DRIVE ?SLEEP ?NIGHT ?SAT)
  (and
    (instance ?MARK Human)
    (names "Mark" ?MARK)
    (instance ?DRIVE Driving)
    (agent ?DRIVE ?MARK)
    (instance ?SLEEP Sleeping)
    (experiencer ?SLEEP ?MARK)
    (instance ?SAT Saturday)
    (instance ?NIGHT NightTime)
    (during ?NIGHT ?SAT)
    (during (WhenFn ?DRIVE) ?NIGHT)
    (during (WhenFn ?SLEEP) (WhenFn ?DRIVE))))

John was equidistant from Monterey and Salinas at 3:50pm Tuesday.

(exists (?J ?M ?S ?L ?TI ?T1 ?U ?N1 ?N2)
    (and
        (instance ?J Human)
        (names ?J "John")
	(instance ?M City)
	(names "Monterey" ?M)
	(instance ?S City)
	(names "Salinas" ?S)
	(instance ?L GeographicArea)
	(instance ?U UnitOfLength)
	(equal ?T1 (MinuteFn 50(HourFn 15(DayFn Tuesday))))
        (instance ?TI ?T1)
	(holdsDuring ?TI (and (located ?J ?L)
              (equal
		(distance ?L ?M (MeasureFn ?N1 ?U))
		(distance ?L ?S (MeasureFn ?N2 ?U)))))))