W3C home > Mailing lists > Public > public-rdf-wg@w3.org > May 2012

Defining rdf:XMLLiteral in terms of the DOM

From: Richard Cyganiak <richard@cyganiak.de>
Date: Wed, 9 May 2012 15:54:36 +0100
Message-Id: <C7A13771-152C-49DA-9932-F408CCCD509A@cyganiak.de>
To: RDF Working Group WG <public-rdf-wg@w3.org>
Off-list, Ivan and me have explored different possible definitions of the rdf:XMLLiteral value space, considering different formalisms for defining XML documents (XML infosets, DOM trees, etc). Below is a modification of the previous proposal. It expresses the same value space, but in terms of the DOM instead of XML infosets.

Value space:

The value space contains sets of DocumentFragments [DOM3]. Two DocumentFragments A and B are of the same value if and only if the DOM method A.isEqualNode(B) returns true.

L2V mapping:

The lexical-to-value mapping is defined as follows:
* Let xmldoc be the lexical form wrapped between an arbitrary XML start-tag and matching end-tag (an XML document [XML10])
* Let domdoc be a DOM Document object [DOM3] corresponding to xmldoc
* Return a DocumentFragment whose childNodes attribute is equal to the childNodes attribute of domdoc's documentElement attribute

The relevant definitions are:

   DocumentFragment: http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-B63ED1A3
   Node.isEqualNode: http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-isEqualNode
   Node: http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-1950641247

Everything else would remain as in the previous proposal (datatype is optional; the lexical space doesn't require canonicalization but requires well-formedness). The previous proposal for rdf:XMLLiterals was here:
With more background:

The advantages of the DOM-based definition are:

   A very well-defined notion of equality
   Readily available off-the-shelf implementations
   HTML5 is also defined in terms of the DOM

Received on Wednesday, 9 May 2012 14:55:09 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 22:02:04 UTC