[namespaceDocument-8] grokRDDL.xsl mapping to RDF

My thoughts on mapping RDDL to RDF came together tonight
in the form of an XSLT transformation...

  http://www.w3.org/2003/12/rdf-in-xhtml-xslts/grokRDDL.xsl
  $Id: grokRDDL.xsl,v 1.1 2004/01/16 03:02:34 connolly Exp $
  interpret RDDL as RDF.

I started with the RDDL draft that seemed to be current
per the issues list
http://www.w3.org/2001/tag/issues.html?type=1#namespaceDocument-8
 --> http://www.tbray.org/tag/rddl4.html

and worked out the design I had in mind when I raised
objections to the earlier mapping...

 Re: RDDL again
 Date: 09 Jun 2003 10:42:04 -0500
 Message-Id: <1055173324.8317.19.camel@dirk.dm93.org>
 http://lists.w3.org/Archives/Public/www-tag/2003Jun/0017.html

And I tested it thusly...

$ xsltproc grokRDDL.xsl ,rddl4.html >,xxx.rdf

$ python ~/swap/cwm.py --rdf ,xxx.rdf --n3 >,xxx.n3

(where swap is http://www.w3.org/2000/10/swap/)

and I get statements that I agree with:

[[[
    <http://www.ietf.org/rfc/rfc2396.txt>     rddl:nature
<http://www.isi.edu/in-notes/iana/assignments/media-types/text/plain> .
                                                                                
    rddl:     :directory rddl:home,
                rddl:natures,
                rddl:purposes;
         :normative-reference <http://www.ietf.org/rfc/rfc2396.txt>,
                <http://www.w3.org/TR/REC-xml-names>,
                <http://www.w3.org/TR/xhtml-basic>,
                <http://www.w3.org/TR/xml-infoset/>,
                <http://www.w3.org/TR/xmlbase/>,
                <http://www.w3.org/tr/xptr>;
         :reference <http://www.w3.org/TR/xhtml-modularization/>,
                <http://www.w3.org/tr/xhtml1> .
]]]

That's an excerpt from ,xxx.n3 which is attached in full
with the namespace prefixes and all that.

If I pretty-print the .rdf thusly...

$ python ~/swap/cwm.py --rdf ,xxx.rdf >,xxx2.rdf

I get something not too bad looking...

[[[
    <rdf:Description rdf:about="http://www.ietf.org/rfc/rfc2396.txt">
        <rddl:nature
rdf:resource="http://www.isi.edu/in-notes/iana/assignments/media-types/text/plain"/>
    </rdf:Description>
                                                                                
    <rdf:Description rdf:about="http://www.rddl.org/">
        <directory rdf:resource="http://www.rddl.org/home"/>
        <directory rdf:resource="http://www.rddl.org/natures"/>
        <directory rdf:resource="http://www.rddl.org/purposes"/>
        <normative-reference
rdf:resource="http://www.ietf.org/rfc/rfc2396.txt"/>
        <normative-reference
rdf:resource="http://www.w3.org/TR/REC-xml-names"/>       
<normative-reference rdf:resource="http://www.w3.org/TR/xhtml-basic"/>
        <normative-reference
rdf:resource="http://www.w3.org/TR/xml-infoset/"/>
        <normative-reference
rdf:resource="http://www.w3.org/TR/xmlbase/"/>
        <normative-reference rdf:resource="http://www.w3.org/tr/xptr"/>
        <reference
rdf:resource="http://www.w3.org/TR/xhtml-modularization/"/>
        <reference rdf:resource="http://www.w3.org/tr/xhtml1"/>
    </rdf:Description>
]]]

,xxx2.rdf is attached in full too.


I have one gripe about the rddl4 design: it doesn't say
how to indicate what namespace you're talking about; i.e.
how to pick out... http://www.rddl.org/ from

| ... identified by the URI <code>http://www.rddl.org/</code>

I kludged it in the XSLT thusly:

  <!-- @@KLUDGE! but we need some way to find out what
  namespace we're talking about -->
  <xsl:variable name='subjectNamespace'
select='/h:html//h:code[starts-with(., "http://")]/text()'/>

What's a good way to mark this up? Something like

	<code class="theNameSpace">http://www.rddl.org/</code>

would work... or we could make a 'self' purpose and use that...

  <a href="http://www.rddl.org/"
   rddl:purpose="http://www.rddl.org/purposes#self">http://www.rddl.org/


In sum, I like rddl4 but for
  1. Some pending edits we've discussed:
   - a hello-world example
   - DTD foo
   - a MIME type registration

  2. a normative mapping to RDF, for which I propose
	grokRDDL.xsl (with the "this namespace" kludge
	fixed) as a reference implementation 

  3. Discussion of the use of RDDL in HTTP
	300 "multiple choices" responses:
    "the response SHOULD include an entity containing a list
	of resource characteristics and location(s) from which
	the user or user agent can choose the one most appropriate."
    -- http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.1

  4. a fragment indirection mechanism as discussed in vancouver
	http://www.w3.org/2003/07/21-tag-summary.html

My thoughts on fragment indirection haven't come together yet.

-- 
Dan Connolly, W3C http://www.w3.org/People/Connolly/

Received on Thursday, 15 January 2004 23:46:11 UTC