upcomingBrief.n3
1.49 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
@prefix dc: <http://purl.org/dc/elements/1.1/>.
<> dc:description """
textual summary of upcoming iCalendar events.
USAGE:
$ python cwm.py myCal.rdf anotherCal.rdf upcomingBrief.n3 --think
--strings --with 2004-03-29 >stuff.txt
TODO:
@@ timezones
@@ recurring events
""",
"$Id: upcomingBrief.n3,v 1.4 2005/09/05 14:38:14 connolly Exp $".
@prefix cal: <http://www.w3.org/2002/12/cal/icaltzd#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
@prefix str: <http://www.w3.org/2000/10/swap/string#> .
@prefix os: <http://www.w3.org/2000/10/swap/os#> .
@prefix : <#>.
{ "1" os:argv ?WHEN } => { ?WHEN a :TimeBoundary }.
{ ?E a cal:Vevent;
cal:dtstart ?WHEN.
?WHEN str:notLessThan [ a :TimeBoundary ].
} => { ?E :when ?WHEN }.
{ ?E a cal:Vevent;
:when ?WHEN;
cal:summary ?WHAT.
(?WHEN ".0") str:concatenation ?K0.
(?WHEN ".1") str:concatenation ?K1.
(?WHEN ".2") str:concatenation ?K2.
(?WHEN ".9") str:concatenation ?K9.
} => {
?K0 log:outputString ?WHEN .
?K1 log:outputString ": " .
?K2 log:outputString ?WHAT .
?K9 log:outputString "\n" .
}.
{ ?E a cal:Vevent;
:when ?WHEN;
cal:location ?WHERE.
(?WHEN ".31") str:concatenation ?K31.
(?WHEN ".32") str:concatenation ?K32.
} => {
?K31 log:outputString " @ ".
?K32 log:outputString ?WHERE.
}.
{ ?E a cal:Vevent;
:when ?WHEN;
cal:dtend ?WHEN2.
(?WHEN ".35") str:concatenation ?K35.
(?WHEN ".36") str:concatenation ?K36.
} => {
?K35 log:outputString " thru ".
?K36 log:outputString ?WHEN2.
}.