W3C home > Mailing lists > Public > www-archive@w3.org > October 2005

Re: Sparql and forms

From: Danny Ayers <danny.ayers@gmail.com>
Date: Sun, 2 Oct 2005 20:06:02 +0200
Message-ID: <1f2ed5cd0510021106m222b3a47i40a0afb33ed1f8d1@mail.gmail.com>
To: Dan Connolly <connolly@w3.org>
Cc: www-archive@w3.org

On 10/2/05, Dan Connolly <connolly@w3.org> wrote:
> rdf forms? Sparql forms, where props are mapped to form fields client
> side, and the result comes back grddl style
> ScheduledTopicChat on rdf forms?

If you do have a chat I'm bound to miss it, so below are some notes.

I've done some experimentation around this area, most of it trying to
build something to sort out my to-do lists. I was also partly
motivated by Bill deHora's skepticism about round-tripping RDF through

I found generating and populating simple HTML forms through
SPARQL/XSLT relatively straightforward (grr, can't find code for any
of the earlier experiments). The issues Bill described were certainly
present (such as having multiple values for a field which should only
have one), but I'm not convinced it's significantly worse than e.g.
SQL templated through PHP. I think the Muenchian method of grouping
results (for XSLT 1.0, see below) may be useful for more structured
forms/domain models.

Having ovine ancestry I couldn't resist trying some Ajax
(XMLHttpRequest) along with this. One approach I tried was to separate
out the presentation/Ajax bits (with a lot of UI utils I'd found) from
the forms, piping HTML results from SPARQL/XSLT through this. It got
complicated very quickly. Another trick I tried was to have a kind of
2-phase submission, so the data in a text area was periodically sent
to the server while you typed, only when you click a button does the
stuff get put in the triplestore. I think that might be usable

Quick glance suggests the service/code's currently broken, but this
stuff's around:
(draggable! WYSIWYG! borked!)

JSON (JavaScript Object Notation) may be useful as an intermediate
client-side data representation from which forms can be filled
dynamically. It can be generated from SPARQL/XSLT, but grouping of
results proved rather tricky in XSLT 1.0, though doable using the
Muenchian Method. I suspect this could be useful in directly
generating forms from SPARQL.

I stumbled on NextAction, which is a totally in-browser (Javascript,
DOM, JSON) organiser tool based on ideas from the Getting Things Done

Mark Nottingham had looked at JSON and came to generally negative
conclusions, but I think if you forget XML and just view it in terms
of the domain model (mapped from RDF) it's potentially useful:

So anyhow I started with a clone of the NextAction app with a bit of
Javascript to turn the local JSON data into RDF/XML and send it to the
server using XMLHttpRequest ("Commit"):
(I'm not sure how functional any of this code is right now - can't
remember where I left it)

The backend store is Redland/MySQL, with mod_python/Pymplex (a little
HTTP method/Python bridge). There's a query form attached but I don't
think there's any of the GTD data in there, though you can see the
sample queries by clicking on the buttons:

I got SPARQL/XSLT to filter/render JSON back from the store
("Update"). After playing with this a while I realised that a lot of
the existing code was getting in my way (it allowed in-browser source
editing) so made a start on reimplementing the same stuff from
(may need to refresh browser/click "Dashboard" a few times to get it
to do anything - even then it doesn't do much ;-)

That's about where I left it.

As I was dealing with project planning data, I was pleased to discover
Planner for Gnome used an XML format and (if I remember correctly) had
an "Export to HTML", which gave a good rendering of Gannt charts,
could be useful as the end product of SPARQL/XSLT.
Some notes around:

Something I speculated about was doing hierarchical outlines in the same way:

another speculation - Microforms:

My source is all around
(but alas crufty and not clearly organised)

Recently I've been dynamically populating HTML forms from RDF using
the DWR Ajax toolkit connecting to Jena server-side. This has been
relatively straightforward, though I still find Javascript hard work.


Received on Sunday, 2 October 2005 18:06:08 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:42:54 UTC