Question: Which has less area, Butler County sharing a border with Allegheny County or Mercer County in Pennsylvania?
Choices:
Fayette County
Cumberland County
Allegheny County
Franklin County
Butler County
Mercer County
Westmoreland County
York County
Bucks County
Warren County
Program:
function: Find
inputs: Allegheny County
function: Relate
dependencies: 0
inputs: shares border with
backward
function: Find
inputs: Butler County
function: And
dependencies: 1
2
function: Find
inputs: Pennsylvania
function: Relate
dependencies: 4
inputs: located in the administrative territorial entity
backward
function: Find
inputs: Mercer County
function: And
dependencies: 5
6
function: SelectBetween
dependencies: 3
7
inputs: area
less
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "Butler County" . ?e <shares_border_with> ?e_1 . ?e_1 <pred:name> "Allegheny County" .   } UNION { ?e <pred:name> "Mercer County" . ?e <located_in_the_administrative_territorial_entity> ?e_2 . ?e_2 <pred:name> "Pennsylvania" .  } ?e <area> ?pv . ?pv <pred:value> ?v .  } ORDER BY ?v LIMIT 1
Answer: Mercer County