Pychinko-0.1 Release

This is the first release of Pychinko, a Rete-based rule engine.

Requirements

For Pychinko to run, you must have the following Python packages installed:

Installation

Once you've unpacked Pychinko, the first step is to change config.py to reflect your settings.

Finally, run:

$ python setup.py install

Running the tests

Once you've correctly set the variables in config.py and installed the necessary software packages, try the following: $ python run_tests.py This runs two major test suites, one on the internals of Pychinko (a suite of unit tests) and one preliminary test of the Rete engine that compares the results for soundness and completeness against CWM. There are a total of 20 tests. If all went well, you should see something along those lines:
$ python run_tests.py
Running all Pychinko testcases
Generating random facts into generatedtests/testfacts.200.n3
Generating random facts into generatedtests/testfacts.100.n3
Generating random facts into generatedtests/testfacts.1200.n3
Generating random facts into generatedtests/testfacts.700.n3
Generating random facts into generatedtests/testfacts.500.n3
Testing  rules/rdfs-rules.n3
CWM COMMAND:  time cwm.py groundtests/rdfs-closure1.n3 --ntriples \
--think=rules/rdfs-rules.n3 --base=http://www.mindswap.org/~katz/ \
--purge > generatedtests/testoutput.rdfs-closure1.cwm.n3
10  inferred fact(s)
Pychinko time: 0.412466049194
CWM time: 

real    0m4.547s
user    0m1.010s
sys     0m0.040s
comparing generatedtests/testoutput.rdfs-closure1.cwm.n3 and
generatedtests/testoutput.rdfs-closure1.pychinko.n3
parsing: generatedtests/testoutput.rdfs-closure1.pychinko.n3
no differences.
....{mary: {bob: ()}}
.Time to add (fast): 0.0213160514832
.Time to add (slow): 0.014710187912
...{parent: {None: {None: [AlphaNode(Pattern(?x, parent, ?y))(Mem:
{})], bob: [AlphaNode(Pattern(bob, parent, ?y))(Mem: {})]}}}
....Pattern(?x, type, ?d)
.......
----------------------------------------------------------------------
Ran 20 tests in 7.182s

Usage

If you've reached this stage with no problems, consider yourself lucky. Using Pychinko is very simple. To pass a set of rules and facts to Pychinko for inference, use the following:
$ python main.py --facts=factsFile.n3 --rules=rulesFile.n3
Below is an example of running the RDFS inference rules on a file:
$ python main.py --facts=groundtests/rdfs-closure1.n3 --rules=rules/rdfs-rules.n3
10  inferred fact(s)
By default, the results are dumped to a file called pychinko.output. You can change this using the --output argument, e.g.:
$ python main.py --facts=groundtests/rdfs-closure1.n3 --rules=rules/rdfs-rules.n3 --output=myResults.n3
10  inferred fact(s)

yarden@umd.edu
Last modified: Wed Jan 19 03:23:52 EST 2005