itin2ical.n3
4.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
@prefix dc: <http://purl.org/dc/elements/1.1/> .
<> dc:description """
rules to map from Navigant itinerary vocabulary
to iCalendar vocabulary.
$Id: itin2ical.n3,v 1.6 2002/06/04 01:45:09 connolly Exp $
""";
dc:source [ = <http://ilrt.org/discovery/2001/06/schemas/ical-full/hybrid.rdf>;
dc:source <http://www.ietf.org/rfc/rfc2445.txt> ].
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix ical: <http://ilrt.org/discovery/2001/06/schemas/ical-full/hybrid.rdf#>.
@prefix str: <http://www.w3.org/2000/10/swap/string#>.
@prefix n: <http://www.w3.org/2001/07dc-bos/grokNavItin#> .
@prefix pa: <http://www.w3.org/2000/08/palm56/addr#> .
@prefix pd: <http://www.w3.org/2000/08/palm56/datebook#> .
@prefix r: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix : <#>.
this log:forAll :flt, :carrierName, :num, :sum,
:yymmdd, :hh_mm, :hh_mm2, :dtstart, :dtend, :tz, :tz2,
:where, :fromName, :toName.
# things with the same airportname have the same timezone
{ :where n:airportName [ is n:airportName of [ :timeZone :tz ] ] }
log:implies { :where :timeZone :tz }.
#hmm... someplace to scrape these from?
@prefix a: <http://www.daml.org/cgi-bin/airport?>. #hmm... ?MCI is a document *and* an airport?
a:MCI
n:airportName "KANSAS CITY INTL";
:timeZone :ChicagoTime.
a:STL n:airportName "ST LOUIS INTL";
:timeZone :ChicagoTime.
a:ORD n:airportName "CHICAGO OHARE";
:timeZone :ChicagoTime.
a:DFW n:airportName "DALLAS FT WORTH";
:timeZone :ChicagoTime.
a:EWR n:airportName "NEWARK";
:timeZone :NewYorkTime.
a:BOS n:airportName "BOSTON";
:timeZone :NewYorkTime.
a:DCA n:airportName "WASHINGTON REAGAN";
:timeZone :NewYorkTime.
a:NCE n:airportName "NICE";
:timeZone :ParisTime.
a:LHR n:airportName "LONDON HEATHROW";
:timeZone :LondonTime.
a:SFO n:airportName "SAN FRANCISCO";
:timeZone :LosAngelesTime.
{ :flt
n:date :yymmdd;
n:carrier [ pa:company :carrierName ];
n:flightNum :num;
n:LV [ n:time :hh_mm;
n:place [ n:airportName :fromName;
:timeZone [ ical:TZID :tz] ] ];
n:AR [ n:place [ n:airportName :toName;
:timeZone [ ical:TZID :tz2] ];
n:time :hh_mm2 ].
(:carrierName " #" :num " from " :fromName " to " :toName) str:concatenation :sum.
(:yymmdd "T" :hh_mm ":00") str:concatenation :dtstart. #@@ extra punct in dates
(:yymmdd "T" :hh_mm2 ":00") str:concatenation :dtend.
}
log:implies {
:flt a ical:VEVENT;
ical:SUMMARY :sum;
ical:DTSTART [ ical:TZID :tz; #@@hybrid handles tzids differently
#hmm... property params should modivy the property, not the object, no?
r:value :dtstart ];
ical:DTEND [
ical:TZID :tz2;
r:value :dtend
].
}.
# Timezone stuff transcribed from an evolution calendar...
# original source seems to be...
<> dc:source [ = <ftp://elsie.nci.nih.gov/pub/>;
dc:creator "Olson, A.D., et al"; #@@ lazy...
dc:title "Time zone code and data";
dc:description "updated periodically" ].
:ChicagoTime a ical:VTIMEZONE;
ical:TZID "/softwarestudio.org/Olson_20011030_5/America/Chicago";
ical:_subComponent [
a ical:STANDARD;
ical:TZOFFSETFROM "-0500";
ical:TZOFFSETTO "-0600";
ical:TZNAME "CST";
ical:DTSTART "19701025T020000";
ical:RRULE [ ical:FREQ ical:YEARLY; ical:INTERVAL "1";
ical:BYDAY "-1SU"; # maybe (-1 ical:SU)?
ical:BYMONTH "10" ]
],
[
a ical:DAYLIGHT;
ical:TZOFFSETFROM "-0600";
ical:TZOFFSETTO "-0500";
ical:TZNAME "CDT";
ical:DTSTART "19700405T020000";
ical:RRULE [ ical:FREQ ical:YEARLY;
ical:INTERVAL "1"; ical:BYDAY "1SU"; ical:BYMONTH "4" ];
].
:NewYorkTime a ical:VTIMEZONE;
ical:TZID "/softwarestudio.org/Olson_20011030_5/America/New_York";
ical:_subComponent [
a ical:STANDARD;
ical:TZOFFSETFROM "-0400";
ical:TZOFFSETTO "-0500";
ical:TZNAME "EST";
ical:DTSTART "19701025T020000";
ical:RRULE [ ical:FREQ ical:YEARLY; ical:INTERVAL "1";
ical:BYDAY "-1SU"; ical:BYMONTH "10" ];
],
[
a ical:DAYLIGHT;
ical:TZOFFSETFROM "-0500";
ical:TZOFFSETTO "-0400";
ical:TZNAME "EDT";
ical:DTSTART "19700405T020000";
ical:RRULE [ ical:FREQ ical:YEARLY; ical:INTERVAL "1";
ical:BYDAY "1SU"; ical:BYMONTH "4" ]
].
:ParisTime
ical:TZID "/softwarestudio.org/Olson_20011030_5/Europe/Paris"
# more properties...@@
.
:LondonTime
ical:TZID "/softwarestudio.org/Olson_20011030_5/Europe/London"
# more properties...@@
.
:LosAngelesTime
ical:TZID "/softwarestudio.org/Olson_20011030_5/America/Los_Angeles"
# more properties...@@
.