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">
7 <!ENTITY % constants SYSTEM "../constants">
10 <!-- Copyright (C) 2013, 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. -->
14 <!-- Core documentation on the FOCAL_EVENTS view.
16 - This is indeed the query that makes the view, so don't break it!
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!
23 <para xmlns="http://docbook.org/ns/docbook"
26 <figure xml:id="focal_events-code">
27 <title>Query Defining the FOCAL_EVENTS View</title>
29 <code role="view">SELECT events.eid AS eid
30 , events.intid AS intid
31 , focals.pid AS focalpid
32 , otherpart.pid AS otherpid
33 , events.behavior AS behavior
34 , events.position AS position
35 , events.uncertain AS uncertain
36 , followparts.role AS focalrole
37 , focals.participant AS focal
38 , focals.part AS focalpart
40 WHEN events.baboon THEN
43 followrole(intervals.followid, otherpart.participant)
45 , otherpart.participant AS other
47 WHEN events.baboon THEN
49 WHEN focals.part = 'gmi_actor' THEN
51 WHEN focals.part = 'gmi_actee' THEN
59 , events.baboon AS baboon
60 , events.comment AS comment
63 ON (intervals.intid = events.intid)
65 ON (followparts.followid = intervals.followid)
66 JOIN chimpids AS fp_ids
67 ON (fp_ids.chimpid = followparts.chimpid)
69 ON (focals.eid = events.eid)
70 JOIN chimpids AS focal_ids
71 ON (focal_ids.chimpid = focals.participant)
72 LEFT OUTER JOIN parts AS otherpart
73 ON (otherpart.eid = events.eid
74 AND focals.pid IS DISTINCT FROM otherpart.pid)
75 WHERE focal_ids.animid = fp_ids.animid</code><code>;</code></literallayout>
78 <!-- Figure containing FOCAL_EVENTS view diagram. -->
80 <!-- Use mediaobject role attribute to select either xhtml (html)
81 or pdf (dblatex) file paths. -->
83 <figure xml:id="focal_events-erd">
84 <title>Entity Relationship Diagram of the FOCAL_EVENTS View</title>
86 <imageobject role="html">
87 <imagedata scalefit="1" width="6in"
88 fileref="/doc/diagrams/focal_events.png" format="PNG" />
90 <imageobject role="dblatex">
91 <imagedata scalefit="1" width="6in"
92 fileref="/diagrams/focal_events.eps" format="EPS" />
95 <textobject> <phrase>If we could we would display here the
96 diagram showing how the FOCAL_EVENTS view is constructed.</phrase>