N3Modeljena-readme.txt ---------------------- Implementation of my N3Model API interfaced to a Jena RDF store. The base class N3Model defines the basic API, implemented in pure Python. N3ModelJenaMem provides an implementation that uses a Jena memory-based RDF store. N3ModelJenaRdb provides an implementation that uses a Jena RDB-based RDF store. This has been tested with MySQL, but the interface exposes enough of Jena's RDB options that it should be usable with any Jena-supported RDB. For background information about this software, please see: http://www.ninebynine.org/RDFNotes/RDFForLittleLanguages.htm (The report generator software has not yet been modified to run against a Jena model.) To run the software, Jython 2-1 is required. (http://www.jython.org/download.html) N3JenaRdb.java is a Java shim class used to interface Python to the Jena ModelRDB class. I compile this into the same directory as the Python source code. It seems that some classes don't get picked up automatically under Jython, so the batch file Jython.bat has explicit classpath specification for Jena and MySQL modules. This will need adjusting or rewriting for different target environments. Note that databases must be created before they can be used. I use module CreateTestDatabase.py running under CPython 2.2 to create the test database using MySQL. The exact procedure will vary with the database used. After creating the database, the N3ModelJenaRdb.format() method must be called the first tike before it can be used (I'm hoping to fix this.) Interfacing to Notation3 parser ------------------------------- Here is a plan for interfacing my Notation3 parser () to load data into a Jena model. One day, I'll just do this and release the code. 1. Use N3SyntaxCheck.py as a starting point. Check that it runs under your Jython config. This will check out the parser separately from Jena. 2. Check that you can run N3ModelJenaMem under your Jython -- this will prove that you can access the basic Jena classes OK. I think the RDFNode updates will need to be applied. (This is primarily a class file, but contains code for stand-alone testing.) 3. Check that you can run N3ModelJenaRdb under your Jython -- this will prove that you can use the Jena RDB stuff. My code is all set up for MySQL, so you may need to tweak the database access parameters. (This is primarily a class file, but contains code for stand-alone testing.) 4. Modify a copy of N3SyntaxCheck.py to use N3ModelJenaMem or N3ModelJenaRdb in place of N3Model -- these classes extend N3Model and use the same interface other than initialization. The main logic for driving the parser in method readData of class N3SyntaxCheck. Note that readData() creates a temporary model into which the parsed N3 is loaded; if the -r option is used, this is then merged into a separate N3Model that has been created by the class constructor. History: -------- 15-May-2002: Initial release #g -- $Id: N3ModelJena-readme.txt,v 1.3 2002/09/12 14:16:42 graham Exp $