340 likes | 477 Views
Semantic Web. Quratulain Rajput Faculty of Computer Science, IBA Spring2013. Web Ontology Language (OWL). Web Ontology Language (OWL). RDFS is limited in its expression Binary predicate Subclass hierarchy, property hierarchy and Restrictions (domain and range)
E N D
Semantic Web Quratulain Rajput Faculty of Computer Science, IBA Spring2013
Web Ontology Language (OWL) Quratulain Rajput
Web Ontology Language (OWL) • RDFS is limited in its expression • Binary predicate • Subclass hierarchy, property hierarchy and • Restrictions (domain and range) • In order to model more complex knowledge • Require more expressiveness based on formal logics. • Allow logical reasoning. Quratulain
OWL • Since 2004 OWL is W3C recommended standard for modeling of ontologies Quratulain
OWL • In design of OWL, there was a need to find balance between expressivity of the language and scalable reasoning. • Generally, the richer the language is , the more inefficient the reasoning support becomes, often non-computable. • Thus need a compromise, a language supported by reasonably efficient reasoners while sufficiently expressive to express large classes of ontologies. Quratulain
Reasoning with OWL • Class membership • If x is an instance of a class C, and C is a subclass of D, then we can infer that x is an instance of D • Equivalence of classes • If class A is equivalent to class B, and class B is equivalent to class C, then A is equivalent to C, too • Consistency • X instance of classes A and B, but A and B are disjoint • This is an indication of an error in the ontology • Classification • Certain property-value pairs are a sufficient condition for membership in a class A; if an individual x satisfies such conditions, we can conclude that x must be an instance of A A Semantic Web Primer
Uses for Reasoning • Reasoning support is important for • checking the consistency of the ontology and the knowledge • checking for unintended relationships between classes • automatically classifying instances in classes • Reasoning is valuable for • designing large ontologies, where multiple authors are involved • integrating and sharing ontologies from various sources A Semantic Web Primer
Reasoning Support for OWL • OWL is (partially) mapped on a description logic, and makes use of reasonersuch as FaCT, HermiTand RACER etc. • Description logics are a subset of predicate logic for which efficient reasoning support is possible. A Semantic Web Primer
Limited Expressive Power of RDFS • Local scope of properties • rdfs:range defines the range of a property (e.g. eats) for all classes • In RDF Schema we cannot declare range restrictions that apply to some classes only • E.g. we cannot say that cows eat only plants, while other animals may eat meat, too Vegetable eats Animal Food meat A Semantic Web Primer
Limited Expressive Power of RDFS • Disjointness of classes • Sometimes we wish to say that classes are disjoint (e.g. male and female) Male Person Female A Semantic Web Primer
Limited Expressive Power of RDFS • Boolean class Constructs Owl includes: • Negation • Disjunction • Conjunction • Sometimes we wish to build new classes by combining other classes using union, intersection, and complement • E.g. person is the disjoint union of the classes male and female Quratulain Rajput
Limited Expressive Power of RDFS • Cardinality restrictions • E.g. a person has exactly two parents, a course is taught by at least one lecturer • Special characteristics of properties • Transitive property (like “greater than”) • Unique property (like “is mother of”) • A property is the inverse of another property (like “eats” and “is eaten by”) A Semantic Web Primer
Limited Expressive Power of RDFS • The limitation RFDS has been overcome by introducing Web Ontology Language (OWL) Quratulain Rajput
Class Element • Classes defined using owl:class • owl:Class is a subclass of rdfs:Class <owl:Classrdf:about=”Professor”/> Quratulain
Owl:disjointWith <owl:Classrdf:about="#associateProfessor"> <owl:disjointWithrdf:resource="#professor"/> <owl:disjointWithrdf:resource="#assistantProfessor"/> </owl:Class> Quratulain
Owl:equivalenceClass <owl:Classrdf:ID="faculty"> <owl:equivalentClassrdf:resource="#academicStaffMember"/> </owl:Class> <owl:Classrdf:ID="TexasThings"> <owl:equivalentClass> <owl:Restriction> <owl:onPropertyrdf:resource="#locatedIn" /> <owl:someValuesFromrdf:resource="#TexasRegion" /> </owl:Restriction> </owl:equivalentClass> </owl:Class> • Equivalence vssubclassOf : • When A is subclass of B , then A necessarily inherit all characteristics of B , not vice versa Quratulain
Predefined Classes • owl:Thing • owl:Nothing Quratulain
Property Element • RDFS only has rdfs:Property • In owl two kinds of properties: • ObjectProperty • E.g. is-TaughtBy, supervises • DataTypeProperty • E.g. phone, title, age, etc. • More than domain and range can be declare. Quratulain
Properties <owl:ObjectPropertyrdf:ID="isTaughtBy"> <owl:domainrdf:resource="#course"/> <owl:rangerdf:resource= "#academicStaffMember"/> <rdfs:subPropertyOfrdf:resource="#involves"/> </owl:ObjectProperty> <owl:DatatypePropertyrdf:ID="age"> <owl:domainrdf:resource=“#People"/> <rdfs:rangerdf:resource= "http://www.w3.org/2001/XLMSchema #nonNegativeInteger"/> </owl:DatatypeProperty> Quratulain
Inverse Property <owl:ObjectPropertyrdf:ID="teaches"> <rdfs:rangerdf:resource="#course"/> <rdfs:domainrdf:resource= "#academicStaffMember"/> <owl:inverseOfrdf:resource="#isTaughtBy"/> </owl:ObjectProperty> Quratulain
Equivalent Properties owl:equivalentProperty: <owl:ObjectPropertyrdf:ID="lecturesIn"> <owl:equivalentPropertyrdf:resource="#teachesIn"/> </owl:ObjectProperty> A Semantic Web Primer
SubclassOf • As in RDF(S), subclass relationships can be expressed in OWL with the same rdfs:subClassOf property <owl:Classrdf:about=”Professor”> <rdfs:subClassOfrdf:resource=”FacultyMember” /> </owl:Class> Quratulain
Reasoning (Owl:Class) • Classes are also transitive in OWL which lets us draw simple inferences <owl:Classrdf:about=”Professor”> <rdfs:subClassOfrdf:resource=”FacultyMember” /> </owl:Class> <owl:Classrdf:about=”FacultyMember”> <rdfs:subClassOfrdf:resource=”person” /> </owl:Class> • Allow us to infer that Professor is a subclass of Person Quratulain
Reasoning (owl:disjointWith) • If two classes are declared as disjoint using owl:disjointWith property • This means that they do not share any individual (intersection between classes is empty) Quratulain
Reasoning (owl:disjointWith) • Following inference can be done with disjointness property <owl:Classrdf:about=”Professor”> <rdfs:subClassOfrdf:resource=”FacultyMember” /> </owl:Class> <owl:Classrdf:about=”Book”> <rdfs:subClassOfrdf:resource=”Publication” /> </owl:Class> <owl:Classrdf:about=”FacultyMember”> <owl:disjointWithrdf:resource=”Publication” /> </owl:Class> • Allow us to infer that Professor and Book are also disjoint Quratulain
Reasoning (owl:equivalentClass) <owl:Classrdf:about=”Man”> <rdfs:subClassOfrdf:resource=”Person”/> </owl:Class> <owl:Classrdf:about=”person”> <owl:equivalentClassrdf:resource=”Human”/> </owl:Class> • Allows us to infer that man is a subclass of Human Quratulain
Property Restriction • A property restriction is a special kind of class description. It describes an anonymous class, namely a class of all individuals that satisfy the restriction. • OWL distinguishes two kinds of property restrictions: • value constraints and • cardinality constraints. Quratulain
Property Restriction • A value constraint puts constraints on the range of the property • owl:allValuesFrom • owl:someValuesFrom • owl:hasValue • A cardinality constraint puts constraints on the number of values a property can take • owl:maxCardinality • owl:minCardinality Quratulain
Value Constraints <owl:Classrdf:about="#firstYearCourse"> <rdfs:subClassOf> <owl:Restriction> <owl:onPropertyrdf:resource="#isTaughtBy"/> <owl:allValuesFromrdf:resource= #Professor"/> </owl:Restriction> </rdfs:subClassOf> </owl:Class> Quratulain
Cardinality Constraints <owl:Restriction> <owl:onPropertyrdf:resource="#hasParent" /> <owl:minCardinalityrdf:datatype= "&xsd;nonNegativeInteger">2 </owl:minCardinality> </owl:Restriction> Quratulain
Boolean Combination • Union, intersection and compliment of classes. • owl:intersectionOf • owl:unionOf • owl:complementOf Quratulain
Owl:ComplementOf <owl:Class> <owl:complementOf> <owl:Classrdf:about="#Meat"/> </owl:complementOf> </owl:Class> Quratulain Rajput
Owl:unionOf <owl:Classrdf:ID="peopleAtUni"> <owl:unionOfrdf:parseType="Collection"> <owl:Classrdf:about="#staffMember"/> <owl:Classrdf:about="#student"/> </owl:unionOf> </owl:Class> Quratulain
Owl:intersectionOf <owl:Classrdf:ID="facultyInCS"> <owl:intersectionOfrdf:parseType="Collection"> <owl:Classrdf:about="#faculty"/> <owl:Restriction> <owl:onPropertyrdf:resource="#belongsTo"/> <owl:hasValuerdf:resource= "#CSDepartment"/> </owl:Restriction> </owl:intersectionOf> </owl:Class> Quratulain