<aname="L6"></a><ttclass="py-lineno"> 6</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># This program is free software; you can redistribute it and/or</tt></tt>
<aname="L7"></a><ttclass="py-lineno"> 7</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># modify it under the terms of the GNU General Public License</tt></tt>
<aname="L8"></a><ttclass="py-lineno"> 8</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># as published by the Free Software Foundation; either version 2 </tt></tt>
<aname="L9"></a><ttclass="py-lineno"> 9</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># of the License, or (at your option) any later version.</tt></tt>
<aname="L11"></a><ttclass="py-lineno"> 11</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># This program is distributed in the hope that it will be useful,</tt></tt>
<aname="L12"></a><ttclass="py-lineno"> 12</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># but WITHOUT ANY WARRANTY; without even the implied warranty of</tt></tt>
<aname="L13"></a><ttclass="py-lineno"> 13</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</tt></tt>
<aname="L14"></a><ttclass="py-lineno"> 14</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># GNU General Public License for more details. </tt></tt>
<aname="L16"></a><ttclass="py-lineno"> 16</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># You should have received a copy of the GNU General Public License</tt></tt>
<aname="L17"></a><ttclass="py-lineno"> 17</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># along with this program; if not, write to the Free Software</tt></tt>
<aname="L18"></a><ttclass="py-lineno"> 18</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.</tt></tt>
<aname="L21"></a><ttclass="py-lineno"> 21</tt><ttclass="py-line"><ttclass="py-docstring">""" Basic data types that can be used as attributes for a L{Record</tt></tt>
<aname="L24"></a><ttclass="py-lineno"> 24</tt><ttclass="py-line"><ttclass="py-docstring">Basic attributes of a record can be B{qualified} by one or more</tt></tt>
<aname="L25"></a><ttclass="py-lineno"> 25</tt><ttclass="py-line"><ttclass="py-docstring">additional sub-attributes. For instance, an attribute I{author} of</tt></tt>
<aname="L26"></a><ttclass="py-lineno"> 26</tt><ttclass="py-line"><ttclass="py-docstring">type L{Person} can have, for every Person instance, a sub-attribute of</tt></tt>
<aname="L27"></a><ttclass="py-lineno"> 27</tt><ttclass="py-line"><ttclass="py-docstring">type L{Date} that represents its birth date."""</tt></tt>
</div><divid="_Qualified-collapsed"style="display:none;"pad="+++"indent="++++"></div><divid="_Qualified-expanded"><aname="L41"></a><ttclass="py-lineno"> 41</tt><ttclass="py-line"><ttclass="py-docstring">""" Mix-in class that provides qualifiers to attributes, making</tt></tt>
<aname="L42"></a><ttclass="py-lineno"> 42</tt><ttclass="py-line"><ttclass="py-docstring"> them behave like composite data types (but not arbitrarily nested</tt></tt>
</div><divid="_Qualified.is_complete-collapsed"style="display:none;"pad="+++"indent="++++++++"></div><divid="_Qualified.is_complete-expanded"><aname="L71"></a><ttclass="py-lineno"> 71</tt><ttclass="py-line"><ttclass="py-docstring">"""Returns True if the field has an actual value (ie, hasn't</tt></tt>
<aname="L72"></a><ttclass="py-lineno"> 72</tt><ttclass="py-line"><ttclass="py-docstring"> been created by adding qualifiers only)"""</tt></tt>
<aname="L79"></a><ttclass="py-lineno"> 79</tt><ttclass="py-line"><ttclass="py-docstring"> It is used, when you add qualifiers before you add the main field</tt></tt>
<aname="L80"></a><ttclass="py-lineno"> 80</tt><ttclass="py-line"><ttclass="py-docstring"> to a record. Trying to store it will raise an error.</tt></tt>
<aname="L87"></a><ttclass="py-lineno"> 87</tt><ttclass="py-line"><ttclass="py-string">"but is empty: %s"</tt><ttclass="py-op">%</tt><ttclass="py-name">self</tt><ttclass="py-op">.</tt><ttclass="py-name">q</tt><ttclass="py-op">)</tt></tt>
</div><divid="Person-collapsed"style="display:none;"pad="+++"indent="++++"></div><divid="Person-expanded"><aname="L97"></a><ttclass="py-lineno"> 97</tt><ttclass="py-line"><ttclass="py-docstring">''' A person name. '''</tt></tt>
</div><divid="Date-collapsed"style="display:none;"pad="+++"indent="++++"></div><divid="Date-expanded"><aname="L180"></a><ttclass="py-lineno">180</tt><ttclass="py-line"><ttclass="py-docstring">''' A date. '''</tt></tt>
</div><divid="Text-collapsed"style="display:none;"pad="+++"indent="++++"></div><divid="Text-expanded"><aname="L257"></a><ttclass="py-lineno">257</tt><ttclass="py-line"><ttclass="py-docstring">''' Textual data '''</tt></tt>
</div><divid="URL-collapsed"style="display:none;"pad="+++"indent="++++"></div><divid="URL-expanded"><aname="L299"></a><ttclass="py-lineno">299</tt><ttclass="py-line"><ttclass="py-docstring">''' An URL '''</tt></tt>
</div><divid="URL.index-collapsed"style="display:none;"pad="+++"indent="++++++++"></div><divid="URL.index-expanded"><aname="L324"></a><ttclass="py-lineno">324</tt><ttclass="py-line"><ttclass="py-comment"># do not index the document suffix, only the server name and document page</tt></tt>
<aname="L383"></a><ttclass="py-lineno">383</tt><ttclass="py-line"><ttclass="py-docstring"> In the simplest case, this can be seen as a value in a enumerated</tt></tt>
<aname="L384"></a><ttclass="py-lineno">384</tt><ttclass="py-line"><ttclass="py-docstring"> set of possible values. The possible values are defined as</tt></tt>
<aname="L385"></a><ttclass="py-lineno">385</tt><ttclass="py-line"><ttclass="py-docstring"> L{Pyblio.Schema.TxoItem}s, and are stored in the</tt></tt>
<aname="L386"></a><ttclass="py-lineno">386</tt><ttclass="py-line"><ttclass="py-docstring"> L{Store.Database}, in the B{txo} attribute, and L{Store.Record}s</tt></tt>
<aname="L387"></a><ttclass="py-lineno">387</tt><ttclass="py-line"><ttclass="py-docstring"> can contain Txo attributes which refer to these</tt></tt>
<aname="L388"></a><ttclass="py-lineno">388</tt><ttclass="py-line"><ttclass="py-docstring"> L{Pyblio.Schema.TxoItem}s. Say you have a list of known document</tt></tt>
<aname="L389"></a><ttclass="py-lineno">389</tt><ttclass="py-line"><ttclass="py-docstring"> types in the I{document-type} taxonomy. You can then affect the</tt></tt>
<aname="L390"></a><ttclass="py-lineno">390</tt><ttclass="py-line"><ttclass="py-docstring"> document type to the I{type} attribute of a record with the</tt></tt>
<aname="L391"></a><ttclass="py-lineno">391</tt><ttclass="py-line"><ttclass="py-docstring"> following operations:</tt></tt>
<aname="L443"></a><ttclass="py-lineno">443</tt><ttclass="py-line"><ttclass="py-comment"># If 'other' is not of the proper type, simply consider</tt></tt>
<aname="L444"></a><ttclass="py-lineno">444</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># 'self' as superior.</tt></tt>