Changeset 1367 for fmts/trunk
- Timestamp:
- Feb 26, 2012, 11:37:05 PM (13 years ago)
- Location:
- fmts/trunk/p
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
fmts/trunk/p/C0XF2N.m
r1366 r1367 38 38 S @ZFARY@("C0XTN")=$NA(^C0X(101)) ; TRIPLES GLOBAL NAME 39 39 S @ZFARY@("C0XSN")=$NA(^C0X(201)) ; STRING FILE GLOBAL NAME 40 S @ZFARY@("C0XDIR")="/home/ vista/gpl/C0Q/trunk/rdf/"40 S @ZFARY@("C0XDIR")="/home/glilly/fmts/trunk/samples/smart-rdf-in/" 41 41 S @ZFARY@("BLKLOAD")=1 ; this file supports block load 42 42 S @ZFARY@("FMTSSTYLE")="F2N" ; fileman style … … 271 271 W !,"VOCABS:" 272 272 N ZZ S ZZ="" 273 F S ZZ=$O(C0XVOC(ZZ)) Q:ZZ="" W !,ZZ,":",C0 CVOC(ZZ)273 F S ZZ=$O(C0XVOC(ZZ)) Q:ZZ="" W !,ZZ,":",C0XVOC(ZZ) 274 274 ; 275 275 ; -- look for children called rdf:Description. quit if none. not an rdf file … … 398 398 ;S ZOIEN=$$IENOF(ZO) 399 399 ;I $D(C0XFDA) D UPDIE ; ADD THE STRINGS IF NEEDED 400 I '$D(BATCNT) S BATCNT=0 400 401 S BATCNT=BATCNT+1 401 402 S C0XCNT=C0XCNT+1 … … 412 413 . S C0XFDA(C0XTFN,"?+"_ATCNT_",",.04)=$O(ZIENS("IEN","ZP","")) 413 414 . S C0XFDA(C0XTFN,"?+"_BATCNT_",",.05)=$O(ZIENS("IEN","ZO","")) 415 I '$D(BATMAX) S BATMAX=10000 414 416 I BATCNT=BATMAX D ; BATCH IS DONE 415 417 . I $G(BLKLOAD) D ; bulk load … … 452 454 Q ZIEN 453 455 ; 454 IENOFA(ZOUTARY, ZINARY,FARY) ; RESOLVE STRINGS TO IEN IN STRINGS FILE456 IENOFA(ZOUTARY,INARY,FARY) ; RESOLVE STRINGS TO IEN IN STRINGS FILE 455 457 ; OR ADD THEM IF 456 458 ; MISSING. ZINARY AND ZOUTARY ARE PASSED BY REFERENCE … … 462 464 K ZOUTARY ; START WITH CLEAN RESULTS 463 465 K C0XFDA2 ; USE A SEPARATE FDA FOR THIS 466 I '$D(C0XVOC) D INITVOC^C0XUTIL 467 N ZINARY 464 468 N ZI S ZI="" 469 F S ZI=$O(INARY(ZI)) Q:ZI="" D ; 470 . N ZK 471 . S ZK=$O(INARY(ZI,"")) 472 . S ZINARY($$EXT^C0XUTIL(ZI),$$EXT^C0XUTIL(ZK))="" 465 473 N ZV,ZIEN 466 474 N ZCNT S ZCNT=0 -
fmts/trunk/p/C0XGET1.m
r1354 r1367 114 114 W !,"s:",zsub," p:",zpred," o:",zobj 115 115 d trip(.tmprtn,zsub,zpred,zobj,zgraph,fary) 116 n zzz,zrsub,zrpred,zrobj,zgraph,zcnt,zrary 117 s zzz="" 118 f s zzz=$o(tmprtn(zzz)) q:zzz="" d ; 119 . s zrsub=$$GET1^DIQ(C0XTFN,zzz_",",.03,"E") 120 . s zrpred=$$GET1^DIQ(C0XTFN,zzz_",",.04,"E") 121 . s zrobj=$$GET1^DIQ(C0XTFN,zzz_",",.05,"E") 122 . s zrgraph=$$GET1^DIQ(C0XTFN,zzz_",",.02,"E") 123 . s zrary(zrsub,zrpred_"^"_zrobj)="" 124 ;b 125 ; 116 d ien2tary(.zrary,"tmprtn") ; convert to triples 117 ; 118 d rdfout^C0XRDF(.triplertn,.zrary) q ; 126 119 i REPLYFMT="JSON" d jsonout(.triplertn,.zrary) q ; what follows is 'else' 127 120 ; … … 135 128 . . s triplertn(zcnt)=zrsub_"^"_zzz 136 129 . . s zcnt=zcnt+1 130 q 131 ; 132 ien2tary(zrary,zinary) ; zinary is an array of iens passed by name 133 ; zrary is passed by reference and is return array of triples 134 ; format zrary(zsub,"zpred^zobj")="" 135 ; 136 n zzz,zrsub,zrpred,zrobj,zgraph,zcnt 137 s zzz="" 138 f s zzz=$o(@zinary@(zzz)) q:zzz="" d ; 139 . s zrsub=$$GET1^DIQ(C0XTFN,zzz_",",.03,"E") 140 . s zrpred=$$GET1^DIQ(C0XTFN,zzz_",",.04,"E") 141 . s zrobj=$$GET1^DIQ(C0XTFN,zzz_",",.05,"E") 142 . s zrgraph=$$GET1^DIQ(C0XTFN,zzz_",",.02,"E") 143 . s zrary(zrsub,zrpred_"^"_zrobj)="" 137 144 q 138 145 ;
Note:
See TracChangeset
for help on using the changeset viewer.