W3C home > Mailing lists > Public > public-grddl-wg@w3.org > November 2006

RE: Atom to N3 XSLT for #issue-output-formats

From: Dan Connolly <connolly@w3.org>
Date: Wed, 29 Nov 2006 12:45:41 -0600
To: "McBride, Brian" <brian.mcbride@hp.com>
Cc: Danny Ayers <danny.ayers@gmail.com>, GRDDL Working Group <public-grddl-wg@w3.org>, Henry Story <henry.story@bblfish.net>
Message-Id: <1164825941.3997.1279.camel@dirk>

On Wed, 2006-11-29 at 15:44 +0000, McBride, Brian wrote:
> Two novice points:
> 
> 1. Checking the specs  on XSLT, I notice that xsl:output allows the
> method to be text, xml, html or a qname.  We would not have to register
> a mime-type to define a qname to indicate turtle.  I don't know what
> implementations do if you use a qname - the spec doesn't say.
> 
> If the method is 'text' does this indicate that the output is definitely
> n3/turtle or that it is some textual format and you have to have some
> other means of determining which.

That qname hook does look interesting.

The GRDDL spec is currently silent (except for examples) on how
you get from a hunk of XSLT to an algorithm that goes from
XML nodesets to RDF graphs. It introduces "transform property"
to relate them, but does not go as far as a normative reference
to XSLT to say exactly how it works:

[[
If an information resource IR has a GRDDL transformation whose
transformation property TP, applied to the XML root node from a
representation of IR, gives an RDF Graph G, then G is a GRDDL result of
IR.
]]

The informative N3 rule is:

{
?IR grddl:transformation [
      grddl:txprop ?TP ];
  log:uri [ fn:doc [ ?TP ?G] ] .
} => {
?IR grddl:result ?G .
}

In the example in the spec, ?IR binds to <http://www.w3.org/2001/sw/grddl-wg/td/titleauthor.html>,
and the grddl:transformation object bnode binds to <glean_title.xsl>.

I managed to get cwm to generate a proof while I was working on the rules;
oh... I haven't checked it in... there...
  http://www.w3.org/2004/01/rdxh/grddl-rule-test-pf.txt

In step 25, "by erasure from step 1" means "hard-coded in <grddl-rule-tests.n3>";
i.e. I didn't formalize how a txprop is determined from a hunk of XSLT; I just
asserted that it happens.

1: ...
 [by parsing <grddl-rule-tests.n3>]

16: ...
 [by parsing <grddl-rules3.n3>]

22: <http://www.w3.org/2001/sw/grddl-wg/td/titleauthor.html> :transformation <http://www.w3.org/2001/sw/grddl-wg/td/glean_title.xsl> .
 [by erasure from step 21]

23: <http://www.w3.org/2001/sw/grddl-wg/td/titleauthor.html> :uri "http://www.w3.org/2001/sw/grddl-wg/td/titleauthor.html" .
 [by built-in Axiom log:uri]

24: "http://www.w3.org/2001/sw/grddl-wg/td/titleauthor.html" fn:doc :rootTA .
 [by erasure from step 1]

25: @forSome :_g47 . <http://www.w3.org/2001/sw/grddl-wg/td/glean_title.xsl> grddl:txprop :_g47 .
 [by erasure from step 1]

26: @forSome :_g47 . g4:rootTA :_g47 {<http://www.w3.org/2001/sw/grddl-wg/td/titleauthor.html> <http://purl.org/dc/elements/1.1/title> "The Stand" . } .
 [by erasure from step 1]
  # Please excuse a cwm proof bug; steps 25 and 26 should be combined in one step.

27: @forAll g:G, g:IR, g:TP . { @forSome :_g31, :_g32, :_g33 . :_g31 grddl:txprop g:TP . :_g32 fn:doc :_g33 . :_g33 g:TP g:G . g:IR log:uri :_g32; grddl:transformation :_g31 . } log:implies {g:IR grddl:result g:G . } .
 [by erasure from step 16]

28: ...
 [by rule from step 27 applied to steps [22, 23, 24, 25, 26]
  with bindings {'_g_L30C26': '<http://www.w3.org/2001/sw/grddl-wg/td/glean_title.xsl>', '_g_L32C20': '<file:///home/connolly/w3ccvs/WWW/2004/01/rdxh/grddl-rule-tests#rootTA>', 'G': '{titleauthor.html title "The ...tand"}', '_g_L32C11': '"http...html"', 'IR': '<http://www.w3.org/2001/sw/grddl-wg/td/titleauthor.html>',
'TP': '[...]'}]

29: <http://www.w3.org/2001/sw/grddl-wg/td/titleauthor.html> :result {<http://www.w3.org/2001/sw/grddl-wg/td/titleauthor.html> <http://purl.org/dc/elements/1.1/title> "The Stand" . } .



> 2. Where do we stand on multiple transform languages?  Not precluding or
> actively enabling?

not precluding.

"Transformations should have available representations in
widely-supported formats. We expect most consumers to support XSLT
version 1[XSLT1] for the foreseeable future, though XSLT2[XSLT2]
deployment is increasing. While javascript, C, or any other programming
language technically expresses the relevant information, XSLT is
specifically designed to express XML to XML transformations and has some
good safety characteristics."
 -- http://www.w3.org/2004/01/rdxh/spec#txforms

http://www.w3.org/2004/01/rdxh/spec#issue-whichlangs was
resolved 25 Oct.

>   If actively enabling should we deal with how
> non-xslt languages deal with multiple output formats.
> 
> I'm thinking we should keep things as simple as possible.
> 
> Brian
-- 
Dan Connolly, W3C http://www.w3.org/People/Connolly/
D3C2 887B 0F92 6005 C541  0875 0F91 96DE 6E52 C29E
Received on Wednesday, 29 November 2006 18:46:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:11:46 GMT