These are chat archives for linkeddata/warp

4th
May 2016
Melvin Carvalho
@melvincarvalho
May 04 2016 12:34
I think I've found a bug in WARP
When giving read access to everyone for a a file it generates:
@prefix n0: <#>.
@prefix n1: <http://www.w3.org/ns/auth/acl#>.
@prefix loc: <https://localhost:8443/>.
@prefix n2: <http://melvincarvalho.com/#>.
@prefix n3: <http://xmlns.com/foaf/0.1/>.

n0:policy0
    a    n1:Authorization;
    n1:accessTo
       <https://localhost:8443/checkacl.acl>, loc:checkacl;
    n1:agent
       n2:me;
    n1:mode
       n1:Control, n1:Read, n1:Write.
n0:policy1
    a    n1:Authorization;
    n1:accessTo
       loc:checkacl;
    n1:agentClass
       n3:Agent;
    n1:mode
       n1:Read.
but loc: should be </> as a relative path
and n1: accessTo should be loc:checkacl.acl
        g.add($rdf.sym("#policy"+i), WAC("accessTo"), $rdf.sym(decodeURI($scope.uri)));
perhaps the issue is in the rdflib serializer too
Melvin Carvalho
@melvincarvalho
May 04 2016 12:40
at the end it does
    var s = new $rdf.Serializer(g).toN3(g);
i wonder if setBase() would help here ...
Melvin Carvalho
@melvincarvalho
May 04 2016 12:53
I think rdflib would fix it
            str += '@prefix ' + this.prefixes[ns] + ': <' +
             $rdf.uri.refTo(this.base, ns) + '>.\n';
Andrei
@deiu
May 04 2016 13:47
Is it warp related or rdflib related?
Melvin Carvalho
@melvincarvalho
May 04 2016 13:48
From what I can see it's warp related, because I dont think warp sets the base URL
but there may also be a bug in rdflib
Melvin Carvalho
@melvincarvalho
May 04 2016 13:53
I raised an issue linkeddata/warp#20
just try making an acl and see if the .acl gives relative or absolute uris for the accessTo
or in the prefix
Andrei
@deiu
May 04 2016 13:57
I think warp uses an older version of rdflib
I’ll try to upgrade and test again
Melvin Carvalho
@melvincarvalho
May 04 2016 14:01
good idea, but if the base is not set, maybe it cant work out what uris are relative to:
   var s = new $rdf.Serializer(g).toN3(g);
unless it's in g already