<> a <http://www.w3.org/2000/10/swap/log#N3Document> .

@prefix dc: <http://purl.org/dc/elements/1.1/>.
<> dc:description """lookup lat/long of airports""",
"$Id: airportLookup.n3,v 1.1 2002/06/04 06:01:48 connolly Exp $".

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.

@prefix log: <http://www.w3.org/2000/10/swap/log#> .
@prefix str: <http://www.w3.org/2000/10/swap/string#> .

@prefix apt: <http://www.daml.org/2001/10/html/airport-ont#>.

@prefix t: <http://www.w3.org/2001/07dc-bos/grokNavItin#> .

@prefix : <airportLookup#>.

this log:forAll :LAT1, :LON1, :LAT2, :LON2, :NUM, :YMD,
  :K, :TXT, :IT, :P, :Q, :X, :Y.


# well-known airports...
{ :X a :Y; #@@kludge...
    log:uri [ str:startsWith "http://www.daml.org/cgi-bin/airport?" ] }
 log:implies { :X a :AirportKnownToDAML }.

#substitute AirportKnownToDAMLs for airports mentioned in itieraries
#special case of UnambiguousProperty and =, perhaps
t:airportName :determines t:place.
{ :P :determines :Q.
  :X :Q [ :P [ is :P of :Y ] ].
} log:implies { :X :Q :Y }.


# we only want to look up certain airports...
{ [ t:air [ t:LV [ t:place :X ] ] ]. }
 log:implies { :X a :InterestingPlace }.
{ [ t:air [ t:AR [ t:place :X ] ] ]. }
 log:implies { :X a :InterestingPlace }.


# believe what daml.org says about airport latitutde/longitudes...
:AirportProperty is rdf:type of
  apt:latitude,
  apt:name,
  apt:iataCode,
  apt:icaoCode,
  apt:location,
  apt:latitude,
  apt:longitude,
  apt:elevation.

{
  :P a :AirportProperty.
  [ a :AirportKnownToDAML, :InterestingPlace;
    log:semantics [
      log:includes {
        :IT :P :X.
      }
    ] ].
} log:implies {
  :IT a apt:Airport; :P :X.
}.



