- From: Jeremy Carroll <jjc@hplb.hpl.hp.com>
- Date: Thu, 04 Sep 2003 16:56:39 +0100
- To: w3c-rdfcore-wg@w3.org
DanBri asked me to write up the wrapper design, I present this as three different versions of the text for rdf:parseType="Literal" in the syntax doc. The first version, no wrapping, is the current text. The second version, always wrapping is one of the designs we have rejected. The third version, wrapping when xml:lang present is another variant. I am not advocating in this message. The three versions are variants on bullet point 4. in http://www.w3.org/TR/rdf-syntax-grammar/#parseTypeLiteralPropertyElt which reads (Sept 5 version) [[ For element e and the literal l that is the rdf:parseType="Literal" content. l is not transformed by the syntax data model mapping into events (as noted in 6 Syntax Data Model) but remains an XML Infoset of XML Information items. l is transformed into the lexical form of an XML literal in the RDF graph x (a Unicode string) by the following algorithm. This does not mandate any implementation method — any other method that gives the same result may be used. 1. Use l to construct an XPath[XPATH] node-set (a document subset) 2.Apply Exclusive XML Canonicalization [XML-XC14N]) with comments and with empty InclusiveNamespaces PrefixList to this node-set to give a sequence of octets s 3. This sequence of octets s can be considered to be a UTF-8 encoding of some Unicode string x (sequence of Unicode characters) 4. The Unicode string x is used as the lexical form of l Then o := typed-literal(literal-value := x, literal-datatype := http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral ) and the following statement is added to the graph: ]] Version 0: no wrapping ====================== (no change) 4. The Unicode string x is used as the lexical form of l Version 1: wrapping always ========================== 4. The Unicode string being the concatenation of "<rdf-wrapper xml:lang=\"", e.language, "\">", x and "</rdf-wrapper>" is used as the lexical form of l Version 2: wrapping when there is a language ============================================ 4. If e.language is not the empty string then the Unicode string being the concatenation of "<rdf-wrapper xml:lang=\"", e.language, "\">", x and "</rdf-wrapper>" is used as the lexical form of l If e.language is the empty string then the Unicode string x is used as the lexical form of l ----------------------- I think those are the minimal textual changes required for adding the wrapper to RDF; note that Version 1 would be better with additional changes to concepts and ntriples requiring the wrapper to be there on an rdf:XMLLiteral. Jeremy
Received on Thursday, 4 September 2003 12:35:26 UTC