This query:
{"MA"^state:code.state:borderstate^city:state city:name ?n} => {?n a :NAME_OF_CITY_IN_A_STATE_BORDERING_MASSACHUSETTS }.
Command line:
cwm http://www.w3.org/2000/10/swap/test/dbork/defdoc2.n3 --mode=rse --think
http://www.w3.org/2000/10/swap/doc/
15 of 17