[foaf-dev] web of trust, openid and foaf

Story Henry henry.story at bblfish.net
Thu Sep 20 10:02:06 BST 2007

On 20 Sep 2007, at 00:20, Peter Williams wrote:

> Hopefully, its useful to a community when a new reader tries stuff  
> out. Ideally, I'm adding some value by commenting on the experience  
> of actually using the specifications.
> In summary, it was bad news: it was far too PAINFUL. The good news,  
> the nugget of know-how that was recovered is EXCELLENT.
> ----------------------------------------------
> (a) This version:
> http://xmlns.com/foaf/spec/20070524.html <http://xmlns.com/foaf/ 
> spec/20070524.html>  (rdf <https://webmail.rapattoni.com/exchange/ 
> pwilliams/Drafts/RE:%20[foaf-dev]%20web%20of%20trust,%20openid%20and 
> %20foaf.EML/20070524.rdf> ) . The HTML file resolves, but the rdf  
> link doesn't. HTML document doesn't obviously address the openid term.
> .

You have a lot of URLs up there in your mail. Are you draging and  
dropping URLs in Windows? There may be something a little shaky with  
that method of doing things....

I get a good document with
curl http://xmlns.com/foaf/spec/20070524.rdf

(curl is a very simple command line tool to get a document)

The openid relation was added very recently, and has not yet made it  
into the html version. That will have to wait for the next version -  
0.10 I suppose.

> (b) Latest version:
> http://xmlns.com/foaf/spec/ <http://xmlns.com/foaf/spec/>  (rdf  
> <https://webmail.rapattoni.com/exchange/pwilliams/Drafts/RE:%20 
> [foaf-dev]%20web%20of%20trust,%20openid%20and%20foaf.EML/ 
> index.rdf> ) Both links resolve. Neither the HTML nor the N3  
> address Openid.

It works for me:

hjs at bblfish:0$ cwm http://xmlns.com/foaf/spec/ --ntriples | grep openid
     <http://xmlns.com/foaf/0.1/openid>     <http://www.w3.org/ 
1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf- 
syntax-ns#Property> .
     <http://xmlns.com/foaf/0.1/openid>     <http://www.w3.org/ 
1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/ 
owl#InverseFunctionalProperty> .
     <http://xmlns.com/foaf/0.1/openid>     <http://www.w3.org/ 
1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/ 
owl#ObjectProperty> .
     <http://xmlns.com/foaf/0.1/openid>     <http://www.w3.org/ 
2000/01/rdf-schema#comment> "An OpenID  for an Agent." .
     <http://xmlns.com/foaf/0.1/openid>     <http://www.w3.org/ 
2000/01/rdf-schema#domain> <http://xmlns.com/foaf/0.1/Agent> .
     <http://xmlns.com/foaf/0.1/openid>     <http://www.w3.org/ 
2000/01/rdf-schema#isDefinedBy> <http://xmlns.com/foaf/0.1/> .
     <http://xmlns.com/foaf/0.1/openid>     <http://www.w3.org/ 
2000/01/rdf-schema#label> "openid" .
     <http://xmlns.com/foaf/0.1/openid>     <http://www.w3.org/ 
2000/01/rdf-schema#range> <http://xmlns.com/foaf/0.1/Document> .
     <http://xmlns.com/foaf/0.1/openid>     <http://www.w3.org/ 
2000/01/rdf-schema#subPropertyOf> <http://xmlns.com/foaf/0.1/ 
isPrimaryTopicOf> .
     <http://xmlns.com/foaf/0.1/openid>     <http://www.w3.org/ 
2003/06/sw-vocab-status/ns#term_status> "unstable" .

> (c) the http://xmlns.com/foaf/spec/ 
> 20070524.html#term_PersonalProfileDocument <http://xmlns.com/foaf/ 
> spec/20070524.html#term_PersonalProfileDocument>  text is nicely  
> written. It alone justifies my time invested in FOAF todate.


