Ok, I found that Tim Berner's Lee and co, are using their own ontology which is similar to the http in rdf one I mentioned earlier, with the advantage that it is being deployed in a real experimental application that does exactly what I need to do too.

Try the latest development version of the tabulator with Firefox at
http://www.w3.org/2005/ajar/tab

The tabulator is written in javascript and contains a quad store (it knows where it got the triples from). You can see how it keeps track of the http requests by typing in a url such as
http://bblfish.net/people/henry/card
in the box at the top, then pressing Go!

Tabulator will then fetch the information, which might involve redirects etc.

You can then view how it stores this metadata by clicking the little wheel, clicking on the "access" relation
and clicking the Data as N3 view. I get this:

@prefix http: <http://www.w3.org/2007/ont/http#>.

[ http:location
   "http://bblfish.net/people/henry/card.n3";;
http:status
   "303";
http:statusText
   "See Other" ].


The other way of seeing this (some of this information) is to go to the bottom of the tabulator page, open the Log section, and click "dump store to log" right at the bottom. This dumps the store in Ntriples format. (so there must be some info missing, as it does not keep the context). But this is also very helpful.

<http://bblfish.net/people/henry/card> <http://www.w3.org/2007/ont/link#request > _:n70 . _:n70 <http://www.w3.org/2000/01/rdf-schema#label> "Access of http://bblfish.net/people/henry/card " .
_:n70 <http://www.w3.org/2007/ont/link#handler> _:n71 .
_:n70 <http://www.w3.org/2007/ont/link#status> _:n69 .
_:n70 <http://www.w3.org/2007/ont/http#status> "303" .
_:n70 <http://www.w3.org/2007/ont/http#statusText> "See Other" .
_:n70 <http://www.w3.org/2007/ont/http#location> "http://bblfish.net/people/henry/card.n3 " .

#( there is no more info on _:n71 or _:n69 presumably because of the 303. )

<http://bblfish.net/people/henry/card.n3> <http://www.w3.org/2007/ont/link#requestedBy > <http://bblfish.net/people/henry/card> .

#( notice above that it keeps track of how requests are followed through )

_:n0 <http://www.w3.org/2007/ont/link#source> <http://bblfish.net/people/henry/card.n3 > . <http://bblfish.net/people/henry/card.n3> <http://www.w3.org/2007/ont/link#request > _:n73 . _:n73 <http://www.w3.org/2000/01/rdf-schema#label> "Access of http://bblfish.net/people/henry/card.n3 " .
_:n73 <http://www.w3.org/2007/ont/link#handler> _:n74 .
_:n73 <http://www.w3.org/2007/ont/link#status> _:n72 .
_:n70 <http://www.w3.org/2006/link#redirectedRequest> _:n73 .
_:n73 <http://www.w3.org/2007/ont/http#status> "200" .
_:n73 <http://www.w3.org/2007/ont/http#statusText> "OK" .
_:n73 <http://www.w3.org/2007/ont/httph#date> "Wed, 21 Nov 2007 16:14:08 GMT" . _:n73 <http://www.w3.org/2007/ont/httph#server> "Apache/2.0.55 (Unix) DAV/2 mod_perl/2.0.2 Perl/v5.8.4" . _:n73 <http://www.w3.org/2007/ont/httph#last-modified> "Tue, 04 Sep 2007 14:53:46 GMT" .
_:n73 <http://www.w3.org/2007/ont/httph#etag> "\"4cf-15f5-74c3d280\"" .
_:n73 <http://www.w3.org/2007/ont/httph#accept-ranges> "bytes" .
_:n73 <http://www.w3.org/2007/ont/httph#content-length> "5621" .
_:n73 <http://www.w3.org/2007/ont/httph#content-type> "text/rdf+n3; charset=utf-8" .

#( It also adds some information as to the type of a resource )

<http://bblfish.net/people/henry/card.n3> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type > <http://www.w3.org/2007/ont/link#Document> . <http://bblfish.net/people/henry/card.n3> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type > <http://www.w3.org/2007/ont/link#TextDocument> .

