Ontology: Akt-Support-Ontology; Representation Language: OCML; File: time

This ontology was created by the Advanced Knowledge Technologies (AKT) project. AKT is an Interdisciplinary Research Collaboration (IRC), which is sponsored by the UK Engineering and Physical Sciences Research Council under grant number GR/N15764/01. The AKT IRC comprises the Universities of Aberdeen, Edinburgh, Sheffield, Southampton and the Open University.

;;; Mode: Lisp; Package: ocml

;;; The Open University

(in-package "OCML")

;;;A minimalist set of time-related definitions. 
;;;We may want to extend this in the future

(in-ontology akt-support-ontology)

(def-class YEAR-IN-TIME (integer) ?x Show the class year-in-time in WebOnto
	"A year-in-time must be an integer and integer can be a year-in-time"
	:iff-def (integer ?x)
        :avoid-infinite-loop t)

(def-class MONTH-IN-TIME (positive-integer)?x Show the class month-in-time in WebOnto
  "A month-in-time is an integer in the interval 1-12"
  :iff-def (and (positive-integer ?x)(< ?x 13) )
  :prove-by  (member ?x '(1 2 3 4 5 6 7 8 9 10 11 12 ))
  :no-proofs-by (:iff-def))

(def-class DAY-IN-TIME (positive-integer)?x Show the class day-in-time in WebOnto
  "A day-in-time is an integer in the interval 1-31"
  :iff-def (and (positive-integer ?x)(< ?x 32) )
  :prove-by  (member ?x '(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
                          24 25 26 27 28 29 30 31))
  
  :no-proofs-by (:iff-def))

(def-class HOUR-IN-TIME (non-negative-integer) ?x Show the class hour-in-time in WebOnto
  "A hour-in-time is an integer in the interval 0-23"
  :iff-def (and (non-negative-integer ?x)(< ?x 24) )
  :prove-by  (member ?x '(0  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23))
  :no-proofs-by (:iff-def))
      

(def-class MINUTE-IN-TIME (non-negative-integer) ?x Show the class minute-in-time in WebOnto
  "A minute-in-time is an integer in the interval 0-59"
  :iff-def (and (non-negative-integer ?x)(< ?x 60) )
  :prove-by  (member ?x '(0  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
                          30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
                          59))
  :no-proofs-by (:iff-def))



(def-class SECOND-IN-TIME (real-number)?x Show the class second-in-time in WebOnto
  "A second-in-time is a real number greater or equal to 0, less than 60"
  :iff-def (and (real-number ?x)(not (< ?x 0))(< ?x 60))
  :avoid-infinite-loop t)


(def-class TIME-POSITION (intangible-thing) Show the class time-position in WebOnto
  "A time position is either a time interval or a time point.
   Any time position is relative to a time zone"
  ((in-timezone :default-value "+00:00" :type timezone)))

