@prefix : <http://example.org/#>.

# beetle is a car
:beetle a :Car.

# all cars are green or blue
{
    ?A a :Car.
} => ($ {
    ?A :is :green.
} {
    ?A :is :blue.
} $).

# green things are nice or pretty
{
    ?A :is :green.
} => ($ {
    ?A :is :nice.
} {
    ?A :is :pretty.
} $).

# pretty things are beautiful
{
    ?A :is :pretty.
} => {
    ?A :is :beautiful.
}.

# cars are not beautiful
{
    ?A a :Car.
} => {
    {
        ?A :is :beautiful.
    } => ($ $).
}.

# blue things are beautiful
{
    ?A :is :blue.
} => {
    ?A :is :beautiful.
}.

# query
{
    ?S :is ?O.
} =^ {
    ?S :is ?O.
}.
