Download Knowledge Engineering and Ontologies in AI: USF CS Department Perspective - Prof. Christop and more Study notes Computer Science in PDF only on Docsity!
Artificial Intelligence
Programming
Ontologies^ Chris Brooks
Department of Computer ScienceUniversity of San Francisco
Knowledge Engineering Logic provides one answer to the question of
how
to say
things. It does not tell us
what
to say.
Typically, this is the hard part. We want to give our agent enough knowledge to solveall of the problems we are interested in. The process of building a knowledge base is referred toas^
knowledge engineering Many of the same principles as software engineering.
Department of Computer Science — University of San Francisco – p.1/
??
Knowledge Enginering The knowledge engineering process typically consists ofthe following steps.1. Determine the queries and types of facts that areavailable/allowed
For example, will the agent need to select actionsor make conclusions, or just answer questions froma human user? Will we ask existential queries, or just universalqueries?
- Gather the relevant knowledge
Interview experts and find out how the domainworks.
Department of Computer Science — University of San Fra
Knowledge Enginering The knowledge engineering process typically consists ofthe following steps.^ 3. Select a vocabulary of classes, functions,predicates and constants
This vocabulary is called an
ontology
- Encode general knowledge about the domain^ Formally represent the knowledge gathered in step2.^ This may require revisiting step 3. 5. Encode specific queries or problems to be solved.^ This may require returning to steps 3 and 4.
Department of Computer Science — University of San Francisco – p.3/
??
Ontologies An ontology is a vocabulary that describes all of theobjects of interest in the domain and the relationsbetween them.^ All of the relevant knowledge about a problem we areinterested in. Ontolgies allow knowledge about a domain to be sharedbetween agents (including humans). This can allow knowledge to be reused more easily. Allows an agent to perform inference with its currentknowledge.
Department of Computer Science — University of San Francisco – p.4/
??
Vocabulary An ontology consists of:^ A set of
concepts
or
classes
Guitarist
(GeorgeHarrison
),^ ∀
x Guitarist
(x)
M usician
(x)
Instances of these classes. Relations between classes of objects, sometimes called slots
or
properties
or^
roles
perf orms
(Beatles, W hiteAlbum
), containedOn
(RockyR
Restrictions on properties (sometimes called constraints
∀x, y Artist
(x)
∧^ Song
(y)
∧^ containedOn
(y, z
)^ ∧
perf orms
(x, y
)^ →
perf ormsOn
(x, z
) Department of Computer Science — University of San Fra
Ontologies vs OO design Classes are a primary focus of ontology design. In many ways, this looks like object-oriented design. We have classes and subclasses, and properties ofclasses that look like data members. However, properties have richer semantics than datamembers. A property may attach to several classes at once, andhave subproperties. We can specify constraints on the values in a slot’srange. Properties can exist without being assigned to a class.
Department of Computer Science — University of San Francisco – p.6/
??
Ontology tools An popular means for assisting in knowledgeengineering is the use of GUI-based tools. Details of logic and inference are hidden from the user. Protege is one of the more well-known ontologydeveloment tools.
Department of Computer Science — University of San Francisco – p.7/
??
OWL Web Ontology Language (OWL) is an XML-basedlanguage for representing ontologies. Built on top of RDF Encodes a
description logic Decidable subset of first-order logic. We’ll be using a graphical tool (Protege) that uses OWLas its underlying representation.
Department of Computer Science — University of San Fra
Types of OWLs OWL Lite^ Does not allow cardinality (except 0 and 1)^ Primarily classes, simple constraints/rules^ Efficient inference mechanisms exist OWL DL^ Complete and decidable, but more expressive.^ Inference mechanisms exist.^ This is what we’ll be using. OWL Full^ Allows metaclasses, richer reasoning about classes^ No inference mechanisms exist for all of OWL Full.
Department of Computer Science — University of San Francisco – p.9/
??
Uses of OWL Organization and indexing of journals and scientificliterature Human Genome Project (and bioinformatics in general) Data integration between DBs in an enterprise Automated Web Service description and composition and others ...
Department of Computer Science — University of San Francisco – p.10/
??
The Pizza Tutorial The pizza tutorial provides a nice tour of the issuesinvolved in creating an ontology in Protege with OWL. We begin by asking
competency questions
questions we’d like our KB to be able to answer.
What toppings are on a Margherita pizza? Is the Americana pizza vegetarian? What can I put on my pizza to make it spicy? What pizzas have Tomato on them?
Department of Computer Science — University of San Fran
Reasoners As your ontology gets large, it can be difficult tomaintain:^ Do you have the hierarchy right?^ Are there contradictions?^ Are there other relations that are entailed? A big advantage of using this sort of tool is the ability toperform this inference automatically. Tools for doing this are known as reasoners. We’ll be using a particular reasoner known as RACER.
Department of Computer Science — University of San Francisco – p.18/
??
Reasoners We can use the reasoner to:^ Check consistency^ Classify the taxonomy^ Infer class membership Let’s add an inconsistent class: InconsistentTopping^ Subclass of Cheese^ Restriction: must be a Veggie. Run the reasoner.
Department of Computer Science — University of San Francisco – p.19/
??
Necessary and Sufficient Condition So far, we’ve only specificed
necessary
conditions.
This is not enough to show that something must be amember of a particular class. Create a CheesePizza class Add a necessary and Sufficient restriction - has aCheese topping.
This is now a
definition
with a Cheese topping. Run RACER again.
Department of Computer Science — University of San Fran
Universal restrictions We specificed that a Margherita pizza must haveTomato and Mozzarella, but not that those were the onlythings it could have. To do this, we use universal restrictions. Create a VeggiePizza. Under necessary and sufficient, indicate that alltoppings must be veggie or cheese. Run RACER again.
Department of Computer Science — University of San Francisco – p.21/
??
Open World Reasoning Why is Margherita (and Soho) not suclassed as Veggie? Protege and OWL use open-world reasoning^ Can’t assume something is false just because it’s notstated to be true. Margherita could have other toppings. Add a closure axiom to MargheritaPizza. Use the widget to add closure axioms for Soho andAmericana.
Department of Computer Science — University of San Francisco – p.22/
??
Value Partitions Use the Wizard to create a SpicynessValuePartition Subclass this to get Hot, Mild, Medium Add hasSpiciness property Use the PropertyRestrictions wizard.
Department of Computer Science — University of San Fran
Cardinality We can also specify the number of toppings a pizzamust have. Create a CrowdedPizza Necessary and Sufficient: minimum cardinality: 3.
Department of Computer Science — University of San Francisco – p.24/
??
Individuals We can then add individuals using the individuals tab. the Forms tab lets us specify how individuals should bedisplayed. Add a NamedPizza that has tomato and Mozzarella Run the reasoner again.
Department of Computer Science — University of San Francisco – p.25/
??
Querying the KB The query pane lets us create, save and retrieve queries We can specify either AND or OR. Try finding all pizzas that have a cheese topping.
Department of Computer Science — University of San Fran