Introduction to OWL


Monsoon 2018
Instructor: Raghava Mutharaju
IIIT-Delhi
IIIT Delhi

OWL (Web Ontology Language)


  • OWL is a knowledge representation language used to build ontologies
  • OWL 2 is the latest version of the W3C standard
  • Three types of entities (elements used to refer to real-world objects)
    1. Classes: They are used to group sets of individuals that have something in common among them.
      Eg: Car, Student, Employee, Father, Mother
    2. Properties: They are the binary relations between the individuals.
      Eg: hasDaughter, hasSpouse, worksFor
    3. Individuals: They are the instances or constants in the domain
      Eg: mary (is a Woman), julie (is a Parent)
  • All the entities are identified by using IRIs

Identifiers and Naming Conventions

Identifiers


  • URL (Uniform Resource Locator)
    • It is a mechanism to specify and locate a web resource on a computer network.
    • Eg: http://, ftp://
  • URN (Uniform Resource Name)
    • They are persistent location independent identifiers that use the urn scheme.
    • Eg: ISBN of a book is a URN used to identify a book uniquely

Identifiers


  • URI (Uniform Resource Identifier)
    • It is an identifier that can uniquely and unambiguously identify resources
    • ASCII encoding is used in the identifiers
    • URL and URN are type of URIs. URIs and URNs need not be resolvable to a location, which is the case with URL
    • Eg: http://www.w3.org/2002/07/owl#
  • IRI (International Resource Identifier)
    • IRI is similar to URI except that the character set for encoding the identifier is Universal Character Set (UTF-8)
    • Eg: é, ö could be used in IRI

Naming Conventions


  • Class: They are written in upper camel case (or Pascal case) where every first letter in a compound word is capitalized
    Eg: Father, Parent, MyBirthdayGuests
  • Properties: They are written in lower camel case where every first letter in a compound word excluding the first word is capitalized
    Eg: hasDaughter, hasAge
  • Individuals: same as Properties
    Eg: mary, john, julie

OWL Syntax

  • Following syntaxes are supported by OWL
    • Functional-Style syntax
    • RDF/XML
    • OWL/XML
    • Manchester syntax
  • We will follow the functional syntax since it is human friendly
  • Declaration(Class(Person))
  • Declaration(NamedIndividual(mary))
  • ClassAssertion(Person mary)
  • ClassAssertion(Women mary)
  • ObjectPropertyAssertion(hasWife john mary)

  • Axioms: Basic statements such as the above are called axioms of an OWL ontology
  • Entities: Class, Properties, and Individuals
  • Expression: combinations of entities to form complex descriptions from basic ones
  • All these together capture the knowledge of a domain

Class Hierarchy


  • SubClassOf(Woman Person)
  • SubClassOf(Mother Woman)
  • EquivalentClasses(Person Human)
    • SubClassOf(Person Human)
    • SubClassOf(Human Person)
  • DisjointClasses(Mother Father)

Property Hierarchy


  • SubPropertyOf(hasDaughter hasChild)
  • SubPropertyOf(parentOf ancestorOf)
  • DisjointProperties(parentOf childOf)

Object and Data Properties


  • Object Property: One individual is related to another individual by a property
    • Eg: ObjectPropertyAssertion(hasWife john mary)
  • Data Property: A property relates an individual to a data value
    • Eg: DataPropertyAssertion(hasAge john "51"^^xsd:integer)

Domain and Range of Properties


  • Additional information about the properties can be provided using domain and range
  • They are the "semantic link" between classes and properties
  • Eg: ObjectPropertyDomain(hasOwner Vehicle)
  • Eg: ObjectPropertyRange(hasOwner Person)
  • Eg: DataPropertyDomain(hasAge Person)
  • Eg: DataPropertyRange(hasAge xsd:nonNegativeInteger)

Two Assumptions

Open World Assumption


  • Closed World Assumption (CWA) is the assumption that anything not known to be true is false
  • Open World Assumption (OWA) is the assumption that anything not known to be true is unknown
    • Eg: Italy is part of Europe
    • Eg: Is Spain part of Europe?
    • CWA: No
    • OWA: Unknown

Open World Assumption


  • CWA is used when the system has complete information or if a definitive answer is required from the available information
    • Eg: Relational tables with information on only Italy
    • Eg: Flight booking information
  • OWA is useful when the system has incomplete information.
    • Eg: Knowledge in an ontology is incomplete
    • Eg: Open nature of WWW where data is constantly changing

No Unique Name Assumption


  • In Unique Name Assumption (UNA), the assumption is that entities with different names (which act as IDs) represent different entities
    • Italy is a country
    • Spain is a country
    • Under CWA, UNA is followed: Italy and Spain are different
  • OWL makes the assumption that different names do not necessarily represent different individuals (no UNA)
    • ClassAssertion(Person john)
    • ClassAssertion(Person bill)
    • john and bill are not different unless explicitly stated

No Unique Name Assumption


  • Under OWA, UNA is not followed: unless explicitly stated, we do not know yet whether john and bill are different or the same
    • DifferentIndividuals(john bill)
    • SameIndividual(john bill)
  • Different organizations can build ontologies on the same theme and could have individuals with the same name
    • Eg: http://www.example1.org/institute/IIIT-D
    • Eg: http://www.example2.org/institute/IIIT-D

Logical Class Constructors

Intersection


  • Intersection of two classes consists of exactly those individuals which are instances of both the classes
    • EquivalentClasses(Mother ObjectIntersectionOf(Woman Parent))
    • Class Mother consists of exactly those instances that belong to both Woman and Parent

