1 dr alexiei dingli introduction to web science modelling the sw

56
1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

Upload: lora-ray

Post on 26-Dec-2015

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

1

Dr Alexiei Dingli

Introduction to Web Science

Modelling the SW

Page 2: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

2

• Acquire

• Model

• Reuse

• Retrieve

• Publish

• Maintain

Six challenges of the Knowledge Life Cycle

Page 3: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

3

• Various ways ...

– Variables– Data Structures– Files– Databases– Networks– Ontologies

How do we model knowledge?

Page 4: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

4

What is an Ontology? (1)

Page 5: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

5

An ontology is explicit formal specification of the terms in a domain and the relations

amongst them.

What is an Ontology? (2)

Page 6: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

6

An ontology is explicit formal specification of the terms in a domain and the relations

amongst them.

A bunch of impressive words, but what do they mean?

What is an Ontology? (3)

Page 7: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

7

Why develop an Ontology? (1)

Page 8: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

8

• Shift in recent years from– AI experts to Domain experts– Became common on the WWW– Range from …

• Taxonomies – E.g. categorising websites such as Yahoo

• Categorisations of Products– E.g. such as Amazon

Why develop an Ontology? (2)

Page 9: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

9

– To achieve this we have• RDF

– Encodes knowledge on the web– Makes it accessible by agents

• OWL– Extends RDF with more expressive constructs– Facilitates agent’s interaction

Why develop an Ontology? (3)

Page 10: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

10

• Many disciplines have standard ontologies – Used by domain experts– To share and annotate information

• Medicine– SNOMED (Systemized Nomenclature of Medicine)– Unified Medical Language System

Why develop an Ontology? (4)

Page 11: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

11

• An ontology defines a common vocabulary for researchers who need to share information in a domain

• It includes machine-interpretable definitions of basic concepts in the domain and relations among them

In simple terms …

Page 12: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

12

• To share common understanding of the structure of information among people or software agents

• To enable reuse of domain knowledge

• To make domain assumptions explicit

• To separate domain knowledge from the operational knowledge

• To analyze domain knowledge

Why would you develop an Ontology?

Page 13: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

13

• Suppose several different Web sites contain medical information or provide medical e-commerce services

• If these Web sites share and publish the same underlying ontology of the terms they all use, then computer agents can extract and aggregate information from these different sites

• The agents can use this aggregated information to answer user queries or as input data to other applications.

Sharing common understanding

Page 14: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

14

• Models for many different domains need to represent the notion of time

• This representation includes the notions of time intervals, points in time, relative measures of time, and so on

• If one group of researchers develops such an ontology in detail, others can simply reuse it for their domains

• Additionally, if we need to build a large ontology, we can integrate several existing ontologies describing portions of the large domain

Enabling reuse of domain knowledge

Page 15: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

15

• The implementation of the ontology makes it possible to change these assumptions easily if our knowledge about the domain changes

• Hard-coding assumptions about the world in programming-language code makes these assumptions not only hard to find and understand but also hard to change, in particular for someone without programming expertise

• In addition, explicit specifications of domain knowledge are useful for new users who must learn what terms in the domain mean

Making explicit domain assumptions

Page 16: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

16

• We can describe a task of configuring a product from its components according to a required specification

• Implement a program that does this configuration independent of the products and components themselves

• We can then develop an ontology of PC-components and characteristics and apply the algorithm to configure made-to-order PCs

Separating the domain knowledge from the operational knowledge

Page 17: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

17

• Formal analysis of terms is extremely valuable when both

– attempting to reuse existing ontologies

– extending them

Analysing domain knowledge

Page 18: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

18

• Often an ontology of the domain is not a goal in itself

• Similar to defining a set of data and their structure for other programs to use

• Problem-solving methods, domain-independent applications, and software agents use ontologies and knowledge bases built from ontologies as data

What would you do with an ontology?

Page 19: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

19

• An ontology of – wine and food

• This ontology can then be used as a basis for some application in a suite of restaurant-managing tools: – Create wine suggestions for the menu of the day – Answer queries of waiters and customers – Analyze an inventory list of a wine cellar and suggest which

wine categories to expand and which particular wines to purchase for upcoming menus or cookbooks

Example usage

Page 20: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

20

• Object-oriented programming – centers primarily around methods on classes

– programmer makes design decisions based on the operational properties of a class

– A wheel can be a subclass in a class car

• Ontology designer – makes decisions based on the structural properties of a

class

– a class structure and relations among classes in an ontology are different from the structure for a similar domain in an object-oriented program

– A wheel is not a kind-of car!

Different from OO programming

Page 21: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

21

• Ontology : formal explicit description of

concepts in a domain

• Classes : concepts

• Slots : properties, attributes, roles

• Facets : restrictions on roles

• Knowledgebase : Ontology + Instance

Terminology

Page 22: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

22

• Describe concepts in the domain– E.g. a class of wines represents all wines

• Specific wines are instances of this class– E.g. a Bordeaux wine is an instance of  the class of Bordeaux

wines

• A class can have subclasses that represent concepts that are more specific than the superclass– E.g. we can divide the class of all wines into red, white, and rosé

