<?xml version='1.0' encoding='ISO-8859-1'?>
<!DOCTYPE uridef[
  <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns">
  <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema">
  <!ENTITY daml "http://www.daml.org/2001/03/daml+oil">
  <!ENTITY service "http://www.daml.org/services/daml-s/2001/05/Service">
  <!ENTITY process "http://www.daml.org/services/daml-s/2001/05/Process">
  <!ENTITY profile "http://www.daml.org/services/daml-s/2001/05/Profile">
  <!ENTITY date "http://www.ai.sri.com/daml/ontologies/sri-basic/1-0/Date.daml">
  <!ENTITY time "http://www.ai.sri.com/daml/ontologies/sri-basic/1-0/Time.daml">
  <!ENTITY airport "http://www.daml.ri.cmu.edu/ont/AirportCodes.daml">
  <!ENTITY DEFAULT "http://www.daml.org/services/daml-s/2001/05/AlphaAir-process.daml">
  <!ENTITY THIS "http://www.daml.org/services/daml-s/2001/05/AlphaAir-process.daml">
]>
 
<!--
This document uses entity types as a shorthand for URIs.
Download the source for a version with unexpanded entities.
  -->
 
<rdf:RDF
  xmlns:rdf=    "&rdf;#"
  xmlns:rdfs=   "&rdfs;#"
  xmlns:daml=   "&daml;#"
  xmlns:service= "&service;#"
  xmlns:process= "&process;#"
  xmlns:profile= "&profile;#"
  xmlns:airport= "&airport;#"
  xmlns=        "&DEFAULT;#">
 
  <daml:Ontology about="">
    <daml:versionInfo>
      $Id: AlphaAir-process.daml,v 1.1 2001/05/31 22:28:28 kmbarber Exp $
    </daml:versionInfo>
    <rdfs:comment>
      Process and Service Coalition
      Process and Profile Models for AlphaAir.com
 
    </rdfs:comment>
    <daml:imports rdf:resource="&rdf;" />
    <daml:imports rdf:resource="&rdfs;" />
    <daml:imports rdf:resource="&daml;" />
    <daml:imports rdf:resource="&service;" />
    <daml:imports rdf:resource="&process;" />
    <daml:imports rdf:resource="&profile;" />
  </daml:Ontology>

<!-- ########################################################################## -->
<!-- Credit Card Details.
     Here are definitions that should probably be abstracted to a different
     file, such as an ECommerce ontology.  I've included them here for now,
     although some of them already exist within the Congo example!
  -->

  <rdfs:Class rdf:ID="CreditCardTypes">
    <daml:oneOf rdf:parseType="daml:collection">
      <CreditCardType rdf:ID="MasterCard"/>
      <CreditCardType rdf:ID="VISA"/>
      <CreditCardType rdf:ID="AmericanExpress"/>
      <CreditCardType rdf:ID="DiscoverCard"/>
     </daml:oneOf>
  </rdfs:Class>
   
  <rdf:Property rdf:ID="creditCardNumber">
    <rdfs:subPropertyOf rdf:resource="&process;#input"/>
    <rdfs:domain rdf:resource="#CreditCardTypes"/>
    <rdfs:range rdf:resource="&daml;#Thing"/>
  </rdf:Property>
   
  <rdf:Property rdf:ID="creditExistsPrecondition">
    <rdfs:subPropertyOf rdf:resource="&process;#precondition"/>
    <rdfs:domain rdf:resource="#CreditCardTypes"/>
    <rdfs:comment>
      Keeping it simple.  The card either has credit or not!
    </rdfs:comment>
  </rdf:Property>
   
  <rdf:Property rdf:ID="creditCardType">
    <rdfs:subPropertyOf rdf:resource="&process;#input"/>
    <rdfs:range rdf:resource="#CreditCardTypes"/>
  </rdf:Property>
   
  <rdf:Property rdf:ID="creditCardExpirationDate">
    <rdfs:subPropertyOf rdf:resource="&process;#input"/>
    <rdfs:domain rdf:resource="#CreditCardTypes"/>
    <rdfs:range rdf:resource="&time;#Time"/>
  </rdf:Property>

  <rdf:Property rdf:ID="creditCardValidity">
    <rdfs:subPropertyOf rdf:resource="&process;#parameter"/>
    <rdfs:domain rdf:resource="#CreditCardTypes"/>
    <rdfs:range rdf:resource="#ValidityType"/>
  </rdf:Property>

  <rdfs:Class rdf:ID="ValidityType">
    <daml:oneOf rdf:parseType="daml:collection">
      <DeliveryType rdf:ID="Valid"/>
      <DeliveryType rdf:ID="Expired"/>
      <DeliveryType rdf:ID="Invalid CC-Number"/>
      <DeliveryType rdf:ID="Invalid CC-Type"/>
      <DeliveryType rdf:ID="Authorization Refused"/>
    </daml:oneOf>
  </rdfs:Class>

  <rdf:Property rdf:ID="acceptableCreditCard">
    <rdfs:subPropertyOf rdf:resource="&process;#precondition"/>
    <rdfs:range rdf:resource="#CreditCardTypes">
      <rdfs:subClassOf>
	<daml:Restriction>
	  <daml:onProperty rdf:about="#creditExistsPrecondition" />
	  <daml:hasValue>true</daml:hasValue>
	</daml:Restriction>
      </rdfs:subClassOf>
    </rdfs:range>
  </rdf:Property>

