1 | C0XGET3 ; VEN/SMH - Sam's Getters... let's try to make them simple ;2013-02-04 12:00 PM
|
---|
2 | ;;1.1;FILEMAN TRIPLE STORE;
|
---|
3 | ;
|
---|
4 | IEN(N) ; Public $$; Resolved IEN of a stored string such as "rdf:type" in Strings File
|
---|
5 | I +N=N Q N ; We are given the IEN, just return it back
|
---|
6 | Q $$IENOF^C0XGET1($$EXT^C0XUTIL(N))
|
---|
7 | ;
|
---|
8 | ;
|
---|
9 | ;
|
---|
10 | GOPS1(G,O,P) ; Public $$; Get Subject for A Graph/Object/Predicate combination
|
---|
11 | N S S S=$O(^C0X(101,"GOPS",$$IEN(G),$$IEN(O),$$IEN(P),""))
|
---|
12 | Q:S="" ""
|
---|
13 | Q ^C0X(201,S,0)
|
---|
14 | GOPS(R,G,O,P) ; Public Proc; Get Subjects for A Graph/Object/Predicate combination
|
---|
15 | ; R is global style RPC reference
|
---|
16 | N S S S=""
|
---|
17 | F S S=$O(^C0X(101,"GOPS",$$IEN(G),$$IEN(O),$$IEN(P),S)) Q:S="" S @R@(S)=^C0X(201,S,0)
|
---|
18 | QUIT
|
---|
19 | ONETYPE1(G,O) ; Public $$; Get Subject for Graph/Object of a specific type
|
---|
20 | ; This is a conveince call to GOPS1 with Predicate="rdf:type"
|
---|
21 | Q $$GOPS1(G,O,"rdf:type")
|
---|
22 | ONETYPE(R,G,O) ; Public Proc; Get Subjects for Graph/Object of a specific type
|
---|
23 | ; R is global style RPC reference
|
---|
24 | ; This is a conveince call to GOPS with Predicate="rdf:type"
|
---|
25 | D GOPS(R,G,O,"rdf:type")
|
---|
26 | QUIT
|
---|
27 | GSPO1(G,S,P) ; Public $$; Get Object for A Graph/Subject/Predicate combination
|
---|
28 | ; Supports forward relational navigation for predicates using "." as separator
|
---|
29 | N EP S EP=$P(P,".",2,99) ; Extended Predicate
|
---|
30 | S P=$P(P,".") ; Predicate becomes the first piece
|
---|
31 | N O S O=$O(^C0X(101,"GSPO",$$IEN(G),$$IEN(S),$$IEN(P),""))
|
---|
32 | Q:O="" "" ; Another end point for recursion
|
---|
33 | Q:$L(EP) $$GSPO1(G,O,EP) ; if we have an extended predicate, recurse
|
---|
34 | Q ^C0X(201,O,0) ; this is the end point of the recursion.
|
---|