which monarch is the ruler of a kingdom that is also ruled by house of kalākaua?
Entity Entity Entity Entity Entity Entity Entity Entity
m.02pr2z m.0hpdv m.02gzs0 m.03329d m.0332bj m.0318dc m.0j644xl m.02q0n8
Kalākaua Kamehameha I Kamehameha II Kamehameha III Kamehameha V Kamehameha IV Alapainui Lunalilo
class class entity
royalty.monarch royalty.kingdom m.03cdc1
royalty.monarch royalty.kingdom royalty.royal_line
Monarch Kingdom House of Kalākaua
none none none
royalty.kingdom.rulers royalty.royal_line.kingdom_s_ruled
Rulers Kingdom(s) ruled
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX : <http://rdf.freebase.com/ns/> 
SELECT (?x0 AS ?value) WHERE {
SELECT DISTINCT ?x0  WHERE { 
?x0 :type.object.type :royalty.monarch . 
?x1 :type.object.type :royalty.kingdom . 
VALUES ?x2 { :m.03cdc1 } 
?x1 :royalty.kingdom.rulers ?x0 . 
?x2 :royalty.royal_line.kingdom_s_ruled ?x1 . 
FILTER ( ?x0 != ?x1 && ?x0 != ?x2 && ?x1 != ?x2  )
}
}
(AND royalty.monarch (JOIN (R royalty.kingdom.rulers) (JOIN (R royalty.royal_line.kingdom_s_ruled) m.03cdc1)))