Knowledge Representation Part VII Protégé / RDFS / OWL / ++ Jan Pettersen Nytun, UiA 1
S O P Outline • Protégé example • RDFS • OWL • Some W3C documents concerning OWL 2 Jan Pettersen Nytun, UiA, Ontologies, page 2
S O P The Semantic Web Language Stack Hierarchy of languages, where each layer exploits and uses capabilities of the layers below. / XML Schema Jan Pettersen Nytun, UiA, page 3
S Individuals O P [4] Jan Pettersen Nytun, UiA, page 4
Setting Default Namespace S O P Explicitly • I found some problems like double #’s in the stored file when not explicitly stating the namespace. Explicitly stating the default namespace Jan Pettersen Nytun, UiA, page 5
S Turle File O P @prefix : <http://www.uia.no/IKT437/janpettersennytun/ontologies/lecture5#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @base <http://http://www.uia.no/IKT437/janpettersennytun/ontologies/lecture5#> . <http://http://www.uia.no/IKT437/janpettersennytun/ontologies/lecture5#> rdf:type owl:Ontology . Jan Pettersen Nytun, UiA, page 6
S Turle File Continues... O P ######################################################## # # Object Properties # ######################################################## :hasSibling rdf:type owl:ObjectProperty . :livesIn rdf:type owl:ObjectProperty . Jan Pettersen Nytun, UiA, page 7
S Turle File Continues... O P ################################################################# # # Individuals # ################################################################# :England rdf:type owl:NamedIndividual , owl:Thing . :Gemma rdf:type owl:NamedIndividual , owl:Thing . :Matthew rdf:type owl:NamedIndividual , owl:Thing ; :livesIn :England ; :hasSibling :Gemma . Jan Pettersen Nytun, UiA, page 8
S Adding Classes O P Jan Pettersen Nytun, UiA, page 9
S O P ########################################################## # # Classes # ########################################################## :Country rdf:type owl:Class . :Person rdf:type owl:Class . Jan Pettersen Nytun, UiA, page 10
S O P # Individuals :England rdf:type :Country , owl:NamedIndividual . :Gemma rdf:type :Person , owl:NamedIndividual . :Matthew rdf:type :Person , owl:NamedIndividual ; :livesIn :England ; :hasSibling :Gemma . Jan Pettersen Nytun, UiA, page 11
S O P [4]: In OWL classes are built up of descriptions that specify the conditions that must be satisfied by an individual for it to be a member of the class. Jan Pettersen Nytun, UiA, page 12
S O P Which Syntax Does Protégé Uses? Jan Pettersen Nytun, UiA, Ontologies, page 13
S Protégé Uses O P The Manchester OWL Syntax in Dialog Windows • The Manchester syntax [ OWL 2 Manchester Syntax ] is an OWL syntax that is designed to be easier for non-logicians to read. Jan Pettersen Nytun, UiA, Ontologies, page 14
S Save Ontology Using The Manchester Syntax O P Prefix: : <http://www.uia.no/IKT437/janpettersennytun/ontologies/lecture5#> Prefix: owl: <http://www.w3.org/2002/07/owl#> Prefix: rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> Prefix: xml: <http://www.w3.org/XML/1998/namespace> Prefix: xsd: <http://www.w3.org/2001/XMLSchema#> Prefix: rdfs: <http://www.w3.org/2000/01/rdf-schema#> Ontology: <http://http://www.uia.no/IKT437/janpettersennytun/ontologies/lecture5#> ObjectProperty: <http://http://www.uia.no/IKT437/janpettersennytun/ontologies/lecture5#livesIn> ObjectProperty: <http://http://www.uia.no/IKT437/janpettersennytun/ontologies/lecture5#hasSibling> Class: <http://http://www.uia.no/IKT437/janpettersennytun/ontologies/lecture5#Person> Class: <http://http://www.uia.no/IKT437/janpettersennytun/ontologies/lecture5#Country> Jan Pettersen Nytun, UiA, Ontologies, page 15
Individual: Matthew Types: <http://http://www.uia.no/IKT437/janpettersennytun/ontologies/lecture5#Person> Facts: <http://http://www.uia.no/IKT437/janpettersennytun/ontologies/lecture5#livesIn> <http://http://www.uia.no/IKT437/janpettersennytun/ontologies/lecture5#England>, <http://http://www.uia.no/IKT437/janpettersennytun/ontologies/lecture5#hasSibling> <http://http://www.uia.no/IKT437/janpettersennytun/ontologies/lecture5#Gemma> Individual: <http://http://www.uia.no/IKT437/janpettersennytun/ontologies/lecture5#Gemma> Types: <http://http://www.uia.no/IKT437/janpettersennytun/ontologies/lecture5#Person> Individual: <http://http://www.uia.no/IKT437/janpettersennytun/ontologies/lecture5#England> Types: <http://http://www.uia.no/IKT437/janpettersennytun/ontologies/lecture5#Country>
S O P Outline • Protégé example • RDFS • OWL • Some W3C documents concerning OWL 2 Jan Pettersen Nytun, UiA, Ontologies, page 17
S RDFS O P Allows definition of (simple) ontologies. RDFS gives some fundamental concepts, e.g.: • subClassOf • subPropertyOf • Domain and range • … Jan Pettersen Nytun, UiA, 18
S rdfs:subClassOf O P The members of one class (the subclass) are also members of the other (the super class). :Female rdf:type owl:Class ; rdfs:subClassOf :Human . Tools like reasoners “understands” the semantics of subClassOf. Jan Pettersen Nytun, UiA, 19
S O P rdfs:subPropertyOf The pair related by one property (the sub property) are included in the other (the super property). :hasSon rdf:type owl:ObjectProperty ; rdfs:subPropertyOf :isParentTo . Jan Pettersen Nytun, UiA, 20
S Property Domains and Ranges O P • Properties link individuals from the domain to individuals from the range (or to “data” if for instance type is String). • Pizza ontology example: - the property hasTopping links individuals belonging to class Pizza (domain) to individuals belonging to the class of PizzaTopping (range). • It is important to realize that in OWL domains and ranges should not be viewed as only constraints to be checked. They are used as `axioms' in reasoning. Jan Pettersen Nytun, UiA, 21
S O P Domain and Range can be used to describe a property. They determine the class membership of individuals related by the property. Given the 2 triples: From Wikipedia, the :employer rdfs:domain :Person free encyclopedia :employer rdfs:range :Organization Then triple: :John :employer :CompanyX Requires that: - :John is necessarily a :Person - :CompanyX is necessarily a :Organization Jan Pettersen Nytun, UiA, 22
S Multiple Classes As The Range O P For A Property This is interpreted as the intersection of the classes. For example, if the range of a property has the classes Man and Woman , the range of the property is interpreted as Man intersection Woman (this range would then be very small in number of individuals since not many are man and woman at the same time) . Jan Pettersen Nytun, UiA , 23
S O P Did not work for me! Jan Pettersen Nytun, UiA, page 24
S This Seems to Work Fine! O P somePizza and someTopping are individuals stated to be of type Thing Jan Pettersen Nytun, UiA, page 25
S Limitations Of RDFS O P [5] … modelers often need even richer and more expressive primitives to specify the formal semantics of Web resources… For example, one cannot state in RDFS that “this class is equivalent to this other class”, and cannot specify cardinality constraints. Jan Pettersen Nytun, UiA, 26
S O P Outline • Protégé example • RDFS • OWL • Some W3C documents concerning OWL 2 Jan Pettersen Nytun, UiA, Ontologies, page 27
S OWL O P OWL extends the possibilities found in RDFS, e.g.: • equivalentClass • inverseOf • transitiveProperty • SymetricProperty • … Jan Pettersen Nytun, UiA, 28
S Part Of OWL Metamodel [5] O P Jan Pettersen Nytun, UiA, Ontologies, page 29
Unique Name Assumption (UNA) S O P in Logic • UNA different names always refer to different entities in the world. • Protégé-OWL is based on UNA. • OWL is not based on UNA. OWL supplies explicit constructs: – owl:sameAs (property) two given names or identifiers (e.g., URIs) refer to the same individual or entity. – owl:differentFrom (property) two given names or identifiers (e.g., URIs) refer to different individuals or entities. Jan Pettersen Nytun, UiA, page 30
S Disjoint Classes O P • OWL Classes are assumed to “overlap”, e.g., an individual may be of several classes. • It is however possible to specify that two classes are disjoint. Knowledge Representation Part III, JPN, UiA Jan Pettersen Nytun, UiA , 31
S OWL O P Property types • There are two main types of properties: – Object properties. – Datatype properties. • Additionally: Annotation properties can be used to add metadata (data about data). Knowledge Representation Part II, JPN, UiA 32
S O P Property Characteristics OWL allows the meaning of properties to be enriched through the use of property characteristics. E.g., inverse property . Knowledge Representation Part III, JPN, UiA 33
Recommend
More recommend