77
Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine restrictions (e.g., the set of planets that go around the sun and have at least 1 moon) the classes used to define restrictions (e.g., a Vegetarian is someone who eats food that is not Meat) OWL also includes restrictions that refer to cardinality, referring to the number of distinct values for a given property some individual has We can then describe, e.g., “the set of planets that have at least 3 moons”

Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Embed Size (px)

Citation preview

Page 1: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language,

including intersections, unions, complements

Using these, we combine

restrictions (e.g., the set of planets that go around the sun and have at least 1 moon)

the classes used to define restrictions (e.g., a Vegetarian is someone who eats food that is not Meat)

OWL also includes restrictions that refer to cardinality,

referring to the number of distinct values for a given property some individual has

We can then describe, e.g., “the set of planets that have at least 3 moons”

Page 2: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Reasoning with sets must cope with the following fundament aspects of the Semantic Web

Open World Assumption (a consequence of the AAA slogan) There could always be something new that someone will say; we

must assume that there is always more info that could be known

Nonunique Naming Since the speakers on the Web won’t necessarily coordinate their

naming efforts, the same entity could be known by more than one name (URI)

Page 3: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Unions and Intersections All set operations can be used on any class definition, including

named classes and restrictions

They use the collection (list) constructs of RDF

U1 a owl:Class;

owl:unionOf ( ns:A ns:B … ).

I1 a owl:Class;

owl:intersectionOf ( ns:A ns:B … ) .

The intersection/union of 2 or more classes it itself a class

Represented by either naming the class or by defining an anonymous class

Page 4: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

An anonymous class can be used again if named using owl:equivalentClass

bb:MajorLeagueBaseballPlayer owl:equivalentClass

[ a owl:Class;

owl:intersectionOf

( bb:MajorLeagueMember bb:Player bb:BaseballEmployee ) ] .

Natural language descriptions often have a notion of intersection built in

“All planets orbiting the sun” is the intersection of all things that orbit the sun (a restriction) and all planets

:SolarPlanet a owl:Class;

owl:intersectionOf (

:Planet

[ a owl:Restriction;

owl:onProperty :orbits;

owl:hasValue :TheSun] ) .

Page 5: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

The set of major league baseball players is the intersection of

all things that play on a major league team (someValueFrom restriction) and

baseball players

:MajorLeagueBaseballPlayer a owl:Class;

owl:intersectionOf (

:BaseballPlayer

[ a owl:Restriction;

owl:onProperty :playsFor;

owl:someValuesFrom :MajorLeagueTeam] ) .

Page 6: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Example: High-Priority Candidate Questions Earlier defined

a class of candidate questions based on dependencies on selected answers

priorities for the questions

Now use set constructors to combine these to form a class of candidate questions of a given priority

Repeat here the description of SelectedAnswer that classifies a dependent question as EnabledQuestion

q:SelectedAnswer rdfs:subClassOf

[ a owl:Restriction:

owl:onProperty q:enablesCandidate;

owl:allValuesFrom q:EnabledQuestion] .

Page 7: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Define a class of questions we’re ready to ask based on 2 criteria

They’ve been enabled by the description above

They have high priority

Do it with an intersectionOf constructor

q:CandidateQuestion owl:equivalentClass

[ a owl:Class;

owl:intersectionOf

( q:EnabledQuestion q:HighPriorityQuestion )] .

Page 8: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Or we could make a more relaxed description for candidate questions and include medium-priority questions

q:CandidateQuestion owl:equivalentClass

[ a owl:Class;

owl:intersectionOf

( q:EnabledQuestion

[ a owl:unionOf

( q:HighPriorityQuestion

q:MediumPriorityQuestion )] )] .

Page 9: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Closing the World Note the impact of the Open World Assumption on set operations and

counting

Even the notion of set complement is subtle

Say, based on its absence, that something isn’t a member of a set But then find that it is

But there are ways to assert in OWL that certain parts of the world are closed

Make inferences involving complements or counting much clearer

Example: James Dean made only 3 movies We know this; he’s been dead for 50 years

