-
Notifications
You must be signed in to change notification settings - Fork 0
/
dtou-lang3-reasoning-conflict1.n3s
84 lines (72 loc) · 1.89 KB
/
dtou-lang3-reasoning-conflict1.n3s
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
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix list: <http://www.w3.org/2000/10/swap/list#> .
@prefix : <http://example.org/ns#>.
######
# Reasoning rules
######
# RelatedDataAppInput
(_:usage _:data _:app _:input _:ai _:u) log:onNegativeSurface {
_:usage a :UsageContext;
:app _:ai.
_:ai :policy _:app.
_:app a :AppPolicy;
:input_spec _:input.
_:data a :Data;
:uri _:u.
_:input :data _:u.
() log:onNegativeSurface {
_:m a :RelatedDataAppInput;
:usage _:usage;
:data _:data;
:app _:app;
:input _:input.
}.
}.
## Real Type (of Tagging) -- the type without any subtype. This is a helper for OutputTagging.
(_:x _:T) log:onNegativeSurface {
_:x a :Tagging;
:type _:T.
(_:t2 _:scope) log:onPositiveSurface {
(
()
{
_:x :type _:t2.
_:t2 rdfs:subClassOf _:T.
}
()
) log:collectAllIn _:scope.
}.
() log:onNegativeSurface {
_:x :real_type _:T.
}.
}.
# UnsatisfiedRequirement
(_:x _:data _:input _:policy _:requirement _:T _:N) log:onNegativeSurface {
_:x a :RelatedDataAppInput;
:data _:data;
:input _:input.
_:data :policy _:policy.
_:policy :requirement _:requirement.
_:requirement
:real_type _:T;
:name _:N.
# # Won't work, because RDF Surfaces hold open world asumption, and negation/negative surface is also in this sense... Patrick suggested using N3's scoped negation instead, as shown below.
# (_:provide) log:onNegativeSurface {
# _:input :provide _:provide.
# _:provide
# :type _:T;
# :name _:N.
# }.
(_:provide _:scope) log:onPositiveSurface {
( () { _:input :provide _:provide. _:provide :type _:T; :name _:N} ()) log:collectAllIn (_:scope 2).
}.
() log:onNegativeSurface {
_:m a :UnsatisfiedRequirement;
:input _:input;
:data _:data;
:type _:T;
:name _:N.
}.
}.
:UnsatisfiedRequirement rdfs:subClassOf :Conflict.