- From: Ivan Herman <ivan@w3.org>
- Date: Thu, 10 May 2012 15:20:38 +0200
- To: Richard Cyganiak <richard@cyganiak.de>
- Cc: Arnaud Le Hors <lehors@us.ibm.com>, David Wood <david@3roundstones.com>, public-rdf-wg Group WG <public-rdf-wg@w3.org>
Ah. I think I found out why this would indeed work: namely because - DocumentFragment is a subclass of Node[1] - equality is defined on nodes, and indeed looks at the node names (that is what I was afraid of) but, looking at the table in [1], the name of a Document Fragment is always fixed (and is set to '#document-fragment'). Ie, the equality will work because, in fact, the DOM3 spec is such that it has a reserved 'name' for document fragments (and that is what I was looking for). So you are right, it works, thanks to those clever DOM3 editors:-). Is it worth putting a note into the document to make this clear? Or is it so obvious that this discussion is just the outcome of my own stupidity? Ivan [1] http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-1950641247 On May 10, 2012, at 15:06 , Richard Cyganiak wrote: > Ivan, > > On 10 May 2012, at 14:04, Ivan Herman wrote: >> - A.isEqualNode(B)[1] compares the notes A and B _and_ its children. Ie, it compares, among other things, the nodeName of the two document fragments > > Sure, but: > >> - the LV mapping returns the result of the following transforms on L (lexical value) >> wrap L into _something_ -> xmldoc -> domdoc -> domfrag -> normalize() > > No. > > [[ > Let domfrag be a DOM DocumentFragment whose childNodes attribute is equal to the childNodes attribute of domdoc's documentElement attribute > ]] > > domfrag is a *new* document fragment that includes only the *child nodes* of domdoc's document element. It does *not* include the document element. > >> So I can be evil enough and wrap a lexical value into a _different_ XML element before doing the rest of the transformation for each lexical value. > > You can do that and there is nothing evil about it. > >> As a result, the values will always be different under the value space comparison. > > No. This gives you different domdocs, but equivalent domfrags. After normalization, they will compare equal. > >> It is obviously a stupid and pathological case, but the exact wording of the algorithm does not exclude that... > > I think you are mistaken. > > Best, > Richard > > >> >> Ivan >> >> >> [1] http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-isEqualNode >> >> On May 10, 2012, at 14:27 , Richard Cyganiak wrote: >> >>> Ivan, >>> >>> On 10 May 2012, at 09:11, Ivan Herman wrote: >>>> (First of all, I explicitly cc this to Arnaud; he was one of the co-editors of the DOM3 spec, it would be good if he could review that to be on the safe side...) >>> >>> +1! >>> >>>> the only thing I am uncertain about is that issue about the arbitrary XML tag enclosing the whole thing. We clearly need that, but how does that exactly affect the algorithm? >>> >>> The thing with the arbitrary enclosing start and end tag was taken straight from RDF 2004. It's in the definition of the lexical space. >>> >>>> After all, A.isEqualNode(B) compares the nodes' names; if different arbitrary enclosing terms are used, then this will return False, although our intention is to say True... >>> >>> But A.isEqualNode(B) compares the *values*, and the values are the result of applying the L2V mapping, and the L2V mapping returns only the *child nodes* of the document element. So the arbitrary element that we created is *not* being compared; only the list of its children is compared. >>> >>>> Somehow the lexical-to-value mapping algorithm has to keep track, when creating xmldoc, whether such a wrapper element has been added to the original literal or not. >>> >>> I'm not sure what you mean. If the original literal already is properly wrapped in matching start and end tags (that is, it's already a well-formed XML document, not just an XML fragment), then the phrasing as is just wraps it into another element. Everything should still work. >>>> >>>> I am not sure what the best way of handling that is. Maybe, conceptually, that top level wrapping element is a predefined RDF element, and must be used only when there is no wrapping element in the original lexical form in the first place. >>> >>> I'm not sure what problem this would solve. >>> >>>> (In any case, this is not something the author of the RDF content should see.) >>> >>> They don't. >>> >>> Best, >>> Richard >>> >>> >>> >>>> >>>> Ivan >>>> >>>> >>>> >>>> On May 9, 2012, at 20:12 , Richard Cyganiak wrote: >>>> >>>>> Dave, all, >>>>> >>>>> I have updated the RDF Concepts ED according to today's resolution. Please review. >>>>> >>>>> http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-concepts/index.html#section-XMLLiteral >>>>> >>>>> RDF Semantics still needs to be updated accordingly (make rdf:XMLLiteral optional and interpret it only under D-Entailment, like any other datatype). >>>>> >>>>> I've taken the liberty to create an action (on a randomly chosen RDF Semantics editor): >>>>> >>>>> https://www.w3.org/2011/rdf-wg/track/actions/170 >>>>> >>>>> No objection to the status change. >>>>> >>>>> Best, >>>>> Richard >>>>> >>>>> >>>>> >>>>> On 9 May 2012, at 17:45, David Wood wrote: >>>>> >>>>>> Hi all, >>>>>> >>>>>> Today, we resolved [1]: >>>>>> [[ >>>>>> RESOLVED: in RDF 1.1: [a] XMLLiterals are optional; [b] lexical space consists of well-formed XML fragments; [c] the canonical lexical form is http://www.w3.org/TR/xml-exc-c14n/, as defined in RDF 2004; [d] the value space consists of (normalized) DOM trees. >>>>>> ]] >>>>>> >>>>>> Richard's proposal [2], that evolved into this resolution, was meant to close ISSUE-13 [3]. So, I have changed the status of ISSUE-13 to "pending approval" and suggest that the implementation of this resolution be considered editorial in nature. >>>>>> >>>>>> Any objections? >>>>>> >>>>>> Regards, >>>>>> Dave >>>>>> >>>>>> [1] http://www.w3.org/2011/rdf-wg/meeting/2012-05-09#resolution_1 >>>>>> [2] http://lists.w3.org/Archives/Public/public-rdf-wg/2012May/0006.html >>>>>> [3] https://www.w3.org/2011/rdf-wg/track/issues/13 >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> >>>> ---- >>>> Ivan Herman, W3C Semantic Web Activity Lead >>>> Home: http://www.w3.org/People/Ivan/ >>>> mobile: +31-641044153 >>>> FOAF: http://www.ivan-herman.net/foaf.rdf >>>> >>>> >>>> >>>> >>>> >>>> >>> >>> >> >> >> ---- >> Ivan Herman, W3C Semantic Web Activity Lead >> Home: http://www.w3.org/People/Ivan/ >> mobile: +31-641044153 >> FOAF: http://www.ivan-herman.net/foaf.rdf >> >> >> >> >> >> > ---- Ivan Herman, W3C Semantic Web Activity Lead Home: http://www.w3.org/People/Ivan/ mobile: +31-641044153 FOAF: http://www.ivan-herman.net/foaf.rdf
Received on Thursday, 10 May 2012 13:17:51 UTC