Changeset 1391 for fmts


Ignore:
Timestamp:
Apr 4, 2012, 2:45:35 PM (13 years ago)
Author:
George Lilly
Message:

added support for raw mumps array format

Location:
fmts/trunk/p
Files:
2 edited

Legend:

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

    r1388 r1391  
    109109 ;
    110110getGraph(zrtn,zgrf,form) ; get all triples in graph zgrf
    111  ; forms planned: "rdf" "json" "array" "turtle" "triples"
    112  ; forms supported: "rdf" "json" "array"
     111 ; forms planned: "rdf" "json" "array" "turtle" "triples" "raw"
     112 ; forms supported: "rdf" "json" "array" "raw"
    113113 I '$D(form) S form="rdf"
    114114 N ZIENS,ZTRIP
     
    119119 i form="rdf" d rdfout^C0XRDF(.zrtn,.ZTRIP) q  ;
    120120 i form="array" d arrayout^C0XGET1(.zrtn,.ZTRIP) q  ;
     121 i form="raw" d rawout^C0XGET1(.zrtn,.ZTRIP) q  ;
    121122 W !,"Form not supported: ",form
    122123 Q
     
    157158 i form="json" d jsonout(.triplertn,.zrary) q  ; what follows is 'else'
    158159 i form="rdf" d rdfout^C0XRDF(.triplertn,.zrary) q  ;
    159  i form="array" d arrayout(.triplertn,.zrary) q ;
     160 i form="array" d arrayout(.triplertn,.zrary) q  ;
     161 i form="raw" d rawout(.triplertn,.zrary) q  ;
    160162 w !,"form not supported: ",form
    161163 q
     
    283285 q
    284286 ;
     287rawout(rtn,zary) ; output a mumps array of triples
     288 ;
     289 s zrsub=""
     290 ;s zcnt=1
     291 f  s zrsub=$o(zary(zrsub)) q:zrsub=""  d  ; organized by subject
     292 . s zzz=""
     293 . f  s zzz=$o(zary(zrsub,zzz)) q:zzz=""  d  ; pred and obj
     294 . . s rtn(zrsub,$p(zzz,"^",1))=$p(zzz,"^",2)
     295 . . ;s zcnt=zcnt+1
     296 q
     297 ;
    285298strings(zrary,zinary) ; convert pointers to strings
    286299 ;
  • fmts/trunk/p/C0XRDF.m

    r1385 r1391  
    4343 . S ZA=$P(ZPRED,":",1)
    4444 . S ZB=$P(ZPRED,":",2)
     45 . I $E(ZB,1,1)="/" D  ;
     46 . . S ZB=$P(ZB,"/",2) ; handling gpltest:/note situations
    4547 . S ZC=C0XVOC(ZA)
    4648 . I ZOBJ["nodeID:" D  Q  ;
Note: See TracChangeset for help on using the changeset viewer.