A simple 200 scenario (was RE: Jonathan and Alan's Homework Question)

Drawing on the discussion between Alan and Tim on yesterdays call...

Consider a document which contains a transcription of "The United States Constitution" such as: http://www.usconstitution.net/const.html - in fact lets use this as the URI for this scenario. The following is a lightly edited wget transcript of an HTTP GET request/response using that URI on the request line.

<transcript>
$ wget --debug http://www.usconstitution.net/const.html
DEBUG output created by Wget 1.10.2 on cygwin.

--11:18:57--  http://www.usconstitution.net/const.html
           => `const.html'
Created socket 3.
Releasing 0x006ab9c0 (new refcount 1).

---request begin---
GET http://www.usconstitution.net/const.html HTTP/1.0
User-Agent: Wget/1.10.2
Accept: */*
Host: www.usconstitution.net

---request end---
Proxy request sent, awaiting response...
---response begin---
HTTP/1.1 200 OK
Date: Wed, 19 Mar 2008 11:12:44 GMT
Server: Apache/2.2.4
Last-Modified: Wed, 19 Mar 2008 04:05:00 GMT
ETag: "938fe1-12907-5b551300"
Accept-Ranges: bytes
Content-Type: text/html
Content-length: 76039
Connection: close
Age: 511

---response end---
200 OK
Length: 76,039 (74K) [text/html]

Closed fd 3
11:18:57 (1.15 MB/s) - `const.html' saved [76039/76039]
</transcript>


So... what do we have:

:aOp a                   :HttpOperation;
     :hasRequest                             #domain->:HttpOperation; range->:HttpRequest (functional)
       [ a                :HttpRequest;
         :requestOp       :httpGet;          #domain->:HttpRequest; range->:HttpOpCode (functional)
         :requestResource                    #domain->:HttpRequest; range->rdf:Resource (or maybe owl:Thing) (functional)
            http://www.usconstitution.net/const.html
       ]
     :hasResponse                            #domain->:HttpOperation; range->:HttpResponse (functional)
       [ a :HttpResponse;
         :responseCode        :response200;  #domain->:HttpResponse; range->:HttpResponseCode (functional)
         :responseDate                       #domain->:HttpResponse; range->xsd:dateTime (functional)
                               "2008-03-19Z11:12:44"^^xsd:datetime;
         :responseContentType  "text/html";  #domain->:HttpResponse; range->literal (a media type string)(functional)
         :responseContentLength              #domain->:HttpResponse; range->xsd:integer
                               "76038"^^xsd:integer;
         :responseBody                       #domain->:HttpResponse; range->literal (encoding resource state) (functional)
                               "[some literal elided from the transcript]".  (functional)
       ]

That captures most of the information from that interaction - eliding fields not (currently) interested in.

// a pidgin N3 rule
{ ?x a :HttpOperation;
     :hasRequest ?req;
     :hasResponse ?resp.

  ?req a                      :HttpRequest;
        :requestOp            :httpGet;
        :requestedResource    ?resource.

  ?resp a                     :HttpResponse;
        :responseCode         :response200; # modelled as a URI
        :responseDate         ?date;        # a literal date (see above)
        :responseContentType  ?contentType; # a literal content-type (as above)
        :responseBody         ?body         # a literal (as above)
} -> {
  ?resource
        a                     :Document;    # aka Information Resource... whatever (due to the 200)
        :hasState                           # domain->rdf:Resource (or maybe owl:Thing); range->:TimedResourceState (non-functional)
          [ a             :TimedResourceState
            :timeStamp    ?date;            # domain->TimedResourceState; range->xsd:dateTime (functional)
            :state        _:state           # domain->TimedResourceState; range->:ResourceState (functional)
            :aStateOf     ?resource         # domain->Union(:TimeResourceState,:ResourceState); range->rdf:Resource (or maybe owl:Thing) (functional?)
          ]

  _:state
        a                 :ResourceState   # A blank node
        :stateContentType ?contentType;    # domain->:ResourceState; range->literal (a media type string) (functional)
        :stateContent     ?body            # domain->:ResourceState; range->literal (encoding resource state). (functional)
        :aStateOf         ?resource        # domain->Union(:TimeResourceState,:ResourceState); range->rdf:Resource (or maybe owl:Thing) (non-functional)

  ?resp :conveys          _:state;         # domain->:HttpResponse; range->:ResourceState
}

Strictly Jonathan/Alan's question was what relations may exist between the requested thing (a document transcribing the US Constitution) and the protocol response message. The answer given here is that the response message conveys the state of the the requested thing.

The state of the thing is modelled here as a pair of a content-type and a body (and maybe gratuitously I've included backward "aStateOf" relations to the resource). I've separated out this pair (via a possibly blank node) so that a given state could be the state of many resources. A rule something like the following can then be used to 'collapse' identical resource states to be the same state.

{ ?s1   a       :ResourceState .
  ?s2 a     :ResourceState .

  ?s1 :stateContentType ?ct .
  ?s2 :stateContentType ?ct .

  ?s1 :stateContent     ?content .
  ?s2 :stateContent     ?content .
} -> {
  ?s1   owl:sameAs ?s2 .     # or maybe owl:sameIndividual
}

In this way, states become a sort of type for the messages which convey them. [Indeed have given no thought here to :ResourceState conveyed in PUT/POST messages].

Of course... this isn't quite the state of the document, rather it is a lexical serialisation of it. This does not deal with equivalence of different serialisations of the 'same' state.

To some extend it is this 'state' which I think Alan was wanting to speak of rather than the 'resources' aka 'things' that curently hold that state.

Things that this interaction has *not* told us are:
- that the document state is invariant.
- that the document in question transcribes the US Constitution .
- that there are no other available serialisations of the state of the resource.

Stuart
--
Hewlett-Packard Limited registered Office: Cain Road, Bracknell, Berks RG12 1HN
Registered No: 690597 England

Received on Wednesday, 19 March 2008 13:55:09 UTC