source: fmts/trunk/kids/C0X_1_0_0_T4.KID@ 1483

Last change on this file since 1483 was 1273, checked in by George Lilly, 13 years ago

initial load of ftms project files and test data

File size: 34.9 KB
RevLine 
[1273]1KIDS Distribution saved on Oct 31, 2011@00:07:33
2includes WGET and print template
3**KIDS**:C0X*1.0*0^
4
5**INSTALL NAME**
6C0X*1.0*0
7"BLD",7885,0)
8C0X*1.0*0^^0^3111031^n
9"BLD",7885,4,0)
10^9.64PA^172.201^2
11"BLD",7885,4,172.101,0)
12172.101
13"BLD",7885,4,172.101,222)
14y^y^f^^^^n
15"BLD",7885,4,172.201,0)
16172.201
17"BLD",7885,4,172.201,222)
18y^y^f^^^^n
19"BLD",7885,4,"B",172.101,172.101)
20
21"BLD",7885,4,"B",172.201,172.201)
22
23"BLD",7885,6.3)
244
25"BLD",7885,"KRN",0)
26^9.67PA^779.2^20
27"BLD",7885,"KRN",.4,0)
28.4
29"BLD",7885,"KRN",.4,"NM",0)
30^9.68A^1^1
31"BLD",7885,"KRN",.4,"NM",1,0)
32C0X PRINT GRAPH FILE #172.101^172.101^0
33"BLD",7885,"KRN",.4,"NM","B","C0X PRINT GRAPH FILE #172.101",1)
34
35"BLD",7885,"KRN",.401,0)
36.401
37"BLD",7885,"KRN",.402,0)
38.402
39"BLD",7885,"KRN",.403,0)
40.403
41"BLD",7885,"KRN",.5,0)
42.5
43"BLD",7885,"KRN",.84,0)
44.84
45"BLD",7885,"KRN",3.6,0)
463.6
47"BLD",7885,"KRN",3.8,0)
483.8
49"BLD",7885,"KRN",9.2,0)
509.2
51"BLD",7885,"KRN",9.8,0)
529.8
53"BLD",7885,"KRN",9.8,"NM",0)
54^9.68A^1^1
55"BLD",7885,"KRN",9.8,"NM",1,0)
56C0XMAIN^^0^B115009682
57"BLD",7885,"KRN",9.8,"NM","B","C0XMAIN",1)
58
59"BLD",7885,"KRN",19,0)
6019
61"BLD",7885,"KRN",19.1,0)
6219.1
63"BLD",7885,"KRN",101,0)
64101
65"BLD",7885,"KRN",409.61,0)
66409.61
67"BLD",7885,"KRN",771,0)
68771
69"BLD",7885,"KRN",779.2,0)
70779.2
71"BLD",7885,"KRN",870,0)
72870
73"BLD",7885,"KRN",8989.51,0)
748989.51
75"BLD",7885,"KRN",8989.52,0)
768989.52
77"BLD",7885,"KRN",8994,0)
788994
79"BLD",7885,"KRN","B",.4,.4)
80
81"BLD",7885,"KRN","B",.401,.401)
82
83"BLD",7885,"KRN","B",.402,.402)
84
85"BLD",7885,"KRN","B",.403,.403)
86
87"BLD",7885,"KRN","B",.5,.5)
88
89"BLD",7885,"KRN","B",.84,.84)
90
91"BLD",7885,"KRN","B",3.6,3.6)
92
93"BLD",7885,"KRN","B",3.8,3.8)
94
95"BLD",7885,"KRN","B",9.2,9.2)
96
97"BLD",7885,"KRN","B",9.8,9.8)
98
99"BLD",7885,"KRN","B",19,19)
100
101"BLD",7885,"KRN","B",19.1,19.1)
102
103"BLD",7885,"KRN","B",101,101)
104
105"BLD",7885,"KRN","B",409.61,409.61)
106
107"BLD",7885,"KRN","B",771,771)
108
109"BLD",7885,"KRN","B",779.2,779.2)
110
111"BLD",7885,"KRN","B",870,870)
112
113"BLD",7885,"KRN","B",8989.51,8989.51)
114
115"BLD",7885,"KRN","B",8989.52,8989.52)
116
117"BLD",7885,"KRN","B",8994,8994)
118
119"FIA",172.101)
120C0X TRIPLE
121"FIA",172.101,0)
122^C0X(101,
123"FIA",172.101,0,0)
124172.101I
125"FIA",172.101,0,1)
126y^y^f^^^^n
127"FIA",172.101,0,10)
128
129"FIA",172.101,0,11)
130
131"FIA",172.101,0,"RLRO")
132
133"FIA",172.101,172.101)
1340
135"FIA",172.201)
136C0X STRING
137"FIA",172.201,0)
138^C0X(201,
139"FIA",172.201,0,0)
140172.201
141"FIA",172.201,0,1)
142y^y^f^^^^n
143"FIA",172.201,0,10)
144
145"FIA",172.201,0,11)
146
147"FIA",172.201,0,"RLRO")
148
149"FIA",172.201,172.201)
1500
151"FIA",172.201,172.2011)
1520
153"IX",172.101,172.101,"G",0)
154172.101^G^REGULAR INDEX OF THE GRAPH FIELD^R^^F^IR^I^172.101^^^^^LS
155"IX",172.101,172.101,"G",1)
156S ^C0X(101,"G",X,DA)=""
157"IX",172.101,172.101,"G",2)
158K ^C0X(101,"G",X,DA)
159"IX",172.101,172.101,"G",2.5)
160K ^C0X(101,"G")
161"IX",172.101,172.101,"G",11.1,0)
162^.114IA^1^1
163"IX",172.101,172.101,"G",11.1,1,0)
1641^F^172.101^.02^^1^F
165"IX",172.101,172.101,"G",11.1,1,3)
166
167"IX",172.101,172.101,"GOPS",0)
168172.101^GOPS^GRAPH ONLY OBJECT PREDICATE SUBJECT^R^^R^IR^I^172.101^^^^^LS
169"IX",172.101,172.101,"GOPS",1)
170S ^C0X(101,"GOPS",$E(X(1),1,240),$E(X(2),1,240),$E(X(3),1,240),$E(X(4),1,240),DA)=""
171"IX",172.101,172.101,"GOPS",2)
172K ^C0X(101,"GOPS",$E(X(1),1,240),$E(X(2),1,240),$E(X(3),1,240),$E(X(4),1,240),DA)
173"IX",172.101,172.101,"GOPS",2.5)
174K ^C0X(101,"GOPS")
175"IX",172.101,172.101,"GOPS",11.1,0)
176^.114IA^4^4
177"IX",172.101,172.101,"GOPS",11.1,1,0)
1781^F^172.101^.02^240^1^F
179"IX",172.101,172.101,"GOPS",11.1,1,3)
180
181"IX",172.101,172.101,"GOPS",11.1,2,0)
1822^F^172.101^.05^240^2^F
183"IX",172.101,172.101,"GOPS",11.1,2,3)
184
185"IX",172.101,172.101,"GOPS",11.1,3,0)
1863^F^172.101^.04^240^3^F
187"IX",172.101,172.101,"GOPS",11.1,3,3)
188
189"IX",172.101,172.101,"GOPS",11.1,4,0)
1904^F^172.101^.03^240^4^F
191"IX",172.101,172.101,"GOPS",11.1,4,3)
192
193"IX",172.101,172.101,"GOSP",0)
194172.101^GOSP^GRAPH ONLY OBJECT SUBJECT PREDICATE^R^^R^IR^I^172.101^^^^^LS
195"IX",172.101,172.101,"GOSP",1)
196S ^C0X(101,"GOSP",$E(X(1),1,240),$E(X(2),1,240),$E(X(3),1,240),$E(X(4),1,240),DA)=""
197"IX",172.101,172.101,"GOSP",2)
198K ^C0X(101,"GOSP",$E(X(1),1,240),$E(X(2),1,240),$E(X(3),1,240),$E(X(4),1,240),DA)
199"IX",172.101,172.101,"GOSP",2.5)
200K ^C0X(101,"GOSP")
201"IX",172.101,172.101,"GOSP",11.1,0)
202^.114IA^4^4
203"IX",172.101,172.101,"GOSP",11.1,1,0)
2041^F^172.101^.02^240^1^F
205"IX",172.101,172.101,"GOSP",11.1,1,3)
206
207"IX",172.101,172.101,"GOSP",11.1,2,0)
2082^F^172.101^.05^240^2^F
209"IX",172.101,172.101,"GOSP",11.1,2,3)
210
211"IX",172.101,172.101,"GOSP",11.1,3,0)
2123^F^172.101^.03^240^3^F
213"IX",172.101,172.101,"GOSP",11.1,3,3)
214
215"IX",172.101,172.101,"GOSP",11.1,4,0)
2164^F^172.101^.04^240^4^F
217"IX",172.101,172.101,"GOSP",11.1,4,3)
218
219"IX",172.101,172.101,"GPSO",0)
220172.101^GPSO^GRAPH ONLY PREDICATE SUBJECT OBJECT^R^^R^IR^I^172.101^^^^^LS
221"IX",172.101,172.101,"GPSO",1)
222S ^C0X(101,"GPSO",$E(X(1),1,240),$E(X(2),1,240),$E(X(3),1,240),$E(X(4),1,240),DA)=""
223"IX",172.101,172.101,"GPSO",2)
224K ^C0X(101,"GPSO",$E(X(1),1,240),$E(X(2),1,240),$E(X(3),1,240),$E(X(4),1,240),DA)
225"IX",172.101,172.101,"GPSO",2.5)
226K ^C0X(101,"GPSO")
227"IX",172.101,172.101,"GPSO",11.1,0)
228^.114IA^4^4
229"IX",172.101,172.101,"GPSO",11.1,1,0)
2301^F^172.101^.02^240^1^F
231"IX",172.101,172.101,"GPSO",11.1,1,3)
232
233"IX",172.101,172.101,"GPSO",11.1,2,0)
2342^F^172.101^.04^240^2^F
235"IX",172.101,172.101,"GPSO",11.1,2,3)
236
237"IX",172.101,172.101,"GPSO",11.1,3,0)
2383^F^172.101^.03^240^3^F
239"IX",172.101,172.101,"GPSO",11.1,3,3)
240
241"IX",172.101,172.101,"GPSO",11.1,4,0)
2424^F^172.101^.05^240^4^F
243"IX",172.101,172.101,"GPSO",11.1,4,3)
244
245"IX",172.101,172.101,"GSPO",0)
246172.101^GSPO^GROUP ONLY SUBJECT PREDICATE OBJECT^R^^R^IR^I^172.101^^^^^LS
247"IX",172.101,172.101,"GSPO",1)
248S ^C0X(101,"GSPO",$E(X(1),1,240),$E(X(2),1,240),$E(X(3),1,240),$E(X(4),1,240),DA)=""
249"IX",172.101,172.101,"GSPO",2)
250K ^C0X(101,"GSPO",$E(X(1),1,240),$E(X(2),1,240),$E(X(3),1,240),$E(X(4),1,240),DA)
251"IX",172.101,172.101,"GSPO",2.5)
252K ^C0X(101,"GSPO")
253"IX",172.101,172.101,"GSPO",11.1,0)
254^.114IA^4^4
255"IX",172.101,172.101,"GSPO",11.1,1,0)
2561^F^172.101^.02^240^1^F
257"IX",172.101,172.101,"GSPO",11.1,1,3)
258
259"IX",172.101,172.101,"GSPO",11.1,2,0)
2602^F^172.101^.03^240^2^F
261"IX",172.101,172.101,"GSPO",11.1,2,3)
262
263"IX",172.101,172.101,"GSPO",11.1,3,0)
2643^F^172.101^.04^240^3^F
265"IX",172.101,172.101,"GSPO",11.1,3,3)
266
267"IX",172.101,172.101,"GSPO",11.1,4,0)
2684^F^172.101^.05^240^4^F
269"IX",172.101,172.101,"GSPO",11.1,4,3)
270
271"IX",172.101,172.101,"OPS",0)
272172.101^OPS^REGULAR INDEX OF OBJECT PREDICATE SUBJECT^R^^R^IR^I^172.101^^^^^LS
273"IX",172.101,172.101,"OPS",1)
274S ^C0X(101,"OPS",X(1),X(2),X(3),DA)=""
275"IX",172.101,172.101,"OPS",2)
276K ^C0X(101,"OPS",X(1),X(2),X(3),DA)
277"IX",172.101,172.101,"OPS",2.5)
278K ^C0X(101,"OPS")
279"IX",172.101,172.101,"OPS",11.1,0)
280^.114IA^3^3
281"IX",172.101,172.101,"OPS",11.1,1,0)
2821^F^172.101^.05^^1^F
283"IX",172.101,172.101,"OPS",11.1,1,3)
284
285"IX",172.101,172.101,"OPS",11.1,2,0)
2862^F^172.101^.04^^2^F
287"IX",172.101,172.101,"OPS",11.1,2,3)
288
289"IX",172.101,172.101,"OPS",11.1,3,0)
2903^F^172.101^.03^^3^F
291"IX",172.101,172.101,"OPS",11.1,3,3)
292
293"IX",172.101,172.101,"OSP",0)
294172.101^OSP^REGULAR INDEX OF OBJECT SUBJECT PREDICATE^R^^R^IR^I^172.101^^^^^LS
295"IX",172.101,172.101,"OSP",1)
296S ^C0X(101,"OSP",X(1),X(2),X(3),DA)=""
297"IX",172.101,172.101,"OSP",2)
298K ^C0X(101,"OSP",X(1),X(2),X(3),DA)
299"IX",172.101,172.101,"OSP",2.5)
300K ^C0X(101,"OSP")
301"IX",172.101,172.101,"OSP",11.1,0)
302^.114IA^3^3
303"IX",172.101,172.101,"OSP",11.1,1,0)
3041^F^172.101^.05^^1^F
305"IX",172.101,172.101,"OSP",11.1,1,3)
306
307"IX",172.101,172.101,"OSP",11.1,2,0)
3082^F^172.101^.03^^2^F
309"IX",172.101,172.101,"OSP",11.1,2,3)
310
311"IX",172.101,172.101,"OSP",11.1,3,0)
3123^F^172.101^.04^^3^F
313"IX",172.101,172.101,"OSP",11.1,3,3)
314
315"IX",172.101,172.101,"PSO",0)
316172.101^PSO^REGULAR INDEX OF PREDICATE SUBJECT OBJECT^R^^R^IR^I^172.101^^^^^LS
317"IX",172.101,172.101,"PSO",1)
318S ^C0X(101,"PSO",X(1),X(2),X(3),DA)=""
319"IX",172.101,172.101,"PSO",2)
320K ^C0X(101,"PSO",X(1),X(2),X(3),DA)
321"IX",172.101,172.101,"PSO",2.5)
322K ^C0X(101,"PSO")
323"IX",172.101,172.101,"PSO",11.1,0)
324^.114IA^3^3
325"IX",172.101,172.101,"PSO",11.1,1,0)
3261^F^172.101^.04^^1^F
327"IX",172.101,172.101,"PSO",11.1,1,3)
328
329"IX",172.101,172.101,"PSO",11.1,2,0)
3302^F^172.101^.03^^2^F
331"IX",172.101,172.101,"PSO",11.1,2,3)
332
333"IX",172.101,172.101,"PSO",11.1,3,0)
3343^F^172.101^.05^^3^F
335"IX",172.101,172.101,"PSO",11.1,3,3)
336
337"IX",172.101,172.101,"SPO",0)
338172.101^SPO^REGULAR INDEX OF SUBJECT PREDICATE OBJECT^R^^R^IR^I^172.101^^^^^LS
339"IX",172.101,172.101,"SPO",1)
340S ^C0X(101,"SPO",X(1),X(2),X(3),DA)=""
341"IX",172.101,172.101,"SPO",2)
342K ^C0X(101,"SPO",X(1),X(2),X(3),DA)
343"IX",172.101,172.101,"SPO",2.5)
344K ^C0X(101,"SPO")
345"IX",172.101,172.101,"SPO",11.1,0)
346^.114IA^3^3
347"IX",172.101,172.101,"SPO",11.1,1,0)
3481^F^172.101^.03^^1^F
349"IX",172.101,172.101,"SPO",11.1,1,3)
350
351"IX",172.101,172.101,"SPO",11.1,2,0)
3522^F^172.101^.04^^2^F
353"IX",172.101,172.101,"SPO",11.1,2,3)
354
355"IX",172.101,172.101,"SPO",11.1,3,0)
3563^F^172.101^.05^^3^F
357"IX",172.101,172.101,"SPO",11.1,3,3)
358
359"IX",172.201,172.201,"B",0)
360172.201^B^regular B index for strings to support long strings^R^^F^IR^I^172.201^^^^^LS
361"IX",172.201,172.201,"B",1)
362S ^C0X(201,"B",$E(X,1,240),DA)=""
363"IX",172.201,172.201,"B",2)
364K ^C0X(201,"B",$E(X,1,240),DA)
365"IX",172.201,172.201,"B",2.5)
366K ^C0X(201,"B")
367"IX",172.201,172.201,"B",11.1,0)
368^.114IA^1^1
369"IX",172.201,172.201,"B",11.1,1,0)
3701^F^172.201^.01^240^1^F
371"KRN",.4,1498,-1)
3720^1
373"KRN",.4,1498,0)
374C0X PRINT GRAPH^3111029.121^@^172.101^^@^3111030
375"KRN",.4,1498,"F",2)
376.03;W25;S~.04;C27;W25~.05;C54;W25~
377"KRN",.4,1498,"H")
378C0X TRIPLE LIST
379"MBREQ")
3800
381"ORD",5,.4)
382.4;5;;;EDEOUT^DIFROMSO(.4,DA,"",XPDA);FPRE^DIFROMSI(.4,"",XPDA);EPRE^DIFROMSI(.4,DA,$E("N",$G(XPDNEW)),XPDA,"",OLDA);;EPOST^DIFROMSI(.4,DA,"",XPDA);DEL^DIFROMSK(.4,"",%)
383"ORD",5,.4,0)
384PRINT TEMPLATE
385"QUES","XPF1",0)
386Y
387"QUES","XPF1","??")
388^D REP^XPDH
389"QUES","XPF1","A")
390Shall I write over your |FLAG| File
391"QUES","XPF1","B")
392YES
393"QUES","XPF1","M")
394D XPF1^XPDIQ
395"QUES","XPF2",0)
396Y
397"QUES","XPF2","??")
398^D DTA^XPDH
399"QUES","XPF2","A")
400Want my data |FLAG| yours
401"QUES","XPF2","B")
402YES
403"QUES","XPF2","M")
404D XPF2^XPDIQ
405"QUES","XPI1",0)
406YO
407"QUES","XPI1","??")
408^D INHIBIT^XPDH
409"QUES","XPI1","A")
410Want KIDS to INHIBIT LOGONs during the install
411"QUES","XPI1","B")
412NO
413"QUES","XPI1","M")
414D XPI1^XPDIQ
415"QUES","XPM1",0)
416PO^VA(200,:EM
417"QUES","XPM1","??")
418^D MG^XPDH
419"QUES","XPM1","A")
420Enter the Coordinator for Mail Group '|FLAG|'
421"QUES","XPM1","B")
422
423"QUES","XPM1","M")
424D XPM1^XPDIQ
425"QUES","XPO1",0)
426Y
427"QUES","XPO1","??")
428^D MENU^XPDH
429"QUES","XPO1","A")
430Want KIDS to Rebuild Menu Trees Upon Completion of Install
431"QUES","XPO1","B")
432NO
433"QUES","XPO1","M")
434D XPO1^XPDIQ
435"QUES","XPZ1",0)
436Y
437"QUES","XPZ1","??")
438^D OPT^XPDH
439"QUES","XPZ1","A")
440Want to DISABLE Scheduled Options, Menu Options, and Protocols
441"QUES","XPZ1","B")
442NO
443"QUES","XPZ1","M")
444D XPZ1^XPDIQ
445"QUES","XPZ2",0)
446Y
447"QUES","XPZ2","??")
448^D RTN^XPDH
449"QUES","XPZ2","A")
450Want to MOVE routines to other CPUs
451"QUES","XPZ2","B")
452NO
453"QUES","XPZ2","M")
454D XPZ2^XPDIQ
455"RTN")
4561
457"RTN","C0XMAIN")
4580^1^B115009682
459"RTN","C0XMAIN",1,0)
460C0XMAIN ; GPL - Fileman Triples entry point routine ;10/13/11 17:05
461"RTN","C0XMAIN",2,0)
462 ;;0.1;C0X;nopatch;noreleasedate;Build 4
463"RTN","C0XMAIN",3,0)
464 ;Copyright 2011 George Lilly. Licensed under the terms of the GNU
465"RTN","C0XMAIN",4,0)
466 ;General Public License See attached copy of the License.
467"RTN","C0XMAIN",5,0)
468 ;
469"RTN","C0XMAIN",6,0)
470 ;This program is free software; you can redistribute it and/or modify
471"RTN","C0XMAIN",7,0)
472 ;it under the terms of the GNU General Public License as published by
473"RTN","C0XMAIN",8,0)
474 ;the Free Software Foundation; either version 2 of the License, or
475"RTN","C0XMAIN",9,0)
476 ;(at your option) any later version.
477"RTN","C0XMAIN",10,0)
478 ;
479"RTN","C0XMAIN",11,0)
480 ;This program is distributed in the hope that it will be useful,
481"RTN","C0XMAIN",12,0)
482 ;but WITHOUT ANY WARRANTY; without even the implied warranty of
483"RTN","C0XMAIN",13,0)
484 ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
485"RTN","C0XMAIN",14,0)
486 ;GNU General Public License for more details.
487"RTN","C0XMAIN",15,0)
488 ;
489"RTN","C0XMAIN",16,0)
490 ;You should have received a copy of the GNU General Public License along
491"RTN","C0XMAIN",17,0)
492 ;with this program; if not, write to the Free Software Foundation, Inc.,
493"RTN","C0XMAIN",18,0)
494 ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
495"RTN","C0XMAIN",19,0)
496 ;
497"RTN","C0XMAIN",20,0)
498 Q
499"RTN","C0XMAIN",21,0)
500 ;
501"RTN","C0XMAIN",22,0)
502INITFARY(ZFARY) ; INITIALIZE FILE NUMBERS AND OTHER USEFUL THINGS
503"RTN","C0XMAIN",23,0)
504 ; FOR THE DEFAULT TRIPLE STORE. USE OTHER VALUES FOR SUPPORTING ADDITIONAL
505"RTN","C0XMAIN",24,0)
506 ; TRIPLE STORES
507"RTN","C0XMAIN",25,0)
508 S @ZFARY@("C0XTFN")=172.101 ; TRIPLES FILE NUMBER
509"RTN","C0XMAIN",26,0)
510 S @ZFARY@("C0XSFN")=172.201 ; TRIPLES STRINGS FILE NUMBER
511"RTN","C0XMAIN",27,0)
512 S @ZFARY@("C0XTN")=$NA(^C0X(101)) ; TRIPLES GLOBAL NAME
513"RTN","C0XMAIN",28,0)
514 S @ZFARY@("C0XSN")=$NA(^C0X(201)) ; STRING FILE GLOBAL NAME
515"RTN","C0XMAIN",29,0)
516 S @ZFARY@("C0XDIR")="/home/glilly/all_smart_patient_data/smart-rdf/"
517"RTN","C0XMAIN",30,0)
518 D USEFARY(ZFARY)
519"RTN","C0XMAIN",31,0)
520 Q
521"RTN","C0XMAIN",32,0)
522 ;
523"RTN","C0XMAIN",33,0)
524USEFARY(ZFARY) ; INITIALIZES VARIABLES SAVED IN ARRAY ZFARY
525"RTN","C0XMAIN",34,0)
526 N ZI S ZI=""
527"RTN","C0XMAIN",35,0)
528 F S ZI=$O(@ZFARY@(ZI)) Q:ZI="" D
529"RTN","C0XMAIN",36,0)
530 . ;N ZX
531"RTN","C0XMAIN",37,0)
532 . S ZX="S "_ZI_"="""_@ZFARY@(ZI)_""""
533"RTN","C0XMAIN",38,0)
534 . ;W !,ZX
535"RTN","C0XMAIN",39,0)
536 . X ZX
537"RTN","C0XMAIN",40,0)
538 Q
539"RTN","C0XMAIN",41,0)
540 ;
541"RTN","C0XMAIN",42,0)
542IMPORT(FNAME,FDIR,FURL,FARY) ; EXTRINSIC THAT READS A FILE FROM THE STANDARD
543"RTN","C0XMAIN",43,0)
544 ; DIRECTORY, LOADS IT INTO THE TRIPLESTORE AS TEXT, AND RETURNS THE
545"RTN","C0XMAIN",44,0)
546 ; NODE NAME OF THE TEXT TRIPLE
547"RTN","C0XMAIN",45,0)
548 ; FDIR IS THE OPTIONAL DIRECTORY (DEFAUTS TO STANDARD DIR)
549"RTN","C0XMAIN",46,0)
550 ; FURL IS THE OPTIONAL URI FOR ACCESSING THE FILE FROM THE TRIPLE STORE
551"RTN","C0XMAIN",47,0)
552 ; FARY IS THE OPTIONAL FILE ARRAY OF THE TRIPLE STORE TO USE
553"RTN","C0XMAIN",48,0)
554 I '$D(FARY) D ;
555"RTN","C0XMAIN",49,0)
556 . D INITFARY("C0XFARY")
557"RTN","C0XMAIN",50,0)
558 . S FARY="C0XFARY"
559"RTN","C0XMAIN",51,0)
560 D USEFARY(FARY)
561"RTN","C0XMAIN",52,0)
562 N ZD,ZTMP
563"RTN","C0XMAIN",53,0)
564 I '$D(FDIR) S FDIR=C0XDIR ; DIRECTORY OF THE RDF FILE
565"RTN","C0XMAIN",54,0)
566 I '$D(FURL) D ;
567"RTN","C0XMAIN",55,0)
568 . N ZN2 S ZN2=$TR(FNAME,".","_") ; REMOVE THE DOT FROM THE NAME
569"RTN","C0XMAIN",56,0)
570 . S FURL=FDIR_ZN2
571"RTN","C0XMAIN",57,0)
572 N ZTMP
573"RTN","C0XMAIN",58,0)
574 S ZTMP=$NA(^TMP("C0X",$J,"FILEIN",1)) ; WHERE TO PUT THE INCOMING FILE
575"RTN","C0XMAIN",59,0)
576 K @ZTMP ; MAKE SURE IT'S CLEAR
577"RTN","C0XMAIN",60,0)
578 S C0XSTART=$$NOW^XLFDT
579"RTN","C0XMAIN",61,0)
580 W !,"STARTED: ",C0XSTART
581"RTN","C0XMAIN",62,0)
582 W !,"READING IN: ",FNAME
583"RTN","C0XMAIN",63,0)
584 I '$$FILEIN(ZTMP,FDIR,FNAME,4) D Q ; QUIT IF NO SUCCESS
585"RTN","C0XMAIN",64,0)
586 . W !,"ERROR READING FILE: ",FDIR,FNAME
587"RTN","C0XMAIN",65,0)
588 S ZRDF=$NA(^TMP("C0X",$J,"FILEIN")) ; WITHOUT THE SUBSCRIPT
589"RTN","C0XMAIN",66,0)
590 W !,$O(@ZRDF@(""),-1)," LINES READ"
591"RTN","C0XMAIN",67,0)
592 D INSRDF(ZRDF,FURL,FARY) ; IMPORT AND PROCESS THE RDF
593"RTN","C0XMAIN",68,0)
594 Q
595"RTN","C0XMAIN",69,0)
596 ;
597"RTN","C0XMAIN",70,0)
598WGET(ZURL,FARY) ; GET FROM THE INTERNET AN RDF FILE AND INSERT IT
599"RTN","C0XMAIN",71,0)
600 ;
601"RTN","C0XMAIN",72,0)
602 I '$D(FARY) D ;
603"RTN","C0XMAIN",73,0)
604 . D INITFARY("C0XFARY")
605"RTN","C0XMAIN",74,0)
606 . S FARY="C0XFARY"
607"RTN","C0XMAIN",75,0)
608 D USEFARY(FARY)
609"RTN","C0XMAIN",76,0)
610 ;N ZLOC,ZTMP
611"RTN","C0XMAIN",77,0)
612 K ZTMP
613"RTN","C0XMAIN",78,0)
614 S ZLOC=$NA(^TMP("C0X","WGET",$J))
615"RTN","C0XMAIN",79,0)
616 S C0XSTART=$$NOW^XLFDT
617"RTN","C0XMAIN",80,0)
618 W !,"STARTED: ",C0XSTART
619"RTN","C0XMAIN",81,0)
620 W !,"DOWNLOADING: ",ZURL
621"RTN","C0XMAIN",82,0)
622 S OK=$$httpGET^%zewdGTM(ZURL,.ZTMP)
623"RTN","C0XMAIN",83,0)
624 M @ZLOC=ZTMP
625"RTN","C0XMAIN",84,0)
626 W !,$O(@ZLOC@(""),-1)," LINES READ"
627"RTN","C0XMAIN",85,0)
628 D INSRDF(ZLOC,ZURL,FARY)
629"RTN","C0XMAIN",86,0)
630 Q
631"RTN","C0XMAIN",87,0)
632 ;
633"RTN","C0XMAIN",88,0)
634INSRDF(ZRDF,ZNAME,FARY) ; INSERT AN RDF FILE INTO THE STORE AND PROCESS
635"RTN","C0XMAIN",89,0)
636 ; ZRDF IS PASSED BY NAME
637"RTN","C0XMAIN",90,0)
638 I '$D(FARY) D ;
639"RTN","C0XMAIN",91,0)
640 . D INITFARY("C0XFARY")
641"RTN","C0XMAIN",92,0)
642 . S FARY="C0XFARY"
643"RTN","C0XMAIN",93,0)
644 D USEFARY(FARY)
645"RTN","C0XMAIN",94,0)
646 N ZGRAPH,ZSUBJECT
647"RTN","C0XMAIN",95,0)
648 S ZGRAPH="_:G"_$$LKY9 ; RANDOM GRAPH NAME
649"RTN","C0XMAIN",96,0)
650 S ZSUBJECT=$$ANONS ; RANDOM ANOYMOUS SUBJECT
651"RTN","C0XMAIN",97,0)
652 D ADD(ZGRAPH,ZSUBJECT,"fmts:url",ZNAME,FARY)
653"RTN","C0XMAIN",98,0)
654 N ZTXTNM
655"RTN","C0XMAIN",99,0)
656 S ZTXTNM="_TXT_INCOMING_RDF_FILE_"_ZNAME_"_"_$$LKY9 ; NAME FOR TEXT NODE
657"RTN","C0XMAIN",100,0)
658 D ADD(ZGRAPH,ZSUBJECT,"fmts:rdfSource",ZTXTNM,FARY)
659"RTN","C0XMAIN",101,0)
660 D UPDIE(.C0XFDA) ; TRY IT OUT
661"RTN","C0XMAIN",102,0)
662 K C0XCNT ;RESET FOR NEXT TIME
663"RTN","C0XMAIN",103,0)
664 D STORETXT(ZRDF,ZTXTNM,FARY)
665"RTN","C0XMAIN",104,0)
666 W !,"ADDED: ",ZGRAPH," ",ZSUBJECT," fmts:rdfSource ",ZTXTNM
667"RTN","C0XMAIN",105,0)
668 D PROCESS(.G,ZRDF,ZNAME,ZGRAPH,FARY) ; PARSE AND INSERT THE RDF
669"RTN","C0XMAIN",106,0)
670 Q
671"RTN","C0XMAIN",107,0)
672 ;
673"RTN","C0XMAIN",108,0)
674STORETXT(ZTXT,ZNAME,FARY) ; STORE TEXT IN THE TRIPLESTORE AT ZNAME
675"RTN","C0XMAIN",109,0)
676 ;
677"RTN","C0XMAIN",110,0)
678 I '$D(FARY) D ;
679"RTN","C0XMAIN",111,0)
680 . D INITFARY("C0XFARY")
681"RTN","C0XMAIN",112,0)
682 . S FARY="C0XFARY"
683"RTN","C0XMAIN",113,0)
684 D USEFARY(FARY)
685"RTN","C0XMAIN",114,0)
686 N ZIEN
687"RTN","C0XMAIN",115,0)
688 S ZIEN=$$IENOF(ZNAME,FARY) ; GET THE IEN
689"RTN","C0XMAIN",116,0)
690 D CLEAN^DILF
691"RTN","C0XMAIN",117,0)
692 K ZERR
693"RTN","C0XMAIN",118,0)
694 D WP^DIE(C0XSFN,ZIEN_",",1,,ZTXT,"ZERR")
695"RTN","C0XMAIN",119,0)
696 I $D(ZERR) D ;
697"RTN","C0XMAIN",120,0)
698 . ZWR ZERR
699"RTN","C0XMAIN",121,0)
700 Q
701"RTN","C0XMAIN",122,0)
702 ;
703"RTN","C0XMAIN",123,0)
704GETTXT(ZRTN,ZNAME,FARY) ; RETURNS RDF SOURCE OR OTHER TEXT
705"RTN","C0XMAIN",124,0)
706 ; ZRTN IS PASSED BY REFERENCE
707"RTN","C0XMAIN",125,0)
708 I '$D(FARY) D ;
709"RTN","C0XMAIN",126,0)
710 . D INITFARY("C0XFARY")
711"RTN","C0XMAIN",127,0)
712 . S FARY="C0XFARY"
713"RTN","C0XMAIN",128,0)
714 D USEFARY(FARY)
715"RTN","C0XMAIN",129,0)
716 N ZIEN
717"RTN","C0XMAIN",130,0)
718 S ZIEN=$$IENOF(ZNAME)
719"RTN","C0XMAIN",131,0)
720 S OK=$$GET1^DIQ(C0XSFN,ZIEN_",",1,,"ZRTN")
721"RTN","C0XMAIN",132,0)
722 Q
723"RTN","C0XMAIN",133,0)
724 ;
725"RTN","C0XMAIN",134,0)
726WHERETXT(ZNAME,FARY) ; EXTRINSIC WHICH RETURNS THE NAME OF THE GLOBAL
727"RTN","C0XMAIN",135,0)
728 ; WHERE THE TEXT IS LOCATED. NAME IS THE NAME OF THE STRING
729"RTN","C0XMAIN",136,0)
730 I '$D(FARY) D ;
731"RTN","C0XMAIN",137,0)
732 . D INITFARY("C0XFARY")
733"RTN","C0XMAIN",138,0)
734 . S FARY="C0XFARY"
735"RTN","C0XMAIN",139,0)
736 D USEFARY(FARY)
737"RTN","C0XMAIN",140,0)
738 N ZIEN
739"RTN","C0XMAIN",141,0)
740 S ZIEN=$$IENOF(ZNAME)
741"RTN","C0XMAIN",142,0)
742 Q $NA(@C0XSN@(ZIEN,1))
743"RTN","C0XMAIN",143,0)
744 ;
745"RTN","C0XMAIN",144,0)
746FILEIN(ZINTMP,ZDIR,ZFNAME,ZLVL) ; READS A FILE INTO ZINTMP USING FTG^%ZISH
747"RTN","C0XMAIN",145,0)
748 ; ZINTMP IS PASSED BY NAME AND INCLUDES THE NEW SUBSCRIPT
749"RTN","C0XMAIN",146,0)
750 ; IE ^TMP("C0X","FILEIN",1)
751"RTN","C0XMAIN",147,0)
752 ; ZLVL IN THIS CASE WOULD BE 3 INCREMENTING THE 1
753"RTN","C0XMAIN",148,0)
754 ; EXTRINSIC WHICH RETURNS THE RESULT OF FTG^%ZISH
755"RTN","C0XMAIN",149,0)
756 S OK=$$FTG^%ZISH(ZDIR,FNAME,ZINTMP,ZLVL)
757"RTN","C0XMAIN",150,0)
758 Q OK
759"RTN","C0XMAIN",151,0)
760 ;
761"RTN","C0XMAIN",152,0)
762TESTPROC ; TEST PROCESS WITH EXISTING SMALL RDF FILE
763"RTN","C0XMAIN",153,0)
764 S ZIN=$NA(^TMP("C0X",12226,"FILEIN"))
765"RTN","C0XMAIN",154,0)
766 S ZGRAPH="/test/rdfFile"
767"RTN","C0XMAIN",155,0)
768 S ZM="/test/rdfFile/meta"
769"RTN","C0XMAIN",156,0)
770 D PROCESS(.G,ZIN,ZGRAPH,ZM)
771"RTN","C0XMAIN",157,0)
772 Q
773"RTN","C0XMAIN",158,0)
774 ;
775"RTN","C0XMAIN",159,0)
776PROCESS(ZRTN,ZRDF,ZGRF,ZMETA,FARY) ; PROCESS AN INCOMING RDF FILE
777"RTN","C0XMAIN",160,0)
778 ; ZRTN IS PASS BY REFERENCE AND RETURNS MESSAGES ABOUT THE PROCESSING
779"RTN","C0XMAIN",161,0)
780 ; ZRDF IS PASSED BY NAME AND IS THE GLOBAL CONTAINING THE RDF FILE
781"RTN","C0XMAIN",162,0)
782 ; ZGRF IS THE NAME OF THE GRAPH TO USE IN THE TRIPLE STORE FOR RESULTS
783"RTN","C0XMAIN",163,0)
784 ; ZMETA IS OPTIONAL AND IS THE NAME OF THE GRAPH TO STORE METADATA
785"RTN","C0XMAIN",164,0)
786 ;
787"RTN","C0XMAIN",165,0)
788 I '$D(FARY) D ;
789"RTN","C0XMAIN",166,0)
790 . D INITFARY("C0XFARY")
791"RTN","C0XMAIN",167,0)
792 . S FARY="C0XFARY"
793"RTN","C0XMAIN",168,0)
794 D USEFARY(FARY)
795"RTN","C0XMAIN",169,0)
796 ; -- first parse the rdf file with the MXML parser
797"RTN","C0XMAIN",170,0)
798 ;S C0XDOCID=$$PARSE^C0CNHIN(ZRDF,"C0XARRAY") ; PARSE WITH MXML
799"RTN","C0XMAIN",171,0)
800 S C0XDOCID=$$EN^MXMLDOM(ZRDF,"W")
801"RTN","C0XMAIN",172,0)
802 ; -- assign the MXLM dom global name to ZDOM
803"RTN","C0XMAIN",173,0)
804 S ZDOM=$NA(^TMP("MXMLDOM",$J,C0XDOCID))
805"RTN","C0XMAIN",174,0)
806 W !,$O(@ZDOM@(""),-1)," XML NODES PARSED"
807"RTN","C0XMAIN",175,0)
808 ; -- populate the metagraph to point to the graph with status unfinished
809"RTN","C0XMAIN",176,0)
810 S METAS=$$ANONS ; GET AN ANONOMOUS RANDOM SUBJECT
811"RTN","C0XMAIN",177,0)
812 I '$D(ZMETA) S ZMETA="_:G"_$$LKY9 ; RANDOM GRAPH NAME FOR METAGRAPH
813"RTN","C0XMAIN",178,0)
814 D ADD(ZMETA,METAS,"fmts:about",ZGRF,FARY) ; POINT THE META TO THE GRAPH
815"RTN","C0XMAIN",179,0)
816 D ADD(ZMETA,METAS,"fmts:status","unfinished",FARY) ; mark as unfinished
817"RTN","C0XMAIN",180,0)
818 ;S C0XDATE=$$FMDTOUTC^C0CUTIL($$NOW^XLFDT,"DT")
819"RTN","C0XMAIN",181,0)
820 S C0XDATE=$$NOW^XLFDT
821"RTN","C0XMAIN",182,0)
822 D ADD(ZMETA,METAS,"fmts:dateTime",C0XDATE,FARY)
823"RTN","C0XMAIN",183,0)
824 D UPDIE(.C0XFDA) ; commit the metagraph changes to the triple store
825"RTN","C0XMAIN",184,0)
826 ; --
827"RTN","C0XMAIN",185,0)
828 ; -- pull out the vocabularies in the RDF statement. marked with xmlns:
829"RTN","C0XMAIN",186,0)
830 ; -- put them in a local variable for quick reference
831"RTN","C0XMAIN",187,0)
832 ; -- TODO: create a graph for vocabularies and validate incoming against it
833"RTN","C0XMAIN",188,0)
834 ;
835"RTN","C0XMAIN",189,0)
836 S C0XVOC=""
837"RTN","C0XMAIN",190,0)
838 N ZI,ZJ,ZK S ZI=""
839"RTN","C0XMAIN",191,0)
840 F S ZI=$O(@ZDOM@(1,"A",ZI)) Q:ZI="" D ; FOR EACH xmlns
841"RTN","C0XMAIN",192,0)
842 . S ZVOC=$P(ZI,"xmlns:",2)
843"RTN","C0XMAIN",193,0)
844 . I ZVOC'="" S C0XVOC(ZVOC)=$G(@ZDOM@(1,"A",ZI))
845"RTN","C0XMAIN",194,0)
846 ;W !,"VOCABS:" ZWR C0XVOC
847"RTN","C0XMAIN",195,0)
848 ;
849"RTN","C0XMAIN",196,0)
850 ; -- look for children called rdf:Description. quit if none. not an rdf file
851"RTN","C0XMAIN",197,0)
852 ;
853"RTN","C0XMAIN",198,0)
854 S ZI=$O(@ZDOM@(1,"C",""))
855"RTN","C0XMAIN",199,0)
856 I $G(@ZDOM@(1,"C",ZI))'="rdf:Description" D Q ; not an rdf file
857"RTN","C0XMAIN",200,0)
858 . W !,"Error. Not an RDF file. Cannot process."
859"RTN","C0XMAIN",201,0)
860 ;
861"RTN","C0XMAIN",202,0)
862 ; -- now process the rdf description children
863"RTN","C0XMAIN",203,0)
864 ;
865"RTN","C0XMAIN",204,0)
866 S ZI=""
867"RTN","C0XMAIN",205,0)
868 S (C0XSUB,C0XPRE,C0XOBJ)="" ; INITIALIZE subject, object and predicate
869"RTN","C0XMAIN",206,0)
870 F S ZI=$O(@ZDOM@(1,"C",ZI)) Q:ZI="" D ;
871"RTN","C0XMAIN",207,0)
872 . ; -- we are skipping any child that is not rdf:Description
873"RTN","C0XMAIN",208,0)
874 . ; -- TODO: check to see if this is right in general
875"RTN","C0XMAIN",209,0)
876 . ;
877"RTN","C0XMAIN",210,0)
878 . IF $G(@ZDOM@(1,"C",ZI))'="rdf:Description" D Q ;
879"RTN","C0XMAIN",211,0)
880 . . W !,"SKIPPING NODE: ",ZI
881"RTN","C0XMAIN",212,0)
882 . ; -- now looking for the subject for the triples
883"RTN","C0XMAIN",213,0)
884 . S ZX=$G(@ZDOM@(ZI,"A","rdf:about"))
885"RTN","C0XMAIN",214,0)
886 . I ZX'="" D ; we have the subject
887"RTN","C0XMAIN",215,0)
888 . . ;W " about: ",ZX
889"RTN","C0XMAIN",216,0)
890 . . S C0XSUB=ZX
891"RTN","C0XMAIN",217,0)
892 . E D ;
893"RTN","C0XMAIN",218,0)
894 . . S ZX=$G(@ZDOM@(ZI,"A","rdf:nodeID")) ; node id is another style of subject
895"RTN","C0XMAIN",219,0)
896 . . I ZX'="" D ;
897"RTN","C0XMAIN",220,0)
898 . . . S C0XSUB=ZX
899"RTN","C0XMAIN",221,0)
900 . I C0XSUB="" S C0XSUB=$$ANONS ; DEFAULT TO BLANK SUBJECT
901"RTN","C0XMAIN",222,0)
902 . ;
903"RTN","C0XMAIN",223,0)
904 . ; -- we now have the subject. the children of this node have the rest
905"RTN","C0XMAIN",224,0)
906 . ;
907"RTN","C0XMAIN",225,0)
908 . S ZJ="" ; for the children of the rdf:Description nodes
909"RTN","C0XMAIN",226,0)
910 . F S ZJ=$O(@ZDOM@(ZI,"C",ZJ)) Q:ZJ="" D ; for each child
911"RTN","C0XMAIN",227,0)
912 . . S C0XPRE=@ZDOM@(ZJ) ; the predicate without a prefix
913"RTN","C0XMAIN",228,0)
914 . . S ZX=$G(@ZDOM@(ZJ,"A","xmlns")) ; name space
915"RTN","C0XMAIN",229,0)
916 . . I ZX'="" S C0XPRE=ZX_C0XPRE ; add the namespace prefix
917"RTN","C0XMAIN",230,0)
918 . . I C0XPRE[":" D ; expand using vocabulary
919"RTN","C0XMAIN",231,0)
920 . . . N ZB,ZA
921"RTN","C0XMAIN",232,0)
922 . . . S ZB=$P(C0XPRE,":",1)
923"RTN","C0XMAIN",233,0)
924 . . . S ZA=$P(C0XPRE,":",2)
925"RTN","C0XMAIN",234,0)
926 . . . I $G(C0XVOC(ZB))'="" D ;
927"RTN","C0XMAIN",235,0)
928 . . . . S C0XPRE=C0XVOC(ZB)_ZA ; expanded
929"RTN","C0XMAIN",236,0)
930 . . S ZY=$G(@ZDOM@(ZJ,"A","rdf:resource")) ; potential object
931"RTN","C0XMAIN",237,0)
932 . . I ZY'="" D Q ;
933"RTN","C0XMAIN",238,0)
934 . . . S C0XOBJ=ZY ; object
935"RTN","C0XMAIN",239,0)
936 . . . D ADD(ZGRF,C0XSUB,C0XPRE,C0XOBJ) ; finally. our first real triple
937"RTN","C0XMAIN",240,0)
938 . . ; -- this is an else because of the quit above
939"RTN","C0XMAIN",241,0)
940 . . S ZX=$G(@ZDOM@(ZJ,"A","rdf:nodeID")) ; fishing for nodeId object
941"RTN","C0XMAIN",242,0)
942 . . I ZX'="" D Q ; got one
943"RTN","C0XMAIN",243,0)
944 . . . S C0XOBJ=ZX ; we are using the incoming nodeIDs as object/subject
945"RTN","C0XMAIN",244,0)
946 . . . ; without change... this could be foolish .. look at it again later
947"RTN","C0XMAIN",245,0)
948 . . . D ADD(ZGRF,C0XSUB,C0XPRE,C0XOBJ) ; go for it and add a node
949"RTN","C0XMAIN",246,0)
950 . . S C0XOBJ=$G(@ZDOM@(ZJ,"T",1)) ; hopefully an object is here
951"RTN","C0XMAIN",247,0)
952 . . I C0XOBJ="" D Q ; not a happy situation
953"RTN","C0XMAIN",248,0)
954 . . . W !,"ERROR, NO OBJECT FOUND FOR NODE: ",ZJ
955"RTN","C0XMAIN",249,0)
956 . . D ADD(ZGRF,C0XSUB,C0XPRE,C0XOBJ) ; go for it and add a node
957"RTN","C0XMAIN",250,0)
958 W !,"INSERTING ",C0XCNT," TRIPLES"
959"RTN","C0XMAIN",251,0)
960 D UPDIE(.C0XFDA) ; commit the updates to the file
961"RTN","C0XMAIN",252,0)
962 ; next, mark the graph as finished
963"RTN","C0XMAIN",253,0)
964 S C0XEND=$$NOW^XLFDT
965"RTN","C0XMAIN",254,0)
966 W !," ENDED AT: ",C0XEND
967"RTN","C0XMAIN",255,0)
968 S C0XDIFF=$$FMDIFF^XLFDT(C0XEND,C0XSTART,2)
969"RTN","C0XMAIN",256,0)
970 W !," ELAPSED TIME: ",C0XDIFF," SECONDS"
971"RTN","C0XMAIN",257,0)
972 W !," APPROXIMATELY ",$P(C0XCNT/C0XDIFF,".")," TRIPLES PER SECOND"
973"RTN","C0XMAIN",258,0)
974 Q
975"RTN","C0XMAIN",259,0)
976 ;
977"RTN","C0XMAIN",260,0)
978SHOW(ZN) ;
979"RTN","C0XMAIN",261,0)
980 ZWR ^TMP("MXMLDOM",$J,1,ZN,*)
981"RTN","C0XMAIN",262,0)
982 Q
983"RTN","C0XMAIN",263,0)
984 ;
985"RTN","C0XMAIN",264,0)
986ANONS() ; RETURNS AN ANONOMOUS SUBJECT
987"RTN","C0XMAIN",265,0)
988 Q "_S:"_$$LKY9
989"RTN","C0XMAIN",266,0)
990 ;
991"RTN","C0XMAIN",267,0)
992NEWG(NGRAPH,NMETA) ; CREATES A NEW META GRAPH, MARKS IT AS UNFINISHED
993"RTN","C0XMAIN",268,0)
994 ; THEN CREATES A NEW GRAPH AND POINTS THE METAGRAPH TO IT
995"RTN","C0XMAIN",269,0)
996 ; NGRAPH AND NMETA ARE PASSED BY REFERENCE AND ARE THE RETURN
997"RTN","C0XMAIN",270,0)
998 S NGRAPH="G"_$$LKY9
999"RTN","C0XMAIN",271,0)
1000 S NMETA=NGRAPH_"A"
1001"RTN","C0XMAIN",272,0)
1002 Q
1003"RTN","C0XMAIN",273,0)
1004 ;
1005"RTN","C0XMAIN",274,0)
1006ADD(ZG,ZS,ZP,ZO,FARY) ; ADD A TRIPLE TO THE TRIPLESTORE. ALL VALUES ARE TEXT
1007"RTN","C0XMAIN",275,0)
1008 ; THE FDA IS SET UP BUT THE FILES ARE NOT UPDATED. CALL UPDIE TO COMPLETE
1009"RTN","C0XMAIN",276,0)
1010 I '$D(FARY) D ;
1011"RTN","C0XMAIN",277,0)
1012 . D INITFARY("C0XFARY")
1013"RTN","C0XMAIN",278,0)
1014 . S FARY="C0XFARY"
1015"RTN","C0XMAIN",279,0)
1016 D USEFARY(FARY)
1017"RTN","C0XMAIN",280,0)
1018 I '$D(C0XCNT) S C0XCNT=0
1019"RTN","C0XMAIN",281,0)
1020 N ZNODE
1021"RTN","C0XMAIN",282,0)
1022 S ZNODE="N"_$$LKY17
1023"RTN","C0XMAIN",283,0)
1024 N ZNARY ; GET READY TO CALL IENOFA
1025"RTN","C0XMAIN",284,0)
1026 S ZNARY("ZG",ZG)=""
1027"RTN","C0XMAIN",285,0)
1028 S ZNARY("ZS",ZS)=""
1029"RTN","C0XMAIN",286,0)
1030 S ZNARY("ZP",ZP)=""
1031"RTN","C0XMAIN",287,0)
1032 S ZNARY("ZO",ZO)=""
1033"RTN","C0XMAIN",288,0)
1034 D IENOFA(.ZIENS,.ZNARY,FARY) ; RESOLVE/ADD STRINGS
1035"RTN","C0XMAIN",289,0)
1036 ;S ZGIEN=$$IENOF(ZG) ; LAYGO TO GET IEN
1037"RTN","C0XMAIN",290,0)
1038 ;S ZSIEN=$$IENOF(ZS)
1039"RTN","C0XMAIN",291,0)
1040 ;S ZPIEN=$$IENOF(ZP)
1041"RTN","C0XMAIN",292,0)
1042 ;S ZOIEN=$$IENOF(ZO)
1043"RTN","C0XMAIN",293,0)
1044 ;I $D(C0XFDA) D UPDIE ; ADD THE STRINGS IF NEEDED
1045"RTN","C0XMAIN",294,0)
1046 S C0XCNT=C0XCNT+1
1047"RTN","C0XMAIN",295,0)
1048 S C0XFDA(C0XTFN,"?+"_C0XCNT_",",.01)=ZNODE
1049"RTN","C0XMAIN",296,0)
1050 S C0XFDA(C0XTFN,"?+"_C0XCNT_",",.02)=$O(ZIENS("IEN","ZG",""))
1051"RTN","C0XMAIN",297,0)
1052 S C0XFDA(C0XTFN,"?+"_C0XCNT_",",.03)=$O(ZIENS("IEN","ZS",""))
1053"RTN","C0XMAIN",298,0)
1054 S C0XFDA(C0XTFN,"?+"_C0XCNT_",",.04)=$O(ZIENS("IEN","ZP",""))
1055"RTN","C0XMAIN",299,0)
1056 S C0XFDA(C0XTFN,"?+"_C0XCNT_",",.05)=$O(ZIENS("IEN","ZO",""))
1057"RTN","C0XMAIN",300,0)
1058 ; REMEMBER TO CALL UPDIE WHEN YOU'RE DONE
1059"RTN","C0XMAIN",301,0)
1060 Q
1061"RTN","C0XMAIN",302,0)
1062 ;
1063"RTN","C0XMAIN",303,0)
1064LKY9() ;EXTRINIC THAT RETURNS A RANDOM 9 DIGIT NUMBER. USED FOR GENERATING
1065"RTN","C0XMAIN",304,0)
1066 ; UNIQUE NODE AND GRAPH NAMES
1067"RTN","C0XMAIN",305,0)
1068 N ZN,ZI
1069"RTN","C0XMAIN",306,0)
1070 S ZN=""
1071"RTN","C0XMAIN",307,0)
1072 F ZI=1:1:9 D ;
1073"RTN","C0XMAIN",308,0)
1074 . S ZN=ZN_$R(10)
1075"RTN","C0XMAIN",309,0)
1076 Q ZN
1077"RTN","C0XMAIN",310,0)
1078 ;
1079"RTN","C0XMAIN",311,0)
1080LKY17() ;EXTRINIC THAT RETURNS A RANDOM 9 DIGIT NUMBER. USED FOR GENERATING
1081"RTN","C0XMAIN",312,0)
1082 ; UNIQUE NODE AND GRAPH NAMES
1083"RTN","C0XMAIN",313,0)
1084 N ZN,ZI
1085"RTN","C0XMAIN",314,0)
1086 S ZN=""
1087"RTN","C0XMAIN",315,0)
1088 F ZI=1:1:17 D ;
1089"RTN","C0XMAIN",316,0)
1090 . S ZN=ZN_$R(10)
1091"RTN","C0XMAIN",317,0)
1092 Q ZN
1093"RTN","C0XMAIN",318,0)
1094 ;
1095"RTN","C0XMAIN",319,0)
1096IENOF(ZSTRING,FARY) ; EXTRINSIC WHICH RETURNS THE IEN OF ZS IN THE STRINGS FILE
1097"RTN","C0XMAIN",320,0)
1098 I '$D(FARY) D ;
1099"RTN","C0XMAIN",321,0)
1100 . D INITFARY("C0XFARY")
1101"RTN","C0XMAIN",322,0)
1102 . S FARY="C0XFARY"
1103"RTN","C0XMAIN",323,0)
1104 N ZIEN
1105"RTN","C0XMAIN",324,0)
1106 S ZIEN=$O(@C0XSN@("B",ZSTRING,""))
1107"RTN","C0XMAIN",325,0)
1108 I ZIEN="" D ;
1109"RTN","C0XMAIN",326,0)
1110 . S C0XFDA2(C0XSFN,"+1,",.01)=ZSTRING
1111"RTN","C0XMAIN",327,0)
1112 . D UPDIE(.C0XFDA2)
1113"RTN","C0XMAIN",328,0)
1114 . S ZIEN=$O(@C0XSN@("B",ZSTRING,""))
1115"RTN","C0XMAIN",329,0)
1116 . K C0XFDA2
1117"RTN","C0XMAIN",330,0)
1118 Q ZIEN
1119"RTN","C0XMAIN",331,0)
1120 ;
1121"RTN","C0XMAIN",332,0)
1122IENOFA(ZOUTARY,ZINARY,FARY) ; RESOLVE STRINGS TO IEN IN STRINGS FILE
1123"RTN","C0XMAIN",333,0)
1124 ; OR ADD THEM IF
1125"RTN","C0XMAIN",334,0)
1126 ; MISSING. ZINARY AND ZOUTARY ARE PASSED BY REFERENCE
1127"RTN","C0XMAIN",335,0)
1128 ; ZINARY LOOKS LIKE ZINARY("VAR","VAL")=""
1129"RTN","C0XMAIN",336,0)
1130 ; RETURNS IN ZOUTARY OF THE FORM ZOUTARY("IEN","VAR",IEN)=""
1131"RTN","C0XMAIN",337,0)
1132 I '$D(FARY) D ;
1133"RTN","C0XMAIN",338,0)
1134 . D INITFARY("C0XFARY")
1135"RTN","C0XMAIN",339,0)
1136 . S FARY="C0XFARY"
1137"RTN","C0XMAIN",340,0)
1138 K ZOUTARY ; START WITH CLEAN RESULTS
1139"RTN","C0XMAIN",341,0)
1140 K C0XFDA2 ; USE A SEPARATE FDA FOR THIS
1141"RTN","C0XMAIN",342,0)
1142 N ZI S ZI=""
1143"RTN","C0XMAIN",343,0)
1144 N ZV,ZIEN
1145"RTN","C0XMAIN",344,0)
1146 N ZCNT S ZCNT=0
1147"RTN","C0XMAIN",345,0)
1148 F S ZI=$O(ZINARY(ZI)) Q:ZI="" D ; LOOK FOR MISSING STRINGS
1149"RTN","C0XMAIN",346,0)
1150 . S ZV=$O(ZINARY(ZI,""))
1151"RTN","C0XMAIN",347,0)
1152 . I $O(@C0XSN@("B",ZV,""))="" D ;
1153"RTN","C0XMAIN",348,0)
1154 . . S ZCNT=ZCNT+1
1155"RTN","C0XMAIN",349,0)
1156 . . S C0XFDA2(C0XSFN,"+"_ZCNT_",",.01)=ZV
1157"RTN","C0XMAIN",350,0)
1158 I $D(C0XFDA2) D ;
1159"RTN","C0XMAIN",351,0)
1160 . D UPDIE(.C0XFDA2) ; ADD MISSING STRINGS
1161"RTN","C0XMAIN",352,0)
1162 . K C0XFDA2 ; CLEAN UP
1163"RTN","C0XMAIN",353,0)
1164 F S ZI=$O(ZINARY(ZI)) Q:ZI="" D ; NOT GET ALL IENS
1165"RTN","C0XMAIN",354,0)
1166 . S ZV=$O(ZINARY(ZI,""))
1167"RTN","C0XMAIN",355,0)
1168 . S ZIEN=$O(@C0XSN@("B",ZV,"")) ; THEY SHOULD BE THERE NOW
1169"RTN","C0XMAIN",356,0)
1170 . I ZIEN="" D ;
1171"RTN","C0XMAIN",357,0)
1172 . . W !,"ERROR ADDING STRING: ",ZV
1173"RTN","C0XMAIN",358,0)
1174 . . B
1175"RTN","C0XMAIN",359,0)
1176 . S ZOUTARY("IEN",ZI,ZIEN)=""
1177"RTN","C0XMAIN",360,0)
1178 Q
1179"RTN","C0XMAIN",361,0)
1180 ;
1181"RTN","C0XMAIN",362,0)
1182UPDIE(ZFDA) ; INTERNAL ROUTINE TO CALL UPDATE^DIE AND CHECK FOR ERRORS
1183"RTN","C0XMAIN",363,0)
1184 ; ZFDA IS PASSED BY REFERENCE
1185"RTN","C0XMAIN",364,0)
1186 ;ZWR ZFDA
1187"RTN","C0XMAIN",365,0)
1188 ;B
1189"RTN","C0XMAIN",366,0)
1190 K ZERR
1191"RTN","C0XMAIN",367,0)
1192 D CLEAN^DILF
1193"RTN","C0XMAIN",368,0)
1194 D UPDATE^DIE("","ZFDA","","ZERR")
1195"RTN","C0XMAIN",369,0)
1196 I $D(ZERR) S ZZERR=ZZERR ; ZZERR DOESN'T EXIST,
1197"RTN","C0XMAIN",370,0)
1198 ; INVOKE THE ERROR TRAP IF TASKED
1199"RTN","C0XMAIN",371,0)
1200 ;. W "ERROR",!
1201"RTN","C0XMAIN",372,0)
1202 ;. ZWR ZERR
1203"RTN","C0XMAIN",373,0)
1204 ;. B
1205"RTN","C0XMAIN",374,0)
1206 K ZFDA
1207"RTN","C0XMAIN",375,0)
1208 Q
1209"RTN","C0XMAIN",376,0)
1210 ;
1211"SEC","^DIC",172.101,172.101,0,"AUDIT")
1212@
1213"SEC","^DIC",172.101,172.101,0,"DD")
1214@
1215"SEC","^DIC",172.101,172.101,0,"DEL")
1216@
1217"SEC","^DIC",172.101,172.101,0,"LAYGO")
1218@
1219"SEC","^DIC",172.101,172.101,0,"RD")
1220@
1221"SEC","^DIC",172.101,172.101,0,"WR")
1222@
1223"SEC","^DIC",172.201,172.201,0,"AUDIT")
1224@
1225"SEC","^DIC",172.201,172.201,0,"DD")
1226@
1227"SEC","^DIC",172.201,172.201,0,"DEL")
1228@
1229"SEC","^DIC",172.201,172.201,0,"LAYGO")
1230@
1231"SEC","^DIC",172.201,172.201,0,"RD")
1232@
1233"SEC","^DIC",172.201,172.201,0,"WR")
1234@
1235"VER")
12368.0^22.0
1237"^DD",172.101,172.101,0)
1238FIELD^^.05^5
1239"^DD",172.101,172.101,0,"DDA")
1240N
1241"^DD",172.101,172.101,0,"DT")
12423111013
1243"^DD",172.101,172.101,0,"ID",.02)
1244S %I=Y,Y=$S('$D(^(0)):"",$D(^C0X(201,+$P(^(0),U,2),0))#2:$P(^(0),U,1),1:""),C=$P(^DD(172.201,.01,0),U,2) D Y^DIQ:Y]"" W " ",Y,@("$E("_DIC_"%I,0),0)") S Y=%I K %I
1245"^DD",172.101,172.101,0,"ID",.03)
1246S %I=Y,Y=$S('$D(^(0)):"",$D(^C0X(201,+$P(^(0),U,3),0))#2:$P(^(0),U,1),1:""),C=$P(^DD(172.201,.01,0),U,2) D Y^DIQ:Y]"" W " ",Y,@("$E("_DIC_"%I,0),0)") S Y=%I K %I
1247"^DD",172.101,172.101,0,"ID",.04)
1248S %I=Y,Y=$S('$D(^(0)):"",$D(^C0X(201,+$P(^(0),U,4),0))#2:$P(^(0),U,1),1:""),C=$P(^DD(172.201,.01,0),U,2) D Y^DIQ:Y]"" W " ",Y,@("$E("_DIC_"%I,0),0)") S Y=%I K %I
1249"^DD",172.101,172.101,0,"ID",.05)
1250S %I=Y,Y=$S('$D(^(0)):"",$D(^C0X(201,+$P(^(0),U,5),0))#2:$P(^(0),U,1),1:""),C=$P(^DD(172.201,.01,0),U,2) D Y^DIQ:Y]"" W " ",Y,@("$E("_DIC_"%I,0),0)") S Y=%I K %I
1251"^DD",172.101,172.101,0,"IX","B",172.101,.01)
1252
1253"^DD",172.101,172.101,0,"NM","C0X TRIPLE")
1254
1255"^DD",172.101,172.101,.01,0)
1256NODEID^RF^^0;1^K:$L(X)>30!($L(X)<3)!'(X'?1P.E) X
1257"^DD",172.101,172.101,.01,.1)
1258TRIPLE NODE ID
1259"^DD",172.101,172.101,.01,1,0)
1260^.1
1261"^DD",172.101,172.101,.01,1,1,0)
1262172.101^B
1263"^DD",172.101,172.101,.01,1,1,1)
1264S ^C0X(101,"B",$E(X,1,30),DA)=""
1265"^DD",172.101,172.101,.01,1,1,2)
1266K ^C0X(101,"B",$E(X,1,30),DA)
1267"^DD",172.101,172.101,.01,3)
1268Answer must be 3-30 characters in length
1269"^DD",172.101,172.101,.01,"DT")
12703111013
1271"^DD",172.101,172.101,.02,0)
1272GRAPH^P172.201^C0X(201,^0;2^Q
1273"^DD",172.101,172.101,.02,.1)
1274TRIPLE GRAPH
1275"^DD",172.101,172.101,.02,3)
1276Answer must be 3-240 characters in length
1277"^DD",172.101,172.101,.02,"DT")
12783111030
1279"^DD",172.101,172.101,.03,0)
1280SUBJECT^P172.201^C0X(201,^0;3^Q
1281"^DD",172.101,172.101,.03,.1)
1282TRIPLE SUBJECT
1283"^DD",172.101,172.101,.03,"DT")
12843111030
1285"^DD",172.101,172.101,.04,0)
1286PREDICATE^P172.201^C0X(201,^0;4^Q
1287"^DD",172.101,172.101,.04,.1)
1288TRIPLE PREDICATE
1289"^DD",172.101,172.101,.04,"DT")
12903111030
1291"^DD",172.101,172.101,.05,0)
1292OBJECT^P172.201^C0X(201,^0;5^Q
1293"^DD",172.101,172.101,.05,.1)
1294TRIPLE OBJECT
1295"^DD",172.101,172.101,.05,"DT")
12963111030
1297"^DD",172.201,172.201,0)
1298FIELD^^1^2
1299"^DD",172.201,172.201,0,"DDA")
1300N
1301"^DD",172.201,172.201,0,"DT")
13023111013
1303"^DD",172.201,172.201,0,"NM","C0X STRING")
1304
1305"^DD",172.201,172.201,0,"PT",172.101,.02)
1306
1307"^DD",172.201,172.201,0,"PT",172.101,.03)
1308
1309"^DD",172.201,172.201,0,"PT",172.101,.04)
1310
1311"^DD",172.201,172.201,0,"PT",172.101,.05)
1312
1313"^DD",172.201,172.201,.01,0)
1314STRING^RF^^0;1^K:$L(X)>240!($L(X)<1)!'(X=X) X
1315"^DD",172.201,172.201,.01,.1)
1316TRIPLE STRING
1317"^DD",172.201,172.201,.01,1,0)
1318^.1^^0
1319"^DD",172.201,172.201,.01,3)
1320Answer must be 1-240 characters in length
1321"^DD",172.201,172.201,.01,"DT")
13223111028
1323"^DD",172.201,172.201,1,0)
1324TEXT^172.2011^^1;0
1325"^DD",172.201,172.2011,0)
1326TEXT SUB-FIELD^^.01^1
1327"^DD",172.201,172.2011,0,"DT")
13283111013
1329"^DD",172.201,172.2011,0,"NM","TEXT")
1330
1331"^DD",172.201,172.2011,0,"UP")
1332172.201
1333"^DD",172.201,172.2011,.01,0)
1334TEXT^Wx^^0;1
1335"^DD",172.201,172.2011,.01,.1)
1336LONGER TEXT
1337"^DD",172.201,172.2011,.01,"DT")
13383111013
1339"^DIC",172.101,172.101,0)
1340C0X TRIPLE^172.101
1341"^DIC",172.101,172.101,0,"GL")
1342^C0X(101,
1343"^DIC",172.101,"B","C0X TRIPLE",172.101)
1344
1345"^DIC",172.201,172.201,0)
1346C0X STRING^172.201
1347"^DIC",172.201,172.201,0,"GL")
1348^C0X(201,
1349"^DIC",172.201,"B","C0X STRING",172.201)
1350
1351**END**
1352**END**
Note: See TracBrowser for help on using the repository browser.