/ doc / views /
/doc/views/event_bout_aggs.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) 2014, 2018 The Meme Factory, Inc. http://www.meme.com
11 - See document output for full copyright information. -->
12
13 <!-- Core documentation on the EVENT_BOUT_AGGS view.
14
15 - This is indeed the query that makes the view, so don't break it!
16
17 - The "code" element must have a 'role="view"' attribute
18 - so that Gombe-MI code generation can get the code
19 - and actually make the view!
20
21 - Smushed event_bouts view. One row per bout.
22 -->
23
24 <para xmlns="http://docbook.org/ns/docbook"
25 version="5.0">
26
27 <figure xml:id="event_bout_aggs-code">
28 <title>Query Defining the EVENT_BOUT_AGGS View</title>
29 <literallayout><code role="view">
30 SELECT event_bouts.followid AS followid
31 , event_bouts.function AS function
32 , event_bouts.animid AS animid
33 , event_bouts.role AS role
34 , event_bouts.chimpid AS chimpid
35 , event_bouts.bout AS bout
36 , event_bouts.behavior AS behavior
37 , BOOL_OR(event_bouts.uncertain) AS uncertain
38 , MIN(event_bouts.time) AS start_time
39 , MAX(event_bouts.time) AS stop_time
40 , event_bouts.prior_gap AS prior_gap
41 , event_bouts.gap_noobs AS gap_noobs
42 , event_bouts.left_censored AS left_censored
43 , event_bouts.right_censored AS right_censored
44 , event_bouts.day_start AS day_start
45 , event_bouts.day_end AS day_end
46 FROM event_bouts
47 GROUP BY event_bouts.followid
48 , event_bouts.animid
49 , event_bouts.bout
50 , event_bouts.behavior
51 -- The values that are unique per above anyway
52 , event_bouts.function
53 , event_bouts.role
54 , event_bouts.chimpid
55 , event_bouts.prior_gap
56 , event_bouts.gap_noobs
57 , event_bouts.left_censored
58 , event_bouts.right_censored
59 , event_bouts.day_start
60 , event_bouts.day_end</code><code>;</code></literallayout>
61 </figure>
62
63 <!-- Figure containing EVENT_BOUT_AGGS view diagram. -->
64
65 <!-- Use mediaobject role attribute to select either xhtml (html)
66 or pdf (dblatex) file paths. -->
67
68 <figure xml:id="event_bout_aggs-erd">
69 <title>Entity Relationship Diagram of the EVENT_BOUT_AGGS View</title>
70 <mediaobject>
71 <textobject> <phrase>ER diagram intentionally omitted.</phrase>
72 </textobject>
73 </mediaobject>
74 </figure>
75 </para>
76 <!--
77 Local Variables:
78 mode: xml
79 End:
80 -->