<!-- ########################################################################## -->
<!-- Account Details -->

  <rdf:Property rdf:ID="acctName">
    <rdfs:subPropertyOf rdf:resource="&process;#input"/>
    <rdfs:range rdf:resource="&rdfs;#Literal"/>
    <daml:cardinality>1</daml:cardinality>
  </rdf:Property>
   
  <rdf:Property rdf:ID="password">
    <rdfs:subPropertyOf rdf:resource="&process;#input"/>
    <rdfs:range rdf:resource="&rdfs;#Literal"/>
    <daml:cardinality>1</daml:cardinality>
  </rdf:Property>
   
  <rdf:Property rdf:ID="fullName">
    <rdfs:comment>
      The account holder's full name (defined as a literal).
      This could be decomposed further.
    </rdfs:comment>
    <rdfs:subPropertyOf rdf:resource="&process;#input" />
    <rdfs:range rdf:resource="&rdfs;#Literal"/>
  </rdf:Property>

  <rdf:Property rdf:ID="fullAddress">
    <rdfs:comment>
      The account holder's full home address (defined as a literal).
      This could be decomposed further.
    </rdfs:comment>
    <rdfs:subPropertyOf rdf:resource="&process;#input" />
    <rdfs:range rdf:resource="&rdfs;#Literal"/>
  </rdf:Property>

  <!--
    The following two properties are defined as parameters as they are
    passed between subprocesses; i.e. output of one process and input of another.
    -->

  <rdf:Property rdf:ID="email">
    <rdfs:comment>
      The account holder's email address (defined as a literal).
      This could be decomposed further.
    </rdfs:comment>
    <rdfs:subPropertyOf rdf:resource="&process;#parameter" />
    <rdfs:range rdf:resource="&rdfs;#Literal"/>
  </rdf:Property>

  <rdf:Property rdf:ID="#acctID">
    <rdfs:subPropertyOf rdf:resource="&process;#parameter" />
    <rdfs:comment>
      This is an internal account ID that is generated when the
      user is logged in, and references their account.

      This might later represent the account itself, for now we
      leave the range undefined.
    </rdfs:comment>
    <rdfs:range rdf:resource="&daml;#Thing" />
    <daml:cardinality>1</daml:cardinality>
  </rdf:Property>

<!-- ########################################################################## -->
<!-- Deliverables -->

  <rdfs:Class rdf:ID="FlightItinerary">
    <rdfs:subClassOf rdf:resource="&daml;#Thing" />
  </rdfs:Class>

  <rdfs:Class rdf:ID="ReservationNumber">
    <rdfs:subClassOf rdf:resource="&daml;#Thing" />
  </rdfs:Class>

<!-- ########################################################################## -->
<!-- Flight Properties -->

  <!-- The definition of the compound entity "date" needs to be extended
       here to include either a departure time or arrival time, i.e. the
       filght must depart by, or arrive by...
    -->

  <rdf:Property rdf:ID="departureAirport">
    <rdfs:subPropertyOf rdf:resource="&process;#input"/>
    <rdfs:range rdf:resource="&airport;#AirportCodes"/>
    <daml:cardinality>1</daml:cardinality>
  </rdf:Property>

  <rdf:Property rdf:ID="arrivalAirport">
    <rdfs:subPropertyOf rdf:resource="&process;#input"/>
    <rdfs:range rdf:resource="&airport;#AirportCodes"/>
    <daml:cardinality>1</daml:cardinality>
  </rdf:Property>

  <rdf:Property rdf:ID="roundTrip">
    <rdfs:subPropertyOf rdf:resource="&process;#input"/>
    <!-- Boolean -->
    <rdfs:range rdf:resource="&daml;#Thing" />
    <daml:cardinality>1</daml:cardinality>
  </rdf:Property>

  <rdf:Property rdf:ID="outboundDate">
    <rdfs:subPropertyOf rdf:resource="&process;#input"/>
    <rdfs:range rdf:resource="&date;#Date"/>
    <daml:cardinality>1</daml:cardinality>
  </rdf:Property>

  <rdf:Property rdf:ID="inboundDate">
    <rdfs:subPropertyOf rdf:resource="&process;#input"/>
    <rdfs:range rdf:resource="&date;#Date"/>
    <daml:cardinality>1</daml:cardinality>
  </rdf:Property>

  <rdf:Property rdf:ID="flightItinerary">
    <rdfs:subPropertyOf rdf:resource="&process;#output" />
    <rdfs:range rdf:resource="#FlightItinerary"/>
  </rdf:Property>

  <rdf:Property rdf:ID="reservationNumber">
    <rdfs:subPropertyOf rdf:resource="&process;#output" />
    <rdfs:range rdf:resource="#ReservationNumber"/>
    <daml:cardinality>1</daml:cardinality>
  </rdf:Property>


