Source file time.ml

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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
(*********************************************************************************)
(*                OCaml-RDF                                                      *)
(*                                                                               *)
(*    Copyright (C) 2012-2021 Institut National de Recherche en Informatique     *)
(*    et en Automatique. All rights reserved.                                    *)
(*                                                                               *)
(*    This program is free software; you can redistribute it and/or modify       *)
(*    it under the terms of the GNU Lesser General Public License version        *)
(*    3 as published by the Free Software Foundation.                            *)
(*                                                                               *)
(*    This program is distributed in the hope that it will be useful,            *)
(*    but WITHOUT ANY WARRANTY; without even the implied warranty of             *)
(*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *)
(*    GNU General Public License for more details.                               *)
(*                                                                               *)
(*    You should have received a copy of the GNU General Public License          *)
(*    along with this program; if not, write to the Free Software                *)
(*    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA                   *)
(*    02111-1307  USA                                                            *)
(*                                                                               *)
(*    Contact: Maxence.Guesdon@inria.fr                                          *)
(*                                                                               *)
(*********************************************************************************)

let time_str = "http://www.w3.org/2006/time#";;
let time = Iri.of_string time_str ;;
let time_ s = Iri.of_string (time_str ^ s);;

let c_DateTimeDescription = time_ "DateTimeDescription" ;;
let c_DateTimeInterval = time_ "DateTimeInterval" ;;
let c_DayOfWeek = time_ "DayOfWeek" ;;
let c_Duration = time_ "Duration" ;;
let c_DurationDescription = time_ "DurationDescription" ;;
let c_GeneralDateTimeDescription = time_ "GeneralDateTimeDescription" ;;
let c_GeneralDurationDescription = time_ "GeneralDurationDescription" ;;
let c_Instant = time_ "Instant" ;;
let c_Interval = time_ "Interval" ;;
let dt_Number = time_ "Number" ;;
let c_ProperInterval = time_ "ProperInterval" ;;
let c_TRS = time_ "TRS" ;;
let c_TemporalEntity = time_ "TemporalEntity" ;;
let c_TemporalUnit = time_ "TemporalUnit" ;;
let c_TimePosition = time_ "TimePosition" ;;
let c_Year = time_ "Year" ;;
let after = time_ "after" ;;
let before = time_ "before" ;;
let day = time_ "day" ;;
let dayOfWeek = time_ "dayOfWeek" ;;
let dayOfYear = time_ "dayOfYear" ;;
let days = time_ "days" ;;
let dt_generalDay = time_ "generalDay" ;;
let dt_generalMonth = time_ "generalMonth" ;;
let dt_generalYear = time_ "generalYear" ;;
let hasBeginning = time_ "hasBeginning" ;;
let hasDateTimeDescription = time_ "hasDateTimeDescription" ;;
let hasDuration = time_ "hasDuration" ;;
let hasDurationDescription = time_ "hasDurationDescription" ;;
let hasEnd = time_ "hasEnd" ;;
let hasMember = time_ "hasMember" ;;
let hasTRS = time_ "hasTRS" ;;
let hour = time_ "hour" ;;
let hours = time_ "hours" ;;
let inDateTime = time_ "inDateTime" ;;
let inTimePosition = time_ "inTimePosition" ;;
let inXSDDateTime = time_ "inXSDDateTime" ;;
let inside = time_ "inside" ;;
let intervalAfter = time_ "intervalAfter" ;;
let intervalBefore = time_ "intervalBefore" ;;
let intervalContains = time_ "intervalContains" ;;
let intervalDuring = time_ "intervalDuring" ;;
let intervalEquals = time_ "intervalEquals" ;;
let intervalFinishedBy = time_ "intervalFinishedBy" ;;
let intervalFinishes = time_ "intervalFinishes" ;;
let intervalMeets = time_ "intervalMeets" ;;
let intervalMetBy = time_ "intervalMetBy" ;;
let intervalOverlappedBy = time_ "intervalOverlappedBy" ;;
let intervalOverlaps = time_ "intervalOverlaps" ;;
let intervalStartedBy = time_ "intervalStartedBy" ;;
let intervalStarts = time_ "intervalStarts" ;;
let minute = time_ "minute" ;;
let minutes = time_ "minutes" ;;
let month = time_ "month" ;;
let months = time_ "months" ;;
let nominalPosition = time_ "nominalPosition" ;;
let numericDuration = time_ "numericDuration" ;;
let numericPosition = time_ "numericPosition" ;;
let second = time_ "second" ;;
let seconds = time_ "seconds" ;;
let timeZone = time_ "timeZone" ;;
let unitType = time_ "unitType" ;;
let week = time_ "week" ;;
let weeks = time_ "weeks" ;;
let xsdDateTime = time_ "xsdDateTime" ;;
let year = time_ "year" ;;
let years = time_ "years" ;;

