RDFa support in Jena GRDDL Reader (SVN)

Summary:
RDFa support now in Jena GRDDL Reader, even without a GRDDL profile 
being specified. Also includes HTML tidy.
Uses v0.8 of Fabien's transform.

(Not yet released, but can be built from public sources)

Note to WGs:
This was an easy extension to a GRDDL aware agent, taking only an hour 
or two for coding and testing. This can be interpreted as showing that 
the two technologies have synergy.
Background: Paolo wants RDFa support in Jena.

========

Hi Paolo

I've made my first effort at adding RDFa support.

You need to get the SVN copy of the Jena GRDDL Reader.
The minimal documentation is found on the setProperty method of
com.hp.hpl.jena.grddl.GRDDLReader

The example test code is:

     	Model m = createMemModel();
     	RDFReader r = m.getReader("GRDDL");
     	r.setProperty("grddl.rdfa", "true");
         r.read(m, 
"http://www.w3.org/2001/sw/grddl-wg/td/hCardFabien-RDFa.html");
         Model m2 = createMemModel();
         m2.read(
"http://www.w3.org/2001/sw/grddl-wg/td/hCardFabien-output.rdf",
"http://www.w3.org/2001/sw/grddl-wg/td/hCardFabien-RDFa.html",
         		"RDF/XML");
         assertIsoModels(m2, m);


The key line is:

     	r.setProperty("grddl.rdfa", "true");

this disables all other GRDDL processing and adds Fabien's transform as 
the only transformation (for all (X)HTML input).

NB: the SVN version is not recommended for general use since I fiddle 
with the security features, and some are currently disabled. With the 
grddl.rdfa property set, the risks are much less: essentially you are 
exposed to Fabien's computer being subverted.

The test above was quite slow (about 10 seconds). I could add caching 
for transforms, so that you don't keep getting Fabien's transform when 
doing a lot of files. However, caching is not yet on my horizon.

Jeremy


-- 
Hewlett-Packard Limited
registered Office: Cain Road, Bracknell, Berks RG12 1HN
Registered No: 690597 England

Received on Friday, 25 May 2007 12:41:00 UTC