SELECT DISTINCT ?uri WHERE {?uri <http://dbpedia.org/ontology/subsequentWork> <http://dbpedia.org/resource/Frasier> . ?uri <http://dbpedia.org/ontology/openingTheme> <http://dbpedia.org/resource/Where_Everybody_Knows_Your_Name> . ?uri <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/TelevisionShow>}
Name the television show whose subsequent work is Frasier and opening theme is Where Everybody Knows Your Name?
SELECT DISTINCT ?p WHERE { ?p rdf:type ontology:Television_Show . ?p property:opening_theme resource:Where_Everybody_Knows_Your_Name . ?p property:subsequent_work resource:Frasier }
Cheers
The television show with subsequent work Frasier and opening theme Where Everybody Knows Your Name is [Cheers].
The TV show that followed Frasier, and the opening theme is where everyone knows your name [Cheers].