The Simpsons - An example Ontology for tutorial purposes#

The Simpsons is a popular comic televisions series. A comprehensive overview (in german) is Simpsonspedia.
This page shows, how we implement the simpsons ontology in KnowWE.

Also, please check out our visualization docs, which are based on the ontology defined here: Doc SparqlVisualization, Doc ConceptVisualization

General Domain Model#

We first define some classes framing the example domain.

Classes #

si.SimpsonsConcept
si:SimpsonsConcept
a
rdfs.Class
rdfs:Class
.
si.LivingBeing
si:LivingBeing
rdfs.subClassOf
rdfs:subClassOf
si.SimpsonsConcept
si:SimpsonsConcept
;
rdfs.label
rdfs:label
"Lebewesen"@de
,
"Living being"@en
.
si.Human
si:Human
rdfs.subClassOf
rdfs:subClassOf
si.LivingBeing
si:LivingBeing
;
rdfs.label
rdfs:label
"Mensch"@de
,
"Human"@en
.
si.Animal
si:Animal
rdfs.subClassOf
rdfs:subClassOf
si.LivingBeing
si:LivingBeing
;
rdfs.label
rdfs:label
"Tier"@de
,
"Animal"@en
.
si.GenderType
si:GenderType
rdfs.subClassOf
rdfs:subClassOf
si.SimpsonsConcept
si:SimpsonsConcept
;
rdfs.label
rdfs:label
"Geschlecht"@de
,
"Gender"@en
.
si.male
si:male
rdf.type
rdf:type
si.GenderType
si:GenderType
;
rdfs.label
rdfs:label
"männlich"@de
,
"male"@en
.
si.female
si:female
rdf.type
rdf:type
si.GenderType
si:GenderType
;
rdfs.label
rdfs:label
"weiblich"@de
,
"female"@en
.
si.Building
si:Building
rdfs.subClassOf
rdfs:subClassOf
si.SimpsonsConcept
si:SimpsonsConcept
;
rdfs.label
rdfs:label
"Gebäude"@de
,
"Building"@en
.
si.Location
si:Location
rdfs.subClassOf
rdfs:subClassOf
si.SimpsonsConcept
si:SimpsonsConcept
;
rdfs.label
rdfs:label
"Ort"@de
,
"Location"@en
.
si.Powerplant
si:Powerplant
rdfs.subClassOf
rdfs:subClassOf
si.Building
si:Building
;
rdfs.label
rdfs:label
"Kraftwerk"@de
,
"Power plant"@en
.
Some (alternative ways) to express negations.

[]
rdf.type
rdf:type
owl.AllDisjointClasses
owl:AllDisjointClasses
;
owl.members
owl:members
(
si.Human
si:Human
si.Building
si:Building
si.GenderType
si:GenderType
)
.
si.GenderType
si:GenderType
owl.disjointWith
owl:disjointWith
si.Human
si:Human
.

Properties#

rdfs:range si:Human; rdfs:domain si:Human.

