which poem has a character named tam o'shanter?
Entity
m.09xx2c
Tam o' Shanter
class entity
book.poem m.05cbkkf
book.poem book.poem_character
Poem Tam O'Shanter
none none
book.poem.characters
Characters
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 :book.poem . 
VALUES ?x1 { :m.05cbkkf } 
?x0 :book.poem.characters ?x1 . 
FILTER ( ?x0 != ?x1  )
}
}
(AND book.poem (JOIN book.poem.characters m.05cbkkf))