marklogic / marklogic-jena

Adapter for using MarkLogic with the Jena RDF Framework
Other
5 stars 11 forks source link

abort/end transaction commits permission changes to SPARQLUpdatePermission #8

Closed kkanthet closed 9 years ago

kkanthet commented 9 years ago

steps to reproduce:: open Write Transaction setSPARQLUpdate permission to READ insert graph and triples commit transaction open new Transaction setSPARQLUpdate permission to UPDATE insert graph and triples abort or end transaction Result: Current:: permission is changed to Update Expected:: finish the transaction and undo permission change

markLogicDatasetGraph.begin(ReadWrite.WRITE);
        markLogicDatasetGraph.setSPARQLUpdatePermissions(permissions.permission("test-perm", Capability.READ));
        update = new UpdateRequest();
        update.add("BASE <http://example.org/> INSERT  {GRAPH <copy3> {<s33> <p33> <o33>}}  WHERE {GRAPH <copy1> {?s ?p <o3>}}");
        UpdateAction.execute(update, markLogicDatasetGraph);
        markLogicDatasetGraph.commit();
        permissions = markLogicDatasetGraph.getSPARQLUpdatePermissions();
        System.out.println(permissions.toString());
        assertTrue(permissions.get("test-perm").contains(Capability.READ));

        markLogicDatasetGraph.begin(ReadWrite.WRITE);
        markLogicDatasetGraph.setSPARQLUpdatePermissions(permissions.permission("test-perm", Capability.UPDATE));
        update = new UpdateRequest();
        update.add("BASE <http://example.org/> INSERT DATA {GRAPH <copy3> {<s333> <p333> <o333>}}");
        UpdateAction.execute(update, markLogicDatasetGraph);
        markLogicDatasetGraph.abort();
        permissions = markLogicDatasetGraph.getSPARQLUpdatePermissions();
        System.out.println(permissions.toString());
        assertFalse(permissions.get("test-perm").contains(Capability.UPDATE));
        assertTrue(permissions.get("test-perm").contains(Capability.READ));
kkanthet commented 9 years ago

Closing this issue as this is not a bug , mis-understood the functionality.