| 1 |
# -------------- |
| 2 |
# Beetle example |
| 3 |
# -------------- |
| 4 |
# |
| 5 |
# See https://en.wikipedia.org/wiki/Disjunction_elimination |
| 6 |
|
| 7 |
@prefix log: <http://www.w3.org/2000/10/swap/log#>. |
| 8 |
@prefix : <urn:example:>. |
| 9 |
|
| 10 |
# beetle is a car |
| 11 |
:beetle a :Car. |
| 12 |
|
| 13 |
# all cars are green or blue |
| 14 |
(_:A) log:onNegativeSurface { |
| 15 |
_:A a :Car. |
| 16 |
() log:onNegativeSurface { |
| 17 |
_:A :is :green. |
| 18 |
}. |
| 19 |
() log:onNegativeSurface { |
| 20 |
_:A :is :blue. |
| 21 |
}. |
| 22 |
}. |
| 23 |
|
| 24 |
# green things are beautiful |
| 25 |
(_:A) log:onNegativeSurface { |
| 26 |
_:A :is :green. |
| 27 |
() log:onNegativeSurface { |
| 28 |
_:A :is :beautiful. |
| 29 |
}. |
| 30 |
}. |
| 31 |
|
| 32 |
# blue things are beautiful |
| 33 |
(_:A) log:onNegativeSurface { |
| 34 |
_:A :is :blue. |
| 35 |
() log:onNegativeSurface { |
| 36 |
_:A :is :beautiful. |
| 37 |
}. |
| 38 |
}. |
| 39 |
|
| 40 |
# query |
| 41 |
() log:onNegativeSurface { |
| 42 |
:beetle :is :beautiful. |
| 43 |
() log:onNegativeAnswerSurface { |
| 44 |
:beetle :is :beautiful. |
| 45 |
}. |
| 46 |
}. |