-
Notifications
You must be signed in to change notification settings - Fork 0
/
sparql-regex-transforms.cl
514 lines (493 loc) · 22.9 KB
/
sparql-regex-transforms.cl
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
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
;All functions assume that the codo triplestore is open and bound to *db*
;Also, there must be a Text Index set up with the Object being the value
;of the codo:statePatientID property. This enables fast lookups for patients based on their hasID
;Note: when compiling this file or individual functions you will get warnings that variable
;matched-p is not used. These are not serious. One function returns multiple values and we
;need the second value but not the first but to get a handle on the second value we need to
;provide a variable that binds to both. Matched-p is that variable.
(in-package :db.agraph.user)
(defun analyze-ad-hoc-pid-strings1 ()
(print "Entering ad hoc transforms 1")
;Father of P154 not in model so using 154
(sparql:run-sparql
"DELETE {
?p codo:reasonString ?rs.}
INSERT {
?nexp a codo:CloseContact.
?p codo:suspectedReasonOfCatchingCovid-19 ?nexp.
?p codo:contractedVirusFrom ?pc1.
?p codo:hasRelationship ?pc1.
?p codo:contractedVirusFrom ?pc2.
?p codo:hasRelationship ?pc2.
}
WHERE {
?p codo:reasonString ?rs.
?p codo:statePatientID ?pid.
?pc1 codo:statePatientID '104'.
?pc2 codo:statePatientID '154'.
BIND (IRI((CONCAT('http://www.isibang.ac.in/ns/codo#CloseContact-', ?pid))) AS ?nexp).
FILTER(?rs = 'Contact with P104 and father of P154')
}")
(sparql:run-sparql
"DELETE {
?p codo:reasonString ?rs.}
INSERT {
?nexp a codo:CloseContact.
?p codo:suspectedReasonOfCatchingCovid-19 ?nexp.
?p codo:contractedVirusFrom ?pc1.
?p codo:hasRelationship ?pc1.
?p codo:contractedVirusFrom ?pc2.
?p codo:hasRelationship ?pc2.
}
WHERE {
?p codo:reasonString ?rs.
?p codo:statePatientID ?pid.
?pc1 codo:statePatientID '159'.
?pc2 codo:statePatientID '103'.
BIND (IRI((CONCAT('http://www.isibang.ac.in/ns/codo#CloseContact-', ?pid))) AS ?nexp).
FILTER(?rs = 'Contact of P159 and son of P103')}")
(sparql:run-sparql
"DELETE {
?p codo:reasonString ?rs.}
INSERT {
?nexp a codo:CloseContact.
?p codo:suspectedReasonOfCatchingCovid-19 ?nexp.
?p codo:contractedVirusFrom ?pc1.
?p codo:hasRelationship ?pc1.
?p codo:contractedVirusFrom ?pc2.
?p codo:hasRelationship ?pc2.
}
WHERE {
?p codo:reasonString ?rs.
?p codo:statePatientID ?pid.
?pc1 codo:statePatientID '19'.
?pc2 codo:statePatientID '94'.
BIND (IRI((CONCAT('http://www.isibang.ac.in/ns/codo#CloseContact-', ?pid))) AS ?nexp).
FILTER(?rs = 'Contact with P19 and sister of P94')
}")
(sparql:run-sparql
"DELETE {
?p codo:reasonString ?rs.}
INSERT {
?nexp a codo:CloseContact.
?p codo:suspectedReasonOfCatchingCovid-19 ?nexp.
?p codo:contractedVirusFrom ?pc1.
?p codo:hasRelationship ?pc1.
?p codo:contractedVirusFrom ?pc2.
?p codo:hasRelationship ?pc2.
?p codo:contractedVirusFrom ?pc3.
?p codo:hasRelationship ?pc3.
}
WHERE {
?p codo:reasonString ?rs.
?p codo:statePatientID ?pid.
?pc1 codo:statePatientID '1243'.
?pc2 codo:statePatientID '1244'.
?pc3 codo:statePatientID '1245'.
BIND (IRI((CONCAT('http://www.isibang.ac.in/ns/codo#CloseContact-', ?pid))) AS ?nexp).
FILTER(?rs = 'Contact of P1243 to P1245')
}")
(sparql:run-sparql
"DELETE {
?p codo:reasonString ?rs.}
INSERT {
?nexp a codo:CloseContact.
?p codo:suspectedReasonOfCatchingCovid-19 ?nexp.
?p codo:contractedVirusFrom ?pc1.
?p codo:hasRelationship ?pc1.
?p codo:contractedVirusFrom ?pc2.
?p codo:hasRelationship ?pc2.
?p codo:contractedVirusFrom ?pc3.
?p codo:hasRelationship ?pc3.
?p codo:contractedVirusFrom ?pc4.
?p codo:hasRelationship ?pc4.
?p codo:contractedVirusFrom ?pc5.
?p codo:hasRelationship ?pc5.
}
WHERE {
?p codo:reasonString ?rs.
?p codo:statePatientID ?pid.
?pc1 codo:statePatientID '134'.
?pc2 codo:statePatientID '135'.
?pc3 codo:statePatientID '136'.
?pc4 codo:statePatientID '137'.
?pc5 codo:statePatientID '138'.
BIND (IRI((CONCAT('http://www.isibang.ac.in/ns/codo#CloseContact-', ?pid))) AS ?nexp).
FILTER(CONTAINS(?rs,'Contact with P134-P135-P136-P137 and P138') || CONTAINS(?rs,'Contact with P134- P135- P136- P137 and P138'))
}")
(sparql:run-sparql
"DELETE {
?p codo:reasonString ?rs.}
INSERT {
?nexp a codo:CloseContact.
?p codo:suspectedReasonOfCatchingCovid-19 ?nexp.
?p codo:contractedVirusFrom ?pc1.
?p codo:hasRelationship ?pc1.
?p codo:contractedVirusFrom ?pc2.
?p codo:hasRelationship ?pc2.
?p codo:contractedVirusFrom ?pc3.
?p codo:hasRelationship ?pc3.
?p codo:contractedVirusFrom ?pc4.
?p codo:hasRelationship ?pc4.
?p codo:contractedVirusFrom ?pc5.
?p codo:hasRelationship ?pc5.
}
WHERE {
?p codo:reasonString ?rs.
?p codo:statePatientID ?pid.
?pc1 codo:statePatientID '134'.
?pc2 codo:statePatientID '135'.
?pc3 codo:statePatientID '136'.
?pc4 codo:statePatientID '137'.
?pc5 codo:statePatientID '139'.
BIND (IRI((CONCAT('http://www.isibang.ac.in/ns/codo#CloseContact-', ?pid))) AS ?nexp).
FILTER(CONTAINS(?rs,'Contact with P134-P135-P136-P137 and P139'))
}")
(sparql:run-sparql
"DELETE {
?p codo:reasonString ?rs.}
INSERT {
?nexp a codo:CloseContact.
?p codo:suspectedReasonOfCatchingCovid-19 ?nexp.
?p codo:contractedVirusFrom ?pc1.
?p codo:hasRelationship ?pc1.
?p codo:contractedVirusFrom ?pc2.
?p codo:hasRelationship ?pc2.
?p codo:contractedVirusFrom ?pc3.
?p codo:hasRelationship ?pc3.
?p codo:contractedVirusFrom ?pc4.
?p codo:hasRelationship ?pc4.
?p codo:contractedVirusFrom ?pc5.
?p codo:hasRelationship ?pc5.
}
WHERE {
?p codo:reasonString ?rs.
?p codo:statePatientID ?pid.
?pc1 codo:statePatientID '134'.
?pc2 codo:statePatientID '135'.
?pc3 codo:statePatientID '136'.
?pc4 codo:statePatientID '137'.
?pc5 codo:statePatientID '140'.
BIND (IRI((CONCAT('http://www.isibang.ac.in/ns/codo#CloseContact-', ?pid))) AS ?nexp).
FILTER(CONTAINS(?rs,'Contact with P134-P135-P136-P137 and P140'))
}")
)
(defun analyze-ad-hoc-pid-strings2 ()
(print "Entering ad hoc transforms 2")
(sparql:run-sparql
"DELETE {
?p codo:reasonString ?rs.}
INSERT {
?nexp a codo:CloseContact.
?p codo:suspectedReasonOfCatchingCovid-19 ?nexp.
?p codo:contractedVirusFrom ?pc1.
?p codo:hasRelationship ?pc1.
?p codo:contractedVirusFrom ?pc2.
?p codo:hasRelationship ?pc2.
?p codo:contractedVirusFrom ?pc3.
?p codo:hasRelationship ?pc3.
?p codo:contractedVirusFrom ?pc4.
?p codo:hasRelationship ?pc4.
?p codo:contractedVirusFrom ?pc5.
?p codo:hasRelationship ?pc5.
}
WHERE {
?p codo:reasonString ?rs.
?p codo:statePatientID ?pid.
?pc1 codo:statePatientID '89'.
?pc2 codo:statePatientID '90'.
?pc3 codo:statePatientID '91'.
?pc4 codo:statePatientID '141'.
BIND (IRI((CONCAT('http://www.isibang.ac.in/ns/codo#CloseContact-', ?pid))) AS ?nexp).
FILTER(CONTAINS(?rs,'Contact of P89-P90-P91 and P141'))}")
(sparql:run-sparql
"DELETE {
?p codo:reasonString ?rs.}
INSERT {
?nexp a codo:CloseContact.
?p codo:suspectedReasonOfCatchingCovid-19 ?nexp.
?p codo:contractedVirusFrom ?pc1.
?p codo:hasRelationship ?pc1.
?p codo:contractedVirusFrom ?pc2.
?p codo:hasRelationship ?pc2.
}
WHERE {
?p codo:reasonString ?rs.
?p codo:statePatientID ?pid.
?pc1 codo:statePatientID '16752'.
?pc2 codo:statePatientID '16753'.
BIND (IRI((CONCAT('http://www.isibang.ac.in/ns/codo#CloseContact-', ?pid))) AS ?nexp).
FILTER(CONTAINS(?rs,'Contact of P- 16752 and P-16753'))
}")
(sparql:run-sparql "DELETE {
?p codo:reasonString ?rs.}
INSERT {
?nexp a codo:CloseContact.
?p codo:suspectedReasonOfCatchingCovid-19 ?nexp.
?p codo:contractedVirusFrom ?pc1.
?p codo:hasRelationship ?pc1.
?p codo:contractedVirusFrom ?pc2.
?p codo:hasRelationship ?pc2.
?p codo:contractedVirusFrom ?pc3.
?p codo:hasRelationship ?pc3.
?p codo:contractedVirusFrom ?pc4.
?p codo:hasRelationship ?pc4.
?p codo:contractedVirusFrom ?pc5.
?p codo:hasRelationship ?pc5.
}
WHERE {
?p codo:reasonString ?rs.
?p codo:statePatientID ?pid.
?pc1 codo:statePatientID '23238'.
?pc2 codo:statePatientID '23239'.
?pc3 codo:statePatientID '23240'.
?pc4 codo:statePatientID '23241'.
?pc5 codo:statePatientID '23231'.
BIND (IRI((CONCAT('http://www.isibang.ac.in/ns/codo#CloseContact-', ?pid))) AS ?nexp).
FILTER(?rs = 'Contact of P23238 to P23241 and P23231')
}"))
(defun make-close-contact-object (patient-upi rs-upi)
;A utility function for all the functions that process
;reasonString properties with patient ID's in them
;Creates an instance of the codo:CloseContact object and makes it the value of the
;suspectedReasonOfCatchingCovid-19 property
;upi->value gets the string representation of the name of the object
(let* ((pid-upi (object (get-triple :s patient-upi :p !codo:statePatientID)))
(pid-string (upi->value pid-upi))
(nexp-uri-string (concatenate 'string "http://www.isibang.ac.in/ns/codo#CloseContact-" pid-string))
(nexp-upi (intern-resource nexp-uri-string)))
(add-triple nexp-upi !rdf:type !codo:CloseContact)
(add-triple patient-upi !codo:suspectedReasonOfCatchingCovid-19 nexp-upi)
(if *test-modep* (add-triple patient-upi !codo:reasonStringTD rs-upi))
(delete-triples :s patient-upi :p !codo:reasonString :o rs-upi)
)
)
(defun analyze-pid-strings1 ()
(print "Entering pattern matching transforms 1")
; For strings of the form: "Contact of P1606-1608"
(let ((results
(sparql:run-sparql
"SELECT ?p ?rs WHERE {?p codo:reasonString ?rs. FILTER(REGEX(?rs, 'Contact of P\\\\d+-\\\\d+'))}" :results-format :lists)))
; Don't really need to loop for current data since only one string matches this pattern but best to do this
; in case new data has more strings like this
(loop for result in results do
;Each result has two bindings, each in a list. First binding is the patient-upi ?p second is the reasonString-upi ?rs
;Following Let gets the bindings and gets the reasonString from its UPI
(let* ((patient-upi (first result))
(patient-value (part->terse patient-upi))
(rs-upi (second result))
(rs (upi->value rs-upi))
)
;Need multiple-value-bind because match-re returns a boolean if it succeeds and then the actual matched string
;Don't need the boolean but need to bind to it anyway to get the string. This results in a compilation warning
;because the variable matched-p is not used
(multiple-value-bind (matched-p ids) (match-re "\\d+-\\d+" rs)
;Split-re returns a list with the two integers between the dash
(let* ((id-string-list (split-re "-" ids))
(first-id-num (parse-integer (first id-string-list)))
(last-id-num (parse-integer (second id-string-list))))
;Use freetext index to efficiently retrieve the patient from its ID number
(loop for id-index from first-id-num to last-id-num
do
;String+ converts the integer back to a string so it can be used to find the patient
(let* ((id-string (string+ id-index))
(host-upi (first (freetext-get-unique-subjects (list 'match id-string) :index "PatientIDs")))
)
(print (list patient-value id-string))
(add-triple patient-upi !codo:contractedVirusFrom host-upi)
))))
(make-close-contact-object patient-upi rs-upi)
)))
(commit-triple-store)
)
(defun analyze-pid-strings2 ()
; For strings of the form: "Contact of P6137 to P6139"
(print "Entering pattern matching transforms 2")
(let ((results
(sparql:run-sparql "SELECT ?p ?rs WHERE {?p codo:reasonString ?rs. FILTER(REGEX(?rs, 'Contact of P\\\\d+ to P\\\\d+'))}" :results-format :lists)))
; Don't really need to loop for current data since only one string matches this pattern but best to do this
; in case new data has more strings like this
(loop for result in results do
;Each result has two bindings, each in a list. First binding is the patient-upi ?p second is the reasonString-upi ?rs
;Following Let gets the bindings and gets the reasonString from its UPI
(let* ((patient-upi (first result))
(patient-value (part->terse patient-upi))
(rs-upi (second result))
(rs (upi->value rs-upi))
)
;Need multiple-value-bind because match-re returns a boolean if it succeeds and then the actual matched string
;Don't need the boolean but need to bind to it anyway to get the string. This results in a compilation warning
;because the variable matched-p is not used
(multiple-value-bind (matched-p ids) (match-re "\\d+ to P\\d+" rs)
;Split-re returns a list with the two integers between the dash
(let* ((id-string-list (split-re " to P" ids))
(first-id-num (parse-integer (first id-string-list)))
(last-id-num (parse-integer (second id-string-list))))
;Use freetext index to efficiently retrieve the patient from its ID number
(loop for id-index from first-id-num to last-id-num
do
;String+ converts the integer back to a string so it can be used to find the patient
(let* ((id-string (string+ id-index))
(host-upi (first (freetext-get-unique-subjects (list 'match id-string))))
)
(print (list patient-value id-string))
(add-triple patient-upi !codo:contractedVirusFrom host-upi)
))))
(make-close-contact-object patient-upi rs-upi)
)))
(commit-triple-store)
)
(defun analyze-pid-strings3 ()
; For strings of the form: "Contact of P1942-P1944 and P1947"
; See analyze-pid-strings1 for more detailed comments
(print "Entering pattern matching transforms 3")
(let ((results
(sparql:run-sparql
"SELECT ?p ?rs WHERE {?p codo:reasonString ?rs. FILTER(REGEX(?rs, ' P\\\\d+-P\\\\d+ and P\\\\d+'))}" :results-format :lists)))
;As in previous function, each result contains a list of the patient UPI and the reasonString UPI
;Everything else works as in analyze-seq-reason-strings1 except this checks for a different pattern and has to match
;for an additional patient ID that comes after the "and"
(loop for result in results do
(let* ((patient-upi (first result))
(rs-upi (second result))
(rs (upi->value rs-upi))
)
(multiple-value-bind (matched-p ids) (match-re "\\d+-P\\d+" rs)
(let* ((id-string-list (split-re "-P" ids))
(first-id-num (parse-integer (first id-string-list)))
(last-id-num (parse-integer (second id-string-list)))
)
(loop for id-index from first-id-num to last-id-num
do
(let* ((id-string (string+ id-index))
(host-upi (first (freetext-get-unique-subjects (list 'match id-string))))
)
(print (list patient-upi id-string))
(add-triple patient-upi !codo:contractedVirusFrom host-upi)
))))
(multiple-value-bind (matched-p and-id-string) (match-re "and P\\d+" rs)
(let* ((id-string (subseq and-id-string 5))
(host-upi (first (freetext-get-unique-subjects (list 'match id-string)))))
(print (list patient-upi id-string))
(add-triple patient-upi !codo:contractedVirusFrom host-upi)
)
)
(make-close-contact-object patient-upi rs-upi))))
(commit-triple-store)
)
(defun analyze-pid-strings8 ()
; For strings of the form: "Contact of P1942-P1945"
(print "Entering pattern matching transforms 8")
(let ((results
(sparql:run-sparql "SELECT ?p ?rs WHERE {?p codo:reasonString ?rs. FILTER(REGEX(?rs, 'Contact of P\\\\d+-P\\\\d+'))}" :results-format :lists)))
; Don't really need to loop for current data since only one string matches this pattern but best to do this
; in case new data has more strings like this
(loop for result in results do
;Each result has two bindings, each in a list. First binding is the patient-upi ?p second is the reasonString-upi ?rs
;Following Let gets the bindings and gets the reasonString from its UPI
(let* ((patient-upi (first result))
(patient-value (part->terse patient-upi))
(rs-upi (second result))
(rs (upi->value rs-upi))
)
;Need multiple-value-bind because match-re returns a boolean if it succeeds and then the actual matched string
;Don't need the boolean but need to bind to it anyway to get the string. This results in a compilation warning
;because the variable matched-p is not used
(multiple-value-bind (matched-p ids) (match-re "\\d+-P\\d+" rs)
;Split-re returns a list with the two integers between the dash
(let* ((id-string-list (split-re "-P" ids))
(first-id-num (parse-integer (first id-string-list)))
(last-id-num (parse-integer (second id-string-list))))
;Use freetext index to efficiently retrieve the patient from its ID number
(loop for id-index from first-id-num to last-id-num
do
;String+ converts the integer back to a string so it can be used to find the patient
(let* ((id-string (string+ id-index))
(host-upi (first (freetext-get-unique-subjects (list 'match id-string))))
)
(print (list rs patient-value id-string host-upi))
(add-triple patient-upi !codo:contractedVirusFrom host-upi)
))))
(make-close-contact-object patient-upi rs-upi)
)))
(commit-triple-store)
)
(defun analyze-pid-strings9 ()
; For strings of the form: "Contact of P28441 to 28443"
(print "Entering pattern matching transforms 9")
(let ((results
(sparql:run-sparql "SELECT ?p ?rs WHERE {?p codo:reasonString ?rs. FILTER(REGEX(?rs, 'Contact of P\\\\d+ to \\\\d+'))}" :results-format :lists)))
; Don't really need to loop for current data since only one string matches this pattern but best to do this
; in case new data has more strings like this
(loop for result in results do
;Each result has two bindings, each in a list. First binding is the patient-upi ?p second is the reasonString-upi ?rs
;Following Let gets the bindings and gets the reasonString from its UPI
(let* ((patient-upi (first result))
(patient-value (part->terse patient-upi))
(rs-upi (second result))
(rs (upi->value rs-upi))
)
;Need multiple-value-bind because match-re returns a boolean if it succeeds and then the actual matched string
;Don't need the boolean but need to bind to it anyway to get the string. This results in a compilation warning
;because the variable matched-p is not used
(multiple-value-bind (matched-p ids) (match-re "\\d+ to \\d+" rs)
;Split-re returns a list with the two integers between the dash
(let* ((id-string-list (split-re " to " ids))
(first-id-num (parse-integer (first id-string-list)))
(last-id-num (parse-integer (second id-string-list))))
;Use freetext index to efficiently retrieve the patient from its ID number
(loop for id-index from first-id-num to last-id-num
do
;String+ converts the integer back to a string so it can be used to find the patient
(let* ((id-string (string+ id-index))
(host-upi (first (freetext-get-unique-subjects (list 'match id-string))))
)
(print (list patient-value id-string))
(add-triple patient-upi !codo:contractedVirusFrom host-upi)
))))
(make-close-contact-object patient-upi rs-upi)
)))
(commit-triple-store)
)
(defun analyze-pid-stringsG ()
; For strings of the form: "Contact of 16752 and 16753 and 19794"
; This is a general function that will replace many of the functions previously above
; It should match any string that starts with "Contact of" and will find each of the patient Ids.
; This should work for any string with patient Ids in it however, it will not process intervals of Ids.
; E.g. "P123-P125" would get processed by this function by just using the ids 123 and 125 and would not include 123
; Hence, the functions that process intervals must run before this function
; See analyze-pid-strings1 for more detailed comments
(print "Entering pattern matching transforms G")
(let ((results
(sparql:run-sparql
"SELECT ?p ?rs WHERE {?p codo:reasonString ?rs. FILTER(STRSTARTS(?rs, 'Contact'))}" :results-format :lists)))
(loop for result in results do
(let* (
(patient-upi (first result))
(patient-value (part->terse patient-upi))
(rs-upi (second result))
(rs (upi->value rs-upi))
(ids (split-re "\\D+" rs))
)
;Need multiple-value-bind because match-re returns a boolean if it succeeds and then the actual matched string
;Don't need the boolean but need to bind to it anyway to get the string. This results in a compilation warning
;because the variable matched-p is not used
(print rs)
(print ids)
(loop for id-string in ids do
(if (string= id-string "") (print "Ignoring blank id string")
(let ((host-upi (first (freetext-get-unique-subjects (list 'match id-string)))))
(print (list patient-value id-string))
(add-triple patient-upi !codo:contractedVirusFrom host-upi)
(make-close-contact-object patient-upi rs-upi)))))))
(commit-triple-store)
)
(defun codo-regex-transforms ()
(analyze-ad-hoc-pid-strings1)
(analyze-ad-hoc-pid-strings2)
(analyze-pid-strings1)
(analyze-pid-strings2)
(analyze-pid-strings3)
(analyze-pid-strings8)
(analyze-pid-strings9)
(analyze-pid-stringsG))