Page 10: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Enumerating Sets with owl:oneOf In the James Dean example, needn’t reject the Open World

Assumption

Just need an enumeration of all the members of a given class (James Dean movies)

Enumerate the members of a class with the owl:oneOf construct

ss:SolarPlanet rdf:type owl:Class;

owl:oneOf ( ss:Mercury ss:Venus ss:Earth ss:Mars

ss:Jupiter ss:Saturn ss:Uranus

ss:Neptune ) .

This class contains 8 individuals and no others

Page 11: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

owl:oneOf limits the AAA slogan

Nobody else can say there’s another distinct item

So use owl:oneOf carefully and only when the definition of the class isn’t likely to change (or at least not often)

But owl:oneOf places no limitation on the Nonunique Naming Assumption

Makes no claim about whether, e.g., Mercury might be the same as Venus

Combined with owl:someValuesFrom, owl:oneOf provides a generalization of owl:hasValue

owl:hasValue specified a single value a property can take

But owl:someValues from combined with owl:oneOf specifies a set of values a property can take

Page 12: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Challenge In a dialogue with Rimbaud, Rocky used the fact that

James Dean made only 3 movies and a process of elimination

to determine what movie Rimbaud saw

How to represent this in OWL?

Solution Define the class of James Dean movies as

:JamesDeanMovie a owl:Class;

owl:oneOf ( :Giant :EastOfEden :Rebel ) .

As usual, we define the meaning of owl:oneOf in terms of the inferences that can be drawn from it

There are several

Page 13: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

First, can infer that each instance listed in owl:oneOf is indeed a member of the class

Given the above, can infer

:Giant rdf:type :JamesDeanMovie .

:EastOfEden rdf:type :JamesDeanMovie .

:Rebel rdf:type :JamesDeanMovie .

But owl:oneOf also asserts that these are the only members

In terms of inference, if we assert that some new thing is a member of the class, it must be owl:sameAs one of the members listed in the owl:oneOf

list

In our example, if someone introduces a new member of the class

:RimbaudMovie rdf:type :JamesDeanMovie .

can infer that :RimbaudMovie is owl:sameAs one of the movies mentioned

Page 14: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

So far, we’ve expressed inferences in terms of new triples inferred

But here the inference tells that some triple from a small set holds (don’t know which)

Can’t assert any new triple

To do the elimination in OWL, must be able to say that some individual is not the same as another

Page 15: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Differentiating Individuals with owl:differentFrom Because of the Nonunique Naming Assumption, when we want

different things, must name things that are explicitly different

For this, OWL provides owl:differentFrom ss:Earth owl:differentFrom ss:Mars .

owl:differentFrom supports several inferences when used with other constructs like owl:cardinality and owl:oneOf

Page 16: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Challenge 28 Use OWL to model the dialogue between Rocky and Rimbaud so

OWL can infer that Rimbaud saw Rebel

Solution At the beginning of the dialogue, Rocky knows that the movie

Rimbaud saw was one of the 3 listed

He guesses Giant. If correct, can assert

:RimbaudMovie owl:sameAs :Giant .

But wrong, so assert

:RimbaudMovie owl:differentFrom :Giant .

Still must guess, this time East of Eden, and again wrong, so assert

:RimbaudMovie owl:differentFrom :EastOfEden .

Page 17: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

The semantics of owl:one of and owl:differentFrom now let us infer

:RimbaudMovie owl:sameAs :Rebel .

See Figure 1 for the assertions and inference

Page 18: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Differentiating Multiple Individuals To simplify specification of lists of items all different from one another,

OWL provides 2 constructs used together: owl:AllDifferent, owl:distinctMembers

Specify that an RDF list (i.e., collection) of items are mutually distinct by referring to the list in a triple using predicate owl:distinctMembers

The domain of owl:distinctMembers is owl:AllDifferent

It’s customary for the subject of an owl:distinctMembers triple to be a bnode

[ a owl:AllDifferent;

owl:distinctMembers

( ss:Mercury ss:Venus … ss:Neptune )] .

Page 19: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

The following is typical

:SolarPlanet a owl:Class;