si.livesIn
si:livesIn
rdf.type
rdf:type
rdf.Property
rdf:Property
.
si.relatedWith
si:relatedWith
owl.inverseOf
owl:inverseOf
si.relatedWith
si:relatedWith
;
rdf.type
rdf:type
owl.ReflexiveProperty
owl:ReflexiveProperty
.
si.parent
si:parent
rdf.type
rdf:type
owl.AsymmetricProperty
owl:AsymmetricProperty
;
rdfs.subPropertyOf
rdfs:subPropertyOf
si.relatedWith
si:relatedWith
.
si.spouse
si:spouse
rdf.type
rdf:type
rdf.Property
rdf:Property
.
si.husband
si:husband
rdfs.subPropertyOf
rdfs:subPropertyOf
si.spouse
si:spouse
.
si.wife
si:wife
rdfs.subPropertyOf
rdfs:subPropertyOf
si.spouse
si:spouse
;
owl.inverseOf
owl:inverseOf
null
husband
.
si.spouse
si:spouse
owl.propertyDisjointWith
owl:propertyDisjointWith
si.parent
si:parent
.
si.child
si:child
rdf.type
rdf:type
rdf.Property
rdf:Property
;
rdfs.subPropertyOf
rdfs:subPropertyOf
si.relatedWith
si:relatedWith
;
owl.inverseOf
owl:inverseOf
si.parent
si:parent
.
si.mother
si:mother
rdf.type
rdf:type
rdf.Property
rdf:Property
;
rdfs.subPropertyOf
rdfs:subPropertyOf
si.parent
si:parent
.
si.father
si:father
rdf.type
rdf:type
rdf.Property
rdf:Property
;
rdfs.subPropertyOf
rdfs:subPropertyOf
si.parent
si:parent
.
si.grandparent
si:grandparent
rdf.type
rdf:type
rdf.Property
rdf:Property
;
owl.propertyChainAxiom
owl:propertyChainAxiom
(
si.parent
si:parent
si.parent
si:parent
)
.
si.grandfather
si:grandfather
rdf.type
rdf:type
rdf.Property
rdf:Property
;
rdfs.subPropertyOf
rdfs:subPropertyOf
si.grandparent
si:grandparent
;
owl.propertyChainAxiom
owl:propertyChainAxiom
(
si.parent
si:parent
si.father
si:father
)
.
si.sibling
si:sibling
rdf.type
rdf:type
owl.SymmetricProperty
owl:SymmetricProperty
;
rdf.type
rdf:type
owl.TransitiveProperty
owl:TransitiveProperty
;
owl.inverseOf
owl:inverseOf
si.sibling
si:sibling
;
rdfs.subPropertyOf
rdfs:subPropertyOf
si.relatedWith
si:relatedWith
.
si.gender
si:gender
rdf.type
rdf:type
rdf.Property
rdf:Property
;
rdfs.domain
rdfs:domain
si.LivingBeing
si:LivingBeing
;
rdfs.range
rdfs:range
si.GenderType
si:GenderType
.
si.age
si:age
rdf.type
rdf:type
rdf.Property
rdf:Property
.
si.worksAt
si:worksAt
rdf.type
rdf:type
rdf.Property
rdf:Property
.
si.owns
si:owns
rdf.type
rdf:type
rdf.Property
rdf:Property
;
rdfs.range
rdfs:range
si.Ownership
si:Ownership
;
owl.minCardinality
owl:minCardinality
"1"
.
si.Ownership
si:Ownership
rdfs.subClassOf
rdfs:subClassOf
si.SimpsonsConcept
si:SimpsonsConcept
.
si.amount
si:amount
rdf.type
rdf:type
rdf.Property
rdf:Property
.
si.ownType
si:ownType
rdf.type
rdf:type
rdf.Property
rdf:Property
.

NegativeObjectPropertyAssertion#

Bart never wants to be a female.

[]
rdf.type
rdf:type
owl.NegativePropertyAssertion
owl:NegativePropertyAssertion
;
owl.sourceIndividual
owl:sourceIndividual
si.bart
si:bart
;
owl.assertionProperty
owl:assertionProperty
si.gender
si:gender
;
owl.targetIndividual
owl:targetIndividual
si.female
si:female
.

Illustrative Instances#

We now insert some characters and things of the Simpsons world.

