W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > February 2011

Re: PROPOSAL to address RDFa Profiles - ISSUE-73 and ISSUE-78

From: Toby Inkster <tai@g5n.co.uk>
Date: Sun, 13 Feb 2011 23:06:22 +0000
To: Ivan Herman <ivan@w3.org>
Cc: nathan@webr3.org, Manu Sporny <msporny@digitalbazaar.com>, W3C RDFa WG <public-rdfa-wg@w3.org>
Message-ID: <20110213230622.49ff1073@miranda.g5n.co.uk>
On Thu, 10 Feb 2011 18:39:44 +0100
Ivan Herman <ivan@w3.org> wrote:

> What I do in my distiller, and I think this is the only way to do it,
> is to separate the two. For SVG files I first try to find the RDF/XML
> portions, extract it from the SVG file, and parse it into a graph. I
> then parse the same file with the RDFa parser, produce another graph.
> I then merge the two graphs before outputting it to the caller.

I do this slightly differently, though it has the same effect.

I parse the file as RDFa, but in the processing algorithm, if the
current element is <rdf:RDF>, serialise the element as canonical XML and
pass that to an RDF/XML parser which has a callback, accepting each
triple and dealing with it the same way I would triples from RDFa. Then
I set the recurse flag to false and carry on as normal.

The advantage of doing it this way is that anybody using the callback
feature of my library receives the triples in document order whether
they came from RDFa or RDF/XML. It also means that the algorithm
remains mostly one-pass.

-- 
Toby A Inkster
<mailto:mail@tobyinkster.co.uk>
<http://tobyinkster.co.uk>


Received on Sunday, 13 February 2011 23:06:23 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:19:51 UTC