I think this can make a helpful case as to why one should keep track of this information. It should be no trouble extracting this from RESTlets I imagine. But I thought the RESTlet group might find this insight quite interesting.


Henry

On 21 Nov 2007, at 11:18, Story Henry wrote:

Hi,

I have found an interesting ontology for HTTP called "Http in RDF". It is being developed with
some interesting use cases in mind:

  - Reporting test results
  - Conformance claims
  - Developing Web Apps

http://www.w3.org/TR/HTTP-in-RDF/

This could be used in the case of RESTlets to log all information about connections into an RDF database, which could then be queried using SPARQL, or used in other ways... It can also be interesting just to look
at the model being used here.

The ontology is pure RDF which means that relations are very flexible. It is possible for example for relations to point to literals just as easily as it is for them to objects point to objects. Clearly for particular applications it would help to use the ontology in a more OWL-DL like manner, which would fit java use better, and perhaps even
be more efficient for DB storage.

What do the resulting relations look like? Here is an example I put together to help me grok it.

If I run the following curl

[EMAIL PROTECTED]:0$ curl -I http://xmlns.com/foaf/0.1/knows --trace-ascii

I get the following trace

<curl-output.txt>


which would result in the following graph in N3

@prefix http: <http://www.w3.org/2006/http#> .
@prefix http-header: <http://www.w3.org/2006/http-header#> .

_:r1 a http:HeadRequest;
  http:abs_path "/foaf/0.1/knows";
  http:version "1.1";
  http:header [ http:fieldName http-header:User-Agent;
http:fieldValue "curl/7.16.3 (powerpc-apple- darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3" ];
  http:header [ http:fieldName http-header:Host;
                http:fieldValue "xmlns.com" ];
  http:header [ http:fieldName http-header:Accept;
                http:fieldValue "*/*" ];
  http:response [ http:version "1.1";
                  http:responseCode http:303;
                  http:header [ http:fieldName http-header:Date;
http:fieldValue "Wed, 21 Nov 2007 00:14:38 GMT" ];
                  http:header [ http:fieldName http-header:Server;
http:fieldValue "Apache/1.3.37 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/ 1.3.26.1a PHP/4.4.7 mod_ssl/2.8.22 OpenSSL/0.9.7e" ];
                  http:header [ http:fieldName http-header:Location;
http:fieldValue "http://xmlns.com/foaf/spec/ " ]; http:header [ http:fieldName http-header:Content- Type; http:fieldValue [ http:elementName "text/html"; http:param [ http:paramName "charset"; http:paramValue "iso-8859-1" ]
                                                 ]
                              ]
                ] .


Notice that the above does not tell us what the request was issued against. So one has to link the
request to the connection it is part of

_:c1 a http:Connection;
  http:connectionAuthority "xmlns.com:80";
  http:request _:r1 .

If we wanted to follow up with this with a new request to 
http://xmlns.com/foaf/spec/
then we would send another request, perhaps using the same connection

_:c1 http:request [ a http:GetRequest;
                   http:abs_path "/foaf/0.1/knows";
                   http:version "1.1";
                   # etc...
http:response [ http:body <file:///cache/sdfsdfs.rdf >;
                 ] .



So it is clear from the above that we have a vocabulary here that is very close to the mechanics of HTTP. It may be helpful to have a few relations a little higher in the stack of abstractions to link
the resource <http://xmlns.com/foaf/0.1/knows> to its representations

Anyway, any thoughts on how close this model is to the Restlets model? Does it help? Using @rdf annotations from so(m)mer (https://sommer.dev.java.net) one may even be able to link the two models
quite easily .


   Henry

Ps. The above may look very verbose, but remember that URLs are pointers, and so every use of a URL can be
condensed down to 1 pointer.


Home page: http://bblfish.net/
Sun Blog: http://blogs.sun.com/bblfish/
Foaf name: http://bblfish.net/people/henry/card#me




Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to