6’6’’	
6’0’’	
5’6’’	
5’0’’	
4’6’’	
4’0’’	
3’6’’	
3’0’’	
6’6’’	
6’0’’	
5’6’’	
5’0’’	
4’6’’	
4’0’’	
3’6’’	
3’0’’	
	
	
Who	owns	the	
robot	chicken?
Donald	J.	Trump	
												Dr.	Evil	
Kim	Jong-un	
Frank	Underwood	
Bane
Shark	
Octopus	
Tortoise	
Armadillo	
Robot	
Chicken
1. There are five houses.
2. Frank Underwood lives in the Red house.
3. Dr. Evil owns the frickin’ Octopus.
4. Whiskey is the preferred drink in the Black house.
5. Donald Trump drinks Bourbon.
6. The Black house is just to the right of the White house.
7. The Black Lung smoker owns the Tortoise.
8. French Soot is smoked in the Brown house.
9. Tequila is the preferred drink in the middle house.
10.Bane lives in the first house.
11.The villain who smokes Coal Dust lives in the house next
to the villain with the Armadillo.
12.French Soot is smoked in a house next to the house
where the Shark is kept.
13.The Slow Death smoker drinks Vodka.
14.Kim Jong-un smokes Hacking Cough.
15.Bane lives next to the Blue house.
Who	owns	the	
robot	chicken?	
	
Who	drinks	
champagne?
@prefix		:		<http://ngrams.ucd.ie/hawking#>	.	
	
@prefix	rdfs:	<http://www.w3.org/2000/01/rdf-schema#>	.	
	
@prefix	owl:	<http://www.w3.org/2002/07/owl#>	.	
	
@prefix	xsd:	<http://www.w3.org/2001/XMLSchema#>	.	
	
@prefix	rdf:	<http://www.w3.org/1999/02/22-rdf-syntax-ns#>	.	
	
Every	line	is	a	
triple,	ending	
with	a	period.
Anonymous	
classes	are	
defined	in	[	]	
	
<http://ngrams.ucd.ie/hawking>	rdf:type	owl:Ontology	.	
	
	
	
[	rdf:type	owl:AllDisjointClasses	;	
		owl:members	(	:Color	:Drink	:House	:Person	:Pet	:Smoke	)	]	.	
	
Separate	triples	
with	a	semicolon
Let’s	define	the	
key	classes	in	
the	riddle	…	
	
:Color	rdf:type	owl:Class	;	
							owl:equivalentClass		
										[		rdf:type	owl:Class	;	
														owl:oneOf	(	:Blue	:Brown	:White	:Black	:Red	)	]	.	
	
:Drink	rdf:type	owl:Class	;	
							owl:equivalentClass			
											[	rdf:type	owl:Class	;	
														owl:oneOf	(	:Vodka	:Champagne	:Bourbon	:Tequila	:Whiskey	)	]	.
Now	for		
the	relations	
between	classes	
:drinks	rdf:type		 	 owl:FunctionalProperty	,	
																		 	 	 	 owl:InverseFunctionalProperty	,	
																		 	 	 	 owl:ObjectProperty	;	
									 rdfs:domain		:Person;	
									 rdfs:range						:Drink		.	
	
:hasColor	rdf:type		 owl:FunctionalProperty	,	
																					 	 	 owl:InverseFunctionalProperty	,	
																					 	 	 owl:ObjectProperty	;	
										rdfs:domain		 :House	;	
			rdfs:range	 	 :Color		.	
Use	commas	for	
multiple	values	
for	a	property		
But	what’s	an	
inverse	
functional	
property?
owl:onProperty	
owl:someValuesFrom	
:Color	
	rdfs:subClassOf	
:House	rdf:type	owl:Class	;	
															rdfs:subClassOf				[		
						rdf:type			owl:Restriction	;	
																									owl:onProperty			:hasColor	;	
																									owl:someValuesFrom			:Color	]	.	
:hasColor	
owl:Restriction	
owl:Class	
rdf:type	
???	
rdf:type	
:House
:Person	rdf:type	owl:Class	;	
								rdfs:subClassOf		
											[	rdf:type	owl:Class	;	
													owl:intersectionOf	(		
																	[	rdf:type	owl:Restriction	;	
																			owl:onProperty	:drinks	;	
																			owl:someValuesFrom	:Drink	]	
																	[	rdf:type	owl:Restriction	;	
																			owl:onProperty	:hasPet	;	
																			owl:someValuesFrom	:Pet	]	
																	[	rdf:type	owl:Restriction	;	
																			owl:onProperty	:livesIn	;	
																			owl:someValuesFrom	:House	]	
																	[	rdf:type	owl:Restriction	;	
																			owl:onProperty	:smokes	;	
																			owl:someValuesFrom	:Smoke	]	
													)	
								]	.	
	
Ensure	every	
person	has	all	
of	the	vices	…
:isNextTo		rdf:type		 	 owl:IrreflexiveProperty	,	
																			 	 	 			 	 owl:ObjectProperty	,	
																							 	 			 	 owl:SymmetricProperty	;	
											 	 rdfs:domain		 :House	;	
											 	 rdfs:range		 :House	.	
	
:isRightTo			rdf:type		owl:FunctionalProperty	,	
	 				 					 	 	 	 owl:InverseFunctionalProperty	,	
	 				 					 	 	 	 owl:ObjectProperty	;	
												 	 		owl:inverseOf		 	 		:isLeftTo	;	
															 		rdfs:subPropertyOf			:isNextTo	.	
	