> (d) the http://xmlns.com/foaf/spec/20070524.html#term_made <http:// 
> xmlns.com/foaf/spec/20070524.html#term_made>  has "See foaf:made  
> <https://webmail.rapattoni.com/exchange/pwilliams/Drafts/RE:%20 
> [foaf-dev]%20web%20of%20trust,%20openid%20and%20foaf.EML/ 
> 1_text.htm#term_made> ..." . This may be intended to link to  
> foaf:maker <https://webmail.rapattoni.com/exchange/pwilliams/Drafts/ 
> RE:%20[foaf-dev]%20web%20of%20trust,%20openid%20and%20foaf.EML/ 
> 1_text.htm#term_maker> . Or, much more likely, Peter just plain  
> doesnt understand self-denoting, self-referring documents.

Well spotted. I think that is meant to be referencing foaf:maker

> (e) The default media at http://xmlns.com/foaf/0.1 seems to be HTML  
> (if I screen scrape the tags, as RDF). However, my particular  
> parser objects to its syntax if I treat it as HTML. I does not  
> obviously generate N3 when asked.

hjs at bblfish:0$ curl -I http://xmlns.com/foaf/0.1
HTTP/1.1 301 Moved Permanently
Date: Thu, 20 Sep 2007 08:34:18 GMT
Server: Apache/1.3.37 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/ 
2.4.2 mod_gzip/ PHP/4.4.7 mod_ssl/2.8.22 OpenSSL/0.9.7e
Location: http://xmlns.com/foaf/0.1/
Content-Type: text/html; charset=iso-8859-1

Yes. the default is HTML.

If you ask for rdf/xml you get

hjs at bblfish:0$ curl -I -H "Accept: application/rdf+xml" http:// 
HTTP/1.1 200 OK
Date: Thu, 20 Sep 2007 08:35:04 GMT
Server: Apache/1.3.37 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/ 
2.4.2 mod_gzip/ PHP/4.4.7 mod_ssl/2.8.22 OpenSSL/0.9.7e
Vary: Accept
Last-Modified: Sat, 16 Jun 2007 23:18:26 GMT
ETag: "4110733-9c51-46746fc2"
Accept-Ranges: bytes
Content-Length: 40017
Content-Type: application/rdf+xml

Usually one should assume that rdf/xml is what goes on the wire.  
Sadly, because it is difficult to write and confuses people. But it  
is a standard.

To get the N3 I just run:

hjs at bblfish:0$ cwm http://xmlns.com/foaf/0.1

which gets the rdf/xml and transforms it to N3.

For my AtomOwl Ontology I provided N3, RDF/XML, NTriples and html  
see: http://bblfish.net/work/atom-owl/2006-06-06/

> (f) Taking your cwm hint, I ended up writing script in a similar  
> tool that finally retrieved a RDF stream with an openid definition!  
> Im not sure I'd ever have made it this far, using merely a browser.

Browsers are interpreters for a limit set of media types. They don't  
usually off the bat do anything very interesting with most xml  
formats. It is much better to use simple command line tools when  
dealing with other xml types. At least the browser won't get in the way.

> var req = new HttpRequest("http://xmlns.com/foaf/0.1");
> req.header["Accept"] = "application/rdf+xml";
> var ds = req.getResponseData();
> Response.write(ds.format("application/n3"));


(the n3 mime type is text/rdf+n3 I believe)

> (g) Finally an OpenID definition (after 1 hour!)
>  foaf:openid a rdf:Property, owl:ObjectProperty,  
> owl:InverseFunctionalProperty;
>  rdfs:comment "An OpenID  for an Agent.";
>  rdfs:domain foaf:Agent;
>  rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/>;
>  rdfs:label "openid";
>  rdfs:range foaf:Document;
>  rdfs:subPropertyOf foaf:isPrimaryTopicOf;
>  <http://www.w3.org/2003/06/sw-vocab-status/ns#term_status>  
> "unstable".

See my one line command above!

