who built the locomotive for the taff vale railway a class?
Entity
m.04qp9t
North British Locomotive Company
class entity
rail.locomotive_builder m.03ycl6d
rail.locomotive_builder rail.locomotive_class
Locomotive builder Taff Vale Railway A class
none none
rail.locomotive_builder.locomotive_classes_built
Locomotive classes built
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_builder . 
VALUES ?x1 { :m.03ycl6d } 
?x0 :rail.locomotive_builder.locomotive_classes_built ?x1 . 
FILTER ( ?x0 != ?x1  )
}
}
(AND rail.locomotive_builder (JOIN rail.locomotive_builder.locomotive_classes_built m.03ycl6d))