Did {Alexander_Hamilton} {occupation} {lawyer}?
Did Alexander Hamilton practice law?
Is Alexander Hamilton a lawyer?
ASK WHERE { resource:Alexander_Hamilton property:occupation resource:lawyer }
 ASK { ?statement1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q178903> . ?statement1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P106> . ?statement1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q40348>. } 
ASK WHERE { wd:Q178903 wdt:P106 wd:Q40348 }