Rx4RDF requires Python 2.2 or later (2.4 recommended) and the 4Suite XML library (at http://4Suite.org, version 1.0a1 or later).
Rx4RDF and Rhizome are tested on Linux, Windows XP, and OS X 10.4 and should work on any platform that supports Python and 4Suite. It has been also known to work on Windows 98, Windows 2000, Cygwin and BSD.
If you're just interested in ZML you just need this one Python file.
Optional RDF Libraries
If the following RDF libraries are installed, Rx4RDF will utilize the datastores and RDF parsers that they support -- see the Raccoon manual for more info. If none are installed, Rx4RDF only supports a text file-based datastore and the NTriples and RxML RDF formats.
Redland (http://librdf.org/). Enables support for the RDF/XML and Turtle RDF formats. Note that the required Python bindings need to be installed separately.
RDFLib (http://www.rdflib.net) Enables support for the RDF/XML format.
4Suite RDF -- the latest version of 4Suite (1.0b3) does not include their RDF library. However, prior versions of 4Suite do and they can be used with RxRDF. Note that 4Suite's RDF/XML parser doesn't support recent changes to the syntax and will only be used if none of the other RDF libraries are installed.
Other optional packages:
If Lupy is installed (http://www.divmod.org/Home/Projects/Lupy), Rhizome will perform full-text indexing of content (requires Python 2.3 or later). See the Rhizome manual for more info.
Install
This is a standard Python source distribution. To install:
- Unzip
- Run python <unzip dir>/setup.py install
This installs:
- a package named "rx" in the Python site-packages directory
- shell scripts or .bat files for running Raccoon and ZML in the Python scripts directory (in the Python install directory on Windows or or on Unix-like systems one of the standard "/usr/bin", "usr/local/bin", or "~/bin").
- a directory named "rx4rdf" containing documentation, Rhizome pages, and other ancillary files in the Python "share" directory (in the Python install directory on Windows or on Unix-like systems one of the standard "/usr/share", "usr/local/share", or "~/share").
(Actually, if you always run Python from the directory you unzipped to, you don't even need install it.)
Upgrading
Upgrading contains notes on upgrading from the previous version.
Quick Start
Once you've installed Rx4RDF, use this guide to quickly start playing with its various components. Also, see the readme.txt in the install package for release notes.
Raccoon and Rhizome
Run a local copy of this site:
- cd <unzip dir>/site
- either:
- <python script dir>/run-raccoon -a site-config.py or
- python <python lib dir>/site-packages/rx/raccoon.py -a site-config.py
- Browse to http://localhost:8000 (edit server.cfg to change the port).
To start a fresh Rhizome site, copy the files in the <unzip dir>/blank directory (which is also installed to <python share dir>/rx4rdf/blank) to the directory where you want to the site to live. Then edit blank-config.py to adjust the path to rhizome-config.py. (There are other settings you should probably change to -- read the comments in blank-config.py or consult the Rhizome manual.) Now you are ready to launch your new site:
- cd <directory of the new site>
- <python script dir>/run-raccoon -a blank-config.py
RxPath
To run a query on an RDF or NTriples file:
python <python lib dir>/site-packages/rx/RxPathDom.py myrdf.rdf "RxPath expression"
If "RxPath expression" is omitted it will start in interactive mode.
RxPath expressions can be preceeded by one or more expressions of the form xmlns(prefix=namespaceuri), which set the namespace prefixes for subsequent RxPath expression (for duration of the session if in interactive mode). If the prefix is omitted (e.g. xmlns(=http://example.org/ns)) the default namespace will be set.
RxSLT
To invoke a RxSLT transform on a RDF or NTriples file:
python <python lib dir>/site-packages/rx/RxPathDom.py -t|--transform myrdf.rdf myrxslt.xsl
RxUpdate
There's no command line interface for RxUpdate yet -- to experiment with it run an instance of Rhizome and go to the Sandbox page (you'll probably have to login as admin). Or see RxPath.py for programmatic interfaces.
ZML
Convert ZML to XML:
<python script dir>/zml [-p] [-d] [-mm MyMarkupMapFactory()] zmlsample.zml or python <python lib dir>/site-packages/rx/zml.py [-p] [-d] [-mm MyMarkupMapFactory()] zmlsample.zml
Convert ZML to XML: <python script dir>/zml -z xmlsample.xml
Options:
- -z convert from XML to ZML (if omitted: ZML to XML)
- -p pretty print
- -d show debug output
ZML to XML options:
- -m assume ZML source is in markup mode
- -r [rootelement] wrap in root element (default: "zml")
- -mm markupmap [string that evaluates to a Python class compatible with rx.zml.DefaultMarkupMapFactory]
RxML
Convert a RDF or NTriples file to RxML/ZML:
python <python lib dir>/site-packages/rx/rxml.py -r myrdf.rdf
Convert a RxML/XML file to RDF (NTriples):
python <python lib dir>/site-packages/rx/rxml.py -n myrdf.rdf

