Question: Of the Canadian provinces that share a border with North Dakota, which has the smallest area?
Choices:
Newfoundland and Labrador
Manitoba
Quebec
Alberta
New Brunswick
Saskatchewan
Nova Scotia
British Columbia
Prince Edward Island
Ontario
Program:
function: Find
inputs: North Dakota
function: Relate
dependencies: 0
inputs: shares border with
backward
function: FilterConcept
dependencies: 1
inputs: province of Canada
function: SelectAmong
dependencies: 2
inputs: area
smallest
SPARQL: SELECT ?e WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "province of Canada" . ?e <shares_border_with> ?e_1 . ?e_1 <pred:name> "North Dakota" .  ?e <area> ?pv . ?pv <pred:value> ?v .  } ORDER BY ?v LIMIT 1
Answer: Manitoba