W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > September 2004

use case fodder for xml output - mozilla templates (svg generator)

From: Dan Brickley <danbri@w3.org>
Date: Thu, 9 Sep 2004 02:42:58 -0400
To: public-rdf-dawg-comments@w3.org
Cc: dean@w3.org, libby.miller@bris.ac.uk
Message-ID: <20040909064258.GA7011@homer.w3.org>

(Feel free to ignore if this is out of order 'cos I'm looking at 
pre-pub docs.)

The Mozilla browser ships with an RDF query system, called XUL
Templates. The basic idea is much the same scope as most other basic RDF
QLs (SQuish/RDFdb/RDQL/etc); the interesting part is that they use it as 
part of a templating system, to generate XML of various kinds (HTML,
XUL, SVG, ...).

I just found an SVG-generating example on the Mozilla website, and
confirmed that it runs in the SVG-enabled build of Mozilla. If the WG
are thinking of use cases for things like 'construct' (in the BRQL
pre-strawman[1]) or full XML generation (in [2]) I'd encourage folk to 
take a look at this. The use case isn't very real world (it generates
SVG from querying an RDF graph that contains SVG fragments) but it is
real and runs clientside in browser. There's more b/g on XUL Templates
around [3]. I also note that DAWG is getting noticed in the XUL Template
world, eg. recently in http://www.xulplanet.com/ndeakin/archive/2004/8/27/
	There's been some discussion lately about how to improve XUL templates.
	I just added some comments about this.

	Some proposals include using an SQL-like language which generates
	results. This is suitable for database-backed data, and a query language
	for RDF is being developed. Others talk about using XSLT since it's
	already an established template language, although it would only work
	using XML. Another option is to simply improve upon the existing
	template system by adding support for conditions, better scripting, and
	so forth.

Anyway the SVG-generating example that prompted this message can be 
found at http://www.croczilla.com/svg/samples/ (last item in page), ie.

This consumes RDF from a linked file, 

I'll include it here for reference. To my mind, it shows that there's
merit in the XML for resultsets work, since it should be easy to write
XSLT to emit SVG. Perhaps the 'construct' clause in the QL itself can be
thought of as a optimised common case of this sort of more general XML
generation mechanism? Also worth noting that XUL Templates have a
special case construct for container membership. I think that might be
becvause their design pre-dates our addition of rdfs:member into RDFS
(ie. a superproperty of the _1 _2 etc properties). However we now have
rdf:List so XUL Templates might still be a motivator for that kind of

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
  <svg:svg datasources="xulsvg1.rdf" ref="urn:root">
          <content uri="?root"/>
          <triple subject="?root"
          <member container="?shapes" child="?shape"/>

          <triple subject="?shape"
          <triple subject="?shape"
          <svg:polygon uri="?shape" 
                       points="100,100 200,100 150,200"/>


Hope this is of interest,



[1] http://www.w3.org/2001/sw/DataAccess/rq23/#construct
[2] http://lists.w3.org/Archives/Public/www-archive/2004Sep/att-0013/_RDF-XML.html
   "Making RDF Data Available for XML processing"
[3] http://www.mozilla.org/rdf/doc/
Received on Thursday, 9 September 2004 06:42:59 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:52:05 UTC