<?xml version="1.0"?>
<rdf:RDF xmlns="http://www.daml.org/2000/10/daml-ont#" 
         xmlns:daml="http://www.daml.org/2000/10/daml-ont#" 
         xmlns:a="https://www.daml.org/actionitems/actionitems-20000905.rdfs#" 
         xmlns:num="http://www.daml.org/2000/10/daml-num.daml#" 
         xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" 
         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

	<!-- mark DAML program action item 12 as complete -->
	<rdf:Description about="https://www.daml.org/actionitems/12.rdf">
		<a:state>closed</a:state>
		<a:Action parseType="Resource">
			<a:status>available at http://www.kestrel.edu/DAML/2000/12/TIME.daml</a:status>
			<a:date>12-14-2000 17:44</a:date>
			<a:by>becker@kestrel.edu</a:by>
		</a:Action>
 	</rdf:Description>

	<!--  	Does importing an ontology adds a new recognizable namespace
		or we still need to declare the namespace and use the corresponding 
		tag to refer to resources
	-->

	<Ontology about="">
		<versionInfo>$Id$</versionInfo>
		<comment>Kestrel Scheduling Ontology 	
	This ontology is based on the time ontology available from Stanford's ontoserver. Other 
	groups also defined time ontologies in DAML:
	http://www.ai.sri.com/daml/ontologies/sri-basic/1-0/Time.daml
	http://www.cs.cmu.edu/~softagents/atlas/ontologies/atlas-date.daml
	But they do not provide all the entities needed in a scheduling domain. 
	</comment>
		<imports resource="http://www.daml.org/2000/10/daml-ont"/>
	</Ontology>


	<Class ID="Temporal-Entity"/>

	<Class ID="Time-Point">
	   <comment>
	   From KSL - Simple-Time ontology "A time-point is a point in
	   real, historical time (on earth).  It is independent of
	   observer and context.  A time-point is not a measurement of
	   time, nor is it a specification of time.  It is the point
	   in time. The time-points at which events occur can be known
	   with various degrees of precision and approximation, but
	   conceptually time-points are point-like and not
	   interval-like.  That is, it doesn't make sense to talk
	   about what happens during a time-point, or how long the
	   time-point lasts."  Although one can think of TimePoint as
	   an integer representing an offset from a certain TimePoint
	   considered to be the start of the time scale, we will
	   represent a time point as a subclass of daml:#Thing and
	   would use a property to express the value of the time point
	   with respect to a certain reference point using a certain
	   unit of measure or time glanularity.
	   </comment>	   
	   <label> Time-Point </label>
	   <subClassOf resource="#Temporal-Entity"/>
	</Class>

	<Property ID="time">
	    <domain resource="#Time-Point"/>
	    <range resource="num:#Integer"/>
	    <comment> 
	    For now, assume the value of a time point to be
	    expressed by an integer representing a number of certain time
	    units since the origin of the time scale. 
	    </comment>
	</Property>
	
	<!-- How do I enumertate the elements of a class ? -->
	
	<Class ID="Time-Unit">
	   <subClassOf resource="num:#Literal"/> 
	   <label> Time-Unit</label> 
	   <comment> 
	   The Time-Unit represents the granularity
	   of the time representation. The property time of a
	   TimePoint represents the number of time units since a
	   certain time point TimeZero.
	   </comment>
	</Class>

	<Property ID="time-unit">
	   <domain resource="#Time-Point"/>
	   <range resource="#Time-Unit"/>
	   <comment> 
	   Using small letters to represent a property that has as
	   domain the class with the same name as the property but starting
	   with capital letter.
	   </comment>
	</Property>

	<!-- 
	How do I say that the value of a Second should be an
	integer between 0 and 59 without defining a property value and
	restricting the value of the property using the onProperty and
	toValue construct.  Should the restriction be on the property
	declaration or in the domain class declaration.  -->
	
	<Class ID="Month">
	   <label>Month</label>
	   <subClassOf resource="daml:#Literal"/>
	   <comment>
	   This has been based on
	   http://www.cs.cmu.edu/~softagents/atlas/ontologies/atlas-date.daml.
	   But I do not add the month names in the definition of the class
	   since the names are just literals.
	   Is it correct to define all the member of the class using
	   the oneOf construct? 
	   </comment>
	</Class>

	<Class ID="Between0and59"> 
	  <comment> 
	  Trick to get the correct restiction on seconds and
	  minutes without having to define a class Seconds and Minutes
	  Again, how do I express the value of an Integer??
	  </comment>
	  <label>Between0and56</label>
	  <subClassOf resource="num:#Integer"/>
	  <restrictedBy>
	    <restriction> 
	      <onProperty resource="num:min"/> 
	      <hasValue resource="0"/>
	    </restriction>
	    <restriction> 
	      <onProperty resource="num:max"/> 
	      <hasValue resource="59"/>
	    </restriction>
	  </restrictedBy>
	</Class>

	<Class ID="Between0and23"> 
	  <comment> 
	  Trick to get the correct restiction on hours without having
	  to define a class Hours
	  Again, how do I express the value of an Integer??
	  </comment>
	  <label>Between0and56</label>
	  <subClassOf resource="num:#Integer"/>
	  <restrictedBy>
	    <restriction> 
	      <onProperty resource="num:min"/> 
	      <hasValue resource="0"/>
	    </restriction>
	    <restriction> 
	      <onProperty resource="num:max"/> 
	      <hasValue resource="23"/>
	    </restriction>
	  </restrictedBy>
	</Class>

	<Class ID="Between1and31"> 
	  <comment> 
	  Trick to get the correct restiction on days and
	  minutes without having to define a class Day.
	  Again, how do I express the value of an Integer??
	  </comment>
	  <label>Between0and31</label>
	  <subClassOf resource="num:#Integer"/>
	  <restrictedBy>
	    <restriction> 
	      <onProperty resource="num:min"/> 
	      <hasValue resource="1"/>
	    </restriction>
	    <restriction> 
	      <onProperty resource="num:max"/> 
	      <hasValue resource="31"/>
	    </restriction>
	  </restrictedBy>
	</Class>

	<Class ID="Day-Of-The-Week">
	   <label>dayOfTheWeek</label>
	   <subClassOf resource="daml:#Literal"/>
	   <comment>The name of the week day.
	   </comment>
	</Class>
	<Property ID="second">
		<domain resource="#Date"/>
		<range resource="num:#Integer"/>
		<comment/>
	</Property>
	<Property ID="minute">
		<domain resource="#Date"/>
		<range resource="num:#Integer"/>
		<comment/>
	</Property>
	<Property ID="hour">
		<domain resource="#Date"/>
		<range resource="num:#Integer"/>
		<comment/>
	</Property>
	<Property ID="day">
		<domain resource="#Date"/>
		<range resource="num:#Integer"/>
		<comment/>
	</Property>
	<Property ID="day-Of-The-Week">
		<subPropertyOf resource="#day"/>
		<range resource="#Day-Of-The-Week"/>
	</Property>
	<Property ID="month">
		<domain resource="#Date"/>
		<range resource="#Month"/>
		<comment/>
	</Property>
	<Property ID="monthNumber">
		<subPropertyOf resource="month"/>
		<range resource="num:#Integer"/>
	</Property>
	<Property ID="year">
		<domain resource="#Date"/>
		<range resource="num:#Integer"/>
		<comment/>
	</Property>
	<Class ID="Calendar">
		<label>Calendar</label>
		<comment>A calendar class provides rules on how to translate the
   time property of a TimePoint object into a Date object expressed in
   terms of month, day, etc..</comment>
	</Class>
	<Property ID="calendar">
		<domain resource="#Date"/>
		<range resource="#Calendar"/>
		<comment>Maybe Date should be a sub-class of Calendar. 
     Here I based the ontology on the Java API that defines an
     abstract class Calendar,  and a separate class for representing
     the date. In the Java implementation, however, the class Date is
     equivalent to the class TimePoint. 
     </comment>
	</Property>
	<Class ID="Date">
		<comment> 
      A date is the entity that provides a representation for a time
      point in a given calendar. It has properties day, second,
      minute, hour, year. I will restrict the values of the properties
      in the class definition. I am here using a construct presented
      in DAML-OIL and not standard DAML.
      How do I say that the value of a certain property should be in a
      certain range?? 
      The default DAML syntax for restriction uses the
      onProperty/hasValue or onProperty/toClass construct. The problem
      with these types of construct is that I can only constrain the
      range of a property value to belong to a certain class. For
      example, if I want to say that the value of the property second
      is an integer between 0 and 59, I need to declare a class, for
      example Seconds, and constrain the its values to be between 0
      and 59. Then I can use this class in the toClass construct. The
      problem is that if I wand to use seconds that go only from 0 to
      30, I need to declare a new sub-class of Seconds. How can I
      restrict only the value without having to create a new class
      every time I need to impose restrictions. How can I refer to the
      value of a certain property?        
     </comment>
		<intersectionOf parseType="daml:collection">
			<Restriction>
				<onProperty resource="#second"/>
				<hasValue resource="Between0and59"/>
			</Restriction>
			<Restriction>
				<onProperty resource="#minute"/>
				<hasValue resource="Between0and59"/>
			</Restriction>
			<Restriction>
				<onProperty resource="#hour"/>
				<hasValue resource="Between0and23"/>
			</Restriction>
			<Restriction>
				<onProperty resource="#day"/>
				<hasValue resource="Between1and31"/>
			</Restriction>
		</intersectionOf>
	</Class>
	<!-- Here are some instances of TimePoints and Calendars -->
	<!-- 
   Definitions for Time Intervals 
   How do I express the fact that the start time of an interval
   should be less than the end time?
   -->
	<Class ID="Time-Interval">
	   <subClassOf resource="#Temporal-Entity"/> 
	   <label>Time-Interval</label> 
	   <comment> 
	   This class is characterized
	   by a pair of TimePoints and a given duration representing
	   the difference between the two time points
	   </comment>
	   <restrictedBy>
	      <restriction>
	         <onProperty resource="#start-time-point"/>
		    <onProperty resource="#end-time-point"/>
	      </restriction>
	   </restrictedBy>
	</Class>

	<Property ID="start-time-point">
	   <domain resource="Time-Interval"/>
	   <range resource="Time-Point"/>
	</Property>

	<Property ID="end-time-point">
	   <domain resource="Time-Interval"/>
	   <range resource="Time-Point"/>
	</Property>

	<Property ID="duration">
	   <domain resource="Time-Interval"/>
	   <range resource="num:#Integer"/>
	   <comment>
	   The duration is just the difference between the endTimePoint and
	   the startTimePoint of the interval
	   </comment>
	</Property>
		

       <!-- CLASS INTERVAL-SEQUENCE -->
       <Class ID="Interval-Sequence">
          <label>Interval-Sequence</label>
	  <comment> Sequence of time interval defining a temporal profile </comment>
       </Class>



       <Class ID="Terporal-Relation">
          <label>Temporal-Relation</label>
          <comment>
	  The temporal relation is the super class to represent
	  relations between Time-Points and Time-Intervals.  
          </comment>
       </Class>

       <Property ID="from">
          <domain resource="#Temporal-Relation"/>
	  <range  resource="#Termporal-Entity"/>
       </Property>

       <Property ID="to">
          <domain resource="#Temporal-Relation"/>
	  <range  resource="#Termporal-Entity"/>
       </Property>

       <Property ID="lower-bound">
          <domain resource="#Temporal-Relation"/>
	  <range  resource="daml:#Integer"/>
       </Property>

       <Property ID="upper-bound">
          <domain resource="#Temporal-Relation"/>
	  <range  resource="daml:#Integer"/>
       </Property>

       <!--

       In the definition of the Before class I want to define a
       property - the temporal relation between two temporal
       entities, as a first class object. 
       I also want to say that: 
       1) If the value of the property from and to are Time-Points, then 
          Before (t1, t2 ) implies t1.time < t2.time
       2) If the value of the property from and to are Time-Intervals,
       then Before (I1, I2) implies I1.end-time-point.time <=
       I2.start-time-point.time
       3) If from is a Time-Point and to a Time-Interval, then Before(t1,
       I1) implies t1.time < I1.start-time-point.time
       4) If from is a Time-Interval and to a Time-Point, then
       Before(I1, t1) implies I1.end-time-point.time <= t1.time.

       -->

       <Class ID="Before">
         <label>Before</label>
	 <comment></comment>
	 <subClassOf resource="#Temporal-Relation"/>
       </Class>

       <Class ID="After">
         <label>Before</label>
	 <comment></comment>
	 <subClassOf resource="#Temporal-Relation"/>
       </Class>
       

       <Property ID="before"> 
         <domain resource="#Temporal-Entity"/>
	 <range resource="#Temporal-Entity"/>
       </Property>	

       <Property ID="after"> 
         <domain resource="#Temporal-Entity"/>
	 <range resource="#Temporal-Entity"/>
	 <inverseOf resource="#before"/>
       </Property>	

       <Property ID="same-start"> 
         <domain resource="#Temporal-Interval"/>
	 <range resource="#Temporal-Interval"/>
       </Property>	

       <Property ID="same-end"> 
         <domain resource="#Temporal-Interval"/>
	 <range resource="#Temporal-Interval"/>
       </Property>
              
       <Property ID="meets"> 
         <domain resource="#Temporal-Interval"/>
	 <range resource="#Temporal-Interval"/>
	 <subPropertyOf resource="#same-start"/>
	 <subPropertyOf resource="#same-end"/>
       </Property>	

       <Property ID="overlaps"> 
         <domain resource="#Temporal-Interval"/>
	 <range resource="#Temporal-Interval"/>
       </Property>

       <Property ID="disjoint"> 
         <domain resource="#Temporal-Interval"/>
	 <range resource="#Temporal-Interval"/>
       </Property>

       

</rdf:RDF>
