XInclude or Not, that is the question

ACTION: Murray to write up the pros and cons 
<http://www.w3.org/2004/01/rdxh/spec#issue-mt-ns>http://www.w3.org/2004/01/rdxh/spec#issue-mt-ns 

[recorded in 
<http://www.w3.org/2006/11/22-grddl-wg-minutes.html#action13>http://www.w3.org/2006/11/22-grddl-wg-minutes.html#action13]


The problem, as I understand it, is that there is potential to return 
different graphs
depending on whether XIncludes are processed before a transformation is run 
against
the source document.

The following is adapted from http://www.w3.org/TR/xinclude/#basic-example
===========================================================

The following XML document contains an xi:include element which points to 
an external document.
Assume the base URI of this document is http://www.example.org/document.xml.

         <?xml version='1.0'?>
         <document xmlns:xi="http://www.w3.org/2001/XInclude"
                       xmlns:grddl="http://www.w3.org/2003/g/data-view#"
                              grddl:Transformation="grokDisclaimer.xsl">
           <p>120 Mz is adequate for an average home user.</p>

           <xi:include href="disclaimer.xml"/>

         </document>

disclaimer.xml contains:

         <?xml version='1.0'?>
         <disclaimer>
           <p>The opinions represented herein represent those of the individual
           and should not be interpreted as official policy endorsed by 
this organization.</p>
         </disclaimer>

The infoset resulting from resolving inclusions on this document is the 
same (except for the include history and language properties) as that of 
the following document:

         <?xml version='1.0'?>
         <document xmlns:xi="http://www.w3.org/2001/XInclude"
                       xmlns:grddl="http://www.w3.org/2003/g/data-view#"
                              grddl:Transformation="grokDisclaimer.xsl">
           <p>120 Mz is adequate for an average home user.</p>

           <disclaimer xml:base="http://www.example.org/disclaimer.xml">
           <p>The opinions represented herein represent those of the individual
           and should not be interpreted as official policy endorsed by 
this organization.</p>
         </disclaimer>

         </document>
===========================================================

Obviously, a GRDDL Transformation expressed in XSLT will produce a 
different result
from the original document than it will from the final document, if the 
Transformation is
intent on extracting disclaimers. The resulting RDF graph will not relate 
information found
in disclaimer.xml without XInclude processing.

The question that I believe we face is:

         How can GRDDL implementations ensure consistent result graphs
         when xi:include elements are present within a source document?

         [I suppose that the question could be further expanded to consider
         what to do when xi:include is found within a namespace document.]

There are several answers:

         -- A GRDDL-aware processor can ensure that its results are 
self-consistent
             by choosing an XInclude  policy and sticking with it.
         -- Developers of GRDDL Transformations can reference XML Pipelines 
to describe
             their XInclude-processing policy. (See below.)
         -- Developers of GRDDL Transformations can use XSLT to transform 
XIncludes
             into equivalent RDF triples so that downstream processors can 
follow their
             noses to discover additional resources. Care must be taken to 
maintain
             a relation to the original transformation in case further 
transformations
                are required. (I don't know XSLT or DC well enough to write 
the transformation.)
         -- Developers of GRDDL Transformations can use XSLT to ignore 
XIncludes.

===========================================================
Lacking public software to demonstrate how an XML Pipeline would work, I 
can only
record here what a pipeline running XInclude and then XSLT looks like 
syntactically.

<p:pipeline name="MyGRDDL"
             xmlns:p="http://example.org/PipelineNamespace">
   <p:input port="InfoResource" sequence="no"/>
   <p:input port="Transformation" sequence="no"/>
   <p:output port="MyGRDDLresult" step="XSLT" source="result"/>

   <p:step type="p:xinclude" name="XINCLUDE">
     <p:input port="document" step="MyGRDDL" source="InfoResource"/>
   </p:step>

   <p:step type="p:xslt" name="XSLT">
     <p:input port="document" step="XINCLUDE" source="result"/>
     <p:input port="document" step="MyGRDDL" source="Transformation"/>
   </p:step>

</p:pipeline>
===========================================================

Received on Wednesday, 29 November 2006 16:21:07 UTC