Re: specifying GRDDL transformation for document with no transformation attribute?

On Wed, 25 Oct 2006, Bob DuCharme wrote:
> What about specifying a GRDDL transformation for a document that has
> neither, and which we can't edit? The ability to convert output of web
> services to RDF, for example, opens up a lot of possibilities, but we
> don't want to have to wait for Amazon to add an
> http://www.w3.org/2003/g/data-view#transformation attribute to the
> ProductInfo element returned by their web service (or adding a
> grddl:namespaceTransformation property to a namespace document) before
> incorporating that data into an app.

Well, a transformation nominated / defined by the 
producer (in this case) would be more authorative than one nominated by consumer 
(especially if the content is in a specific vocabulary), wouldn't you say? 
However, I can see the value in being able to incorporate RDF content using a (locally 
nominated?) transform for sources that may not yet have defined their own 
transformation.

> Would it make sense to do just have a small element with a
> grddl:transformation attribute on the root and an xi:include element
> pointing at the actual document to transform, like this?
>
>  <someContainer xmlns:grddl="http://www.w3.org/2003/g/data-view#"
>    xmlns:xi="http://www.w3.org/2001/XInclude"
>    grddl:transformation="http://www.snee.com/xsl/xml2rdf.xsl">
>    <xi:include
> href="http://xml.amazon.com/onca/xml3?t=idname&amp;dev-t=devtoken&amp;ArtistSearch=The%20Velvet%20Underground&amp;mode=music&amp;type=heavy&amp;f=xml"/>
>  </someContainer>
>
>
> I suppose that XInclude support isn't quite where we want it, and I wonder
> if alternative ideas to address the same issue have been floated.

Actually, I think this a pretty good scenario for how some XML processing 
can be used to achieve something like this - during (or before) the 
transformation is run. <http://www.snee.com/xsl/xml2rdf.xsl> could even 
be rewritten (at a later point) to include / import templates for the 
request vocabulary, define a top-level template for the someContainer 
document element, and trigger continued processing (in push fashion, not 
pull [1]):

#templates in locally nominated transform

<xsl:template match='/someContainer'>
   <xsl:apply-templates select='*'/>
</xsl:template>

#Templates for request vocabulary

<xsl:template match='ProductInfo/Request/Args'>
   [ a :Request <xsl:apply-templates select='Arg'  />  ]
</xsl:template>

<xsl:template match='Arg'>
   :<xsl:value-of select='@name'/> "<xsl:value-of select='@value'/>";
</xsl:template>

[1] http://copia.ogbuji.net/blog/2005-06-10/Push_vs_pu

Chimezie Ogbuji
Lead Systems Analyst
Thoracic and Cardiovascular Surgery
Cleveland Clinic Foundation
9500 Euclid Avenue/ W26
Cleveland, Ohio 44195
Office: (216)444-8593
ogbujic@ccf.org

Received on Thursday, 26 October 2006 09:56:02 UTC