Question: Does the Surrey that borders Greater London or does Lincolnshire have fewer inhabitants?
Choices:
Warwickshire
Essex
Somerset
Derbyshire
Northumberland
West Midlands
Surrey
Lincolnshire
Cumbria
Staffordshire
Program:
function: Find
inputs: Greater London
function: Relate
dependencies: 0
inputs: shares border with
forward
function: Find
inputs: Surrey
function: And
dependencies: 1
2
function: Find
inputs: Lincolnshire
function: SelectBetween
dependencies: 3
4
inputs: population
less
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "Surrey" . ?e_1 <shares_border_with> ?e . ?e_1 <pred:name> "Greater London" .   } UNION { ?e <pred:name> "Lincolnshire" .  } ?e <population> ?pv . ?pv <pred:value> ?v .  } ORDER BY ?v LIMIT 1
Answer: Lincolnshire