:isLeftTo		 rdf:type		 	 	 	 owl:ObjectProperty	;	
											 	 rdfs:subPropertyOf		 :isNextTo	.	
	
	
Now	to	
constrain	the	
neighbours!
:House1		 :isLeftTo		 :House2	.	
:House2		 :isLeftTo		 :House3	.	
:House3		 :isLeftTo		 :House4	.	
:House4		 :isLeftTo		 :House5	.	
	
[	rdf:type			 	 	 	 	owl:NegativePropertyAssertion	;	
		owl:assertionProperty			:isNextTo	;	
		owl:targetIndividual		 	:House1	;	
		owl:sourceIndividual		 	:House5		]	.	
	
[	rdf:type			 	 	 	 owl:AllDifferent	;	
		owl:distinctMembers			(	:House2	:House1	:House4	:House3	:House5	)	]	.
:House			rdf:type			owl:Class	;	
								 				rdfs:subClassOf		
												 	 	 	 [	rdf:type	owl:Restriction	;	
															 	 	 		owl:onProperty	:isNextTo	;	
															 	 	 		owl:onClass	:House	;	
															 	 	 		owl:maxQualifiedCardinality		
"2"^^xsd:nonNegativeInteger	]	,	
												 	 	 	 [	rdf:type	owl:Restriction	;	
															 	 	 			owl:onProperty	:hasColor	;	
															 	 	 			owl:someValuesFrom	:Color	]	.	
	
	
	
	
Qualified	
cardinality!		
Eureka!	 	
A	house	has		
at	most	two	
neighboring	
houses	
	
and	at	least	
(but	only)		
one	colour!
[	rdf:type			 	 	 	 owl:AllDifferent	;	
		owl:distinctMembers			(:Black	:White	:Red	:Brown	:Blue)	]	.	
	
[	rdf:type	owl:AllDifferent	;	
			owl:distinctMembers	(	:DrEvil	:Bane	:FrankUnderwood		
:DonaldTrump	:KimJongUn	)	]	.	
	
[	rdf:type	owl:AllDifferent	;	
		owl:distinctMembers	(	:Bourbon	:Vodka	:Champagne	:Whiskey		
:Tequila	)	]	.	
[	rdf:type	owl:AllDifferent	;	
			owl:distinctMembers	(	:Octopus	:RobotChicken	:Armadillo	:Tortoise		
:Shark	)	]	.	
[	rdf:type	owl:AllDifferent	;	
		owl:distinctMembers	(	:BlackLung	:FrenchSoot	:CoalDust	:SlowDeath		
:HackingCough	)	]	.	
	
	
	I’m	no	
	Einstein,	but		
I	could	be!	
	
So	beware	the		
non-unique	names	
assumption
:FrankUnderwood	:livesIn	[	:hasColor	:Red	]	.	
	
:DrEvil	:hasPet	:Octopus	.	
	
	[]	:drinks	:Whiskey	;	
					:livesIn	[	:hasColor	:Black	]	.	
	
:DonaldTrump	:drinks	:Bourbon	.	
	
	[]	:hasColor	:Black	;		
					:isRightTo	[	:hasColor	:White	]	.	
	
[]	:smokes	:BlackLung	;	
				:hasPet	:Tortoise	.	
	
	
Now	for	the	
specific	facts	of	the	
riddle	…	
	
[	]	denotes	a	
blank	node
[]		:drinks		:Whiskey	;	
					:livesIn	[	:hasColor	:Black	]	.
}	
[]	:smokes	:FrenchSoot	;	
				:livesIn	[	:hasColor	:Brown	]	.	
	
	
[]	:drinks	:Tequila	;	
				:livesIn	:House3	.	
	
	
:Bane	:livesIn	:House1	.	
	
	
[]	:smokes	:CoalDust	;	
				:livesIn	[	:isNextTo	_:x11	]	.	
	
[]	:livesIn	_:x11	;	
				:hasPet	:Armadillo	.
[]			:livesIn		_:x11	;	
						:hasPet		:Armadillo	.	
	
[]		:smokes		:CoalDust	;	
					:livesIn				[	:isNextTo	_:x11	]	.
[]		:smokes	:FrenchSoot;	
					:livesIn	[	:isNextTo	_:x12	]	.	
	
[]		:livesIn		_:x12	;	
					:hasPet		:Shark	.	
	
	
[]	:smokes	:SlowDeath	;	
				:drinks			:Vodka	.	
	
	
:KimJongUn	:smokes	:HackingCough	.	
	
	
:Bane	:livesIn	[	:isNextTo	[	:hasColor	:Blue	]	]	.	
}
French	
Soot
French	
Soot
French	
Soot	 Slow	
Death	
Hacking	
Cough
Slow	
Death	
Hacking	
Cough	
Black	
Lung	
Coal		
Dust	
French	
Soot
Hawking:
The Riddle
Credits
Hawking’s	riddle	is	based	on	“Einstein’s	Riddle”	from	Life	
magazine	in	December,	1962.	Einstein’s	connection	to	the	
riddle	is	apocryphal,	and	about	as	tenuous	as	Hawking’s.	
	
My	solution	here	is	based	on	that	of	Martin	G.	Skjæveland

Hawking's riddle: An OWL lesson