/ doc / views /
/doc/views/noobs.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 NOBOS 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
22 <para xmlns="http://docbook.org/ns/docbook"
23 version="5.0">
24
25 <figure xml:id="noobs-code">
26 <title>Query Defining the NOOBS View</title>
27 <literallayout><code role="view">
28 SELECT followparts.followid AS followid
29 , followparts.chimpid AS chimpid
30 , followparts.role AS role
31 , chimpids.animid AS animid
32 , times.time AS time
33 FROM followparts
34 JOIN chimpids ON (chimpids.chimpid = followparts.chimpid)
35 CROSS JOIN
36 (SELECT GENERATE_SERIES('2000-01-01 gmi_day_start'::TIMESTAMP
37 , '2000-01-01 gmi_day_end'::TIMESTAMP
38 , '1 minute')::TIME
39 AS time
40 ) AS times
41 WHERE NOT EXISTS
42 (SELECT 1
43 FROM intervals
44 JOIN events ON (events.intid = intervals.intid)
45 JOIN parts ON (parts.eid = events.eid)
46 JOIN chimpids AS part_cids
47 ON (part_cids.chimpid = parts.participant)
48 WHERE intervals.followid = followparts.followid
49 AND intervals.time = times.time
50 AND part_cids.animid = chimpids.animid
51 LIMIT 1)</code><code>;</code></literallayout>
52 </figure>
53
54 <!-- Figure containing NOOBS view diagram. -->
55
56 <!-- Use mediaobject role attribute to select either xhtml (html)
57 or pdf (dblatex) file paths. -->
58
59 <figure xml:id="noobs-erd">
60 <title>Entity Relationship Diagram of the NOOBS View</title>
61 <mediaobject>
62 <imageobject role="html">
63 <imagedata scalefit="1" width="6in"
64 fileref="/doc/diagrams/noobs.png" format="PNG" />
65 </imageobject>
66 <imageobject role="dblatex">
67 <imagedata scalefit="1" width="6in"
68 fileref="/diagrams/noobs.eps" format="EPS" />
69 </imageobject>
70
71 <textobject> <phrase>If we could we would display here the
72 diagram showing how the NOOBS view is constructed.</phrase>
73 </textobject>
74 </mediaobject>
75 </figure>
76 </para>
77 <!--
78 Local Variables:
79 mode: xml
80 End:
81 -->