Re: newbie question about sparql and 200

On Thu, 2008-08-14 at 13:36 -0400, Alan Ruttenberg wrote:
> On Aug 14, 2008, at 1:32 PM, Dan Connolly wrote:
> 
> > On Thu, 2008-08-14 at 13:09 -0400, Alan Ruttenberg wrote:
> > [...]
> >> Why is the note necessary? In fact it seems backwards:
> >>
> >>>>>>> "The FROM NAMED syntax suggests that the IRI identifies the
> >>>>>>> corresponding graph, but the relationship between an IRI and a
> >>>>>>> graph
> >>>>>>> in an RDF dataset is indirect. The IRI identifies a resource,
> >>>>>>> and the
> >>>>>>> resource is represented by a graph (or, more precisely: by a
> >>>>>>> document that serializes a graph). For further details see
> >>>>>>> [WEBARCH]."
> >>
> >>
> >> That is, the IRI identifies the graph, and the representation is a
> >> serialization of that graph. How is it different than asking for any
> >> document, and getting back either html, or rtf, or whatever?
> >
> > Graphs are like integers or strings; they don't have state.
> > Documents, in the sense of "the front page of the new york times"
> > do have state; i.e. they change over time.
> 
> Not all documents have state.

Very well, let's both be more explicit with our quantifiers.

You used the term 'document' in your question; there are
two relevant senses of the word:

  (1) in the sense of "the front page of the new york times"

  (2) in the sense of an XML document, i.e. a sequence
   of characters (or perhaps bytes)

I wanted to clarify that I understood you to
be using sense (1) which is pretty close
to webarch:InformationResource .

And yes, not every document in the 1st sense changes;
documents such as RFC 822 are documents in both
the 1st and 2nd sense (which leads to nearly
no end of confusion; hence the distinct term
information resource)

> > To say that <http://example.com/graph1> identifies a graph
> > leads to a contradiction when two different GET requests
> > return different graphs/representations.
> 
> How could this happen if they can't change? (as you posit above)
> BTW, it's fine for two different representations to be returned  -  
> doesn't mean the graph(= underlying resource) changed.

Well, yes, it's fine for different representations to be
returned, but combined with the "from URI identifies
the graph", it leads to conclusions. Consider:

 select ?P from <http://nytimes.example/stocks> {
     _:someStock nyse:sym "XOM"; nyse:price ?P }

Two parties run the query. When p1 sends
the query to a SPARQL endpoint, which turns
around a does a GET where the response is

  200
  Date: ... 14:00
  Content-Type: text/turtle

  <#xom> nyse:sym "XOM"; nyse:price 10.

If the SPARQL spec said that the from URI identifies the
graph represented in the response, we would have

  <http://nytimes.example/stocks>
   owl:sameAs
  { <#xom> nyse:sym "XOM"; nyse:price 10. }.


OK so far? (is it helpful to use N3 to formalize
the discussion?)

Then when p2 sends the query to a SPARQL endpoint
which does a GET where the response is:

  200
  Date: ... 14:20
  Content-Type: text/turtle

  <#xom> nyse:sym "XOM"; nyse:price 12.

Again, if the SPARQL spec said that the from URI
identifies the graph represented in the response,
we'd have:

  <http://nytimes.example/stocks>
   owl:sameAs
  { <#xom> nyse:sym "XOM"; nyse:price 12. }.


The graphs  are distinct, right?
One has a triple with 10 in the object spot
and one doesn't. Formally, that is:

  { <#xom> nyse:sym "XOM"; nyse:price 10. }
    owl:differentFrom
    { <#xom> nyse:sym "XOM"; nyse:price 12. }

Substituting equals for equals, we get:

<http://nytimes.example/stocks>
 owl:differentFrom
   <http://nytimes.example/stocks> .

And that's a contradiction.

And that's why the SPARQL spec does *not* say
that the from URI identifies the graph you happen
to GET there, but rather, clarifies that the
relationship is indirect. Rather than

 <http://nytimes.example/stocks>
   owl:sameAs
  { <#xom> nyse:sym "XOM"; nyse:price 10. }.

it's more like

 <http://nytimes.example/stocks>
   webarch:representation [
     turtle:parsedGraph
    { <#xom> nyse:sym "XOM"; nyse:price 10. } ].

and as you observed, it's fine to have
more than one representation; webarch:representation
is not an owl:FunctionalProperty.

-- 
Dan Connolly, W3C http://www.w3.org/People/Connolly/
gpg D3C2 887B 0F92 6005 C541  0875 0F91 96DE 6E52 C29E

Received on Thursday, 14 August 2008 22:47:45 UTC