Fictional Universes and OWL! – Part II

Ordinary Wizarding Level (OWL) exams are featured in the Harry Potter fictional universe, and are taken by Hogwarts students to become wizards! After the Pokemon verse and the Lord of the Rings Ontology, I was fascinated to see if I can come up with a HarryPotter ontology to model the fictional universe! 

OWLy

Consider the following axioms in the HarryPotter ontology:

  • Classes: Wizard, Cat, Owl, Toad, Arachnid, Wand, Umbrella, Person
  • Object Properties: possessMagicDevice, hasPet 
  • Individuals:
    • Hagrid (instanceOf Wizard),
    • Aragog (instanceOf Arachnid),
    • UmbrellaOfHagrid (instanceOf Umbrella)
    • Crookshanks (instanceOf Cat)
  • disjointWith (Cat, Arachnid, Owl, Toad) 
  • (Wizard) subclassOf (
    • Person AND 
    • possessMagicDevice ONLY Wand AND
    • hasPet ONLY (Cat OR Owl OR Toad))
  • Hagrid hasPet Aragog 
  • Hagrid possessMagicDevice UmbrellaOfHagrid

Question: Is your Harry Potter Ontology consistent or inconsistent? Justify your answer.

Answer: Inconsistent, because Hagrid cannot have an Arachnid pet named Aragog!

  • Hagrid hasPet Aragog
  • Aragog instanceOf Arachnid 
  • Hagrid instanceOf Wizard 
  • Wizard hasPet ONLY (Cat OR Owl OR Toad) 
  • disjointWith (Cat, Arachnid, Owl, Toad)

Other justifications are incorrect, since Wand and Umbrella are not said to be disjoint classes. Hence, UmbrellaOfHagrid can be a Wand AND an Umbrella (which is True!)


And you can also show entailment and open world/closed world distinctions using an example with axioms from the HarryPotter ontology

Consider a system with the following set of axioms:

  • HarryPotter is an instance of Wizard
  • Gryffindor is an instance of House
  • Slytherin is an instance of House
  • HarryPotter is assigned to Gryffindor
  • A Wizard is assigned to exactly one House
  • Wizards are subclass of Humans

Question: If we were to ask “if Harry Potter is assigned to Slytherin ?” and the system is a closed world system, what is the expected answer? What if the system is an open world system?

Answer: False in the closed world system, but True (or Unknown) in the open world system

We now add an axiom,

Harry Potter is assigned to Slytherin

Question: Will the addition of this axiom generate an error in the closed world system?

Answer: Yes (distinct entities assumption)

Question: Will the addition of this axiom generate an error in the open world system?

Answer: No, since it may assume Gryffindor == Slytherin (same entities)

Question:  Are the following axioms entailed (something that is true, but not explicitly asserted), from the above set of axioms? Justify your answer.

  1. HarryPotter is an instance of Human
  2. A Human is assigned to exactly one House

Answer: (1) True (2) False


And finally, you can play around with what type of role restrictions and logical definitions should you use to model your own HarryPotter Ontology, given a set of statements! For example, 

Phoenix is a type of pet owned only by a wizard.

Phoenix subClassOf (

  • Pet  AND 
  • isPetOf  ONLY Wizard)

Hogwarts is a school. HogwartsStudent is a type of Student who attends Hogwarts.

Hogwarts instanceOf School

HogwartsStudent subClassOf (

  • Student AND 
  • attendsSchool  VALUE Hogwarts)

A Student is allowed to have one Pet – either a Cat or a Toad or an Owl.

Student subClassOf (hasPet MAX 1 (Cat OR Toad OR Owl))

An Auror is a Student who should have taken at least 1 Occlumency or Potions lessons but no Divination lessons.

Auror subClassOf (

  • Student AND 
  • hasTaken SOME/MIN 1 (OcclumencyLesson OR PotionsLesson) AND
  • NOT hasTaken SOME DivinationLesson)

QuidditchTeam plays some QuidditchGame, and can possess exactly 3 Chasers and 1 Seeker.

QuidditchTeam subClassOf (

  • (play SOME QuidditchGame) AND
  • (isComposedOf  EXACTLY 3 Chaser) AND
  • (isComposedOf  EXACTLY 1 Seeker))