1.63k likes | 1.77k Views
ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ , ΑΠΘ ΜΕΤΑΠΤΥΧΙΑΚΟ ΠΡΟΓΡΑΜΜΑ ΣΠΟΥΔΩΝ Κατεύθυνση Πληροφοριακών Συστημάτων - 1 ο Εξάμηνο Σημασιολογικός Ιστός lpis .csd.auth.gr/mtpx/sw/index.htm. Διδάσκων: Ν. Βασιλειάδης Αναπλ. Καθ. Τμ. Πληροφορικής ΑΠΘ. Μαθήματα: 6b - 7-8. Chapter 4 Web Ontology Language: OWL.
E N D
ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ, ΑΠΘΜΕΤΑΠΤΥΧΙΑΚΟ ΠΡΟΓΡΑΜΜΑ ΣΠΟΥΔΩΝ Κατεύθυνση Πληροφοριακών Συστημάτων - 1ο Εξάμηνο Σημασιολογικός Ιστόςlpis.csd.auth.gr/mtpx/sw/index.htm Διδάσκων: Ν. Βασιλειάδης Αναπλ. Καθ. Τμ. Πληροφορικής ΑΠΘ Μαθήματα: 6b-7-8
Chapter 4Web Ontology Language: OWL Grigoris Antoniou Frank van Harmelen
Lecture Outline • Basic Ideas of OWL • The OWL Language • Examples • The OWL Namespace • Future Extensions A Semantic Web Primer, 2nd Edition
Expressivity of RDF/RDFS • The expressivity of RDF and RDF Schema is deliberately very limited • RDF is limited to binary ground predicates • RDF Schema is limited to a subclass hierarchy and a property hierarchy, with domain and range definitions of these properties • The Web Ontology Working Group of W3C identified some characteristic use-cases for the Semantic Web that require much more expressiveness than RDF and RDF Schema. A Semantic Web Primer, 2nd Edition
Need for More Powerful Language • Researchers identified the need for a more powerful ontology modeling language. • Initiative to define a richer language DAML+OIL • Join of the U.S. proposal DAML-ONT and the European language OIL • DAML+OIL was the starting point for the definition of the language OWL • Aimed to be the standardized and broadly accepted ontology language of the Semantic Web A Semantic Web Primer, 2nd Edition
Requirements for Ontology Languages • Ontology languages allow users to write explicit, formal conceptualizations of domain models • The main requirements are: • a well-defined syntax • efficient reasoning support • a formal semantics • sufficient expressive power • convenience of expression A Semantic Web Primer, 2nd Edition
Well-Defined Syntax • It is a necessary condition for machine-processing of information • OWL builds upon RDF and RDFS and has the same kind of syntax • The XML-based RDF syntax is not user-friendly • This drawback is not very significant because users will develop their ontologies using authoring or ontology development tools, instead of writing them directly in OWL. A Semantic Web Primer, 2nd Edition
Formal Semantics • A formal semantics describes precisely the meaning of knowledge. • The semantics does not refer to subjective intuitions • The semantics is not open to different interpretations by different people (or machines) • One use of a formal semantics is to allow people to reason about the knowledge. A Semantic Web Primer, 2nd Edition
Tradeoff between Expressive Power and Efficient Reasoning Support • The richer the language is, the more inefficient the reasoning support becomes • Sometimes it crosses the border of noncomputability • We need a compromise: • A language supported by reasonably efficient reasoners • A language that can express large classes of ontologies and knowledge. A Semantic Web Primer, 2nd Edition
Reasoning About Knowledge in Ontology Languages • 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 • If class A is subclass of B, B subclass of C and C subclass of A, then A, B, C are equivalent to each other • 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 • If C and D are equivalent classes, then if x is an instance C, then it is also an instance of D, and vice versa A Semantic Web Primer, 2nd Edition
Reasoning About Knowledge in Ontology Languages (2) • Consistency • X instance of classes A and B, but A and B are disjoint • X is an instance of both A and complement of A • This is an indication of an error in the ontology • Classification • Certainproperty-valuepairsare a sufficientconditionformembershipin a class A • FirstYearCourses are Courses with Year=1 • If anindividual x satisfiessuchconditions, wecanconcludethat x mustbeaninstanceof A A Semantic Web Primer, 2nd Edition
Uses for Reasoning • Reasoning support is important for • checking consistency of ontology and knowledge • checking for unintended relationships between classes • automatically classifying instances in classes • Checks like the preceding ones are valuable for • designing large ontologies, where multiple authors are involved • integrating - sharing ontologies from various sources A Semantic Web Primer, 2nd Edition
Reasoning Support for OWL • Semantics is a prerequisite for reasoning support • Formal semantics and reasoning support are usually provided by • mapping an ontology language to a known logical formalism • using automated reasoners that already exist for those formalisms • OWL is (partially) mapped on a description logic, and makes use of reasoners such as FaCT and RACER • Description logics are a subset of predicate logic for which efficient reasoning support is possible A Semantic Web Primer, 2nd Edition
Limitations of the Expressive Power of RDF Schema • 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 A Semantic Web Primer, 2nd Edition
Limitations of the Expressive Power of RDF Schema (2) • Disjointness of classes • Sometimes we wish to say that classes are disjoint (e.g. male and female) • Boolean combinations of classes • 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 A Semantic Web Primer, 2nd Edition
Limitations of the Expressive Power of RDF Schema (3) • 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, 2nd Edition
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, 2nd Edition
Three Species of OWL • W3C’s Web Ontology Working Group defined OWL as 3 different sublanguages: • OWL Full • OWL DL • OWL Lite • Each sublanguage geared toward fulfilling different aspects of requirements A Semantic Web Primer, 2nd Edition
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 • Any legal RDF document is also a legal OWL Full document • Any valid RDF/RDF Schema conclusion is also a valid OWL Full conclusion • OWL Full is so powerful that it is undecidable • No complete (or efficient) reasoning support A Semantic Web Primer, 2nd Edition
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, 2nd Edition
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, 2nd Edition
Comparison of OWL Sublanguages • Ontology developers adopting OWL should consider which sublanguage best suits their needs. • Choice between OWL Lite - OWL DL: • Do we need the more expressive constructs provided by OWL DL? • Choice between OWL DL-OWL Full: • Do we need the meta-modeling facilities of RDF Schema? • E.g. defining classes of classes, attaching properties to classes. • In OWL Full reasoning support is less predictable than OWL DL, because complete OWL Full implementations are impossible A Semantic Web Primer, 2nd Edition
Upward Compatibility between OWL Species • Every legal OWL Lite ontology is a legal OWL DL ontology • Every legal OWL DL ontology is a legal OWL Full ontology • Every valid OWL Lite conclusion is a valid OWL DL conclusion • Every valid OWL DL conclusion is a valid OWL Full conclusion A Semantic Web Primer, 2nd Edition
OWL Compatibility with RDFSchema • All varieties of OWL use RDF for their syntax • Instances are declared as in RDF, using RDF descriptions and typing information • OWL constructorsarespecialisations of their RDF counterparts A Semantic Web Primer, 2nd Edition
OWL Compatibility with RDFSchema (2) • Semantic Web design aims at downward compatibility with corresponding reuse of software across the various layers • Any OWL-aware processor will also provide correct interpretations of any RDF Schema document. • The advantage of full downward compatibility for OWL is only achieved for OWL Full, at the cost of computational intractability A Semantic Web Primer, 2nd Edition
Lecture Outline • Basic Ideas of OWL • The OWL Language • Examples • The OWL Namespace • Future Extensions A Semantic Web Primer, 2nd Edition
OWL Syntactic Varieties • OWL uses the RDF/XML syntax • Other syntactic forms for OWL : • An alternative, more readable XML syntax (OWL/XML) • Functional syntax: much more compact and readable than the XML languages • Manchester Syntax: designed to be as human-readable as possible. Used in the user interface of most ontology editors (e.g. Protégé) A Semantic Web Primer, 2nd Edition
OWL XML/RDF Syntax: Header <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#"> • An OWL ontology may start with a collection of assertions for housekeeping purposes using owl:Ontology element A Semantic Web Primer, 2nd Edition
owl:Ontology <owl:Ontology rdf: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> • owl:imports is a transitive property A Semantic Web Primer, 2nd Edition
Functional OWL Syntax Ontology( Annotation(rdfs:comment "An example OWL ontology") Annotation(rdfs:label "University Ontology") Annotation(owl:imports http://www.mydomain.org/persons) ) A Semantic Web Primer, 2nd Edition
Imported Ontologies • While namespaces are used for disambiguation purposes, imported ontologies provide definitions that can be used • Usually there will be an import element for each namespace used, but it is possible to import additional ontologies A Semantic Web Primer, 2nd Edition
Classes • Classes are defined using owl:Class • owl:Class is a subclass of rdfs:Class <owl:Class rdf:ID="associateProfessor"> <rdfs:subClassOf rdf:resource="#academicStaffMember"/> </owl:Class> A Semantic Web Primer, 2nd Edition
ClassDisjointness • Disjointness is defined usingowl:disjointWith <owl:Class rdf:about="#associateProfessor"> <owl:disjointWith rdf:resource="#professor"/> <owl:disjointWith rdf:resource="#assistantProfessor"/> </owl:Class> A Semantic Web Primer, 2nd Edition
Class Equivalence • owl:equivalentClass defines equivalence of classes <owl:Class rdf:ID="faculty"> <owl:equivalentClass rdf:resource="#academicStaffMember"/> </owl:Class> A Semantic Web Primer, 2nd Edition
Functional OWL Syntax Declaration(Class(<#academicStaffMember>)) Declaration(Class(<#associateProfessor>)) Declaration(Class(<#Professor>)) SubClassOf(<#associateProfessor> <#academicStaffMember>) Declaration(Class(<#faculty>)) EquivalentClasses(<#faculty> <#academicStaffMember>) DisjointClasses(<#assistantProfessor> <#associateProfessor>) DisjointClasses(<#associateProfessor> <#professor>) A Semantic Web Primer, 2nd Edition
Manchester Syntax Class: uni:professor DisjointWith: uni:associateProfessor Class: uni:assistantProfessor Class: uni:associateProfessor SubClassOf: uni:academicStaffMember DisjointWith: uni:professor, uni:assistantProfessor Class: uni:academicStaffMember EquivalentTo: uni:faculty A Semantic Web Primer, 2nd Edition
owl:Thingandowl:Nothing • Predefined classes • owl:Thing is the most general class, which contains everything • owl:Nothing is the empty class • Εvery class is a subclass of owl:Thing and a superclass of owl:Nothing. A Semantic Web Primer, 2nd Edition
Properties • In OWL there are two kinds of properties • Object properties, which relate objects to other objects • E.g. is-TaughtBy, supervises • Data type properties, which relate objects to datatype values • E.g. phone, title, age, etc. A Semantic Web Primer, 2nd Edition
Datatype Properties • OWL makes use of XML Schema data types, using the layered architecture of the SW <owl:DatatypeProperty rdf:ID="age"> <rdfs:range rdf:resource=“&xsd;nonNegativeInteger”/> </owl:DatatypeProperty> A Semantic Web Primer, 2nd Edition
Object Properties • User-defined data types <owl:ObjectProperty rdf:ID="isTaughtBy"> <rdfs:domain rdf:resource="#course"/> <rdfs:range rdf:resource="#academicStaffMember"/> <rdfs:subPropertyOf rdf:resource="#involves"/> </owl:ObjectProperty> A Semantic Web Primer, 2nd Edition
Multiple domains/ranges • More than 1domain and range may be declared • The intersection of the domains (ranges) is taken. <owl:DatatypeProperty rdf:ID=“name"> <rdfs:domain rdf:resource=“#Customer”/> <rdfs:domain rdf:resource=“#Employee”/> </owl:DatatypeProperty> A Semantic Web Primer, 2nd Edition
Inverse Properties <owl:ObjectProperty rdf:ID="teaches"> <rdfs:range rdf:resource="#course"/> <rdfs:domain rdf:resource="#academicStaffMember"/> <owl:inverseOf rdf:resource="#isTaughtBy"/> </owl:ObjectProperty> • Domain and range can be inherited from the inverse property • Interchange domain with range. A Semantic Web Primer, 2nd Edition
Equivalent Properties <owl:ObjectProperty rdf:ID="lecturesIn"> <owl:equivalentProperty rdf:resource="#teaches"/> </owl:ObjectProperty> A Semantic Web Primer, 2nd Edition
Functional OWL Syntax (1) Declaration(DataProperty(<#age>)) DataPropertyRange(<#age> <http://www.w3.org/2001/XMLSchema#nonNegativeInteger>) Declaration(ObjectProperty(<#isTaughtBy>)) SubObjectPropertyOf(<#isTaughtBy> <#involves>) ObjectPropertyDomain(<#isTaughtBy> <#course>) ObjectPropertyRange(<#isTaughtBy> <#academicStaffMember>) InverseObjectProperties(<#teaches> <#isTaughtBy>) A Semantic Web Primer, 2nd Edition
Functional OWL Syntax (2) Declaration(ObjectProperty(<#lecturesIn>)) EquivalentObjectProperties(<#lecturesIn> <#teaches>) Declaration(ObjectProperty(<#teaches>)) EquivalentObjectProperties(<#teaches> <#lecturesIn>) InverseObjectProperties(<#teaches> <#isTaughtBy>) ObjectPropertyDomain(<#teaches> <#academicStaffMember>) ObjectPropertyRange(<#teaches> <#course>) A Semantic Web Primer, 2nd Edition
Manchester Syntax ObjectProperty: uni:teaches EquivalentTo: uni:lecturesIn Domain: uni:academicStaffMember Range: uni:course InverseOf: uni:isTaughtBy ObjectProperty: uni:lecturesIn EquivalentTo: uni:teaches DataProperty: uni:age Range: <http://... #nonNegativeInteger> ObjectProperty: uni:isTaughtBy SubPropertyOf: uni:involves Characteristics: Functional Domain: uni:course Range: uni:academicStaffMember InverseOf: uni:teaches
Property Restrictions • In OWL we can declare that the class C satisfies certain conditions • All instances of C satisfy the conditions • This is equivalent to saying that C is subclass of a class C', where C' collects all objects that satisfy the conditions • C' can remain anonymous A Semantic Web Primer, 2nd Edition
Explanation of Restrictions • If an object x belongs to a class C, then it satisfies the restriction R • xC R(x) • Necessary condition (if an object belongs to a class, then it necessarily satisfies the restriction) • Let R be the class of all objects that satisfy R • This includes necessarily all objects of class C and possibly other objects • Thus, CR (C subclass of R) A Semantic Web Primer, 2nd Edition
Explanation of Restrictions (2) • If class R includes objects ONLY of class C, this means that there are not objects that satisfy the restriction other than objects of class C • Classes R and C contain exactly the same objects • They are equivalent (C≡R CR RC) • Additional condition: If an object x belongs to a class R (i.e. it satisfies the restriction R), then it must belong to class C (since C and R are equivalent) • R(x) xC • Sufficient condition (if an object satisfies the restriction, then this is sufficient to belong to the class) A Semantic Web Primer, 2nd Edition
Property Restrictions (2) • A (restriction) class is achieved through an owl:Restriction element • This element contains an owl:onProperty element and one or more restriction declarations • One type of restriction declarations defines cardinality restrictions(at least 1, at most 3, etc.) A Semantic Web Primer, 2nd Edition