foaf:Group SPARQL and PGP example

Hi TimBL,

Care to dig out a GPG key and try signing some RDF? Am playing with
ideas for expressing foaf:Group membership rules in SPARQL. SPARQL
rather than OWL or RIF since properties of the graph/doc are
interesting here. One example (which goes back to SWAD days) is to say
things like, "the members of this group are people who are said to
have a workplaceHomepage of www.w3.org by timbl". Since SPARQL isnt' a
full rule language, the query needs to be a bit hardcoded. But I'd be
interested in getting this running...

Example follows (uses wrong key fingerprint, but you get the idea?)

cheers,

Dan

"Someone's in the W3C Staff group if a document signed by TimBL says
their workplaceHomepage is http://www.w3.org/".

<foaf:Group rdf:about="#w3t_according_to_timbl"
xmlns:foaf="http://xmlns.com/foaf/0.1/">
  <foaf:name>W3C Team members</foaf:name>
  <foaf:membershipClass> <!-- previously used OWL -->

     <foaf:Query foaf:var="?x"> <![CDATA[

     PREFIX : <http://xmlns.com/foaf/0.1/>
     PREFIX wot: <http://xmlns.com/wot/0.1/>
     SELECT ?x
#     FROM <http://www.w3.org/People/TimBL/staff.rdf> # hardcode the
src? or just properties of it?
# or use Construct? ?x foaf:member foo_group etc
     WHERE {
        GRAPH ?doc {
          ?x a :Person .
          ?x :workplaceHomepage <http://www.w3.org/> .
        } .
          ?doc wot:assuredBy [ a :Agent;   wot:keyid = "B573B63A" ] .
     }

     ]]>
    </foaf:Query>
  </foaf:membershipClass>
</foaf:Group>

Received on Tuesday, 6 November 2007 01:00:09 UTC