Re: RDFa reliance on namespace declaration

Hi Ian,

All good points, although many of the problems seem to me to not be
unique to RDFa or XHTML.

(More comments below, inline.)

> I'd like to highlight a likely problem with RDFa's use of qname-like
> constructs in attribute values. I'm referring to CURIEs here but the
> same applies to any binding between XML namespace declarations and text
> content in the XML.
>
> The problem lies with the coupling of the specific prefix used in the
> namespace declaration with the prefix used in content. Any XML
> processor, such as an XSLT stylesheet or a SAX pipeline, can change the
> namespaces prefix arbitrarily thereby breaking the syntactic link
> between the qname/CURIE used in the attribute and the namespace declaration.
>
> The breakage happens because the XML processor has no knowledge of the
> semantics of particular text content in specific attributes.
>
> So, passing the following through a stylesheet:
>
> <p class="contactinfo" about="http://example.org/staff/jo"
>     xmlns:contact="http://www.w3.org/2001/vcard-rdf/3.0#">
>      My name is
>      <meta property="contact:fn">
>          Jo Smith
>      </meta>.
> </p>
>
> could very easily result in the following, with the consequent loss of
> all embedded triples:
>
> <p class="contactinfo" about="http://example.org/staff/jo"
>     xmlns:xyz="http://www.w3.org/2001/vcard-rdf/3.0#">
>      My name is
>      <meta property="contact:fn">
>          Jo Smith
>      </meta>.
> </p>
>
>
> As far as I can tell the only solutions are:
>
> 1) replace use of CURIEs in content with namespaced elements/attributes
>
> 2) replace namespace declaration mechanism with declarations based in
> the actual content with semantics specified by RDFa
>
> 3) replace CURIEs in content with full URIs
>
> 4) change XML namespaces spec to somehow understand CURIEs/qnames in content
>
> I think 1 is unlikely given that we're working within the limits of DTD
> and XSD validation
>
> 2 is the approach used by eRDF

This is actually in the realm of CURIEs, rather than RDFa. We
discussed a long time ago the idea of allowing the 'context' for
CURIEs to be definable, in much the same way as you can define the
context for XPath expressions. Since the CURIE proposal is nothing but
a substitution mechanism, it doesn't actually rely on namespaces and
prefixes--that's just a convenient way of making a whole load of
strings available for substitution without having to invent new
attributes.

But as Misha has said elsewhere, namespace declarations are no good to
NewsML since they want to get the 'substitution strings' in from some
external document, and XInclude won't let you import a whole
collection of attributes.

Namespace declarations are also no good for a language like SPARQL
which doesn't use XML for its syntax.

So although I would for the moment hold on changing the syntax (I
believe eRDF uses the hyphen instead of the colon, but at least for
now I'm still convinced that CURIEs can use the colon), I think there
is plenty of scope for CURIEs to be flexible about where the 'list of
strings to substitute' comes from.

(For example, the XPath spec says that any XPath expression is
evaluated within an 'evaluation context', which includes a library of
functions, a set of namespaces, and so on. CURIEs could do the same,
and say that the 'evaluation context' is a list of tokens with their
matching substitution strings. It would be up to the langauge using
CURIEs to say how that list is obtained.)


> 3 would work for copy and paste at the expense of looking ugly, but I
> don't believe visual impact is a requirement of RDFa?

Not sure how to take that. :) I've seen mentions on microformats
discussions that RDFa 'looks ugly', and can't understand why. All of
the different formats for embedding metadata into XHTML are very
similar, and certainly when using RDFa to mark up very simple
statements, there is nothing to choose between it, microformats, and
eRDF.

Anyway, the reason we can't insist on full URIs is to do with ease of
authoring--one of the major design goals of RDFa was to allow authors
to create RDF that could be used by RDF tools and processors, but
without the author needing to know anything about RDF. Insisting on
full URIs puts us right back into the same space that RDF has been in
for years, and is why we devised the notion of 'compact URIs'.


> 4 seems difficult and would introduce yet another dependency for RDFa
> adoption

True, although as I said, it's the same for XML Schema, WSDL, XSLT, blah, blah.

Thanks for your useful comments.

Regards,

Mark

-- 
Mark Birbeck
CEO
x-port.net Ltd.

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

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

Received on Wednesday, 14 June 2006 13:22:11 UTC