ontology http://www.wsmo.org/2004/d3/d3.2/v0.1/20040628/dt.wsml

      namespace
            default=http://www.wsmo.org/ontologies/dateTime#,
            dc=http://purl.org/dc/elements/1.1#,
            wsml=http://www.wsmo.org/2004/d16/d16.1/v0.2/20040418#
            
      non-functional-properties 
            dc:title "Date and Time Ontology"
            dc:creator "DERI International"
            dc:subject "Date", "Time", "Date and Time Algebra"
            dc:description "generic representation of data and time including basic algebra"
            dc:publisher "DERI International"
            dc:contributor "Holger Lausen", "Axel Polleres", "Ruben Lara"
            dc:date "2004-06-28"
            dc:type http://www.wsmo.org/2004/d2/v0.3/20040329/#ontos
            dc:format "text/plain"
            dc:language "en-US"
            dc:relation http://www.isi.edu/~pan/damltime/time-entry.owl, 
                  http://www.w3.org/TR/xmlschema-2/      
            dc:coverage "World"
            dc:rights http://www.deri.org/privacy.html
            version "$Revision: 1.13 $"
      
      
      comment: conceptDefinitions
            concept instant 
                  non-functional-properties
                        dc:description "An instant represents a particular point in time and is the super concept
                              of all concrete representations such as the Gregorian calendar"
      
            concept interval
                  non-functional-properties
                        dc:description "An interval represents a duration between 2 points in time"
                  start oftype instant
                  end oftype instant
      
            concept date subconcept-of instant
                  non-functional-properties
                        dc:description "concept date and its representation according to the Gregorian Calendar"
                  dayOfMonth oftype dayOfMonth
                  monthOfYear oftype monthOfYear
                  year oftype year
      
            concept dayOfMonth subconcept-of xsd:integer
                  non-functional-properties
                        dc:description "day of a month is represented by an integer"
      
            concept year subconcept-of xsd:integer
                  non-functional-properties
                        dc:description "year is represented by an integer"
      
            concept monthOfYear subconcept-of xsd:integer
                  non-functional-properties
                        dc:description "monthOfYear is represented by an integer"
      
            concept time
                  hourOfDay oftype hourOfDay
                  minuteOfHour oftype minuteOfHour
                  secondOfMinute oftype secondOfMinute
            
            concept secondOfMinute subconcept-of xsd:integer
                  non-functional-properties
                        dc:description "a secondOfMinute is represented by an integer"
      
            concept minuteOfHour subconcept-of xsd:integer
                  non-functional-properties
                        dc:description "a minuteOfHour is represented by an integer"
      
            concept hourOfDay subconcept-of xsd:integer
                  non-functional-properties
                        dc:description "a hourOfDay is represented by an integer"
      
            concept dateAndTime subconcept-of instant
                  non-functional-properties
                        dc:description "concept date and time and representing together a specific point of time (instant)"
                  date oftype date
                  time oftype time

      
      comment: variableDefinitions
            variable X, Y, Z, D1, D2 memberof topConcept
            variable A, B, C, D, E, F, JDN, JDN_D1, JDN_D2, SFM_T1, SFM_T2 memberof xsd:integer
            variable T, T1, T2 memberof time            
                  
      comment: functionDefintions
            function julianDayNumber
                  non-functional-properties
                        dc:description "The Julian Day Count is a uniform count of days from a remote epoch 
                              in the past (about 4712 BC). At this instant, the Julian Day Number is 0. Once 
                              you have the Julian Day Number of a particular date in history, it is easy to 
                              calculate time elapsed between it and any other Julian Day Number"
                        dc:source http://quasar.as.utexas.edu/BillInfo/JulianDatesG.html
                  parameter instant oftype instant
                        non-functional-properties
                              dc:descripion "For each instant there should exist a corresponding Julian Day 
                                    Number, however it may not be always defined only by this binary predicate, 
                                    e.g. if the instant is represented as Gregorian Date and it is a date between 
                                    1582 and 1924 a country      must be given as third parameter (since e.g. Greece 
                                    changed no earlier then 9th of March 1924 from the Julian to the Gregorian Calendar)"
                              comment: The following dc:source indicates which country changed in which year 
                              comment: from the Julian to the Gregorian Calendar
                              dc:source http://members.brabant.chello.nl/~h.reints/cal/whenjul2greg.htm
                  range oftype xsd:integer
      
            function daysBetween
                  non-functional-properties
                        dc:description "(Instant1, Instant2, Difference) is a triple of the ternary relation 
                              corresponding to this function iff Instant1 and Instant2 are members of the concept 
                              'instant' (particular point in time) and Instant2 is 'Difference' days after Instant1."
                  parameter instant1 oftype instant
                  parameter instant2 oftype instant
                  range oftype xsd:integer
      
            function secondsBetween
                  non-functional-properties
                        dc:description "(Instant1, Instant2, Difference) is a triple of the ternary relation 
                              corresponding to this function      iff Instant1 and Instant2 are members of the concept 
                              'instant' (particular point in time) and Instant2 is 'Differnce' seconds after Instant1."
                  parameter instant1 oftype instant
                  parameter instant2 oftype instant
                  range oftype xsd:integer
      
            function secondsFromMidnight
                  non-functional-properties
                        dc:description "(Time, SecondsFromMidnight) is a tuple of the binary relation 
                              corresponding to this function iff SecondsFromMidnight are the seconds elapsed from
                              00:00:00 of the same day.
                              This simplifies the axiomatization of the difference between two given times"
                  parameter time oftype time
                  range oftype xsd:integer
                  
      comment: relationDefintions
            relation contains
                  non-functional-properties
                        dc:description "(Interval, X) is a tuple of the binary relation 
                              corresponding to this function iff Interval contains X and X is an instant or an 
                              interval"
                  parameter interval oftype interval
                  parameter intervalOrInstant oftype (instant or interval)
                  
      
      comment: axiomDefinitions
            axiom invalidMonthOfYear
                  non-functional-properties
                        dc:description "integrity constraint for valid monthOfYear"
                  logical-expression
                  "<-
                        X memberof monthOfYear and 
                        (X < 1 or X > 12)."
      
            axiom invalidDayOfMonth
                  non-functional-properties
                        dc:description "integrity constraint for valid dayOfMonths"
                  logical-expression
                        "<-
                              X memberof dayOfMonth and 
                              (X < 1 or X > 31)."
      
            axiom validDate
                  non-functional-properties
                        dc:description "Integrity Constraints for date.
                              The dayOfMonth is valid in dependency of the actual monthOfYear, in a leap
                              year the month 2 of the Year has 29 days otherwise 28. For leap years holds
                              the following:      Every year divisible by 4 is a leap year.      However, every 
                              year divisible by 100 is not a leap year. However, every year divisible by 
                              400 is a leap year after all.
                              
                              Note: This axiomatization is still imprecise, since the country plays a role
                              when defining a valid day of the month: E.g. 1712 was a double leap year
                              in Sweden, i.e. February 1712 had 30 days in Sweden.
                              
                              The mathematical function symbol modulo is assumed to be defined elsewhere
                              as that it returns the remainder after an integer division of its 
                              first argument by its second"
                        dc:source http://www.tondering.dk/claus/cal/node3.html
      
                  logical-expression
                        "<-
                              X memberof date and ( 
                               (X.dayOfMonth > 28 and X.monthOfYear = 2,
                                     not ((modulo(X.year ,4) = 0 and not modulo(X.year ,100) = 0)
                                                      or modulo(X.year ,400) = 0))
                                    or (X.dayOfMonth > 29 , X.monthOfYear = 2)
                                    or (X.dayOfMonth > 30 , X.monthOfYear = 4)
                                    or (X.dayOfMonth > 30 , X.monthOfYear = 6)
                                    or (X.dayOfMonth > 30 , X.monthOfYear = 9)
                                    or (X.dayOfMonth > 30 , X.monthOfYear = 11)
                              )."

      
            axiom invalidHourOfDay
                  non-functional-properties
                        dc:description "integrity constraint for valid hourOfDay:"
                  logical-expression
                        "<-
                              X memberof hourOfDay and 
                              (X < 0 or X >= 24)."
      
            axiom invalidMinuteOfHour
                  non-functional-properties
                        dc:description "integrity constraint for valid minuteOfHour:"
                  logical-expression
                        "<-
                              X memberof minuteOfHour and 
                              (X < 0 or X >= 60)."
      
            axiom invalidSecondOfMinute
                  non-functional-properties
                        dc:description "integrity constraint for valid secondOfMinute:"
                  logical-expression
                        "<-
                              X memberof secondOfMinute and 
                              (X < 0 or X >= 60)."
      
            axiom invalidInterval
                  non-functional-properties
                        dc:description "computes if a interval X contains a second interval Y"
                  logical-expression
                        "<-
                              X memberof interval and X.start >= X.end."
      
            axiom equalityDate
                  non-functional-properties
                        dc:description "computes equality of a date"
                  logical-expression
                        "X = Y <-
                              Y memberof date and X memberof date and
                              X.dayOfMonth = Y.dayOfMonth and
                              X.monthOfYear = Y.monthOfYear and
                              X.year = Y.year."
      
            axiom beforeDate
                  non-functional-properties
                        dc:description "computes if a given date X is before another date Y"
                  logical-expression
                        "X < Y <-
                              Y memberof date and X memberof date and
                              ((X.dayOfMonth = Y.dayOfMonth and X.monthOfYear = Y.monthOfYear and X.year = Y.year) or
                              (X.monthOfYear < Y.monthOfYear and X.year = Y.year) or
                              (X.year < Y.year))."
      
            axiom afterDate
                  non-functional-properties
                        dc:description "defined as inverse of beforeDate"
                  logical-expression
                        "X > Y <- Y < X"
                        
            axiom julianDayNumber
                  non-functional-properties
                        dc:description "This Axiom describes how the correct Julian Day Number
                              can be computed for a given Gregorian Calendar Date. Note
                              that the Gregorian Calendar was introduced in 15.October 1582. 
                              however until 1919 this axiomatization is not unambiguous since the country
                              should be taken into to account as 3rd parameter (e.g. Greece 
                              changed at the 9 Mar 1924 from the Julian to the Gregorian calendar).
                              
                              Details to the axiomatization
                              If the month is January or February we subtract 1 from the year to get a new Year
                              and add 12 to the month to get a new Month. (Thus, we are thinking of January and 
                              February as being the 13th and 14th month of the previous year and March is the 
                              start of the year, this simplifies the calculation considering the leap year)
                              
                              Within the calculation the fractional part of all results has to be dropped,
                              here we use the function symbol floor() [it can be rewritten as predicate,
                              however it gets less readable]
                              
                              A more lengthy description of this axiomatization can be found at
                              http://quasar.as.utexas.edu/BillInfo/JulianDatesG.html"
                              
                        dc:source http://quasar.as.utexas.edu/BillInfo/JulianDatesG.html,
                              http://members.brabant.chello.nl/~h.reints/cal/whenjul2greg.htm
                  logical-expression
                        "julianDayNumber(X) = JDN <-
                              X memberof date and
                              ((
                                          X.monthOfYear < 3 and
                                          Y = X.year -1 and
                                          M = X.monthOfYear + 12
                                    ) 
                                    or 
                                    (
                                          X.monthOfYear > 2 and
                                          Y = X.year and
                                          M = X.monthOfYear 
                              ))
                              and
                              D = X.dayOfMonth and
                              A = floor(Y / 100) and
                              B = floor(A / 4) and
                              C = 2 - A + B and
                              E = floor(365.25 * (Y + 4716)) and
                              F = floor(30.6001 * (M + 1)) and
                              JDN = C + D + E + F - 1524."
      
            axiom daysBetweenDates
                  non-functional-properties
                        dc:description "the difference in days between 2 dates"
                  logical-expression
                        "daysBetween(D1, D2) hasvalue      X <-
                              D1 memberof date and D2 memberof date and
                              X = julianDayNumber(D1) - julianDayNumber(D2)."
      
            axiom equalityTime
                  non-functional-properties
                        dc:description "computes if two given times are the same"
                  logical-expression
                        "X = Y <-
                              X memberof time and Y memberof time and
                              X.secondOfMinute = Y.secondOfMinute and
                              X.minuteOfHour = Y.minuteOfHour and 
                              X.hourOfDay = Y.hourOfDay."
      
            axiom beforeTime
                  non-functional-properties
                        dc:description "computes if a given time X is before another time Y"
                  logical-expression
                        "X < Y <-
                              X memberof time and Y memberof time and
                              ((X.secondOfMinute < Y.secondOfMinute and X.minuteOfHour = Y.minuteOfHour and X.hourOfDay = Y.hourOfDay) or
                              (X.minuteOfHour < Y.minuteOfHour and X.hourOfDay = Y.hourOfDay) or
                              (X.hourOfDay < Y.hourOfDay))."
      
            axiom afterTime
                  non-functional-properties
                        dc:description "defined as inverse of beforeTime"
                  logical-expression
                        "X > Y <- Y < X."
      
            axiom secondsFromMidnight
                  non-functional-properties
                        dc:description "computes the amount of seconds from midnight"
                  logical-expression
                        "secondsFromMidnight(T) hasvalue X <-
                              T memberof time and
                              X = T.secondOfMinute + (T.minuteOfHour*60) + (T.hourOfDay*60*60)."
      
            axiom secondsBetweenTimes
                  non-functional-properties
                        dc:description "the difference in seconds between 2 times"
                  logical-expression
                        "secondsBetween(T1, T2) hasvalue X <-
                              T1 memberof time and T2 memberof time and
                              X = secondsFromMidnight(T1) - secondsFromMidnight(T2)."
      
            axiom equalityDateAndTime
                  non-functional-properties
                        dc:description "computes if Date and Time are equal"
                  logical-expression
                        "X = Y <-
                              X memberof dateAndTime and Y memberof dateAndTime and
                              X.date = Y.date and
                              X.time = Y.time."
      
            axiom beforeDateAndTime
                  non-functional-properties
                        dc:description "computes if a given date and time X is before another date and time Y"
                  logical-expression
                        "X < Y <-
                              X memberof dateAndTime and Y memberof dateAndTime and
                              ((X.date = Y.date and X.time < Y.time) or
                              X.date < Y.date)."
      
            axiom afterDateAndTime
                  non-functional-properties
                  dc:description "defined as inverse of beforeDateAndTime"
                  logical-expression
                        "X > Y <- X 
                              memberof dateAndTime and Y memberof dateAndTime and
                              Y < X."
      
            axiom secondsBetweenDateAndTime
                  non-functional-properties
                        dc:description "computes the difference in seconds between two different DateAndTime"
                  logical-expression
                        "secondsBetween(D1, D2) = X <-
                              D1 memberof dateAndTime and D2 memberof dateAndTime and
                              X = secondsFromMidnight(D1.time) + julianDayNumber(D1.date) * 24 * 60 * 60 -
                                          (secondsFromMidnight(D2.time) + julianDayNumber(D2.date) * 24 * 60 * 60)."
      
            axiom daysBetweenDateAndTime
                  non-functional-properties
                        dc:description "the difference in days between two different DateAndTime"
                  logical-expression
                        "daysBetween(D1, D2) hasvalue X <-
                              D1 memberof dateAndTime and D2 memberof dateAndTime and
                              X = daysBetween(D1.date, D2.date)."
      
            axiom intervalContainment
                  non-functional-properties
                        dc:description "computes if a interval X contains a second interval Y"
                  logical-expression
                        "contains(X, Y) <-
                              X memberof interval and Y memberof interval and
                              (X.start < Y.start or X.start = Y.start) and
                              (X.end > Y.end or X.end = Y.end)."
      
            axiom instantContainment
                  non-functional-properties
                  dc:description "computes if a interval X contains a instant Y"
                  logical-expression
                        "contains(X, Y) <-
                              X memberof interval and Y memberof instant and
                              (X.start < Y or X.start = Y) and
                              (X.end > Y or X.end = Y)."