Re: Sparql and forms

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
forms:
http://www.dehora.net/journal/2005/08/automated_mapping_between_rdf_and_forms_part_i.html

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
somewhere.

Quick glance suggests the service/code's currently broken, but this
stuff's around:
http://pragmatron.org/live/note
(draggable! WYSIWYG! borked!)
http://dannyayers.com/svn/pragmatron/xslt/ajax-wrapper.xsl

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.
http://www.crockford.com/JSON/index.html
http://www.jenitennison.com/xslt/grouping/muenchian.html

I stumbled on NextAction, which is a totally in-browser (Javascript,
DOM, JSON) organiser tool based on ideas from the Getting Things Done
book:
http://trimpath.com/demos/nextaction_static1/nextaction.htm

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:
http://www.mnot.net/blog/2005/01/24/json

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"):
http://pragmatron.org/gtd/nextaction.htm
(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:
http://pragmatron.org/query.html

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
scratch:
http://pragmatron.org/gtd/
(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:
http://dannyayers.com/archives/2005/07/27/passing-it-around/
http://dannyayers.com/archives/2005/07/17/sparql-update-5/

Something I speculated about was doing hierarchical outlines in the same way:
http://dannyayers.com/archives/2005/07/14/xoxo-template-for-blogs/

another speculation - Microforms:
http://dannyayers.com/archives/2005/08/01/microforms/

My source is all around
http://dannyayers.com/svn
(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.


--

http://dannyayers.com

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