Question: Does North Yorkshire (that shares a border with East Riding of Yorkshire) or Greater London have less area?
Choices:
Norfolk
North Yorkshire
Northumberland
West Midlands
Cumbria
Derbyshire
Greater London
Staffordshire
Essex
Somerset
Program:
function: Find
inputs: East Riding of Yorkshire
function: Relate
dependencies: 0
inputs: shares border with
forward
function: Find
inputs: North Yorkshire
function: And
dependencies: 1
2
function: Find
inputs: Greater London
function: SelectBetween
dependencies: 3
4
inputs: area
less
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "North Yorkshire" . ?e_1 <shares_border_with> ?e . ?e_1 <pred:name> "East Riding of Yorkshire" .   } UNION { ?e <pred:name> "Greater London" .  } ?e <area> ?pv . ?pv <pred:value> ?v .  } ORDER BY ?v LIMIT 1
Answer: Greater London