Question: Which area is larger, Dorset (the one that shares border with Wiltshire) or Lancashire?
Choices:
Staffordshire
Derbyshire
Warwickshire
Somerset
Cumbria
Essex
West Midlands
Norfolk
Dorset
Lancashire
Program:
function: Find
inputs: Wiltshire
function: Relate
dependencies: 0
inputs: shares border with
forward
function: Find
inputs: Dorset
function: And
dependencies: 1
2
function: Find
inputs: Lancashire
function: SelectBetween
dependencies: 3
4
inputs: area
greater
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "Dorset" . ?e_1 <shares_border_with> ?e . ?e_1 <pred:name> "Wiltshire" .   } UNION { ?e <pred:name> "Lancashire" .  } ?e <area> ?pv . ?pv <pred:value> ?v .  } ORDER BY DESC(?v) LIMIT 1
Answer: Lancashire