The Simpsons - An example Ontology for tutorial purposes#
The Simpsons is a polpular comic televisions series. A comprehensive overview (in german) is Simpsonspedia.
General Domain Model#
We first define some classes framing the example domain.
Classes #
si.Human
si:Humanrdf.type
rdf:typerdfs.Class
rdfs:Class ;
rdfs.label
rdfs:label,
"Human"@en .
si.Animal
si:Animalrdf.type
rdf:typerdfs.Class
rdfs:Class ;
rdfs.label
rdfs:label,
"Animal"@en .
si.GenderType
si:GenderTyperdf.type
rdf:typerdfs.Class
rdfs:Class ;
rdfs.label
rdfs:label,
"Gender"@en .
si.male
si:malerdf.type
rdf:typesi.GenderType
si:GenderType ;
rdfs.label
rdfs:label,
"male"@en .
si.female
si:femalerdf.type
rdf:typesi.GenderType
si:GenderType ;
rdfs.label
rdfs:label,
"female"@en .
si.Building
si:Buildingrdf.type
rdf:typerdfs.Class
rdfs:Class ;
rdfs.label
rdfs:label,
"Building"@en .
si.Location
si:Locationrdf.type
rdf:typerdfs.Class
rdfs:Class ;
rdfs.label
rdfs:label,
"Location"@en .
si.Powerplant
si:Powerplantrdf.type
rdf:typerdfs.Class
rdfs:Class ;
rdfs.subClassOf
rdfs:subClassOfsi.Building
si:Building ;
rdfs.label
rdfs:label,
"Power plant"@en .
Properties#
si.livesIn
si:livesInrdf.type
rdf:typerdf.Property
rdf:Property .
si.relatedWith
si:relatedWithrdf.type
rdf:typeowl.ReflexiveProperty
owl:ReflexiveProperty .
si.parent
si:parentrdf.type
rdf:typeowl.AsymmetricProperty
owl:AsymmetricProperty ;
rdfs.subPropertyOf
rdfs:subPropertyOfsi.relatedWith
si:relatedWith .
si.spouse
si:spouserdf.type
rdf:typerdf.Property
rdf:Property .
si.husband
si:husbandrdfs.subPropertyOf
rdfs:subPropertyOfsi.spouse
si:spouse .
si.spouse
si:spouseowl.propertyDisjointWith
owl:propertyDisjointWithsi.parent
si:parent .
si.child
si:childrdf.type
rdf:typerdf.Property
rdf:Property ;
rdfs.subPropertyOf
rdfs:subPropertyOfsi.relatedWith
si:relatedWith ;
owl.inverseOf
owl:inverseOfsi.parent
si:parent .
si.mother
si:motherrdf.type
rdf:typerdf.Property
rdf:Property ;
rdfs.subPropertyOf
rdfs:subPropertyOfsi.parent
si:parent .
si.father
si:fatherrdf.type
rdf:typerdf.Property
rdf:Property ;
rdfs.subPropertyOf
rdfs:subPropertyOfsi.parent
si:parent .
si.grandparent
si:grandparentrdf.type
rdf:typerdf.Property
rdf:Property ;
owl.propertyChainAxiom
owl:propertyChainAxiomsi.parent
si:parentsi.parent
si:parent .
si.grandfather
si:grandfatherrdf.type
rdf:typerdf.Property
rdf:Property ;
owl.propertyChainAxiom
owl:propertyChainAxiomsi.parent
si:parentsi.father
si:father .
si.sibling
si:siblingrdf.type
rdf:typeowl.SymmetricProperty
owl:SymmetricProperty ;
rdf.type
rdf:typeowl.TransitiveProperty
owl:TransitiveProperty ;
rdfs.subPropertyOf
rdfs:subPropertyOfsi.relatedWith
si:relatedWith .
si.gender
si:genderrdf.type
rdf:typerdf.Property
rdf:Property ;
rdfs.domain
rdfs:domainsi.GenderType
si:GenderType .
si.age
si:agerdf.type
rdf:typerdf.Property
rdf:Property .
si.owns
si:ownsrdf.type
rdf:typerdf.Property
rdf:Property ;
owl.minCardinality
owl:minCardinality .
si.amount
si:amountrdf.type
rdf:typerdf.Property
rdf:Property .
si.ownType
si:ownTyperdf.type
rdf:typerdf.Property
rdf:Property .
NegativeObjectPropertyAssertion#
Bart never wants to be a female.
Illustrative Instances#
We now insert some characters and things of the Simpsons world.
si.springfield
si:springfieldrdf.type
rdf:typesi.Location
si:Location ;
rdfs.label
rdfs:label .
si.homer
si:homerrdfs.label
rdfs:label ;
rdf.type
rdf:typesi.Human
si:Human ;
si.age
si:age ;
si.gender
si:gendersi.male
si:male ;
si.father
si:fathersi.abraham
si:abraham ;
si.livesIn
si:livesInsi.springfield
si:springfield .
si.marge
si:margerdfs.label
rdfs:label ;
rdf.type
rdf:typesi.Human
si:Human ;
si.age
si:age ;
si.gender
si:gendersi.female
si:female ;
si.livesIn
si:livesInsi.springfield
si:springfield .
si.bart
si:bartrdfs.label
rdfs:label ;
rdf.type
rdf:typesi.Human
si:Human ;
si.age
si:age ;
si.gender
si:gendersi.male
si:male ;
si.sibling
si:siblingsi.lisa
si:lisa ;
si.mother
si:mothersi.marge
si:marge ;
si.father
si:fathersi.homer
si:homer ;
si.livesIn
si:livesInsi.springfield
si:springfield .
si.lisa
si:lisardfs.label
rdfs:label ;
rdf.type
rdf:typesi.Human
si:Human ;
si.age
si:age ;
si.gender
si:gendersi.female
si:female ;
si.mother
si:mothersi.marge
si:marge ;
si.father
si:fathersi.homer
si:homer ;
si.livesIn
si:livesInsi.springfield
si:springfield .
si.maggie
si:maggierdfs.label
rdfs:label ;
rdf.type
rdf:typesi.Human
si:Human ;
si.age
si:age ;
si.sibling
si:siblingsi.lisa
si:lisa ;
si.gender
si:gendersi.female
si:female ;
si.mother
si:mothersi.marge
si:marge ;
si.father
si:fathersi.homer
si:homer ;
si.livesIn
si:livesInsi.springfield
si:springfield .
si.abraham
si:abrahamrdfs.label
rdfs:label ;
rdf.type
rdf:typesi.Human
si:Human ;
si.mother
si:mothersi.yuma
si:yuma ;
si.gender
si:gendersi.male
si:male .
si.yuma
si:yumardfs.label
rdfs:label ;
rdf.type
rdf:typesi.Human
si:Human ;
si.gender
si:gendersi.female
si:female .
si.burns_dog
si:burns_dogrdf.type
rdf:typesi.Animal
si:Animal ;
rdfs.label
rdfs:label .
si.burns_powerplant
si:burns_powerplantrdf.type
rdf:typesi.Powerplant
si:Powerplant ;
rdfs.label
rdfs:label .
si.burns
si:burnsrdf.type
rdf:typesi.Human
si:Human ;
rdfs.label
rdfs:label ;
si.gender
si:gendersi.male
si:male ;
si.owns
si:owns,
_:own2 .
_:own1
si.amount
si:amount ;
si.ownType
si:ownTypesi.burns_dog
si:burns_dog .
_:own2
si.amount
si:amount ;
si.ownType
si:ownTypesi.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.
Barts Grand-Pa#
Use property paths in SPARQL.
Now using a defined PropertyChain
Optional belongings#
We also can add optional patterns into the query. Show all humans and their (optional) belongings.
UNION: All names of humans and animals#
Administrative Definitions of the Simpsons Ontology#
This wiki article belongs to the simpsons package.
We define the ontology using all articles of the simpsons package. Let's us the namespace si for the resources.