Changeset 1381
- Timestamp:
- Mar 22, 2012, 9:38:37 AM (13 years ago)
- Location:
- fmts/trunk/p
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
fmts/trunk/p/C0XF2N.m
r1380 r1381 142 142 S BATMAX=10000 ; TRY BATCHES OF THIS SIZE 143 143 N ZGRAPH,ZSUBJECT 144 S ZGRAPH="_:G"_$$LKY 9; RANDOM GRAPH NAME144 S ZGRAPH="_:G"_$$LKY5 ; RANDOM GRAPH NAME 145 145 S ZSUBJECT=$$ANONS() ; RANDOM ANOYMOUS SUBJECT 146 146 D ADD(ZGRAPH,ZSUBJECT,"fmts:url",ZNAME,FARY) 147 147 N ZTXTNM 148 S ZTXTNM="_TXT_INCOMING_RDF_FILE_"_ZNAME_"_"_$$LKY 9; NAME FOR TEXT NODE148 S ZTXTNM="_TXT_INCOMING_RDF_FILE_"_ZNAME_"_"_$$LKY5 ; NAME FOR TEXT NODE 149 149 D ADD(ZGRAPH,ZSUBJECT,"fmts:rdfSource",ZTXTNM,FARY) 150 D ADD(ZGRAPH,ZSUBJECT,"fmts:tag",$$name2tag(ZNAME),FARY) 150 151 D SWUPDIE(.C0XFDA) ; TRY IT OUT 151 152 K C0XCNT ;RESET FOR NEXT TIME … … 154 155 D PROCESS(.G,ZRDF,ZNAME,ZGRAPH,FARY) ; PARSE AND INSERT THE RDF 155 156 Q 157 ; 158 name2tag(zname) ; extrinsic which returns a tag derived from a name 159 ; /home/vista/project.xml ==> project 160 q $p($re($p($re(zname),"/")),".") 156 161 ; 157 162 STORETXT(ZTXT,ZNAME,FARY) ; STORE TEXT IN THE TRIPLESTORE AT ZNAME … … 253 258 ; -- populate the metagraph to point to the graph with status unfinished 254 259 S METAS=$$ANONS ; GET AN ANONOMOUS RANDOM SUBJECT 255 I '$D(ZMETA) S ZMETA="_:G"_$$LKY 9; RANDOM GRAPH NAME FOR METAGRAPH260 I '$D(ZMETA) S ZMETA="_:G"_$$LKY5 ; RANDOM GRAPH NAME FOR METAGRAPH 256 261 D ADD(ZMETA,METAS,"fmts:about",ZGRF,FARY) ; POINT THE META TO THE GRAPH 257 262 D ADD(ZMETA,METAS,"fmts:status","unfinished",FARY) ; mark as unfinished … … 371 376 ; 372 377 ANONS() ; RETURNS AN ANONOMOUS SUBJECT 373 Q "iDPsDPss"_$$LKY 9378 Q "iDPsDPss"_$$LKY5 374 379 ; 375 380 NEWG(NGRAPH,NMETA) ; CREATES A NEW META GRAPH, MARKS IT AS UNFINISHED 376 381 ; THEN CREATES A NEW GRAPH AND POINTS THE METAGRAPH TO IT 377 382 ; NGRAPH AND NMETA ARE PASSED BY REFERENCE AND ARE THE RETURN 378 S NGRAPH="G"_$$LKY 9383 S NGRAPH="G"_$$LKY5 379 384 S NMETA=NGRAPH_"A" 380 385 Q … … 426 431 Q 427 432 ; 433 LKY5() ;EXTRINIC THAT RETURNS A RANDOM 5 DIGIT NUMBER. USED FOR GENERATING 434 ; UNIQUE NODE AND GRAPH NAMES 435 N ZN,ZI 436 S ZN="" 437 F ZI=1:1:5 D ; 438 . S ZN=ZN_$R(10) 439 Q ZN 440 ; 428 441 LKY9() ;EXTRINIC THAT RETURNS A RANDOM 9 DIGIT NUMBER. USED FOR GENERATING 429 442 ; UNIQUE NODE AND GRAPH NAMES -
fmts/trunk/p/C0XGET1.m
r1377 r1381 141 141 q 142 142 ; 143 subject(pred,obj,graph,form,fary) ; extrinsic which returns the first 144 ; multiple of return from subjects - returns null if more than one 145 ; subjects(.G,sub,pred) 146 ; G("nodeID:1234") ==> "nodeID:1234" 147 n zin,zrtn 148 d subjects(.zin,$g(pred),$g(obj),$g(form),$g(fary)) 149 s zrtn=$o(zin("")) 150 i $o(zin(zrtn))'="" s zrtn="" 151 q zrtn 152 ; 143 153 preds(listrtn,sub,obj,graph,form,fary) ; return list of subjects 144 154 d onelist("P",$g(sub),,$g(obj),$g(fary)) ;subjects … … 148 158 d onelist("O",$g(sub),$g(pred),"",$g(fary)) ;subjects 149 159 q 160 ; 161 object(sub,pred,graph,form,fary) ; extrinsic which returns the first 162 ; multiple of return from objects - returns null if more than one 163 ; objects(.G,sub,pred) 164 ; G("location") ==> "location" 165 n zin,zrtn 166 d objects(.zin,$g(sub),$g(pred),$g(form),$g(fary)) 167 s zrtn=$o(zin("")) 168 i $o(zin(zrtn))'="" s zrtn="" 169 q zrtn 150 170 ; 151 171 onelist(zw,sub,pred,obj,fary) ; returns list
Note:
See TracChangeset
for help on using the changeset viewer.