Question: Which area is smaller, West Midlands (the one whose area is 902 square kilometre) or Gloucestershire (the one that shares border with Monmouthshire)?
Choices:
Norfolk
Warwickshire
East Riding of Yorkshire
Northumberland
Derbyshire
Staffordshire
West Midlands
Somerset
Cumbria
Essex
Program:
function: Find
inputs: West Midlands
function: FilterNum
dependencies: 0
inputs: area
902 square kilometre
=
function: Find
inputs: Monmouthshire
function: Relate
dependencies: 2
inputs: shares border with
forward
function: Find
inputs: Gloucestershire
function: And
dependencies: 3
4
function: SelectBetween
dependencies: 1
5
inputs: area
less
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "West Midlands" . ?e <area> ?pv_1 . ?pv_1 <pred:unit> "square kilometre" . ?pv_1 <pred:value> "902"^^xsd:double . } UNION { ?e <pred:name> "Gloucestershire" . ?e_1 <shares_border_with> ?e . ?e_1 <pred:name> "Monmouthshire" . } ?e <area> ?pv . ?pv <pred:value> ?v .  } ORDER BY ?v LIMIT 1
Answer: West Midlands