Firefox 3.5 and W3C Geo API

2009-07-08 12:09:29 +0000

I have made a simple webpage which makes use of the W3C Geo API. The page will prompt you for your location, given you are using FF3.5, and will subsequently ask you for a WebID and some text to describe what you are up to.

The service then generates a call to another endpoint I bashed together, that takes the following cgi arguements.
<br /> webid - lat - long with an OPTIONAL alt - datetime - doing(what I am doing now field)<br />
e.g.,
<br /> https://mmt.me.uk/blog/services/FOAFEvent?lat=51.4583494&long=-0.1186444&webid=http://foo.com/foaf.rdf%23bar&datetime=2009-07-08T13:02:46+01:00&doing=writing+a+blog+article<br />
That in turn generates a FOAF person scrobble, or a FOAF Event. I have made us of the Event, Timeline, FOAF, dc, and the Geo ontologies.

So this service can be found on my site, https://mmt.me.uk/blog/geo. It should be noted that I DO NOT store any of the information which I output on this site. I will make it HTTPS at some point, and then I will replace using Plazes.com with my own service. I would rather a world where I was running all of my own social networking from my own machine.

The code to do this is so simple. In order to do the W3C geo stuff all you need to do is write some html and javascript, like so (sorry about the indentation)
`



`
and this :
`


` Here are a bunch of links which I used to find out how to do this : * <http://www.skyhookwireless.com/whoweare/privacypolicy.php> * <http://dev.w3.org/geo/api/spec-source.html> * <http://ajaxian.com/archives/navigatorgeolocation-using-the-w3c-geolocation-api-today> * <http://www.tralfamadore.com/2008/08/w3c-geolocation-api-on-iphone-with.html> * <http://almaer.com/blog/using-the-w3c-geolocation-api-specification-today-extending-whereareyou> * <https://developer.mozilla.org/En/Using_geolocation>

Enabling Trust in a FOAF Document

2009-07-08 11:13:15 +0000

This blog post follows on from my previous one signing and verifying files with GnuPG, whereby I showed (he says), in its simplest form, how one can digitally sign and verify a document. This in turn allows anyone reading the document to verify whether or not it has been tampered with since it was signed.

In this post I will describe two methods of linking to a digital signature from a RDF document. The RDF document I will be describing in this post is a FOAF document, but is is needless to say that this approach can be used from any RDF file.

The method described below makes use of the Web of Trust ontology (WOT). WOT allows for RDF documents to be signed using Digital Signatures and Public Key Cryptography.

Whilst putting together the foaf validator, which checks the semantics of a RDF document to ensure that it is a well formed foaf:PersonalProfileDocument, I came across these two different methods of using the Web of Trust ontology.

Linking to an armored digital signature using the WOT ontology from your FOAF file:

Step 0: Declare the wot namespace in the FOAF file

<BR><br /> @prefix wot: <http://xmlns.com/wot/0.1/> .<BR><br />

Step 1

Add a triple from the Document pointing to the digital signature like so:

<BR><br /> <> wot:assurance <http://foo.com/foaf.rdf.asc> .<BR><br />

Step 2

Add a triples associating the public key used to sign the FOAF document to the FOAF person. This can be done in one of two ways, like so:

Style 1

<BR><br /> _:bnode0 a <http://xmlns.com/wot/0.1/PubKey> .<br /> _:bnode0 dc:title &#8220;Public Key Bnode&#8221; .<br /> _:bnode0 wot:fingerprint &#8220;FW89F7WF78SD8F7SD7FG21JL213192&#8221; .<br /> _:bnode0 wot:hex_id &#8220;12A75E9B&#8221; .<br /> _:bnode0 wot:identity <#me> .<br /> _:bnode0 wot:pubkeyAddress <http://foo.com/me.pubkey.asc> <br />

This is how I sign my FOAF file

Style 2

<BR><br /> <#me> wot:hasKey _:bnode0 .<br /> _:bnode0 a <http://xmlns.com/wot/0.1/PubKey> .<br /> _:bnode0 wot:pubkeyAddress <http://foo.com/me.pubkey.asc> <br /> _:bnode0 dc:title &#8220;Public Key Bnode&#8221; .<br /> _:bnode0 wot:fingerprint &#8220;FW89F7WF78SD8F7SD7FG21JL213192&#8221; .<br /> _:bnode0 wot:hex_id &#8220;12A75E9B&#8221; .<br />

This is how Kjetil signs his FOAF file

These two methods of associating a publicKey to a FOAF WebID, which is in turn can be used to digitally sign a FOAF file are both supported by Garlik’s FOAF validator.

Enabling a Writable WebID with WebDAV

2009-07-08 10:45:49 +0000

In this post I will describe how you can enable write access to a file, specially a RDF one, via Apache’s HTTP server and the Web Distributed Authoring and Versioning protocol (WebDAV) extension to the HTTP protocol.

So, why would you want to do this?

I use WebDAV on my FOAF file to enable write access via Tim Berners-Lee’s Tabulator and Garlik’s foafbuilder. This technology allows me to write updates straight through the HTTP protocol, so that I don’t have to save the file to my local machine, and scp it over.

These are the configuration settings needed in your httpd.conf file:

Setting up WebDAV on a whole directory:

`

<VirtualHost *:80>

ServerName www.foo.com

ServerAlias foo.com

Alias / /var/www/foo/public_html/



DAV On

AuthType Basic

AuthName “webdav”

Header set MS-Author-Via DAV

AuthUserFile /var/www/foo/passwd.dav



Require user bar



</Location>

</VirtualHost>

`

Enabling WebDAV for all files ending in .rdf:

`

<VirtualHost :80>

ServerName www.foo.com

ServerAlias foo.com

Alias / /var/www/foo/public_html/

<Files ~ “.
.rdf”>

DAV On

AuthType Basic

AuthName “webdav”

AuthUserFile /var/www/foo/passwd.dav

Header set MS-Author-Via DAV

ForceType application/rdf+xml



Require user bar



</Files>

</VirtualHost>

`

_It should be noted that the methods presented above allow for the files to be read normally via HTTP, as well as catering for writing via WebDAV.

_

WebDAV related HTTP Headers:

The correct HTTP header used to tell a client that a file is WebDAV enabled is:

MS-Author-via: DAV

Some of this information was taken from the ESW wiki’s article “EditingData”, and I should thank everyone who helped put it together.