RE: Comments on RDF/A Syntax (Editor's Draft 27 October 2005)

Jeremy,

> I cannot agree with you that an RDF/XML parser is supposed to 
> skip over anything it doesn't understand.

I apologise...I wasn't being clear. I mean that the parser can skip over
anything that *precedes* the beginning of legitimate RDF/XML--we are not
therefore limited to standalone RDF/XML documents. (See 7.2.1 Grammar start
[*].)

So if you place RDF/XML into another document--say XHTML or SVG--an RDF/XML
parser should be able to pick it out. For example, in SVG you can embed
RDF/XML in the metadata element, and an RDF/XML parser should be able to
process that, even though it doesn't 'understand' the SVG that surrounds
this data.

My plan therefore, in early versions of RDF/A, was to make use of this, but
to try and go a step further in that the RDF/XML being parsed would actually
be XHTML. (This is different to the SVG model, where there is a clear break
between the two languages.) Unfortunately, this was not possible.


> It is because I wrote a RDF/XML parser before in accordance with
> the RDF/XML Grammer [1].

As it happens, that's the very reason I knew that there *was* a problem. ;)

Years ago I wrote an RDF/XML parser for one of my chapters in the book XML
Metadata (Wrox), and one of the things I did was exactly this--step past any
events that arrived prior to a legitimate starting event, and so process
RDF/XML that was embedded in other documents. (I say 'event' because the
parser was built as a layer on top of SAX, which is how the RDF/XML grammar
itself later came to be defined.)

So, my point is that given that an RDF/XML parser can (should) be able to
pick out RDF/XML that is embedded in *any* document, we would cause a lot of
problems if we used the RDF/XML attributes in XHTML 2 without them operating
in *exactly* the same way.


> However, it is still not too difficult to implement RDF/A parser
> having experience in RDF/XML parser.

Of course...that's the idea! As you say, it's very easy. But the plan is
also to make it easy to 'parse' RDF/A using XSLT, which opens things up
quite a lot.


> You may concentrate on those frequently used attributes, including 
> rdf:about, rdf:resource, rdf:datatype, rdf:nodeID, xml:lang, 
> xml:base. Other 
> RDF attributes should be "obsoleted" in RDF/A syntax.

No...the question I was trying to address was not whether one *can* place
RDF/XML into XHTML. Instead I was trying to see how one could use XHTML
'normally' and at the same time create a set of RDF triples. I was
originally hoping that with a few cunningly placed attributes I could
'trigger' an RDF/XML parser to start consuming. If this had been possible we
could have simply fed nearly normal XHTML documents into completely normal
RDF/XML parsers.

But the problem is that given the striped syntax of RDF/XML, the parsing
soon gets out of sync, and even very simple XHTML documents get interpreted
wrongly (or to be more precise, they don't express what one would
intuitively expect them to). If you are writing 'real' RDF/XML you can
counter the synchronisation problem by switching parse types; but if you are
writing 'real' XHTML then you'd constantly be using the parse type
attributes--and that is a non-starter for XHTML.

Regards,

Mark


[*] http://www.w3.org/TR/rdf-syntax-grammar/#section-grammar-productions

Mark Birbeck
CEO
x-port.net Ltd.

e: Mark.Birbeck@x-port.net
t: +44 (0) 20 7689 9232
w: http://www.formsPlayer.com/

Download our XForms processor from
http://www.formsPlayer.com/

Received on Monday, 28 November 2005 12:45:32 UTC