[foaf-protocols] webid query at uriburner targeting a foaf.me card

Stéphane Corlosquet scorlosquet at gmail.com
Fri Mar 18 14:23:16 CET 2011


On Fri, Mar 18, 2011 at 8:39 AM, peter williams <home_pw at msn.com> wrote:

> Thanks. And, you confirmed my worst fear – that each source of foaf
> documents (n billion of them, in the endgame) could require a different
> sparql query, merely to test if an array has a particular value. That world
> is obviously impractical.
>
>
>
> For now (since we all learning), for any foaf card I will make upto 2
> queries, in sequence.  If either of the queries you outline generates a
> webid value in its result-type, then the cert is valid. This is a coping
> strategy, not a fix. But, at least the 2 highest-profile foaf generating
> sites with webid pubkeys will be queryable.
>
>
>
> Is there a way to run the “2 queries”  in just one run of the sparql
> protocol? Use a composite query that is?
>

yes, you can combine 2 graph patterns with UNION [1]

Steph.

[1] http://www.w3.org/TR/rdf-sparql-query/#alternatives



>
>
> *From:* foaf-protocols-bounces at lists.foaf-project.org [mailto:
> foaf-protocols-bounces at lists.foaf-project.org] *On Behalf Of *Andreas
> Radinger
> *Sent:* Friday, March 18, 2011 4:57 AM
> *To:* foaf-protocols at lists.foaf-project.org
> *Subject:* Re: [foaf-protocols] webid query at uriburner targeting a
> foaf.me card
>
>
>
> On 3/18/11 12:12 AM, Peter Williams wrote:
>
> using the uriburner query:
>
>
> DEFINE get:soft "replace"
> PREFIX cert: <http://www.w3.org/ns/auth/cert#>
> PREFIX rsa: <http://www.w3.org/ns/auth/rsa#>
> select  ?webid
> FROM <http://foaf.me/pw2#me>
> WHERE {
> [] cert:identity ?webid ;
> rsa:modulus ?m ;
> rsa:public_exponent ?e .
> ?m cert:hex
> "BD4B4A4435D501EE874670E1017FABB08060C1CB3CE5B43D7F627CC4E0A21D243A4FD6890BCF723F39CA5F0A866E43400699146F47F699033C07C8E7CFB9066E851B5D8D2E7179A0DB2C1A59B7FC7CBE70AAB9D0D3A7F234DB9FCEF967AB8FB7932897C12CB074EDE215FECA0DF407F72336064E81D43F8301A994E2A0F4BACD"^^xsd:string
> .
> ?e cert:decimal "65537"^^xsd:string
> }
>
>
>
> the foaf.me card at http://foaf.me/pw2#me has
>
>
>
> *-* <http://foaf.me/pw2> <rdf:Description>
>
> * * <rdf:type rdf:resource="*http://www.w3.org/ns/auth/rsa#RSAPublicKey*"
> />
>
> * * <cert:identity rdf:resource="*#me*" />
>
> *-* <http://foaf.me/pw2> <rsa:modulus rdf:parseType="*Resource*">
>
> * * <cert:hex>*bd 4b 4a 44 35 d5 01 ee 87 46 70 e1 01 7f ab b0 80 60 c1 cb
> 3c e5 b4 3d 7f 62 7c c4 e0 a2 1d 24 3a 4f d6 89 0b cf 72 3f 39 ca 5f 0a 86
> 6e 43 40 06 99 14 6f 47 f6 99 03 3c 07 c8 e7 cf b9 06 6e 85 1b 5d 8d 2e 71
> 79 a0 db 2c 1a 59 b7 fc 7c be 70 aa b9 d0 d3 a7 f2 34 db 9f ce f9 67 ab 8f
> b7 93 28 97 c1 2c b0 74 ed e2 15 fe ca 0d f4 07 f7 23 36 06 4e 81 d4 3f 83
> 01 a9 94 e2 a0 f4 ba cd*</cert:hex>
>
> * * </rsa:modulus>
>
> *-* <http://foaf.me/pw2> <rsa:public_exponent rdf:parseType="*Resource*">
>
> * * <cert:decimal>*65537*</cert:decimal>
>
> * * </rsa:public_exponent>
>
> * * </rdf:Description>
>
>
>
>
>
> what I'm hoping is that the uriburner agent will, given the 1 query formula
> (into which I plugin mod/exp/uri from the client cert), talk to both the
> webid wiki resource server and the foaf.me resource server.
>
>
>
> Logically, there is no difference in the triple sets (apart from values) -
> though the wiki is using HTML/RDFa and foaf.me returns RDF/XML. Do I have
> to know to put the hex in lower case, or something?
>
>
>
> HTTP/1.1 200 OK
> Date: Thu, 17 Mar 2011 22:53:54 GMT
> Server: Apache/2.2.12 (Ubuntu)
> X-Powered-By: PHP/5.2.10-2ubuntu6.4
> MS-Author-Via: SPARQL
> Content-Length: 1381
> Keep-Alive: timeout=15, max=100
> Connection: Keep-Alive
> Content-Type: application/xml
> X-Pad: avoid browser bug
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <rdf:RDF xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#<http://www.w3.org/1999/02/22-rdf-syntax-ns>
> ...
>
> Summary. query get the right answer when working against the webid wiki's
> triples, but same basic query doesnt seem to get the right answer against
> the foaf.me resource.
>
>
>
> _______________________________________________
>
> foaf-protocols mailing list
>
> foaf-protocols at lists.foaf-project.org
>
> http://lists.foaf-project.org/mailman/listinfo/foaf-protocols
>
> Hi,
>
> the problem is that
> a) the wiki page in RDFa at [1] use typed literals (xsd:string) and
> b) the foaf.me resource in RDF at [2] use untyped literals
> for the values of cert:hex and cert:decimal.
>
> The correct query for a) is:
> PREFIX cert: <http://www.w3.org/ns/auth/cert#><http://www.w3.org/ns/auth/cert>
> PREFIX rsa: <http://www.w3.org/ns/auth/rsa#><http://www.w3.org/ns/auth/rsa>
> select  ?webid
> FROM <http://webid.myxwiki.org/xwiki/bin/view/XWiki/homepw4><http://webid.myxwiki.org/xwiki/bin/view/XWiki/homepw4>
> WHERE {
> [] cert:identity ?webid ;
> rsa:modulus ?m ;
> rsa:public_exponent ?e .
> ?m cert:hex
> "b520f38479f5803a7ab33233155eeef8ad4e1f575b603f7780f3f60ceab1\n34618fbe117539109c015c5f959b497e67c1a3b2c96e5f098bb0bf2a6597\n779d26f55fe8d320de7af0562fd2cd067dbc9d775b22fc06e63422717d00\na6801dedafd7b54a93c3f4e59538475673972e524f4ec2a3667d0e1ac856\nd532e32bf30cef8c1adc41718920568fbe9f793daeeaeeaa7e8367b7228a\n895a6cf94545a6f6286693277a1bc7750425ce6c35d570e89453117b88ce\n24206afd216a705ad08b7c59\n"^^xsd:string
> .
> ?e cert:decimal "65537"^^xsd:string .
> }
>
> The correct query for b) would be:
> PREFIX cert: <http://www.w3.org/ns/auth/cert#><http://www.w3.org/ns/auth/cert>
> PREFIX rsa: <http://www.w3.org/ns/auth/rsa#><http://www.w3.org/ns/auth/rsa>
> select  ?webid
> FROM <http://foaf.me/pw2#me> <http://foaf.me/pw2#me>
> WHERE {
> [] cert:identity ?webid ;
> rsa:modulus ?m ;
> rsa:public_exponent ?e .
> ?m cert:hex "bd 4b 4a 44 35 d5 01 ee 87 46 70 e1 01 7f ab b0 80 60 c1 cb 3c
> e5 b4 3d 7f 62 7c c4 e0 a2 1d 24 3a 4f d6 89 0b cf 72 3f 39 ca 5f 0a 86 6e
> 43 40 06 99 14 6f 47 f6 99 03 3c 07 c8 e7 cf b9 06 6e 85 1b 5d 8d 2e 71 79
> a0 db 2c 1a 59 b7 fc 7c be 70 aa b9 d0 d3 a7 f2 34 db 9f ce f9 67 ab 8f b7
> 93 28 97 c1 2c b0 74 ed e2 15 fe ca 0d f4 07 f7 23 36 06 4e 81 d4 3f 83 01
> a9 94 e2 a0 f4 ba cd".
> ?e cert:decimal "65537".
> }
>
>
> [1] http://webid.myxwiki.org/xwiki/bin/view/XWiki/homepw4
> [2] http://foaf.me/pw2
>
>
> --
>
> Best regards
>
> Andreas Radinger
>
>
>
> ------------------------------------------
>
> Dipl.-Ing. Andreas Radinger
>
> Professur für Allgemeine BWL, insbesondere E-Business
>
> e-business & web science research group
>
> Universität der Bundeswehr München
>
>  e-mail: andreas.radinger at unibw.de
>
> phone:  +49-(0)89-6004-4218
>
> fax:    +49-(0)89-6004-4620
>
> www:    http://www.unibw.de/ebusiness/
>
> skype:  andreas.radinger
>
>
>
>
> _______________________________________________
> foaf-protocols mailing list
> foaf-protocols at lists.foaf-project.org
> http://lists.foaf-project.org/mailman/listinfo/foaf-protocols
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.foaf-project.org/pipermail/foaf-protocols/attachments/20110318/c62701cd/attachment.htm 


More information about the foaf-protocols mailing list