> (h) Note the foafsig and htmlfoafsig references. Ive no idea what  
> they are, but they are interesting to me by cirtue of their  
> association with the wot
> <http://xmlns.com/foaf/0.1/> a owl:Ontology;
>  dc:date "$Date: 2007-06-16 23:18:26 $";
>  dc:description "The Friend of a Friend (FOAF) RDF vocabulary,  
> described using W3C RDF Schema and the Web Ontology Language.";
>  dc:title "Friend of a Friend (FOAF) vocabulary";
>  <http://xmlns.com/wot/0.1/assurance> <http://xmlns.com/foafsig>;
>  <http://xmlns.com/wot/0.1/src_assurance> <http://xmlns.com/ 
> htmlfoafsig>.

That's cool. I had not noticed those.

> (i) Note that retrieving (b)(rdf) gave
> <http://xmlns.com/foaf/0.1/ <http://xmlns.com/foaf/0.1/> > a  
> owl:Ontology;
>  dc:date "$Date: 2007-05-23 19:25:11 $";
>  dc:description "The Friend of a Friend (FOAF) RDF vocabulary,  
> described using W3C RDF Schema and the Web Ontology Language.";
>  dc:title "Friend of a Friend (FOAF) vocabulary";
>  <http://xmlns.com/wot/0.1/assurance <http://xmlns.com/wot/0.1/ 
> assurance> > <http://xmlns.com/foaf/0.1/../foafsig <http:// 
> xmlns.com/foaf/0.1/../foafsig> >;
>  <http://xmlns.com/wot/0.1/src_assurance <http://xmlns.com/wot/0.1/ 
> src_assurance> > <http://xmlns.com/foaf/0.1/../htmlfoafsig <http:// 
> xmlns.com/foaf/0.1/../htmlfoafsig> >.
> This has an even wierder set of conventions for accessing the  
> assurance values. A little help for poor readers is required.

with cwm you can run your own sparql server on a file, which is fun.

hjs at bblfish:2$ cwm http://xmlns.com/foaf/0.1 --sparqlServer

Then you can go an open a browser on port 8000, http://localhost:8000/

And enter a query such as

