What is the {Gryffindor student} for {characters} of {Harry Potter}
WHAT STUDENTS ARE IN HARRY POTTER GRYFFINDOR?
WHAT STUDENTS ARE IN GRYFFINDOR IN HARRY POTTER?
SELECT DISTINCT ?y WHERE { resource:Harry_Potter property:characters ?y . ?y rdf:type ontology:Gryffindor_student }
select distinct ?obj where { ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q8337> . ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P674> . ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?obj . ?obj <http://www.wikidata.org/entity/P31> <http://wikidata.dbpedia.org/resource/Q33179355> } 
 select distinct ?obj where { wd:Q8337 wdt:P674 ?obj . ?obj wdt:P31 wd:Q33179355 } 
Ron Weasley Hermione Granger Ginny Weasley Minerva McGonagall Albus Dumbledore James Potter Lily Potter Harry Potter