Some thoughts about XML literals in RDF
This page prepared as possible discussion notes concerning parseType="Literal" and XML literals in RDF.
Two orthogonal requirements:
- Lexical forms with XML-like markup. Don't wish to force escaping of every '<' and '&'.
- Literal values that are XML infosets
Two orthogonal solutions:
- rdf:parseType="Literal"
- rdf:datatype="&rdf;XMLLiteral"
The current solution is conflating these into a single mechanism, with the resulting stresses that we now witness (RDFcore discussions as of July 2003: see archive and references below).
If we separate these, we can have:
Simple text:
<rdf:Description>
<ex:prop xml:lang="en">Some text</ex:prop>
</rdf:Description>
Simple text with markup:
<rdf:Description>
<ex:prop xml:lang="en" rdf:parseType="Literal">
Some <em>marked-up</em> text
</ex:prop>
</rdf:Description>
Simple text with XML infoset (based) value:
<rdf:Description>
<ex:prop rdf:datatype="&rdf;XMLLiteral">Some XML text</ex:prop>
</rdf:Description>
XML text with XML infoset (based) value:
<rdf:Description>
<ex:prop rdf:datatype="&rdf;XMLLiteral"
rdf:parseType="Literal">
<record>
<head>Data structure encoded in XML</head>
<field1>XYZZY</field1>
<field2>12345</field2>
</record>
</ex:prop>
</rdf:Description>
References:
- Martin Duerst's revised comments on I18N and XML Literals needing language tags: http://lists.w3.org/Archives/Public/w3c-rdfcore-wg/2003Jul/0126.html
- Pat Hayes "Tiger by the tail" commentary on usage of XML: http://lists.w3.org/Archives/Public/w3c-rdfcore-wg/2003Jul/0067.html
- My comments "XML literals considered textual": http://lists.w3.org/Archives/Public/w3c-rdfcore-wg/2003Jul/0117.html
- Dan Connolly's reference to #rdfms-literal-is-xml-structure: http://lists.w3.org/Archives/Public/w3c-rdfcore-wg/2003Jul/0035.html, which espouses a non-textual view ofXML literals in RDF.
- Patrick Stickler's simplifying proposal: http://lists.w3.org/Archives/Public/w3c-rdfcore-wg/2003Jul/0131.html
- My comments "XML literals lacking consensus": http://lists.w3.org/Archives/Public/w3c-rdfcore-wg/2003Jul/0155.html
- My comments: "Who feels the pain?", and thoughts on application use of RDF literals: http://lists.w3.org/Archives/Public/w3c-rdfcore-wg/2003Jul/0212.html, a precursor to this page.
For feedback please see: <http://www.ninebynine.org/index.html#Contact>
$Id: XMLLiterals.html,v 1.1 2003/07/17 22:10:16 graham Exp $