Policy Parser » Download Code

Downloading the Policy Parser


Click here to download the complete code for the Policy Parser.


The directory structure of the code (after expanding the .tar.gz file) is as follows:



Executing the Policy Parser on the command line:


Even though the Policy Parser is available on the web for use, the user may wish you execute it on their own machine. The instructions for running the Policy Parser on the command line is as follows:


NOTE: The user must have the NLTK library already installed on the machine, and the path to the library should be added to the environment variable PYTHONPATH.


Untar PolicyParser.tar.gz into a directory of choice. In that directory, type:


bash$: cd PolicyInterpreter
bash$: python
Python 2.5.1 (r251:54863, Feb 4 2008, 21:48:13)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from policyParser import *
>>> result = runPolicyParser()


The Policy Parser asks the user for two inputs: the name of a policy and the sentence for the policy itself. The result of running the Policy Parser is a string that represent the generated RDF. To use the AIR reasoner with this policy, however, the RDF file must be stored at a location (URI) on the web. Thus, we recommend the user to use our web tool, which automatically stores the generated RDF on the web and provides an interface to retrieve the RDF for the use with the reasoner.