Docsity

Building Ontologies for Artificial Intelligence: A Step-by-Step Guide, 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/??
11-0: Review of FOL
Some more FOL samples ...
Departmentof Computer Science —University of San Francisco – p.2/??
11-1: Knowledge Engineering
FOL gives us an answer to how to say things.
It doesn’t tell us what to say.
In large domains, this is the hard part.
We need to include enough knowledge to allow our
system to answer all queries of interest.
The process of building a knowledge base is referred to as
knowledge engineering.
Departmentof Computer Science —University of San Francisco – p.3/??
11-2: Knowledge Engineering
A knowledge engineering process typically consists of the
following steps:
1. Determine allowable queries and types of facts that will beavailable.
For example, will the agentneed to select actions or make conclusions, or just
answer questions?
2. Gather the relevant knowledge.
Interview experts, find out how the domain works
3. Select a vocabulary or predicates, functions, and constants.
This 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 that are to be solved.
Return to steps 3 and 4 as needed.
Departmentof Computer Science —University of San Francisco – p.4/??
11-3: Ontologies
An ontology is a vocabulary that describes all the objects
of interest in the domain and the relations between them.
Ontologies allow knowledge about a domain to be shared
between agents (including humans)
Allows knowledge to be re-used more easily..
Allows an agent to perform inference about current
knowledge.
Departmentof Computer Science —University of San Francisco – p.5/??
11-4: Vocabulary
An ontology consists of:
A set of concepts or classes
P rof essor(Brook s),∀x P rof essor(x)→
US F Employ ee(x)
Features or attributes of these classes, often called
slots or properties or roles.
Salary (Brooks, $500), N ame(Brooks,0C hris0)
Restrictions on slots (sometimes called facets)
∀x, y P rof essor(x)∧S alary(x, y)→x < $1000
Instances of classes.
Departmentof Computer Science —University of San Francisco – p.6/??
pf3

Partial preview of the text

Download Building Ontologies for Artificial Intelligence: A Step-by-Step Guide and more Study notes Computer Science in PDF only on Docsity!

Artificial Intelligence Programming

Ontologies

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

Review of FOL 11-0:

Some more FOL samples ... ?? Department of Computer Science — University of San Francisco – p.2/

Knowledge Engineering 11-1:

to say things. how FOL gives us an answer to to say. what It doesn’t tell us In large domains, this is the hard part. We need to include enough knowledge to allow our system to answer all queries of interest. The process of building a knowledge base is referred to as

. knowledge engineering ?? Department of Computer Science — University of San Francisco – p.3/

Knowledge Engineering 11-2:

A knowledge engineering process typically consists of the following steps: Determine allowable queries and types of facts that will be available. 1. For example, will the agent need to select actions or make conclusions, or just answer questions? Gather the relevant knowledge. 2. Interview experts, find out how the domain works Select a vocabulary or predicates, functions, and constants. 3.

. ontology This is called an Encode general knowledge about the domain. 4. Formally represent the knowledge gathered in step 2. This may require revisiting step 3. Encode specific queries or problems that are to be solved. 5. Return to steps 3 and 4 as needed. ?? Department of Computer Science — University of San Francisco – p.4/

Ontologies 11-3:

An ontology is a vocabulary that describes all the objects of interest in the domain and the relations between them. Ontologies allow knowledge about a domain to be shared between agents (including humans) Allows knowledge to be re-used more easily.. Allows an agent to perform inference about current knowledge.

Vocabulary 11-4:

An ontology consists of: classes or concepts A set of → )x( x P rof essor ∀ ,) Brooks( P rof essor )x( U SF Employee Features or attributes of these classes, often called

. roles or properties or slots )′ Chris ′ Brooks,( , N ame$500) Brooks,( Salary ) facets Restrictions on slots (sometimes called $1000 x < → ) x, y( Salary ∧ )x( x, y P rof essor ∀ Instances of classes.

Ontologies vs OO design 11-5:

Classes are the 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’s range. Slots can exist without being assigned to a class. ?? Department of Computer Science — University of San Francisco – p.7/

Graphical representations 11-6:

Logic is a very powerful representation language, but it can be difficult for humans to work with. In addition, the lack of structure between sentences in a KB can make inference difficult. is a way to graphically represent and semantic network A reason about some logical concepts. ?? Department of Computer Science — University of San Francisco – p.8/

Semantic Net example 11-7:

) M ary, John( SisterOf ) M ary( F emale )x( P erson → )x( xF emale ∀ ) John( M ale )x( P erson → )x( xM ale ∀ )x( M ammal → )x( xP erson ∀

  1. x,( Def aultN umberOf Legs → )x( xP erson ∀
  2. John,( legs ?? Department of Computer Science — University of San Francisco – p.9/

Inference in a Semantic Net 11-8:

Inference becomes easy in a semantic net; to answer questions about John, we follow the labeled edges node. John emanating from the This is the same sort of inference done by modern OO languages to resolve inheritance. Strengths: Knowledge is easily visualized, relationships between objects are clearer. Weaknesses: only binary relations, no negation, disjunction, or existential quantifiers. We can extend semantic nets to include these features, but we lose the transparency. Instead, use a semantic net to model class/slot relations, and FOL (or something similar) to model ?? Department of Computer Science — University of San Francisco – p.10/ rules.

Protege 11-9:

Protege is a Java-based graphical tool for constructing ontologies. Has plugins for Jess (a rule-based inference engine) and Jython Can export data in RDF and OWL for use with the Semantic Web.

Using Protege to build a simple 11-10:

ontology

Let’s make a simple ontology to describe the USF CS department.

  • these are competency questions We begin by asking questions we’d 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?