Every repository with this icon (
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
.gitignore | ||
| |
COPYING | ||
| |
README.textile | ||
| |
pom.xml | ||
| |
src/ |
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
Online parser
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.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.simpleparse http://examples.tobyinkster.co.uk/hcard <http://www.example.com/> <http://xmlns.com/foaf/0.1/primaryTopic> <http://www.example.com/#jack> . <http://www.example.com/> <http://purl.org/dc/terms/abstract> "This page is intended to be a demonstration of\n\t\tthe use of RDFa (including FOAF, Dublin Core and W3C PIM vocabularies) in\n\t\tconjunction with Microformats (including hCard and rel-tag)."@en . ...
or
$ 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 ;
...
Simpleparse has no dependencies beyond validator.nu (only in the case that the HTML format is used), and streams. However the output looks nasty, and the jena-based rdfa.parse is better tested.
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.
Simple example
(from the tests) and the query that results.








