310 likes | 581 Views
Web Ontology Language (OWL). Lecture # 10 Faculty of Computer Science, IBA. Combining OWL with RDF Schema. Ideally, OWL would extend RDF Schema Consistent with the layered architecture of the Semantic Web
E N D
Web Ontology Language (OWL) Lecture # 10 Faculty of Computer Science, IBA
Combining OWL with RDF Schema • Ideally, OWL would extend RDF Schema • Consistent with the layered architecture of the Semantic Web • But simply extending RDF Schema would work against obtaining expressive power and efficient reasoning • Combining RDF Schema with logic leads to uncontrollable computational properties A Semantic Web Primer
Three Species of OWL • W3C’sWeb Ontology Working Group defined OWL as three different sublanguages: • OWL Full • OWL DL • OWL Lite • Each sublanguage geared toward fulfilling different aspects of requirements A Semantic Web Primer
OWL Full • It uses all the OWL languages primitives • It allows the combination of these primitives in arbitrary ways with RDF and RDF Schema • OWL Full is fully upward-compatible with RDF, both syntactically and semantically • OWL Full is so powerful that it is undecidable • No complete (or efficient) reasoning support A Semantic Web Primer
OWL DL • OWL DL (Description Logic) is a sublanguage of OWL Full that restricts application of the constructors from OWL and RDF • Application of OWL’s constructors’ to each other is disallowed • Therefore it corresponds to a well studied description logic • OWL DL permits efficient reasoning support • But we lose full compatibility with RDF: • Not every RDF document is a legal OWL DL document. • Every legal OWL DL document is a legal RDF document. A Semantic Web Primer
OWL Lite • An even further restriction limits OWL DL to a subset of the language constructors • E.g., OWL Lite excludes enumerated classes, disjointness statements, and arbitrary cardinality. • The advantage of this is a language that is easier to • grasp, for users • implement, for tool builders • The disadvantage is restricted expressivity A Semantic Web Primer
The OWL Language: Syntax • XML-Syntax • Abstract Syntax • Graphic Syntax Quratulain
The OWL Language: Header • OWL document contains information about namespaces, versioning and annotations • No direct impact on knowledge but mainly needed for usability • Every OWL document is an RDF document • Contains a root element: <rdf:RDF xmlns:owl ="http://www.w3.org/2002/07/owl#" xmlns:rdf ="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xsd ="http://www.w3.org/2001/XLMSchema#"> Quratulain
The OWL Language: Header OWL document may contain general information about ontology: <owl:Ontologyrdf:about=""> <rdfs:comment>An example OWL ontology </rdfs:comment> <owl:priorVersion rdf:resource="http://www.mydomain.org/uni-ns-old"/> <owl:imports rdf:resource="http://www.mydomain.org/persons"/> <rdfs:label>University Ontology</rdfs:label> </owl:Ontology> Quratulain
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> Quratulain
Predefined Classes • owl:Thing • owl:Nothing Quratulain
Property Element • 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="#teaches"/> </owl:ObjectProperty> A Semantic Web Primer
As in RDF(S), subclass relationships can be expressed in OWL with the same rdfs:subClassOfproperty <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:disjointWithproperty • This means that they do not share any individual (intersection between classes is empty) Quratulain
Reasoning (owl:disjointWith) • Following inference can be done with disjointnessproperty <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: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