find leander-class cruiser class ships.
Entity Entity Entity Entity Entity Entity Entity Entity
m.019yrp m.029qbx m.02q9y7 m.037t86 m.03tx7y m.03tzpj m.03ythp m.04bm42
HMNZS Achilles HMS Orion HMS Ajax HMS Neptune HMAS Sydney HMAS Hobart HMAS Perth HMNZS Leander
class entity
boats.ship m.02q9sg
boats.ship boats.ship_class
Ship Leander-class cruiser
none none
boats.ship.ship_class
Ship Class
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 :boats.ship . 
VALUES ?x1 { :m.02q9sg } 
?x0 :boats.ship.ship_class ?x1 . 
FILTER ( ?x0 != ?x1  )
}
}
(AND boats.ship (JOIN boats.ship.ship_class m.02q9sg))