Question: Which has a greater area, Saskatchewan (whose official name is Saskatchewan) or Newfoundland and Labrador?
Choices:
Ontario
New Brunswick
Manitoba
Quebec
Prince Edward Island
Saskatchewan
Newfoundland and Labrador
British Columbia
Alberta
Nova Scotia
Program:
function: Find
inputs: Saskatchewan
function: FilterStr
dependencies: 0
inputs: official name
Saskatchewan
function: Find
inputs: Newfoundland and Labrador
function: SelectBetween
dependencies: 1
2
inputs: area
greater
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "Saskatchewan" . ?e <official_name> ?pv_1 . ?pv_1 <pred:value> "Saskatchewan" . } UNION { ?e <pred:name> "Newfoundland and Labrador" . } ?e <area> ?pv . ?pv <pred:value> ?v .  } ORDER BY DESC(?v) LIMIT 1
Answer: Saskatchewan