Union


  • union of two classes contains every individual which is contained in at least one of these classes
    • EquivalentClasses(Parent ObjectUnionOf(Mother Father))
    • DisjointClasses(Mother Father)
    • Instance of Parent is either an instance of Mother or Father

Complement


  • Complement of a class consists of exactly those individuals that are not members of the other class
    • EquivalentClasses(ChildlessPerson ObjectIntersectionOf(Person ObjectComplementOf(Parent))
  • Class constructors can be nested
    • SubClassOf(Grandfather ObjectIntersectionOf(Man Parent))
    • ClassAssertion(ObjectIntersectionOf(Person ObjectComplementOf(Parent)) Jack)

Logical Quantifiers

  • A quantifier specifies the quantity of specimen from a domain of discourse over which a property acts on.
    • Domain of discourse is the universe or the set of objects that we are interested in. Eg: Car, Person, Mother, Father
  • Two quantifiers are of interest to us
    • Existential quantifier ($\exists$)
    • Universal quantifier ($\forall$)

Existential Quantifier


  • There should exist at least one instance from the domain of discourse (class) that participates in the given relation/property
    • Eg: Any Exam must have at least one Examiner
    • SubClassOf(Exam ObjectSomeValuesFrom(hasExaminer Examiner))
    • Eg: Parent is someone who has at least one child
    • EquivalentClasses(Parent ObjectSomeValuesFrom(hasChild Person))
  • Phrases such as "at least one", "for some" are used for this quantifier

Universal Quantifier


  • A given property participates with all the instances of a particular domain of discourse (class)
    • Eg: All Examiners of an Exam must be Professors
    • SubClassOf(Exam ObjectAllValuesFrom(hasExaminer Professor))
  • Corner case: Exams which have no Examiner are also covered by this quantifier
  • "for all" is used for this quantifier

Universal Quantifier


  • Eg: A happy person is someone who has a happy child
  • EquivalentClasses(HappyPerson ObjectAllValuesFrom(hasChild HappyPerson))
  • The above quantification indicates that a childless person can also be happy
  • Intuitively, we want to say that in order to be happy, a person must have at least one happy child
  • EquivalentClasses(HappyPerson ObjectIntersectionOf(ObjectAllValuesFrom(hasChild HappyPerson) ObjectSomeValuesFrom(hasChild HappyPerson)))

Cardinality restriction

Max cardinality


  • John has at most 4 children
  • ClassAssertion(ObjectMaxCardinality(4 hasChild Parent) John)
  • This declares an upper bound on the number of children that John has

Min cardinality


  • John has at least 2 children
  • ClassAssertion(ObjectMinCardinality(2 hasChild Parent) John)
  • This declares a lower bound on the number of children that John has

Exact cardinality


  • John has exactly 3 children
  • ClassAssertion(ObjectExactCardinality(3 hasChild Parent) John)
  • This declares an exact number of children that John has

Enumeration of Individuals


  • List all possible and the only members of a class
  • EquivalentClasses(MyBirthdayGuests ObjectOneOf(Bill John Mary))
  • Classes defined this way are called closed classes
  • What if we add ClassAssertion(MyBirthdayGuests Jeff)?
  • Jeff must be equal to one of the 3 defined instances

Property Characteristics

Inverse Property


  • If one property can be obtained by inverting or changing the direction of the other then it is an inverse property
    • InverseObjectProperties(hasParent hasChild)
    • ObjectPropertyAssertion(hasParent A B)
    • ObjectPropertyAssertion(hasChild B A)

Symmetric Property


  • If a property and its inverse are the same then it is called a symmetric property
    • SymmetricObjectProperty(hasSpouse)
    • ObjectPropertyAssertion(hasSpouse A B)
    • ObjectPropertyAssertion(hasSpouse B A)

Assymmetric Property


  • It explicitly states that if A is connected to B through a certain property then B cannot be connected to A by the same property
    • AsymmetricObjectProperty(hasChild)

Reflexive Property


  • A reflexive property connects everything to itself
    • ReflexiveObjectProperty(hasRelative)
    • Everyone is related to himself/herself

Irreflexive Property


  • If an individual cannot be connected to itself by the given property then such a property is irreflexive
    • IrreflexiveObjectProperty(parentOf)
    • Nobody can be one's own parent

Functional Property


  • If a property connects A to B then there can be only one unique value for B
    • FunctionalObjectProperty(hasHusband)
    • ObjectPropertyAssertion(hasHusband Mary James)
    • ObjectPropertyAssertion(hasHusband Mary Jim)
    • Conclusion: Since hasHusband is functional, James and Jim should be the same

Inverse Functional Property


  • If a property connects A to B then there can be only one unique value for A
    • InverseFunctionalObjectProperty(hasHusband)
    • An individual can be the husband of at most one another individual

Transitive Property


  • A transitive property connects A with C if it connects A to B and B to C
    • TransitiveObjectProperty(hasAncestor)
  • Transitive properties can be used to connect whole-part relations
    • TransitiveObjectProperty(subRegionOf)

Disjoint Property


  • Two properties are disjoint if there are no two individuals that are connected by the two properties
    • DisjointObjectProperties(hasParent hasSpouse)
    • Parents and children cannot marry each other

Property Chains


  • It is a generalization of transitive property
    • Eg: SubObjectPropertyOf(ObjectPropertyChain(hasParent hasParent) hasGrandparent)
    • Eg: If A hasParent B, and B hasParent C, then A hasGrandparent C
    • Eg: SubObjectPropertyOf(ObjectPropertyChain(hasFather hasBrother) hasUncle)

References


  1. OWL 2 Web Ontology Language Primer. Pascal Hitzler et. al.
  2. A Description Logic Primer. Markus Krötzsch et. al.

Next Topic


Designing and building an ontology