owl:intersectionOf (

owl:oneOf ( ss:Mercury, ss:Venus, ss:Earth, ss:Mars,

ss:Jupiter, ss:Saturn, ss:Uranus,

ss:Neptune )

[ a owl:AllDifferent;

owl:distinctMembers

(ss:Mercury, ss:Venus, ss:Earth, ss:Mars,

ss:Jupiter, ss:Saturn, ss:Uranus,

ss:Neptune ) ] ) .

Page 20: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

This is the same as asserting 28 owl:differentFrom triples, one for each pair of items in the list

For the James Dean movies,

[ a owl:AllDifferent;

owl:distinctMembers

( :EastOfEden :Giant :Rebel )] .

It’s common to use owl:oneOf and owl:AllDifferent as we’ve done,

to say that a class is made up of an enumerated list of distinct elements

Page 21: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

See Figure 2 The list is

constructed with rdf:first, rdf:next, rdf:nil

Page 22: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Cardinality Cardinality restrictions let us express constraints on the number of

individuals that can be related to a member of the restriction class

E.g., a baseball team has exactly 9 (distinct) players

Cardinality restrictions also let us define sets of particular interest—the set of 1-act plays

Page 23: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

The syntax is similar to other restrictions—e.g., the class of things with exactly 5 players

[ a owl:Restriction;

owl:onProperty :hasPlayer;

owl:cardinality 9]

Can also specify a lower bound—e.g., those things with at least 10 players

[ a owl:Restriction;

owl:onProperty :hasPlayer;

owl:minCardinality 10]

and an upper bound—e.g., those things with at most 2 players

[ a owl:Restriction;

owl:onProperty :hasPlayer;

owl:maxCardinality 2]

Page 24: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Cardinality refers to the number of distinct values a property has

It interacts closely with the Nonunique Naming Assumption and owl:differentFrom

Regarding inference,

if we can show that an individual has exactly (resp., at least, at most) n distinct values for a property,

then it’s a member of the corresponding owl:cardinality (resp., owl:minCardinality, owl:maxCardinality) restriction

Similarly,

if we assert that something is a member of an owl:cardinality restriction,

then it must have exactly n distinct values for the property

Similar conclusions follow from restrictions on minimum and maximum cardinality

Page 25: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Challenge 29 Rocky and Rimbaud continue their conversation

Rimbaud: Do you own any James Dean movies?

Rocky: They’re the only ones I own.

Rimbaud: Then you own no more than three movies.

Model these facts in OWL so that Rimbaud’s conclusion follows from the OWL semantics

Solution Need a property to indicate that someone owns a movie

:ownsMovie a owl:ObjectProperty .

Page 26: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

In OWL, make general statements about an individual by asserting that they are a member of a restriction class

:JamesDeanExclusive owl:equivalentClass

[ a owl:Restriction;

owl:onProperty :ownsMovie;

owl:allValuesFrom :JamesDeanMovie] .

:Rocky a :JamesDeanExclusive .

Define the class of things that own at most 3 movies

:FewMovieOwner owl:equivalentClass

[ a owl:Restriction;

owl:onProperty :ownsMovie;

owl:maxCardinality 3] .

Page 27: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Rocky’s conclusion is the triple

:Rocky a :FewMovieOwner .

This triple can be inferred from the model

All values of property :ownsMovie for Rocky come from class :JamesDeanMovie

There are only 3, all distinct

So Rocky owns at most 3 movies

Figure 3 (next slide) shows the inference

Page 28: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine
Page 29: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Challenge 30 Model the following in OWL

Rimbaud: How many movies do you own?

Rocky: Three.

Rimbaud: Then you own the one I saw last night, Rebel without a Cause.

Solution Assert that Rocky is a member of the owl:cardinality restriction class

for “the set of things that own exactly 3 movies”

:ThreeMovieOwner owl:equivalentClass

[ a owl:Restriction;

owl:onProperty :ownsMovie;

owl:cardinality 3] .

:Rocky a :ThreeMovieOwner .

Page 30: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Now Rocky owns exactly 3 distinct movies

All his movies are members of :JamesDeanMovie