si.springfield
si:springfield
rdf.type
rdf:type
si.Location
si:Location
;
rdfs.label
rdfs:label
"Springfield"
.
si.homer
si:homer
rdfs.label
rdfs:label
"Homer Simpson2"
;
rdf.type
rdf:type
si.Human
si:Human
;
si.age
si:age
"36"
;
si.gender
si:gender
si.male
si:male
;
si.father
si:father
si.abraham
si:abraham
;
si.worksAt
si:worksAt
si.burns_powerplant
si:burns_powerplant
;
si.livesIn
si:livesIn
si.springfield
si:springfield
.
si.marge
si:marge
rdfs.label
rdfs:label
"Marge Simpson"
;
rdf.type
rdf:type
si.Human
si:Human
;
si.age
si:age
"34"
;
si.husband
si:husband
si.homer
si:homer
;
si.gender
si:gender
si.female
si:female
;
si.livesIn
si:livesIn
si.springfield
si:springfield
.
si.bart
si:bart
rdfs.label
rdfs:label
"Bart Simpson"
;
rdf.type
rdf:type
si.Human
si:Human
;
si.age
si:age
"10"
;
si.gender
si:gender
si.male
si:male
;
si.sibling
si:sibling
si.lisa
si:lisa
,
si.maggie
si:maggie
;
si.mother
si:mother
si.marge
si:marge
;
si.father
si:father
si.homer
si:homer
;
si.livesIn
si:livesIn
si.springfield
si:springfield
.
si.lisa
si:lisa
rdfs.label
rdfs:label
"Lisa Simpson"
;
rdf.type
rdf:type
si.Human
si:Human
;
si.age
si:age
"8"
;
si.gender
si:gender
si.female
si:female
;
si.mother
si:mother
si.marge
si:marge
;
si.father
si:father
si.homer
si:homer
;
si.livesIn
si:livesIn
si.springfield
si:springfield
.
si.maggie
si:maggie
rdfs.label
rdfs:label
"Maggie Simpson"
;
rdf.type
rdf:type
si.Human
si:Human
;
si.age
si:age
"1"
;
si.sibling
si:sibling
si.lisa
si:lisa
;
si.gender
si:gender
si.female
si:female
;
si.mother
si:mother
si.marge
si:marge
;
si.father
si:father
si.homer
si:homer
;
si.livesIn
si:livesIn
si.springfield
si:springfield
.
si.abraham
si:abraham
rdfs.label
rdfs:label
"Abraham Simpson"
;
rdf.type
rdf:type
si.Human
si:Human
;
si.mother
si:mother
si.yuma
si:yuma
;
si.livesIn
si:livesIn
si.retirement_home
si:retirement_home
;
si.gender
si:gender
si.male
si:male
.
si.retirement_home
si:retirement_home
rdf.type
rdf:type
si.Location
si:Location
;
rdfs.label
rdfs:label
"Ruhestandspalast"@de
.
si.yuma
si:yuma
rdfs.label
rdfs:label
"Yuma Hickman"
;
rdf.type
rdf:type
si.Human
si:Human
;
si.gender
si:gender
si.female
si:female
.
si.burns_dog
si:burns_dog
rdf.type
rdf:type
si.Animal
si:Animal
;
rdfs.label
rdfs:label
"Mr. Burns' dog"
.
si.burns_powerplant
si:burns_powerplant
rdf.type
rdf:type
si.Powerplant
si:Powerplant
;
rdfs.label
rdfs:label
"Mr. Burns' nuclear power plant"
.
We can also introduce blank nodes to represent the belongings of Mr. Burns.

si.burns
si:burns
rdf.type
rdf:type
si.Human
si:Human
;
rdfs.label
rdfs:label
"Charles Montgomery Burns"
;
si.livesIn
si:livesIn
si.springfield
si:springfield
;
si.gender
si:gender
si.male
si:male
;
si.owns
si:owns
[
si.amount
si:amount
"3"
;
si.ownType
si:ownType
si.burns_dog
si:burns_dog
]
,
si.burns_powerplant
si:burns_powerplant
.

Sample Queries#

Ok, we can test/query the ontology by inserting some SPARQL statements.

Simple start#

Show me all instances of Human and also show their labels.

No ontology found! The package '' is not used to compile an ontology. Internal error while rendering section: null

Barts Grand-Pa#

Use property paths in SPARQL.

No ontology found! The package '' is not used to compile an ontology. Internal error while rendering section: null
Now using a defined PropertyChain

No ontology found! The package '' is not used to compile an ontology. Internal error while rendering section: null

Optional belongings#

We also can add optional patterns into the query. Show all humans and their (optional) belongings.

No ontology found! The package '' is not used to compile an ontology. Internal error while rendering section: null

UNION: All names of humans and animals#

No ontology found! The package '' is not used to compile an ontology. Internal error while rendering section: null

Expected Compentency Questions: Intersecting Properties#

The family father: A father that is also a husband

No ontology found! The package '' is not used to compile an ontology. Internal error while rendering section: null

Hierarchical Table#

No ontology found! The package '' is not used to compile an ontology. Internal error while rendering section: null

Administrative Definitions of the Simpsons Ontology#

This wiki article belongs to the simpsons package.

simpsons
We define the ontology using all articles of the simpsons package.

OWL2_RL_REDUCED_OPTIMIZED
simpsons
Let's use the namespace si for the resources.

si http://www.example.org/ontology#