FuXi

FuXi (pronounced foo-see) is a forward-chaining, rule-based system that expands 4RDF to include reasoning capabilities via interpretation of explicit implications writen in Notation 3 and persisted in the Model under a named sub graph (scope). Fuxi uses Pychinko to match and fire the specified rules. It also includes a Versa function that allows Versa query expressions to be executed within a model (scoped or not) extended to include statements inferred by rules in a particular scope.

Below is the format of the versa function:

prospective-query(ruleGraph,targetGraph,expr,qScope=None)

Using FuXi, it takes all the facts from the current query context (which may or may not be scoped) , the rules from the scope and invokes/executes the Rete reasoner. It adds the inferred statements to the scope. Then, it performs the query over the (or the entire model if None), removing the inferred statements upon exit

Fuxi depends on Pychinko, rdflib, and CWM (just the 1.82 tarball is sufficient and suggested). Pychinko's interpreter only uses CWM for it's N3 log/math/os function implementations and rdflib for it's Literal and URIRef classes (for representing the correspondig terms of an RDF statement for purposes of comparing them when matching rules). See Yarden Katz's comments on the original FuXi http://copia.ogbuji.net/blog/2005-05-29/FuXi

The dependent libraries can be downloaded from:

The FuXi source tree is located here: http://copia.ogbuji.net/files/FuXi/ and the most recent version can be downloaded here

FuXi Description of a Project (DOAP) instance: FuXi-doap.rdf

FuXi can be installed via the standard 'python setup.py install' It will install FuXi.py, VersaFuXiExtensions.py and N3RuleExtractor.py to the python path and finally it also will update Ft.Rdf.Parsers.Versa.init to include the extension function(s). If this latter part of the installation process doesn't work (perhaps because you have installed 4Suite in an unlikely, non-default location) you should simply be able to copy over FuXi/Versa/init.py to /Ft/Rdf/Parsers/Versa

Convention Note: When I refer to a scope, I mean it in the 4RDF sense. 4RDF implements named subgraphs (within the larger RDF Model) as scopes. Statements are associated with a scope by an extra attribute persisted on the statement.
Versa queries (and all Model manipulations) can occur on the entire model or within a specific scope. For more information on the mind-bending subject see:

http://copia.ogbuji.net/blog/2005-05-16/Contexts__

Chimezie Ogbuji