There are just 3 different :JamesDeanMovies

Infer

He owns each of them

In particular, infer

:Rocky :ownsMovie :Rebel .

Figure 4 (next slide) shows the assertions and inferences

Page 31: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine
Page 32: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Small Cardinality Limits Restrictions of cardinalities to the small numbers 0 and 1 have

special modeling utility

minCardinality 1 Those with some (at least 1) value for the property

E.g., onProperty ownsMovie minCardinality 1 specifies the set of those owning at least 1 movie

maxCardinality 1 Those that, if they have a value for the property, have a unique value

E.g., onProperty ownsMovie maxCardinality 1 specifies the set of those limiting themselves to 1 movie

Page 33: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

minCaridnality 0 Those for which a value for the property is optional

Superfluous in OWL semantics (properties are always optional) But the explicit assertion can be useful for model readability

E.g., onProperty ownsMovie minCardinality 0 explicitly specifies the set of those for which owning a movie is optional

maxCardinality 0 Those for which no value for the property is allowed

E.g., onProperty ownsMovie maxCardinality 0 specifies the set of those owning no movies

Page 34: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Set Complement The complement of a class is another class whose members are all

things not in the complemented class

A complement applies to a single class, so define it with 1 triple

ex:ClassA owl:complementOf ex:ClassB .

The complement of a class includes everything in the universe not in that class

E.g., the complement of bb:MajorLeaguePlayer includes not only minor league players but also movies, planets, …

Page 35: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Usually work with the relative complement (e.g., the class of players who aren’t major league players) by combining complement and intersection—e.g.,

bb:MinorLeaguePlayer owl:intersectionOf

( [ a owl:Class;

owl:complementOf bb:MajorLeaguePlayer ]

bb:Player ) .

Using the complement class just here—no need for a name Specified anonymously in bnode notation

Page 36: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Challenge 31 Continue the dialogue with an addition participant, Paul

Paul: I have all James Dean’s movies.

Rimbaud: Do you have other movies too?

Paul: I have some movies that aren’t James Dean movies.

Rocky: You must have at least four movies then.

Model this situation and conclusion in OWL

Page 37: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Solution Define an inverse of :ownsMovie

:ownedBy owl:inverseOf :ownsMovie .

Define the class of all movies Paul owns

:PaulsMovie a owl:Class;

owl:intersectionOf

( [ a owl:Restriction;

owl:onProperty :ownedBy;

owl:hasValue :Paul]

:Movie ) .

Paul owns every James Dean movie: every :JamesDeanMovie is a :PaulsMovie (but possibly not vice versa)

:JamesDeanMovie rdfs:subClassOf :PaulsMovie .

Page 38: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Paul also owns other movies

Capture this in OWL

First note that the following anonymous class includes everything that isn’t a James Dean Movie

[ owl:complementOf :JamesDeanMovie]

Building on this, the following is an anonymous class of all things having some value for :ownsMovie that isn’t a James Dean movie

[ a owl:Restriction;

owl:onProperty :ownsMovie;

owl:someValuesFrom

[ owl:complementOf :JamesDeanMovie]]

Finally, we assert that Paul is such a thing

:Paul a [ a owl:Restriction;

owl:onProperty :ownsMovie;

owl:someValuesFrom

[ owl:complementOf :JamesDeanMovie]] .

Page 39: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Want to conclude that Paul is a member of a class of people owning 4 or more movies

Remains to define this class

:ManyMovieOwner owl:equivalentClass

[ a owl:Restriction;

owl:onProperty :ownsMovie;

owl:minCardinality 4] .

Paul owns all 3 James Dean movies and at least 1 non-James Dean movie

At least 4 in all

So infer

:Paul rdf:type :ManyMovieOwner .

Figure 5 shows the assertions and conclusion

Page 40: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine
Page 41: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Disjoint Sets Specify that 2 classes are non-overlapping, or disjoint, with

owl:disjointFrom

:Man owl:disjointFrom :Woman .

For any members of disjoint classes, can infer that they are owl:differentFrom one another

Given

:Irene a :Woman .

:Ralph a :Man .

infer

