source: fmts/trunk/p/C0XGET1.m@ 1343

Last change on this file since 1343 was 1343, checked in by George Lilly, 12 years ago

beginning some retrieval code

File size: 2.1 KB
Line 
1C0XGET1 ; GPL - Fileman Triples entry point routine ;1/12/12 17:05
2 ;;0.1;C0X;nopatch;noreleasedate;Build 7
3 ;Copyright 2011 George Lilly. Licensed under the terms of the GNU
4 ;General Public License See attached copy of the License.
5 ;
6 ;This program is free software; you can redistribute it and/or modify
7 ;it under the terms of the GNU General Public License as published by
8 ;the Free Software Foundation; either version 2 of the License, or
9 ;(at your option) any later version.
10 ;
11 ;This program is distributed in the hope that it will be useful,
12 ;but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;GNU General Public License for more details.
15 ;
16 ;You should have received a copy of the GNU General Public License along
17 ;with this program; if not, write to the Free Software Foundation, Inc.,
18 ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 ;
20 Q
21 ;
22LSSUBJ(RTN,ZSUBJ,C0XFARY) ; LIST NODES WITH SUBJECT ZSUBJ
23 ;
24 I '$D(C0XFARY) D INITFARY^C0XF2N("C0XFARY")
25 D USEFARY^C0XF2N("C0XFARY")
26 Q
27 ;
28LSGRFS(RTN,C0XFARY) ; LIST ALL GRAPHS
29 ;
30 I '$D(C0XFARY) D INITFARY^C0XF2N("C0XFARY")
31 D USEFARY^C0XF2N("C0XFARY")
32 N ZI S ZI=""
33 F S ZI=$O(@C0XTN@("G",ZI)) Q:ZI="" D ;
34 . S RTN(ZI,$$STR(ZI))=""
35 Q
36 ;
37STR(ZIN,C0XFARY) ; EXTRINSIC RETURNS A STRING
38 I '$D(C0XFARY) D INITFARY^C0XF2N("C0XFARY")
39 Q $$GET1^DIQ(C0XSFN,ZIN,.01,"E")
40 ;
41SPO(ZRTN,ZNODE,C0XFARY)
42 I '$D(C0XFARY) D INITFARY^C0XF2N("C0XFARY")
43 N ZI S ZI=$$NXT(.ZRTN)
44 S ZRTN(ZI,"S")=$$S(ZNODE)
45 S ZRTN(ZI,"P")=$$P(ZNODE)
46 S ZRTN(ZI,"O")=$$O(ZNODE)
47 Q
48 ;
49S(ZNODE,C0XFARY) ; EXTRINSIC RETURNING THE SUBJECT
50 Q $$STR($$GET1^DIQ(C0XTFN,ZNODE,.03,"I")) ;
51 ;
52P(ZNODE,C0XFARY) ; EXTRINSIC RETURNING THE PREDICATE
53 Q $$STR($$GET1^DIQ(C0XTFN,ZNODE,.04,"I")) ;
54 ;
55O(ZNODE,C0XFARY) ; EXTRINSIC RETURNING THE OBJECT
56 Q $$STR($$GET1^DIQ(C0XTFN,ZNODE,.05,"I")) ;
57 ;
58NXT(ZRTN) ;EXTRINSIC FOR THE NEXT NODE IN ARRAY ZRTN, PASSED BY REF
59 Q $O(ZRTN(""),-1)+1
60 ;
61SING(ZRTN,ZG) ; SUBJECTS IN GRAPH
62 ;
63 I '$D(C0XFARY) D INITFARY^C0XF2N("C0XFARY")
64 N ZI,ZN S ZI=""
65 F S ZI=$O(@C0XTN@("GSO",ZG,ZI)) Q:ZI="" D ;
66 . S ZRTN($$NXT(ZRTN),"S")=$$STR(ZI)
67 Q
68 ;
Note: See TracBrowser for help on using the repository browser.