(def-class TIMEZONE (string) Show the class timezone in WebOnto
  "We represent a time zone as a string with the format 
   {-/+}hh:mm ")




(def-class TIME-POINT (time-position) Show the class time-point in WebOnto
  "A point in time"
  ((second-of :type second-in-time :max-cardinality 1 )
   (minute-of :type minute-in-time :max-cardinality 1 )
   (hour-of :type hour-in-time :max-cardinality 1 )
   (day-of :type day-in-time :max-cardinality 1)
   (month-of :type month-in-time :max-cardinality 1)
   (year-of :type year-in-time :max-cardinality 1 ))
  :constraint  (and (not (and (month-of ?x 2)
                             (> (the ?day (day-of ?x ?day))
                                29)))
                    (not (and (member-of ?x (4 6 9 11))
                              (> (the ?day (day-of ?x ?day))
                                30)))))






(def-class CALENDAR-DATE (time-point) Show the class calendar-date in WebOnto
 "A calendar date is a time point in which month, day and year have 
  been specified but hour, minute and second have not"
  ((minute-of :type minute-in-time :max-cardinality 0 )
   (second-of :type second-in-time :max-cardinality 0 )
   (hour-of :type hour-in-time :max-cardinality 0 )
   (day-of :type day-in-time :cardinality 1)
   (month-of :type month-in-time :cardinality 1)
   (year-of :type year-in-time :cardinality 1)))




(def-class TIME-INTERVAL (time-position) Show the class time-interval in WebOnto
  "An interval is defined by two time points or a duration.  
   Classes of intervals, e.g., a day, can be defined by specifying only
   a duration.  A time interval has no gaps"

  ((begins-at-time-point :type time-point :max-cardinality 1)
   (ends-at-time-point :type time-point :max-cardinality 1)
   (has-duration :type duration :max-cardinality 1)))

(def-class DAY (time-interval) Show the class day in WebOnto
  ((has-duration :value 24-hour-duration)))

(def-class WEEK (time-interval) Show the class week in WebOnto
  ((has-duration :value 7-day-duration)))

(def-class MONTH (time-interval)) Show the class month in WebOnto

(def-class JANUARY (month) Show the class january in WebOnto
  ((has-duration :value 31-day-duration)))

(def-class FEBRUARY (month) Show the class february in WebOnto
  ((has-duration :default-value 28-day-duration)))

(def-class FEBRUARY-IN-LEAP-YEARS (february) Show the class february-in-leap-years in WebOnto
  ((has-duration :value 29-day-duration)))
  

(def-class MARCH (month) Show the class march in WebOnto
  ((has-duration :value 31-day-duration)))

(def-class APRIL (month) Show the class april in WebOnto
  ((has-duration :value 30-day-duration)))

(def-class MAY (month) Show the class may in WebOnto
  ((has-duration :value 31-day-duration)))

(def-class JUNE (month) Show the class june in WebOnto
  ((has-duration :value 30-day-duration)))

(def-class JULY (month) Show the class july in WebOnto
  ((has-duration :value 31-day-duration)))

(def-class AUGUST (month) Show the class august in WebOnto
  ((has-duration :value 31-day-duration)))

(def-class SEPTEMBER (month) Show the class september in WebOnto
  ((has-duration :value 30-day-duration)))

(def-class OCTOBER (month) Show the class october in WebOnto
  ((has-duration :value 31-day-duration)))

(def-class NOVEMBER (month) Show the class november in WebOnto
  ((has-duration :value 30-day-duration)))

(def-class DECEMBER (month) Show the class december in WebOnto
  ((has-duration :value 31-day-duration)))

(def-class YEAR (time-interval) Show the class year in WebOnto
  ((has-duration :value 12-month-duration)))

(def-class DURATION (physical-quantity) Show the class duration in WebOnto
  "A measure of time, e.g., 5 hours"
  ((has-unit-of-measure :type time-measure)
   ))

(def-instance 24-HOUR-DURATION duration Show the instance 24-hour-duration in WebOnto
  ((has-unit-of-measure time-measure-hour)
   (has-magnitude 24)))

(def-instance 7-DAY-DURATION duration Show the instance 7-day-duration in WebOnto
  ((has-unit-of-measure time-measure-day)
   (has-magnitude 7)))

(def-instance 28-DAY-DURATION duration Show the instance 28-day-duration in WebOnto
  ((has-unit-of-measure time-measure-day)
   (has-magnitude 28)))

(def-instance 29-DAY-DURATION duration Show the instance 29-day-duration in WebOnto
  ((has-unit-of-measure time-measure-day)
   (has-magnitude 29)))

(def-instance 30-DAY-DURATION duration Show the instance 30-day-duration in WebOnto
  ((has-unit-of-measure time-measure-day)
   (has-magnitude 30)))

(def-instance 31-DAY-DURATION duration Show the instance 31-day-duration in WebOnto
  ((has-unit-of-measure time-measure-day)
   (has-magnitude 31)))

(def-instance 12-MONTH-DURATION duration Show the instance 12-month-duration in WebOnto
  ((has-unit-of-measure time-measure-year)
   (has-magnitude 12)))

(def-class TIME-MEASURE (unit-of-measure) Show the class time-measure in WebOnto
  "The class of all unit of measures used to measure time,
   e.g., minute, second, hour, etc...")

(def-instance TIME-MEASURE-SECOND time-measure) Show the instance time-measure-second in WebOnto

(def-instance TIME-MEASURE-MINUTE time-measure) Show the instance time-measure-minute in WebOnto

(def-instance TIME-MEASURE-HOUR time-measure) Show the instance time-measure-hour in WebOnto

(def-instance TIME-MEASURE-DAY time-measure) Show the instance time-measure-day in WebOnto

(def-instance TIME-MEASURE-MONTH time-measure) Show the instance time-measure-month in WebOnto

(def-instance TIME-MEASURE-YEAR time-measure) Show the instance time-measure-year in WebOnto

(def-instance TIME-MEASURE-CENTURY time-measure) Show the instance time-measure-century in WebOnto


(def-axiom DURATION-IS-BEGIN-TIME-MINUS-END-TIME Show the axiom duration-is-begin-time-minus-end-time in WebOnto
  "This axiom states the relation between duration, begin time 
   and end time in an interval"
  (=> (and (time-interval ?x)
           (begins-at-time-point ?x ?tp1)
           (ends-at-time-point ?x ?tp2))
      (= (has-duration ?x (time-difference 
                           (the ?tp1 (begins-at-time-point ?x ?tp1))
                           (the ?tp2 (ends-at-time-point ?x ?tp2)))))))


(def-function TIME-DIFFERENCE (?tp1 ?tp2) -> ?d Show the function time-difference in WebOnto
  "The duration between two time points.
   No operational definition is given here, only a spec"
  :def (and (time-point ?tp1)
            (time-point ?tp2)
            (duration ?d)))




            


      



Contact Point

Email: John Domingue (j.b.domingue@open.ac.uk)