# --------------
# Beetle example
# --------------
#
# See https://en.wikipedia.org/wiki/Disjunction_elimination

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix : <http://example.org/#>.

# beetle is a car
:beetle a :Car.

# all cars are green or blue
(_:A) log:onNegativeSurface [ log:graph (
    [ log:triple (_:A rdf:type :Car)]
    [ log:triple (() log:onNegativeSurface [ log:graph (
        [ log:triple (_:A :is :green)]
    )])]
    [ log:triple (() log:onNegativeSurface [ log:graph (
        [ log:triple (_:A :is :blue)]
    )])]
)].

# green things are beautiful
(_:A) log:onNegativeSurface [ log:graph (
    [ log:triple (_:A :is :green)]
    [ log:triple (() log:onNegativeSurface [ log:graph (
        [ log:triple (_:A :is :beautiful)]
    )])]
)].

# blue things are beautiful
(_:A) log:onNegativeSurface [ log:graph (
    [ log:triple (_:A :is :blue)]
    [ log:triple (() log:onNegativeSurface [ log:graph (
        [ log:triple (_:A :is :beautiful)]
    )])]
)].

# query
(_:S) log:onNegativeSurface [ log:graph (
    [ log:triple (_:S :is :beautiful)]
    [ log:triple (() log:onNegativeAnswerSurface [ log:graph (
        [ log:triple (_:S :is :beautiful)]
    )])]
)].
