-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacp.trig
89 lines (70 loc) · 1.54 KB
/
acp.trig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# -----------------------------
# Access control policy example
# -----------------------------
@prefix list: <http://www.w3.org/2000/10/swap/list#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.
@prefix : <http://example.org/#>.
:test1 :policy :PolicyX;
:has :A, :B, :C.
:PolicyX a :Policy;
:allOf :A, :B;
:anyOf :C;
:noneOf :D.
_:bng_1 log:isImpliedBy _:bng_2.
_:bng_1 {
var:Pol :pass :allOfTest.
}
_:bng_2 {
var:Test :policy var:Pol.
var:Pol a :Policy.
(_:bng_3 _:bng_4) log:forAllIn var:X.
}
_:bng_3 {
var:Pol :allOf var:Field.
}
_:bng_4 {
var:Test :has var:Field.
}
_:bng_5 log:isImpliedBy _:bng_6.
_:bng_5 {
var:Pol :pass :anyOfTest.
}
_:bng_6 {
var:Test :policy var:Pol.
var:Pol a :Policy.
(var:Field _:bng_7 var:List) log:collectAllIn var:X.
var:List list:length var:L.
(var:L) log:notEqualTo (0).
}
_:bng_7 {
var:Pol :anyOf var:Field.
var:Test :has var:Field.
}
_:bng_8 log:isImpliedBy _:bng_9.
_:bng_8 {
var:Pol :pass :noneOfTest.
}
_:bng_9 {
var:Test :policy var:Pol.
var:Pol a :Policy.
(var:Field _:bng_10 var:List) log:collectAllIn var:X.
var:List list:length var:L.
(var:L) log:equalTo (0).
}
_:bng_10 {
var:Pol :noneOf var:Field.
var:Test :has var:Field.
}
# query
_:bng_11 log:query _:bng_12.
_:bng_11 {
var:Pol a :Policy.
var:Pol :pass :allOfTest.
var:Pol :pass :anyOfTest.
var:Pol :pass :noneOfTest.
}
_:bng_12 {
:test :for var:Pol.
:test :is true.
}