Docsity

Ontologies - Artificial Intelligence Programming - Lecture Slides | CS 662, Study notes of Computer Science

Toggle sidebar
bg1
Artificial Intelligence Programming
Ontologies
Chris Brooks
Department of Computer Science
University of San Francisco
Departmentof Computer Science — University of San Francisco – p. 1/??
16-2: 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 solve all of the
problems we are interested in.
•The process of building a knowledge base is referred to as
knowledge engineering
◦Many of the same principles as software engineering.
Departmentof Computer Science — University of San Francisco – p. 2/??
16-3: Knowledge Enginering
•The knowledge engineering process typically consists of the
following steps.
1. Determine the queries and types of facts that are
available/allowed
◦For example, will the agent need to select actions or
make conclusions, or just answer questions from a
human user?
◦Will we ask existential queries, or just universal queries?
2. Gather the relevant knowledge
◦Interview experts and find out how the domain works.
3. Select a vocabulary of classes, functions, predicates and
constants
◦This vocabulary is called an ontology
4. Encode general knowledge about the domain
◦Formally represent the knowledge gathered in step 2.
◦This may require revisiting step 3.
5. Encode specific queries or problems to be solved.
◦This may require returning to steps 3 and 4.
Departmentof Computer Science — University of San Francisco
16-4: Ontologies
•An ontology is a vocabulary that describes all of the objects of
interest in the domain and the relations between them.
◦All of the relevant knowledge about a problem we are
interested in.
•Ontolgies allow knowledge about a domain to be shared
between agents (including humans).
•This can allow knowledge to be reused more easily.
•Allows an agent to perform inference with its current knowledge.
Departmentof Computer Science — University of San Francisco – p. 4/??
16-5: Vocabulary
•An ontology consists of:
◦A set of concepts or classes
◦Pr ofessor(B rooks),∀x P rof essor(x)→U SF E mployee(x)
•Instances of these classes.
•Relations between classes of objects, sometimes called slots
or properties or roles.
◦Salary(B rooks, $500), N ame(Brooks, “C hris′′)
•Restrictions on slots (sometimes called facets)
◦∀x, y P r ofessor (x)∧Salary (x,y )→y < $1000
Departmentof Computer Science — University of San Francisco – p. 5/??
16-6: 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 of classes
that look like data members.
•However,slots have richer semantics than data members.
•A slot may attach to several classes at once.
•We can specify constraints on the values in a slotâ˘
A´
Zs range.
•Slots can exist without being assigned to a class.
Departmentof Computer Science — University of San Francisco
pf3

Partial preview of the text

Download Ontologies - Artificial Intelligence Programming - Lecture Slides | CS 662 and more Study notes Computer Science in PDF only on Docsity!

Artificial Intelligence Programming

Ontologies^ Chris Brooks

Department of Computer ScienceUniversity of San Francisco

Department of Computer Science — University of San Francisco – p. 1/

??

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 solve all of theproblems we are interested in. •^ The process of building a knowledge base is referred to as^ knowledge engineering

◦^ Many of the same principles as software engineering.

Department of Computer Science — University of San Francisco – p. 2/

??

Knowledge Enginering

-^ The knowledge engineering process typically consists of thefollowing steps. 1. Determine the queries and types of facts that are

available/allowed ◦^ For example, will the agent need to select actions ormake conclusions, or just answer questions from ahuman user? ◦^ Will we ask existential queries, or just universal queries?

  1. Gather the relevant knowledge

◦^ Interview experts and find out how the domain works.

  1. Select a vocabulary of classes, functions, predicates and

constants ◦^ This vocabulary is called an

ontology

  1. Encode general knowledge about the domain

◦^ Formally represent the knowledge gathered in step 2. ◦^ This may require revisiting step 3.

  1. Encode specific queries or problems to be solved.

◦^ This may require returning to steps 3 and 4.

Department of Computer Science — University of San Fra

Ontologies

-^ An ontology is a vocabulary that describes all of the objects ofinterest in the domain and the relations between 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 current knowledge.

Department of Computer Science — University of San Francisco – p. 4/

??

Vocabulary

-^ An ontology consists of:

◦^ A set of

concepts

or classes

◦^ P rof essor

(Brooks

),^ ∀

x P rof essor

(x)

U SF Employee

(x)

-^ Instances of these classes. •^ Relations between classes of objects, sometimes called

slots

or^ properties

or roles

◦^ Salary

(Brooks,

, N ame

(Brooks,

“Chris

′′^ )

-^ Restrictions on slots (sometimes called

facets

◦^ ∀

x, y P rof essor

(x)

∧^ Salary

(x, y

)^ →

y <

$1000 Department of Computer Science — University of San Francisco – p. 5/

??

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 of classesthat look like data members. •^ However, slots have richer semantics than data members. •^ A slot may attach to several classes at once. •^ We can specify constraints on the values in a slotâ ˘

A ´Zs range.

-^ Slots can exist without being assigned to a class.

Department of Computer Science — University of San Fra

Graphical Representations

-^ Logic is a very powerful representation language, but it can bedifficult for humans to work with. •^ In addition, the lack of structure between sentences in a KB canmake inference difficult. •^ A

semantic network

is a way to graphically represent and

reason about some logical concepts.

Department of Computer Science — University of San Francisco – p. 7/

??

Semantic Net example

-^ SisterOf

(M ary, John

-^ F emale

(M ary

•^ ∀

xF emale

(x)

P erson

(x)

-^ M ale

(John

•^ ∀

xM ale

(x)

P erson

(x)

•^ ∀

xP erson

(x)

M ammal

(x)

•^ ∀

xP erson

(x)

Def aultN umberOf Legs

(x,

-^ legs

(John,

Department of Computer Science — University of San Francisco – p. 8/

??

Inference in a Semantic Net

-^ Inference becomes easy in a semantic net; to answer questionsabout John, we follow the labeled edges emanating from the^ John

node. ◦^ This is the same sort of inference done by modern OOlanguages to resolve inheritance.

-^ Strengths: Knowledge is easily visualized, relationshipsbetween objects are clearer. •^ Weaknesses: only binary relations, no negation, disjunction, orexistential quantifiers.

◦^ We can extend semantic nets to include these features, butwe lose the transparency. ◦^ Instead, use a semantic net to model class/slot relations,and FOL (or something similar) to model rules.

Department of Computer Science — University of San Fra

Protege

-^ Protege is a Java-based graphical tool for constructingontologies. •^ Has a rich set of plugins for performing inference andvisualizing data. •^ Can export data in RDF and OWL for use with the SemanticWeb.

Department of Computer Science — University of San Francisco – p. 10/

??

Using Protege to build a simple ontology

-^ Let’s make a simple ontology to describe the USF CSdepartment. •^ We begin by asking

competency questions

  • these are

questions weâ ˘

A ´Zd like our KB to be able to answer.

◦^ Who is taking CS662? ◦^ Which professors teach classes on Monday? ◦^ How many students are taking both CS662 and CS601? ◦^ What classes should one take before taking CS662? ◦^ Which professors assign the most work?

Department of Computer Science — University of San Francisco – p. 11/

??

Classes

-^ As with OO design, we can work top-down, bottom-up, or in acombination of the two. •^ Letâ ˘

A ´Zs start by making a Person class.

-^ We can then subclass that to make Professors and Students. •^ Students have GradStudent and UndergradStudent subclasses. •^ Letâ ˘

A ´Zs also make a separate class representing courses.

Department of Computer Science — University of San Fran