find locomotives of class indian locomotive class wap-7.
Entity
m.0tkdv0m
Chennai - Bangalore Double Decker Express
class entity
rail.locomotive m.07_g7t
rail.locomotive rail.locomotive_class
Locomotive Indian locomotive class WAP-7
none none
rail.locomotive.locomotive_class
Locomotive 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 :rail.locomotive . 
VALUES ?x1 { :m.07_g7t } 
?x0 :rail.locomotive.locomotive_class ?x1 . 
FILTER ( ?x0 != ?x1  )
}
}
(AND rail.locomotive (JOIN rail.locomotive.locomotive_class m.07_g7t))