# ----------
# Witch Case
# ----------
#
# Original http://www.w3.org/2000/10/swap/test/reason/witch.n3

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

#[1] \forall x, BURNS(x) /\ WOMAN(x) => WITCH(x)
[ log:graph (
    [ log:triple (var:x rdf:type :BURNS)]
    [ log:triple (var:x rdf:type :WOMAN)]
)] log:implies [ log:graph (
    [ log:triple (var:x rdf:type :WITCH)]
)].

#[2] WOMAN(GIRL)
:GIRL rdf:type :WOMAN.

#[3] \forall x, ISMADEOFWOOD(x) => BURNS(x)
[ log:graph (
    [ log:triple (var:x rdf:type :ISMADEOFWOOD)]
)] log:implies [ log:graph (
    [ log:triple (var:x rdf:type :BURNS)]
)].

#[4] \forall x, FLOATS(x) => ISMADEOFWOOD(x)
[ log:graph (
    [ log:triple (var:x rdf:type :FLOATS)]
)] log:implies [ log:graph (
    [ log:triple (var:x rdf:type :ISMADEOFWOOD)]
)].

#[5] FLOATS(DUCK)

:DUCK rdf:type :FLOATS.

#[6] \forall x,y FLOATS(x) /\ SAMEWEIGHT(x,y) => FLOATS(y)
[ log:graph (
    [ log:triple (var:x rdf:type :FLOATS)]
    [ log:triple (var:x :SAMEWEIGHT var:y)]
)] log:implies [ log:graph (
    [ log:triple (var:y rdf:type :FLOATS)]
)].

# and, by experiment
# [7] SAMEWEIGHT(DUCK,GIRL)
:DUCK :SAMEWEIGHT :GIRL.

# query
[ log:graph (
    [ log:triple (var:S rdf:type :WITCH)]
)] log:impliesAnswer [ log:graph (
    [ log:triple (var:S rdf:type :WITCH)]
)].
