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

<> dc:description """visualize an itinerary as
a digram...""",
"""hmm... more general schedule diagrams? inRegion, subEvents, etc.?
at least include meetings, hotels, taxicabs, etc. Maybe
meals? i.e. visualize pretty much everything from an
expense report?""",
"$Id: itinDiagram.n3,v 1.2 2002/06/26 19:12:59 connolly Exp $".

@prefix k: <http://opencyc.sourceforge.net/daml/cyc.daml#> .
@prefix t: <http://www.w3.org/2000/10/swap/pim/travelTerms#> .
@prefix log: <http://www.w3.org/2000/10/swap/log#> .

@prefix g: <http://www.w3.org/2001/02pd/gv#>.

@prefix : <itinDiagram#>. #@@absolute?

this log:forAll
  :P,
  :APT, :APT2, :ELV, :EAR,
  :T, :T2,
  :NUM, :CN, :CN2,
  :IATA, :IATA2.


k:fromLocation a :ArLv.
k:toLocation a :ArLv.

# airports are shown as nodes labelled by name (IATA code?)
{
  :P a :ArLv.
  [ k:subEvents [ :P :APT ]].
  :APT k:nameString :CN
} log:implies {
 :theGraph g:hasNode :APT. :APT g:label :CN.
}.



# for each flight,
# make a departure node and an arrival node, connected
# to the airports (and to each other).
# label them with times
# label the arc between them with the flight number. (and duration@@)
{ []
    k:subEvents [
      k:fromLocation :APT;
      t:departureTime :T;
      k:toLocation  :APT2;
      t:arrivalTime :T2;
      t:flightNumber :NUM
    ]
  .
}
  log:implies {
  :APT is :start of [
    is g:hasNode of :theGraph;
    g:label :T; #@@more...
    [ a g:EdgeProperty; g:label :NUM] [
      is g:hasNode of :theGraph;
      :arrivalAt :APT2;
      g:label :T2 #@@more...
    ]
  ].
}.

:start a g:EdgeProperty; g:label "lv".
:arrivalAt a g:EdgeProperty; g:label "ar".

<> g:digraph :theGraph.
