Skip to content
shellac edited this page Oct 13, 2010 · 7 revisions

Welcome to java-rdfa

The cruftiest RDFa parser in the world, I’ll bet. Apologies that there isn’t much documentation. Things may explode: you have been warned.

Currently passing all conformance and (scripting free) RDFa-in-text/html tests.

This was written by Damian Steer. It is an offshoot of the Stars Project which was funded by JISC

Useful Links

Maven repository (snapshots)
Java api documentation

Basic Use

Add to classpath, with jena. If you want (non-xml) HTML support get the validator.nu parser. You will now be able to:

Class.forName("net.rootdev.javardfa.jena.RDFaReader"); // this will hook in to jena and add the readers
model.read(url, "XHTML"); // xml parsing
model.read(other, "HTML"); // html parsing

From the command line you can try it out:

$ java rdfa.parse http://examples.tobyinkster.co.uk/hcard
<http://examples.tobyinkster.co.uk/hcard#jack>
      <http://www.w3.org/2006/vcard/ns#category>
              "Counter-Terrorist Unit"@en ;
...
$ java rdfa.parse --format HTML http://www.slideshare.net/intdiabetesfed/world-diabetes-day-2009
<http://www.slideshare.net/intdiabetesfed/world-diabetes-day-2009>
      <http://purl.org/dc/terms/creator>
              "intdiabetesfed"@en ;
...

Form Mode

There is a secret form mode (that prompted the development of this parser). In this mode you can generate basic graph patterns by including ?variables where curies are allowed, and INPUT tags generate @name variables.

Clone this wiki locally