<rdf:RDF
  xmlns:rdf ="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
  xmlns:daml="http://www.daml.org/2001/03/daml+oil#"
>

<daml:Ontology rdf:about="">
  <daml:versionInfo>Version 1</daml:versionInfo>
  <rdfs:comment>Survey Ontology</rdfs:comment>
  <daml:imports rdf:resource="http://www.daml.org/2001/03/daml+oil"/>
</daml:Ontology>

<!-- Classes -->

<rdfs:Class rdf:ID="Directive" />

<rdfs:Class rdf:ID="BodyDirective" />

<rdfs:Class rdf:ID="Start" />

<rdfs:Class rdf:ID="Finish" />

<rdfs:Class rdf:ID="Module" />

<rdfs:Class rdf:ID="UpdatesOnly" />

<rdfs:Class rdf:ID="Query" />

<rdfs:Class rdf:ID="Validation" />

<rdfs:Class rdf:ID="Question" />

<rdfs:Class rdf:ID="RosterManipulation" />

<rdfs:Class rdf:ID="TabularQuery" />

<rdfs:Class rdf:ID="LoopRoster" />

<rdfs:Class rdf:ID="CreateRoster" />

<rdfs:Class rdf:ID="Survey" />

<rdfs:Class rdf:ID="SurveyConnector" />

<rdfs:Class rdf:ID="NormalConnector" />

<rdfs:Class rdf:ID="ConditionalConnector" />

<rdfs:Class rdf:ID="Branch" />

<rdfs:Class rdf:ID="Skip" />

<rdfs:Class rdf:ID="Procedure" />

<!-- Properties -->

<rdf:Property rdf:ID="surveyForm" />

<rdf:Property rdf:ID="selectionExpression" />

<rdf:Property rdf:ID="updateDirective" />

<rdf:Property rdf:ID="fillVariable" />

<rdf:Property rdf:ID="responseVariable" />

<rdf:Property rdf:ID="responseValidation" />

<rdf:Property rdf:ID="roster" />

<rdf:Property rdf:ID="d_member" />

<rdf:Property rdf:ID="c_member" />

<rdf:Property rdf:ID="finish" />

<rdf:Property rdf:ID="condition" />

<daml:UniqueProperty rdf:ID="followingDirective">
  <rdfs:domain rdf:resource="#SurveyConnector" />
  <rdfs:range  rdf:resource="#Directive" />
</daml:UniqueProperty>

<!-- <daml:UnambiguousProperty rdf:ID="incomingConnector">
         <daml:inverseOf rdf:resource="#followingDirective" />
     </daml:UnambiguousProperty> -->

<daml:UniqueProperty rdf:ID="previousDirective">
  <rdfs:domain rdf:resource="#SurveyConnector" />
  <rdfs:range  rdf:resource="#Directive" />
</daml:UniqueProperty>

<!-- <daml:UnambiguousProperty rdf:ID="outgoingConnector">
         <daml:inverseOf rdf:resource="#previousDirective" />
     </daml:UnambiguousProperty> -->

<!-- <rdf:Property rdf:ID="outgoingNormalConnector">
        <rdfs:subPropertyOf rdf:resource="#outgoingConnector" />
        <rdfs:range         rdf:resource="#NormalConnector" />
     </rdf:Property> -->

<daml:UniqueProperty rdf:ID="Client" />

<!-- Class Restrictions -->

<rdfs:Class rdf:about="#Procedure">
  <rdfs:subClassOf>
    <daml:Restriction>
       <daml:onProperty rdf:resource="#d_member" />
       <daml:toClass rdf:resource="#Directive" />
    </daml:Restriction>
  </rdfs:subClassOf>
  <rdfs:subClassOf>
    <daml:Restriction>
       <daml:onProperty rdf:resource="#c_member" />
       <daml:toClass rdf:resource="#SurveyConnector" />
    </daml:Restriction>
  </rdfs:subClassOf>
</rdfs:Class>

