<?xml version='1.0' encoding='ISO-8859-1'?>
<!DOCTYPE rdf:RDF [
         <!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
         <!ENTITY rdfs 'http://www.w3.org/2000/01/rdf-schema#'>
         <!ENTITY owl 'http://www.w3.org/2002/07/owl#'>
         <!ENTITY policy 'http://www.cs.umbc.edu/~lkagal1/rei/ontologies/ReiPolicy.owl#'>
         <!ENTITY action 'http://www.cs.umbc.edu/~lkagal1/rei/ontologies/ReiAction.owl#'>
         <!ENTITY constraint 'http://www.cs.umbc.edu/~lkagal1/rei/ontologies/ReiConstraint.owl#'>
         <!ENTITY deontic 'http://www.cs.umbc.edu/~lkagal1/rei/ontologies/ReiDeontic.owl#'>
         <!ENTITY entity 'http://www.cs.umbc.edu/~lkagal1/rei/ontologies/ReiEntity.owl#'>
         <!ENTITY dso 'http://www.dspace.org/objectModel#'>
         <!ENTITY dsr 'http://www.dspace.org/rules.rdfs#'>
         <!ENTITY inst 'http://www.dspace.org/instances.rdf#'>
         <!ENTITY history 'http://www.dspace.org/history#'>
         ]>
         
<rdf:RDF xmlns:rdf="&rdf;"
             xmlns:rdfs="&rdfs;"
             xmlns:owl="&owl;"
             xmlns:policy="&policy;"
             xmlns:action="&action;"
             xmlns:constraint="&constraint;"
             xmlns:deontic="&deontic;"
             xmlns:entity="&entity;"
                 xmlns:dso="&dso;"
             xmlns:dsr="&dsr;"
             xmlns:inst="&inst;"
                 xmlns:history="&history;"
               xml:base="http://www.dspace.org/instances.rdf#">
             
<!-- CU-0006 Deposit Agreement
                
                Actual DSpace@MIT Policy Examples
                
                1. Each [DSpace Item] requires a <deposit license>
                2. Upon deposit of each [Dspace Item], <depositor> is required to accept the deposit license.
        -->
        

    <entity:Variable rdf:ID="var1" policy:desc="An authorized DSpace Depositor"/>
        
        <entity:Variable rdf:ID="var2" policy:desc="A DSpace Item"/>
                        
        <!-- Is DSpace Item -->
        <constraint:SimpleConstraint rdf:ID="IsDSpaceItem">
                <constraint:subject rdf:resource="#var2"/>
                <constraint:predicate rdf:resource="&rdf;type"/>
                <constraint:object rdf:resource="&dso;Item"/>
                <policy:desc>All DSpace Items</policy:desc>
        </constraint:SimpleConstraint>
                
        <!-- [Upon Deposit] -->
        <constraint:SimpleConstraint rdf:ID="CreatesItem">
                <constraint:subject rdf:resource="#var1"/>
                <!-- Existing Class of Actions in History Ontology, wonder if I need to reference an individual of the class here. -->
                <constraint:predicate rdf:resource="&history;Creates"/>
                <constraint:object rdf:resource="#var2"/>
        </constraint:SimpleConstraint>

        <!-- Individual of new class of Actions in new namespace 'http://www.dspace.org/rules.rdfs' -->
        <dsr:AcceptingLicense rdf:ID="AcceptsLicense">
                <action:actor rdf:resource="#var1"/>
                <action:target rdf:resource="http://libraries.mit.edu/dspace-mit/build/policies/license.html"/>
        </dsr:AcceptingLicense>
        
        <!-- Individual of new class of Actions in new namespace 'http://www.dspace.org/rules.rdfs' -->
        <dsr:HavingDepositLicense rdf:ID="hasMITDSpaceDepositLicense">
                <action:actor rdf:resource="#var2"/>
                <action:target rdf:resource="http://libraries.mit.edu/dspace-mit/build/policies/license.html"/>
        </dsr:HavingDepositLicense>
                
        <!-- 1. Each Dspace Item Requires a Deposit License -->
        <deontic:Obligation rdf:ID="RequireLicense" policy:desc="Each DSpace Item Requires a Deposit License">
                <deontic:actor rdf:resource="#var2"/>
                <!-- Reference to individual of new class in new namespace 'http://www.dspace.org/rules.rdfs' -->
                <deontic:action rdf:resource="&dsr;hasMITDSpaceDepositLicense"/>
                <deontic:constraint rdf:resource="#IsDSpaceItem"/>
        </deontic:Obligation>
                
        <!-- 2. Upon deposit of each DSpace Item, depositor (DSpace User) is required to accept the deposit license. -->
        <deontic:Obligation rdf:ID="AcceptLicense" policy:desc="Upon deposit of each Dspace Item, depositor is required to accept the deposit license.">
                <deontic:actor rdf:resource="#var1"/>
                <!-- Reference to individual of new Class in new namespace 'http://www.dspace.org/rules.rdfs'.  New Class is a subClass of the Class of all actions. -->
                <deontic:action rdf:resource="&inst;AcceptsLicense"/>
                <deontic:constraint rdf:resource="#CreatesItem"/>
        </deontic:Obligation>
        
        <!-- Statement of Policy, For all DSpace Items, both rule number 1 (see above) and rule number 2 (see above) apply. -->
        <policy:Policy rdf:ID="CU0006DepositLicense">
                <policy:actor rdf:resource="#var2"/>
                <policy:context rdf:resource="#IsDSpaceItem"/>
                <policy:grants rdf:resource="#RequireLicense"/>
                <policy:grants rdf:resource="#DepositorAcceptsLicense"/>
        </policy:Policy>
        
        <!-- Granting instance for rule number 2. -->
        <policy:Granting rdf:ID="DepositorAcceptsLicense">
                <policy:to rdf:resource="#var1"/>
                <policy:deontic rdf:resource="#AcceptLicense"/>
        </policy:Granting>
            
</rdf:RDF>
