1 (defun triples-given-beginning (node)
2 "Get triples outbound from the given NODE."
3 ;; (search `(((a ,node))
8 (and (equal (get-content (get-source id
) node
))
9 (ground-p (get-source (get-source id
)))
10 (ground-p (get-source (get-sink id
)))
11 (ground-p (get-sink (get-source id
)))
12 (ground-p (get-sink (get-sink id
)))))))
14 (defun triples-given-end (node)
15 "Get triples inbound into NODE."
16 ;; (search `(((b ,node))
21 (and (equal (get-content (get-sink id
) node
))
22 (ground-p (get-source (get-source id
)))
23 (ground-p (get-source (get-sink id
)))
24 (ground-p (get-sink (get-source id
)))
25 (ground-p (get-sink (get-sink id
)))))))
27 (defun triples-given-middle (edge)
28 "Get the triples that run along EDGE."
29 ;; (search `(((c ,edge))
34 (and (equal (get-content id
) edge
)
35 (ground-p (get-source (get-source id
)))
36 (ground-p (get-source (get-sink id
)))
37 (ground-p (get-sink (get-source id
)))
38 (ground-p (get-sink (get-sink id
)))))))
40 (defun triples-given-middle-and-end (edge node
)
41 "Get the triples that run along EDGE into NODE."
42 ;; (search `(((c ,edge) (b ,node))
47 (and (equal (get-content id
) edge
)
48 (equal (get-content (get-sink id
) node
))
49 (ground-p (get-source (get-source id
)))
50 (ground-p (get-source (get-sink id
)))
51 (ground-p (get-sink (get-source id
)))
52 (ground-p (get-sink (get-sink id
))))))))
54 (defun triples-given-beginning-and-middle (node edge
)
55 "Get the triples that run from NODE along EDGE."
56 ;; (search `(((a ,node) (c ,edge))
61 (and (equal (get-content (get-source id
) node
))
62 (equal (get-content id
) edge
)
63 (ground-p (get-source (get-source id
)))
64 (ground-p (get-source (get-sink id
)))
65 (ground-p (get-sink (get-source id
)))
66 (ground-p (get-sink (get-sink id
)))))))
68 (defun triples-given-beginning-and-end (node1 node2
)
69 "Get the triples that run from NODE1 to NODE2. Optional
70 argument VIEW causes the results to be selected
71 into a view with that name."
72 ;; (search `(((a ,node1) (b ,node2))
77 (and (equal (get-content (get-source id
) node1
))
78 (equal (get-content (get-sink id
) node2
))
79 (ground-p (get-source (get-source id
)))
80 (ground-p (get-source (get-sink id
)))
81 (ground-p (get-sink (get-source id
)))
82 (ground-p (get-sink (get-sink id
)))))))
84 (defun triple-exact-match (node1 edge node2
)
85 "Get the triples that run from NODE1 along EDGE to
87 ;; (search `(((a ,node1) (b ,node2) (c ,edge))
92 (and (equal (get-content (get-source id
) node1
))
93 (equal (get-content id
) edge
)
94 (equal (get-content (get-sink id
) node2
))
95 (ground-p (get-source (get-source id
)))
96 (ground-p (get-source (get-sink id
)))
97 (ground-p (get-sink (get-source id
)))
98 (ground-p (get-sink (get-sink id
)))))))