W3C home > Mailing lists > Public > public-rdf-in-xhtml-tf@w3.org > January 2008

librdfa - a pure C RDFa parser

From: Manu Sporny <msporny@digitalbazaar.com>
Date: Thu, 31 Jan 2008 04:24:09 -0500
Message-ID: <47A193B9.5090008@digitalbazaar.com>
To: RDFa mailing list <public-rdf-in-xhtml-tf@w3.org>

librdfa is a pure C implementation of a standards-compliant RDFa parser.
The library is quite easy to use (there are only 5 functions). librdfa
is stream-based, very small and quite fast.

You can download the source using git:

git clone http://rdfa.digitalbazaar.com/librdfa.git

This implementation was completed using the latest RDFa Syntax Document
specification (Jan 25th, 2008). I followed the processing rules section
exactly as written. It took around 43 hours to implement. I have some
feedback for Mark on the processing section (all very minor issues). It
was much easier than I thought it would be... constructing a set of
steps that were that easy to follow takes a considerable amount of skill
- much respect to Mark for laying the rules out clearly, concisely and
correctly :)

The good news is that many of the test cases that I tried generate
triples, some of them are even correct! I just got done with the first
full implementation of the parser, so there are loads of bugs around,
I'm sure. The library is available under a
BSD/GPL/whatever-will-get-it-in-as-many-applications-as-possible license.

Here are some "features":

- uses expat for the underlying XML parser
- small in size - 19KB library
- big in heart* (little code that does big things)
- cross-platform (compiles for Linux now, Windows in two weeks)
- stream-based (SAX based - no DOM processing)
- small execution footprint (~2KB per RDFa context)
- designed to be Swig'ed (C#, Lua, Perl, PHP, Python, Ruby)

I'll be working towards getting this parser fully compliant with the
test suite in the next couple of weeks. We're going to work on
integrating it into Firefox (via a native XPCOM component) in the weeks
after that.

-- manu

* - not actually a feature

Manu Sporny
President/CEO - Digital Bazaar, Inc.
blog: Intro to the Semantic Web in 6 minutes (video)
Received on Thursday, 31 January 2008 09:24:36 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:50:26 UTC