source: fmts/trunk/kids/C0X_1_0_0_T3.KID@ 1371

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

initial load of ftms project files and test data

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