:Irene owl:differentFrom :Ralph .

Page 42: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Challenge 32 Continuing with the dialogue:

Paul: Not only do I have all the James Dean movies, but I also have movies with Judy Garland, Tom Cruise, Judi Dench, and Antonio Banderas.

Rocky: You must own at least seven movies.

Paul: How did you know that?

Rocky: Because none of those people played in movies together.

Model this situation and conclusion in OWL

Page 43: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Solution Express that Paul owns, e.g., a Judy Garland movie by asserting that

he’s a member of the class of things that own Judy Garland movies

:Paul a [ a owl:Restriction;

owl:onProperty :ownsMovie;

owl:someValuesFrom :JudyGarlandMove] .

:Paul a [ a owl:Restriction;

owl:onProperty :ownsMovie;

owl:someValuesFrom :JudiDenchMove] .

:Paul a [ a owl:Restriction;

owl:onProperty :ownsMovie;

owl:someValuesFrom :TomCruiseMove] .

:Paul a [ a owl:Restriction;

owl:onProperty :ownsMovie;

owl:someValuesFrom :AntonioBanderasMove] .

Page 44: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Define the set of people who own 7 or more movies

:SevenMovieOwner a owl:Restriction;

own:onProperty ownsMovie;

owl:minCardinality 7 .

We don’t know that Paul’s a member of this class until we know that all the sets of movies are disjoint

:JamesDeanMovie owl:disjointWith :JudyGarlandMovie .

:JamesDeanMovie owl:disjointWith :TomCruiseMovie .

:JamesDeanMovie owl:disjointWith :JudiDenchMovie .

:JamesDeanMovie owl:disjointWith :AntonioBanderasMovie .

:JudyGarlandMovie owl:disjointWith :TomCuiseMovie .

:JudyGarlandMovie owl:disjointWith :JudyDenchMovie .

:JudyGarlandMovie owl:disjointWith :AntonioBanderasMovie .

:TomCruiseMovie owl:disjointWith :JudyDenchMovie .

:TomCruiseMovie owl:disjointWith :AntonioBanderasMovie .

:JudiDenchMovie owl:disjointWith :AntonioBanderasMovie .

Page 45: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Given

Paul has 3 James Dean movies and at least 1 movie with each of the other actors mentioned

None of these movies appears twice (all sets disjoint)

an inference engine can confirm

:Paul a :SevenMovieOwner .

Figure 6 shows these assertions and inferences

Page 46: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Note how owl:someValuesFrom interacts with cardinality

Each owl:someValueFrom restriction guarantees the existence of one value for the specified property

Given the values are distinct, can count at least 1 per owl:someValuesFrom restriction

Just as owl:AllDifferent lets us specify that several individuals are mutually distinct,

could have something like owl:AllDisjoint to specify that a set of classes are mutually disjoint

The OWL standard didn’t include such a construct

But some proposals for OWL extensions include it

Page 47: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Prerequisites Revisited We explored how prerequisites can be modeled using

owl:allValuesFrom

But had a problem with the Open World Assumption: How can we tell that all prerequisites have been satisfied?

Now show several ways to close the world

Recall that we modeled the fact that something has all its prerequisites selected is a q:EnabledQuestion as

q:hasPrerequisite a owl:ObjectProperty .

[ a owl:Restriction;

owl:onProperty q:hasPrerequisite;

owl:allValuesFrom q:SelectedAnswer]

rdfs:subClassOf q:EnableQuestion .

Page 48: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

No Prerequisites To assert that an individual has no values for some property, use a

cardinality restriction

c:WhatProblem a [ a owl:Restriction;

owl:onProperty q:hasPrerequisite;

owl:cardinality 0] .

So there are no triples of the following form, i.e., c:WhatProblem has no prerequisites

c:WhatProblem q:hasPrerequisite ?x .

So c:WhatProlem satisfies

c:WhatProblem a [ a owl:Restriction;

owl:onProperty q:hasPrerequisite;

owl:allValuesFrom q:SelectedAnswer] .

Hence

c:WhatProblem a q:EnabledQuestion .

Page 49: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

