updated to new cert:ontology which now allows relation from person to key, making it easier to write in foaf files. webid
authorHenry Story <henry.story@bblfish.net>
Mon, 17 Oct 2011 20:47:27 +0200
branchwebid
changeset 85 8a84fe5eec71
parent 84 cf0d0d460b06
child 86 0f5073724842
updated to new cert:ontology which now allows relation from person to key, making it easier to write in foaf files.
src/main/scala/auth/WebIdClaim.scala
--- a/src/main/scala/auth/WebIdClaim.scala	Mon Oct 17 12:52:37 2011 +0200
+++ b/src/main/scala/auth/WebIdClaim.scala	Mon Oct 17 20:47:27 2011 +0200
@@ -42,17 +42,20 @@
      final val xsd: String = "http://www.w3.org/2001/XMLSchema#"
 
     val selectQuery = QueryFactory.create("""
- 		  PREFIX cert: <http://www.w3.org/ns/auth/cert#>
- 		  PREFIX rsa: <http://www.w3.org/ns/auth/rsa#>
- 		  SELECT ?key ?m ?e ?mod ?exp
- 		  WHERE {
- 		   ?key cert:identity ?webid ;
- 		      rsa:modulus ?m ;
- 		      rsa:public_exponent ?e .
- 
- 		    OPTIONAL { ?m cert:hex ?mod . }
- 		    OPTIONAL { ?e cert:decimal ?exp . }
- 		  }""")
+      PREFIX cert: <http://www.w3.org/ns/auth/cert#>
+      PREFIX rsa: <http://www.w3.org/ns/auth/rsa#>
+      SELECT ?m ?e ?mod ?exp
+      WHERE {
+       {
+         ?key  cert:identity ?webid .
+       } UNION {
+         ?webid cert:key ?key .
+       }
+        ?key rsa:modulus ?m ;
+             rsa:public_exponent ?e .
+       OPTIONAL { ?m cert:hex ?mod . }
+       OPTIONAL { ?e cert:decimal ?exp . }
+}""")
 
   /**
     * Transform an RDF representation of a number into a BigInteger