<!-- ########################################################################## -->
<!-- The Basic Service Process -->
<!-- All processes that can be used to compose the top level Alpha Air process
     are derived from this class.
  -->

  <rdfs:Class rdf:ID="AlphaAirBuyProcess">
    <rdfs:subClassOf rdf:resource="&process;#Process"/>
  </rdfs:Class>

<!-- ########################################################################## -->
<!-- Expand and Collapse relations for AlphaAir_Process
     Based on the Congo.daml model
  -->

<process:expand> 
  <rdfs:Class> rdfs:about ="#AlphaAir_Process"</rdfs:Class> 
  <rdfs:Class> rdfs:about ="#ExpandedAlphaAir_Process"</rdfs:Class>
</process:expand>


<!-- ########################################################################## -->
<!-- ExpandedAlphaAir_Process -->

  <rdfs:Class rdf:ID="ExpandedAlphaAir_Process">
    <rdfs:subClassOf rdf:resource="&process;#Sequence" />
    <daml:subClassOf>
      <daml:Restriction> 
	<daml:onProperty rdf:resource="&process;#components" />
	<daml:toClass>
	  <daml:subClassOf>
	    <daml:unionOf rdf:parseType="daml:collection">
	      <rdfs:Class rdfs:about="#GetDesiredFlightDetails"/>
	      <rdfs:Class rdfs:about="#SelectInboundFlight"/>
	      <rdfs:Class rdfs:about="#FinalizeFlightDetails"/>           
	      <rdfs:Class rdfs:about="#LogInChoice"/>
	      <rdfs:Class rdfs:about="#ConfirmReservation"/>
	      <rdfs:Class rdfs:about="#DeliverFlightItinerary"/>
	    </daml:unionOf>
	  </daml:subClassOf>
	</daml:toClass>
      </daml:Restriction>
    </daml:subClassOf>
  </rdfs:Class>

<!-- ########################################################################## -->
<!-- GetDesiredFlightDetails
     Get details such as airports, prefered time, roundtrip etc
  -->

  <rdfs:Class rdf:ID="GetDesiredFlightDetails">
    <rdfs:subClassOf rdf:resource="#AlphaAirBuyProcess" />
    <rdfs:subClassOf>
      <daml:Restriction>
	<rdfs:onProperty rdf:resource="&process;#input" />
	<daml:toClass rdf:resource="#DesiredFlightDetails"/>
      </daml:Restriction>
    </rdfs:subClassOf>
  </rdfs:Class>

  <rdfs:Class rdf:ID="DesiredFlightDetails">
    <daml:unionOf rdf:parseType="daml:collection">
      <daml:Thing rdf:resource="#departureAirport"/>
      <daml:Thing rdf:resource="#arrivalAirport"/>
      <daml:Thing rdf:resource="#outboundDate"/>
      <daml:Thing rdf:resource="#roundTrip"/>
      <daml:Thing rdf:resource="#inboundDate"/>
    </daml:unionOf>
  </rdfs:Class>

