[foaf-dev] SPARQL update - was: relation from foaf to pubkey

Story Henry henry.story at bblfish.net
Thu Aug 27 13:10:58 CEST 2009


By the way the mod and cert:decimal relations together form a owl2 key.

http://www.w3.org/TR/2009/WD-owl2-new-features-20090611/#F9:_Keys

Sadly the owl2 group have their own notation to explain what they are  
doing that I don't understand. Perhaps someone could enlighten me on  
how I state that in the rsa ontology in N3?
(It would be nice to have those specs in N3)

Concerning sparql update...

On 26 Aug 2009, at 11:23, Toby Inkster wrote:

> On Wed, 2009-08-26 at 11:05 +0200, Melvin Carvalho wrote:
>> This is what I find most tricky tricky, for example in the  
>> description
>> above, can you give me any way of changing the modulus, without doing
>> it by hand?
>
> I think this SPARQL Update should do the trick, assuming that you want
> to change the modulus of <#me>'s key to the decimal "12301".
>
> MODIFY <http://example.com/graph>
> DELETE {
>  ?mod cert:decimal ?mod_dec .
> }
> INSERT {
>  ?mod cert:decimal "12301" .
> }
> WHERE {
>  ?key cert:identity <#me> ;
>       rsa:modulus ?mod .
>  ?mod cert:decimal ?mod_dec .
> }

Just guessing from what I see there - I have not yet read up on SPARUL  
carefully - that would cover a lot more than you wanted. A person for  
example could have more than one cert identifying him. I am not sure  
what the SPARUL above would do, but I have a feeling it would replace  
the modulus for all of the certs, which would not be what is wanted.

Would this not be better?

MODIFY <http://example.com/graph>
INSERT {
  ?mod cert:hex "AAAADSFDD...." .
}
DELETE {
  ?mod cert:decimal "BBB8CE454309191...." .
}
WHERE {
  [] cert:identity <#me> ;
     rsa:public_exponent [ cert:decimal "65537" ];
     rsa:modulus ?mod .
                 ?mod cert:hex "BBB8CE454309191...." .
}

I was thinking it may be better to put the DELETE first, then to add  
the insert.
Who knows, the server may do some consistency checking? (but perhaps  
that is covered by SPARUL)

Looking for feedback on if this works. If so we should add it to:

	http://esw.w3.org/topic/foaf+ssl/HOWTO

Henry


>
>> You have 3 bnodes in there, how do we handle them?
>
> SPARQL Update copes pretty well with bnodes. However, there's no  
> *rule*
> in FOAF+SSL that says the key, modulus and exponent need to be bnodes.
> My RSA key has a URI for example:
>
> http://tobyinkster.co.uk/#key_rsa_B025112EAF7811F968593BBCBC795CFF5A9158C0





>
> -- 
> Toby A Inkster
> <mailto:mail at tobyinkster.co.uk>
> <http://tobyinkster.co.uk>



More information about the foaf-dev mailing list