<rdfs:Class rdf:about="#Directive">
  <rdfs:label>Contains Updates</rdfs:label>
  <rdfs:subClassOf>
    <daml:Restriction daml:maxCardinality="1">
       <daml:onProperty rdf:resource="#surveyForm" />
    </daml:Restriction>
  </rdfs:subClassOf>
  <rdfs:subClassOf>
    <daml:Restriction daml:maxCardinality="1">
       <daml:onProperty rdf:resource="#selectionExpression" />
    </daml:Restriction>
  </rdfs:subClassOf>
  <rdfs:comment>The following two restrictions do not constrain
    anything but allow me to indicate that they are properties on
    this class
  </rdfs:comment>
  <rdfs:subClassOf>
    <daml:Restriction daml:minCardinality="0">
       <daml:onProperty rdf:resource="#updateDirective" />
    </daml:Restriction>
  </rdfs:subClassOf>
  <rdfs:subClassOf>
    <daml:Restriction daml:minCardinality="0">
       <daml:onProperty rdf:resource="#fillVariable" />
    </daml:Restriction>
  </rdfs:subClassOf>
  <rdfs:subClassOf>
    <daml:Restriction>
       <daml:onProperty rdf:resource="#outgoingConnector" />
       <daml:toClass rdf:resource="#SurveyConnector" />
    </daml:Restriction>
  </rdfs:subClassOf>
  <rdfs:subClassOf>
    <daml:Restriction daml:maxCardinalityQ="1">
       <daml:onProperty rdf:resource="#outgoingNormalConnector" />
       <daml:toClass rdf:resource="#NormalConnector" />
    </daml:Restriction>
  </rdfs:subClassOf>
  <daml:disjointUnionOf rdf:parseType="daml:collection">
    <rdfs:Class rdf:about="#BodyDirective"/>
    <rdfs:Class rdf:about="#Start"/>
    <rdfs:Class rdf:about="#Finish"/>
  </daml:disjointUnionOf>
</rdfs:Class>

<rdfs:Class rdf:about="#Start">
  <rdfs:subClassOf rdf:resource="#Directive" />
  <rdfs:subClassOf>
    <daml:Restriction daml:maxCardinality="0">
       <daml:onProperty rdf:resource="#incomingConnector" />
       <daml:toClass rdf:resource="#SurveyConnector" />
    </daml:Restriction>
  </rdfs:subClassOf>
</rdfs:Class>

<rdfs:Class rdf:about="#Finish">
  <rdfs:subClassOf rdf:resource="#Directive" />
  <rdfs:subClassOf>
    <daml:Restriction daml:maxCardinality="0">
       <daml:onProperty rdf:resource="#outgoingConnector" />
       <daml:toClass rdf:resource="#SurveyConnector" />
    </daml:Restriction>
  </rdfs:subClassOf>
</rdfs:Class>

<rdfs:Class rdf:about="#BodyDirective">
  <rdfs:label>Body Directive</rdfs:label>
  <rdfs:subClassOf rdf:resource="#Directive" />
  <rdfs:subClassOf>
    <daml:Restriction daml:minCardinalityQ="1">
       <daml:onProperty rdf:resource="#outgoingConnector" />
       <daml:toClass rdf:resource="#SurveyConnector" />
    </daml:Restriction>
  </rdfs:subClassOf>
  <rdfs:subClassOf>
    <daml:Restriction daml:minCardinalityQ="1">
       <daml:onProperty rdf:resource="#incomingConnector" />
       <daml:toClass rdf:resource="#SurveyConnector" />
    </daml:Restriction>
  </rdfs:subClassOf>
  <daml:disjointUnionOf rdf:parseType="daml:collection">
    <rdfs:Class rdf:about="#Query"/>
    <rdfs:Class rdf:about="#UpdateOnly"/>
    <rdfs:Class rdf:about="#Module"/>
  </daml:disjointUnionOf>
</rdfs:Class>

<rdfs:Class rdf:about="#UpdatesOnly">
  <rdfs:label>Updates Only</rdfs:label>
  <rdfs:subClassOf rdf:resource="#BodyDirective" />
</rdfs:Class>

<rdfs:Class rdf:about="#Module">
  <rdfs:subClassOf rdf:resource="#BodyDirective" />
  <rdfs:subClassOf rdf:resource="#Procedure" />
</rdfs:Class>

<rdfs:Class rdf:about="#Survey">
  <rdfs:subClassOf>
    <daml:Restriction daml:cardinality="1">
       <daml:onProperty rdf:resource="#client" />
    </daml:Restriction>
  </rdfs:subClassOf>
</rdfs:Class>