In summary, this holds since all of this problem’s prerequisites have been selected

Vacuously true since it has no prerequisites

Note: x A(x) B(x) is true if it’s true for every substitution instance x/a, where a denotes an individual

A(a) B(a) is true if A(a) is false

If A(a) is false for every individual a, then A(a) B(a) is true for every individual

I.e., x A(x) B(x) is true when nothing satisfies A(x)

Page 50: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Counting Prerequisites Also determine that something satisfies its prerequisites by counting how

many there are (as with the James Dean movies)

Suppose something has 1 prerequisite

d:TvSymptom a [ a owl:Restriction;

owl:onProperty hasPrerequisite;

owl:cardinality 1] .

And suppose we know 1 prerequisite and its type

d:TvSymptom q:hasPrerequisite d:STV .

d:STV a q:SelectedAnswer .

One prerequisite is a member of q:SelectedAnswer and there aren’t any other prerequisites

So all prerequisites are members of q:SelectedAnswer

d:TVSymptom a [ a owl:Restriction;

owl:onProperty q:hasPrerequisite;

owl:allValuesFrom q:SelectedAnswer] .

Page 51: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Can make inferences with larger counts (as with the James Dean movies) if all entities are different

Given

d:TVTurnedOn a [ a owl:Restriction;

owl:onProperty q:hasPrerequisite;

owl:cardinality 2] .

d:TVTurnedOn q:hasPrerequisite d:TVSnothing .

d:TVTurnedOn q:hasPrerequisite d:STVSnosound .

d:TVSnothing owl:differentFrom d:STVSnosound .

d:TVSnothing a q:SelectedAnswer .

d:STVSnosound a q:SelectedAnswer .

infer (since only 2 prerequisites and we know which they are)

d:TVTurnedOn a [ a owl:Restriction;

owl:onProperty q:hasPrerequisite;

owl:allValuesFrom q:SelectedAnswer] .

Page 52: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Guarantees of Existence Recall: Membership of individual A in an owl:allValuesFrom restriction

on property P doesn’t guarantee existence of a triple of the form

A P ?x .

If A is a member of a restriction owl:onProperty P owl:someValuesFrom class C, can infer there’s a pair of triples

A P ?x .

?x rdf:type C .

So owl:someValuesFrom does guarantee the existence of some value for the given property

owl:hasValue not only guarantees such a triple but even specifies it

I.e., if A is a member of the restriction owl:onProperty P owl:hasValue X, can infer

A P X .

Page 53: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

ContradictionsChallenge 33 Model the following situation and conclusion in OWL

Rocky: I have a couple of Judy Garland movies.

Rimbaud: But you said you own only James Dean movies, and he and Judy Garland weren’t in any movie together.

Page 54: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

This introduces a new aspect of inferencing in OWL

In the simplest form of inferencing, we infer triples based on asserted ones

With notions more advanced than RDFS-Plus,

some inferences themselves can’t be represented as triples

but can result in new triples when combined with other assertions

But here no new triples are inferred at all

Rimbaud found a contradiction in what Rocky said

Page 55: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

The contradiction arises because Rocky states the following

:JamesDeanExclusive owl:equivalentClass

[ a owl:Restriction;

owl:onProperty :ownsMovie;

owl:allValuesFrom :JamesDeanMovie] .

:Rocky a :JamesDeanExclusive .

:Rocky a [ a owl:Restriction;

owl:onProperty :ownsMovie;

owl:someValuesFrom :JudyGarlandMovie] .

:JudyGarlandMovie owl:disjointWith :JamesDeanMovie .

Figure 7 (next slide) shows the assertions (no inferences)

Page 56: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine
Page 57: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

The OWL semantics can tell us that there’s a contradiction but not which assertion is wrong

The truth of an assertion relates, not to OWL semantics, but to the domain being modeled

A model may fail to correspond to the actual state of affairs

If this is because it’s logically inconsistent (so couldn’t correspond to any state of affairs), the tools surrounding OWL can tell us so

Page 58: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Unsatisfiable Classes A contradiction involves a set of assertions that can’t all be true at the

same time