module Open = struct
  let time_c_DateTimeDescription = c_DateTimeDescription
  let time_c_DateTimeInterval = c_DateTimeInterval
  let time_c_DayOfWeek = c_DayOfWeek
  let time_c_Duration = c_Duration
  let time_c_DurationDescription = c_DurationDescription
  let time_c_GeneralDateTimeDescription = c_GeneralDateTimeDescription
  let time_c_GeneralDurationDescription = c_GeneralDurationDescription
  let time_c_Instant = c_Instant
  let time_c_Interval = c_Interval
  let time_dt_Number = dt_Number
  let time_c_ProperInterval = c_ProperInterval
  let time_c_TRS = c_TRS
  let time_c_TemporalEntity = c_TemporalEntity
  let time_c_TemporalUnit = c_TemporalUnit
  let time_c_TimePosition = c_TimePosition
  let time_c_Year = c_Year
  let time_after = after
  let time_before = before
  let time_day = day
  let time_dayOfWeek = dayOfWeek
  let time_dayOfYear = dayOfYear
  let time_days = days
  let time_dt_generalDay = dt_generalDay
  let time_dt_generalMonth = dt_generalMonth
  let time_dt_generalYear = dt_generalYear
  let time_hasBeginning = hasBeginning
  let time_hasDateTimeDescription = hasDateTimeDescription
  let time_hasDuration = hasDuration
  let time_hasDurationDescription = hasDurationDescription
  let time_hasEnd = hasEnd
  let time_hasMember = hasMember
  let time_hasTRS = hasTRS
  let time_hour = hour
  let time_hours = hours
  let time_inDateTime = inDateTime
  let time_inTimePosition = inTimePosition
  let time_inXSDDateTime = inXSDDateTime
  let time_inside = inside
  let time_intervalAfter = intervalAfter
  let time_intervalBefore = intervalBefore
  let time_intervalContains = intervalContains
  let time_intervalDuring = intervalDuring
  let time_intervalEquals = intervalEquals
  let time_intervalFinishedBy = intervalFinishedBy
  let time_intervalFinishes = intervalFinishes
  let time_intervalMeets = intervalMeets
  let time_intervalMetBy = intervalMetBy
  let time_intervalOverlappedBy = intervalOverlappedBy
  let time_intervalOverlaps = intervalOverlaps
  let time_intervalStartedBy = intervalStartedBy
  let time_intervalStarts = intervalStarts
  let time_minute = minute
  let time_minutes = minutes
  let time_month = month
  let time_months = months
  let time_nominalPosition = nominalPosition
  let time_numericDuration = numericDuration
  let time_numericPosition = numericPosition
  let time_second = second
  let time_seconds = seconds
  let time_timeZone = timeZone
  let time_unitType = unitType
  let time_week = week
  let time_weeks = weeks
  let time_xsdDateTime = xsdDateTime
  let time_year = year
  let time_years = years
end

