cert:key implementations

Ok, I added an implementation to the read-write web scala project at the W3C.

   https://dvcs.w3.org/hg/read-write-web/rev/8a84fe5eec71

As you can see the diff is pretty simple:

 --- a/src/main/scala/auth/WebIdClaim.scala	Mon Oct 17 12:52:37 2011 +0200
     1.2 +++ b/src/main/scala/auth/WebIdClaim.scala	Mon Oct 17 20:47:27 2011 +0200
     1.3 @@ -42,17 +42,20 @@
     1.4       final val xsd: String = "http://www.w3.org/2001/XMLSchema#"
     1.5  
     1.6      val selectQuery = QueryFactory.create("""
     1.7 - 		  PREFIX cert: <http://www.w3.org/ns/auth/cert#>
     1.8 - 		  PREFIX rsa: <http://www.w3.org/ns/auth/rsa#>
     1.9 - 		  SELECT ?key ?m ?e ?mod ?exp
    1.10 - 		  WHERE {
    1.11 - 		   ?key cert:identity ?webid ;
    1.12 - 		      rsa:modulus ?m ;
    1.13 - 		      rsa:public_exponent ?e .
    1.14 - 
    1.15 - 		    OPTIONAL { ?m cert:hex ?mod . }
    1.16 - 		    OPTIONAL { ?e cert:decimal ?exp . }
    1.17 - 		  }""")
    1.18 +      PREFIX cert: <http://www.w3.org/ns/auth/cert#>
    1.19 +      PREFIX rsa: <http://www.w3.org/ns/auth/rsa#>
    1.20 +      SELECT ?m ?e ?mod ?exp
    1.21 +      WHERE {
    1.22 +       {
    1.23 +         ?key  cert:identity ?webid .
    1.24 +       } UNION {
    1.25 +         ?webid cert:key ?key .
    1.26 +       }
    1.27 +        ?key rsa:modulus ?m ;
    1.28 +             rsa:public_exponent ?e .
    1.29 +       OPTIONAL { ?m cert:hex ?mod . }
    1.30 +       OPTIONAL { ?e cert:decimal ?exp . }
    1.31 +}""")
    1.32  


I am not sure if this is better than Toby's implementation, but it may be.  :-)
So now we just need bergi to update his tests so that we can find out if I am doing things right!


Henry


On 13 Oct 2011, at 14:37, Toby Inkster wrote:

> Henry Story <henry.story@gmail.com> wrote:
>> On 13 Oct 2011, at 14:06, Toby Inkster wrote:
>> 
>>> Checked in support for cert:pubKey to my repo...
>>> http://goddamn.co.uk/svn-web/perlmods/revision?rev=977  
>> 
>> Goddamn that's fast!
>> 
>> Ok. Can we then go for just cert:key ?
> 
> http://goddamn.co.uk/svn-web/perlmods/revision?rev=978
> 
> Would have been faster but I was eating some clementine.

Received on Monday, 17 October 2011 18:59:12 UTC