A similar situation arises when we define a class in an inconsistent way

Illustrate this with a slight variation on the previous example

First define the class of people owning Judy Garland movies

:JudyGarlandMovieOwner owl:equivalentClass

[ a owl:Restriction;

owl:onProperty :ownsMovie;

owl:someValueFromm :JudyGarlandMovie] .

Now, instead of claiming that Rocky is a member of this class and JamesDeanExclusive, define a class of such people

:JDJG owl:intersectionOf

( :JudyGarlandMovieOwner :JamesDeanExclusive ) .

Page 59: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

We can define this class without asserting that Rocky (or anything else) is a member, hence without involving a contradiction

But the same argument showing that Rocky can’t be a member shows that nothing can be a member of this class

Not only is the class empty, it must be empty—it (or the description of what it contains, which implicitly involves a variable) is unsatisfiable

Asserting that something is a member of an unsatisfiable class introducers a contradiction into the model

Page 60: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Figure 8 shows the assertions and conclusions

JDJG, being the intersection of JudyGarlandMovieOwner and JamesDeanExclusive, is a subclass of both

It’s inferred to be a subclass of owl:Nothing, the necessarily empty class

Page 61: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Propagation of Unsatisfiable Classes An unsatisfiable class easily leads to other unsatisfiable class

definitions

subclass If a class can’t have any members, then no subclass of it can have a

member (which would thereby be a member too of the class)

someValuesFrom

A restriction with owl:someValuesFrom an unsatisfiable class is itself unsatisfiable

domain and range If a property has an unsatisfiable domain or range, it’s unusable

Asserting any triple using the property as predicate results in a contradiction

Page 62: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

intersection of disjoints The intersection of 2 disjoint classes is unsatisfiable

The intersection of any class with an unsatisfiable class is unsatisfiable

Some operations don’t propagate unsatisfiability

The union of class C with an unsatisfiable class is just C

A restriction owl:allValuesFrom an unsatisfiable class can be satisfiable—

vacuously so: no member can have the property in question

The usefulness of these rules in modeling comes during analysis of the results of an inference engine

Many inference engines report on unsatisfiable classes

But, with several such classes, it’s hard to unravel the threads

Page 63: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Inferring Class Relationships Earlier focused on drawing inferences about individuals but have

shifted to inferences about classes

Some of the more common of the many patterns are the following

Use set notation for brevity (and clarity)

Intersections and subclass A B A, A B B

Union and subclass A B A, A B B

Complement and subclass If A B then A B

Page 64: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Subclass propagation through restriction owl:allValuesFrom

If A B then { x | y P(x,y) y A } { x | y P(x,y) y B }

owl:someValuesFrom

If A B then { x | y P(x,y) y A } { x | y P(x,y) y B }

hasValue, someValuesFrom, and subClassOf If a A then { x | P(x,a) } { x | y P(x,y) y A }

Relative cardinalities For natural number c, d where d > c,

{ x | card({ y | P(x,y ) } ) = d } { x | card({ y | P(x,y ) } ) c }

Page 65: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Examples Subclass propagation through restriction If :AllStarBaseballTeam is a subclass of :BaseballTeam,

then the restriction (on any property, e.g., :playsFor)

owl:allValuesFrom :AllStarBaseballTeam

is a subclass of the restriction (on the same property :playsFor)

owl:allValuesFrom :BaseballTeam

hasValue, someValuesFrom, and subClassOf Suppose individual :TokyoGiants is a member of class :BaseballTeam

The restriction on property :playsFor

owl:hasValue :TokyoGiants

is a subclass of the restriction on :playsFor

owl:someValuesFrom :BaseballTeam

Page 66: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Relative cardinalities Suppose a :ViableBaseballTeam must have at least 9 players on its

roster and a :FullBaseballTeam has exactly 10 players

:FullBaseballTeam is a subclass of :ViableBaseBallTeam

owl:someValuesFrom and owl:minCardinality Suppose :BaseballTeam has some pitcher, i.e., :BaseballTeam is a

subclass of the restriction

owl:onProperty :hasPlayer owl:someValuesFrom :Pitcher

