Re: Issue with the result set format

On Mon, 22 Nov 2004 17:31:12 +0000, "Seaborne, Andy" <> 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:
> 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
I think that would mean adding a new top-level element outside
<results> giving something like:

<dawg-result xmlns="">

  <!-- order of names here is an arbitrary order
       but the <result> child elements MUST match this order

       This header would be required.

      <hpage href=""/>
      <!-- unbound variables -->


      <name xml:lang="en">Bob</name>
      <mbox href="mailto:bob@work"/>
      <age datatype="">30</age>



or in the style of result2.xml

<dawg-result xmlns=""
             xsi:schemaLocation=" result2.xsd">

      <var name="hpage"/>
      <var name="name"/>
      <var name="mbox"/>
      <var name="age"/>

      <var name="hpage" href=""/>
      <var name="name">Alice</var>
      <var name="mbox"/>
      <var name="age"/>

      <var name="hpage"></var>

      <var name="name" xml:lang="en">Bob</var>
      <var name="mbox" href="mailto:bob@work"/>
      <var name="age" datatype="">30</var>



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


Received on Friday, 26 November 2004 11:44:08 UTC