程序代写代做 chain flex Semantic Technologies and Applications COMP5860M

Semantic Technologies and Applications COMP5860M
John Stell
Room 9.15, School of Computing
j.g.stell@leeds.ac.uk
Lecture 5: February 2020
1

Inviduals can change over time (1)
Time Relation
0
1
2
3
4
fn ifn asy ir tr sy rf
2

Inviduals can change over time (2)
Previous slide showed five relations between individuals at different times.
This could be for the property
When you decide what characteristics to put for a property:
􏰀 You add a characteristic if at EVERY time the relation between individuals has it.
􏰀 Do not get confused by accidental features that may happen at some times
􏰀 Ask yourself what are the characteristics (if any) that will ALWAYS be there whatever individuals there happen to be
3

Domain and Range
It is possible in Protege to say that individuals connected by a property must belong to specified classes.
We might want to say that a property teaches should be from the class Staff to class Module.
In this case Staff is the Domain and Module is the Range In Protege you can specify the domain or the range as the
intersection of several classes
The Domain and the Range can be the same
– this is NOT the same as the property being reflexive!
4

Sub-property and super property
Example:
The motherOf property is a sub-property of parentOf
motherOf ⊑ parentOf If A is motherOf B then A is parentOf B
The parentOf property is a super property of motherOf
In description logic ⊆ is used to mean something different from ⊑. We stick to ⊑ for inclusion of properties and classes.
Earlier version of slides had a mistake about this
5

Composing Properties (Chains)
In OWL and Protege (but not in lots of other places): Given properties R and S,
R ◦S is the property where x is linked to z if
1. x is linked to something y by R, and 2. y islinkedtoz byS
This is nice for pictures but opposite to the most popular (if misguided) convention for function composition.
6

Composing Properties (Chains)
Example
Classes: Module, Student, Degree
Properties: takenBy, compulsoryFor, studiedBy
􏰀 A module can be studied by a student
􏰀 A degree can be taken by a student
􏰀 A module can be compulsory for a degree
How do we say the following?
If a module is compulsory for a degree taken by a student then the module must be studied by the student
compulsoryFor ◦ takenBy ⊑ studiedBy
In Protege: studiedBy needs to be a super property of the chain compulsoryFor o takenBy
7

Composing Properties (Chains)
The composition or chain compulsoryFor ◦ takenBy is a new property relating every module which is compulsory for some degree to every student taking that degree.
This is a powerful idea. Assuming parentOf, childOf, motherOf, daughterOf have conventional meanings, which of these correspond to or include the properties granddaughterOf, grandmotherOf, siblingOf, grandparentOf, or other easily named things?
􏰀 childOf o childOf
􏰀 parentOf o childOf
􏰀 childOf o parentOf
􏰀 daughterOf o childOf 􏰀 motherOf o parentOf 􏰀 parentOf o brotherOf
8

Building new Classes using properties. Existential flavour
Suppose we have a class: Mansion and a property owns.
Two individuals are related by this property just when the first owns the second.
For example a particular person owning a specific car.
We can build a new class from Mansion and owns.
This is the class consisting of every individual who owns a Mansion.
In description logic we could write
This means the class of everyone who owns a mansion, or people where .
We could call this class Rich, or better say it’s a subclass of Rich. In Protege the same class is written:
∃ owns · Mansion
something they own is a mansion
owns some Mansion
9

Building new Classes using properties. Universal flavour
Suppose we have a class: Worthless and a property owns. We can build a new class from Worthless and owns.
This is the class consisting of every individual who only owns things that are Worthless.
In description logic we could write
This means the class of everyone who owns only worthless things, or people where .
We could call this class Poor. It includes anyone owning nothing In Protege the same class is written:
Notice how this is different from:
∀ owns · Worthless
everything they own is worthless
owns only Worthless
owns some Worthless
10

Property (Role) Composition and Restriction
concept: knowing someone who has a child who plays football
∃ (knows ◦ hasChild).PlaysFootball
concept: having a child who knows someone who plays football
∃ (hasChild ◦ knows).PlaysFootball
In first order logic the first corresponds to those x for which
∃y ∃z (knows(x,y)∧hasChild(y,z)∧PlaysFootball(z))
How in description logic could we formulate the concept of knowing someone who plays football who has a child?
11

More Restriction Examples
More Examples of the power of Description Logic to define new classes out of existing ones and properties.
􏰀 Teaching staff are staff who teach some module
􏰀 A PG Only module is a module only studied by post grads
􏰀
􏰀
TeachingStaff ≡ Staff ⊓ ∃ teaches.Module PGOnlyModule ≡ Module ⊓ ∀ studiedBy.PostGrad
Note the syntax: quantifier, property, dot, class
⊓ is intersection of classes (like ∩ for sets) also ⊔, union, like ∪. The symbol ≡ is saying the classes are the same.
12

Defining new classes – Avoid these mistakes
∃ teaches.Module
is NOT the idea of modules that have someone that teaches them
∀ studiedBy.PostGrad
is NOT the idea of modules studied by all the post grads
Also beware that the syntax is NOT that of 1st order logic
“Class of modules only studied by 1st years and 2nd years” is NOT
Module ⊓ ∀ studiedBy.(FirstYear ⊓ SecYear) What is this class?
13

Number Restrictions
If R is a property (role) and n a non-negative integer then
≤ n R and ≥ n R and = n R are concepts.
For example: Criminal ⊓ (≥ 3 hasCar ) ⊑ SuccessfulCriminal This is for counting the number of things having a particular
property, not for talking about people who are more than 65. A qualified number restriction is one of these
≤ n R.C ≥ n R.C = n R.C
For example: (= 4 hasRoom.BedRoom) ⊓ ∀ hasRoom.Spacious Note that ≥ 1 R.C is equivalent to ∃ R.C
What could this mean? ≥ 2hasChild.(≥ 2hasChild.Female) and this? ≥ 2 hasChild .(≥ 2 hasLivedIn.City )
14

Statements about classes
“Undergraduate students are students” UnderGrad ⊑ Student
“Modules and students are disjoint”
Module ⊓ Student ≡ ⊥
“Every student is a postgrad or undergrad (or possibly both)” Student ⊑ UnderGrad ⊔ PostGrad
15

Statements about classes
“Undergrads and postgrads are students” (beware the “and” here modelled by ⊔)
UnderGrad ⊔ PostGrad ⊑ Student “People who are staff and students are postgrads”
(notice “and” modelled by ⊓)
Staff ⊓ Student ⊑ PostGrad
or more accurately:
Person ⊓ Staff ⊓ Student ⊑ PostGrad
but: “staff and students are people”
Staff ⊔ Student ⊑ Person
16