Question: Which location is relative to Montgomery County, which has Gardez Bien as motto text and shares a border with Frederick County (population 239520)?
Choices:
northwest
north-northwest
west-northwest
southwest
south-southwest
south
consolidated city-county
north
northeast
south-southeast
Answer: northwest
SPARQL: SELECT DISTINCT ?qpv WHERE { ?e_1 <pred:name> "Montgomery County" . ?e_1 <motto_text> ?pv . ?pv <pred:value> "Gardez Bien" . ?e_2 <pred:name> "Frederick County" . ?e_2 <population> ?pv_1 . ?pv_1 <pred:unit> "1" . ?pv_1 <pred:value> "239520"^^xsd:double . ?e_1 <shares_border_with> ?e_2 . [ <pred:fact_h> ?e_1 ; <pred:fact_r> <shares_border_with> ; <pred:fact_t> ?e_2 ] <direction_relative_to_location> ?qpv .  }
Program:
function: Find
inputs: Montgomery County
function: FilterStr
dependencies: 0
inputs: motto text
Gardez Bien
function: Find
inputs: Frederick County
function: FilterNum
dependencies: 2
inputs: population
239520
=
function: QueryRelationQualifier
dependencies: 1
3
inputs: shares border with
direction relative to location