<!-- ########################################################################## -->
<!-- FinalizeFlightDetails
     A composite process for obtaining the outbound and (if necessary) the
     inbound flights based on the DesiredFlightDetails.
  -->

  <rdfs:Class rdf:ID="FinalizeFlightDetails">           
    <rdfs:subClassOf rdf:resource="&process;#If-Then-Else" />
    <daml:subClassOf>
      <daml:Restriction> 
	<daml:onProperty rdf:resource="&process;#components" />
	<daml:toClass>
	  <daml:subClassOf>
	    <daml:unionOf rdf:parseType="daml:collection">
	      <rdfs:Class rdfs:about="#DetermineRoundTripStatus"/>
	      <rdfs:Class rdfs:about="#SelectRoundTripFlight"/>
	      <rdfs:Class rdfs:about="#SelectOneWayFlight"/>
	    </daml:unionOf>
	  </daml:subClassOf>
	</daml:toClass>
      </daml:Restriction>
    </daml:subClassOf>
  </rdfs:Class>

  <rdf:Property rdf:about="#ifRoundTrip">
    <rdfs:subPropertyOf rdf:resource="&process;#ifCondition" />
    <rdfs:domain rdf:resource="#FinalizeFlightDetails"/>
    <rdfs:range rdf:resource="#DetermineRoundTripStatus"/>
  </rdf:Property>

  <rdf:Property rdf:about="#thenSelectRoundTripFlight">
    <rdfs:subPropertyOf rdf:resource="&process;#then" />
    <rdfs:domain rdf:resource="#FinalizeFlightDetails"/>
    <rdfs:range rdf:resource="#SelectRoundTripFlight"/>
  </rdf:Property>

  <rdf:Property rdf:about="#elseSelectOneWayFlight">
    <rdfs:subPropertyOf rdf:resource="&process;#else" />
    <rdfs:domain rdf:resource="#FinalizeFlightDetails"/>
    <rdfs:range rdf:resource="#SelectOneWayFlight"/>
  </rdf:Property>

<!-- ########################################################################## -->
<!-- DetermineRoundTripStatus
     This is a conditional which is used
     to determine if the desired itinerary includes a return
     flight.
  -->

  <rdfs:Class rdf:ID="DetermineRoundTripStatus">
    <rdfs:subClassOf rdf:resource="&process;#Condition" />
    <rdfs:subClassOf>
      <daml:Restriction>
	<daml:onProperty rdf:about="#roundTrip" />
	<daml:hasValue>true</daml:hasValue>
      </daml:Restriction>
    </rdfs:subClassOf>
  </rdfs:Class>

<!-- ########################################################################## -->
<!-- SelectRoundTripFlight
     Select both an outbound and an inbound flight
  -->

  <rdfs:Class rdf:ID="SelectRoundTripFlight">           
    <rdfs:subClassOf rdf:resource="&process;#Sequence" />
    <daml:subClassOf>
      <daml:Restriction> 
	<daml:onProperty rdf:resource="&process;#components" />
	<daml:toClass>
	  <daml:subClassOf>
	    <daml:unionOf rdf:parseType="daml:collection">
	      <rdfs:Class rdfs:about="#SelectOutboundFlight"/>
	      <rdfs:Class rdfs:about="#SelectInboundFlight"/>
	    </daml:unionOf>
	  </daml:subClassOf>
	</daml:toClass>
      </daml:Restriction>
    </daml:subClassOf>
  </rdfs:Class>

<!-- ########################################################################## -->
<!-- SelectOneWayFlight
     Select an outbound flight only
  -->

  <rdfs:Class rdf:ID="SelectOneWayFlight">           
    <rdfs:subClassOf rdf:resource="&process;#CompositeProcess" />
    <daml:subClassOf>
      <daml:Restriction> 
	<daml:onProperty rdf:resource="&process;#components" />
	<daml:toClass>
	  <daml:subClassOf>
	    <daml:unionOf rdf:parseType="daml:collection">
	      <rdfs:Class rdfs:about="#SelectOutboundFlight"/>
	    </daml:unionOf>
	  </daml:subClassOf>
	</daml:toClass>
      </daml:Restriction>
    </daml:subClassOf>
  </rdfs:Class>

<!-- ########################################################################## -->
<!-- SelectOutboundFlight
     This is where a number of flight alternatives would be offered,
     and the requester would select one possible filght.

     For now assume that an arbitary (valid) option is chosen without
     any conversation with the requester.
  -->

  <rdfs:Class rdf:ID="SelectOutboundFlight">
    <rdfs:subClassOf rdf:resource="#AlphaAirBuyProcess" />
  </rdfs:Class>


<!-- ########################################################################## -->
<!-- SelectInboundFlight
     This is where a number of flight alternatives would be offered,
     and the requester would select one possible filght.

     For now assume that an arbitary (valid) option is chosen without
     any conversation with the requester.
  -->

  <rdfs:Class rdf:ID="SelectInboundFlight">
    <!-- Select one of several possible flights based on time -->
    <!-- Ignore if this is not a round-trip -->
    <rdfs:subClassOf rdf:resource="#AlphaAirBuyProcess" />
  </rdfs:Class>

