@prefix dc: <http://purl.org/dc/elements/1.1/>.

<> dc:title "A Travel Vocabulary";
   dc:description """airport codes and such. @@see also: cyc transport vocabulary
http://www.cyc.com/cyc-2-1/vocab/transportation-vocab.html"""
   .


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

@prefix ical: <http://ilrt.org/discovery/2001/06/schemas/ical-full/hybrid.rdf#>.

@prefix ont:  <http://www.daml.org/2001/03/daml+oil#> .

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


@prefix cs: <http://www.cyc.com/cyc-2-1/vocab/spatial-vocab.html#>.
@prefix ct: <http://www.cyc.com/cyc-2-1/vocab/time-vocab.html#>.
@prefix ci: <http://www.cyc.com/cyc-2-1/vocab/info-vocab.html#>.
@prefix ctop: <http://www.cyc.com/cyc-2-1/vocab/top-vocab.html#>.
@prefix cact: <http://www.cyc.com/cyc-2-1/vocab/actor-vocab-complete.html#>.

@prefix : <http://www.w3.org/2001/08swws67/travel#>.
@prefix t: <http://www.w3.org/2001/08swws67/travel#>.

@prefix apt: <http://www.megginson.com/exp/ns/airports#>.

@prefix cg: <http://www.cyc.com/cyc-2-1/vocab/group-vocab.html#>.
@prefix ctrans: <http://www.cyc.com/cyc-2-1/vocab/transportation-vocab.html#>.

:iata u:label "iata code";
  a rdf:Property, ont:UnambiguousProperty;
  u:isDefinedBy
   <http://www.iata.org/codes/>;
  u:domain
   ctrans:AirportOrganization, apt:Airport;
  u:seeAlso
   <http://www.faa.gov/aircodeinfo.htm>,
   <http://www.w3.org/2001/06/airports.rdf>,
   <http://www.primenet.com/~rfwatts/uteworld/airports.txt> # per megginson
  .

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

nav:Itinerary u:subClassOf ct:ItineraryDocument.

<http://www.megginson.com/exp/id/airports/KSJC>
  a apt:Airport;
  apt:icao "KSJC";
  apt:name "San Jose, San Jose International Airport, CA, United States";
  apt:iata "SJC";
  apt:latitude "37-21-33N";
  apt:longitude "121-55-27W";
  apt:elevation "25M";

  :iata "SJC".

<http://www.sjc.org/>
  dc:title "San Jose International Airport".


:stateAbbr
  u:isDefinedBy <http://www.usps.gov/ncsc/lookups/abbr_state.txt>;
  a ont:UnambiguousProperty;
  u:domain <http://www.cyc.com/cyc-2-1/vocab/geography-vocab.html#State-UnitedStates>.

this log:forSome <#CA>.
<#CA> :stateAbbr "CA".

<http://www.megginson.com/exp/id/airports/KSJC>
	cs:inRegion <#CA>.

[ :iata "SFO" ] cs:inRegion <#CA>.


#########################
############
# DAML stuff
@prefix ont_: <@@/ont_#>.

@prefix ont:  <http://www.daml.org/2001/03/daml+oil#> .
# @@from 2001/03swell/listsAx.n3
@prefix sl: <http://www.w3.org/2001/03swell/lists#>.
this log:forAll :p, :C, :C2, :s, :o, :x.
{ :C ont:oneOf [ sl:member :x ] } log:implies { :x a :C }.

{ :s ont:first :o } log:implies { :s sl:member :o }.
{ :s ont:rest [ sl:member :o ] } log:implies { :s sl:member :o }.

@prefix ont_: <@@/ont_#>.

{ :p a ont:TransitiveProperty.
  :s :p :x.
  :x :p :o. }
  log:implies { :s :p :o }.

{ :p ont_:reflexiveOver :C.
  :s a :C. } log:implies { :s :p :s }.

{ :p ont_:symmetricOver :C.
  :s a :C.
  :o a :C.
  :s :p :o } log:implies { :o :p :s }.

