- From: Dave Beckett <dave.beckett@bristol.ac.uk>
- Date: Fri, 26 Nov 2004 11:41:33 +0000
- To: andy.seaborne@hp.com
- Cc: RDF Data Access Working Group <public-rdf-dawg@w3.org>
On Mon, 22 Nov 2004 17:31:12 +0000, "Seaborne, Andy" <andy.seaborne@hp.com> wrote: > > My base example for working with the XML result set format is turning the > results into an HTML table and I have been writing an XQuery to do this > transformation. > > The first stage of the transformation is writing out the table > headers in <th>'s based on the variable names. > > The proposed result set format: > > http://lists.w3.org/Archives/Public/public-rdf-dawg/2004JulSep/0556.html > either the form result1.xml or result2.xml > is slightly tricky to work with because the variables aren't declared > explicitly. It is possible to access the variables in the first > row if every variable is always named in every solution even when > unbound, ... every variable name already appears in every <result> in both formats, so all the names are always available. > ... but it isn't convenient to treat the first row specially, > when streaming for example. There are two access to row one in > this example. So you want to know all the variable names but want this knowledge before the body of the results are given so that you don't have to read the first line twice. I don't think that's a huge problem, but I guess could be done by adding a header block with such info. (In this case, maybe removing unbound variables would be possible, although my preference is the current style). So for the result1.xml style in http://lists.w3.org/Archives/Public/public-rdf-dawg/2004JulSep/att-0556/result1.xml I think that would mean adding a new top-level element outside <results> giving something like: <dawg-result xmlns="http://www.w3.org/sw/2001/DataAccess/result1#"> <!-- order of names here is an arbitrary order but the <result> child elements MUST match this order This header would be required. --> <variables> <hpage/> <name/> <mbox/> <age/> </variables> <results> <result> <hpage href="http://work.example.org/alice/"/> <name>Alice</name> <!-- unbound variables --> <mbox/> <age/> </result> <result> <hpage></hpage> <name xml:lang="en">Bob</name> <mbox href="mailto:bob@work"/> <age datatype="http://www.w3.org/2001/XMLSchema#decimal">30</age> </result> </results> </dawg-results> or in the style of result2.xml http://lists.w3.org/Archives/Public/public-rdf-dawg/2004JulSep/att-0556/result2.xml <dawg-result xmlns="http://www.w3.org/sw/2001/DataAccess/result2#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/XMLSchema-instance result2.xsd"> <variables> <var name="hpage"/> <var name="name"/> <var name="mbox"/> <var name="age"/> </variables> <results> <result> <var name="hpage" href="http://work.example.org/alice/"/> <var name="name">Alice</var> <var name="mbox"/> <var name="age"/> </result> <result> <var name="hpage"></var> <var name="name" xml:lang="en">Bob</var> <var name="mbox" href="mailto:bob@work"/> <var name="age" datatype="http://www.w3.org/2001/XMLSchema#decimal">30</var> </result> </results> </dawg-result> > Having the variable names enables sending SPARQL queries to a > server and getting the results without the result processing > needing to understand the query to extract the variables. The > query-and-results layer can be a pass-through that > just processes XML; no SPARQL parser, no RDF toolkit needed. The existing formats can be handled without RDF knowledge either but they do need to have knowledge of what the query does - application knowledge - which includes knowing what variable names will be bound and what they mean. The case of handling an arbitrary query result and not knowing any of the names seems only something likely to happen with generic rdf query demonstrations rather than in applications. Dave
Received on Friday, 26 November 2004 11:44:08 UTC