<!-- ########################################################################## -->
<!-- LogInChoice
     This allows a user to choose whether to create an account and profile, or
     to log into an existing account.
  -->

  <rdfs:Class rdf:ID="LogInChoice">           
    <rdfs:subClassOf rdf:resource="&process;#Choice" />
    <daml:subClassOf>
      <daml:Restriction> 
	<daml:onProperty rdf:resource="&process;#components" />
	<daml:toClass>
	  <daml:subClassOf>
	    <daml:unionOf rdf:parseType="daml:collection">
	      <rdfs:Class rdfs:about="#CreateAccount"/>
	      <rdfs:Class rdfs:about="#LogIntoExistingAccount"/>
	    </daml:unionOf>
	  </daml:subClassOf>
	</daml:toClass>
      </daml:Restriction>
    </daml:subClassOf>
  </rdfs:Class>

<!-- ########################################################################## -->
<!-- CreateAcct requires inputs of acct name and signin info -->

  <rdfs:Class rdf:ID="CreateAccount">
    <rdfs:subClassOf rdf:resource="#AlphaAirBuyProcess" />
    <rdfs:subClassOf>
      <daml:Restriction>
	<rdfs:onProperty rdf:resource="&process;#input"/>
        <daml:toClass rdf:resource="#CreateAccountInfo"/>
      </daml:Restriction>
      <daml:Restriction>
	<rdfs:onProperty rdf:resource="&process;#output"/>
        <daml:toClass rdf:resource="#AccountID"/>
      </daml:Restriction>
    </rdfs:subClassOf>
  </rdfs:Class>

  <rdfs:Class rdf:ID="CreateAccountInfo">
    <daml:unionOf rdf:parseType="daml:collection">
      <daml:Thing rdf:resource="#fullName"/>
      <daml:Thing rdf:resource="#fullAddress"/>
      <daml:Thing rdf:resource="#email"/>
      <daml:Thing rdf:resource="#accntName"/>
      <daml:Thing rdf:resource="#password"/>
    </daml:unionOf>
  </rdfs:Class>

  <rdfs:Class rdf:ID="AccountID">
    <rdfs:subClassOf rdf:resource="&daml;#Thing"/>
  </rdfs:Class>

  <rdf:Property rdf:about="#acctID">
    <rdfs:domain rdf:resource="#AccountID" />
  </rdf:Property>


<!-- ########################################################################## -->

  <rdfs:Class rdf:ID="LogIntoExistingAccount">
    <rdfs:subClassOf rdf:resource="#AlphaAirBuyProcess" />
    <rdfs:subClassOf>
      <daml:Restriction>
	<rdfs:onProperty rdf:resource="&process;#input" />
	<daml:toClass rdf:resource="#LogInInfo"/>
      </daml:Restriction>
      <daml:Restriction>
	<rdfs:onProperty rdf:resource="&process;#output"/>
        <daml:toClass rdf:resource="#AccountID"/>
      </daml:Restriction>
    </rdfs:subClassOf>
  </rdfs:Class>

  <rdfs:Class rdf:ID="LogInInfo">
    <daml:unionOf rdf:parseType="daml:collection">
      <daml:Thing rdf:resource="#acctName"/>
      <daml:Thing rdf:resource="#password"/>
    </daml:unionOf>
  </rdfs:Class>

<!-- ########################################################################## -->

<!-- ########################################################################## -->
<!-- ConfirmReservation
     Confirm the reservation. For now assume that
     reservations are confirmed automatically
  -->

  <rdfs:Class rdf:ID="ConfirmReservation">
    <rdfs:subClassOf rdf:resource="#AlphaAirBuyProcess" />
  </rdfs:Class>

<!-- ########################################################################## -->
<!-- DeliverFlightItinerary
     Send the flight Itinerary to the Email as defined by the
     user account.
  -->

  <rdfs:Class rdf:ID="DeliverFlightItinerary">
    <rdfs:subClassOf rdf:resource="#AlphaAirBuyProcess" />
    <rdfs:subClassOf>
      <daml:Restriction>
	<rdfs:onProperty rdf:resource="&process;#input" />
        <daml:toClass rdf:resource="#DeliverFlightItineraryInfo"/>
      </daml:Restriction>
    </rdfs:subClassOf>
  </rdfs:Class>

  <rdfs:Class rdf:ID="DeliverFlightItineraryInfo">
    <daml:unionOf rdf:parseType="daml:collection">
      <daml:Thing rdf:resource="#flightItinerary"/>
      <daml:Thing rdf:resource="#reservationNumber"/>
    </daml:unionOf>
  </rdfs:Class>

</rdf:RDF>
