!!! The Simpsons - An example Ontology for tutorial purposes

The Simpsons is a popular comic televisions series. A comprehensive overview (in german) is [Simpsonspedia|http://simpsonspedia.net].\\
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]

[{Image src='Demo - Simpsons/simpsons_family.png' width='150px' align='left'}]


!!! General Domain Model

We first define some classes framing the example domain.


! Classes 

%%turtle
si:ApplianceConcept a rdfs:Class.

si:LivingBeing rdfs:subClassOf si:ApplianceConcept;
	rdfs:label "Lebewesen"@de, "Living being".

si:Human
   rdfs:subClassOf si:LivingBeing ;
   a rdfs:Class;
   rdfs:label "Mensch"@de, "Human"@en .

si:Animal
    rdfs:subClassOf si:LivingBeing ;
   rdfs:label "Tier"@de, "Animal"@en .

si:GenderType 
   rdfs:subClassOf si:SimpsonsConcept ;
   rdfs:label "Geschlecht"@de, "Gender"@en .

si:male
   rdf:type si:GenderType ;
   rdfs:label "männlich"@de, "male"@en .

si:female
   rdf:type si:GenderType ;
   rdfs:label "weiblich"@de, "female"@en .

si:Building
   rdfs:subClassOf si:SimpsonsConcept ;
   rdfs:label "Gebäude"@de, "Building"@en .
   
si:Location
   rdfs:subClassOf si:SimpsonsConcept ;
   rdfs:label "Ort"@de, "Location"@en .
   
si:Powerplant   
   rdfs:subClassOf si:Building ;
   rdfs:label "Kraftwerk"@de, "Power plant"@en .
%

Some (alternative ways) to express negations.

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

si:GenderType owl:disjointWith si:Human .

%


! Properties

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

%%turtle
si:livesIn
   rdf:type rdf:Property .

si:relatedWith 
   owl:inverseOf si:relatedWith;
   rdf:type owl:ReflexiveProperty.

si:parent
   rdf:type owl:AsymmetricProperty ;
   rdfs:subPropertyOf si:relatedWith .
   
si:spouse
   rdf:type rdf:Property .

si:husband
   rdfs:subPropertyOf si:spouse .
   
si:wife
   rdfs:subPropertyOf si:spouse ;
   owl:inverseOf husband.
   
si:spouse owl:propertyDisjointWith si:parent .
      
si:child
   rdf:type rdf:Property ;
   rdfs:subPropertyOf si:relatedWith ;
   owl:inverseOf si:parent .

si:mother
   rdf:type rdf:Property ;
   rdfs:subPropertyOf si:parent .

si:father
   rdf:type rdf:Property ;
   rdfs:subPropertyOf si:parent .

si:grandparent 
   rdf:type rdf:Property ; 
   owl:propertyChainAxiom  ( si:parent  si:parent ) .
   
si:grandfather 
   rdf:type rdf:Property ; 
   rdfs:subPropertyOf si:grandparent;
   owl:propertyChainAxiom  ( si:parent  si:father ) .


si:sibling
   rdf:type owl:SymmetricProperty ;
   rdf:type owl:TransitiveProperty ;
   owl:inverseOf si:sibling;
   rdfs:subPropertyOf si:relatedWith .
   
si:gender
   rdf:type rdf:Property ;
   rdfs:domain si:LivingBeing;
   rdfs:range si:GenderType.
   
si:age rdf:type rdf:Property .   

si:worksAt rdf:type rdf:Property .

si:owns rdf:type rdf:Property ;
   rdfs:range si:Ownership;
   owl:minCardinality "1" .
   
si:Ownership
	rdfs:subClassOf si:SimpsonsConcept.

si:amount rdf:type rdf:Property .

si:ownType rdf:type rdf:Property .
%


! NegativeObjectPropertyAssertion

Bart never wants to be a female.

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


!!! Illustrative Instances

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

%%Turtle
si:springfield
   rdf:type si:Location ;
   rdfs:label "Springfield" .

si:homer
   rdfs:label "Homer Simpson" ;
   rdf:type si:Human ;
   si:age "36" ;
   si:gender si:male ;
   si:father si:abraham ;
   si:worksAt si:burns_powerplant;
   si:livesIn si:springfield .

si:marge
   rdfs:label "Marge Simpson" ;
   rdf:type si:Human ;
   si:age "34" ;
   si:husband si:homer ;
   si:gender si:female ;
   si:livesIn si:springfield .

si:bart
   rdfs:label "Bart Simpson" ;
   rdf:type si:Human ;
   si:age "10" ;
   si:gender si:male ;
   si:sibling si:lisa ;
   si:mother si:marge ;
   si:father si:homer ;
   si:livesIn si:springfield .
   
si:lisa 
   rdfs:label "Lisa Simpson" ;
   rdf:type si:Human ;
   si:age "8" ;
   si:gender si:female ;
   si:mother si:marge ;
   si:father si:homer ;
   si:livesIn si:springfield .

si:maggie 
   rdfs:label "Maggie Simpson" ;
   rdf:type si:Human ;
   si:age "1" ;
   si:sibling si:lisa ;
   si:gender si:female ;
   si:mother si:marge ;
   si:father si:homer ;
   si:livesIn si:springfield .
   
si:abraham
   rdfs:label "Abraham Simpson" ;
   rdf:type si:Human ;
   si:mother si:yuma ;
   si:livesIn si:retirement_home;
   si:gender si:male .
   
si:retirement_home
	rdf:type si:Location;
	rdfs:label "Ruhestandspalast"@de.

si:yuma
   rdfs:label "Yuma Hickman" ;
   rdf:type si:Human ;
   si:gender si:female .


si:burns_dog
   rdf:type si:Animal ;
   rdfs:label "Mr. Burns' dog" .

si:burns_powerplant
   rdf:type si:Powerplant ;
   rdfs:label "Mr. Burns' nuclear power plant" .
%

We can also introduce blank nodes to represent the belongings of Mr. Burns.

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

%


%%SparqlVisualization

    SELECT ?x ?y ?z WHERE {
	    ?x ?y ?z . 
	    FILTER (STRSTARTS(STR(?x), "http://www.example.org/ontology#")).
	    FILTER (STRSTARTS(STR(?z), "http://www.example.org/ontology#")).
	    FILTER NOT EXISTS {?x rdf:type rdfs:Class}.
	    FILTER NOT EXISTS {?z rdf:type rdfs:Class}.
	    FILTER NOT EXISTS {?x rdf:type rdf:Property}.
	    FILTER NOT EXISTS {?z rdf:type rdf:Property}.
	    FILTER (?y != si:relatedWith).
	    FILTER (?y != si:parent).
	    FILTER (?y != si:child).
	    FILTER (?y != si:grandparent).
	    FILTER (?z != ?x).

}
@rankDir: BT
@size: 1200
%


!!! Administrative Definitions of the Simpsons Ontology

This wiki article belongs to the {{simpsons}} package.

%%package simpsons

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

%%ontology
  @uses: simpsons
  @ruleset: OWL2_RL_REDUCED_OPTIMIZED
%

Let's us the namespace {{si}} for the resources.

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