[foaf-protocols] Web ACL
Melvin Carvalho
melvincarvalho at gmail.com
Tue May 19 10:59:10 CEST 2009
A quick example to display web access control can be seen here:
Demo
=====
http://foaf.me/testACL.php
The code
=======
This uses the first version of libACL.php [1]
<?
require_once('config.php');
require_once('lib/libACL.php');
$uri = 'http://ld2sd.deri.org/wac-demo/wac.ttl';
print "testing acl list at $uri";
$acl = getACL($uri);
print "<pre>";
print_r($acl);
?>
The SPARQL
==========
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix foaf: <http://xmlns.com/foaf/0.1/>
prefix dcterms: <http://purl.org/dc/terms/>
prefix acl: <http://www.w3.org/ns/auth/acl#>
select distinct ?resource ?person ?mode from
<http://ld2sd.deri.org/wac-demo/wac> where {
?aut acl:accessTo ?resource ;
acl:mode ?accessMode .
?accessMode a ?mode .
OPTIONAL {
?aut acl:agentClass ?group .
?group foaf:member ?person
}
OPTIONAL {
?aut acl:agent ?person
}
}
(thanks to mhausenblas)
[1] http://github.com/melvincarvalho/foafme/tree/a10cebe786abfe3510a193ca4e817d230481d0c3/lib
More information about the foaf-protocols
mailing list