wines– Alternatively, we can divide a class of all wines into sparkling and

non-sparkling wines. 

Classes

Page 23: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

23

• Describe properties of classes and instances– E.g. Château Lafite Rothschild Pauillac wine has a full body; it

is produced by the Château Lafite Rothschild winery– We have two slots describing the wine in this example:

• the slot body with the value full

• the slot maker with the value Château Lafite Rothschild winery

– At the class level, we can say that instances of the class Wine will have slots describing their flavor, body, sugar level, the maker of the wine and so on.

Slots

Page 24: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

24

1. Determine the domain and scope of the ontology

2. Defining classes in the ontology

3. Arranging the classes in a taxonomic (subclass–superclass) hierarchy

4. Defining slots and describing allowed values for these slots

5. Creating instances

Steps to create an ontology …

Page 25: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

25

• No one correct way to model a domain, there are always viable alternatives– The best solution almost always depends on the

application that you have in mind and the extensions that you anticipate

• Ontology development is necessarily an iterative process

• Concepts in the ontology should be close to objects (physical or logical) and relationships in your domain of interest– E.g. nouns (objects) or verbs (relationships)

Rules to create an ontology

Page 26: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

26

• What is the domain that the ontology will cover?

• For what  we are going to use the ontology?

• For what types of questions the information in the ontology should provide answers?

• Who will use and maintain the ontology?

Step 1: Determine the domain and scope of the ontology

Page 27: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

27

• Consider the ontology of wine and food …

– Representation of food and wines is the domain of the ontology

– We will use this ontology for the applications that suggest good combinations of wines and food

• The concepts describing different types of wines, main food types, the notion of a good combination of wine and food and a bad combination will figure into our ontology

• It is also unlikely that the ontology will include concepts for managing inventory in a winery or employees in a restaurant even though these concepts are somewhat related to the notions of wine and food

Step 1: Example (1)

Page 28: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

28

• But if it is used …

– to assist in natural-language processing of articles in wine magazines, it may be important to include synonyms and part-of-speech information for concepts in the ontology

– to help restaurant customers decide which wine to order, we need to include retail-pricing information

– for wine buyers in stocking a wine cellar, wholesale pricing and availability may be necessary

Step 1: Example (2)

Page 29: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

29

• Sketch a list of questions that a knowledge base based on the ontology should be able to answer …

• Does the ontology contain enough information to answer these types of questions?

• Do the answers require a particular level of detail or representation of a particular area?

• These competency questions are just a sketch and do not need to be exhaustive.

How to check its competence?

Page 30: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

30

• In the wine and food domain, the following are the possible competency questions …

– Which wine characteristics should I consider when choosing a wine?– Is Bordeaux a red or white wine?– Does Cabernet Sauvignon go well with seafood?– What is the best choice of wine for grilled meat?– Which characteristics of a wine affect its appropriateness for a dish?– Does a bouquet or body of a specific wine change with vintage year?– What were good vintages for Napa Zinfandel?

• Judging from this list of questions, the ontology will include the information on various wine characteristics and wine types, vintage years—good and bad ones—classifications of foods that matter for choosing an appropriate wine, recommended combinations of wine and food

Example competency questions

Page 31: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

31

• Check what others have done …– Refine – Extend it

• Might be useful if our system needs to interact with other applications that already use a particular ontology

• Even if the ontology is in a different formalism, most applications can convert from one to the other

Can we reuse existing ontologies?

Page 32: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

32

• If a French wines ontology already exists …

– Import this knowledge base and the ontology on which it is based

– We will have not only the classification of French wines but also wine characteristics used to distinguish and describe the wines

– Lists of wine properties may already be available from commercial Web sites

Reuse Example

Page 33: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

33

• Useful to write down a list of all terms we would like either to make statements about or to explain to a user– What are the terms we would like to talk about?

– What properties do those terms have?

– What would we like to say about those terms?

• E.g. important wine terms include …– wine, grape, winery, location, a wine’s color, body, flavor and sugar

content; different types of food, such as fish and red meat; subtypes of wine such as white wine, and so on. Initially,

Enumerate important terms in an ontology (1)

Page 34: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

34

• It is important to get a comprehensive list of terms without worrying about overlap between concepts

• they represent …– relations among the terms

– any properties that the concepts may have

– whether the concepts are classes or slots

• Typically, we create a few definitions of the concepts in the hierarchy and then  continue by describing properties of these concepts and so on.

• This is the most important  step in the ontology-design process!

Enumerate important terms in an ontology (2)

Page 35: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

35

• Three approaches– Top Down

• Start from most general concepts and specialise• Wine -> White, Red, Rose

– Bottom Up• Define specific class and group into generic concepts• White, Red, Rose -> Wine

– Combination

• None of the methods are better than the other

Step 2: Define the classes and the class hierarchy

Page 36: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

36

• Select the terms that describe objects having independent existence rather than terms that describe these objects– These terms will be classes – We organize the classes into a hierarchical by

asking if by being an instance of one class, the object will necessarily (i.e., by definition) be an instance of some other class

Step 3 : From the enumeration mentioned earlier …

