OWL - Web Ontology Language
Several languages
owl:Restriction
: RestrictionsAllows to describe classes in terms of other things we already modeled
owl:Restriction rdfs:subClassOf owl:Class
owl:someValuesFrom
:AllStarPlayer
is a :Player
for which at least one value of :playsFor
comes from the class :AllStarTeam
[a owl:Restiction; owl:onProperty :playsFor; owl:someValuesFrom :AllStarTeam]
:AllStarTeam
$\Rightarrow$ he is an :AllStarPlayer
owl:allValuesFrom
owl:hasValue
:Team
s :from :Japan
:orbitsAround
:orbitsAround :TheSun
belongs to the :SolarSystem
[a owl:Restriction; owl:onProperty :orbitsAround; owl:hasValue :TheSun]
Best way to use these restrictions:
rdfs:subClassOf
owl:equivalentClass
Schema (namespace q
):
q:optionOf a owl:ObjectProperty; rdfs:domain q:Answer; rdfs:range q:Question; owl:inverseOf q:hasOption. q:hasOption a owl:ObjectProperty. q:answerText a owl:DatatypeProperty; rdfs:domain q:Answer; rdfs:range xsd:string. q:questionText a owl:FunctionalProperty, owl:DatatypeProperty; rdfs:domain q:Question; rdfs:range xsd:string. q:Answer a owl:Class. q:Question a owl:Class.
Data (namespace d
):
d:WhatProblem a q:Question; q:hasOption d:STV, d:SInternet, d:SBoth; q:questionText "What system are you having trouble with?". d:STV a q:Answer; q:answerText "Cable TV". d:SInternet a q:Answer; q:answerText "High-speed Internet". d:SBoth a q:Answer; q:answerText "Both". d:TVsymptom a q:Question; q:questionText "What television symptoms are you having?"; q:hasOption d:TVSnothing, d:TVSnosound, d:TVStiling, d:TVSreception. d:TVSnothing a q:Answer; q:answerText "No Picture". d:TVSnosound a q:Answer; q:answerText "No Sound". d:TVStiling a q:Answer; q:answerText "Tiling". d:TVSreception a q:Answer; q:answerText "Bad reception".
owl:someValuesFrom
: Answered questionsFor each question need to know what's selected
q:hasSelectedOption
:
q:hasSelectedOption a owl:ObjectProperty; rdfs:subPropertyOf q:hasOption.
d:WhatProblem
the selected option is d:STV
d:WhatProblem q:hasSelectedOption d:STV
d:WhatProblem
is answered)q:AnsweredQuestion owl:equivalentClass [a owl:Resrtiction; owl:onProperty q:hasSelectedOption; owl:someValuesFrom q:Answer].
owl:allValuesFrom
: Next QuestionsNext questions should depend of what's been asked and answered
q:SelectedAnswer a owl:Class; rdfs:subClassOf q:Answer
q:SelectedAnswer rdfs:range q:SelectedAnswer
d:WhatProblem q:hasSelectedOption d:STV
$\Rightarrow$d:STV a q:SelectedAnswer
now define questions that can be asked: q:EnabledQuestion a owl:Class
q:enablesCandidate
for thatq:enablesCandidate a owl:ObjectProperty; rdfs:domain q:Asnwer; rdfs:range q:Question. d:STV q:enablesCandidate d:TVsymptom. d:SBoth q:enablesCandidate d:TVsymptom.
Restriction:
owl:allValuesFrom
and rdfs:subClassOf
q:SelectedAnswer rdfs:subClassOf [a owl:Restriction; owl:onProperty q:enablesCandidate; owl:allValuesFrom q:EnabledQuestion]
Inference example
d:STV
is selected: d:STV a q:SelectedAnswer
d:STV a [a owl:Restriction; owl:onProperty q:enablesCandidate; owl:allValuesFrom q:EnabledQuestion]
q:enablesCandidate
must be members of q:EnabledQuestion
d:STV q:enablesCandidate d:TVsymptom
infer that d:TVsymptom a q:EnabledQuestion
U a owl:Class; owl:unionOf (ns:A ns:B ...) .
I a owl:Class; owl:intersectionOf (ns:A ns:B ...) .
Example:
q:CandidateQuestions owl:equivalentClass [ a owl:Class; owl:intersectionOf(q:EnabledQuestion q:HighPriorityQuestion)]
Recall the Open World Assumption (see Semantic Web#Main Assumptions)
owl:oneOf
ss:SolarPlanet rdf:type owl:Class; owl:oneOf (ss:Mercury ss:Venus ss:Earth ss:Mars ss:Jupiter ss:Saturn ss:Uranus ss:Neptune).
[a owl:Restriction; owl:onProperty :hasPlayer; owl:cardinality 9]
Also can use:
owl:minCardinality
- lower boundowl:maxCardinality
- upper bound
ex:ClassA owl:complimentOf ex:ClassB
But it includes everything that is not in the complimented class
bb:MinorLeaguePlayer owl:complimentOf bb:MajorLeaguePlayer
bb:MinorLeaguePlayer owl:intersectionOf ( [a owl:Class; owl:complimentOf bb:MajorLeaguePlayer] bb:Player)
bb:MinorLeaguePlayer
s are bb:Player
s who's not in Major League
:Man owl:disjointSet :Woman
:Irene a :Woman
:Ralph a :Man
:Irene owl:differentFRom :Ralph
Protégé