Download presentation
Published byChastity Marilynn Allen Modified over 9 years ago
1
OWL Representing Information Using the Web Ontology Language 1
2
Section 3 2
3
Section 3 Chapter 11: Encoding an OWL Ontology
Organization of OWL files Chapter 12: Defining OWL Lite Classes & Properties Definition of simple classes; pre-defined OWL classes Chapter 13: Describing OWL Lite Property Characteristics Global & local property restrictions; inference shortcuts Chapter 14: Deriving OWL Lite Classes Class descriptions, subclasses, equivalency, intersections Chapter 15: Describing Individuals Unique names assumption; instantiate, relate individuals Chapter 16: OWL Lite Summary Summary of OWL Lite constructs 3
4
Chapter 11 4
5
11 Encoding an OWL Ontology
OWL Ontology encodings Defined in web documents Referenced using URI Developed like software (requirements, design) Use one of the OWL dialects Use RDF/XML syntax Describe classes & properties OWL knowledge base Ontology Instance data Datatypes Chapter describes OWL ontology file structure Header Body Footer 5
6
11.1 OWL Ontology File Structure
Figure shows Relationship between ontology files, namespaces, & related files Distribution of ontology files on web servers Ontologies can extend other ontologies hosted across network Instances Reference ontologies Ontologies Extend/reuse ontologies Built on XMLS datatypes 6
7
11.1 Ontology File Structure cont’d
OWL documents Best practice: use .owl extension Include owl:Ontology element Class definitions Property definitions Typical format Header Body Footer 7
8
11.2 OWL Header OWL ontology file begins with header
Specifies RDF start tag <rdf> Includes namespace attributes Includes ontology element Contains versioning & imports 8
9
11.2.1 XML Declaration & RDF Tag
OWL ontologies represented using RDF/XML Best practice: begin file with XML declaration including version and encoding <?xml version="1.0" encoding="UTF-8"?> <rdf:RDF> start tag containing namespace declarations <rdf:RDF namespaceDeclarations> Defined in the next section 9
10
11.2.2 Namespaces for OWL Ontologies
Namespace declarations Attributes of <rdf:RDF> start tag Identify abbreviated references in ontology file Make file more readable for humans Can be used in tag & attribute names, not values Use XML entities for values, if desired 3 types of namespaces Standard namespace references Part of OWL standard: XMLS, RDF, RDFS, OWL Namespaces associated with imported ontologies Setup shorthand abbreviations to reference URIs Namespaces identifying ontology being defined Defined implicitly by document URI, explicitly by “xml:base”, or “xmlns” attribute 10
11
11.2.2 Ontology Namespaces cont’d
Best practice Order namespaces from bottom to top XMLS (for datatypes) RDF RDFS OWL Reused ontologies Extended ontologies Current ontology 11
12
11.2.2 Ontology Namespaces cont’d
XML Schema Datatypes namespace (xsd prefix) xmlns:xsd=" RDF namespace (rdf prefix) xmlns:rdf=" RDFS namespace (rdfs prefix) xmlns:rdfs=" OWL namespace (owl prefix) xmlns:owl=" Imported namespace (user-defined prefix) xmlns:pasta=" Ontology namespace (user-defined prefix) xmlns=" or URI of containing document or Value of xml:base attribute 12
13
11.2.2 Ontology Namespaces cont’d
xml:base attribute used to expand RDF URIrefs Best practice: Either Include xml:base in ontology file or Use fully-resolved URIs in rdf:about attribute values Example <rdf:RDF xmlns:xsd=" xmlns:rdf=" xmlns:rdfs=" xmlns:owl=" xmlns:pasta=" xmlns=" xml:base=" > 13
14
11.2.3 Ontology Element owl:Ontology element
Built-in class used to instantiate ontologies Header only, not classes, properties, instances Optional but recommended Provides metadata including Version information Imports RDF comments Should include rdf:about attribute Empty value ("") means current ontology Default name: URI of document, unless xml:base specified 14
15
11.2.3 Ontology Element cont’d
owl:Ontology element Recommended practices Give name using rdfs:label property Comment using rdfs:comment property Syntax <owl:Ontology rdf:about="optionalOntologyName"> </owl:Ontology> Example <owl:Ontology rdf:about=""> <rdfs:label>Restaurant Menu</rdfs:label> <rdfs:comment>Describes basic concepts representing a restaurant’s menu</rdfs:comment> </owl:Ontology> 15
16
11.2.3.1 Versioning Information
OWL provides explicit versioning info including Ontology-level versioning Compatibility statements about previous versions Deprecation declarations Classes & properties for backward compatibility 16
17
11.2.3.1.1 Version Information owl:versionInfo property Syntax Example
String representing ontology’s version Can use RCS, CVS, Subversion keywords (see example) Documentation comment; no logical meaning Normally used for ontologies but can be applied to any owl:Thing Best practice: use owl:versionInfo in each OWL document May eventually evolve into parseable “Dublin Core” items Domain: Instance of owl:Thing, Range: Instance of rdfs:Literal Syntax <owl:versionInfo>versionText</owl:versionInfo> Example <owl:Ontology> <owl:versionInfo>$Id: restaurantMenu-ont.owl,v /08/30 12:34:56 llacy Exp$</owl:VersionInfo> </owl:Ontology> 17
18
11.2.3.1.1.1 Indicating Earlier Version
owl:priorVersion property Relates newer version to previous version Tracks ontology version history Domain & Range: Instance of owl:Ontology Syntax <owl:priorVersion rdf:resource="priorOntURI"/> Example <owl:Ontology rdf:about=""> <owl:priorVersion rdf:resource=" </owl:Ontology> 18
19
11.2.3.1.1.2 Backward-Compatibility
owl:backwardCompatibleWith property Explicitly states that all constructs in this version have the same meaning as in the prior version Subproperty of owl:priorVersion If not explicitly stated, incompatibility assumed Domain & Range: Instance of owl:Ontology Syntax <owl:backwardCompatibleWith rdf:resource="olderOntURI"/> Example <owl:Ontology rdf:about=""> <owl:backwardCompatibleWith rdf:resource="&kor;Menu ont"/> <rdfs:comment>added new menu items since 06/22/04</rdfs:comment> </owl:Ontology> 19
20
11.2.3.1.1.3 Incompatible Ontologies
owl:incompatibleWith property Identifies prior versions that this ontology supersedes and is inconsistent with Subproperty of owl:PriorVersion Best practice: include incompatibility comments Domain & Range: Instance of owl:Ontology Syntax <owl:incompatibleWith rdf:resource="olderOntURI"/> Example <owl:Ontology rdf:about=""> <owl:incompatibleWith rdf:resource="&kor;Menu ont"/> <rdfs:comment>added new menu items</rdfs:comment> </owl:Ontology> 20
21
11.2.3.1.1.4 Deprecating Classes owl:DeprecatedClass class Syntax
Identifies classes no longer supported in future versions Supports short-term compatibility Existing ontologies should upgrade to new concepts as soon as possible Signals long-term incompatibility New ontologies should not reference deprecated classes No semantics; treated as comment by parser Best practice: provide comment indicating replacement class Syntax <owl:DeprecatedClass rdf:about="OldClassName"> Example <owl:DeprecatedClass rdf:about="#Pie"> <rdfs:comment>Use DessertPie instead</rdfs:comment> </owl:DeprecatedClass> 21
22
11.2.3.1.1.5 Deprecating Properties
owl:DeprecatedProperty class Identifies properties no longer supported in future versions Same concepts as owl:DeprecatedClass Best practice: provide comment indicating replacement property Syntax <owl:DeprecatedProperty rdf:about="oldPropertyName"> Example <owl:DeprecatedProperty rdf:about="#cost"> <rdfs:comment>Use menuPrice instead</rdfs:comment> </owl:DeprecatedProperty> 22
23
11.2.3.1.1.6 Versioning Summary Construct Purpose owl:versionInfo
Provides version information owl:priorVersion Identifies earlier version of subject ontology owl:backwardCompatibleWith Identifies earlier version compatible with subject ontology owl:incompatibleWith Identifies earlier version incompatible with owl:DeprecatedClass Identifies class that should no longer be used owl:DeprecatedProperty Identifies property that should no longer be used Versioning constructs Documentation only Do not provide additional semantics Not intended for use by inferencing engines 23
24
11.2.3.2 Importing Ontologies owl:imports property
Allows an ontology to reference and extend another ontology Supports incremental & distributed ontologies Similar to “include”/“import” in programming languages Introduces dependencies Made in the ontology element of importing ontology Domain & Range: Instance of owl:Ontology OWL ontology always implicitly imported Syntax <owl:imports rdf:resource="URIofImportedOntology"/> Example <owl:imports rdf:resource=" 24
25
11.2.3.2 Namespace vs. Imports cont’d
Namespace declarations Create prefix abbreviations for identifiers owl:imports properties Include all constructs from ontology referenced in URI Use namespace declaration to create shortened names to reference ontology constructs Example <rdf:RDF xmlns:pasta=" <owl:Ontology about=""> <owl:imports rdf:resource=" </owl:Ontology> 25
26
11.2.3.2 Imports Rules cont’d Multiple imports permitted
owl:imports are transitive A imports B B imports C Therefore A imports C No effect if ontology imports itself (prevents cycles) If A imports B and B imports A, A and B are equivalent If imported ontology not accessible at specified URI during runtime, it may prevent use of importing ontology 26
27
11.2.3.3 Ontology Element Summary
owl:Ontology element provides metadata Version information (owl:versionInfo & related) Name (rdfs:label property) Descriptive comments (rdfs:comment property) Imported ontologies (owl:imports property) Example complete ontology element <owl:Ontology rdf:about=""> <owl:versionInfo>v /10/24</owl:versionInfo> <rdfs:comment>Restaurant Menu ontology</rdfs:comment> <owl:imports rdf:resource="&rest;2004/08/food-ont"/> <owl:priorVersion rdf:resource="&rest;2004/07/Menu-ont"/> <owl:incompatibleWith rdf:resource="&rest;2004/06/Menu-ont"/> <owl:backwardCompatibleWith rdf:resource="&rest;2004/07/Menu- ont"/> <owl:Ontology> 27
28
11.2.4 OWL Header Summary OWL file header contains
RDF tag and namespace properties owl:Ontology element 28
29
11.3-4 OWL File Body & Footer OWL file body
Contains class & property definitions Classes derive from owl:Class; share similar properties Values are XMLS datatypes or object instances Properties define relationships between classes & values Order is not important Forward references are permitted Co-occurring statements assumed to be conjunctive (AND) “Open World Assumption” Anything that is not explicitly stated cannot be assumed to be either true or false. Statements can only be added, not deleted. Limits inferencing and deductive power OWL files end with </rdf:RDF> end tag 29
30
11.5 OWL Encoding Summary OWL ontologies specified through statements in ontology files Ontology files contain Header contains Namespaces Versioning Information Import Statements Body contains statements about Classes Properties Relationships Footer (rdf:RDF end tag) 30
31
Chapter 12 31
32
12 Defining Basic Classes & Properties
OWL Lite classes Based on owl:Class, a richer subclass of rdfs:Class 2 basic class types Simple named classes Predefined classes owl:Thing, owl:Nothing OWL Lite properties Based on rdf:Property 4 basic property types owl:DatatypeProperty, owl:ObjectProperty, owl:AnnotationProperty, owl:OntologyProperty 32
33
12.1 Defining a Simple Named Class
Simple named classes Defined with owl:Class element & rdf:ID attribute Does nothing but declare a name (URI) Within same file, often referenced by fragment (#classname) All statements about a class apply to its individuals Best practices: Name using UpperCamelCase Use rdfs:label and rdfs:comment to document Syntax <owl:Class rdf:ID="className"/> Example <owl:Class rdf:ID="KeyLimePie"> <rdfs:label>Key Lime Pie</rdfs:label> <rdfs:comment>Custard pie made with Key lime juice</rdfs:comment> </owl:Class> 33
34
12.2 Predefined OWL Classes
OWL defines two “extreme” classes owl:Thing Used in statements that apply to all instances owl:Nothing Used in statements that apply to no instances 34
35
12.2.1 Thing Class owl:Thing class Most general class in OWL
Root class for all classes Even rdf:Resource, root class of RDF Every individual is a member of owl:Thing Every class is a subclass of owl:Thing Equal to the union of any class and its complement Set equivalent of “universe” Can be used to make global assertions 35
36
12.2.2 Nothing class owl:Nothing class Subclass of all classes
Empty class No member individuals Set equivalent of “null set” 36
37
12.3 Describing OWL Lite Properties
Are binary relations from one individual (domain) to another individual or a value (range) Enable specification of facts (attribute/value pairs) Four disjoint property types in OWL Datatype properties relate objects to datatype values Object properties relate objects to other objects Annotation properties describe objects Ontology properties relate ontologies to other ontologies 37
38
12.3.1 Datatype Properties owl:DatatypeProperty class Syntax
Identifies a property whose value is a member of a datatype (typed or untyped literals) Strings or simple XMLS datatypes Reasoners use them to interpret a statement’s datatype value Syntax <owl:DatatypeProperty rdf:ID="propertyName"/> Example (specification) <owl:DatatypeProperty rdf:ID="restCloseTime"> <rdfs:domain rdf:resource="#Restaurant"/> <rdfs:range rdf:resource="&xsd;time"/> </owl:DatatypeProperty> Example (use) <rest:Restaurant rdf:ID="JoesPizza"> <restCloseTime rdf:datatype="&xsd;time">21:00:00+01:00</restCloseTime> </rest:Restaurant> 38
39
12.3.2 Object Properties owl:ObjectProperty class Syntax
Identifies property whose value is reference to another individual Value is a resource Points Reasoner to resource containing desired value “What is the name of the owner of Knight Owl Restaurant?” (see below) Syntax <owl:ObjectProperty rdf:ID="propertyName"/> Example (specification) <owl:ObjectProperty rdf:ID="restOwnedBy"/> Example (use) <rest:Person rdf:ID="person123"> <personName>Jason Relles</personName> </rest:Person> <rest:Restaurant rdf:ID="KnightOwlRestaurant"> <ownedBy rdf:resource="#person123"/> </rest:Restaurant> 39
40
12.3.3 Annotation Properties
owl:AnnotationProperty class Identifies property that describes a construct Superclass of rdfs:label, rdfs:comment, rdfs:seeAlso, rdfs:isDefinedBy, owl:versionInfo Domain: named class, property, individual, or ontology Range: individual, data literal, URIref Syntax <owl:AnnotationProperty rdf:about="uriRef"/> Example <owl:AnnotationProperty rdf:about="&rest;reviewer"/> 40
41
12.3.4 Ontology Properties owl:OntologyProperty class
Relates two owl:Ontology instances Superclass of owl:imports, owl:priorVersion, owl:backwardCompatibleWith, owl:incompatibleWith Not often used in practice 41
42
12.4 Classes & Properties Summary
Basic classes are defined using owl:Class owl:Thing is a universal root class & contains everything owl:Nothing is a universal subclass & contains nothing Datatype properties relate objects to literal values Object properties relate objects to other objects Annotation properties provide additional information Ontology properties relate ontologies to other ontologies 42
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.