What is {elected in} and {end cause} of {{James Callaghan} has {position held} as {Member of the 40th Parliament of the United Kingdom}}
When was James Callaghan elected as a member of the UK's 40th Parliament?
When was James Callaghan elected as a Member of the 40th Parliament of the United Kingdom?
SELECT ?v ?o WHERE { ?g property:elected_in ?v . ?g property:end_cause ?o . resource:James_Callaghan property:position_held ?g . ?g property:position_held resource:Member_of_the_40th_Parliament_of_the_United_Kingdom }
select distinct ?value1 ?value2 where { ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q9576> . ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P39> . ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q41582603>. ?statement <http://www.wikidata.org/entity/P580> ?value1 . ?statement <http://www.wikidata.org/entity/P2842> ?value2 } 
SELECT ?value1 ?value2 WHERE { wd:Q9576 p:P39 ?s . ?s ps:P39 wd:Q41582603 . ?s pq:P2715 ?value1 . ?s pq:P1534 ?value2 }