Page 37: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

37

• Create the internal structure (the properties)

• E.g. a wine’s color, body, flavor and sugar content and location of a winery

Step 4: Define the properties of classes (slots)

Page 38: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

38

• “intrinsic” – properties such as the flavor of a wine

• “extrinsic” – properties such as a wine’s name, and area it comes

from

• Parts– if the object is structured; these can be both physical

and abstract “parts” – e.g., the courses of a meal

• Relationships to other individuals – these are the relationships between individual members

of the class and other items – e.g. the maker of a wine, representing a relationship

between a wine and a winery, and the grape the wine is made from

Different kinds of slots …

Page 39: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

39

• All subclasses of a class inherits the slots of that class

• Thus, a slot should be attached to the most general class that can have that property

• E.g. body and color should be attached to the class Wine

Inheritance

Page 40: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

40

• Slots have facets (metadata) describing …– Value type– Cardinality (number of values)– Other features

• E.g. – The name of the wine is a String– A winery produces >=1 wines

Facets

Page 41: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

41

• How many values will a slot have?

– Single cardinality– Multiple cardinality

– Minimum cardinality– Maximum cardinality

Slot Cardinality

Page 42: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

42

• String• Number• Boolean• Enumerated

– E.g. the VALUE slot can take one of three possible values; STRONG, MODERATE, DELICATE

• Instance – an instance of another class– E.g. Winery would have a slot listing the

instances of the wines they produce

Slot-value type

Page 43: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

43

• Range – Allowed classes– For the Produces slot the range can be Wine– i.e. a Winery produces Wine

• Domain– A class to which a slot is attached– The Winery class is the domain of the

Produces– i.e. wine is produced by a Winery

Domain and Range of a Slot

Page 44: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

44

• Choose the most generic

– If a list of classes defining a range or a  domain of a slot includes a class and its subclass, remove the subclass

– If a list of classes defining a range or a  domain of a slot contains all subclasses of a class A, but not the class A itself, the range should contain only the class A and not the subclasses

Doman and Range rules

Page 45: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

45

• Chateau-Morgan-Beaujolais– Body: Light– Color: Red– Flavor:

Creating Instances

Page 46: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

46

• The class hierarchy represents an “is-a” or “kind-of” relation– E.g. a Chardonnay “kind-of” Wine

• A single wine is not a subclass of all wines– E.g. Wine is not a “kind-of” Wines!

• Transitivity of the hierarchical relations– If B is a subclass of A and C is a subclass

of B, then C is a subclass of A– A > B > C = A > C– B is direct subclass of A while C is indirect

Trouble shooting … (1)

Page 47: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

47

• Class hierarchies evolve– A Priest is Male– The Anglicans changed the rule and Priests can be

women

• Classes and their names– Class is a label to a concept in a domain– Not necessary represent the words that denote that

concept

– Synonyms for the same concept do not represent different classes

– E.g. Shrimps and Prawns should exist in one class

Trouble shooting … (2)

Page 48: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

48

• Avoid class cycles– A has a subclass of B

– B is a super class of A

– This would mean that A = B

• Multiple Inheritance– Possible

– A class can be a subclass of several classes• A dog is a subset of the class animal

• A dog is a subset of the class pet

Trouble shooting … (3)

Page 49: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

49

• Siblings are classes that are direct subclasses of the same class

• All the siblings (except for root) must be at the same level of generality

• No rule for the number of siblings, but in general …– Between 2 and 12– 1 shows a modeling problem or incompleteness– More than 12 probably shows room for grouping– However, if no natural classes exist to group concepts

in the long list of siblings, there is no need to create artificial classes

Siblings …

Page 50: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

50

• We should introduce it only when the subclass has …– additional properties that the superclass

does  not have– restrictions different from those of the

superclass– participate in different relationships than the

superclasses

When should we introduce a new class? (1)

Page 51: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

51

• Classes in terminological hierarchies do not have to introduce new properties– E.g.

• A classification of medical diseases• No need of specific properties if it is how they are

classified in the real world

When should we introduce a new class? (2)

Page 52: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

52

• Answer lies in the scope

• How important is the concept for our domain?

• A class should not change often (a property does change)

• If we need to distinguish between objects, then create a class– E.g. Left rib, Right rib or rib {Left, Right}

New class or a new property?

Page 53: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

53

• Individual instances are the most specific concepts represented in a knowledge base

An instance or a class?

Page 54: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

54

The ontology should not contain all the possible information about the domain:

you do not need to specialize (or generalize) more than you need for your application (at most one extra

level each way)

Warning!!

Page 55: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

55

• Divide class into 2

• Create an ontology representing special occasions …– E.g. wedding, birthday, Christmas, etc

• Wins the group that creates the most complete ontology

Exercise

Page 56: 1 Dr Alexiei Dingli Introduction to Web Science Modelling the SW

56

1. Determine the domain and scope of the ontology

2. Defining classes in the ontology

3. Arranging the classes in a taxonomic (subclass–superclass) hierarchy

4. Defining slots and describing allowed values for these slots

5. Creating instances

Hint: Steps to create an ontology …