Docsity

Lecture Slides on Ontologies, Knowledge Engineering | CS 662, Study notes of Computer Science

Partial preview of the text

Download Lecture Slides on Ontologies, Knowledge Engineering | 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/

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/

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/

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/

Slots

-^ Now we can start to fill in the slots. •^ Letâ ˘

A ´Zs start with Student ◦^ Students have a Name, an ID, and some courses theyâ ˘

A ´Zre

taking. ◦ Letâ ˘

A ´Zs also add a â ˘

A ´Zyearâ ˘

A ´Z slot to Undergrads- this

can be Freshman, Sophomore,Junior, or Senior

-^ Next, we can do Professors.

◦^ Professors have a name, a salary, and some courses theyteach.^ •

Wait! Maybe name should be in person instead of studentand professor. ◦^ Then do course - course should have an â ˘

A ´Zinverse

slotâ ˘

A ´Zfor taughtby and enrolls

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

Instances

-^ Now we can begin to populate our knowledge base withinstances of the classes weâ ˘

A ´Zve created.

-^ To begin, add â ˘

A ´ZBrooksâ ˘

A ´Z as a Professor with salary

$100,000 (I wish!) • We can create a course object on the fly to represent CS662. • Next, create a student (use your own name).

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

Querying the KB

-^ The query pane lets us create, save and retrieve queries •^ We can specify either AND or OR. •^ Try finding all students enrolled in CS662.

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

Extending the KB

-^ A KB is only as useful as the data thatâ ˘

A ´Zs in it.

-^ Add instances for Wolber and Parr. •^ Add courses CS601, CS690, and CS112. •^ Add more students. •^ Add a class called Sysadmins and populate it with Alex. •^ Finally, add a class called RA - it should have USFEmployeeand GradStudent as superclasses.

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