What is {elected in} and {end cause} of {{James Matheson} has {position held} as {Member of the 15th Parliament of the United Kingdom}}
In what year and under what circumstances was James Matheson elected as a Member of the 15th Parliament of the UK?
When and why was James Matheson elected as Member of the 15th Parliament of the United Kingdom?
SELECT ?u ?g WHERE { ?s property:position_held resource:Member_of_the_15th_Parliament_of_the_United_Kingdom . ?s property:end_cause ?g . ?s property:elected_in ?u . resource:James_Matheson property:position_held ?s }
select distinct ?value1 ?value2 where { ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q4870843> . ?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/Q41582555>. ?statement <http://www.wikidata.org/entity/P580> ?value1 . ?statement <http://www.wikidata.org/entity/P2842> ?value2 } 
SELECT ?value1 ?value2 WHERE { wd:Q4870843 p:P39 ?s . ?s ps:P39 wd:Q41582555 . ?s pq:P2715 ?value1 . ?s pq:P1534 ?value2 }