foaf:sha1 property with img src=

OK, this gave me a headache. Can anyone help?

(I don't mind the fact I got a headache; once we work out patterns, 
people will copy/paste them, and test. inventing patterns is harder)

I want to express the foaf:sha1 property of an image in my homepage 
(which already uses RDFa):

 From http://danbri.org/

<img rel="foaf:depiction" src="danbri-txt.jpg"
      alt="danbri" style="float: center"/>

...this was already there, saying the picture was a depiction of me. I 
want to add literal valued property of danbri-txt.jpg now, giving its 
hash. I was wondering if it could be done with 'rev' and 'property' but 
suspect it needs reorganizing with <span>...

The hash of this file is
$ sha1sum danbri-txt.jpg
58d174f20c039289544b2364c5c21295df2e4a2b  danbri-txt.jpg

Douglas Crockford just posted a proposal for a hash= attribute in HTML, 
to allow user agents to cache common files like jquery.js

http://blog.360.yahoo.com/blog-TBPekxc1dLNy5DOloPfzVvFIVOWMB0li?p=789

[[
Any HTML tag that accepts a src= or href= attribute should also be 
allowed to take a hash= attribute. The value of a hash attribute would 
be the base 32 encoding of the SHA of the object that would be 
retrieved. This does a couple of useful things.

First, it gives us confidence that the file that we receive is the one 
that we asked for, that it was not replaced or tampered with in transit.

Second, browsers can cache by hash code. If the cache contains a file 
that matches the requested hash=, then there is no need to go to the 
network regardless of the url. This would improve the performance of 
Ajax libraries because you would only have to download the library once 
for all of the sites you visit, even if every site links to its own copy.
Tags: www, security

Tuesday March 25, 2008 - 11:02am (PDT)
]]

BTW this brings up an old 'works manifestations expressions and items' 
FRBR issue with foaf:sha1 and the slippery problem of giving identity 
criteria for "docments"; I originally defined it as an inverse 
functional property, which would mean that we could conclude two objects 
with the same hash are 'the same thing'. Then I backed off from that, 
realising that for example, two different people could create zero-byte 
files (with same hash) on different dates; and if we had a creation-date 
functional property, we'd get a contradiction. But this scenario from 
Douglas Crockford is I think a nice use case for these ideas.

http://xmlns.com/foaf/spec/#term_sha1 documents the current messy state 
of the property, but for purposes of this thread, can we just talk RDFa 
syntax first and get the notation right?

cheers,

Dan

ps. does anyone fancy hacking about in eg. Firefox to see about actually 
implementing this? could be scary deep in the core code, but would be a 
cool hack...

--
http://danbri.org/

Received on Monday, 31 March 2008 11:49:04 UTC