Manually merge Henry's changes: "added many more details on the SPARQL queries" from http://github.com/bblfish/webid-spec/commit/4c29ce34798f22686f29bf3dba4ea899dd7d0e62
authorscor <scorlosquet@gmail.com>
Tue, 03 Aug 2010 12:38:22 -0400
changeset 68 674903de36a8
parent 67 806aa7d17170
child 69 ef9d91c6af1a
Manually merge Henry's changes: "added many more details on the SPARQL queries" from http://github.com/bblfish/webid-spec/commit/4c29ce34798f22686f29bf3dba4ea899dd7d0e62
index-respec.html
--- a/index-respec.html	Tue Aug 03 12:23:27 2010 -0400
+++ b/index-respec.html	Tue Aug 03 12:38:22 2010 -0400
@@ -573,6 +573,52 @@
       rsa:public_exponent [ cert:decimal ?exp ] .
 }
 </pre>
+<p class="issue">The above query is using the original non literal method of writing a query, and does not support the literal notation. Should we in this document take that to now be deprecated?</p>
+<p class="issue">The above query will work properly if the graph does inferencing on the rsa ontology. If it does not then it would be wise to remove the "a rsa:RSAPublicKey relation from the pattern.</p>
+<p>Currently as a trnsition phase allowing for literals and non literal notationthe following query is adopted:</p>
+<pre class='example'>
+PREFIX cert: &lt;http://www.w3.org/ns/auth/cert#&gt;
+PREFIX rsa: &lt;http://www.w3.org/ns/auth/rsa#&gt;
+SELECT ?m ?e ?mod ?exp 
+WHERE { 
+   [] cert:identity ?webid ;
+        rsa:modulus ?m ;
+        rsa:public_exponent ?e .
+   OPTIONAL { ?m cert:hex ?mod . }
+   OPTIONAL { ?e cert:decimal ?exp . }
+</pre>
+<p>In the above query the verifier has to iterate through the answer set,
+converting bindings for ?m and ?e if they are literals to integers, else to check for ?mod and ?exp and convert those to literals. In order to allow for the possibility of there being multiple ways of writing the literals, this process should be able to convert the various 
+</p>
+<p>If we move to dropping the deprecated relations - and thereby make writing the rdf easier, the query can be the much simpler</p>
+<pre class='example'>
+PREFIX cert: &lt;http://www.w3.org/ns/auth/cert#&gt;
+PREFIX rsa: &lt;http://www.w3.org/ns/auth/rsa#&gt;
+SELECT ?m ?e ?mod ?exp 
+WHERE { 
+   [] cert:identity ?webid ;
+        rsa:modulus ?m ;
+        rsa:public_exponent ?e .
+}
+</pre>
+<p>Here the verification agent must check that one of the answers for ?m and ?e matches the public key in the certificate</p>
+<p>If the triple store supports literal inferencing then the query for
+a given modulus "9D79BFE2498..." and exponent "65537" 
+be as simple simple as:
+</p>
+<pre class='example'>
+PREFIX cert: &lt;http://www.w3.org/ns/auth/cert#&gt;
+PREFIX rsa: &lt;http://www.w3.org/ns/auth/rsa#&gt;
+ASK {
+   [] cert:identity &lt;http://example.org/webid#public&gt;;
+      rsa:modulus  "9D79BFE2498..."^^cert:hex;
+      rsa:public_exponent "65537"^^cert:int .
+}
+</pre>
+<p>If the above query returns True, then authentication has succeeded, otherwise not. </p>
+<p>Note that this will requre the type inferencing engine to be able to
+convert literals written in the profile document as "9D ☮ 79 ☮ BF ☮ E2 ☮ F4 ☮ 98 ☮" into the integer.
+</p>
 
 <p class="issue">This section still needs more information.</p>