11.4 Redfoot

Redfoot is another multicomponent application. If you reviewed Section 9.3, you saw one of the components ? an RDF parser and API written in Python called RDFLib ? in use. In addition to RDFLib, Redfoot also provides a lightweight HTTP server in addition to a scriptlike language the creator of Redfoot calls Hypercode.

Information and the source code for Redfoot can be found at http://redfoot.net. Download RDFLib separately at http://rdflib.net. Check the documentation to review the requirements for Redfoot, first, before installing

Redfoot has an HTTP listener that by default listens in on port 80, so if you have another web server running, you may want to shut it off, first. When running locally, access the RDFLib page through http://localhost.

After Redfoot is running, you can administer Redfoot by setting the document root, managing contexts, or editing a weblog (Redfoot also provides a basic weblogging tool). Document root controls where all persisting information is stored. The framework supports multiple RDF/XML models ? the contexts of the tools. Redfoot has several included with the default installation. You can also add additional ones, as I did with the example file at http://burningbird.net/articles/monsters1.rdf. I added the file by specifying its URL within the Add Contexts admin page. From this same admin page, you can also add weblog entries into a weblog; however, the weblog editing features of Redfoot are fairly basic compared to other specialized weblogging tools.

From the main admin page you can access several examples, including an RDF Navigator that seems to allow you to build an RDF model, search on it, and so on. It's difficult to tell exactly how to use the application, though, because there's no documentation for it. The Recipes and the FOAF application, though, are intuitively easy to use. Figure 11-4 shows a page from the Recipes application.

Figure 11-4. Example page from Recipes application

As stated earlier, Redfoot uses its own scripting language it calls Hypercode. Hypercode is Python that's embedded within a CDATA block in an RDF/XML document that contains information about how to initialize the data. For instance, Example 11-4, from the application's Hello World example, reports back "Hello World" to the browser.

Example 11-4. Snippet from Hello World Redfoot application
<rdf:Description rdf:about="http://localhost:8080/">
    <rdfs:label>Hello World</rdfs:label>
        <rdfs:label>Hello World Facet</rdfs:label>
        <red:outer rdf:resource="http://redfoot.net/2002/11/09/redsite#outer"/>
            <rdfs:label>Redsite Outer page</rdfs:label>


<p>Hello World!</p>




In this example, information about the code is defined using RDF/XML and then implemented within the Python block. Interesting, but again the documentation is quite sparse. Redfoot is an application you'll want to check out only if you like to explore, feel comfortable with minimum documentation, and have a great fondness for Python.