Question: Among Pennsylvania counties sharing borders with Montgomery County (which shares a border with Chester County) which has the biggest area?
Choices:
Allegheny County
Westmoreland County
Lehigh County
Berks County
Chester County
Fayette County
Bucks County
Franklin County
Cumberland County
Delaware County
Program:
function: Find
inputs: Chester County
function: Relate
dependencies: 0
inputs: shares border with
forward
function: Find
inputs: Montgomery County
function: And
dependencies: 1
2
function: Relate
dependencies: 3
inputs: shares border with
forward
function: FilterConcept
dependencies: 4
inputs: county of Pennsylvania
function: SelectAmong
dependencies: 5
inputs: area
largest
SPARQL: SELECT ?e WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "county of Pennsylvania" . ?e_1 <shares_border_with> ?e . ?e_1 <pred:name> "Montgomery County" . ?e_2 <shares_border_with> ?e_1 . ?e_2 <pred:name> "Chester County" .  ?e <area> ?pv . ?pv <pred:value> ?v .  } ORDER BY DESC(?v) LIMIT 1
Answer: Berks County