What is {military branch} of {Bill Cosby} that is {military rank} is {Hospital Corpsman} ?
What was the branch of Bill Cosby when he was a hospital corpsman?
What was Bill Cosby military branch while he was a hospital corpsman?
SELECT ?r WHERE { ?z property:military_rank resource:Hospital_Corpsman . ?z property:military_branch ?r . resource:Bill_Cosby property:military_branch ?z }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q213512> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P241> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?obj .
?statement <http://www.wikidata.org/entity/P410> <http://wikidata.dbpedia.org/resource/Q1034117>
} 

SELECT ?obj WHERE { wd:Q213512 p:P241 ?s . ?s ps:P241 ?obj . ?s pq:P410 wd:Q1034117 }