source: fmts/trunk/kids/C0X_1_0_0_T7.KID@ 1380

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

added the new fmts initialization and load routine INIT C0XINIT

File size: 78.3 KB
RevLine 
[1295]1KIDS Distribution saved on Nov 12, 2011@18:16:41
2includes INIT C0XINIT to initialize and load the fmts
3**KIDS**:C0X*1.0*0^
4
5**INSTALL NAME**
6C0X*1.0*0
7"BLD",7883,0)
8C0X*1.0*0^^0^3111112^n
9"BLD",7883,4,0)
10^9.64PA^172.201^2
11"BLD",7883,4,172.101,0)
12172.101
13"BLD",7883,4,172.101,222)
14y^y^f^^^^n
15"BLD",7883,4,172.201,0)
16172.201
17"BLD",7883,4,172.201,222)
18y^y^f^^^^n
19"BLD",7883,4,"B",172.101,172.101)
20
21"BLD",7883,4,"B",172.201,172.201)
22
23"BLD",7883,6.3)
246
25"BLD",7883,"KRN",0)
26^9.67PA^779.2^20
27"BLD",7883,"KRN",.4,0)
28.4
29"BLD",7883,"KRN",.4,"NM",0)
30^9.68A^1^1
31"BLD",7883,"KRN",.4,"NM",1,0)
32C0X PRINT GRAPH FILE #172.101^172.101^0
33"BLD",7883,"KRN",.4,"NM","B","C0X PRINT GRAPH FILE #172.101",1)
34
35"BLD",7883,"KRN",.401,0)
36.401
37"BLD",7883,"KRN",.402,0)
38.402
39"BLD",7883,"KRN",.403,0)
40.403
41"BLD",7883,"KRN",.5,0)
42.5
43"BLD",7883,"KRN",.84,0)
44.84
45"BLD",7883,"KRN",3.6,0)
463.6
47"BLD",7883,"KRN",3.8,0)
483.8
49"BLD",7883,"KRN",9.2,0)
509.2
51"BLD",7883,"KRN",9.8,0)
529.8
53"BLD",7883,"KRN",9.8,"NM",0)
54^9.68A^4^4
55"BLD",7883,"KRN",9.8,"NM",1,0)
56C0XMAIN^^0^B115393527
57"BLD",7883,"KRN",9.8,"NM",2,0)
58C0XF2N^^0^B235898354
59"BLD",7883,"KRN",9.8,"NM",3,0)
60C0XTEST^^0^B14490662
61"BLD",7883,"KRN",9.8,"NM",4,0)
62C0XINIT^^0^B20874536
63"BLD",7883,"KRN",9.8,"NM","B","C0XF2N",2)
64
65"BLD",7883,"KRN",9.8,"NM","B","C0XINIT",4)
66
67"BLD",7883,"KRN",9.8,"NM","B","C0XMAIN",1)
68
69"BLD",7883,"KRN",9.8,"NM","B","C0XTEST",3)
70
71"BLD",7883,"KRN",19,0)
7219
73"BLD",7883,"KRN",19.1,0)
7419.1
75"BLD",7883,"KRN",101,0)
76101
77"BLD",7883,"KRN",409.61,0)
78409.61
79"BLD",7883,"KRN",771,0)
80771
81"BLD",7883,"KRN",779.2,0)
82779.2
83"BLD",7883,"KRN",870,0)
84870
85"BLD",7883,"KRN",8989.51,0)
868989.51
87"BLD",7883,"KRN",8989.52,0)
888989.52
89"BLD",7883,"KRN",8994,0)
908994
91"BLD",7883,"KRN","B",.4,.4)
92
93"BLD",7883,"KRN","B",.401,.401)
94
95"BLD",7883,"KRN","B",.402,.402)
96
97"BLD",7883,"KRN","B",.403,.403)
98
99"BLD",7883,"KRN","B",.5,.5)
100
101"BLD",7883,"KRN","B",.84,.84)
102
103"BLD",7883,"KRN","B",3.6,3.6)
104
105"BLD",7883,"KRN","B",3.8,3.8)
106
107"BLD",7883,"KRN","B",9.2,9.2)
108
109"BLD",7883,"KRN","B",9.8,9.8)
110
111"BLD",7883,"KRN","B",19,19)
112
113"BLD",7883,"KRN","B",19.1,19.1)
114
115"BLD",7883,"KRN","B",101,101)
116
117"BLD",7883,"KRN","B",409.61,409.61)
118
119"BLD",7883,"KRN","B",771,771)
120
121"BLD",7883,"KRN","B",779.2,779.2)
122
123"BLD",7883,"KRN","B",870,870)
124
125"BLD",7883,"KRN","B",8989.51,8989.51)
126
127"BLD",7883,"KRN","B",8989.52,8989.52)
128
129"BLD",7883,"KRN","B",8994,8994)
130
131"FIA",172.101)
132C0X TRIPLE
133"FIA",172.101,0)
134^C0X(101,
135"FIA",172.101,0,0)
136172.101I
137"FIA",172.101,0,1)
138y^y^f^^^^n
139"FIA",172.101,0,10)
140
141"FIA",172.101,0,11)
142
143"FIA",172.101,0,"RLRO")
144
145"FIA",172.101,172.101)
1460
147"FIA",172.201)
148C0X STRING
149"FIA",172.201,0)
150^C0X(201,
151"FIA",172.201,0,0)
152172.201
153"FIA",172.201,0,1)
154y^y^f^^^^n
155"FIA",172.201,0,10)
156
157"FIA",172.201,0,11)
158
159"FIA",172.201,0,"RLRO")
160
161"FIA",172.201,172.201)
1620
163"FIA",172.201,172.2011)
1640
165"IX",172.101,172.101,"G",0)
166172.101^G^REGULAR INDEX OF THE GRAPH FIELD^R^^F^IR^I^172.101^^^^^LS
167"IX",172.101,172.101,"G",1)
168S ^C0X(101,"G",X,DA)=""
169"IX",172.101,172.101,"G",2)
170K ^C0X(101,"G",X,DA)
171"IX",172.101,172.101,"G",2.5)
172K ^C0X(101,"G")
173"IX",172.101,172.101,"G",11.1,0)
174^.114IA^1^1
175"IX",172.101,172.101,"G",11.1,1,0)
1761^F^172.101^.02^^1^F
177"IX",172.101,172.101,"G",11.1,1,3)
178
179"IX",172.101,172.101,"GOPS",0)
180172.101^GOPS^GRAPH ONLY OBJECT PREDICATE SUBJECT^R^^R^IR^I^172.101^^^^^LS
181"IX",172.101,172.101,"GOPS",1)
182S ^C0X(101,"GOPS",$E(X(1),1,240),$E(X(2),1,240),$E(X(3),1,240),$E(X(4),1,240),DA)=""
183"IX",172.101,172.101,"GOPS",2)
184K ^C0X(101,"GOPS",$E(X(1),1,240),$E(X(2),1,240),$E(X(3),1,240),$E(X(4),1,240),DA)
185"IX",172.101,172.101,"GOPS",2.5)
186K ^C0X(101,"GOPS")
187"IX",172.101,172.101,"GOPS",11.1,0)
188^.114IA^4^4
189"IX",172.101,172.101,"GOPS",11.1,1,0)
1901^F^172.101^.02^240^1^F
191"IX",172.101,172.101,"GOPS",11.1,1,3)
192
193"IX",172.101,172.101,"GOPS",11.1,2,0)
1942^F^172.101^.05^240^2^F
195"IX",172.101,172.101,"GOPS",11.1,2,3)
196
197"IX",172.101,172.101,"GOPS",11.1,3,0)
1983^F^172.101^.04^240^3^F
199"IX",172.101,172.101,"GOPS",11.1,3,3)
200
201"IX",172.101,172.101,"GOPS",11.1,4,0)
2024^F^172.101^.03^240^4^F
203"IX",172.101,172.101,"GOPS",11.1,4,3)
204
205"IX",172.101,172.101,"GOSP",0)
206172.101^GOSP^GRAPH ONLY OBJECT SUBJECT PREDICATE^R^^R^IR^I^172.101^^^^^LS
207"IX",172.101,172.101,"GOSP",1)
208S ^C0X(101,"GOSP",$E(X(1),1,240),$E(X(2),1,240),$E(X(3),1,240),$E(X(4),1,240),DA)=""
209"IX",172.101,172.101,"GOSP",2)
210K ^C0X(101,"GOSP",$E(X(1),1,240),$E(X(2),1,240),$E(X(3),1,240),$E(X(4),1,240),DA)
211"IX",172.101,172.101,"GOSP",2.5)
212K ^C0X(101,"GOSP")
213"IX",172.101,172.101,"GOSP",11.1,0)
214^.114IA^4^4
215"IX",172.101,172.101,"GOSP",11.1,1,0)
2161^F^172.101^.02^240^1^F
217"IX",172.101,172.101,"GOSP",11.1,1,3)
218
219"IX",172.101,172.101,"GOSP",11.1,2,0)
2202^F^172.101^.05^240^2^F
221"IX",172.101,172.101,"GOSP",11.1,2,3)
222
223"IX",172.101,172.101,"GOSP",11.1,3,0)
2243^F^172.101^.03^240^3^F
225"IX",172.101,172.101,"GOSP",11.1,3,3)
226
227"IX",172.101,172.101,"GOSP",11.1,4,0)
2284^F^172.101^.04^240^4^F
229"IX",172.101,172.101,"GOSP",11.1,4,3)
230
231"IX",172.101,172.101,"GPSO",0)
232172.101^GPSO^GRAPH ONLY PREDICATE SUBJECT OBJECT^R^^R^IR^I^172.101^^^^^LS
233"IX",172.101,172.101,"GPSO",1)
234S ^C0X(101,"GPSO",$E(X(1),1,240),$E(X(2),1,240),$E(X(3),1,240),$E(X(4),1,240),DA)=""
235"IX",172.101,172.101,"GPSO",2)
236K ^C0X(101,"GPSO",$E(X(1),1,240),$E(X(2),1,240),$E(X(3),1,240),$E(X(4),1,240),DA)
237"IX",172.101,172.101,"GPSO",2.5)
238K ^C0X(101,"GPSO")
239"IX",172.101,172.101,"GPSO",11.1,0)
240^.114IA^4^4
241"IX",172.101,172.101,"GPSO",11.1,1,0)
2421^F^172.101^.02^240^1^F
243"IX",172.101,172.101,"GPSO",11.1,1,3)
244
245"IX",172.101,172.101,"GPSO",11.1,2,0)
2462^F^172.101^.04^240^2^F
247"IX",172.101,172.101,"GPSO",11.1,2,3)
248
249"IX",172.101,172.101,"GPSO",11.1,3,0)
2503^F^172.101^.03^240^3^F
251"IX",172.101,172.101,"GPSO",11.1,3,3)
252
253"IX",172.101,172.101,"GPSO",11.1,4,0)
2544^F^172.101^.05^240^4^F
255"IX",172.101,172.101,"GPSO",11.1,4,3)
256
257"IX",172.101,172.101,"GSPO",0)
258172.101^GSPO^GROUP ONLY SUBJECT PREDICATE OBJECT^R^^R^IR^I^172.101^^^^^LS
259"IX",172.101,172.101,"GSPO",1)
260S ^C0X(101,"GSPO",$E(X(1),1,240),$E(X(2),1,240),$E(X(3),1,240),$E(X(4),1,240),DA)=""
261"IX",172.101,172.101,"GSPO",2)
262K ^C0X(101,"GSPO",$E(X(1),1,240),$E(X(2),1,240),$E(X(3),1,240),$E(X(4),1,240),DA)
263"IX",172.101,172.101,"GSPO",2.5)
264K ^C0X(101,"GSPO")
265"IX",172.101,172.101,"GSPO",11.1,0)
266^.114IA^4^4
267"IX",172.101,172.101,"GSPO",11.1,1,0)
2681^F^172.101^.02^240^1^F
269"IX",172.101,172.101,"GSPO",11.1,1,3)
270
271"IX",172.101,172.101,"GSPO",11.1,2,0)
2722^F^172.101^.03^240^2^F
273"IX",172.101,172.101,"GSPO",11.1,2,3)
274
275"IX",172.101,172.101,"GSPO",11.1,3,0)
2763^F^172.101^.04^240^3^F
277"IX",172.101,172.101,"GSPO",11.1,3,3)
278
279"IX",172.101,172.101,"GSPO",11.1,4,0)
2804^F^172.101^.05^240^4^F
281"IX",172.101,172.101,"GSPO",11.1,4,3)
282
283"IX",172.101,172.101,"OPS",0)
284172.101^OPS^REGULAR INDEX OF OBJECT PREDICATE SUBJECT^R^^R^IR^I^172.101^^^^^LS
285"IX",172.101,172.101,"OPS",1)
286S ^C0X(101,"OPS",X(1),X(2),X(3),DA)=""
287"IX",172.101,172.101,"OPS",2)
288K ^C0X(101,"OPS",X(1),X(2),X(3),DA)
289"IX",172.101,172.101,"OPS",2.5)
290K ^C0X(101,"OPS")
291"IX",172.101,172.101,"OPS",11.1,0)
292^.114IA^3^3
293"IX",172.101,172.101,"OPS",11.1,1,0)
2941^F^172.101^.05^^1^F
295"IX",172.101,172.101,"OPS",11.1,1,3)
296
297"IX",172.101,172.101,"OPS",11.1,2,0)
2982^F^172.101^.04^^2^F
299"IX",172.101,172.101,"OPS",11.1,2,3)
300
301"IX",172.101,172.101,"OPS",11.1,3,0)
3023^F^172.101^.03^^3^F
303"IX",172.101,172.101,"OPS",11.1,3,3)
304
305"IX",172.101,172.101,"OSP",0)
306172.101^OSP^REGULAR INDEX OF OBJECT SUBJECT PREDICATE^R^^R^IR^I^172.101^^^^^LS
307"IX",172.101,172.101,"OSP",1)
308S ^C0X(101,"OSP",X(1),X(2),X(3),DA)=""
309"IX",172.101,172.101,"OSP",2)
310K ^C0X(101,"OSP",X(1),X(2),X(3),DA)
311"IX",172.101,172.101,"OSP",2.5)
312K ^C0X(101,"OSP")
313"IX",172.101,172.101,"OSP",11.1,0)
314^.114IA^3^3
315"IX",172.101,172.101,"OSP",11.1,1,0)
3161^F^172.101^.05^^1^F
317"IX",172.101,172.101,"OSP",11.1,1,3)
318
319"IX",172.101,172.101,"OSP",11.1,2,0)
3202^F^172.101^.03^^2^F
321"IX",172.101,172.101,"OSP",11.1,2,3)
322
323"IX",172.101,172.101,"OSP",11.1,3,0)
3243^F^172.101^.04^^3^F
325"IX",172.101,172.101,"OSP",11.1,3,3)
326
327"IX",172.101,172.101,"PSO",0)
328172.101^PSO^REGULAR INDEX OF PREDICATE SUBJECT OBJECT^R^^R^IR^I^172.101^^^^^LS
329"IX",172.101,172.101,"PSO",1)
330S ^C0X(101,"PSO",X(1),X(2),X(3),DA)=""
331"IX",172.101,172.101,"PSO",2)
332K ^C0X(101,"PSO",X(1),X(2),X(3),DA)
333"IX",172.101,172.101,"PSO",2.5)
334K ^C0X(101,"PSO")
335"IX",172.101,172.101,"PSO",11.1,0)
336^.114IA^3^3
337"IX",172.101,172.101,"PSO",11.1,1,0)
3381^F^172.101^.04^^1^F
339"IX",172.101,172.101,"PSO",11.1,1,3)
340
341"IX",172.101,172.101,"PSO",11.1,2,0)
3422^F^172.101^.03^^2^F
343"IX",172.101,172.101,"PSO",11.1,2,3)
344
345"IX",172.101,172.101,"PSO",11.1,3,0)
3463^F^172.101^.05^^3^F
347"IX",172.101,172.101,"PSO",11.1,3,3)
348
349"IX",172.101,172.101,"SPO",0)
350172.101^SPO^REGULAR INDEX OF SUBJECT PREDICATE OBJECT^R^^R^IR^I^172.101^^^^^LS
351"IX",172.101,172.101,"SPO",1)
352S ^C0X(101,"SPO",X(1),X(2),X(3),DA)=""
353"IX",172.101,172.101,"SPO",2)
354K ^C0X(101,"SPO",X(1),X(2),X(3),DA)
355"IX",172.101,172.101,"SPO",2.5)
356K ^C0X(101,"SPO")
357"IX",172.101,172.101,"SPO",11.1,0)
358^.114IA^3^3
359"IX",172.101,172.101,"SPO",11.1,1,0)
3601^F^172.101^.03^^1^F
361"IX",172.101,172.101,"SPO",11.1,1,3)
362
363"IX",172.101,172.101,"SPO",11.1,2,0)
3642^F^172.101^.04^^2^F
365"IX",172.101,172.101,"SPO",11.1,2,3)
366
367"IX",172.101,172.101,"SPO",11.1,3,0)
3683^F^172.101^.05^^3^F
369"IX",172.101,172.101,"SPO",11.1,3,3)
370
371"IX",172.201,172.201,"B",0)
372172.201^B^regular B index for strings to support long strings^R^^F^IR^I^172.201^^^^^LS
373"IX",172.201,172.201,"B",1)
374S ^C0X(201,"B",$E(X,1,240),DA)=""
375"IX",172.201,172.201,"B",2)
376K ^C0X(201,"B",$E(X,1,240),DA)
377"IX",172.201,172.201,"B",2.5)
378K ^C0X(201,"B")
379"IX",172.201,172.201,"B",11.1,0)
380^.114IA^1^1
381"IX",172.201,172.201,"B",11.1,1,0)
3821^F^172.201^.01^240^1^F
383"KRN",.4,1498,-1)
3840^1
385"KRN",.4,1498,0)
386C0X PRINT GRAPH^3111029.121^@^172.101^^@^3111112
387"KRN",.4,1498,"F",2)
388.03;W25;S~.04;C27;W25~.05;C54;W25~
389"KRN",.4,1498,"H")
390C0X TRIPLE LIST
391"MBREQ")
3920
393"ORD",5,.4)
394.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,"",%)
395"ORD",5,.4,0)
396PRINT TEMPLATE
397"QUES","XPF1",0)
398Y
399"QUES","XPF1","??")
400^D REP^XPDH
401"QUES","XPF1","A")
402Shall I write over your |FLAG| File
403"QUES","XPF1","B")
404YES
405"QUES","XPF1","M")
406D XPF1^XPDIQ
407"QUES","XPF2",0)
408Y
409"QUES","XPF2","??")
410^D DTA^XPDH
411"QUES","XPF2","A")
412Want my data |FLAG| yours
413"QUES","XPF2","B")
414YES
415"QUES","XPF2","M")
416D XPF2^XPDIQ
417"QUES","XPI1",0)
418YO
419"QUES","XPI1","??")
420^D INHIBIT^XPDH
421"QUES","XPI1","A")
422Want KIDS to INHIBIT LOGONs during the install
423"QUES","XPI1","B")
424NO
425"QUES","XPI1","M")
426D XPI1^XPDIQ
427"QUES","XPM1",0)
428PO^VA(200,:EM
429"QUES","XPM1","??")
430^D MG^XPDH
431"QUES","XPM1","A")
432Enter the Coordinator for Mail Group '|FLAG|'
433"QUES","XPM1","B")
434
435"QUES","XPM1","M")
436D XPM1^XPDIQ
437"QUES","XPO1",0)
438Y
439"QUES","XPO1","??")
440^D MENU^XPDH
441"QUES","XPO1","A")
442Want KIDS to Rebuild Menu Trees Upon Completion of Install
443"QUES","XPO1","B")
444NO
445"QUES","XPO1","M")
446D XPO1^XPDIQ
447"QUES","XPZ1",0)
448Y
449"QUES","XPZ1","??")
450^D OPT^XPDH
451"QUES","XPZ1","A")
452Want to DISABLE Scheduled Options, Menu Options, and Protocols
453"QUES","XPZ1","B")
454NO
455"QUES","XPZ1","M")
456D XPZ1^XPDIQ
457"QUES","XPZ2",0)
458Y
459"QUES","XPZ2","??")
460^D RTN^XPDH
461"QUES","XPZ2","A")
462Want to MOVE routines to other CPUs
463"QUES","XPZ2","B")
464NO
465"QUES","XPZ2","M")
466D XPZ2^XPDIQ
467"RTN")
4684
469"RTN","C0XF2N")
4700^2^B235898354
471"RTN","C0XF2N",1,0)
472C0XF2N ; GPL - Fileman Triples entry point routine ;10/13/11 17:05
473"RTN","C0XF2N",2,0)
474 ;;0.1;C0X;nopatch;noreleasedate;Build 6
475"RTN","C0XF2N",3,0)
476 ;Copyright 2011 George Lilly. Licensed under the terms of the GNU
477"RTN","C0XF2N",4,0)
478 ;General Public License See attached copy of the License.
479"RTN","C0XF2N",5,0)
480 ;
481"RTN","C0XF2N",6,0)
482 ;This program is free software; you can redistribute it and/or modify
483"RTN","C0XF2N",7,0)
484 ;it under the terms of the GNU General Public License as published by
485"RTN","C0XF2N",8,0)
486 ;the Free Software Foundation; either version 2 of the License, or
487"RTN","C0XF2N",9,0)
488 ;(at your option) any later version.
489"RTN","C0XF2N",10,0)
490 ;
491"RTN","C0XF2N",11,0)
492 ;This program is distributed in the hope that it will be useful,
493"RTN","C0XF2N",12,0)
494 ;but WITHOUT ANY WARRANTY; without even the implied warranty of
495"RTN","C0XF2N",13,0)
496 ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
497"RTN","C0XF2N",14,0)
498 ;GNU General Public License for more details.
499"RTN","C0XF2N",15,0)
500 ;
501"RTN","C0XF2N",16,0)
502 ;You should have received a copy of the GNU General Public License along
503"RTN","C0XF2N",17,0)
504 ;with this program; if not, write to the Free Software Foundation, Inc.,
505"RTN","C0XF2N",18,0)
506 ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
507"RTN","C0XF2N",19,0)
508 ;
509"RTN","C0XF2N",20,0)
510 Q
511"RTN","C0XF2N",21,0)
512 ;
513"RTN","C0XF2N",22,0)
514 ; This is based on C0XMAIN but experiments with a fast load for triples
515"RTN","C0XF2N",23,0)
516 ; that will write directly to the fileman global
517"RTN","C0XF2N",24,0)
518 ; The file 172.101 is a F2N design style for triples, which means
519"RTN","C0XF2N",25,0)
520 ; that it is a Flat file with no subfiles, all fields at the root
521"RTN","C0XF2N",26,0)
522 ; ... it is a "2" file solution which means all strings are stored in
523"RTN","C0XF2N",27,0)
524 ; ... strings file and pointed to by the triples file
525"RTN","C0XF2N",28,0)
526 ; ... it is an N file because it has generated Node IDs instead of
527"RTN","C0XF2N",29,0)
528 ; ... DINUM which would use the IEN for the Node ID.
529"RTN","C0XF2N",30,0)
530 ; gpl 11/04/2011
531"RTN","C0XF2N",31,0)
532 ;
533"RTN","C0XF2N",32,0)
534INITFARY(ZFARY) ; INITIALIZE FILE NUMBERS AND OTHER USEFUL THINGS
535"RTN","C0XF2N",33,0)
536 ; FOR THE DEFAULT TRIPLE STORE. USE OTHER VALUES FOR SUPPORTING ADDITIONAL
537"RTN","C0XF2N",34,0)
538 ; TRIPLE STORES
539"RTN","C0XF2N",35,0)
540 I $D(@ZFARY) Q ; ALREADY INITIALIZED
541"RTN","C0XF2N",36,0)
542 S @ZFARY@("C0XTFN")=172.101 ; TRIPLES FILE NUMBER
543"RTN","C0XF2N",37,0)
544 S @ZFARY@("C0XSFN")=172.201 ; TRIPLES STRINGS FILE NUMBER
545"RTN","C0XF2N",38,0)
546 S @ZFARY@("C0XTN")=$NA(^C0X(101)) ; TRIPLES GLOBAL NAME
547"RTN","C0XF2N",39,0)
548 S @ZFARY@("C0XSN")=$NA(^C0X(201)) ; STRING FILE GLOBAL NAME
549"RTN","C0XF2N",40,0)
550 S @ZFARY@("C0XDIR")="/home/glilly/fmts/trunk/samples/"
551"RTN","C0XF2N",41,0)
552 S @ZFARY@("BLKLOAD")=1 ; this file supports block load
553"RTN","C0XF2N",42,0)
554 S @ZFARY@("FMTSSTYLE")="F2N" ; fileman style
555"RTN","C0XF2N",43,0)
556 D USEFARY(ZFARY)
557"RTN","C0XF2N",44,0)
558 Q
559"RTN","C0XF2N",45,0)
560 ;
561"RTN","C0XF2N",46,0)
562USEFARY(ZFARY) ; INITIALIZES VARIABLES SAVED IN ARRAY ZFARY
563"RTN","C0XF2N",47,0)
564 N ZI S ZI=""
565"RTN","C0XF2N",48,0)
566 F S ZI=$O(@ZFARY@(ZI)) Q:ZI="" D
567"RTN","C0XF2N",49,0)
568 . ;N ZX
569"RTN","C0XF2N",50,0)
570 . S ZX="S "_ZI_"="""_@ZFARY@(ZI)_""""
571"RTN","C0XF2N",51,0)
572 . ;W !,ZX
573"RTN","C0XF2N",52,0)
574 . X ZX
575"RTN","C0XF2N",53,0)
576 Q
577"RTN","C0XF2N",54,0)
578 ;
579"RTN","C0XF2N",55,0)
580FILEIN ; INTERACTIVE ENTRY POINT FOR OPTION TO READ IN A FILE
581"RTN","C0XF2N",56,0)
582 I '$D(C0XFARY) D INITFARY("C0XFARY")
583"RTN","C0XF2N",57,0)
584 D USEFARY("C0XFARY")
585"RTN","C0XF2N",58,0)
586 S DIR(0)="F^3:240"
587"RTN","C0XF2N",59,0)
588 S DIR("A")="File Directory"
589"RTN","C0XF2N",60,0)
590 S DIR("B")=C0XDIR
591"RTN","C0XF2N",61,0)
592 D ^DIR
593"RTN","C0XF2N",62,0)
594 I Y="^" Q ;
595"RTN","C0XF2N",63,0)
596 S C0XDIR=Y
597"RTN","C0XF2N",64,0)
598 S C0XFARY("C0XDIR")=Y
599"RTN","C0XF2N",65,0)
600 S DIR(0)="F^3:240"
601"RTN","C0XF2N",66,0)
602 S DIR("A")="File Name"
603"RTN","C0XF2N",67,0)
604 I '$D(C0XFN) S DIR("B")="qds.rdf"
605"RTN","C0XF2N",68,0)
606 E S DIR("B")=C0XFN
607"RTN","C0XF2N",69,0)
608 D ^DIR
609"RTN","C0XF2N",70,0)
610 I Y="" Q ;
611"RTN","C0XF2N",71,0)
612 I Y="^" Q ;
613"RTN","C0XF2N",72,0)
614 S C0XFN=Y
615"RTN","C0XF2N",73,0)
616 D IMPORT(C0XFN,C0XDIR,,"C0XFARY")
617"RTN","C0XF2N",74,0)
618 K C0XFDA
619"RTN","C0XF2N",75,0)
620 Q
621"RTN","C0XF2N",76,0)
622 ;
623"RTN","C0XF2N",77,0)
624IMPORT(FNAME,INDIR,INURL,FARY) ; EXTRINSIC THAT READS A FILE FROM THE STANDARD
625"RTN","C0XF2N",78,0)
626 ; DIRECTORY, LOADS IT INTO THE TRIPLESTORE AS TEXT, AND RETURNS THE
627"RTN","C0XF2N",79,0)
628 ; NODE NAME OF THE TEXT TRIPLE
629"RTN","C0XF2N",80,0)
630 ; INDIR IS THE OPTIONAL DIRECTORY (DEFAUTS TO STANDARD DIR)
631"RTN","C0XF2N",81,0)
632 ; INURL IS THE OPTIONAL URI FOR ACCESSING THE FILE FROM THE TRIPLE STORE
633"RTN","C0XF2N",82,0)
634 ; FARY IS THE OPTIONAL FILE ARRAY OF THE TRIPLE STORE TO USE
635"RTN","C0XF2N",83,0)
636 I '$D(FARY) D ;
637"RTN","C0XF2N",84,0)
638 . D INITFARY("C0XFARY")
639"RTN","C0XF2N",85,0)
640 . S FARY="C0XFARY"
641"RTN","C0XF2N",86,0)
642 D USEFARY(FARY)
643"RTN","C0XF2N",87,0)
644 N ZD,ZTMP
645"RTN","C0XF2N",88,0)
646 I '$D(INDIR) S INDIR=C0XDIR ; DIRECTORY OF THE RDF FILE
647"RTN","C0XF2N",89,0)
648 I $G(INURL)="" D ;
649"RTN","C0XF2N",90,0)
650 . ;N ZN2 S ZN2=$P(FNAME,".",1)_"_"_$P(FNAME,".",2) ; REMOVE THE DOT
651"RTN","C0XF2N",91,0)
652 . ;S INURL=FDIR_ZN2
653"RTN","C0XF2N",92,0)
654 . S INURL=INDIR_FNAME
655"RTN","C0XF2N",93,0)
656 N ZTMP
657"RTN","C0XF2N",94,0)
658 S ZTMP=$NA(^TMP("C0X",$J,"FILEIN",1)) ; WHERE TO PUT THE INCOMING FILE
659"RTN","C0XF2N",95,0)
660 K @ZTMP ; MAKE SURE IT'S CLEAR
661"RTN","C0XF2N",96,0)
662 S C0XSTART=$$NOW^XLFDT
663"RTN","C0XF2N",97,0)
664 W !,"STARTED: ",C0XSTART
665"RTN","C0XF2N",98,0)
666 W !,"READING IN: ",FNAME
667"RTN","C0XF2N",99,0)
668 I '$$FILEREAD(ZTMP,INDIR,FNAME,4) D Q ; QUIT IF NO SUCCESS
669"RTN","C0XF2N",100,0)
670 . W !,"ERROR READING FILE: ",INDIR,FNAME
671"RTN","C0XF2N",101,0)
672 S ZRDF=$NA(^TMP("C0X",$J,"FILEIN")) ; WITHOUT THE SUBSCRIPT
673"RTN","C0XF2N",102,0)
674 W !,$O(@ZRDF@(""),-1)," LINES READ"
675"RTN","C0XF2N",103,0)
676 D INSRDF(ZRDF,INURL,FARY) ; IMPORT AND PROCESS THE RDF
677"RTN","C0XF2N",104,0)
678 K INURL
679"RTN","C0XF2N",105,0)
680 K C0XFDA
681"RTN","C0XF2N",106,0)
682 K ^TMP("MXMLDOM",$J)
683"RTN","C0XF2N",107,0)
684 Q
685"RTN","C0XF2N",108,0)
686 ;
687"RTN","C0XF2N",109,0)
688WGET(ZURL,FARY) ; GET FROM THE INTERNET AN RDF FILE AND INSERT IT
689"RTN","C0XF2N",110,0)
690 ;
691"RTN","C0XF2N",111,0)
692 I '$D(FARY) D ;
693"RTN","C0XF2N",112,0)
694 . D INITFARY("C0XFARY")
695"RTN","C0XF2N",113,0)
696 . S FARY="C0XFARY"
697"RTN","C0XF2N",114,0)
698 D USEFARY(FARY)
699"RTN","C0XF2N",115,0)
700 ;N ZLOC,ZTMP
701"RTN","C0XF2N",116,0)
702 K ZTMP
703"RTN","C0XF2N",117,0)
704 S ZLOC=$NA(^TMP("C0X","WGET",$J))
705"RTN","C0XF2N",118,0)
706 K @ZLOC
707"RTN","C0XF2N",119,0)
708 S C0XSTART=$$NOW^XLFDT
709"RTN","C0XF2N",120,0)
710 W !,"STARTED: ",C0XSTART
711"RTN","C0XF2N",121,0)
712 W !,"DOWNLOADING: ",ZURL
713"RTN","C0XF2N",122,0)
714 S OK=$$httpGET^%zewdGTM(ZURL,.ZTMP)
715"RTN","C0XF2N",123,0)
716 M @ZLOC=ZTMP
717"RTN","C0XF2N",124,0)
718 S C0XLINES=$O(@ZLOC@(""),-1)
719"RTN","C0XF2N",125,0)
720 W !,C0XLINES," LINES READ"
721"RTN","C0XF2N",126,0)
722 S C0XDLC=$$NOW^XLFDT ; DOWNLOAD COMPLETE
723"RTN","C0XF2N",127,0)
724 W !,"DOWNLOAD COMPLETE AT ",C0XDLC
725"RTN","C0XF2N",128,0)
726 S C0XDIFF=$$FMDIFF^XLFDT(C0XDLC,C0XSTART,2)
727"RTN","C0XF2N",129,0)
728 W !," ELAPSED TIME: ",C0XDIFF," SECONDS"
729"RTN","C0XF2N",130,0)
730 I C0XDIFF'=0 W !," APPROXIMATELY ",$P(C0XLINES/C0XDIFF,".")," LINES PER SEC"
731"RTN","C0XF2N",131,0)
732 D INSRDF(ZLOC,ZURL,FARY)
733"RTN","C0XF2N",132,0)
734 Q
735"RTN","C0XF2N",133,0)
736 ;
737"RTN","C0XF2N",134,0)
738INSRDF(ZRDF,ZNAME,FARY) ; INSERT AN RDF FILE INTO THE STORE AND PROCESS
739"RTN","C0XF2N",135,0)
740 ; ZRDF IS PASSED BY NAME
741"RTN","C0XF2N",136,0)
742 I '$D(FARY) D ;
743"RTN","C0XF2N",137,0)
744 . D INITFARY("C0XFARY")
745"RTN","C0XF2N",138,0)
746 . S FARY="C0XFARY"
747"RTN","C0XF2N",139,0)
748 D USEFARY(FARY)
749"RTN","C0XF2N",140,0)
750 S BATCNT=0 ; BATCH COUNTER
751"RTN","C0XF2N",141,0)
752 S BATMAX=10000 ; TRY BATCHES OF THIS SIZE
753"RTN","C0XF2N",142,0)
754 N ZGRAPH,ZSUBJECT
755"RTN","C0XF2N",143,0)
756 S ZGRAPH="_:G"_$$LKY9 ; RANDOM GRAPH NAME
757"RTN","C0XF2N",144,0)
758 S ZSUBJECT=$$ANONS ; RANDOM ANOYMOUS SUBJECT
759"RTN","C0XF2N",145,0)
760 D ADD(ZGRAPH,ZSUBJECT,"fmts:url",ZNAME,FARY)
761"RTN","C0XF2N",146,0)
762 N ZTXTNM
763"RTN","C0XF2N",147,0)
764 S ZTXTNM="_TXT_INCOMING_RDF_FILE_"_ZNAME_"_"_$$LKY9 ; NAME FOR TEXT NODE
765"RTN","C0XF2N",148,0)
766 D ADD(ZGRAPH,ZSUBJECT,"fmts:rdfSource",ZTXTNM,FARY)
767"RTN","C0XF2N",149,0)
768 D SWUPDIE(.C0XFDA) ; TRY IT OUT
769"RTN","C0XF2N",150,0)
770 K C0XCNT ;RESET FOR NEXT TIME
771"RTN","C0XF2N",151,0)
772 D STORETXT(ZRDF,ZTXTNM,FARY)
773"RTN","C0XF2N",152,0)
774 W !,"ADDED: ",ZGRAPH," ",ZSUBJECT," fmts:rdfSource ",ZTXTNM
775"RTN","C0XF2N",153,0)
776 D PROCESS(.G,ZRDF,ZNAME,ZGRAPH,FARY) ; PARSE AND INSERT THE RDF
777"RTN","C0XF2N",154,0)
778 Q
779"RTN","C0XF2N",155,0)
780 ;
781"RTN","C0XF2N",156,0)
782STORETXT(ZTXT,ZNAME,FARY) ; STORE TEXT IN THE TRIPLESTORE AT ZNAME
783"RTN","C0XF2N",157,0)
784 ;
785"RTN","C0XF2N",158,0)
786 I '$D(FARY) D ;
787"RTN","C0XF2N",159,0)
788 . D INITFARY("C0XFARY")
789"RTN","C0XF2N",160,0)
790 . S FARY="C0XFARY"
791"RTN","C0XF2N",161,0)
792 D USEFARY(FARY)
793"RTN","C0XF2N",162,0)
794 N ZIEN
795"RTN","C0XF2N",163,0)
796 S ZIEN=$$IENOF(ZNAME,FARY) ; GET THE IEN
797"RTN","C0XF2N",164,0)
798 D CLEAN^DILF
799"RTN","C0XF2N",165,0)
800 K ZERR
801"RTN","C0XF2N",166,0)
802 D WP^DIE(C0XSFN,ZIEN_",",1,,ZTXT,"ZERR")
803"RTN","C0XF2N",167,0)
804 I $D(ZERR) D ;
805"RTN","C0XF2N",168,0)
806 . ZWR ZERR
807"RTN","C0XF2N",169,0)
808 Q
809"RTN","C0XF2N",170,0)
810 ;
811"RTN","C0XF2N",171,0)
812GETTXT(ZRTN,ZNAME,FARY) ; RETURNS RDF SOURCE OR OTHER TEXT
813"RTN","C0XF2N",172,0)
814 ; ZRTN IS PASSED BY REFERENCE
815"RTN","C0XF2N",173,0)
816 I '$D(FARY) D ;
817"RTN","C0XF2N",174,0)
818 . D INITFARY("C0XFARY")
819"RTN","C0XF2N",175,0)
820 . S FARY="C0XFARY"
821"RTN","C0XF2N",176,0)
822 D USEFARY(FARY)
823"RTN","C0XF2N",177,0)
824 N ZIEN
825"RTN","C0XF2N",178,0)
826 S ZIEN=$$IENOF(ZNAME)
827"RTN","C0XF2N",179,0)
828 S OK=$$GET1^DIQ(C0XSFN,ZIEN_",",1,,"ZRTN")
829"RTN","C0XF2N",180,0)
830 Q
831"RTN","C0XF2N",181,0)
832 ;
833"RTN","C0XF2N",182,0)
834WHERETXT(ZNAME,FARY) ; EXTRINSIC WHICH RETURNS THE NAME OF THE GLOBAL
835"RTN","C0XF2N",183,0)
836 ; WHERE THE TEXT IS LOCATED. NAME IS THE NAME OF THE STRING
837"RTN","C0XF2N",184,0)
838 I '$D(FARY) D ;
839"RTN","C0XF2N",185,0)
840 . D INITFARY("C0XFARY")
841"RTN","C0XF2N",186,0)
842 . S FARY="C0XFARY"
843"RTN","C0XF2N",187,0)
844 D USEFARY(FARY)
845"RTN","C0XF2N",188,0)
846 N ZIEN
847"RTN","C0XF2N",189,0)
848 S ZIEN=$$IENOF(ZNAME)
849"RTN","C0XF2N",190,0)
850 Q $NA(@C0XSN@(ZIEN,1))
851"RTN","C0XF2N",191,0)
852 ;
853"RTN","C0XF2N",192,0)
854FILEREAD(ZINTMP,ZDIR,ZFNAME,ZLVL) ; READS A FILE INTO ZINTMP USING FTG^%ZISH
855"RTN","C0XF2N",193,0)
856 ; ZINTMP IS PASSED BY NAME AND INCLUDES THE NEW SUBSCRIPT
857"RTN","C0XF2N",194,0)
858 ; IE ^TMP("C0X","FILEIN",1)
859"RTN","C0XF2N",195,0)
860 ; ZLVL IN THIS CASE WOULD BE 3 INCREMENTING THE 1
861"RTN","C0XF2N",196,0)
862 ; EXTRINSIC WHICH RETURNS THE RESULT OF FTG^%ZISH
863"RTN","C0XF2N",197,0)
864 S OK=$$FTG^%ZISH(ZDIR,FNAME,ZINTMP,ZLVL)
865"RTN","C0XF2N",198,0)
866 Q OK
867"RTN","C0XF2N",199,0)
868 ;
869"RTN","C0XF2N",200,0)
870TESTPROC ; TEST PROCESS WITH EXISTING SMALL RDF FILE
871"RTN","C0XF2N",201,0)
872 S ZIN=$NA(^TMP("C0X",12226,"FILEIN"))
873"RTN","C0XF2N",202,0)
874 S ZGRAPH="/test/rdfFile"
875"RTN","C0XF2N",203,0)
876 S ZM="/test/rdfFile/meta"
877"RTN","C0XF2N",204,0)
878 D PROCESS(.G,ZIN,ZGRAPH,ZM)
879"RTN","C0XF2N",205,0)
880 Q
881"RTN","C0XF2N",206,0)
882 ;
883"RTN","C0XF2N",207,0)
884PROCESS(ZRTN,ZRDF,ZGRF,ZMETA,FARY) ; PROCESS AN INCOMING RDF FILE
885"RTN","C0XF2N",208,0)
886 ; ZRTN IS PASS BY REFERENCE AND RETURNS MESSAGES ABOUT THE PROCESSING
887"RTN","C0XF2N",209,0)
888 ; ZRDF IS PASSED BY NAME AND IS THE GLOBAL CONTAINING THE RDF FILE
889"RTN","C0XF2N",210,0)
890 ; ZGRF IS THE NAME OF THE GRAPH TO USE IN THE TRIPLE STORE FOR RESULTS
891"RTN","C0XF2N",211,0)
892 ; ZMETA IS OPTIONAL AND IS THE NAME OF THE GRAPH TO STORE METADATA
893"RTN","C0XF2N",212,0)
894 ;
895"RTN","C0XF2N",213,0)
896 I '$D(FARY) D ;
897"RTN","C0XF2N",214,0)
898 . D INITFARY("C0XFARY")
899"RTN","C0XF2N",215,0)
900 . S FARY="C0XFARY"
901"RTN","C0XF2N",216,0)
902 D USEFARY(FARY)
903"RTN","C0XF2N",217,0)
904 ;N BATCNT
905"RTN","C0XF2N",218,0)
906 ;N BATMAX
907"RTN","C0XF2N",219,0)
908 ; -- first parse the rdf file with the MXML parser
909"RTN","C0XF2N",220,0)
910 ;S C0XDOCID=$$PARSE^C0CNHIN(ZRDF,"C0XARRAY") ; PARSE WITH MXML
911"RTN","C0XF2N",221,0)
912 S C0XDLC2=$$NOW^XLFDT ; START OF PARSE
913"RTN","C0XF2N",222,0)
914 S C0XDOCID=$$EN^MXMLDOM(ZRDF,"W")
915"RTN","C0XF2N",223,0)
916 K @ZRDF ; DON'T NEED INPUT BUFFER ANYMORE
917"RTN","C0XF2N",224,0)
918 ; -- assign the MXLM dom global name to ZDOM
919"RTN","C0XF2N",225,0)
920 S ZDOM=$NA(^TMP("MXMLDOM",$J,C0XDOCID))
921"RTN","C0XF2N",226,0)
922 S C0XNODE=$O(@ZDOM@(""),-1)
923"RTN","C0XF2N",227,0)
924 W !,C0XNODE," XML NODES PARSED"
925"RTN","C0XF2N",228,0)
926 S C0XPRS=$$NOW^XLFDT ; PARSE COMPLETE
927"RTN","C0XF2N",229,0)
928 W !,"PARSE COMPLETE AT ",C0XPRS
929"RTN","C0XF2N",230,0)
930 S C0XDIFF=$$FMDIFF^XLFDT(C0XPRS,C0XDLC2,2)
931"RTN","C0XF2N",231,0)
932 W !," ELAPSED TIME: ",C0XDIFF," SECONDS"
933"RTN","C0XF2N",232,0)
934 I C0XDIFF'=0 D ;
935"RTN","C0XF2N",233,0)
936 . W !," APPROXIMATELY ",$P(C0XNODE/C0XDIFF,".")," NODES PER SECOND"
937"RTN","C0XF2N",234,0)
938 ; -- populate the metagraph to point to the graph with status unfinished
939"RTN","C0XF2N",235,0)
940 S METAS=$$ANONS ; GET AN ANONOMOUS RANDOM SUBJECT
941"RTN","C0XF2N",236,0)
942 I '$D(ZMETA) S ZMETA="_:G"_$$LKY9 ; RANDOM GRAPH NAME FOR METAGRAPH
943"RTN","C0XF2N",237,0)
944 D ADD(ZMETA,METAS,"fmts:about",ZGRF,FARY) ; POINT THE META TO THE GRAPH
945"RTN","C0XF2N",238,0)
946 D ADD(ZMETA,METAS,"fmts:status","unfinished",FARY) ; mark as unfinished
947"RTN","C0XF2N",239,0)
948 W !,"INSERTING GRAPH: ",ZGRF
949"RTN","C0XF2N",240,0)
950 ;S C0XDATE=$$FMDTOUTC^C0CUTIL($$NOW^XLFDT,"DT")
951"RTN","C0XF2N",241,0)
952 S C0XDATE=$$NOW^XLFDT
953"RTN","C0XF2N",242,0)
954 D ADD(ZMETA,METAS,"fmts:dateTime",C0XDATE,FARY)
955"RTN","C0XF2N",243,0)
956 D SWUPDIE(.C0XFDA) ; commit the metagraph changes to the triple store
957"RTN","C0XF2N",244,0)
958 ; --
959"RTN","C0XF2N",245,0)
960 ; -- pull out the vocabularies in the RDF statement. marked with xmlns:
961"RTN","C0XF2N",246,0)
962 ; -- put them in a local variable for quick reference
963"RTN","C0XF2N",247,0)
964 ; -- TODO: create a graph for vocabularies and validate incoming against it
965"RTN","C0XF2N",248,0)
966 ;
967"RTN","C0XF2N",249,0)
968 S C0XVOC=""
969"RTN","C0XF2N",250,0)
970 N ZI,ZJ,ZK S ZI=""
971"RTN","C0XF2N",251,0)
972 F S ZI=$O(@ZDOM@(1,"A",ZI)) Q:ZI="" D ; FOR EACH xmlns
973"RTN","C0XF2N",252,0)
974 . S ZVOC=$P(ZI,"xmlns:",2)
975"RTN","C0XF2N",253,0)
976 . I ZVOC'="" S C0XVOC(ZVOC)=$G(@ZDOM@(1,"A",ZI))
977"RTN","C0XF2N",254,0)
978 ;W !,"VOCABS:" ZWR C0XVOC
979"RTN","C0XF2N",255,0)
980 ;
981"RTN","C0XF2N",256,0)
982 ; -- look for children called rdf:Description. quit if none. not an rdf file
983"RTN","C0XF2N",257,0)
984 ;
985"RTN","C0XF2N",258,0)
986 S ZI=$O(@ZDOM@(1,"C",""))
987"RTN","C0XF2N",259,0)
988 I $G(@ZDOM@(1,"C",ZI))'="rdf:Description" D Q ; not an rdf file
989"RTN","C0XF2N",260,0)
990 . W !,"Error. Not an RDF file. Cannot process."
991"RTN","C0XF2N",261,0)
992 ;
993"RTN","C0XF2N",262,0)
994 ; -- now process the rdf description children
995"RTN","C0XF2N",263,0)
996 ;
997"RTN","C0XF2N",264,0)
998 S ZI=""
999"RTN","C0XF2N",265,0)
1000 S (C0XSUB,C0XPRE,C0XOBJ)="" ; INITIALIZE subject, object and predicate
1001"RTN","C0XF2N",266,0)
1002 F S ZI=$O(@ZDOM@(1,"C",ZI)) Q:ZI="" D ;
1003"RTN","C0XF2N",267,0)
1004 . ; -- we are skipping any child that is not rdf:Description
1005"RTN","C0XF2N",268,0)
1006 . ; -- TODO: check to see if this is right in general
1007"RTN","C0XF2N",269,0)
1008 . ;
1009"RTN","C0XF2N",270,0)
1010 . IF $G(@ZDOM@(1,"C",ZI))'="rdf:Description" D Q ;
1011"RTN","C0XF2N",271,0)
1012 . . W !,"SKIPPING NODE: ",ZI
1013"RTN","C0XF2N",272,0)
1014 . ; -- now looking for the subject for the triples
1015"RTN","C0XF2N",273,0)
1016 . S ZX=$G(@ZDOM@(ZI,"A","rdf:about"))
1017"RTN","C0XF2N",274,0)
1018 . I ZX'="" D ; we have the subject
1019"RTN","C0XF2N",275,0)
1020 . . ;W " about: ",ZX
1021"RTN","C0XF2N",276,0)
1022 . . S C0XSUB=ZX
1023"RTN","C0XF2N",277,0)
1024 . E D ;
1025"RTN","C0XF2N",278,0)
1026 . . S ZX=$G(@ZDOM@(ZI,"A","rdf:nodeID")) ; node id is another style of subject
1027"RTN","C0XF2N",279,0)
1028 . . I ZX'="" D ;
1029"RTN","C0XF2N",280,0)
1030 . . . S C0XSUB=ZX
1031"RTN","C0XF2N",281,0)
1032 . I C0XSUB="" S C0XSUB=$$ANONS ; DEFAULT TO BLANK SUBJECT
1033"RTN","C0XF2N",282,0)
1034 . ;
1035"RTN","C0XF2N",283,0)
1036 . ; -- we now have the subject. the children of this node have the rest
1037"RTN","C0XF2N",284,0)
1038 . ;
1039"RTN","C0XF2N",285,0)
1040 . S ZJ="" ; for the children of the rdf:Description nodes
1041"RTN","C0XF2N",286,0)
1042 . F S ZJ=$O(@ZDOM@(ZI,"C",ZJ)) Q:ZJ="" D ; for each child
1043"RTN","C0XF2N",287,0)
1044 . . S C0XPRE=@ZDOM@(ZJ) ; the predicate without a prefix
1045"RTN","C0XF2N",288,0)
1046 . . S ZX=$G(@ZDOM@(ZJ,"A","xmlns")) ; name space
1047"RTN","C0XF2N",289,0)
1048 . . I ZX'="" S C0XPRE=ZX_C0XPRE ; add the namespace prefix
1049"RTN","C0XF2N",290,0)
1050 . . I C0XPRE[":" D ; expand using vocabulary
1051"RTN","C0XF2N",291,0)
1052 . . . N ZB,ZA
1053"RTN","C0XF2N",292,0)
1054 . . . S ZB=$P(C0XPRE,":",1)
1055"RTN","C0XF2N",293,0)
1056 . . . S ZA=$P(C0XPRE,":",2)
1057"RTN","C0XF2N",294,0)
1058 . . . I $G(C0XVOC(ZB))'="" D ;
1059"RTN","C0XF2N",295,0)
1060 . . . . S C0XPRE=C0XVOC(ZB)_ZA ; expanded
1061"RTN","C0XF2N",296,0)
1062 . . S ZY=$G(@ZDOM@(ZJ,"A","rdf:resource")) ; potential object
1063"RTN","C0XF2N",297,0)
1064 . . I ZY'="" D Q ;
1065"RTN","C0XF2N",298,0)
1066 . . . S C0XOBJ=ZY ; object
1067"RTN","C0XF2N",299,0)
1068 . . . D ADD(ZGRF,C0XSUB,C0XPRE,C0XOBJ) ; finally. our first real triple
1069"RTN","C0XF2N",300,0)
1070 . . ; -- this is an else because of the quit above
1071"RTN","C0XF2N",301,0)
1072 . . S ZX=$G(@ZDOM@(ZJ,"A","rdf:nodeID")) ; fishing for nodeId object
1073"RTN","C0XF2N",302,0)
1074 . . I ZX'="" D Q ; got one
1075"RTN","C0XF2N",303,0)
1076 . . . S C0XOBJ=ZX ; we are using the incoming nodeIDs as object/subject
1077"RTN","C0XF2N",304,0)
1078 . . . ; without change... this could be foolish .. look at it again later
1079"RTN","C0XF2N",305,0)
1080 . . . D ADD(ZGRF,C0XSUB,C0XPRE,C0XOBJ) ; go for it and add a node
1081"RTN","C0XF2N",306,0)
1082 . . S C0XOBJ=$G(@ZDOM@(ZJ,"T",1)) ; hopefully an object is here
1083"RTN","C0XF2N",307,0)
1084 . . I C0XOBJ="" D Q ; not a happy situation
1085"RTN","C0XF2N",308,0)
1086 . . . W !,"ERROR, NO OBJECT FOUND FOR NODE: ",ZJ
1087"RTN","C0XF2N",309,0)
1088 . . D ADD(ZGRF,C0XSUB,C0XPRE,C0XOBJ) ; go for it and add a node
1089"RTN","C0XF2N",310,0)
1090 S C0XTRP=$$NOW^XLFDT ; PARSE COMPLETE
1091"RTN","C0XF2N",311,0)
1092 W !,"TRIPLES COMPLETE AT ",C0XTRP
1093"RTN","C0XF2N",312,0)
1094 S C0XDIFF=$$FMDIFF^XLFDT(C0XTRP,C0XPRS,2)
1095"RTN","C0XF2N",313,0)
1096 W !," ELAPSED TIME: ",C0XDIFF," SECONDS"
1097"RTN","C0XF2N",314,0)
1098 I C0XDIFF'=0 D ;
1099"RTN","C0XF2N",315,0)
1100 . W !," APPROXIMATELY ",$P(C0XCNT/C0XDIFF,".")," TRIPLES PER SECOND"
1101"RTN","C0XF2N",316,0)
1102 W !,"INSERTING ",C0XCNT," TRIPLES"
1103"RTN","C0XF2N",317,0)
1104 I $D(C0XFDA) D ;
1105"RTN","C0XF2N",318,0)
1106 . I $G(BLKLOAD) D ;
1107"RTN","C0XF2N",319,0)
1108 . . D BULKLOAD(.C0XFDA)
1109"RTN","C0XF2N",320,0)
1110 . E D ;
1111"RTN","C0XF2N",321,0)
1112 . . D UPDIE(.C0XFDA) ; commit the updates to the file
1113"RTN","C0XF2N",322,0)
1114 ; next, mark the graph as finished
1115"RTN","C0XF2N",323,0)
1116 S C0XINS=$$NOW^XLFDT ; PARSE COMPLETE
1117"RTN","C0XF2N",324,0)
1118 W !,"INSERTION COMPLETE AT ",C0XPRS
1119"RTN","C0XF2N",325,0)
1120 S C0XDIFF=$$FMDIFF^XLFDT(C0XINS,C0XTRP,2)
1121"RTN","C0XF2N",326,0)
1122 W !," ELAPSED TIME: ",C0XDIFF," SECONDS"
1123"RTN","C0XF2N",327,0)
1124 I C0XDIFF'=0 W !," APPROXIMATELY ",$P(C0XCNT/C0XDIFF,".")," NODES PER SECOND"
1125"RTN","C0XF2N",328,0)
1126 S C0XEND=$$NOW^XLFDT
1127"RTN","C0XF2N",329,0)
1128 W !," ENDED AT: ",C0XEND
1129"RTN","C0XF2N",330,0)
1130 S C0XDIFF=$$FMDIFF^XLFDT(C0XEND,C0XSTART,2)
1131"RTN","C0XF2N",331,0)
1132 W !," ELAPSED TIME: ",C0XDIFF," SECONDS"
1133"RTN","C0XF2N",332,0)
1134 I C0XDIFF'=0 W !," APPROXIMATELY ",$P(C0XCNT/C0XDIFF,".")," TRIPLES PER SECOND"
1135"RTN","C0XF2N",333,0)
1136 Q
1137"RTN","C0XF2N",334,0)
1138 ;
1139"RTN","C0XF2N",335,0)
1140SHOW(ZN) ;
1141"RTN","C0XF2N",336,0)
1142 ZWR ^TMP("MXMLDOM",$J,1,ZN,*)
1143"RTN","C0XF2N",337,0)
1144 Q
1145"RTN","C0XF2N",338,0)
1146 ;
1147"RTN","C0XF2N",339,0)
1148ANONS() ; RETURNS AN ANONOMOUS SUBJECT
1149"RTN","C0XF2N",340,0)
1150 Q "_:S"_$$LKY9
1151"RTN","C0XF2N",341,0)
1152 ;
1153"RTN","C0XF2N",342,0)
1154NEWG(NGRAPH,NMETA) ; CREATES A NEW META GRAPH, MARKS IT AS UNFINISHED
1155"RTN","C0XF2N",343,0)
1156 ; THEN CREATES A NEW GRAPH AND POINTS THE METAGRAPH TO IT
1157"RTN","C0XF2N",344,0)
1158 ; NGRAPH AND NMETA ARE PASSED BY REFERENCE AND ARE THE RETURN
1159"RTN","C0XF2N",345,0)
1160 S NGRAPH="G"_$$LKY9
1161"RTN","C0XF2N",346,0)
1162 S NMETA=NGRAPH_"A"
1163"RTN","C0XF2N",347,0)
1164 Q
1165"RTN","C0XF2N",348,0)
1166 ;
1167"RTN","C0XF2N",349,0)
1168ADD(ZG,ZS,ZP,ZO,FARY) ; ADD A TRIPLE TO THE TRIPLESTORE. ALL VALUES ARE TEXT
1169"RTN","C0XF2N",350,0)
1170 ; THE FDA IS SET UP BUT THE FILES ARE NOT UPDATED. CALL UPDIE TO COMPLETE
1171"RTN","C0XF2N",351,0)
1172 I '$D(FARY) D ;
1173"RTN","C0XF2N",352,0)
1174 . D INITFARY("C0XFARY")
1175"RTN","C0XF2N",353,0)
1176 . S FARY="C0XFARY"
1177"RTN","C0XF2N",354,0)
1178 D USEFARY(FARY)
1179"RTN","C0XF2N",355,0)
1180 I '$D(C0XCNT) S C0XCNT=0
1181"RTN","C0XF2N",356,0)
1182 N ZNODE
1183"RTN","C0XF2N",357,0)
1184 S ZNODE="N"_$$LKY17
1185"RTN","C0XF2N",358,0)
1186 N ZNARY ; GET READY TO CALL IENOFA
1187"RTN","C0XF2N",359,0)
1188 S ZNARY("ZG",ZG)=""
1189"RTN","C0XF2N",360,0)
1190 S ZNARY("ZS",ZS)=""
1191"RTN","C0XF2N",361,0)
1192 S ZNARY("ZP",ZP)=""
1193"RTN","C0XF2N",362,0)
1194 S ZNARY("ZO",ZO)=""
1195"RTN","C0XF2N",363,0)
1196 D IENOFA(.ZIENS,.ZNARY,FARY) ; RESOLVE/ADD STRINGS
1197"RTN","C0XF2N",364,0)
1198 ;S ZGIEN=$$IENOF(ZG) ; LAYGO TO GET IEN
1199"RTN","C0XF2N",365,0)
1200 ;S ZSIEN=$$IENOF(ZS)
1201"RTN","C0XF2N",366,0)
1202 ;S ZPIEN=$$IENOF(ZP)
1203"RTN","C0XF2N",367,0)
1204 ;S ZOIEN=$$IENOF(ZO)
1205"RTN","C0XF2N",368,0)
1206 ;I $D(C0XFDA) D UPDIE ; ADD THE STRINGS IF NEEDED
1207"RTN","C0XF2N",369,0)
1208 S BATCNT=BATCNT+1
1209"RTN","C0XF2N",370,0)
1210 S C0XCNT=C0XCNT+1
1211"RTN","C0XF2N",371,0)
1212 I $G(BLKLOAD)=1 D ; we are using bulk load
1213"RTN","C0XF2N",372,0)
1214 . S C0XFDA(C0XTFN,BATCNT,.01)=ZNODE
1215"RTN","C0XF2N",373,0)
1216 . S C0XFDA(C0XTFN,BATCNT,.02)=$O(ZIENS("IEN","ZG",""))
1217"RTN","C0XF2N",374,0)
1218 . S C0XFDA(C0XTFN,BATCNT,.03)=$O(ZIENS("IEN","ZS",""))
1219"RTN","C0XF2N",375,0)
1220 . S C0XFDA(C0XTFN,BATCNT,.04)=$O(ZIENS("IEN","ZP",""))
1221"RTN","C0XF2N",376,0)
1222 . S C0XFDA(C0XTFN,BATCNT,.05)=$O(ZIENS("IEN","ZO",""))
1223"RTN","C0XF2N",377,0)
1224 E D ;
1225"RTN","C0XF2N",378,0)
1226 . S C0XFDA(C0XTFN,"?+"_BATCNT_",",.01)=ZNODE
1227"RTN","C0XF2N",379,0)
1228 . S C0XFDA(C0XTFN,"?+"_BATCNT_",",.02)=$O(ZIENS("IEN","ZG",""))
1229"RTN","C0XF2N",380,0)
1230 . S C0XFDA(C0XTFN,"?+"_BATCNT_",",.03)=$O(ZIENS("IEN","ZS",""))
1231"RTN","C0XF2N",381,0)
1232 . S C0XFDA(C0XTFN,"?+"_BATCNT_",",.04)=$O(ZIENS("IEN","ZP",""))
1233"RTN","C0XF2N",382,0)
1234 . S C0XFDA(C0XTFN,"?+"_BATCNT_",",.05)=$O(ZIENS("IEN","ZO",""))
1235"RTN","C0XF2N",383,0)
1236 I BATCNT=BATMAX D ; BATCH IS DONE
1237"RTN","C0XF2N",384,0)
1238 . I $G(BLKLOAD) D ; bulk load
1239"RTN","C0XF2N",385,0)
1240 . . D BULKLOAD(.C0XFDA) ; bulk load the batch
1241"RTN","C0XF2N",386,0)
1242 . E D ; no bulk load
1243"RTN","C0XF2N",387,0)
1244 . . D UPDIE(.C0XFDA)
1245"RTN","C0XF2N",388,0)
1246 . K C0XFDA
1247"RTN","C0XF2N",389,0)
1248 . S BATCNT=0 ; RESET COUNTER
1249"RTN","C0XF2N",390,0)
1250 ; REMEMBER TO CALL UPDIE WHEN YOU'RE DONE
1251"RTN","C0XF2N",391,0)
1252 Q
1253"RTN","C0XF2N",392,0)
1254 ;
1255"RTN","C0XF2N",393,0)
1256LKY9() ;EXTRINIC THAT RETURNS A RANDOM 9 DIGIT NUMBER. USED FOR GENERATING
1257"RTN","C0XF2N",394,0)
1258 ; UNIQUE NODE AND GRAPH NAMES
1259"RTN","C0XF2N",395,0)
1260 N ZN,ZI
1261"RTN","C0XF2N",396,0)
1262 S ZN=""
1263"RTN","C0XF2N",397,0)
1264 F ZI=1:1:9 D ;
1265"RTN","C0XF2N",398,0)
1266 . S ZN=ZN_$R(10)
1267"RTN","C0XF2N",399,0)
1268 Q ZN
1269"RTN","C0XF2N",400,0)
1270 ;
1271"RTN","C0XF2N",401,0)
1272LKY17() ;EXTRINIC THAT RETURNS A RANDOM 9 DIGIT NUMBER. USED FOR GENERATING
1273"RTN","C0XF2N",402,0)
1274 ; UNIQUE NODE AND GRAPH NAMES
1275"RTN","C0XF2N",403,0)
1276 N ZN,ZI
1277"RTN","C0XF2N",404,0)
1278 S ZN=""
1279"RTN","C0XF2N",405,0)
1280 F ZI=1:1:17 D ;
1281"RTN","C0XF2N",406,0)
1282 . S ZN=ZN_$R(10)
1283"RTN","C0XF2N",407,0)
1284 Q ZN
1285"RTN","C0XF2N",408,0)
1286 ;
1287"RTN","C0XF2N",409,0)
1288IENOF(ZSTRING,FARY) ; EXTRINSIC WHICH RETURNS THE IEN OF ZS IN THE STRINGS FILE
1289"RTN","C0XF2N",410,0)
1290 I '$D(FARY) D ;
1291"RTN","C0XF2N",411,0)
1292 . D INITFARY("C0XFARY")
1293"RTN","C0XF2N",412,0)
1294 . S FARY="C0XFARY"
1295"RTN","C0XF2N",413,0)
1296 N ZIEN
1297"RTN","C0XF2N",414,0)
1298 S ZIEN=$O(@C0XSN@("B",ZSTRING,""))
1299"RTN","C0XF2N",415,0)
1300 I ZIEN="" D ;
1301"RTN","C0XF2N",416,0)
1302 . S C0XFDA2(C0XSFN,"+1,",.01)=ZSTRING
1303"RTN","C0XF2N",417,0)
1304 . D UPDIE(.C0XFDA2)
1305"RTN","C0XF2N",418,0)
1306 . S ZIEN=$O(@C0XSN@("B",ZSTRING,""))
1307"RTN","C0XF2N",419,0)
1308 . K C0XFDA2
1309"RTN","C0XF2N",420,0)
1310 Q ZIEN
1311"RTN","C0XF2N",421,0)
1312 ;
1313"RTN","C0XF2N",422,0)
1314IENOFA(ZOUTARY,ZINARY,FARY) ; RESOLVE STRINGS TO IEN IN STRINGS FILE
1315"RTN","C0XF2N",423,0)
1316 ; OR ADD THEM IF
1317"RTN","C0XF2N",424,0)
1318 ; MISSING. ZINARY AND ZOUTARY ARE PASSED BY REFERENCE
1319"RTN","C0XF2N",425,0)
1320 ; ZINARY LOOKS LIKE ZINARY("VAR","VAL")=""
1321"RTN","C0XF2N",426,0)
1322 ; RETURNS IN ZOUTARY OF THE FORM ZOUTARY("IEN","VAR",IEN)=""
1323"RTN","C0XF2N",427,0)
1324 I '$D(FARY) D ;
1325"RTN","C0XF2N",428,0)
1326 . D INITFARY("C0XFARY")
1327"RTN","C0XF2N",429,0)
1328 . S FARY="C0XFARY"
1329"RTN","C0XF2N",430,0)
1330 K ZOUTARY ; START WITH CLEAN RESULTS
1331"RTN","C0XF2N",431,0)
1332 K C0XFDA2 ; USE A SEPARATE FDA FOR THIS
1333"RTN","C0XF2N",432,0)
1334 N ZI S ZI=""
1335"RTN","C0XF2N",433,0)
1336 N ZV,ZIEN
1337"RTN","C0XF2N",434,0)
1338 N ZCNT S ZCNT=0
1339"RTN","C0XF2N",435,0)
1340 F S ZI=$O(ZINARY(ZI)) Q:ZI="" D ; LOOK FOR MISSING STRINGS
1341"RTN","C0XF2N",436,0)
1342 . S ZV=$O(ZINARY(ZI,""))
1343"RTN","C0XF2N",437,0)
1344 . I $O(@C0XSN@("B",ZV,""))="" D ;
1345"RTN","C0XF2N",438,0)
1346 . . S ZCNT=ZCNT+1
1347"RTN","C0XF2N",439,0)
1348 . . S C0XFDA2(C0XSFN,"+"_ZCNT_",",.01)=ZV
1349"RTN","C0XF2N",440,0)
1350 I $D(C0XFDA2) D ;
1351"RTN","C0XF2N",441,0)
1352 . D UPDIE(.C0XFDA2) ; ADD MISSING STRINGS
1353"RTN","C0XF2N",442,0)
1354 . K C0XFDA2 ; CLEAN UP
1355"RTN","C0XF2N",443,0)
1356 F S ZI=$O(ZINARY(ZI)) Q:ZI="" D ; NOT GET ALL IENS
1357"RTN","C0XF2N",444,0)
1358 . S ZV=$O(ZINARY(ZI,""))
1359"RTN","C0XF2N",445,0)
1360 . S ZIEN=$O(@C0XSN@("B",ZV,"")) ; THEY SHOULD BE THERE NOW
1361"RTN","C0XF2N",446,0)
1362 . I ZIEN="" D ;
1363"RTN","C0XF2N",447,0)
1364 . . W !,"ERROR ADDING STRING: ",ZV
1365"RTN","C0XF2N",448,0)
1366 . . B
1367"RTN","C0XF2N",449,0)
1368 . S ZOUTARY("IEN",ZI,ZIEN)=""
1369"RTN","C0XF2N",450,0)
1370 Q
1371"RTN","C0XF2N",451,0)
1372 ;
1373"RTN","C0XF2N",452,0)
1374BULKLOAD(ZBFDA) ; BULK LOADER FOR LOADING TRIPLES INTO FILE 172.101
1375"RTN","C0XF2N",453,0)
1376 ; USING GLOBAL SETS INSTEAD OF UPDATE^DIE
1377"RTN","C0XF2N",454,0)
1378 ; QUITS IF FILE IS NOT 172.101
1379"RTN","C0XF2N",455,0)
1380 ; EXPECTS AN FDA WITHOUT STRINGS FOR THE IENS, STARTING AT 1
1381"RTN","C0XF2N",456,0)
1382 ; QUITS IF FIRST ENTRY IS NOT IENS 1
1383"RTN","C0XF2N",457,0)
1384 ; ASSUMES THAT THE LAST IENS IS THE COUNT OF ENTRIES
1385"RTN","C0XF2N",458,0)
1386 ; ZBFDA IS PASSED BY REFERENCE
1387"RTN","C0XF2N",459,0)
1388 ;
1389"RTN","C0XF2N",460,0)
1390 ; -- reserves a block of iens from file 172.101 by locking the zero node
1391"RTN","C0XF2N",461,0)
1392 ; -- ^C0X(101,0) and adding the count of entries to piece 2 and 3
1393"RTN","C0XF2N",462,0)
1394 ; -- then unlocking to minimize the duration of the lock
1395"RTN","C0XF2N",463,0)
1396 ;
1397"RTN","C0XF2N",464,0)
1398 W !,"USING BULKLOAD"
1399"RTN","C0XF2N",465,0)
1400 I '$D(ZBFDA) Q ; EMPTY FDA
1401"RTN","C0XF2N",466,0)
1402 I $O(ZBFDA(""))'=172.101 Q ; WRONG FILE
1403"RTN","C0XF2N",467,0)
1404 N ZCNT,ZP3,ZP4
1405"RTN","C0XF2N",468,0)
1406 ; -- find the number of nodes to insert
1407"RTN","C0XF2N",469,0)
1408 S ZCNT=$O(ZBFDA(172.101,""),-1)
1409"RTN","C0XF2N",470,0)
1410 I ZCNT="" D Q ;
1411"RTN","C0XF2N",471,0)
1412 . W !,"ERROR IN BULK LOAD - INVALID NODE COUNT"
1413"RTN","C0XF2N",472,0)
1414 . B
1415"RTN","C0XF2N",473,0)
1416 ; -- lock the zero node and reserve a block of iens to insert
1417"RTN","C0XF2N",474,0)
1418 W !,"LOCKING ZERO NODE"
1419"RTN","C0XF2N",475,0)
1420 LOCK +^C0X(101,0)
1421"RTN","C0XF2N",476,0)
1422 S ZP3=$P(^C0X(101,0),U,3)
1423"RTN","C0XF2N",477,0)
1424 S ZP4=$P(^C0X(101,0),U,4)
1425"RTN","C0XF2N",478,0)
1426 S $P(^C0X(101,0),U,3)=ZP3+ZCNT+1
1427"RTN","C0XF2N",479,0)
1428 S $P(^C0X(101,0),U,4)=ZP4+ZCNT+1
1429"RTN","C0XF2N",480,0)
1430 LOCK -^C0X(101,0)
1431"RTN","C0XF2N",481,0)
1432 N ZI,ZN,ZG,ZS,ZP,ZO,ZIEN,ZBASE
1433"RTN","C0XF2N",482,0)
1434 S ZBASE=ZP3 ; the last ien in the file
1435"RTN","C0XF2N",483,0)
1436 W !,"ZERO NODE UNLOCKED, IENS RESERVED=",ZCNT
1437"RTN","C0XF2N",484,0)
1438 W !,$$NOW^XLFDT
1439"RTN","C0XF2N",485,0)
1440 S ZI=""
1441"RTN","C0XF2N",486,0)
1442 F S ZI=$O(ZBFDA(172.101,ZI)) Q:ZI="" D ;
1443"RTN","C0XF2N",487,0)
1444 . S ZN=$G(ZBFDA(172.101,ZI,.01)) ; node name
1445"RTN","C0XF2N",488,0)
1446 . I ZN="" D BLKERR Q ;
1447"RTN","C0XF2N",489,0)
1448 . S ZG=$G(ZBFDA(172.101,ZI,.02)) ; graph pointer
1449"RTN","C0XF2N",490,0)
1450 . I ZG="" D BLKERR Q ;
1451"RTN","C0XF2N",491,0)
1452 . S ZS=$G(ZBFDA(172.101,ZI,.03)) ; subject pointer
1453"RTN","C0XF2N",492,0)
1454 . I ZS="" D BLKERR Q ;
1455"RTN","C0XF2N",493,0)
1456 . S ZP=$G(ZBFDA(172.101,ZI,.04)) ; predicate pointer
1457"RTN","C0XF2N",494,0)
1458 . I ZP="" D BLKERR Q ;
1459"RTN","C0XF2N",495,0)
1460 . S ZO=$G(ZBFDA(172.101,ZI,.05)) ; object pointer
1461"RTN","C0XF2N",496,0)
1462 . I ZO="" D BLKERR Q ;
1463"RTN","C0XF2N",497,0)
1464 . S ZIEN=ZI+ZBASE ; the new ien
1465"RTN","C0XF2N",498,0)
1466 . S ^C0X(101,ZIEN,0)=ZN_U_ZG_U_ZS_U_ZP_U_ZO ; set the zero node
1467"RTN","C0XF2N",499,0)
1468 . S ^C0X(101,"B",ZN,ZIEN)="" ; the B index
1469"RTN","C0XF2N",500,0)
1470 . S ^C0X(101,"G",ZG,ZIEN)="" ; the G for Graph index
1471"RTN","C0XF2N",501,0)
1472 . S ^C0X(101,"SPO",ZS,ZP,ZO)=""
1473"RTN","C0XF2N",502,0)
1474 . S ^C0X(101,"SOP",ZS,ZO,ZP)=""
1475"RTN","C0XF2N",503,0)
1476 . S ^C0X(101,"OPS",ZO,ZP,ZS)=""
1477"RTN","C0XF2N",504,0)
1478 . S ^C0X(101,"OSP",ZO,ZS,ZP)=""
1479"RTN","C0XF2N",505,0)
1480 . S ^C0X(101,"GOPS",ZG,ZO,ZP,ZS)=""
1481"RTN","C0XF2N",506,0)
1482 . S ^C0X(101,"GOSP",ZG,ZO,ZS,ZP)=""
1483"RTN","C0XF2N",507,0)
1484 . S ^C0X(101,"GPSO",ZG,ZP,ZS,ZO)=""
1485"RTN","C0XF2N",508,0)
1486 . S ^C0X(101,"GSPO",ZG,ZS,ZP,ZO)=""
1487"RTN","C0XF2N",509,0)
1488 Q
1489"RTN","C0XF2N",510,0)
1490 ;
1491"RTN","C0XF2N",511,0)
1492BLKERR ;
1493"RTN","C0XF2N",512,0)
1494 W !,"ERROR IN BULK LOAD",! ZWR ZBFDA(ZI)
1495"RTN","C0XF2N",513,0)
1496 B
1497"RTN","C0XF2N",514,0)
1498 Q
1499"RTN","C0XF2N",515,0)
1500 ;
1501"RTN","C0XF2N",516,0)
1502SWUPDIE(ZFDA) ; SWITCH BETWEEN UPDIE AND BULKLOAD
1503"RTN","C0XF2N",517,0)
1504 . I $G(BLKLOAD) D ; bulk load
1505"RTN","C0XF2N",518,0)
1506 . . D BULKLOAD(.ZFDA) ; bulk load the batch
1507"RTN","C0XF2N",519,0)
1508 . E D ; no bulk load
1509"RTN","C0XF2N",520,0)
1510 . . D UPDIE(.ZFDA)
1511"RTN","C0XF2N",521,0)
1512 . K ZFDA
1513"RTN","C0XF2N",522,0)
1514 Q
1515"RTN","C0XF2N",523,0)
1516 ;
1517"RTN","C0XF2N",524,0)
1518UPDIE(ZFDA) ; INTERNAL ROUTINE TO CALL UPDATE^DIE AND CHECK FOR ERRORS
1519"RTN","C0XF2N",525,0)
1520 ; ZFDA IS PASSED BY REFERENCE
1521"RTN","C0XF2N",526,0)
1522 ;ZWR ZFDA
1523"RTN","C0XF2N",527,0)
1524 ;B
1525"RTN","C0XF2N",528,0)
1526 K ZERR
1527"RTN","C0XF2N",529,0)
1528 D CLEAN^DILF
1529"RTN","C0XF2N",530,0)
1530 D UPDATE^DIE("","ZFDA","","ZERR")
1531"RTN","C0XF2N",531,0)
1532 I $D(ZERR) S ZZERR=ZZERR ; ZZERR DOESN'T EXIST,
1533"RTN","C0XF2N",532,0)
1534 ; INVOKE THE ERROR TRAP IF TASKED
1535"RTN","C0XF2N",533,0)
1536 ;. W "ERROR",!
1537"RTN","C0XF2N",534,0)
1538 ;. ZWR ZERR
1539"RTN","C0XF2N",535,0)
1540 ;. B
1541"RTN","C0XF2N",536,0)
1542 K ZFDA
1543"RTN","C0XF2N",537,0)
1544 Q
1545"RTN","C0XF2N",538,0)
1546 ;
1547"RTN","C0XINIT")
15480^4^B20874536
1549"RTN","C0XINIT",1,0)
1550C0XINIT ; GPL - Fileman Triples initialization routine ;10/13/11 17:05
1551"RTN","C0XINIT",2,0)
1552 ;;0.1;C0X;nopatch;noreleasedate;Build 6
1553"RTN","C0XINIT",3,0)
1554 ;Copyright 2011 George Lilly. Licensed under the terms of the GNU
1555"RTN","C0XINIT",4,0)
1556 ;General Public License See attached copy of the License.
1557"RTN","C0XINIT",5,0)
1558 ;
1559"RTN","C0XINIT",6,0)
1560 ;This program is free software; you can redistribute it and/or modify
1561"RTN","C0XINIT",7,0)
1562 ;it under the terms of the GNU General Public License as published by
1563"RTN","C0XINIT",8,0)
1564 ;the Free Software Foundation; either version 2 of the License, or
1565"RTN","C0XINIT",9,0)
1566 ;(at your option) any later version.
1567"RTN","C0XINIT",10,0)
1568 ;
1569"RTN","C0XINIT",11,0)
1570 ;This program is distributed in the hope that it will be useful,
1571"RTN","C0XINIT",12,0)
1572 ;but WITHOUT ANY WARRANTY; without even the implied warranty of
1573"RTN","C0XINIT",13,0)
1574 ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1575"RTN","C0XINIT",14,0)
1576 ;GNU General Public License for more details.
1577"RTN","C0XINIT",15,0)
1578 ;
1579"RTN","C0XINIT",16,0)
1580 ;You should have received a copy of the GNU General Public License along
1581"RTN","C0XINIT",17,0)
1582 ;with this program; if not, write to the Free Software Foundation, Inc.,
1583"RTN","C0XINIT",18,0)
1584 ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1585"RTN","C0XINIT",19,0)
1586 ;
1587"RTN","C0XINIT",20,0)
1588 Q
1589"RTN","C0XINIT",21,0)
1590 ;
1591"RTN","C0XINIT",22,0)
1592CLEAR ; DELETE THE FILESTORE
1593"RTN","C0XINIT",23,0)
1594 K ^C0X
1595"RTN","C0XINIT",24,0)
1596 S ^C0X(101,0)="C0X TRIPLE^172.101I^^"
1597"RTN","C0XINIT",25,0)
1598 S ^C0X(201,0)="C0X STRING^172.201I^^"
1599"RTN","C0XINIT",26,0)
1600 Q
1601"RTN","C0XINIT",27,0)
1602 ;
1603"RTN","C0XINIT",28,0)
1604INIT ; INITIALIZE THE TRIPLE STORE - THIS DELETES THE GLOBALS AND
1605"RTN","C0XINIT",29,0)
1606 ; START ALL OVER... USE WITH CAUTION
1607"RTN","C0XINIT",30,0)
1608 ;
1609"RTN","C0XINIT",31,0)
1610 ; -- we should be more sophisticated here.. at least warn the user
1611"RTN","C0XINIT",32,0)
1612 ; -- and give them a chance to cancel
1613"RTN","C0XINIT",33,0)
1614 ;
1615"RTN","C0XINIT",34,0)
1616 D CLEAR ; DELETE THE TRIPLESTORE
1617"RTN","C0XINIT",35,0)
1618 ;
1619"RTN","C0XINIT",36,0)
1620 ; -- we are assuming that FARY is set up properly in C0XF2N
1621"RTN","C0XINIT",37,0)
1622 ; -- with repect to the default directory and the defaut fileman files
1623"RTN","C0XINIT",38,0)
1624 ; -- here's what it is now: "/home/glilly/fmts/trunk/samples/"
1625"RTN","C0XINIT",39,0)
1626 ; -- that means that all the sample files will look like:
1627"RTN","C0XINIT",40,0)
1628 ; --- qds/QDS_0001.rdf
1629"RTN","C0XINIT",41,0)
1630 ; --- smart-rdf-in/small.rdf
1631"RTN","C0XINIT",42,0)
1632 ;
1633"RTN","C0XINIT",43,0)
1634 S FARY="C0XFARY"
1635"RTN","C0XINIT",44,0)
1636 D INITFARY^C0XF2N(FARY)
1637"RTN","C0XINIT",45,0)
1638 D USEFARY^C0XF2N(FARY)
1639"RTN","C0XINIT",46,0)
1640 S C0XFARY("C0XDIR")="/home/glilly/fmts/trunk/samples/smart-rdf-in/" ;
1641"RTN","C0XINIT",47,0)
1642 D USEFARY^C0XF2N(FARY)
1643"RTN","C0XINIT",48,0)
1644 S SMART(1)="cole-susan.rdf"
1645"RTN","C0XINIT",49,0)
1646 S SMART(2)="jones-cynthia.rdf"
1647"RTN","C0XINIT",50,0)
1648 S SMART(3)="small.rdf"
1649"RTN","C0XINIT",51,0)
1650 S SMART(4)="collins-frank.rdf"
1651"RTN","C0XINIT",52,0)
1652 S SMART(5)="kelly-david.rdf"
1653"RTN","C0XINIT",53,0)
1654 S SMART(6)="smith-maria.rdf"
1655"RTN","C0XINIT",54,0)
1656 S SMART(7)="ford-shirley.rdf"
1657"RTN","C0XINIT",55,0)
1658 S SMART(8)="morgan-jason.rdf"
1659"RTN","C0XINIT",56,0)
1660 S SMART(9)="west-lisa.rdf"
1661"RTN","C0XINIT",57,0)
1662 S SMART(10)="gracia-paul.rdf"
1663"RTN","C0XINIT",58,0)
1664 S SMART(11)="reed-richard.rdf"
1665"RTN","C0XINIT",59,0)
1666 S SMART(12)="west-sandra.rdf"
1667"RTN","C0XINIT",60,0)
1668 S SMART(13)="jackson-jessica.rdf"
1669"RTN","C0XINIT",61,0)
1670 S SMART(14)="small-allergies.rdf"
1671"RTN","C0XINIT",62,0)
1672 S SMART(15)="white-patricia.rdf"
1673"RTN","C0XINIT",63,0)
1674 N ZI S ZI=""
1675"RTN","C0XINIT",64,0)
1676 F S ZI=$O(SMART(ZI)) Q:ZI="" D ; for each smart file
1677"RTN","C0XINIT",65,0)
1678 . D IMPORT^C0XF2N(SMART(ZI),C0XDIR,,FARY) ; import to the triplestore
1679"RTN","C0XINIT",66,0)
1680 S FARY="C0XFARY"
1681"RTN","C0XINIT",67,0)
1682 S C0XFARY("C0XDIR")="/home/glilly/fmts/trunk/samples/qds/"
1683"RTN","C0XINIT",68,0)
1684 D USEFARY^C0XF2N(FARY)
1685"RTN","C0XINIT",69,0)
1686 D IMPORT^C0XF2N("QDS_0001.rdf",C0XDIR,,FARY)
1687"RTN","C0XINIT",70,0)
1688 D IMPORT^C0XF2N("QDS_0028b.rdf",C0XDIR,,FARY)
1689"RTN","C0XINIT",71,0)
1690 D IMPORT^C0XF2N("QDS_0052.rdf",C0XDIR,,FARY)
1691"RTN","C0XINIT",72,0)
1692 D IMPORT^C0XF2N("QDS_0073.rdf",C0XDIR,,FARY)
1693"RTN","C0XINIT",73,0)
1694 D IMPORT^C0XF2N("QDS_0385.rdf",C0XDIR,,FARY)
1695"RTN","C0XINIT",74,0)
1696 D IMPORT^C0XF2N("QDS_0002.rdf",C0XDIR,,FARY)
1697"RTN","C0XINIT",75,0)
1698 D IMPORT^C0XF2N("QDS_0031.rdf",C0XDIR,,FARY)
1699"RTN","C0XINIT",76,0)
1700 D IMPORT^C0XF2N("QDS_0055.rdf",C0XDIR,,FARY)
1701"RTN","C0XINIT",77,0)
1702 D IMPORT^C0XF2N("QDS_0074.rdf",C0XDIR,,FARY)
1703"RTN","C0XINIT",78,0)
1704 D IMPORT^C0XF2N("QDS_0387.rdf",C0XDIR,,FARY)
1705"RTN","C0XINIT",79,0)
1706 D IMPORT^C0XF2N("QDS_0004.rdf",C0XDIR,,FARY)
1707"RTN","C0XINIT",80,0)
1708 D IMPORT^C0XF2N("QDS_0032.rdf",C0XDIR,,FARY)
1709"RTN","C0XINIT",81,0)
1710 D IMPORT^C0XF2N("QDS_0056.rdf",C0XDIR,,FARY)
1711"RTN","C0XINIT",82,0)
1712 D IMPORT^C0XF2N("QDS_0075.rdf",C0XDIR,,FARY)
1713"RTN","C0XINIT",83,0)
1714 D IMPORT^C0XF2N("QDS_0389.rdf",C0XDIR,,FARY)
1715"RTN","C0XINIT",84,0)
1716 D IMPORT^C0XF2N("QDS_0012.rdf",C0XDIR,,FARY)
1717"RTN","C0XINIT",85,0)
1718 D IMPORT^C0XF2N("QDS_0033.rdf",C0XDIR,,FARY)
1719"RTN","C0XINIT",86,0)
1720 D IMPORT^C0XF2N("QDS_0059.rdf",C0XDIR,,FARY)
1721"RTN","C0XINIT",87,0)
1722 D IMPORT^C0XF2N("QDS_0081.rdf",C0XDIR,,FARY)
1723"RTN","C0XINIT",88,0)
1724 D IMPORT^C0XF2N("QDS_0421.rdf",C0XDIR,,FARY)
1725"RTN","C0XINIT",89,0)
1726 D IMPORT^C0XF2N("QDS_0013.rdf",C0XDIR,,FARY)
1727"RTN","C0XINIT",90,0)
1728 D IMPORT^C0XF2N("QDS_0034.rdf",C0XDIR,,FARY)
1729"RTN","C0XINIT",91,0)
1730 D IMPORT^C0XF2N("QDS_0061.rdf",C0XDIR,,FARY)
1731"RTN","C0XINIT",92,0)
1732 D IMPORT^C0XF2N("QDS_0083.rdf",C0XDIR,,FARY)
1733"RTN","C0XINIT",93,0)
1734 D IMPORT^C0XF2N("QDS_0575.rdf",C0XDIR,,FARY)
1735"RTN","C0XINIT",94,0)
1736 D IMPORT^C0XF2N("QDS_0014.rdf",C0XDIR,,FARY)
1737"RTN","C0XINIT",95,0)
1738 D IMPORT^C0XF2N("QDS_0036.rdf",C0XDIR,,FARY)
1739"RTN","C0XINIT",96,0)
1740 D IMPORT^C0XF2N("QDS_0062.rdf",C0XDIR,,FARY)
1741"RTN","C0XINIT",97,0)
1742 D IMPORT^C0XF2N("QDS_0084.rdf",C0XDIR,,FARY)
1743"RTN","C0XINIT",98,0)
1744 D IMPORT^C0XF2N("QDS_0018.rdf",C0XDIR,,FARY)
1745"RTN","C0XINIT",99,0)
1746 D IMPORT^C0XF2N("QDS_0038.rdf",C0XDIR,,FARY)
1747"RTN","C0XINIT",100,0)
1748 D IMPORT^C0XF2N("QDS_0064.rdf",C0XDIR,,FARY)
1749"RTN","C0XINIT",101,0)
1750 D IMPORT^C0XF2N("QDS_0086.rdf",C0XDIR,,FARY)
1751"RTN","C0XINIT",102,0)
1752 D IMPORT^C0XF2N("QDS_0024.rdf",C0XDIR,,FARY)
1753"RTN","C0XINIT",103,0)
1754 D IMPORT^C0XF2N("QDS_0041.rdf",C0XDIR,,FARY)
1755"RTN","C0XINIT",104,0)
1756 D IMPORT^C0XF2N("QDS_0067.rdf",C0XDIR,,FARY)
1757"RTN","C0XINIT",105,0)
1758 D IMPORT^C0XF2N("QDS_0088.rdf",C0XDIR,,FARY)
1759"RTN","C0XINIT",106,0)
1760 D IMPORT^C0XF2N("QDS_0027.rdf",C0XDIR,,FARY)
1761"RTN","C0XINIT",107,0)
1762 D IMPORT^C0XF2N("QDS_0043.rdf",C0XDIR,,FARY)
1763"RTN","C0XINIT",108,0)
1764 D IMPORT^C0XF2N("QDS_0068.rdf",C0XDIR,,FARY)
1765"RTN","C0XINIT",109,0)
1766 D IMPORT^C0XF2N("QDS_0089.rdf",C0XDIR,,FARY)
1767"RTN","C0XINIT",110,0)
1768 D IMPORT^C0XF2N("QDS_0028a.rdf",C0XDIR,,FARY)
1769"RTN","C0XINIT",111,0)
1770 D IMPORT^C0XF2N("QDS_0047.rdf",C0XDIR,,FARY)
1771"RTN","C0XINIT",112,0)
1772 D IMPORT^C0XF2N("QDS_0070.rdf",C0XDIR,,FARY)
1773"RTN","C0XINIT",113,0)
1774 D IMPORT^C0XF2N("QDS_0105.rdf",C0XDIR,,FARY)
1775"RTN","C0XINIT",114,0)
1776 ;D IMPORT^C0XF2N("qds.rdf",C0XDIR,,FARY)
1777"RTN","C0XINIT",115,0)
1778 Q
1779"RTN","C0XINIT",116,0)
1780 ;
1781"RTN","C0XMAIN")
17820^1^B115393527
1783"RTN","C0XMAIN",1,0)
1784C0XMAIN ; GPL - Fileman Triples entry point routine ;10/13/11 17:05
1785"RTN","C0XMAIN",2,0)
1786 ;;0.1;C0X;nopatch;noreleasedate;Build 6
1787"RTN","C0XMAIN",3,0)
1788 ;Copyright 2011 George Lilly. Licensed under the terms of the GNU
1789"RTN","C0XMAIN",4,0)
1790 ;General Public License See attached copy of the License.
1791"RTN","C0XMAIN",5,0)
1792 ;
1793"RTN","C0XMAIN",6,0)
1794 ;This program is free software; you can redistribute it and/or modify
1795"RTN","C0XMAIN",7,0)
1796 ;it under the terms of the GNU General Public License as published by
1797"RTN","C0XMAIN",8,0)
1798 ;the Free Software Foundation; either version 2 of the License, or
1799"RTN","C0XMAIN",9,0)
1800 ;(at your option) any later version.
1801"RTN","C0XMAIN",10,0)
1802 ;
1803"RTN","C0XMAIN",11,0)
1804 ;This program is distributed in the hope that it will be useful,
1805"RTN","C0XMAIN",12,0)
1806 ;but WITHOUT ANY WARRANTY; without even the implied warranty of
1807"RTN","C0XMAIN",13,0)
1808 ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1809"RTN","C0XMAIN",14,0)
1810 ;GNU General Public License for more details.
1811"RTN","C0XMAIN",15,0)
1812 ;
1813"RTN","C0XMAIN",16,0)
1814 ;You should have received a copy of the GNU General Public License along
1815"RTN","C0XMAIN",17,0)
1816 ;with this program; if not, write to the Free Software Foundation, Inc.,
1817"RTN","C0XMAIN",18,0)
1818 ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1819"RTN","C0XMAIN",19,0)
1820 ;
1821"RTN","C0XMAIN",20,0)
1822 Q
1823"RTN","C0XMAIN",21,0)
1824 ;
1825"RTN","C0XMAIN",22,0)
1826INITFARY(ZFARY) ; INITIALIZE FILE NUMBERS AND OTHER USEFUL THINGS
1827"RTN","C0XMAIN",23,0)
1828 ; FOR THE DEFAULT TRIPLE STORE. USE OTHER VALUES FOR SUPPORTING ADDITIONAL
1829"RTN","C0XMAIN",24,0)
1830 ; TRIPLE STORES
1831"RTN","C0XMAIN",25,0)
1832 S @ZFARY@("C0XTFN")=172.101 ; TRIPLES FILE NUMBER
1833"RTN","C0XMAIN",26,0)
1834 S @ZFARY@("C0XSFN")=172.201 ; TRIPLES STRINGS FILE NUMBER
1835"RTN","C0XMAIN",27,0)
1836 S @ZFARY@("C0XTN")=$NA(^C0X(101)) ; TRIPLES GLOBAL NAME
1837"RTN","C0XMAIN",28,0)
1838 S @ZFARY@("C0XSN")=$NA(^C0X(201)) ; STRING FILE GLOBAL NAME
1839"RTN","C0XMAIN",29,0)
1840 ;S @ZFARY@("C0XDIR")="/home/glilly/all_smart_patient_data/smart-rdf/"
1841"RTN","C0XMAIN",30,0)
1842 S @ZFARY@("C0XDIR")="/home/george/fmts/trunk/samples/"
1843"RTN","C0XMAIN",31,0)
1844 D USEFARY(ZFARY)
1845"RTN","C0XMAIN",32,0)
1846 Q
1847"RTN","C0XMAIN",33,0)
1848 ;
1849"RTN","C0XMAIN",34,0)
1850USEFARY(ZFARY) ; INITIALIZES VARIABLES SAVED IN ARRAY ZFARY
1851"RTN","C0XMAIN",35,0)
1852 N ZI S ZI=""
1853"RTN","C0XMAIN",36,0)
1854 F S ZI=$O(@ZFARY@(ZI)) Q:ZI="" D
1855"RTN","C0XMAIN",37,0)
1856 . ;N ZX
1857"RTN","C0XMAIN",38,0)
1858 . S ZX="S "_ZI_"="""_@ZFARY@(ZI)_""""
1859"RTN","C0XMAIN",39,0)
1860 . ;W !,ZX
1861"RTN","C0XMAIN",40,0)
1862 . X ZX
1863"RTN","C0XMAIN",41,0)
1864 Q
1865"RTN","C0XMAIN",42,0)
1866 ;
1867"RTN","C0XMAIN",43,0)
1868IMPORT(FNAME,FDIR,FURL,FARY) ; EXTRINSIC THAT READS A FILE FROM THE STANDARD
1869"RTN","C0XMAIN",44,0)
1870 ; DIRECTORY, LOADS IT INTO THE TRIPLESTORE AS TEXT, AND RETURNS THE
1871"RTN","C0XMAIN",45,0)
1872 ; NODE NAME OF THE TEXT TRIPLE
1873"RTN","C0XMAIN",46,0)
1874 ; FDIR IS THE OPTIONAL DIRECTORY (DEFAUTS TO STANDARD DIR)
1875"RTN","C0XMAIN",47,0)
1876 ; FURL IS THE OPTIONAL URI FOR ACCESSING THE FILE FROM THE TRIPLE STORE
1877"RTN","C0XMAIN",48,0)
1878 ; FARY IS THE OPTIONAL FILE ARRAY OF THE TRIPLE STORE TO USE
1879"RTN","C0XMAIN",49,0)
1880 I '$D(FARY) D ;
1881"RTN","C0XMAIN",50,0)
1882 . D INITFARY("C0XFARY")
1883"RTN","C0XMAIN",51,0)
1884 . S FARY="C0XFARY"
1885"RTN","C0XMAIN",52,0)
1886 D USEFARY(FARY)
1887"RTN","C0XMAIN",53,0)
1888 N ZD,ZTMP
1889"RTN","C0XMAIN",54,0)
1890 I '$D(FDIR) S FDIR=C0XDIR ; DIRECTORY OF THE RDF FILE
1891"RTN","C0XMAIN",55,0)
1892 I '$D(FURL) D ;
1893"RTN","C0XMAIN",56,0)
1894 . N ZN2 S ZN2=$TR(FNAME,".","_") ; REMOVE THE DOT FROM THE NAME
1895"RTN","C0XMAIN",57,0)
1896 . S FURL=FDIR_ZN2
1897"RTN","C0XMAIN",58,0)
1898 N ZTMP
1899"RTN","C0XMAIN",59,0)
1900 S ZTMP=$NA(^TMP("C0X",$J,"FILEIN",1)) ; WHERE TO PUT THE INCOMING FILE
1901"RTN","C0XMAIN",60,0)
1902 K @ZTMP ; MAKE SURE IT'S CLEAR
1903"RTN","C0XMAIN",61,0)
1904 S C0XSTART=$$NOW^XLFDT
1905"RTN","C0XMAIN",62,0)
1906 W !,"STARTED: ",C0XSTART
1907"RTN","C0XMAIN",63,0)
1908 W !,"READING IN: ",FNAME
1909"RTN","C0XMAIN",64,0)
1910 I '$$FILEIN(ZTMP,FDIR,FNAME,4) D Q ; QUIT IF NO SUCCESS
1911"RTN","C0XMAIN",65,0)
1912 . W !,"ERROR READING FILE: ",FDIR,FNAME
1913"RTN","C0XMAIN",66,0)
1914 S ZRDF=$NA(^TMP("C0X",$J,"FILEIN")) ; WITHOUT THE SUBSCRIPT
1915"RTN","C0XMAIN",67,0)
1916 W !,$O(@ZRDF@(""),-1)," LINES READ"
1917"RTN","C0XMAIN",68,0)
1918 D INSRDF(ZRDF,FURL,FARY) ; IMPORT AND PROCESS THE RDF
1919"RTN","C0XMAIN",69,0)
1920 Q
1921"RTN","C0XMAIN",70,0)
1922 ;
1923"RTN","C0XMAIN",71,0)
1924WGET(ZURL,FARY) ; GET FROM THE INTERNET AN RDF FILE AND INSERT IT
1925"RTN","C0XMAIN",72,0)
1926 ;
1927"RTN","C0XMAIN",73,0)
1928 I '$D(FARY) D ;
1929"RTN","C0XMAIN",74,0)
1930 . D INITFARY("C0XFARY")
1931"RTN","C0XMAIN",75,0)
1932 . S FARY="C0XFARY"
1933"RTN","C0XMAIN",76,0)
1934 D USEFARY(FARY)
1935"RTN","C0XMAIN",77,0)
1936 ;N ZLOC,ZTMP
1937"RTN","C0XMAIN",78,0)
1938 K ZTMP
1939"RTN","C0XMAIN",79,0)
1940 S ZLOC=$NA(^TMP("C0X","WGET",$J))
1941"RTN","C0XMAIN",80,0)
1942 S C0XSTART=$$NOW^XLFDT
1943"RTN","C0XMAIN",81,0)
1944 W !,"STARTED: ",C0XSTART
1945"RTN","C0XMAIN",82,0)
1946 W !,"DOWNLOADING: ",ZURL
1947"RTN","C0XMAIN",83,0)
1948 S OK=$$httpGET^%zewdGTM(ZURL,.ZTMP)
1949"RTN","C0XMAIN",84,0)
1950 M @ZLOC=ZTMP
1951"RTN","C0XMAIN",85,0)
1952 W !,$O(@ZLOC@(""),-1)," LINES READ"
1953"RTN","C0XMAIN",86,0)
1954 D INSRDF(ZLOC,ZURL,FARY)
1955"RTN","C0XMAIN",87,0)
1956 Q
1957"RTN","C0XMAIN",88,0)
1958 ;
1959"RTN","C0XMAIN",89,0)
1960INSRDF(ZRDF,ZNAME,FARY) ; INSERT AN RDF FILE INTO THE STORE AND PROCESS
1961"RTN","C0XMAIN",90,0)
1962 ; ZRDF IS PASSED BY NAME
1963"RTN","C0XMAIN",91,0)
1964 I '$D(FARY) D ;
1965"RTN","C0XMAIN",92,0)
1966 . D INITFARY("C0XFARY")
1967"RTN","C0XMAIN",93,0)
1968 . S FARY="C0XFARY"
1969"RTN","C0XMAIN",94,0)
1970 D USEFARY(FARY)
1971"RTN","C0XMAIN",95,0)
1972 N ZGRAPH,ZSUBJECT
1973"RTN","C0XMAIN",96,0)
1974 S ZGRAPH="_:G"_$$LKY9 ; RANDOM GRAPH NAME
1975"RTN","C0XMAIN",97,0)
1976 S ZSUBJECT=$$ANONS ; RANDOM ANOYMOUS SUBJECT
1977"RTN","C0XMAIN",98,0)
1978 D ADD(ZGRAPH,ZSUBJECT,"fmts:url",ZNAME,FARY)
1979"RTN","C0XMAIN",99,0)
1980 N ZTXTNM
1981"RTN","C0XMAIN",100,0)
1982 S ZTXTNM="_TXT_INCOMING_RDF_FILE_"_ZNAME_"_"_$$LKY9 ; NAME FOR TEXT NODE
1983"RTN","C0XMAIN",101,0)
1984 D ADD(ZGRAPH,ZSUBJECT,"fmts:rdfSource",ZTXTNM,FARY)
1985"RTN","C0XMAIN",102,0)
1986 D UPDIE(.C0XFDA) ; TRY IT OUT
1987"RTN","C0XMAIN",103,0)
1988 K C0XCNT ;RESET FOR NEXT TIME
1989"RTN","C0XMAIN",104,0)
1990 D STORETXT(ZRDF,ZTXTNM,FARY)
1991"RTN","C0XMAIN",105,0)
1992 W !,"ADDED: ",ZGRAPH," ",ZSUBJECT," fmts:rdfSource ",ZTXTNM
1993"RTN","C0XMAIN",106,0)
1994 D PROCESS(.G,ZRDF,ZNAME,ZGRAPH,FARY) ; PARSE AND INSERT THE RDF
1995"RTN","C0XMAIN",107,0)
1996 Q
1997"RTN","C0XMAIN",108,0)
1998 ;
1999"RTN","C0XMAIN",109,0)
2000STORETXT(ZTXT,ZNAME,FARY) ; STORE TEXT IN THE TRIPLESTORE AT ZNAME
2001"RTN","C0XMAIN",110,0)
2002 ;
2003"RTN","C0XMAIN",111,0)
2004 I '$D(FARY) D ;
2005"RTN","C0XMAIN",112,0)
2006 . D INITFARY("C0XFARY")
2007"RTN","C0XMAIN",113,0)
2008 . S FARY="C0XFARY"
2009"RTN","C0XMAIN",114,0)
2010 D USEFARY(FARY)
2011"RTN","C0XMAIN",115,0)
2012 N ZIEN
2013"RTN","C0XMAIN",116,0)
2014 S ZIEN=$$IENOF(ZNAME,FARY) ; GET THE IEN
2015"RTN","C0XMAIN",117,0)
2016 D CLEAN^DILF
2017"RTN","C0XMAIN",118,0)
2018 K ZERR
2019"RTN","C0XMAIN",119,0)
2020 D WP^DIE(C0XSFN,ZIEN_",",1,,ZTXT,"ZERR")
2021"RTN","C0XMAIN",120,0)
2022 I $D(ZERR) D ;
2023"RTN","C0XMAIN",121,0)
2024 . ZWR ZERR
2025"RTN","C0XMAIN",122,0)
2026 Q
2027"RTN","C0XMAIN",123,0)
2028 ;
2029"RTN","C0XMAIN",124,0)
2030GETTXT(ZRTN,ZNAME,FARY) ; RETURNS RDF SOURCE OR OTHER TEXT
2031"RTN","C0XMAIN",125,0)
2032 ; ZRTN IS PASSED BY REFERENCE
2033"RTN","C0XMAIN",126,0)
2034 I '$D(FARY) D ;
2035"RTN","C0XMAIN",127,0)
2036 . D INITFARY("C0XFARY")
2037"RTN","C0XMAIN",128,0)
2038 . S FARY="C0XFARY"
2039"RTN","C0XMAIN",129,0)
2040 D USEFARY(FARY)
2041"RTN","C0XMAIN",130,0)
2042 N ZIEN
2043"RTN","C0XMAIN",131,0)
2044 S ZIEN=$$IENOF(ZNAME)
2045"RTN","C0XMAIN",132,0)
2046 S OK=$$GET1^DIQ(C0XSFN,ZIEN_",",1,,"ZRTN")
2047"RTN","C0XMAIN",133,0)
2048 Q
2049"RTN","C0XMAIN",134,0)
2050 ;
2051"RTN","C0XMAIN",135,0)
2052WHERETXT(ZNAME,FARY) ; EXTRINSIC WHICH RETURNS THE NAME OF THE GLOBAL
2053"RTN","C0XMAIN",136,0)
2054 ; WHERE THE TEXT IS LOCATED. NAME IS THE NAME OF THE STRING
2055"RTN","C0XMAIN",137,0)
2056 I '$D(FARY) D ;
2057"RTN","C0XMAIN",138,0)
2058 . D INITFARY("C0XFARY")
2059"RTN","C0XMAIN",139,0)
2060 . S FARY="C0XFARY"
2061"RTN","C0XMAIN",140,0)
2062 D USEFARY(FARY)
2063"RTN","C0XMAIN",141,0)
2064 N ZIEN
2065"RTN","C0XMAIN",142,0)
2066 S ZIEN=$$IENOF(ZNAME)
2067"RTN","C0XMAIN",143,0)
2068 Q $NA(@C0XSN@(ZIEN,1))
2069"RTN","C0XMAIN",144,0)
2070 ;
2071"RTN","C0XMAIN",145,0)
2072FILEIN(ZINTMP,ZDIR,ZFNAME,ZLVL) ; READS A FILE INTO ZINTMP USING FTG^%ZISH
2073"RTN","C0XMAIN",146,0)
2074 ; ZINTMP IS PASSED BY NAME AND INCLUDES THE NEW SUBSCRIPT
2075"RTN","C0XMAIN",147,0)
2076 ; IE ^TMP("C0X","FILEIN",1)
2077"RTN","C0XMAIN",148,0)
2078 ; ZLVL IN THIS CASE WOULD BE 3 INCREMENTING THE 1
2079"RTN","C0XMAIN",149,0)
2080 ; EXTRINSIC WHICH RETURNS THE RESULT OF FTG^%ZISH
2081"RTN","C0XMAIN",150,0)
2082 S OK=$$FTG^%ZISH(ZDIR,FNAME,ZINTMP,ZLVL)
2083"RTN","C0XMAIN",151,0)
2084 Q OK
2085"RTN","C0XMAIN",152,0)
2086 ;
2087"RTN","C0XMAIN",153,0)
2088TESTPROC ; TEST PROCESS WITH EXISTING SMALL RDF FILE
2089"RTN","C0XMAIN",154,0)
2090 S ZIN=$NA(^TMP("C0X",12226,"FILEIN"))
2091"RTN","C0XMAIN",155,0)
2092 S ZGRAPH="/test/rdfFile"
2093"RTN","C0XMAIN",156,0)
2094 S ZM="/test/rdfFile/meta"
2095"RTN","C0XMAIN",157,0)
2096 D PROCESS(.G,ZIN,ZGRAPH,ZM)
2097"RTN","C0XMAIN",158,0)
2098 Q
2099"RTN","C0XMAIN",159,0)
2100 ;
2101"RTN","C0XMAIN",160,0)
2102PROCESS(ZRTN,ZRDF,ZGRF,ZMETA,FARY) ; PROCESS AN INCOMING RDF FILE
2103"RTN","C0XMAIN",161,0)
2104 ; ZRTN IS PASS BY REFERENCE AND RETURNS MESSAGES ABOUT THE PROCESSING
2105"RTN","C0XMAIN",162,0)
2106 ; ZRDF IS PASSED BY NAME AND IS THE GLOBAL CONTAINING THE RDF FILE
2107"RTN","C0XMAIN",163,0)
2108 ; ZGRF IS THE NAME OF THE GRAPH TO USE IN THE TRIPLE STORE FOR RESULTS
2109"RTN","C0XMAIN",164,0)
2110 ; ZMETA IS OPTIONAL AND IS THE NAME OF THE GRAPH TO STORE METADATA
2111"RTN","C0XMAIN",165,0)
2112 ;
2113"RTN","C0XMAIN",166,0)
2114 I '$D(FARY) D ;
2115"RTN","C0XMAIN",167,0)
2116 . D INITFARY("C0XFARY")
2117"RTN","C0XMAIN",168,0)
2118 . S FARY="C0XFARY"
2119"RTN","C0XMAIN",169,0)
2120 D USEFARY(FARY)
2121"RTN","C0XMAIN",170,0)
2122 ; -- first parse the rdf file with the MXML parser
2123"RTN","C0XMAIN",171,0)
2124 ;S C0XDOCID=$$PARSE^C0CNHIN(ZRDF,"C0XARRAY") ; PARSE WITH MXML
2125"RTN","C0XMAIN",172,0)
2126 S C0XDOCID=$$EN^MXMLDOM(ZRDF,"W")
2127"RTN","C0XMAIN",173,0)
2128 ; -- assign the MXLM dom global name to ZDOM
2129"RTN","C0XMAIN",174,0)
2130 S ZDOM=$NA(^TMP("MXMLDOM",$J,C0XDOCID))
2131"RTN","C0XMAIN",175,0)
2132 W !,$O(@ZDOM@(""),-1)," XML NODES PARSED"
2133"RTN","C0XMAIN",176,0)
2134 ; -- populate the metagraph to point to the graph with status unfinished
2135"RTN","C0XMAIN",177,0)
2136 S METAS=$$ANONS ; GET AN ANONOMOUS RANDOM SUBJECT
2137"RTN","C0XMAIN",178,0)
2138 I '$D(ZMETA) S ZMETA="_:G"_$$LKY9 ; RANDOM GRAPH NAME FOR METAGRAPH
2139"RTN","C0XMAIN",179,0)
2140 D ADD(ZMETA,METAS,"fmts:about",ZGRF,FARY) ; POINT THE META TO THE GRAPH
2141"RTN","C0XMAIN",180,0)
2142 D ADD(ZMETA,METAS,"fmts:status","unfinished",FARY) ; mark as unfinished
2143"RTN","C0XMAIN",181,0)
2144 ;S C0XDATE=$$FMDTOUTC^C0CUTIL($$NOW^XLFDT,"DT")
2145"RTN","C0XMAIN",182,0)
2146 S C0XDATE=$$NOW^XLFDT
2147"RTN","C0XMAIN",183,0)
2148 D ADD(ZMETA,METAS,"fmts:dateTime",C0XDATE,FARY)
2149"RTN","C0XMAIN",184,0)
2150 D UPDIE(.C0XFDA) ; commit the metagraph changes to the triple store
2151"RTN","C0XMAIN",185,0)
2152 ; --
2153"RTN","C0XMAIN",186,0)
2154 ; -- pull out the vocabularies in the RDF statement. marked with xmlns:
2155"RTN","C0XMAIN",187,0)
2156 ; -- put them in a local variable for quick reference
2157"RTN","C0XMAIN",188,0)
2158 ; -- TODO: create a graph for vocabularies and validate incoming against it
2159"RTN","C0XMAIN",189,0)
2160 ;
2161"RTN","C0XMAIN",190,0)
2162 S C0XVOC=""
2163"RTN","C0XMAIN",191,0)
2164 N ZI,ZJ,ZK S ZI=""
2165"RTN","C0XMAIN",192,0)
2166 F S ZI=$O(@ZDOM@(1,"A",ZI)) Q:ZI="" D ; FOR EACH xmlns
2167"RTN","C0XMAIN",193,0)
2168 . S ZVOC=$P(ZI,"xmlns:",2)
2169"RTN","C0XMAIN",194,0)
2170 . I ZVOC'="" S C0XVOC(ZVOC)=$G(@ZDOM@(1,"A",ZI))
2171"RTN","C0XMAIN",195,0)
2172 ;W !,"VOCABS:" ZWR C0XVOC
2173"RTN","C0XMAIN",196,0)
2174 ;
2175"RTN","C0XMAIN",197,0)
2176 ; -- look for children called rdf:Description. quit if none. not an rdf file
2177"RTN","C0XMAIN",198,0)
2178 ;
2179"RTN","C0XMAIN",199,0)
2180 S ZI=$O(@ZDOM@(1,"C",""))
2181"RTN","C0XMAIN",200,0)
2182 I $G(@ZDOM@(1,"C",ZI))'="rdf:Description" D Q ; not an rdf file
2183"RTN","C0XMAIN",201,0)
2184 . W !,"Error. Not an RDF file. Cannot process."
2185"RTN","C0XMAIN",202,0)
2186 ;
2187"RTN","C0XMAIN",203,0)
2188 ; -- now process the rdf description children
2189"RTN","C0XMAIN",204,0)
2190 ;
2191"RTN","C0XMAIN",205,0)
2192 S ZI=""
2193"RTN","C0XMAIN",206,0)
2194 S (C0XSUB,C0XPRE,C0XOBJ)="" ; INITIALIZE subject, object and predicate
2195"RTN","C0XMAIN",207,0)
2196 F S ZI=$O(@ZDOM@(1,"C",ZI)) Q:ZI="" D ;
2197"RTN","C0XMAIN",208,0)
2198 . ; -- we are skipping any child that is not rdf:Description
2199"RTN","C0XMAIN",209,0)
2200 . ; -- TODO: check to see if this is right in general
2201"RTN","C0XMAIN",210,0)
2202 . ;
2203"RTN","C0XMAIN",211,0)
2204 . IF $G(@ZDOM@(1,"C",ZI))'="rdf:Description" D Q ;
2205"RTN","C0XMAIN",212,0)
2206 . . W !,"SKIPPING NODE: ",ZI
2207"RTN","C0XMAIN",213,0)
2208 . ; -- now looking for the subject for the triples
2209"RTN","C0XMAIN",214,0)
2210 . S ZX=$G(@ZDOM@(ZI,"A","rdf:about"))
2211"RTN","C0XMAIN",215,0)
2212 . I ZX'="" D ; we have the subject
2213"RTN","C0XMAIN",216,0)
2214 . . ;W " about: ",ZX
2215"RTN","C0XMAIN",217,0)
2216 . . S C0XSUB=ZX
2217"RTN","C0XMAIN",218,0)
2218 . E D ;
2219"RTN","C0XMAIN",219,0)
2220 . . S ZX=$G(@ZDOM@(ZI,"A","rdf:nodeID")) ; node id is another style of subject
2221"RTN","C0XMAIN",220,0)
2222 . . I ZX'="" D ;
2223"RTN","C0XMAIN",221,0)
2224 . . . S C0XSUB=ZX
2225"RTN","C0XMAIN",222,0)
2226 . I C0XSUB="" S C0XSUB=$$ANONS ; DEFAULT TO BLANK SUBJECT
2227"RTN","C0XMAIN",223,0)
2228 . ;
2229"RTN","C0XMAIN",224,0)
2230 . ; -- we now have the subject. the children of this node have the rest
2231"RTN","C0XMAIN",225,0)
2232 . ;
2233"RTN","C0XMAIN",226,0)
2234 . S ZJ="" ; for the children of the rdf:Description nodes
2235"RTN","C0XMAIN",227,0)
2236 . F S ZJ=$O(@ZDOM@(ZI,"C",ZJ)) Q:ZJ="" D ; for each child
2237"RTN","C0XMAIN",228,0)
2238 . . S C0XPRE=@ZDOM@(ZJ) ; the predicate without a prefix
2239"RTN","C0XMAIN",229,0)
2240 . . S ZX=$G(@ZDOM@(ZJ,"A","xmlns")) ; name space
2241"RTN","C0XMAIN",230,0)
2242 . . I ZX'="" S C0XPRE=ZX_C0XPRE ; add the namespace prefix
2243"RTN","C0XMAIN",231,0)
2244 . . I C0XPRE[":" D ; expand using vocabulary
2245"RTN","C0XMAIN",232,0)
2246 . . . N ZB,ZA
2247"RTN","C0XMAIN",233,0)
2248 . . . S ZB=$P(C0XPRE,":",1)
2249"RTN","C0XMAIN",234,0)
2250 . . . S ZA=$P(C0XPRE,":",2)
2251"RTN","C0XMAIN",235,0)
2252 . . . I $G(C0XVOC(ZB))'="" D ;
2253"RTN","C0XMAIN",236,0)
2254 . . . . S C0XPRE=C0XVOC(ZB)_ZA ; expanded
2255"RTN","C0XMAIN",237,0)
2256 . . S ZY=$G(@ZDOM@(ZJ,"A","rdf:resource")) ; potential object
2257"RTN","C0XMAIN",238,0)
2258 . . I ZY'="" D Q ;
2259"RTN","C0XMAIN",239,0)
2260 . . . S C0XOBJ=ZY ; object
2261"RTN","C0XMAIN",240,0)
2262 . . . D ADD(ZGRF,C0XSUB,C0XPRE,C0XOBJ) ; finally. our first real triple
2263"RTN","C0XMAIN",241,0)
2264 . . ; -- this is an else because of the quit above
2265"RTN","C0XMAIN",242,0)
2266 . . S ZX=$G(@ZDOM@(ZJ,"A","rdf:nodeID")) ; fishing for nodeId object
2267"RTN","C0XMAIN",243,0)
2268 . . I ZX'="" D Q ; got one
2269"RTN","C0XMAIN",244,0)
2270 . . . S C0XOBJ=ZX ; we are using the incoming nodeIDs as object/subject
2271"RTN","C0XMAIN",245,0)
2272 . . . ; without change... this could be foolish .. look at it again later
2273"RTN","C0XMAIN",246,0)
2274 . . . D ADD(ZGRF,C0XSUB,C0XPRE,C0XOBJ) ; go for it and add a node
2275"RTN","C0XMAIN",247,0)
2276 . . S C0XOBJ=$G(@ZDOM@(ZJ,"T",1)) ; hopefully an object is here
2277"RTN","C0XMAIN",248,0)
2278 . . I C0XOBJ="" D Q ; not a happy situation
2279"RTN","C0XMAIN",249,0)
2280 . . . W !,"ERROR, NO OBJECT FOUND FOR NODE: ",ZJ
2281"RTN","C0XMAIN",250,0)
2282 . . D ADD(ZGRF,C0XSUB,C0XPRE,C0XOBJ) ; go for it and add a node
2283"RTN","C0XMAIN",251,0)
2284 W !,"INSERTING ",C0XCNT," TRIPLES"
2285"RTN","C0XMAIN",252,0)
2286 D UPDIE(.C0XFDA) ; commit the updates to the file
2287"RTN","C0XMAIN",253,0)
2288 ; next, mark the graph as finished
2289"RTN","C0XMAIN",254,0)
2290 S C0XEND=$$NOW^XLFDT
2291"RTN","C0XMAIN",255,0)
2292 W !," ENDED AT: ",C0XEND
2293"RTN","C0XMAIN",256,0)
2294 S C0XDIFF=$$FMDIFF^XLFDT(C0XEND,C0XSTART,2)
2295"RTN","C0XMAIN",257,0)
2296 W !," ELAPSED TIME: ",C0XDIFF," SECONDS"
2297"RTN","C0XMAIN",258,0)
2298 W !," APPROXIMATELY ",$P(C0XCNT/C0XDIFF,".")," TRIPLES PER SECOND"
2299"RTN","C0XMAIN",259,0)
2300 Q
2301"RTN","C0XMAIN",260,0)
2302 ;
2303"RTN","C0XMAIN",261,0)
2304SHOW(ZN) ;
2305"RTN","C0XMAIN",262,0)
2306 ZWR ^TMP("MXMLDOM",$J,1,ZN,*)
2307"RTN","C0XMAIN",263,0)
2308 Q
2309"RTN","C0XMAIN",264,0)
2310 ;
2311"RTN","C0XMAIN",265,0)
2312ANONS() ; RETURNS AN ANONOMOUS SUBJECT
2313"RTN","C0XMAIN",266,0)
2314 Q "_S:"_$$LKY9
2315"RTN","C0XMAIN",267,0)
2316 ;
2317"RTN","C0XMAIN",268,0)
2318NEWG(NGRAPH,NMETA) ; CREATES A NEW META GRAPH, MARKS IT AS UNFINISHED
2319"RTN","C0XMAIN",269,0)
2320 ; THEN CREATES A NEW GRAPH AND POINTS THE METAGRAPH TO IT
2321"RTN","C0XMAIN",270,0)
2322 ; NGRAPH AND NMETA ARE PASSED BY REFERENCE AND ARE THE RETURN
2323"RTN","C0XMAIN",271,0)
2324 S NGRAPH="G"_$$LKY9
2325"RTN","C0XMAIN",272,0)
2326 S NMETA=NGRAPH_"A"
2327"RTN","C0XMAIN",273,0)
2328 Q
2329"RTN","C0XMAIN",274,0)
2330 ;
2331"RTN","C0XMAIN",275,0)
2332ADD(ZG,ZS,ZP,ZO,FARY) ; ADD A TRIPLE TO THE TRIPLESTORE. ALL VALUES ARE TEXT
2333"RTN","C0XMAIN",276,0)
2334 ; THE FDA IS SET UP BUT THE FILES ARE NOT UPDATED. CALL UPDIE TO COMPLETE
2335"RTN","C0XMAIN",277,0)
2336 I '$D(FARY) D ;
2337"RTN","C0XMAIN",278,0)
2338 . D INITFARY("C0XFARY")
2339"RTN","C0XMAIN",279,0)
2340 . S FARY="C0XFARY"
2341"RTN","C0XMAIN",280,0)
2342 D USEFARY(FARY)
2343"RTN","C0XMAIN",281,0)
2344 I '$D(C0XCNT) S C0XCNT=0
2345"RTN","C0XMAIN",282,0)
2346 N ZNODE
2347"RTN","C0XMAIN",283,0)
2348 S ZNODE="N"_$$LKY17
2349"RTN","C0XMAIN",284,0)
2350 N ZNARY ; GET READY TO CALL IENOFA
2351"RTN","C0XMAIN",285,0)
2352 S ZNARY("ZG",ZG)=""
2353"RTN","C0XMAIN",286,0)
2354 S ZNARY("ZS",ZS)=""
2355"RTN","C0XMAIN",287,0)
2356 S ZNARY("ZP",ZP)=""
2357"RTN","C0XMAIN",288,0)
2358 S ZNARY("ZO",ZO)=""
2359"RTN","C0XMAIN",289,0)
2360 D IENOFA(.ZIENS,.ZNARY,FARY) ; RESOLVE/ADD STRINGS
2361"RTN","C0XMAIN",290,0)
2362 ;S ZGIEN=$$IENOF(ZG) ; LAYGO TO GET IEN
2363"RTN","C0XMAIN",291,0)
2364 ;S ZSIEN=$$IENOF(ZS)
2365"RTN","C0XMAIN",292,0)
2366 ;S ZPIEN=$$IENOF(ZP)
2367"RTN","C0XMAIN",293,0)
2368 ;S ZOIEN=$$IENOF(ZO)
2369"RTN","C0XMAIN",294,0)
2370 ;I $D(C0XFDA) D UPDIE ; ADD THE STRINGS IF NEEDED
2371"RTN","C0XMAIN",295,0)
2372 S C0XCNT=C0XCNT+1
2373"RTN","C0XMAIN",296,0)
2374 S C0XFDA(C0XTFN,"?+"_C0XCNT_",",.01)=ZNODE
2375"RTN","C0XMAIN",297,0)
2376 S C0XFDA(C0XTFN,"?+"_C0XCNT_",",.02)=$O(ZIENS("IEN","ZG",""))
2377"RTN","C0XMAIN",298,0)
2378 S C0XFDA(C0XTFN,"?+"_C0XCNT_",",.03)=$O(ZIENS("IEN","ZS",""))
2379"RTN","C0XMAIN",299,0)
2380 S C0XFDA(C0XTFN,"?+"_C0XCNT_",",.04)=$O(ZIENS("IEN","ZP",""))
2381"RTN","C0XMAIN",300,0)
2382 S C0XFDA(C0XTFN,"?+"_C0XCNT_",",.05)=$O(ZIENS("IEN","ZO",""))
2383"RTN","C0XMAIN",301,0)
2384 ; REMEMBER TO CALL UPDIE WHEN YOU'RE DONE
2385"RTN","C0XMAIN",302,0)
2386 Q
2387"RTN","C0XMAIN",303,0)
2388 ;
2389"RTN","C0XMAIN",304,0)
2390LKY9() ;EXTRINIC THAT RETURNS A RANDOM 9 DIGIT NUMBER. USED FOR GENERATING
2391"RTN","C0XMAIN",305,0)
2392 ; UNIQUE NODE AND GRAPH NAMES
2393"RTN","C0XMAIN",306,0)
2394 N ZN,ZI
2395"RTN","C0XMAIN",307,0)
2396 S ZN=""
2397"RTN","C0XMAIN",308,0)
2398 F ZI=1:1:9 D ;
2399"RTN","C0XMAIN",309,0)
2400 . S ZN=ZN_$R(10)
2401"RTN","C0XMAIN",310,0)
2402 Q ZN
2403"RTN","C0XMAIN",311,0)
2404 ;
2405"RTN","C0XMAIN",312,0)
2406LKY17() ;EXTRINIC THAT RETURNS A RANDOM 9 DIGIT NUMBER. USED FOR GENERATING
2407"RTN","C0XMAIN",313,0)
2408 ; UNIQUE NODE AND GRAPH NAMES
2409"RTN","C0XMAIN",314,0)
2410 N ZN,ZI
2411"RTN","C0XMAIN",315,0)
2412 S ZN=""
2413"RTN","C0XMAIN",316,0)
2414 F ZI=1:1:17 D ;
2415"RTN","C0XMAIN",317,0)
2416 . S ZN=ZN_$R(10)
2417"RTN","C0XMAIN",318,0)
2418 Q ZN
2419"RTN","C0XMAIN",319,0)
2420 ;
2421"RTN","C0XMAIN",320,0)
2422IENOF(ZSTRING,FARY) ; EXTRINSIC WHICH RETURNS THE IEN OF ZS IN THE STRINGS FILE
2423"RTN","C0XMAIN",321,0)
2424 I '$D(FARY) D ;
2425"RTN","C0XMAIN",322,0)
2426 . D INITFARY("C0XFARY")
2427"RTN","C0XMAIN",323,0)
2428 . S FARY="C0XFARY"
2429"RTN","C0XMAIN",324,0)
2430 N ZIEN
2431"RTN","C0XMAIN",325,0)
2432 S ZIEN=$O(@C0XSN@("B",ZSTRING,""))
2433"RTN","C0XMAIN",326,0)
2434 I ZIEN="" D ;
2435"RTN","C0XMAIN",327,0)
2436 . S C0XFDA2(C0XSFN,"+1,",.01)=ZSTRING
2437"RTN","C0XMAIN",328,0)
2438 . D UPDIE(.C0XFDA2)
2439"RTN","C0XMAIN",329,0)
2440 . S ZIEN=$O(@C0XSN@("B",ZSTRING,""))
2441"RTN","C0XMAIN",330,0)
2442 . K C0XFDA2
2443"RTN","C0XMAIN",331,0)
2444 Q ZIEN
2445"RTN","C0XMAIN",332,0)
2446 ;
2447"RTN","C0XMAIN",333,0)
2448IENOFA(ZOUTARY,ZINARY,FARY) ; RESOLVE STRINGS TO IEN IN STRINGS FILE
2449"RTN","C0XMAIN",334,0)
2450 ; OR ADD THEM IF
2451"RTN","C0XMAIN",335,0)
2452 ; MISSING. ZINARY AND ZOUTARY ARE PASSED BY REFERENCE
2453"RTN","C0XMAIN",336,0)
2454 ; ZINARY LOOKS LIKE ZINARY("VAR","VAL")=""
2455"RTN","C0XMAIN",337,0)
2456 ; RETURNS IN ZOUTARY OF THE FORM ZOUTARY("IEN","VAR",IEN)=""
2457"RTN","C0XMAIN",338,0)
2458 I '$D(FARY) D ;
2459"RTN","C0XMAIN",339,0)
2460 . D INITFARY("C0XFARY")
2461"RTN","C0XMAIN",340,0)
2462 . S FARY="C0XFARY"
2463"RTN","C0XMAIN",341,0)
2464 K ZOUTARY ; START WITH CLEAN RESULTS
2465"RTN","C0XMAIN",342,0)
2466 K C0XFDA2 ; USE A SEPARATE FDA FOR THIS
2467"RTN","C0XMAIN",343,0)
2468 N ZI S ZI=""
2469"RTN","C0XMAIN",344,0)
2470 N ZV,ZIEN
2471"RTN","C0XMAIN",345,0)
2472 N ZCNT S ZCNT=0
2473"RTN","C0XMAIN",346,0)
2474 F S ZI=$O(ZINARY(ZI)) Q:ZI="" D ; LOOK FOR MISSING STRINGS
2475"RTN","C0XMAIN",347,0)
2476 . S ZV=$O(ZINARY(ZI,""))
2477"RTN","C0XMAIN",348,0)
2478 . I $O(@C0XSN@("B",ZV,""))="" D ;
2479"RTN","C0XMAIN",349,0)
2480 . . S ZCNT=ZCNT+1
2481"RTN","C0XMAIN",350,0)
2482 . . S C0XFDA2(C0XSFN,"+"_ZCNT_",",.01)=ZV
2483"RTN","C0XMAIN",351,0)
2484 I $D(C0XFDA2) D ;
2485"RTN","C0XMAIN",352,0)
2486 . D UPDIE(.C0XFDA2) ; ADD MISSING STRINGS
2487"RTN","C0XMAIN",353,0)
2488 . K C0XFDA2 ; CLEAN UP
2489"RTN","C0XMAIN",354,0)
2490 F S ZI=$O(ZINARY(ZI)) Q:ZI="" D ; NOT GET ALL IENS
2491"RTN","C0XMAIN",355,0)
2492 . S ZV=$O(ZINARY(ZI,""))
2493"RTN","C0XMAIN",356,0)
2494 . S ZIEN=$O(@C0XSN@("B",ZV,"")) ; THEY SHOULD BE THERE NOW
2495"RTN","C0XMAIN",357,0)
2496 . I ZIEN="" D ;
2497"RTN","C0XMAIN",358,0)
2498 . . W !,"ERROR ADDING STRING: ",ZV
2499"RTN","C0XMAIN",359,0)
2500 . . B
2501"RTN","C0XMAIN",360,0)
2502 . S ZOUTARY("IEN",ZI,ZIEN)=""
2503"RTN","C0XMAIN",361,0)
2504 Q
2505"RTN","C0XMAIN",362,0)
2506 ;
2507"RTN","C0XMAIN",363,0)
2508UPDIE(ZFDA) ; INTERNAL ROUTINE TO CALL UPDATE^DIE AND CHECK FOR ERRORS
2509"RTN","C0XMAIN",364,0)
2510 ; ZFDA IS PASSED BY REFERENCE
2511"RTN","C0XMAIN",365,0)
2512 ;ZWR ZFDA
2513"RTN","C0XMAIN",366,0)
2514 ;B
2515"RTN","C0XMAIN",367,0)
2516 K ZERR
2517"RTN","C0XMAIN",368,0)
2518 D CLEAN^DILF
2519"RTN","C0XMAIN",369,0)
2520 D UPDATE^DIE("","ZFDA","","ZERR")
2521"RTN","C0XMAIN",370,0)
2522 I $D(ZERR) S ZZERR=ZZERR ; ZZERR DOESN'T EXIST,
2523"RTN","C0XMAIN",371,0)
2524 ; INVOKE THE ERROR TRAP IF TASKED
2525"RTN","C0XMAIN",372,0)
2526 ;. W "ERROR",!
2527"RTN","C0XMAIN",373,0)
2528 ;. ZWR ZERR
2529"RTN","C0XMAIN",374,0)
2530 ;. B
2531"RTN","C0XMAIN",375,0)
2532 K ZFDA
2533"RTN","C0XMAIN",376,0)
2534 Q
2535"RTN","C0XMAIN",377,0)
2536 ;
2537"RTN","C0XTEST")
25380^3^B14490662
2539"RTN","C0XTEST",1,0)
2540C0XTEST ; GPL - Fileman Triples bulk load tester ;11/6/11 17:05
2541"RTN","C0XTEST",2,0)
2542 ;;0.1;C0X;nopatch;noreleasedate;Build 6
2543"RTN","C0XTEST",3,0)
2544 ;Copyright 2011 George Lilly. Licensed under the terms of the GNU
2545"RTN","C0XTEST",4,0)
2546 ;General Public License See attached copy of the License.
2547"RTN","C0XTEST",5,0)
2548 ;
2549"RTN","C0XTEST",6,0)
2550 ;This program is free software; you can redistribute it and/or modify
2551"RTN","C0XTEST",7,0)
2552 ;it under the terms of the GNU General Public License as published by
2553"RTN","C0XTEST",8,0)
2554 ;the Free Software Foundation; either version 2 of the License, or
2555"RTN","C0XTEST",9,0)
2556 ;(at your option) any later version.
2557"RTN","C0XTEST",10,0)
2558 ;
2559"RTN","C0XTEST",11,0)
2560 ;This program is distributed in the hope that it will be useful,
2561"RTN","C0XTEST",12,0)
2562 ;but WITHOUT ANY WARRANTY; without even the implied warranty of
2563"RTN","C0XTEST",13,0)
2564 ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2565"RTN","C0XTEST",14,0)
2566 ;GNU General Public License for more details.
2567"RTN","C0XTEST",15,0)
2568 ;
2569"RTN","C0XTEST",16,0)
2570 ;You should have received a copy of the GNU General Public License along
2571"RTN","C0XTEST",17,0)
2572 ;with this program; if not, write to the Free Software Foundation, Inc.,
2573"RTN","C0XTEST",18,0)
2574 ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2575"RTN","C0XTEST",19,0)
2576 ;
2577"RTN","C0XTEST",20,0)
2578 Q
2579"RTN","C0XTEST",21,0)
2580 ;
2581"RTN","C0XTEST",22,0)
2582EN ; run the test
2583"RTN","C0XTEST",23,0)
2584 ;
2585"RTN","C0XTEST",24,0)
2586 k C0XFDA ; clear the node variable
2587"RTN","C0XTEST",25,0)
2588 i '$d(^C0X(101,0)) d ; global doesn't exist
2589"RTN","C0XTEST",26,0)
2590 . s ^C0X(101,0)="C0X TRIPLE^172.101^1^1"
2591"RTN","C0XTEST",27,0)
2592 n zg
2593"RTN","C0XTEST",28,0)
2594 S zg="_:G"_$$LKY9 ; all nodes are in the same graph
2595"RTN","C0XTEST",29,0)
2596 n zi
2597"RTN","C0XTEST",30,0)
2598 f zi=1:1:100000 d ; try a test of 10000 nodes
2599"RTN","C0XTEST",31,0)
2600 . s C0XFDA(172.101,zi,.01)="N"_$$LKY17 ; node name
2601"RTN","C0XTEST",32,0)
2602 . s C0XFDA(172.101,zi,.02)=zg
2603"RTN","C0XTEST",33,0)
2604 . s C0XFDA(172.101,zi,.03)=$R(100000)
2605"RTN","C0XTEST",34,0)
2606 . s C0XFDA(172.101,zi,.04)=$R(100000)
2607"RTN","C0XTEST",35,0)
2608 . s C0XFDA(172.101,zi,.05)=$R(100000)
2609"RTN","C0XTEST",36,0)
2610 S C0XST=$$NOW^XLFDT ; start of the insertion test
2611"RTN","C0XTEST",37,0)
2612 W !,"INSERTION STARTS AT ",C0XST,!
2613"RTN","C0XTEST",38,0)
2614 d BULKLOAD(.C0XFDA)
2615"RTN","C0XTEST",39,0)
2616 s C0XEND=$$NOW^XLFDT ; end of the insertion test
2617"RTN","C0XTEST",40,0)
2618 W !,"INSERTION ENDS AT ",C0XEND
2619"RTN","C0XTEST",41,0)
2620 S C0XDIFF=$$FMDIFF^XLFDT(C0XEND,C0XST,2)
2621"RTN","C0XTEST",42,0)
2622 W !," ELAPSED TIME: ",C0XDIFF," SECONDS"
2623"RTN","C0XTEST",43,0)
2624 I C0XDIFF>0 W !," APPROXIMATELY ",$P(100000/C0XDIFF,".")," NODES PER SECOND"
2625"RTN","C0XTEST",44,0)
2626 q
2627"RTN","C0XTEST",45,0)
2628 ;
2629"RTN","C0XTEST",46,0)
2630LKY9() ;EXTRINIC THAT RETURNS A RANDOM 9 DIGIT NUMBER. USED FOR GENERATING
2631"RTN","C0XTEST",47,0)
2632 ; UNIQUE NODE AND GRAPH NAMES
2633"RTN","C0XTEST",48,0)
2634 N ZN,ZI
2635"RTN","C0XTEST",49,0)
2636 S ZN=""
2637"RTN","C0XTEST",50,0)
2638 F ZI=1:1:9 D ;
2639"RTN","C0XTEST",51,0)
2640 . S ZN=ZN_$R(10)
2641"RTN","C0XTEST",52,0)
2642 Q ZN
2643"RTN","C0XTEST",53,0)
2644 ;
2645"RTN","C0XTEST",54,0)
2646LKY17() ;EXTRINIC THAT RETURNS A RANDOM 9 DIGIT NUMBER. USED FOR GENERATING
2647"RTN","C0XTEST",55,0)
2648 ; UNIQUE NODE AND GRAPH NAMES
2649"RTN","C0XTEST",56,0)
2650 N ZN,ZI
2651"RTN","C0XTEST",57,0)
2652 S ZN=""
2653"RTN","C0XTEST",58,0)
2654 F ZI=1:1:17 D ;
2655"RTN","C0XTEST",59,0)
2656 . S ZN=ZN_$R(10)
2657"RTN","C0XTEST",60,0)
2658 Q ZN
2659"RTN","C0XTEST",61,0)
2660 ;
2661"RTN","C0XTEST",62,0)
2662BULKLOAD(ZBFDA) ; BULK LOADER FOR LOADING TRIPLES INTO FILE 172.101
2663"RTN","C0XTEST",63,0)
2664 ; USING GLOBAL SETS INSTEAD OF UPDATE^DIE
2665"RTN","C0XTEST",64,0)
2666 ; QUITS IF FILE IS NOT 172.101
2667"RTN","C0XTEST",65,0)
2668 ; EXPECTS AN FDA WITHOUT STRINGS FOR THE IENS, STARTING AT 1
2669"RTN","C0XTEST",66,0)
2670 ; QUITS IF FIRST ENTRY IS NOT IENS 1
2671"RTN","C0XTEST",67,0)
2672 ; ASSUMES THAT THE LAST IENS IS THE COUNT OF ENTRIES
2673"RTN","C0XTEST",68,0)
2674 ; ZBFDA IS PASSED BY REFERENCE
2675"RTN","C0XTEST",69,0)
2676 ;
2677"RTN","C0XTEST",70,0)
2678 ; -- reserves a block of iens from file 172.101 by locking the zero node
2679"RTN","C0XTEST",71,0)
2680 ; -- ^C0X(101,0) and adding the count of entries to piece 2 and 3
2681"RTN","C0XTEST",72,0)
2682 ; -- then unlocking to minimize the duration of the lock
2683"RTN","C0XTEST",73,0)
2684 ;
2685"RTN","C0XTEST",74,0)
2686 W !,"USING BULKLOAD"
2687"RTN","C0XTEST",75,0)
2688 I '$D(ZBFDA) Q ; EMPTY FDA
2689"RTN","C0XTEST",76,0)
2690 I $O(ZBFDA(""))'=172.101 Q ; WRONG FILE
2691"RTN","C0XTEST",77,0)
2692 N ZCNT,ZP3,ZP4
2693"RTN","C0XTEST",78,0)
2694 ; -- find the number of nodes to insert
2695"RTN","C0XTEST",79,0)
2696 S ZCNT=$O(ZBFDA(172.101,""),-1)
2697"RTN","C0XTEST",80,0)
2698 I ZCNT="" D Q ;
2699"RTN","C0XTEST",81,0)
2700 . W !,"ERROR IN BULK LOAD - INVALID NODE COUNT"
2701"RTN","C0XTEST",82,0)
2702 . B
2703"RTN","C0XTEST",83,0)
2704 ; -- lock the zero node and reserve a block of iens to insert
2705"RTN","C0XTEST",84,0)
2706 W !,"LOCKING ZERO NODE"
2707"RTN","C0XTEST",85,0)
2708 LOCK +^C0X(101,0)
2709"RTN","C0XTEST",86,0)
2710 S ZP3=$P(^C0X(101,0),U,3)
2711"RTN","C0XTEST",87,0)
2712 S ZP4=$P(^C0X(101,0),U,4)
2713"RTN","C0XTEST",88,0)
2714 S $P(^C0X(101,0),U,3)=ZP3+ZCNT+1
2715"RTN","C0XTEST",89,0)
2716 S $P(^C0X(101,0),U,4)=ZP4+ZCNT+1
2717"RTN","C0XTEST",90,0)
2718 LOCK -^C0X(101,0)
2719"RTN","C0XTEST",91,0)
2720 N ZI,ZN,ZG,ZS,ZP,ZO,ZIEN,ZBASE
2721"RTN","C0XTEST",92,0)
2722 S ZBASE=ZP3 ; the last ien in the file
2723"RTN","C0XTEST",93,0)
2724 W !,"ZERO NODE UNLOCKED, IENS RESERVED=",ZCNT
2725"RTN","C0XTEST",94,0)
2726 W !,$$NOW^XLFDT
2727"RTN","C0XTEST",95,0)
2728 S ZI=""
2729"RTN","C0XTEST",96,0)
2730 F S ZI=$O(ZBFDA(172.101,ZI)) Q:ZI="" D ;
2731"RTN","C0XTEST",97,0)
2732 . S ZN=$G(ZBFDA(172.101,ZI,.01)) ; node name
2733"RTN","C0XTEST",98,0)
2734 . I ZN="" D BLKERR Q ;
2735"RTN","C0XTEST",99,0)
2736 . S ZG=$G(ZBFDA(172.101,ZI,.02)) ; graph pointer
2737"RTN","C0XTEST",100,0)
2738 . I ZG="" D BLKERR Q ;
2739"RTN","C0XTEST",101,0)
2740 . S ZS=$G(ZBFDA(172.101,ZI,.03)) ; subject pointer
2741"RTN","C0XTEST",102,0)
2742 . I ZS="" D BLKERR Q ;
2743"RTN","C0XTEST",103,0)
2744 . S ZP=$G(ZBFDA(172.101,ZI,.04)) ; predicate pointer
2745"RTN","C0XTEST",104,0)
2746 . I ZP="" D BLKERR Q ;
2747"RTN","C0XTEST",105,0)
2748 . S ZO=$G(ZBFDA(172.101,ZI,.05)) ; object pointer
2749"RTN","C0XTEST",106,0)
2750 . I ZO="" D BLKERR Q ;
2751"RTN","C0XTEST",107,0)
2752 . S ZIEN=ZI+ZBASE ; the new ien
2753"RTN","C0XTEST",108,0)
2754 . S ^C0X(101,ZIEN,0)=ZN_U_ZG_U_ZS_U_ZP_U_ZO ; set the zero node
2755"RTN","C0XTEST",109,0)
2756 . S ^C0X(101,"B",ZN,ZIEN)="" ; the B index
2757"RTN","C0XTEST",110,0)
2758 . S ^C0X(101,"G",ZG,ZIEN)="" ; the G for Graph index
2759"RTN","C0XTEST",111,0)
2760 . S ^C0X(101,"SPO",ZS,ZP,ZO)=""
2761"RTN","C0XTEST",112,0)
2762 . S ^C0X(101,"SOP",ZS,ZO,ZP)=""
2763"RTN","C0XTEST",113,0)
2764 . S ^C0X(101,"OPS",ZO,ZP,ZS)=""
2765"RTN","C0XTEST",114,0)
2766 . S ^C0X(101,"OSP",ZO,ZS,ZP)=""
2767"RTN","C0XTEST",115,0)
2768 . S ^C0X(101,"GOPS",ZG,ZO,ZP,ZS)=""
2769"RTN","C0XTEST",116,0)
2770 . S ^C0X(101,"GOSP",ZG,ZO,ZS,ZP)=""
2771"RTN","C0XTEST",117,0)
2772 . S ^C0X(101,"GPSO",ZG,ZP,ZS,ZO)=""
2773"RTN","C0XTEST",118,0)
2774 . S ^C0X(101,"GSPO",ZG,ZS,ZP,ZO)=""
2775"RTN","C0XTEST",119,0)
2776 Q
2777"RTN","C0XTEST",120,0)
2778 ;
2779"RTN","C0XTEST",121,0)
2780BLKERR ;
2781"RTN","C0XTEST",122,0)
2782 W !,"ERROR IN BULK LOAD",! ZWR ZBFDA(ZI)
2783"RTN","C0XTEST",123,0)
2784 B
2785"RTN","C0XTEST",124,0)
2786 Q
2787"RTN","C0XTEST",125,0)
2788 ;
2789"SEC","^DIC",172.101,172.101,0,"AUDIT")
2790@
2791"SEC","^DIC",172.101,172.101,0,"DD")
2792@
2793"SEC","^DIC",172.101,172.101,0,"DEL")
2794@
2795"SEC","^DIC",172.101,172.101,0,"LAYGO")
2796@
2797"SEC","^DIC",172.101,172.101,0,"RD")
2798@
2799"SEC","^DIC",172.101,172.101,0,"WR")
2800@
2801"SEC","^DIC",172.201,172.201,0,"AUDIT")
2802@
2803"SEC","^DIC",172.201,172.201,0,"DD")
2804@
2805"SEC","^DIC",172.201,172.201,0,"DEL")
2806@
2807"SEC","^DIC",172.201,172.201,0,"LAYGO")
2808@
2809"SEC","^DIC",172.201,172.201,0,"RD")
2810@
2811"SEC","^DIC",172.201,172.201,0,"WR")
2812@
2813"VER")
28148.0^22.0
2815"^DD",172.101,172.101,0)
2816FIELD^^.05^5
2817"^DD",172.101,172.101,0,"DDA")
2818N
2819"^DD",172.101,172.101,0,"DT")
28203111013
2821"^DD",172.101,172.101,0,"ID",.02)
2822S %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
2823"^DD",172.101,172.101,0,"ID",.03)
2824S %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
2825"^DD",172.101,172.101,0,"ID",.04)
2826S %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
2827"^DD",172.101,172.101,0,"ID",.05)
2828S %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
2829"^DD",172.101,172.101,0,"IX","B",172.101,.01)
2830
2831"^DD",172.101,172.101,0,"NM","C0X TRIPLE")
2832
2833"^DD",172.101,172.101,.01,0)
2834NODEID^RF^^0;1^K:$L(X)>30!($L(X)<3)!'(X'?1P.E) X
2835"^DD",172.101,172.101,.01,.1)
2836TRIPLE NODE ID
2837"^DD",172.101,172.101,.01,1,0)
2838^.1
2839"^DD",172.101,172.101,.01,1,1,0)
2840172.101^B
2841"^DD",172.101,172.101,.01,1,1,1)
2842S ^C0X(101,"B",$E(X,1,30),DA)=""
2843"^DD",172.101,172.101,.01,1,1,2)
2844K ^C0X(101,"B",$E(X,1,30),DA)
2845"^DD",172.101,172.101,.01,3)
2846Answer must be 3-30 characters in length
2847"^DD",172.101,172.101,.01,"DT")
28483111013
2849"^DD",172.101,172.101,.02,0)
2850GRAPH^P172.201^C0X(201,^0;2^Q
2851"^DD",172.101,172.101,.02,.1)
2852TRIPLE GRAPH
2853"^DD",172.101,172.101,.02,3)
2854Answer must be 3-240 characters in length
2855"^DD",172.101,172.101,.02,"DT")
28563111030
2857"^DD",172.101,172.101,.03,0)
2858SUBJECT^P172.201^C0X(201,^0;3^Q
2859"^DD",172.101,172.101,.03,.1)
2860TRIPLE SUBJECT
2861"^DD",172.101,172.101,.03,"DT")
28623111030
2863"^DD",172.101,172.101,.04,0)
2864PREDICATE^P172.201^C0X(201,^0;4^Q
2865"^DD",172.101,172.101,.04,.1)
2866TRIPLE PREDICATE
2867"^DD",172.101,172.101,.04,"DT")
28683111030
2869"^DD",172.101,172.101,.05,0)
2870OBJECT^P172.201^C0X(201,^0;5^Q
2871"^DD",172.101,172.101,.05,.1)
2872TRIPLE OBJECT
2873"^DD",172.101,172.101,.05,"DT")
28743111030
2875"^DD",172.201,172.201,0)
2876FIELD^^1^2
2877"^DD",172.201,172.201,0,"DDA")
2878N
2879"^DD",172.201,172.201,0,"DT")
28803111013
2881"^DD",172.201,172.201,0,"NM","C0X STRING")
2882
2883"^DD",172.201,172.201,0,"PT",172.101,.02)
2884
2885"^DD",172.201,172.201,0,"PT",172.101,.03)
2886
2887"^DD",172.201,172.201,0,"PT",172.101,.04)
2888
2889"^DD",172.201,172.201,0,"PT",172.101,.05)
2890
2891"^DD",172.201,172.201,.01,0)
2892STRING^RF^^0;1^K:$L(X)>240!($L(X)<1)!'(X=X) X
2893"^DD",172.201,172.201,.01,.1)
2894TRIPLE STRING
2895"^DD",172.201,172.201,.01,1,0)
2896^.1^^0
2897"^DD",172.201,172.201,.01,3)
2898Answer must be 1-240 characters in length
2899"^DD",172.201,172.201,.01,"DT")
29003111028
2901"^DD",172.201,172.201,1,0)
2902TEXT^172.2011^^1;0
2903"^DD",172.201,172.2011,0)
2904TEXT SUB-FIELD^^.01^1
2905"^DD",172.201,172.2011,0,"DT")
29063111013
2907"^DD",172.201,172.2011,0,"NM","TEXT")
2908
2909"^DD",172.201,172.2011,0,"UP")
2910172.201
2911"^DD",172.201,172.2011,.01,0)
2912TEXT^Wx^^0;1
2913"^DD",172.201,172.2011,.01,.1)
2914LONGER TEXT
2915"^DD",172.201,172.2011,.01,"DT")
29163111013
2917"^DIC",172.101,172.101,0)
2918C0X TRIPLE^172.101
2919"^DIC",172.101,172.101,0,"GL")
2920^C0X(101,
2921"^DIC",172.101,"B","C0X TRIPLE",172.101)
2922
2923"^DIC",172.201,172.201,0)
2924C0X STRING^172.201
2925"^DIC",172.201,172.201,0,"GL")
2926^C0X(201,
2927"^DIC",172.201,"B","C0X STRING",172.201)
2928
2929**END**
2930**END**
Note: See TracBrowser for help on using the repository browser.