/ doc / views /
/doc/views/datasheet_events.xml
1 <?xml version='1.0'?>
2 <!DOCTYPE para PUBLIC "-//OASIS//DTD DocBook XML 5.0//EN"
3 "http://www.oasis-open.org/docbook/xml/5.0/dtd/docbook.dtd" [
4 <!-- Use symbols for repeating text. -->
5 <!ENTITY % entities SYSTEM "../entities">
6 %entities;
7 <!ENTITY % constants SYSTEM "../constants">
8 %constants;
9 ]>
10 <!-- Copyright (C) 2013, 2014, 2018 The Meme Factory, Inc. http://www.meme.com
11 - Copyright (C) 2005, 2007, 2010 Karl O. Pinc <kop@meme.com> and others
12 - See document output for full copyright information. -->
13
14 <!-- Core documentation on the DATASHEET_EVENTS view.
15
16 - This is indeed the query that makes the view, so don't break it!
17
18 - The "code" element must have a 'role="view"' attribute
19 - so that Gombe-MI code generation can get the code
20 - and actually make the view!
21 -->
22
23 <para xmlns="http://docbook.org/ns/docbook"
24 version="5.0">
25
26 <figure xml:id="datasheet_events-code">
27 <title>Query Defining the DATASHEET_EVENTS View: Part I</title>
28 <literallayout>
29 <code role="view">SELECT family_events.followid AS followid
30 , family_events.intid AS intid
31 , family_events.eid AS eid
32 , family_events.e_mompid AS e_mompid
33 , family_events.e_infantpid AS e_infantpid
34 , family_events.e_sibpid AS e_sibpid
35 , family_events.e_nonfocalpid AS e_nonfocalpid
36 , family_events.date AS date
37 , family_events.time AS time
38 , family_events.mom AS mom
39 , family_events.infant AS infant
40 , family_events.infant2 AS infant2
41 , family_events.sib AS sib
42 , family_events.sib2 AS sib2
43 , family_events.behavior AS behavior
44 , family_events.position AS position
45 , family_events.uncertain AS uncertain
46 </code></literallayout>
47 </figure>
48 <figure xml:id="datasheet_events-code-part2">
49 <title>Query Defining the DATASHEET_EVENTS View: Part II</title>
50 <literallayout><code role="view"> , family_events.e_mom AS e_mom
51 , family_events.e_mompart AS e_mompart
52 , CASE
53 WHEN family_events.e_mom IS NOT NULL THEN
54 mom_eats.foodpart
55 ELSE
56 NULL
57 END AS e_mom_foodpart
58 , CASE
59 WHEN family_events.e_mom IS NOT NULL THEN
60 mom_eats.foodkind
61 ELSE
62 NULL
63 END AS e_mom_foodkind
64 , CASE
65 WHEN family_events.e_mom IS NOT NULL THEN
66 mom_fished.foodpart
67 ELSE
68 NULL
69 END AS e_mom_fishpart
70 , CASE
71 WHEN family_events.e_mom IS NOT NULL THEN
72 mom_fished.foodkind
73 ELSE
74 NULL
75 END AS e_mom_fishkind
76 , CASE
77 WHEN family_events.e_mom IS NOT NULL THEN
78 mom_fished.result
79 ELSE
80 NULL
81 END AS e_mom_fishresult
82 , CASE
83 WHEN family_events.e_mom IS NOT NULL THEN
84 mom_vocs.vocalization
85 ELSE
86 NULL
87 END AS e_mom_voc
88 , CASE
89 WHEN family_events.e_mom IS NOT NULL THEN
90 mom_plays.play
91 ELSE
92 NULL
93 END AS e_mom_play
94 , CASE
95 WHEN family_events.e_mom IS NOT NULL THEN
96 mom_rests.rest
97 ELSE
98 NULL
99 END AS e_mom_rest
100 </code></literallayout>
101 </figure>
102 <figure xml:id="datasheet_events-code-part3">
103 <title>Query Defining the DATASHEET_EVENTS View: Part III</title>
104 <literallayout><code role="view"> , family_events.e_infant AS e_infant
105 , family_events.e_infantpart AS e_infantpart
106 , CASE
107 WHEN family_events.e_infant IS NOT NULL THEN
108 inf_eats.foodpart
109 ELSE
110 NULL
111 END AS e_infant_foodpart
112 , CASE
113 WHEN family_events.e_infant IS NOT NULL THEN
114 inf_eats.foodkind
115 ELSE
116 NULL
117 END AS e_infant_foodkind
118 , CASE
119 WHEN family_events.e_infant IS NOT NULL THEN
120 inf_fished.foodpart
121 ELSE
122 NULL
123 END AS e_infant_fishpart
124 , CASE
125 WHEN family_events.e_infant IS NOT NULL THEN
126 inf_fished.foodkind
127 ELSE
128 NULL
129 END AS e_infant_fishkind
130 , CASE
131 WHEN family_events.e_infant IS NOT NULL THEN
132 inf_fished.result
133 ELSE
134 NULL
135 END AS e_infant_fishresult
136 , CASE
137 WHEN family_events.e_infant IS NOT NULL THEN
138 inf_vocs.vocalization
139 ELSE
140 NULL
141 END AS e_infant_voc
142 , CASE
143 WHEN family_events.e_infant IS NOT NULL THEN
144 inf_plays.play
145 ELSE
146 NULL
147 END AS e_infant_play
148 , CASE
149 WHEN family_events.e_infant IS NOT NULL THEN
150 inf_rides.ride
151 ELSE
152 NULL
153 END AS e_infant_ride
154 , CASE
155 WHEN family_events.e_infant IS NOT NULL THEN
156 inf_rests.rest
157 ELSE
158 NULL
159 END AS e_infant_rest
160 </code></literallayout>
161 </figure>
162 <figure xml:id="datasheet_events-code-part4">
163 <title>Query Defining the DATASHEET_EVENTS View: Part IV</title>
164 <literallayout><code role="view"> , family_events.e_sib as e_sib
165 , family_events.e_sibpart AS e_sibpart
166 , CASE
167 WHEN family_events.e_sib IS NOT NULL THEN
168 sib_eats.foodpart
169 ELSE
170 NULL
171 END AS e_sib_foodpart
172 , CASE
173 WHEN family_events.e_sib IS NOT NULL THEN
174 sib_eats.foodkind
175 ELSE
176 NULL
177 END AS e_sib_foodkind
178 , CASE
179 WHEN family_events.e_sib IS NOT NULL THEN
180 sib_fished.foodpart
181 ELSE
182 NULL
183 END AS e_sib_fishpart
184 , CASE
185 WHEN family_events.e_sib IS NOT NULL THEN
186 sib_fished.foodkind
187 ELSE
188 NULL
189 END AS e_sib_fishkind
190 , CASE
191 WHEN family_events.e_sib IS NOT NULL THEN
192 sib_fished.result
193 ELSE
194 NULL
195 END AS e_sib_fishresult
196 , CASE
197 WHEN family_events.e_sib IS NOT NULL THEN
198 sib_vocs.vocalization
199 ELSE
200 NULL
201 END AS e_sib_voc
202 , CASE
203 WHEN family_events.e_sib IS NOT NULL THEN
204 sib_plays.play
205 ELSE
206 NULL
207 END AS e_sib_play
208 , CASE
209 WHEN family_events.e_sib IS NOT NULL THEN
210 sib_rides.ride
211 ELSE
212 NULL
213 END AS e_sib_ride
214 , CASE
215 WHEN family_events.e_sib IS NOT NULL THEN
216 sib_rests.rest
217 ELSE
218 NULL
219 END AS e_sib_rest
220 </code></literallayout>
221 </figure>
222 <figure xml:id="datasheet_events-code-part5">
223 <title>Query Defining the DATASHEET_EVENTS View: Part V</title>
224 <literallayout><code role="view"> , family_events.e_nonfocal AS e_nonfocal
225 , family_events.e_nonfocalpart as e_nonfocalpart
226 , family_events.e_baboon AS e_baboon
227 , family_events.e_baboonpart AS e_baboonpart
228 , family_events.e_comment AS e_comment
229 , family_events.i_comment AS i_comment
230 </code></literallayout>
231 </figure>
232 <figure xml:id="datasheet_events-code-part6">
233 <title>Query Defining the DATASHEET_EVENTS View: Part VI</title>
234 <literallayout><code role="view"> FROM family_events
235 LEFT OUTER JOIN vocs AS mom_vocs
236 ON (mom_vocs.eid = family_events.eid
237 AND family_events.e_mom IS NOT NULL)
238 LEFT OUTER JOIN plays AS mom_plays
239 ON (mom_plays.eid = family_events.eid
240 AND family_events.e_mom IS NOT NULL)
241 LEFT OUTER JOIN rests AS mom_rests
242 ON (mom_rests.eid = family_events.eid
243 AND family_events.e_mom IS NOT NULL)
244 LEFT OUTER JOIN eats AS mom_eats
245 ON (mom_eats.eid = family_events.eid
246 AND family_events.e_mom IS NOT NULL)
247 LEFT OUTER JOIN fished AS mom_fished
248 ON (mom_fished.eid = family_events.eid
249 AND family_events.e_mom IS NOT NULL)
250 LEFT OUTER JOIN vocs AS inf_vocs
251 ON (inf_vocs.eid = family_events.eid
252 AND family_events.e_infant IS NOT NULL)
253 LEFT OUTER JOIN plays AS inf_plays
254 ON (inf_plays.eid = family_events.eid
255 AND family_events.e_infant IS NOT NULL)
256 LEFT OUTER JOIN rides AS inf_rides
257 ON (inf_rides.eid = family_events.eid
258 AND family_events.e_infant IS NOT NULL)
259 LEFT OUTER JOIN rests AS inf_rests
260 ON (inf_rests.eid = family_events.eid
261 AND family_events.e_infant IS NOT NULL)
262 LEFT OUTER JOIN eats AS inf_eats
263 ON (inf_eats.eid = family_events.eid
264 AND family_events.e_infant IS NOT NULL)
265 LEFT OUTER JOIN fished AS inf_fished
266 ON (inf_fished.eid = family_events.eid
267 AND family_events.e_infant IS NOT NULL)
268 LEFT OUTER JOIN vocs AS sib_vocs
269 ON (sib_vocs.eid = family_events.eid
270 AND family_events.e_sib IS NOT NULL)
271 LEFT OUTER JOIN plays AS sib_plays
272 ON (sib_plays.eid = family_events.eid
273 AND family_events.e_sib IS NOT NULL)
274 LEFT OUTER JOIN rides AS sib_rides
275 ON (sib_rides.eid = family_events.eid
276 AND family_events.e_sib IS NOT NULL)
277 LEFT OUTER JOIN rests AS sib_rests
278 ON (sib_rests.eid = family_events.eid
279 AND family_events.e_sib IS NOT NULL)
280 LEFT OUTER JOIN eats AS sib_eats
281 ON (sib_eats.eid = family_events.eid
282 AND family_events.e_sib IS NOT NULL)
283 LEFT OUTER JOIN fished AS sib_fished
284 ON (sib_fished.eid = family_events.eid
285 AND family_events.e_sib IS NOT NULL);</code></literallayout>
286 </figure>
287
288 <!-- Figure containing DATASHEET_EVENTS view diagram. -->
289
290 <!-- Use mediaobject role attribute to select either xhtml (html)
291 or pdf (dblatex) file paths. -->
292
293 <figure xml:id="datasheet_events-erd">
294 <title>Entity Relationship Diagram of the DATASHEET_EVENTS View</title>
295 <mediaobject>
296 <textobject> <phrase>The DATASHEET_EVENTS view ER diagram
297 intentionally omitted due to query size.</phrase>
298 </textobject>
299 </mediaobject>
300 </figure>
301 </para>
302 <!--
303 Local Variables:
304 mode: xml
305 End:
306 -->