Can infer that it has at least 1 pitcher, i.e., :BaseballTeam is a subclass of the restriction

owl:onProperty :hasPlayer owl:minCardinality 1

Any class relationship that can be proven based on the semantics of the OWL constructs will be inferred by the logic underlying OWL

We’ve seen only the more common propagation patterns

Page 67: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Inferring class relationships in OWL is in sharp contrast to OO modeling

In OO modeling, all instances are created as members of some class Their behavior is specified by the class structure

In OWL, the class structure can change as more info is learned about classes and individuals

These aspects of OWL are direct consequences of the basic assumptions about the web

AAA slogan, Open World assumption, Nonunique Naming assumption

A strict data model (e.g., an OO model) is useful when there’s top-down governance of the system

Doesn’t work in an open, free system

Our understanding of the structure of knowledge changes as we discover new things

OWL provides a consistent and systematic way to understand those changes

Page 68: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

OWL’s ability to infer class relationships enables a style of modeling where subclass relationships are rarely asserted directly

Instead, relationships between classes are described in terms of unions, intersections, complements, restrictions

And the inference engine determines the class structure

If more info is learned about a given class or individual, more class structure can be inferred

Illustrate this principle with the baseball model—Table 1

Page 69: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Here indicates class equivalence, indicates subclass

Page 70: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Figure 9 shows the class tree asserted

Page 71: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Some subclass relationships inferred from the definitions in Table 1 and our subclass inferencing patterns

AllStarBaseballTeam BaseballTeam AllStarTeam, so AllStarBaseballTeam BaseballTeam

AllStarBaseballTeam AllStarTeam

Both AllStarBaseballPlayer and AllStarPlayer are someValuesFrom restrictions on property playsFor, referencing, resp.,

AllStarBaseballTeam

AllStarTeam

Propagate AllStarBaseballTeam AllStarTeam to infer

AllStarBaseballPlayer AllStarPlayer

Similar reasoning lets us infer

AllStarBaseballPlayer BaseballPlayer

Page 72: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

JBallTeam PacificLeagueTeam CentralLeagueTeam, so

PacificLeagueTeam JBallTeam

PacificLeagueTeam JBallTeam

Hiroshima Carp is a Central League Team so also a JBallTeam and, further, a BaseballTeam

A CarpPlayer is a hasValue restriction on the Carp, so

CarpPlayer BaseballPlayer

Page 73: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

AllStarPlayer is equivalent to the someValuesFrom restriction onProperty playsFor

So any individual member of AllStarPlayer playsFor some team But domain(playsFor) Player So that individual is also a Player

Just shown AllStarPlayer Player

AllStarTeam employs some AllStarPlayer and employs is the inverse of playsFor

So some person playsFor any AllStarTeam But range(playsFor) is Team

So AllStarTeam Team

Page 74: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Figure 10 shows the inferred class structure

Every class is involved in some class inferencing pattern

So the inferred structure (unlike the asserted one) has considerable depth

Page 75: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

Reasoning with Individuals and Classes From an RDF perspective, inferencing about individuals and

inferencing about classes are very similar

New triples are added to the model based on asserted triples

From a modeling perspective, the 2 kinds of reasoning are very different

One draws specific conclusions about individuals in a data stream (A-box reasoning)

The other draws general conclusions about classes of individuals (T-box reasoning)

Page 76: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

The utility of reasoning about individuals in a Semantic Web context is clear

Info specified in one source is transformed according to a model for use in another context

Mappings from one context to the next are specified with such constructs as rdfs:subClassOf, rdfs:subPropertyOf, and various owl:Restrictions

Data are then transformed and processed according to

these models and

the inferences specified in the RDFS and OWL standards for each

Page 77: Counting and Sets in OWL OWL augments restrictions with a full set-theoretic language, including intersections, unions, complements Using these, we combine

The utility of reasoning about classes is more subtle

Determines how data are related in general, even before any data is present

Records relationships with rdfs:subClassOf, rdfs:subPropertyOf, rdfs:domain, rdfs:range

Once these general relationships are inferred, processing individual data is much easier