who built the locomotive classified as south african class 1a 4-8-0?
Entity
m.04qp9t
North British Locomotive Company
class entity
rail.locomotive_builder m.0gvv9ch
rail.locomotive_builder rail.locomotive_class
Locomotive builder South African Class 1A 4-8-0
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.0gvv9ch } 
?x0 :rail.locomotive_builder.locomotive_classes_built ?x1 . 
FILTER ( ?x0 != ?x1  )
}
}
(AND rail.locomotive_builder (JOIN rail.locomotive_builder.locomotive_classes_built m.0gvv9ch))