These exercises sketch steps in a version of the Creanimate dialog system that uses the Semantic Web as its knowledge base.

Overview

Creanimate carried on example-driven dialogs with kids about animal form and function. The original system has a library of about 200 examples, with videos, illustrating different ways animal meet basic needs for survival and reproduction.

The goal of the project is to carry on such dialogs using examples from the web. Given an animal behavior, it should find related contrasting examples with other animals.

Resources

Exercises

Ontology Reader

Write an ontology reader to read OWL ontologies into MOP frames.

Specifically, define (load-owl-from-url url) and (load-owl-from-file url) to define a set of MOP frames, corresponding to the concept hierarchy in the OWL (or similar RDF) file at url or a local file.

Ontologies are mostly about class relationships and class restrictions on predicates, e.g., that the actor of a buying event has to be some kind of intelligent agent. These relationships can be asserted in the MOP framework with add-frame.

E.g., to say a tree is a plant:

(add-frame 'tree :type :mop :abstractions '(plant))

To say that buying is an event with human agents

(add-frame 'buy :type :mop
      :abstractions '(event)
      :slots '(:agent (:constraint human)))

Here's an example of possible output in this form for one part of Animals-tutorial-complete.owl in the demo OWL ontologies package here.

The OWL definition for animal is:

<owl:Class rdf:ID="Animal">
      <rdfs:subClassOf>
        <owl:Class rdf:ID="Living_thing"/>
      </rdfs:subClassOf>
      <owl:disjointWith>
        <owl:Class rdf:ID="Plant"/>
      </owl:disjointWith>
    </owl:Class>

This could be asserted in MOP form (leaving out the disjoint with plants aspect) as:

(add-frame 'animal :type :mop :abstractions '(living_thing))

The OWL definition of herbivore is a bit more complex because they want to say it's an animal that eats plants. This leads in OWL to a conjunction of two pieces of information: (1) the eats property for herbivores is constrained to plants (2) herbivores are animals.

<owl:Class rdf:ID="Herbivore">
      <owl:equivalentClass>
        <owl:Class>
          <owl:intersectionOf rdf:parseType="Collection">
            <owl:Restriction>
              <owl:allValuesFrom>
                <owl:Class rdf:about="#Plant"/>
              </owl:allValuesFrom>
              <owl:onProperty>
                <owl:ObjectProperty rdf:ID="eats"/>
    
              </owl:onProperty>
            </owl:Restriction>
            <owl:Class rdf:about="#Animal"/>
          </owl:intersectionOf>
        </owl:Class>
      </owl:equivalentClass>
    </owl:Class>

In MOP form, this is much much shorter (hence the reason for writing code to do this translation):

(add-frame 'herbivore :type :mop :abstractions (animal)
      :slots '((:eats (:constraint plant))))

To see what's been built so far, use show-memory. This function has a number of different arguments it can take, but the "magic" form to print all concepts with all their slots is:

(show-memory nil t t)

Make your code modular. Most of your functions should be very short and well-named and re-usable. The one annoyingly messy part is converting RDF strings into readable Lisp symbols.

Use net.aserve.client:do-http-request and your XML parser to access the URL and parse the XML.

Final warning: start simple. The agent ontology is pretty small and doesn't do any complicated. But full OWL (even OWL Lite) can have all kinds of nested relationships.

Encyclopedia of Life Stories

Find some good examples from the Encyclopedia of Life and represent them as Creanimate-like stories, using the animal/feature/behavior MOP instance format. Look for examples that have interesting compare-and-contrast connections.

Case Retriever

Implement a CBR matcher to retrieve closest contrasting cases from memory given a real or imaginary animal description, where contrasting is defined to mean matching closely on all slots but one. On that slot, the most dissimilar value is sought instead.

Dialog Manager

Implement a web based interface and dialog manager to carry on a coherent non-repeating Creanimate-style dialog with a user.

Faculty: Chris Riesbeck
Time: MWF: 11:00am-11:50am
Location: Tech LR 5

Contents

Important Links