# ---------------------
# Backward rule example
# ---------------------
#
# See https://www.w3.org/2000/10/swap/doc/tutorial-1.pdf page 17

@prefix math: <http://www.w3.org/2000/10/swap/math#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.
@prefix : <http://example.org/#>.

# something is more interesting if it is greater
[ log:graph (
    [ log:triple (var:X :moreInterestingThan var:Y)]
)] log:isImpliedBy [ log:graph (
    [ log:triple (var:X math:greaterThan var:Y)]
)].

# query
[ log:graph (
    [ log:triple (5 :moreInterestingThan 3)]
)] log:impliesAnswer [ log:graph (
    [ log:triple (:test :is true)]
)].