CONSTRUCT { <http://xmlns.com/foaf/0.1/> ?r ?b . }
WHERE {  <http://xmlns.com/foaf/0.1/> ?r ?b . }

for which the result was the following file

<rdf:RDF xmlns="http://purl.org/dc/elements/1.1/"

     <owl:Ontology rdf:about="http://xmlns.com/foaf/0.1/">
         <date>$Date: 2007-06-16 23:18:26 $</date>
         <description>The Friend of a Friend (FOAF) RDF vocabulary,  
described using W3C RDF Schema and the Web Ontology Language.</ 
         <title>Friend of a Friend (FOAF) vocabulary</title>
         <wot:assurance rdf:resource="http://xmlns.com/foafsig"/>
         <wot:src_assurance rdf:resource="http://xmlns.com/ 


hjs at bblfish:2$ curl -I http://xmlns.com/foafsig
HTTP/1.1 404 Not Found
Date: Thu, 20 Sep 2007 09:00:13 GMT
Server: Apache/1.3.37 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/ 
2.4.2 mod_gzip/ PHP/4.4.7 mod_ssl/2.8.22 OpenSSL/0.9.7e
Content-Type: text/html; charset=iso-8859-1

hjs at bblfish:2$ curl -I http://xmlns.com/htmlfoafsig
HTTP/1.1 404 Not Found
Date: Thu, 20 Sep 2007 09:01:18 GMT
Server: Apache/1.3.37 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/ 
2.4.2 mod_gzip/ PHP/4.4.7 mod_ssl/2.8.22 OpenSSL/0.9.7e
Content-Type: text/html; charset=iso-8859-1

So yes both of those are broken links

> (j) http://xmlns.com/wot/0.1/src_assurance doesn't resolve in a  
> browser
> (k) in a script the ping the wot using an rdf reader produced  
> little valuable output:
> var req = new HttpRequest("http://xmlns.com/wot/0.1/");
> req.header["Accept"] = "application/rdf+xml";
> var ds = req.getResponseData();
> Response.write(ds.format("application/n3"))
> Response.write(ds.format())
> The strream produced material that seemed a bit lacking:-
> @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
>  <?xml version="1.0"?>
> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
> </rdf:RDF>
> (l) a browsing of http://xmlns.com/foaf/ produces some PGP  
> signatures  that may line up with (i). Its hard to know which ones  
> they refer to really, tho!
> Parent Directory <https://webmail.rapattoni.com/>         17- 
> May-2007 03:22      -
> 0.1/ <https://webmail.rapattoni.com/exchange/pwilliams/Drafts/RE:%20 
> [foaf-dev]%20web%20of%20trust,%20openid%20and%20foaf.EML/0.1/ 
> >                     24-May-2007 18:45      -
> CVS/ <https://webmail.rapattoni.com/exchange/pwilliams/Drafts/RE:%20 
> [foaf-dev]%20web%20of%20trust,%20openid%20and%20foaf.EML/CVS/ 
> >                     25-May-2007 05:34      -
> corp/ <https://webmail.rapattoni.com/exchange/pwilliams/Drafts/RE:% 
> 20[foaf-dev]%20web%20of%20trust,%20openid%20and%20foaf.EML/corp/ 
> >                    04-Nov-2006 10:20      -
> doc/ <https://webmail.rapattoni.com/exchange/pwilliams/Drafts/RE:%20 
> [foaf-dev]%20web%20of%20trust,%20openid%20and%20foaf.EML/doc/ 
> >                     16-Jun-2007 16:07      -
> foafsig <https://webmail.rapattoni.com/exchange/pwilliams/Drafts/RE: 
> %20[foaf-dev]%20web%20of%20trust,%20openid%20and%20foaf.EML/ 
> foafsig>                  14-Oct-2003 18:02     1k
> htmlfoafsig <https://webmail.rapattoni.com/exchange/pwilliams/ 
> Drafts/RE:%20[foaf-dev]%20web%20of%20trust,%20openid%20and% 
> 20foaf.EML/htmlfoafsig>              14-Oct-2003 18:02     1k
> spec/ <https://webmail.rapattoni.com/exchange/pwilliams/Drafts/RE:% 
> 20[foaf-dev]%20web%20of%20trust,%20openid%20and%20foaf.EML/spec/ 
> >                    26-Jun-2007 03:01      -
> (m) Seeking to line up the signatures on (h), I tried to browse  
> http://xmlns.com/. However a default document is present -- making  
> resource listing hard.
> (n) Peter the programmer tried out http://xmlns.com/foafsig, but  
> got a 404.
> ________________________________
> From: Story Henry [mailto:henry.story at bblfish.net]
> Sent: Wed 9/19/2007 2:51 AM
> To: Peter Williams
> Cc: foaf-dev at lists.foaf-project.org
> Subject: Re: [foaf-dev] web of trust, openid and foaf
> On 19 Sep 2007, at 00:54, Peter Williams wrote:
>> By chance, my rather intelligent viewer of the FOAF file showed me
>> the triples in N3 of the facts that it read and induced - having
>> parsed a (file) copy of the original FOAF stream stored on my
>> desktop. The form of the statements contrasted with how the same
>> apparent facts were organized when the same viewer rendered in N3
>> the "same" FOAF stream of "facts" delivered directly from the URL
>> which was, infact, the very resource... about which
>> PersonalProfileDocument made statements.
> That is because the foaf file is using relative URLs, something you
> can do in html too. The model behind RDF always of course uses full
> URIs to refer to things.  Relative URLs are useful shorthands, but
> they do require you to make clear where the document was fetched from.
> cwm has an option for setting the base --base=<URI> for this.
> If you store your rdf in a triple store, the triple store will
> usually do this transformation for you.
> If you want to keep track of what was said when and where you can use
> a quad store, like Sesame 2 (openrdf.org).
> Then you can place your statements inside of graphs and make
> statements about those graphs, such as when they were fetched etc...
> In N3 you would write this out like this
> { :me a foaf:Person . ... } fetchEvent [ :time
> "2007-06-07..."^^xsd:dateTime; :from <http://eg.com/foaf> ] .
> Henry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2429 bytes
Desc: not available
Url : http://lists.usefulinc.com/pipermail/foaf-dev/attachments/20070920/4889a856/smime-0001.bin

More information about the foaf-dev mailing list