Skip to content

Commit

Permalink
refreshing
Browse files Browse the repository at this point in the history
  • Loading branch information
josd committed Nov 15, 2023
1 parent e2b0466 commit 9fd87a4
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 0 deletions.
5 changes: 5 additions & 0 deletions legacy/acp/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---------------------
Access control policy
---------------------

An example to test access controll policies.
61 changes: 61 additions & 0 deletions legacy/acp/acp.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix list: <http://www.w3.org/2000/10/swap/list#>.
@prefix rule: <http://eyereasoner.github.io/rule#>.
@prefix : <urn:example:>.

:test1
:policy :PolicyX;
:has :A, :B, :C.

:PolicyX
a :Policy;
:allOf :A, :B;
:anyOf :C;
:noneOf :D.

[] a rule:BackwardRule;
rule:premise (
(_:Test :policy _:Pol)
(_:Pol rdf:type :Policy)
((((_:Pol :allOf _:Field)) ((_:Test :has _:Field))) log:forAllIn _:X)
);
rule:conclusion (
(_:Pol :pass :allOfTest)
).

[] a rule:BackwardRule;
rule:premise (
(_:Test :policy _:Pol)
(_:Pol rdf:type :Policy)
((_:Field ((_:Pol :anyOf _:Field) (_:Test :has _:Field)) _:List) log:collectAllIn _:X)
(_:List list:length _:L)
(_:L log:notEqualTo 0)
);
rule:conclusion (
(_:Pol :pass :anyOfTest)
).

[] a rule:BackwardRule;
rule:premise (
(_:Test :policy _:Pol)
(_:Pol rdf:type :Policy)
((_:Field ((_:Pol :noneOf _:Field) (_:Test :has _:Field)) _:List) log:collectAllIn _:X)
(_:List list:length _:L)
(_:L log:equalTo 0)
);
rule:conclusion (
(_:Pol :pass :noneOfTest)
).

[] a rule:QueryRule;
rule:premise (
(_:Pol rdf:type :Policy)
(_:Pol :pass :allOfTest)
(_:Pol :pass :anyOfTest)
(_:Pol :pass :noneOfTest)
);
rule:conclusion (
(:test :for _:Pol)
(:test :is true)
).
2 changes: 2 additions & 0 deletions legacy/acp/out/acp.ttl.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<urn:example:test> <urn:example:for> <urn:example:PolicyX>.
<urn:example:test> <urn:example:is> true.
2 changes: 2 additions & 0 deletions legacy/acp/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash -x
eye --quiet --nope --legacy acp.ttl --output out/acp.ttl.out

0 comments on commit 9fd87a4

Please sign in to comment.