
Rein : A Distributed Policy Framework in N3 Rules
-------------------------------------------------

Rein (pronounced rain) is a decentralized framework for representing
and reasoning over distributed policies in the Semantic Web. Policies
in Rein use information defined in and inferences made by other
policies and web resources forming interconnected policy
networks. Rein allows policies to be represented in different policy
ontologies and requires the use of N3 rules, a semantic web rule
language, for defining the connections in these networks.  Reasoning
over these networks to obtain policy decisions is done using cwm, an
N3 reasoner. Rein consists of three main components - a high level
ontology for describing policy networks, mechanisms in N3 for using
information and inferences from both policies and web resources, and
an engine for inferring policy decisions from policy networks. As part
of our future work we would like to look into the use of SWRL and
RuleML to develop similar functionality as the Rein framework.

To find out more about Rein, please visit http://dig.csail.mit/2005/05/rein


INSTALLATION
------------

1. Download and install cwm as described at
   http://www.w3.org/2000/10/swap/doc/CwmInstall

Assume that cwm is installed in the following directory
cwm : /home/cwm/cwm.py 

2. Download the Rein reasoning engine and examples, rein.tar.gz, from
http://csail.mit.edu/2005/rein/

3. Unpack rein.tar.gz

4. The Rein directory contains the Rein policy network ontology (rein.n3), 
the Rein reasoning engine (engine.n3), and several examples.

5. Download llyn.py and copy it to home/cwm/swap/


EXECUTING EXAMPLES
------------------

We have developed an example policy network to verify the utility 
of the Rein framework. This example network consists of 4 policy 
ontologies, 5 policies, and several resources that are controlled by 
the policies. We have also developed a set of requests as examples of 
how the Rein framework can be queried. Every file in the example 
network (request?, policy?, ont?) can potentially be in a different 
namespace.

1. We assume that cwm and the Rein engine are downloaded and installed
in the following directories

cwm : /home/cwm/cwm.py 
Rein engine : /home/rein/engine.n3

2. Create an alias for cwm. For example,

> alias cwm="python /home/cwm/cwm.py"

3. To execute a example, change to the Rein home directory and run the 
following command at the prompt

> cwm --n3 request?.n3 --think --filter="engine.n3"

where,
      requestA is a set of queries for resources controlled by policyA
      requestB is a set of queries for resources controlled by policyB
      requestC is a set of queries for resources controlled by policyC
      requestD is a set of queries for resources controlled by policyD


RESULTS
-------

The following are the expected results of the queries. The reasons for
these results are described in the request?.n3 file.

1. requestA.n3 
> cwm --n3 requestA.n3 --think --filter="engine.n3" 
#Processed by Id: cwm.py,v 1.164 2004/10/28 17:41:59 timbl Exp 
        #    using base file:/Users/lkagal1/Research/PAW/Rein/requestA.n3
        
#  Notation3 generation by
#       notation3.py,v 1.166 2004/10/28 17:41:59 timbl Exp

#   Base was: file:/Users/lkagal1/Research/PAW/Rein/requestA.n3
     @prefix : <ontA.n3#> .
     @prefix ontb: <ontB.n3#> .
     @prefix reina: <reinA.n3#> .
    
    :Mark     reina:ispermitted :UseHPFax .
    
    :Matthew     reina:ispermitted :UseHPFax .
    
    :Philip     reina:ispermitted :UseQuantumNetwork .
    
    ontb:Alice     reina:ispermitted :UseHPFax .
    
#ENDS

2. requestB.n3
> cwm --n3 requestB.n3 --think --filter="engine.n3" 
#Processed by Id: cwm.py,v 1.164 2004/10/28 17:41:59 timbl Exp 
        #    using base file:/Users/lkagal1/Research/PAW/Rein/requestB.n3
        
#  Notation3 generation by
#       notation3.py,v 1.166 2004/10/28 17:41:59 timbl Exp

#   Base was: file:/Users/lkagal1/Research/PAW/Rein/requestB.n3
     @prefix : <ontB.n3#> .
     @prefix reinb: <reinB.n3#> .
    
    :Alice     reinb:permitted :Call,
                :Flickr,
                :UberPrint .
    
#ENDS

3. requestC.n3
>   cwm --n3 requestC.n3 --think --filter="engine.n3"
#Processed by Id: cwm.py,v 1.164 2004/10/28 17:41:59 timbl Exp 
        #    using base file:/Users/lkagal1/Research/PAW/Rein/requestC.n3
        
#  Notation3 generation by
#       notation3.py,v 1.166 2004/10/28 17:41:59 timbl Exp

#   Base was: file:/Users/lkagal1/Research/PAW/Rein/requestC.n3
     @prefix : <ontC.n3#> .
     @prefix ontd: <ontD.n3#> .
     @prefix reinc: <reinC.n3#> .
    
    :Jan     reinc:canAccess :Pic234 .
    
    :Jerry     reinc:canAccess :Pic456 .
    
    :Jim     reinc:canAccess :Pic123 .
    
    ontd:Sue     reinc:canAccess :Pic123 .
    
    <http://www.cs.umbc.edu/~finin/foaf.rdf>     reinc:cannotAccess :Pic123 .
    
    <http://www.livejournal.com/users/kyrielle/data/foaf>     reinc:canAccess :Pic789 .
    
#ENDS

4. requestD.n3
> cwm --n3 requestD.n3 --think --filter="engine.n3" 
#Processed by Id: cwm.py,v 1.164 2004/10/28 17:41:59 timbl Exp 
        #    using base file:/Users/lkagal1/Research/PAW/Rein/requestD.n3
        
#  Notation3 generation by
#       notation3.py,v 1.166 2004/10/28 17:41:59 timbl Exp

#   Base was: file:/Users/lkagal1/Research/PAW/Rein/requestD.n3
     @prefix : <ontD.n3#> .
     @prefix onta: <ontA.n3#> .
     @prefix reind: <reinD.n3#> .
    
    onta:Matthew     reind:execute :File2 .
    
    :Jennifer     reind:read :File1;
         <#change-command> :File1 .
    
    :Karen     reind:execute :File3 .
    
#ENDS

