which locomotives have a class of sncf class cc 6500?
Entity
m.0r8mrjt
Aquitaine
class entity
rail.locomotive m.0dgpxj
rail.locomotive rail.locomotive_class
Locomotive SNCF Class CC 6500
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.0dgpxj } 
?x0 :rail.locomotive.locomotive_class ?x1 . 
FILTER ( ?x0 != ?x1  )
}
}
(AND rail.locomotive (JOIN rail.locomotive.locomotive_class m.0dgpxj))