class from ?sub g =
  let sub = match sub with None -> Term.Iri (g.Graph.name()) | Some t -> t in
  object(self)
  method after = g.Graph.objects_of ~sub ~pred: after
  method after_opt = match self#after with [] -> None | x::_ -> Some x
  method after_iris = Graph.only_iris (self#after)
  method after_opt_iri = match self#after_iris with [] -> None | x::_ -> Some x
  method before = g.Graph.objects_of ~sub ~pred: before
  method before_opt = match self#before with [] -> None | x::_ -> Some x
  method before_iris = Graph.only_iris (self#before)
  method before_opt_iri = match self#before_iris with [] -> None | x::_ -> Some x
  method day = Graph.literal_objects_of g ~sub ~pred: day
  method day_opt = match self#day with [] -> None | x::_ -> Some x
  method dayOfWeek = g.Graph.objects_of ~sub ~pred: dayOfWeek
  method dayOfWeek_opt = match self#dayOfWeek with [] -> None | x::_ -> Some x
  method dayOfWeek_iris = Graph.only_iris (self#dayOfWeek)
  method dayOfWeek_opt_iri = match self#dayOfWeek_iris with [] -> None | x::_ -> Some x
  method dayOfYear = Graph.literal_objects_of g ~sub ~pred: dayOfYear
  method dayOfYear_opt = match self#dayOfYear with [] -> None | x::_ -> Some x
  method days = Graph.literal_objects_of g ~sub ~pred: days
  method days_opt = match self#days with [] -> None | x::_ -> Some x
  method hasBeginning = g.Graph.objects_of ~sub ~pred: hasBeginning
  method hasBeginning_opt = match self#hasBeginning with [] -> None | x::_ -> Some x
  method hasBeginning_iris = Graph.only_iris (self#hasBeginning)
  method hasBeginning_opt_iri = match self#hasBeginning_iris with [] -> None | x::_ -> Some x
  method hasDateTimeDescription = g.Graph.objects_of ~sub ~pred: hasDateTimeDescription
  method hasDateTimeDescription_opt = match self#hasDateTimeDescription with [] -> None | x::_ -> Some x
  method hasDateTimeDescription_iris = Graph.only_iris (self#hasDateTimeDescription)
  method hasDateTimeDescription_opt_iri = match self#hasDateTimeDescription_iris with [] -> None | x::_ -> Some x
  method hasDuration = g.Graph.objects_of ~sub ~pred: hasDuration
  method hasDuration_opt = match self#hasDuration with [] -> None | x::_ -> Some x
  method hasDuration_iris = Graph.only_iris (self#hasDuration)
  method hasDuration_opt_iri = match self#hasDuration_iris with [] -> None | x::_ -> Some x
  method hasDurationDescription = g.Graph.objects_of ~sub ~pred: hasDurationDescription
  method hasDurationDescription_opt = match self#hasDurationDescription with [] -> None | x::_ -> Some x
  method hasDurationDescription_iris = Graph.only_iris (self#hasDurationDescription)
  method hasDurationDescription_opt_iri = match self#hasDurationDescription_iris with [] -> None | x::_ -> Some x
  method hasEnd = g.Graph.objects_of ~sub ~pred: hasEnd
  method hasEnd_opt = match self#hasEnd with [] -> None | x::_ -> Some x
  method hasEnd_iris = Graph.only_iris (self#hasEnd)
  method hasEnd_opt_iri = match self#hasEnd_iris with [] -> None | x::_ -> Some x
  method hasMember = g.Graph.objects_of ~sub ~pred: hasMember
  method hasMember_opt = match self#hasMember with [] -> None | x::_ -> Some x
  method hasMember_iris = Graph.only_iris (self#hasMember)
  method hasMember_opt_iri = match self#hasMember_iris with [] -> None | x::_ -> Some x
  method hasTRS = g.Graph.objects_of ~sub ~pred: hasTRS
  method hasTRS_opt = match self#hasTRS with [] -> None | x::_ -> Some x
  method hasTRS_iris = Graph.only_iris (self#hasTRS)
  method hasTRS_opt_iri = match self#hasTRS_iris with [] -> None | x::_ -> Some x
  method hour = Graph.literal_objects_of g ~sub ~pred: hour
  method hour_opt = match self#hour with [] -> None | x::_ -> Some x
  method hours = Graph.literal_objects_of g ~sub ~pred: hours
  method hours_opt = match self#hours with [] -> None | x::_ -> Some x
  method inDateTime = g.Graph.objects_of ~sub ~pred: inDateTime
  method inDateTime_opt = match self#inDateTime with [] -> None | x::_ -> Some x
  method inDateTime_iris = Graph.only_iris (self#inDateTime)
  method inDateTime_opt_iri = match self#inDateTime_iris with [] -> None | x::_ -> Some x
  method inTimePosition = g.Graph.objects_of ~sub ~pred: inTimePosition
  method inTimePosition_opt = match self#inTimePosition with [] -> None | x::_ -> Some x
  method inTimePosition_iris = Graph.only_iris (self#inTimePosition)
  method inTimePosition_opt_iri = match self#inTimePosition_iris with [] -> None | x::_ -> Some x
  method inXSDDateTime = Graph.literal_objects_of g ~sub ~pred: inXSDDateTime
  method inXSDDateTime_opt = match self#inXSDDateTime with [] -> None | x::_ -> Some x
  method inside = g.Graph.objects_of ~sub ~pred: inside
  method inside_opt = match self#inside with [] -> None | x::_ -> Some x
  method inside_iris = Graph.only_iris (self#inside)
  method inside_opt_iri = match self#inside_iris with [] -> None | x::_ -> Some x
  method intervalAfter = g.Graph.objects_of ~sub ~pred: intervalAfter
  method intervalAfter_opt = match self#intervalAfter with [] -> None | x::_ -> Some x
  method intervalAfter_iris = Graph.only_iris (self#intervalAfter)
  method intervalAfter_opt_iri = match self#intervalAfter_iris with [] -> None | x::_ -> Some x
  method intervalBefore = g.Graph.objects_of ~sub ~pred: intervalBefore
  method intervalBefore_opt = match self#intervalBefore with [] -> None | x::_ -> Some x
  method intervalBefore_iris = Graph.only_iris (self#intervalBefore)
  method intervalBefore_opt_iri = match self#intervalBefore_iris with [] -> None | x::_ -> Some x
  method intervalContains = g.Graph.objects_of ~sub ~pred: intervalContains
  method intervalContains_opt = match self#intervalContains with [] -> None | x::_ -> Some x
  method intervalContains_iris = Graph.only_iris (self#intervalContains)
  method intervalContains_opt_iri = match self#intervalContains_iris with [] -> None | x::_ -> Some x
  method intervalDuring = g.Graph.objects_of ~sub ~pred: intervalDuring
  method intervalDuring_opt = match self#intervalDuring with [] -> None | x::_ -> Some x
  method intervalDuring_iris = Graph.only_iris (self#intervalDuring)
  method intervalDuring_opt_iri = match self#intervalDuring_iris with [] -> None | x::_ -> Some x
  method intervalEquals = g.Graph.objects_of ~sub ~pred: intervalEquals
  method intervalEquals_opt = match self#intervalEquals with [] -> None | x::_ -> Some x
  method intervalEquals_iris = Graph.only_iris (self#intervalEquals)
  method intervalEquals_opt_iri = match self#intervalEquals_iris with [] -> None | x::_ -> Some x
  method intervalFinishedBy = g.Graph.objects_of ~sub ~pred: intervalFinishedBy
  method intervalFinishedBy_opt = match self#intervalFinishedBy with [] -> None | x::_ -> Some x
  method intervalFinishedBy_iris = Graph.only_iris (self#intervalFinishedBy)
  method intervalFinishedBy_opt_iri = match self#intervalFinishedBy_iris with [] -> None | x::_ -> Some x
  method intervalFinishes = g.Graph.objects_of ~sub ~pred: intervalFinishes
  method intervalFinishes_opt = match self#intervalFinishes with [] -> None | x::_ -> Some x
  method intervalFinishes_iris = Graph.only_iris (self#intervalFinishes)
  method intervalFinishes_opt_iri = match self#intervalFinishes_iris with [] -> None | x::_ -> Some x
  method intervalMeets = g.Graph.objects_of ~sub ~pred: intervalMeets
  method intervalMeets_opt = match self#intervalMeets with [] -> None | x::_ -> Some x
  method intervalMeets_iris = Graph.only_iris (self#intervalMeets)
  method intervalMeets_opt_iri = match self#intervalMeets_iris with [] -> None | x::_ -> Some x
  method intervalMetBy = g.Graph.objects_of ~sub ~pred: intervalMetBy
  method intervalMetBy_opt = match self#intervalMetBy with [] -> None | x::_ -> Some x
  method intervalMetBy_iris = Graph.only_iris (self#intervalMetBy)
  method intervalMetBy_opt_iri = match self#intervalMetBy_iris with [] -> None | x::_ -> Some x
  method intervalOverlappedBy = g.Graph.objects_of ~sub ~pred: intervalOverlappedBy
  method intervalOverlappedBy_opt = match self#intervalOverlappedBy with [] -> None | x::_ -> Some x
  method intervalOverlappedBy_iris = Graph.only_iris (self#intervalOverlappedBy)
  method intervalOverlappedBy_opt_iri = match self#intervalOverlappedBy_iris with [] -> None | x::_ -> Some x
  method intervalOverlaps = g.Graph.objects_of ~sub ~pred: intervalOverlaps
  method intervalOverlaps_opt = match self#intervalOverlaps with [] -> None | x::_ -> Some x
  method intervalOverlaps_iris = Graph.only_iris (self#intervalOverlaps)
  method intervalOverlaps_opt_iri = match self#intervalOverlaps_iris with [] -> None | x::_ -> Some x
  method intervalStartedBy = g.Graph.objects_of ~sub ~pred: intervalStartedBy
  method intervalStartedBy_opt = match self#intervalStartedBy with [] -> None | x::_ -> Some x
  method intervalStartedBy_iris = Graph.only_iris (self#intervalStartedBy)
  method intervalStartedBy_opt_iri = match self#intervalStartedBy_iris with [] -> None | x::_ -> Some x
  method intervalStarts = g.Graph.objects_of ~sub ~pred: intervalStarts
  method intervalStarts_opt = match self#intervalStarts with [] -> None | x::_ -> Some x
  method intervalStarts_iris = Graph.only_iris (self#intervalStarts)
  method intervalStarts_opt_iri = match self#intervalStarts_iris with [] -> None | x::_ -> Some x
  method minute = Graph.literal_objects_of g ~sub ~pred: minute
  method minute_opt = match self#minute with [] -> None | x::_ -> Some x
  method minutes = Graph.literal_objects_of g ~sub ~pred: minutes
  method minutes_opt = match self#minutes with [] -> None | x::_ -> Some x
  method month = Graph.literal_objects_of g ~sub ~pred: month
  method month_opt = match self#month with [] -> None | x::_ -> Some x
  method months = Graph.literal_objects_of g ~sub ~pred: months
  method months_opt = match self#months with [] -> None | x::_ -> Some x
  method nominalPosition = Graph.literal_objects_of g ~sub ~pred: nominalPosition
  method nominalPosition_opt = match self#nominalPosition with [] -> None | x::_ -> Some x
  method numericDuration = Graph.literal_objects_of g ~sub ~pred: numericDuration
  method numericDuration_opt = match self#numericDuration with [] -> None | x::_ -> Some x
  method numericPosition = Graph.literal_objects_of g ~sub ~pred: numericPosition
  method numericPosition_opt = match self#numericPosition with [] -> None | x::_ -> Some x
  method second = Graph.literal_objects_of g ~sub ~pred: second
  method second_opt = match self#second with [] -> None | x::_ -> Some x
  method seconds = Graph.literal_objects_of g ~sub ~pred: seconds
  method seconds_opt = match self#seconds with [] -> None | x::_ -> Some x
  method timeZone = g.Graph.objects_of ~sub ~pred: timeZone
  method timeZone_opt = match self#timeZone with [] -> None | x::_ -> Some x
  method timeZone_iris = Graph.only_iris (self#timeZone)
  method timeZone_opt_iri = match self#timeZone_iris with [] -> None | x::_ -> Some x
  method unitType = g.Graph.objects_of ~sub ~pred: unitType
  method unitType_opt = match self#unitType with [] -> None | x::_ -> Some x
  method unitType_iris = Graph.only_iris (self#unitType)
  method unitType_opt_iri = match self#unitType_iris with [] -> None | x::_ -> Some x
  method week = Graph.literal_objects_of g ~sub ~pred: week
  method week_opt = match self#week with [] -> None | x::_ -> Some x
  method weeks = Graph.literal_objects_of g ~sub ~pred: weeks
  method weeks_opt = match self#weeks with [] -> None | x::_ -> Some x
  method xsdDateTime = Graph.literal_objects_of g ~sub ~pred: xsdDateTime
  method xsdDateTime_opt = match self#xsdDateTime with [] -> None | x::_ -> Some x
  method year = Graph.literal_objects_of g ~sub ~pred: year
  method year_opt = match self#year with [] -> None | x::_ -> Some x
  method years = Graph.literal_objects_of g ~sub ~pred: years
  method years_opt = match self#years with [] -> None | x::_ -> Some x
  end