Skip to content

Commit

Permalink
Adding policy
Browse files Browse the repository at this point in the history
  • Loading branch information
phochste committed Oct 6, 2024
1 parent b7ae952 commit 9d3b9fa
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions test/pure/policy.n3s
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
@prefix : <urn:example:> .
@prefix log: <http://www.w3.org/2000/10/swap/log#> .

:PolicyA
a :Policy ;
:prohibition _:A.

_:A :action :TalkLoudly.

# Prohibition action X = Duty NOT (action X)
(_:X _:Y _:Z) log:onNegativeSurface {
_:X
a :Policy ;
:prohibition _:Y .
_:Y :action _:Z .

(_:New) log:onNegativeSurface {
_:X :duty _:New .
() log:onNegativeSurface {
_:New :action _:Z .
} .
} .
} .

# Test NOT prohibition X
(_:Pol _:X) log:onNegativeSurface {

() log:onNegativeSurface {
_:Pol
a :Policy ;
:prohibition _:X .
_:X :action :TalkLoudly . # Change this to a double negation to see the body of this negative surface is false
} .

() log:onNegativeSurface {
:test :is true .
} .
} .

# Query
() log:onNegativeSurface {
:test :is true.
() log:onNegativeAnswerSurface {
:test :is true.
}
}.

0 comments on commit 9d3b9fa

Please sign in to comment.