Basic OWL Restrictions An owl:Restriction is an owl:Class defined by describing conditions on the individuals it contains This is the basis for extension of models If we can describe a set of individuals in terms of known classes, we can use that description to define a new class The new class in turn can be used to describe individuals in a yet newer class And so on
70
Embed
Basic OWL Restrictions An owl:Restriction is an owl:Class defined by describing conditions on the individuals it contains This is the basis for extension.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Basic OWLRestrictions An owl:Restriction is an owl:Class defined by describing
conditions on the individuals it contains
This is the basis for extension of models
If we can describe a set of individuals in terms of known classes, we can use that description to define a new class
The new class in turn can be used to describe individuals in a yet newer class
And so on
Example: Questions and Answers Running example: managing questions, as for a questionnaire or (when
correct answers provided) a quiz
Questions and answers both include string data
Selection of an answer to a question may preclude posing certain following questions
Use namespace q: for elements relating to questionnaires in general
Use d: for elements of the particular example questionnaire
Define subproperty q:hasSelectedOption of q:hasOption
q:hasSelectedOption a owl:ObjectProperty;
rdfs:subPropertyOf q:hasOption .
When the user answers a question, a triple is entered to indicate the option selected
E.g., if the user selects “Cable TV” for question d:WhatProblem, we add to the store
d:WhatProblem q:hasSelectedOption d:STV .
No need to remove any triple from the store The original q:hasOption relationship between
d:whatProblem and d:STV still holds
Adding Restrictions The OWL construct for creating class descriptions based on
descriptions of prospective class members is owl:Restriction
A subclass of owl:Class
Defined by a description of its members in terms of existing properties and classes
The class of all things, owl:Thing is unrestricted—see the AAA slogan
Define a owl:Restriction with a description restricting the kinds of things that can be said about class members
E.g., given property :orbitsAround, can say anything :orbitsAround anything else
Restricting the value of :orbitsAround by saying its object must be :TheSun defines the class of all things orbiting around the sun
Three of the restrictions are owl:allValuesFrom, owl:someValuesFrom, owl:hasValue
Keyword owl:onProperty specifies the property used in the definition of the restriction class
E.g., for the restriction defining the objects orbiting around the sun, use
owl:onProperty orbitsAround
Membership in a restriction class must satisfy the conditions given by the kind of restriction and the owl:onProperty specification
owl:someValuesFrom owl:someValuesFrom produces a restriction of the form “All individuals
for which at least 1 value of property P comes from class C”
E.g., define a class for all-star players as “All individuals for which at least 1 value of property :playsFor comes from class :AllStarTeam”
[ a owl:Restriction;
owl:onProperty :playsFor;
owl:someValuesFrom :AllStarTeam]
The subject of all 3 triples here is a bnode—something is a restriction class defined on property :playsFor requiring … There’s no name for the restriction class (yet)—it’s an “unnamed
class”
If an individual actually has some value from class :AllStarTeam for property :playsFor, then it’s in this restriction class
Example: Answered Questions Recall
property q:hasOption (relating a question to an answer option) and
its subproperty q:hasSelectedOption (those answers selected)
Now address the problem of selecting which question to ask
Usually don’t ask a question for which we already have an answer
An answered question is one with some value from class q:Answer for property q:hasSelectedOption
q:AnweredQuestion owl:equivalentClass
[ a owl:Restriction;
owl:onProperty q:hasSelectedOption;
owl:someValueFrom q:Anwer] .
Given the asserted triples
d:WhatProblem q:hasSelectedOption d:STV .
d:STV a Answer .
individual d:WhatProblem satisfies the conditions of the restriction class so is a member of class q:AnsweredQuestion
The inference is: Given
d:WhatProblem a [ a owl:Restriction;
owl:onProperty q:hasSeelctedOption;
owl:someValueFrom q:Anwer] .
by the semantics of owl:equivalentClass infer
d:WhatProblem a AnsweredQuestion
Figure 3 shows these definitions and inferences
owl:allValuesFrom owl:allValuesFrom produces a restriction class of the form “the
individuals for which all values of property P come from class C”
[ a owl:Restriction;
owl:onProperty P;
owl:allValuesFrom C]
If individual x is a member of this restriction, then every value of property P for x is inferred to be in class C
E.g., suppose :myFavoriteAllStarTeam (a member of class :BaseballTeam) is a member of
[ a owl:Restriction;
owl:onProperty :hasPlayer;
owl:allValuesFrom :StarPlayer]
Then every player on :MyFavoriteAllStarTeam is a :StarPlayer
E.g., suppose further that we have the triples
:MyFavoriteAllStarTeam :hasPlayer :Gonzales .
:MyFavoriteAllStarTeam :hasPlayer :Kaneda .
Then both :Kaneda and :Gonzales are of type :StarPlayer
owl:someValueFrom is defined as a restriction class such that there’s at least 1 member of a class with a given property
So it implies there is such a member
owl:allValuesFrom technically means “if there are any members of the class, then they all must have the property”
This doesn’t imply that there are any members
Example: Question Dependencies For our questionnaire, we ask certain questions only after particular
answers are given
First define the class of all selected answers based on the q:hasSelectedOption property
Define a class for the selected answers and ensure that any option that’s been selected appears in the class
q:SelectedAnswer a owl:Class;
rdfs:subClassOf q:Answer .
q:hasSelectedOption rdfs:range q:SelectedAnswer .
Introduce class q:EnabledQuestion of questions that can be asked (after selected answers have been given)
q:EnabledQuestion a owl:Class .
An answer enables a question (property q:enablesCandidate) if selecting that answer causes the system to consider that question as a candidate for the next question asked
q:enablesCandidate a owl:ObjectProperty;
rdfs:domain q:Answer;
rdfs:range q:Question .
E.g., ask a question about TV problems only if the answer to the 1st question indicates such a problem
d:STV q:enablesCandidate d:TVsymptom .
d:SBoth q:enablesCandidate d:TVsymptom .
An answer in the following restriction class has all the questions it enables enabled
[ a owl:Restriction;
owl:onProperty q:enablesCandidate;
owl:allValuesFrom q:EnabledQuestion]
Any member of q:SelectedAnswer should also be a member of this restriction class
q:SelectedAnswer rdfs:subClassOf
[ a owl:Restriction;
owl:onProperty q:enablesCandidate;
owl:allValuesFrom q:EnabledQuestion]
Follow out an example When the user selects answer “Cable TV” for the first question, we assert
d:STV a q:SlectedAnswer .
Because of the subclass relation, d:STV is also in the restriction class d:STV a
[ a owl:Restriction;
owl:onProperty q:enablesCandidate;
owl:allValuesFrom q:EnabledQuestion]
For any answer x that’s a member of this restriction, any question related to x by q:enablesCandidate must be a member of q:EnabledQuestion
Since
d:STV q:enablesCandidate d:TVsymptom .
we infer
d:TVsymptom a q:EnabledQuestion .
Note that we also have
d:SBoth q:enablesCandidate d:TVsymptom .
See Figure 4
Restrictions are shown here using the Manchester syntax q:enablesCabdidate all q:EnabledQuestion
Summarizes a restriction using keywords all, some, and hasValue to indicate restriction types
The restriction property appears before the keyword
The target class (or, for owl:hasValue, individual) appears after the keyword
If we extend the example with another question about Internet symptoms d:InternetSymptoms, we express all dependencies as
Regardless of how product info is brought into the system,
it’s represented consistently in terms of both rdf:type and mfg:Product_Product_line
Challenge: Relationship Transfer in SKOS When mapping from one model to another, often say something of
the form
“Everything related to A by property p should also be related to B by property q ”
E.g.,
“Everyone who plays for the All Star team is governed by the league’s contract”
“Every work in the Collected Works of Shakespeare was written by Shakespeare”
This kind of mapping is relationship transfer:
transfer individuals in a relationship with one entity to another relationship with another entity
Recall the SKOS rule for managing collections
Given
X skos:narrower C .
C skos:member Y .
infer
X skos:narrower Y . Where collection C is narrower than concept Y, we can say “Every
member of C is narrower than X ”
I.e., the rule governing skos:narrower in the context of a skos:Collection is a relationship transfer
Challenge 25 Using OWL constructs, represent the SKOS rule for propagating
skos:narrower in the context of skos:Collection
E.g., represent in OWL the constraint
If
agro:MilkBySourceAnimal skos:member Y .
then
agro:Milk skos:narrower Y .
Solution First define an inverse of skos:member
skos:isMemberOf owl:inverseOf skos:member .
Already have an inverse of skos:narrower in skos:broader
Restate the problem with these inverses
If
Y skos:isMemberOf agro:MilkBySourceAnimal .
then
Y skos:broader agro:Milk .
To specify that the set of all things Y that are members of agro:MilkBySourceAnimal, use an owl:hasValue restriction
agro:MembersOfMilkSource owl:equivalentClass
[ a owl:Restriction;
owl:onProperty skos:isMemberOf;
owl:hasValue agro:MilkBySourceAnimal] .
Also specify the set of all things with agro:Milk as broader category
agro:NarrowerThanMilk owl:equivalentClass
[ a owl:Restriction;
owl:onProperty skos:broader;
owl:hasValue agro:Milk] .
Next, all members of one class are in the other:
agro:MembersOfMilkSource rdfs:subClassOf
agro:NarrowerThanMilk .
Think of this rdfs:subClassOf as like an IF/THEN relation
When both subclass and superclass are restrictions, the IF/THEN takes on more meaning, here
If an individual skos:isMemberOf agro:MilkBySourceAnimal
then that individual (has) skos:broader (concept) agro:Milk
With the inverses as defined, this is the same as saying
If
agro:MilkBySourceAnimal skos:member X .
then
agro:Milk skos:narrower X .
Relationship Transfer In FOAF A similar situation arises in FOAF with groups
Recall that FOAF provides 2 ways to describe members of a group G
Relation foaf:member relates an individual G of foaf:Group to the individuals in G The same G is related to an owl:Class by the
foaf:membershipClass property
Define a foaf:Group for b:Shakespeares_Children as
b:Shakespeares_Children
a foaf:Group;
foaf:name "Shakespeare's Children";
foaf:member b:Susanna, b:Judith, b:Hamnet;
foaf:membershipClass b:ChildOfShakespeare .
b:ChildOfShakespeare a owl:Class .
FOAF specifies the rule
If
b:Shakespeares_Children foaf:member ?x .
then
?x rdfs:type b:ChildOfShakespeare .
See Figure 10: the result of this rule for our example
Solid lines show asserted triples, dotted lines show inferred triples
Challenge 26 How can we get the inference in Figure 10 using only OWL constructs?
Solution This parallels the solution for relationship transfer in SKOS
But here the relationship we’re transferring to is rdfs:type
Begin (as before) by defining an inverse of foaf:member
b:memberOf owl:inverseOf foaf:member .
Using an owl:hasValue restriction, define b:ChildOfShakespeare as the class of all those who are b:memberOf b:Shakespeares_Children
b:ChildrenOfShakesoeare
a owl:Class;
rdfs:label "Child of Shakespeare";
owl:equivalentClass
[ a owl:Restriction;
owl:hasValue b:Shakespeares_Children;
owl:onProperty b:memberOf] .
To follow an inference (see Figure 10), assert a triple
b:Shakespeares_Children foaf:member b:Hamlet .
By the semantics of owl:inverseOf, infer
b:Hamnet b:memberOf b:Shakespeares_Children .
This satisfies the conditions of the restriction, so infer
b:Hamnet rdf:type b:ChildOfShakespeare .
Turn this inference around backward
Assert instead
b:Hamnet rdf:type b:ChildOfShakespeare .
By the semantics of owl:equivalentClass, infer
b:Hamnet rdf:type
[ a owl:Restriction;
owl:hasValue b:Shakespeares_Children;
owl:onProperty b:memberOf] .
For b:Hamnet to satisfy the restriction, it must be that
b:Hamnet b:memberOf b:Shakespeares_Children .
By the semantics of owl:InverseOf, infer
b:Shakespeares_Children foaf:member b:Hamlet .
Discussion That we can represent something in OWL doesn’t necessitate
actually doing so
Consider how the solutions just developed compared to those actually taken by the SKOS and FOAF developers
SKOS uses a special-purpose rule to define the meaning of skos:narrower in the context of a skos:Concept and a skos:Collection So a SKOS user can express the relationship between agro:Milk
and agro:MilkBySourceAnimal just by asserting
agro:Milk skos:narrower agro:MilkBySourceAnimal .
Then the rule takes care of the rest Simpler for the user than constructing the pair of restrictions
SKOS in fact defines the rule more generally
Given
X P C .
P rdf:type skos:CollectableProeprty .
C skos:member Y .
infer
X P Y .
skos:CollectableProperty includes skos:narrower, skos:broader, skos:related
So 1 rule expresses constraints for 3 properties
To do this with the OWL relationship transfer pattern,
we’d have to repeat the pattern once for each property and each concept/collectable pair for which we’re specifying the relationship
But writing a special-purpose rule into to SKOS description has drawbacks
We need to define a rule language and a processor for the rules
The pragmatic answer:
Rules are written in the natural language used for the specification
Processing is done by each application rather than by a general-purpose inference engine
In contrast, an OWL solution
uses generic software
exploits standard semantics
The SKOS specification expresses this rule in prose , leaving its implementation to each application
With FOAF, unlike SKOS, there’s only one property (foaf:membershipClass) affected by the transfer rule