#@@ :unambiguousOver is expressible in DAML, according to Ian
#http://www.daml.org/listarchive/joint-committee/0420.html
{ :p ont_:unambiguousOver :C.
  :s :p :o.
  :x :p :o.
}
  log:implies { :s = :x }.

##########
# borrowing vocabulary from cyc...

ct:TimeInterval u:subClassOf ct:TemporalThing, :TemporallyContinuous.

ct:temporalBoundsIntersect
  u:domain ct:TemporalThing;
  u:range ct:TemporalThing;
  ont_:symmetricOver ct:TemporalThing.

ct:startsDuring
  u:subPropertyOf ct:temporalBoundsIntersect.

ct:endsDuring
  u:subPropertyOf ct:temporalBoundsIntersect.

ct:endingDate
  u:subPropertyOf ct:endsDuring.

ct:startingDate
  u:subPropertyOf ct:startsDuring.

ct:temporallyIntersects
  u:domain ct:TemporalThing;
  u:range ct:TemporalThing;
  u:subPropertyOf ct:temporalBoundsIntersect;
  ont_:symmetricOver ct:TemporalThing.

ct:temporallySubsumes
  u:domain ct:TemporalThing;
  u:range ct:TemporalThing;
  a ont:TransitiveProperty;
  ont_:symmetricOver ct:TemporalThing;
  u:subPropertyOf ct:temporallyIntersects.

ct:CalendarDay
  u:subClassOf ct:Date.

ct:Date
  u:subClassOf ct:TimeInterval.

ct:DayOfWeekType a u:Class; u:label "Day of Week";
  ont:oneOf (ct:Sunday ct:Monday ct:Tuesday
             ct:Wednesday ct:Thursday ct:Friday ct:Saturday).


this log:forAll :t1, :t2.

{ :t1 ct:startsDuring :t2.
  :t2 a :TemporallyContinuous.
}
 log:implies { :t1 ct:temporallyIntersects :t2 }.

{ :t1 ct:endsDuring :t2.
  :t2 a :TemporallyContinuous.
}
 log:implies { :t1 ct:temporallyIntersects :t2 }.




########
# navitin -> cyc stuff

@prefix v: <?>.
this log:forAll v:e, v:itin, v:x, v:where, v:yyyy_mm_dd, v:day.


{ v:e nav:AR [ nav:place v:where ] } log:implies { v:e ctrans:toLocation v:where }.
{ v:e nav:LV [ nav:place v:where ] } log:implies { v:e ctrans:fromLocation v:where }.

ctrans:transportees u:domain ctrans:TransportationEvent;
                    u:range ctop:PartiallyTangible;
		u:subPropertyOf # objectMoving, 
			cact:actors.

{ v:itin nav:for v:who; nav:air v:e }
  log:implies { v:e ctrans:transportees v:who }.

{ v:e nav:date v:yyyy_mm_dd; nav:AR v:x }
  log:implies { v:e ct:endingDate [ a ct:CalendarDay; :yyyy_mm_dd v:yyyy_mm_dd ] }.

{ v:e nav:date v:yyyy_mm_dd; nav:LV v:x }
  log:implies { v:e ct:startingDate [ a ct:CalendarDay; :yyyy_mm_dd v:yyyy_mm_dd ] }.

:yyyy_mm_dd ont_:unambiguousOver ct:CalendarDay;
  u:comment "travel date. @@more explanation...".


{ v:e ical:DTSTART [
     rdf:value [ log:startsWith [ is t:yyyymmdd of
        [ = v:day; a ct:CalendarDay]]] ]
}
  log:implies { v:e ct:startingDate v:day }.

{ v:e ical:DTEND [
     rdf:value [ log:startsWith [ is t:yyyymmdd of
        [ = v:day; a ct:CalendarDay]]] ]
}
  log:implies { v:e ct:endingDate v:day }.



#########
# hmm... where do these go...
@prefix t: <http://www.w3.org/2001/08swws67/travel#>.
{ v:where nav:airportName "SAN FRANCISCO" }
  log:implies { v:where t:iata "SFO" }.
{ v:where nav:airportName "SAN JOSE" }
  log:implies { v:where t:iata "SJC" }.