<rdfs:Class rdf:about="#Query">
  <rdfs:label>Contains Query</rdfs:label>
  <rdfs:subClassOf rdf:resource="#BodyDirective" />
  <rdfs:comment>The following two restrictions do not constrain
    anything but allow me to indicate that they are properties on
    this class
  </rdfs:comment>
  <rdfs:subClassOf>
    <daml:Restriction daml:minCardinality="0">
       <daml:onProperty rdf:resource="#responseVariable" />
    </daml:Restriction>
  </rdfs:subClassOf>
  <rdfs:subClassOf>
    <daml:Restriction daml:minCardinality="0">
       <daml:onProperty rdf:resource="#responseValidation" />
    </daml:Restriction>
  </rdfs:subClassOf>
  <daml:disjointUnionOf rdf:parseType="daml:collection">
    <rdfs:Class rdf:about="#RosterManipulation"/>
    <rdfs:Class rdf:about="#Validation"/>
    <rdfs:Class rdf:about="#Question"/>
  </daml:disjointUnionOf>
</rdfs:Class>

<rdfs:Class rdf:about="#Question">
  <rdfs:subClassOf rdf:resource="#Query" />
</rdfs:Class>

<rdfs:Class rdf:about="#Validation">
  <rdfs:subClassOf rdf:resource="#Query" />
</rdfs:Class>

<rdfs:Class rdf:about="#RosterManipulation">
  <rdfs:label>Roster Manipulation</rdfs:label>
  <rdfs:subClassOf rdf:resource="#Query" />
  <rdfs:subClassOf>
    <daml:Restriction daml:cardinality="1">
       <daml:onProperty rdf:resource="#roster" />
    </daml:Restriction>
  </rdfs:subClassOf>
  <daml:disjointUnionOf rdf:parseType="daml:collection">
    <rdfs:Class rdf:about="#TabularQuery"/>
    <rdfs:Class rdf:about="#LoopRoster"/>
    <rdfs:Class rdf:about="#CreateRoster"/>
  </daml:disjointUnionOf>
</rdfs:Class>

<rdfs:Class rdf:about="#TabularQuery">
  <rdfs:label>Tabular Query</rdfs:label>
  <rdfs:subClassOf rdf:resource="#RosterManipulation" />
</rdfs:Class>

<rdfs:Class rdf:about="#LoopRoster">
  <rdfs:label>Loop Roster</rdfs:label>
  <rdfs:subClassOf rdf:resource="#Procedure" />
  <rdfs:subClassOf rdf:resource="#RosterManipulation" />
</rdfs:Class>

<rdfs:Class rdf:about="#CreateRoster">
  <rdfs:label>Create Roster</rdfs:label>
  <rdfs:subClassOf rdf:resource="#Procedure" />
  <rdfs:subClassOf rdf:resource="#RosterManipulation" />
</rdfs:Class>

<rdfs:Class rdf:about="#SurveyConnector">
  <rdfs:label>Survey Connector</rdfs:label>
  <rdfs:subClassOf>
    <daml:Restriction daml:cardinalityQ="1">
       <daml:onProperty rdf:resource="#previousDirective" />
       <daml:toClass rdf:resource="#Directive" />
    </daml:Restriction>
  </rdfs:subClassOf>
  <rdfs:subClassOf>
    <daml:Restriction daml:cardinalityQ="1">
       <daml:onProperty rdf:resource="#followingDirective" />
       <daml:toClass rdf:resource="#Directive" />
    </daml:Restriction>
  </rdfs:subClassOf>
  <daml:disjointUnionOf rdf:parseType="daml:collection">
    <rdfs:Class rdf:about="#NormalConnector"/>
    <rdfs:Class rdf:about="#ConditionalConnector"/>
  </daml:disjointUnionOf>
</rdfs:Class>

<rdfs:Class rdf:about="#NormalConnector">
  <rdfs:label>Normal</rdfs:label>
  <rdfs:subClassOf rdf:resource="#SurveyConnector" />
</rdfs:Class>

<rdfs:Class rdf:about="#ConditionalConnector">
  <rdfs:label>Conditional</rdfs:label>
  <rdfs:subClassOf rdf:resource="#SurveyConnector" />
  <rdfs:subClassOf>
    <daml:Restriction daml:minCardinality="1">
       <daml:onProperty rdf:resource="#condition" />
    </daml:Restriction>
  </rdfs:subClassOf>
  <daml:disjointUnionOf rdf:parseType="daml:collection">
    <rdfs:Class rdf:about="#Branch"/>
    <rdfs:Class rdf:about="#Skip"/>
  </daml:disjointUnionOf>
</rdfs:Class>

<rdfs:Class rdf:about="#Branch">
  <rdfs:subClassOf rdf:resource="#ConditionalConnector" />
</rdfs:Class>

<rdfs:Class rdf:about="#Skip">
  <rdfs:subClassOf rdf:resource="#ConditionalConnector" />
</rdfs:Class>

</rdf:RDF>

