SELECT DISTINCT ?uri WHERE { <http://dbpedia.org/resource/The_Apple_Tree> <http://dbpedia.org/ontology/basedOn> ?uri. <http://dbpedia.org/resource/A_Literary_Nightmare> <http://dbpedia.org/ontology/author> ?uri}
Which writer of A literary Nightmare also extended the work of The Apple tree ?
SELECT DISTINCT ?p WHERE { resource:The_Apple_Tree property:based_on ?p . resource:A_Literary_Nightmare property:author ?p }
Mark Twain
The person where The Apple Tree was based and author of A Literary Nightmare is [Mark Twain].
The man on whom Apple Three is based and the author of Literary Night [Mark Twain].