Changeset 1423 for fmts/trunk


Ignore:
Timestamp:
May 6, 2012, 10:28:08 AM (13 years ago)
Author:
George Lilly
Message:

implemented PUTGRAF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fmts/trunk/p/C0XXFRM.m

    r1422 r1423  
    2222TEST1 ; test GRAPHY
    2323 ;
     24 D INITFARY^C0XF2N("C0XFARY")
     25 D USEFARY^C0XF2N("C0XFARY")
    2426 S G("possibleMatch",18262)=""
    2527 S G("possibleMatch",18262,"DOB")="19520606^19520606"
     
    3335 S G("possibleMatch",18263,"SSN")=3232221111
    3436 S GRAPH="/test/gpl/graph"
     37 D DELGRAPH^C0XF2N(GRAPH)
    3538 S SUBJECT="/test/gpl/match"
    3639 D GRAPHY("G2","G",GRAPH,SUBJECT) ; CONVERT TO GRAPH
    3740 W !
    3841 ZWR G2
     42 D PUTGRAF("G2",GRAPH) ; add them to the triple store
    3943 ;
    4044 Q
     
    5458 F  S ZJ=$O(@ZIN@(ZP,ZJ)) Q:ZJ=""  D  ; for each object
    5559 . N ZO
    56  . S ZO=$$ANONS^C0XF2N ; anonomous subject
    57  . S @ZOUT@(ZSUB,ZP,ZO)=""
    58  . S @ZOUT@(ZO,"rdf:id",ZJ)=""
     60 . ;S ZO=$$ANONS^C0XF2N ; anonomous subject
     61 . S ZO="vista:"_ZJ
     62 . S @ZOUT@(ZSUB,"fmts:"_ZP,ZO)=""
     63 . ;S @ZOUT@(ZO,"fmts:id",ZJ)=""
    5964 . N ZK S ZK=""
    6065 . F  S ZK=$O(@ZIN@(ZP,ZJ,ZK)) Q:ZK=""  D  ;
    61  . . S @ZOUT@(ZO,ZK,$G(@ZIN@(ZP,ZJ,ZK)))=""
    62  . . D GRAPHY(ZOUT,$NA(@ZIN@(ZP,ZJ,ZK)),ZGRF,ZO)
     66 . . S @ZOUT@(ZO,"fmts:"_ZK,$G(@ZIN@(ZP,ZJ,ZK)))=""
     67 . . ;D GRAPHY(ZOUT,$NA(@ZIN@(ZP,ZJ,ZK)),ZGRF,ZO)
    6368 ;
     69 Q
     70 ;
     71PUTGRAF(ZIN,ZGRF) ; add graph ZIN to the triples store with graph name ZGRF
     72 ; format for ZIN is @ZIN@("subject","predicate","object")=""
     73 N ZI,ZJ,ZK S (ZI,ZJ,ZK)=""
     74 D STARTADD^C0XF2N ; initialize for adding
     75 F  S ZI=$O(@ZIN@(ZI)) Q:ZI=""  D  ;
     76 . N ZARY
     77 . F  S ZJ=$O(@ZIN@(ZI,ZJ)) Q:ZJ=""  D  ;
     78 . . F  S ZK=$O(@ZIN@(ZI,ZJ,ZK)) Q:ZK=""  D  ;
     79 . . . S ZARY(ZJ)=ZK
     80 . . . D ADDINN^C0XF2N(ZGRF,ZI,.ZARY) ; add triples for one subject
     81 . ;ZWR C0XFDA
     82 D BULKLOAD^C0XF2N(.C0XFDA) ; add to the triplestore
    6483 Q
    6584 ;
Note: See TracChangeset for help on using the changeset viewer.