RDFa and SVG Tiny (and the RDFa distiller)
W3C has just published the SVG Tiny 1.2 recommendation. Others are much more experts than me to describe the changes in the core functionality compared to the 1.1 version, so I let them do that. However, there is an interesting aspect of the new recommendation regarding the Semantic Web, too. Indeed, SVG Tiny 1.2 has adopted RDFa as one of the means to add metadata to the SVG file itself. The semantics of the RDFa attributes are the same as for XHTML; in fact, the SVG document simply refers to the RDFa specification. Nevertheless, the fact that the host language is SVG does lead to two small differences:
- SVG uses xml:base, whereas XHTML1+RDFa disallows it in favor of the
base
element - SVG inherits from earlier versions the possibility to add RDF/XML directly into the SVG content via the
metadata
element. An SVG+RDFa distiller ought to understand this RDF graph and merge it with the graph produced by the regular RDFa processing.
The RDFa distiller has been updated to distill SVG+RDFa files, too. To account for those two differences a separate (host=xml
) option has been introduced, although the distiller would work out of the box for most of the SVG cases (ie, for those that do not make use of those two features).
As an example, I have updated the SVG version of the horizontal SW cube to SVG 1.2 Tiny. It uses the metadata
element for the description of the copyright statements, but reuses SVG’s title
and desc
elements to generate the corresponding dc:title
and dc:description
RDF statements using RDFa’s @property
attribute. Using the RDFa distiller, one can get to the RDF content. Cool…
RDFa disallows xml:base? Argh. Why, why.
No...RDFa does not "disallow" @xml:base -- XHTML itself disallows it. Whatever we think of that, we can't go adding it back in, in the spec XHTML+RDFa.
However, note that the XHTML+RDFa spec also says in section 5.5:
This was a gentle pointer towards RDFa parsers for languages like SVG, that they should process @xml:base.