<!DOCTYPE ripe_attributes SYSTEM "attributes.dtd">

<ripe_attributes version="$Revision: 1.10 $" author="$Author: katie $">

  <ripe_attribute name="abuse-mailbox" code="am">
    <description>
   Specifies the e-mail address to which abuse complaints should be sent.
    </description>
    <syntax>e-mail</syntax>

    <representation>
    <sqltable name="abuse_mailbox">
      <insert qtype="ud_lf_ot">
        INSERT abuse_mailbox
        SET thread_id=%d, object_id=%ld, object_type=%d, abuse_mailbox='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE abuse_mailbox
        SET thread_id=%d
        WHERE object_id=%ld
        AND abuse_mailbox='%s'
      </update>
    </sqltable>
    </representation>

    <keys searchable="inverse">

      <queries>
        <sqlquery keytype="wk_email" class="ANY">
          SELECT object_id,0
          FROM   abuse_mailbox i
          WHERE  i.abuse_mailbox = '%s'
    AND  i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="address" code="ad">
    <description>
      Full postal address of a contact.
    </description>
    <syntax>free-form</syntax>
  </ripe_attribute>

  <ripe_attribute name="admin-c" code="ac">
    <description>
   References an on-site administrative contact.
    </description>
    <syntax>nic-handle</syntax>

    <representation> 
    <sqltable name="admin_c">
      <insert qtype="ud_aux__">
        INSERT admin_c 
        SELECT %d, %ld, person_role.object_id, %d 
        FROM person_role 
        WHERE person_role.nic_hdl='%s'
      </insert>
      <update qtype="ud_ax_pr">
        UPDATE admin_c
        SET thread_id=%d
        WHERE object_id=%ld
        AND pe_ro_id=%ld
      </update>
      <dummy qtype="ud_ax_pr">
        INSERT person_role 
        SET thread_id=%d, object_id=%ld, nic_hdl='%s', object_type=%d, dummy=1
      </dummy>
    </sqltable>
    </representation>
    <keys searchable="inverse">
      <foreign value="nh"/>
      
      <queries>
        <!-- Inverse name queries don't make sense, and are slow
        <sqlquery keytype="wk_name" class="ANY">
          SELECT i.object_id
          FROM   admin_c i, %s
          WHERE  %s
          AND    i.pe_ro_id = N00.object_id
	  AND	 i.thread_id = 0
        </sqlquery>
        -->
        <sqlquery keytype="wk_nic_hdl" class="ANY">
          SELECT i.object_id,0
          FROM   admin_c i, person_role
          WHERE  i.pe_ro_id = person_role.object_id
          AND    person_role.nic_hdl  = '%s'
	  AND	 i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="aggr-mtd" code="ag">
      <description>
   Specifies how the aggregate is generated.
      </description>
      <syntax>aggr-mtd</syntax>
  </ripe_attribute>

  <ripe_attribute name="aggr-bndry" code="ab">
      <description>
   Defines a set of ASes, which form the aggregation boundary.
      </description>
      <syntax>aggr-bndry</syntax>
  </ripe_attribute>

  <ripe_attribute name="alias" code="az">
     <description>
   The canonical DNS name for the router.
     </description>
     <syntax>domain-name</syntax>
  </ripe_attribute>

  <ripe_attribute name="as-name" code="aa">
      <description>
   A descriptive name associated with an AS.
      </description>
      <syntax>object-name</syntax>
   </ripe_attribute>


  <ripe_attribute name="as-set" code="as">
    <description>
   Defines the name of the set.
    </description>
    <syntax>as-set</syntax>

    <representation>
    <sqltable name="as_set">
      <insert qtype="ud_main_">
        INSERT as_set
        SET thread_id=%d, object_id=%ld, as_set='%s', dummy=0
      </insert>
      <update qtype="ud_main_">
        UPDATE as_set
        SET thread_id=%d
        WHERE object_id=%ld
      </update>
      <select qtype="ud_main_">
        as_set='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>

      <queries>
        <sqlquery keytype="wk_assetname">
          SELECT object_id,0
          FROM   as_set
          WHERE  as_set = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="auth" code="at">
    <description>
   Defines an authentication scheme to be used.
    </description>
    <syntax>auth-scheme</syntax>

    <representation>
    <sqltable name="auth">
      <insert qtype="ud_lf_at">
        INSERT auth
        SET thread_id=%d, object_id=%ld, object_type=%d, auth='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE auth
        SET thread_id=%d
        WHERE object_id=%ld
        AND auth='%s'
      </update>
    </sqltable>
    </representation>
    <keys searchable="inverse">
      <queries>
        <sqlquery keytype="wk_auth" class="mt">
          SELECT object_id,0
          FROM   auth
          WHERE  auth = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>

  </ripe_attribute>

  <ripe_attribute name="author" code="ah">
    <description>
   References a limerick author.
    </description>
    <syntax>nic-handle</syntax>
    <representation>
      <sqltable name="author">
        <insert qtype="ud_aux__">
          INSERT author
          SELECT %d, %ld, person_role.object_id, %d
          FROM person_role
          WHERE person_role.nic_hdl='%s'
        </insert>
        <update qtype="ud_ax_pr">
          UPDATE author
          SET thread_id=%d
          WHERE object_id=%ld
          AND pe_ro_id=%ld
        </update>
        <dummy qtype="ud_ax_pr">
          INSERT person_role
          SET thread_id=%d, object_id=%ld, nic_hdl='%s', object_type=%d, dummy=1
        </dummy>
      </sqltable>
    </representation>
    <keys searchable="inverse">
      <foreign value="nh"/>
      <queries>
        <!-- Inverse name queries don't make sense, and are slow
        <sqlquery keytype="wk_name" class="ANY">
          SELECT i.object_id
          FROM   author i, %s
          WHERE  %s
          AND    i.pe_ro_id = N00.object_id
          AND    i.thread_id = 0
        </sqlquery>
        -->
        <sqlquery keytype="wk_nic_hdl" class="ANY">
          SELECT i.object_id,0
          FROM   person_role, author i
          WHERE  person_role.object_id = i.pe_ro_id
          AND    person_role.nic_hdl  = '%s'
          AND    i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="certif" code="ce">
     <description>
   Contains the public key.
     </description>
     <syntax>public-key</syntax>
  </ripe_attribute>

  <ripe_attribute name="changed" code="ch">
    <description>
   Specifies who submitted the update, and when the object was
   updated. 
   This attribute is filtered from the default whois output.
    </description>
    <syntax>changed</syntax>
  </ripe_attribute>

  <ripe_attribute xmlname="components-rt" name="components" code="co">
    <description>
   The "components:" attribute defines what component routes are
   used to form the aggregate.  
    </description>
    <syntax>components</syntax>
  </ripe_attribute>

  <ripe_attribute xmlname="components-r6" name="components" code="co">
    <description>
   The "components:" attribute defines what component routes are
   used to form the aggregate.
    </description>
    <syntax>components-r6</syntax>
  </ripe_attribute>

  <ripe_attribute name="country" code="cy">
    <description>
   Identifies the country.
    </description>
    <syntax>country-code</syntax>
  </ripe_attribute>

  <ripe_attribute name="default" code="df">
     <description>
   Specifies default routing policies.
     </description>
     <syntax>default</syntax>
  </ripe_attribute>
 
  <ripe_attribute name="mp-default" code="ma">
     <description>
   Specifies default multiprotocol routing policies.
     </description>
     <syntax>mp-default</syntax>
  </ripe_attribute>
 
  <ripe_attribute name="descr" code="de">
    <description>
   A short decription related to the object.
    </description>
    <syntax>free-form</syntax>
  </ripe_attribute>

  <ripe_attribute name="dom-net" code="di">
    <description>
   List of IP networks in a domain.
    </description>
    <syntax><ripe-list/>ipv4-address</syntax>
  </ripe_attribute>

  <ripe_attribute name="domain" code="dn">
    <description>
   Domain name.
    </description>
    <syntax>domain-name</syntax>

    <representation>
        <sqltable name="domain">
              <insert qtype="ud_main_">
                INSERT domain
                SET thread_id=%d, object_id=%ld, domain='%s'
              </insert>
              <update qtype="ud_main_"></update>
              <select qtype="ud_main_">
                domain='%s' AND
              </select>
        </sqltable>
        <radixtrees family="RX_FAM_RT">
             <IP_V4>
                SELECT domain.object_id,prefix,prefix_length,domain
                FROM inaddr_arpa,domain
                WHERE domain.object_id = inaddr_arpa.object_id
                AND   inaddr_arpa.thread_id = 0
             </IP_V4>
             <IP_V6>
                SELECT domain.object_id, msb, lsb, prefix_length, domain
                FROM ip6int,domain
                WHERE domain.object_id = ip6int.object_id
                AND ip6int.thread_id = 0
             </IP_V6>
        </radixtrees>
    </representation>

    <keys searchable="lookup">
      <primary/>

      <queries>
        <sqlquery keytype="wk_domain">
          SELECT object_id,0
          FROM   domain
          WHERE  domain = '%s'
          AND    thread_id = 0
        </sqlquery>
        <radixquery keytype="wk_iprange"   space="IP_V4" />
        <radixquery keytype="wk_ipprefix"  space="IP_V4" />
        <radixquery keytype="wk_ipaddress" space="IP_V4" />
        <radixquery keytype="wk_ip6prefix" space="IP_V6" />
      </queries>
    </keys>
  </ripe_attribute>


  <ripe_attribute name="ds-rdata" code="ds">
    <description>
      DS records for this domain.
    </description>
    <syntax>ds-rdata</syntax>

    <representation> 
    <sqltable name="ds_rdata">
      <insert qtype="ud_leaf_">
        INSERT ds_rdata 
        SET thread_id=%d, object_id=%ld, ds_rdata='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE ds_rdata 
        SET thread_id=%d 
        WHERE object_id=%ld 
        AND ds_rdata='%s'
      </update>
    </sqltable>
    </representation>

    <keys searchable="inverse">

      <queries>
        <sqlquery keytype="wk_ds_rdata" class="dn">
          SELECT object_id,0
          FROM   ds_rdata i
          WHERE  i.ds_rdata = '%s'
          AND    i.thread_id = 0        
        </sqlquery>
      </queries>

   </keys>

  </ripe_attribute>

  <ripe_attribute name="e-mail" code="em">
    <description>
   The e-mail address of a person, role, organisation or irt team.
   This attribute is filtered from the default whois output when at
   least one of the objects returned by the query contains an 
   abuse-mailbox attribute.
    </description>
    <syntax>e-mail</syntax>
    <representation>
    <sqltable name="e_mail">
     <insert qtype="ud_lf_ot">
        INSERT e_mail
        SET thread_id=%d, object_id=%ld, object_type=%d, e_mail='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE e_mail
        SET thread_id=%d
        WHERE object_id=%ld
        AND e_mail='%s'
      </update>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <queries>
        <sqlquery keytype="wk_email" class="ANY">
          SELECT object_id,0
          FROM   e_mail i
          WHERE  i.e_mail = '%s'
          AND    i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="export" code="ex">
    <description>
   Specifies an export policy expression.
    </description>
    <syntax>export</syntax>
  </ripe_attribute>

  <ripe_attribute name="mp-export" code="me">
    <description>
   Specifies a multiprotocol export policy expression.
    </description>
    <syntax>mp-export</syntax>
  </ripe_attribute>

  <ripe_attribute xmlname="export-comps-rt" name="export-comps" code="ec">
    <description>
   Defines the set's policy filter, a logical expression which
   when applied to a set of routes returns a subset of these
   routes.
    </description>
    <syntax>filter</syntax>
  </ripe_attribute>

  <ripe_attribute xmlname="export-comps-r6" name="export-comps" code="ec">
    <description>
   Defines the set's policy filter, a logical expression which
   when applied to a set of routes returns a subset of these
   routes.
    </description>
    <syntax>v6-filter</syntax>
  </ripe_attribute>

  <ripe_attribute name="fax-no" code="fx">
    <description>
   The fax number of a contact.
    </description>
    <syntax>telephone-number</syntax>
  </ripe_attribute>

  <ripe_attribute name="filter" code="fi">
    <description>
   Defines the set's policy filter.
    </description>
    <syntax>filter</syntax>
  </ripe_attribute>

  <ripe_attribute name="mp-filter" code="mf">
    <description>
   Defines the set's multiprotocol policy filter.
    </description>
    <syntax>mp-filter</syntax>
  </ripe_attribute>

  <ripe_attribute name="filter-set" code="fs">
    <description>
   Defines the name of the filter. 
    </description>
    <syntax>filter-set</syntax>

    <representation> 
    <sqltable name="filter_set">
	<insert qtype="ud_main_">
        INSERT filter_set 
        SET thread_id=%d, object_id=%ld, filter_set='%s'
      </insert>
      <update qtype="ud_main_"></update>
      <select qtype="ud_main_">
        filter_set='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>
      <queries>
        <sqlquery keytype="wk_filterset">
	SELECT object_id,0
	FROM   filter_set 
	WHERE  filter_set='%s'
	AND    thread_id=0
	</sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="fingerpr" code="fp">
    <description>
   A fingerprint of a key certificate generated by the database.
    </description>
    <syntax>fingerpr</syntax>

    <representation> 
    <sqltable name="fingerpr">
      <insert qtype="ud_leaf_">
        INSERT fingerpr 
        SET thread_id=%d, object_id=%ld, fingerpr='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE fingerpr 
        SET thread_id=%d 
        WHERE object_id=%ld 
        AND fingerpr='%s'
      </update>
    </sqltable>
    </representation>

    <keys searchable="inverse">

      <queries>
        <sqlquery keytype="wk_fingerpr" class="kc">
          SELECT object_id,0
          FROM   fingerpr i
          WHERE  i.fingerpr = '%s'
          AND    i.thread_id = 0        
        </sqlquery>
      </queries>
    </keys>

  </ripe_attribute>

  <ripe_attribute xmlname="holes-rt" name="holes" code="ho">
    <description>
   Lists the component address prefixes that are not reachable
   through the aggregate route (perhaps that part of the address
   space is unallocated).
    </description>
    <syntax><list/>address-prefix</syntax>
  </ripe_attribute>

  <ripe_attribute xmlname="holes-r6" name="holes" code="ho">
    <description>
   Lists the component IPv6 address prefixes that are not reachable
   through the aggregate route (perhaps that part of the address
   space is unallocated).
    </description>
    <syntax><list/>inet6num</syntax>
  </ripe_attribute>

  <ripe_attribute name="ifaddr" code="if">
    <description>
   Specifies an interface address within an Internet router.
    </description>
    <syntax>ifaddr</syntax>
    <representation>
      <sqltable name="ifaddr">
        <insert qtype="ud_lf_if">
          INSERT ifaddr
          SET thread_id=%d, object_id=%ld, ifaddr=%u
        </insert>
        <update qtype="ud_lf_if">
          UPDATE ifaddr
          SET thread_id=%d
          WHERE object_id=%ld
          AND ifaddr=%u
        </update>
      </sqltable>
    </representation>
    <keys searchable="lookup">
      <queries>
        <sqlquery keytype="wk_ipaddress" class="ir">
          SELECT object_id,0
          FROM   ifaddr
          WHERE  ifaddr &gt;= %u
          AND    ifaddr &lt;= %u
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="interface" code="ie">
    <description>
   Specifies a multiprotocol interface address within an Internet router.
    </description>
    <syntax>interface</syntax>
    <representation>
      <sqltable name="interface">
        <insert qtype="ud_lf_ie">
          INSERT interface
          SET thread_id=%d, object_id=%ld, 
              interface_v6_msp='%llu', interface_v6_lsp='%llu',
              interface_v4=%u
        </insert>
        <update qtype="ud_lf_ie">
          UPDATE interface
          SET    thread_id=%d
          WHERE  object_id=%ld
          AND    interface_v6_msp='%llu'
          AND    interface_v6_lsp='%llu'
          AND    interface_v4=%u
        </update>
      </sqltable>
    </representation>
    <keys searchable="lookup">
      <queries>
        <sqlquery keytype="wk_ipaddress" class="ir">
          SELECT object_id,0
          FROM   interface
          WHERE  interface_v4 &gt;= %u
          AND    interface_v4 &lt;= %u
          AND    interface_v6_msp = 0
          AND    interface_v6_lsp = 0
          AND    thread_id = 0
        </sqlquery>
        <sqlquery keytype="wk_ip6prefix" class="ir">
          SELECT object_id,0
          FROM   interface
          WHERE  interface_v6_msp='%llu'
          AND    interface_v6_lsp='%llu'
          AND    interface_v4 = 0
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="import" code="ip">
     <description>
   Specifies import policy expression.
     </description>
     <syntax>import</syntax>
  </ripe_attribute>

  <ripe_attribute name="mp-import" code="my">
     <description>
   Specifies multiprotocol import policy expression.
     </description>
     <syntax>mp-import</syntax>
  </ripe_attribute>

  <ripe_attribute name="inetnum" code="in">
    <description>
   Specifies a range of IPv4 that inetnum object presents. The
   ending address should be greater than the starting one.
    </description>
    <syntax>inetnum</syntax>

    <representation>
    <sqltable name="">
      <insert qtype="ud_ma_in">
        INSERT inetnum
        SET thread_id=%d, object_id=%ld, begin_in=%u, end_in=%u
      </insert>
      <update qtype="ud_main_"></update>
      <select qtype="ud_ma_in">
        begin_in=%u AND end_in=%u AND
      </select>
    </sqltable>
       <radixtrees family="RX_FAM_IN">
             <IP_V4>
                SELECT  object_id,begin_in,end_in
                FROM    inetnum
                WHERE   thread_id = 0
             </IP_V4>
        </radixtrees>
    </representation>

    <keys searchable="lookup">
      <primary/>
      <queries>
        <radixquery keytype="wk_iprange"   space="IP_V4" />
        <radixquery keytype="wk_ipprefix"  space="IP_V4" />
        <radixquery keytype="wk_ipaddress" space="IP_V4" />
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="inet6num" code="i6">
    <description>
   Specifies a range of IPv6 addresses in prefix notation.
    </description>
    <syntax>inet6num</syntax>

    <representation>
     <sqltable name="inet6num">
      <insert qtype="ud_ma_i6">
        INSERT inet6num
        SET thread_id=%d, object_id=%ld,
                i6_msb='%llu', i6_lsb='%llu',
                prefix_length=%u
      </insert>
      <update qtype="ud_main_"></update>
      <select qtype="ud_ma_i6">
         i6_msb='%llu' AND i6_lsb='%llu' AND prefix_length=%u AND
      </select>
     </sqltable>
     <radixtrees family="RX_FAM_RT">
        <IP_V6>
                SELECT object_id,i6_msb,i6_lsb,prefix_length
                FROM   inet6num
                WHERE  thread_id = 0
        </IP_V6>
        </radixtrees>
    </representation>

    <keys searchable="lookup">
      <primary/>
      <queries>
        <radixquery keytype="wk_ip6prefix" space="IP_V6"/>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute xmlname="inject-rt" name="inject" code="ij">
    <description>
   Specifies which routers perform the aggregation and when they
   perform it.
    </description>
    <syntax>inject</syntax>
  </ripe_attribute>

  <ripe_attribute xmlname="inject-r6" name="inject" code="ij">
    <description>
   Specifies which routers perform the aggregation and when they
   perform it.
    </description>
    <syntax>inject-r6</syntax>
  </ripe_attribute>

  <ripe_attribute name="key-cert" code="kc">
    <description>
   Defines the public key stored in the database.
    </description>
    <syntax>key-cert</syntax>
    <representation>
      <sqltable name="key_cert">
        <insert qtype="ud_main_">
          INSERT key_cert
          SET thread_id=%d, object_id=%ld, key_cert='%s'
        </insert>
        <update qtype="ud_main_"></update>
        <select qtype="ud_main_">
          key_cert='%s' AND
        </select>
      </sqltable>
    </representation>
    <keys searchable="lookup">
      <primary/>
      <queries>
        <sqlquery keytype="wk_key_cert">
          SELECT object_id,0
          FROM   key_cert
          WHERE  key_cert = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="mbrs-by-ref" code="mr">
    <description>
   This attribute can be used in all "set" objects; it allows
   indirect population of a set. If this attribute is used, the
   set also includes objects of the corresponding type (aut-num
   objects for as-set, for example) that are protected by one of
   these maintainers and whose "member-of:" attributes refer to
   the name of the set. If the value of a "mbrs-by-ref:"
   attribute is ANY, any object of the corresponding type
   referring to the set is a member of the set. If the
   "mbrs-by-ref:" attribute is missing, the set is defined
   explicitly by the "members:" attribute.
    </description>
    <syntax><list/>mbrs-by-ref</syntax>

    <representation>
    <sqltable name="mbrs_by_ref">
      <insert qtype="ud_ax_mr">
        INSERT mbrs_by_ref
        SELECT %d, %ld, mntner.object_id, %d
        FROM mntner
        WHERE mntner.mntner='%s'
      </insert>
      <update qtype="ud_ax_mr">
        UPDATE mbrs_by_ref
        SET thread_id=%d
        WHERE object_id=%ld
        AND mnt_id=%ld
      </update>
      <dummy qtype="ud_ax_mt">
        INSERT mntner
        SET thread_id=%d, object_id=%ld, mntner='%s', dummy=1
      </dummy>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <queries>
        <sqlquery keytype="wk_mntner" class="ANY">
        SELECT i.object_id,0
        FROM   mbrs_by_ref i, mntner MT
        WHERE  MT.mntner = '%s'
        AND    MT.dummy = 0
        AND    MT.object_id = i.mnt_id
        AND    i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute xmlname="members-as" name="members" code="ms">
    <description>
   Lists the members of the set.
    </description>
    <syntax><list/>members-as</syntax>
  </ripe_attribute>

  <ripe_attribute xmlname="members-is" name="members" code="ms">
    <description>
   Lists the members of the set.
    </description>
    <syntax><list/>members-is</syntax>
  </ripe_attribute>

  <ripe_attribute xmlname="mp-members-is" name="mp-members" code="mm">
    <description>
   Lists the multiprocol members of the set.
    </description>
    <syntax>mp-members-is</syntax>
  </ripe_attribute>

  <ripe_attribute xmlname="members-rs" name="members" code="ms">
    <description>
   Lists the members of the set.
    </description>
    <syntax><list/>members-rs</syntax>
  </ripe_attribute>

  <ripe_attribute xmlname="mp-members-rs" name="mp-members" code="mm">
    <description>
   Lists the multiprotocol members of the set.
    </description>
    <syntax>mp-members-rs</syntax>
  </ripe_attribute>

  <ripe_attribute name="method" code="mh">
    <description>
   Defines the type of the public key.
    </description>
    <syntax>method</syntax>
  </ripe_attribute>

  <ripe_attribute name="mnt-by" code="mb">
    <description>
   Specifies the identifier of a registered mntner object used
   for authorisation of operations performed with the object
   that contains this attribute.
    </description>
    <syntax><list/>object-name</syntax>

    <representation> 
    <sqltable name="mnt_by">
      <insert qtype="ud_aux__">
        INSERT mnt_by 
        SELECT %d, %ld, mntner.object_id, %d 
        FROM mntner WHERE mntner.mntner='%s'
      </insert>
      <update qtype="ud_ax_mt">
        UPDATE mnt_by
        SET thread_id=%d
        WHERE object_id=%ld
        AND mnt_id=%ld
      </update>
      <dummy qtype="ud_ax_mt">
        INSERT mntner 
        SET thread_id=%d, object_id=%ld, mntner='%s', dummy=1
      </dummy>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <foreign value="mt"/>

      <queries>
        <sqlquery keytype="wk_mntner" class="ANY">
          SELECT i.object_id,0
          FROM   mntner, mnt_by i
          WHERE  mntner.object_id = i.mnt_id
          AND    mntner.mntner = '%s'
	  AND	 i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="mnt-lower" code="ml">
    <description>
   Specifies the identifier of a registered mntner object used
   for hierarchical authorisation.  Protects creation of objects
   directly (one level) below in the hierarchy of an object type.
   The authentication method of this maintainer object will then 
   be used upon creation of any object directly below the object 
   that contains the "mnt-lower:" attribute.
    </description>
    <syntax><list/>object-name</syntax>

    <representation>
    <sqltable name="mnt_lower">
      <insert qtype="ud_aux__">
        INSERT mnt_lower
        SELECT %d, %ld, mntner.object_id, %d
        FROM mntner
        WHERE mntner.mntner='%s'
      </insert>
      <update qtype="ud_ax_mt">
        UPDATE mnt_lower
        SET thread_id=%d
        WHERE object_id=%ld
        AND mnt_id=%ld
      </update>
      <dummy qtype="ud_ax_mt">
        INSERT mntner
        SET thread_id=%d, object_id=%ld, mntner='%s', dummy=1
      </dummy>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <foreign value="mt"/>

      <queries>
        <sqlquery keytype="wk_mntner" class="ANY">
          SELECT i.object_id,0
          FROM   mntner, mnt_lower i
          WHERE  mntner.object_id = i.mnt_id
          AND    mntner.mntner  = '%s'
          AND    i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="mnt-ref" code="mz">
    <description>
  Specifies the maintainer objects that are entitled to add references to
  the organisation object from other objects.
    </description>
    <syntax><list/>object-name</syntax>

    <representation> 
    <sqltable name="mnt_by">
      <insert qtype="ud_aux__">
        INSERT mnt_ref
        SELECT %d, %ld, mntner.object_id, %d 
        FROM mntner WHERE mntner.mntner='%s'
      </insert>
      <update qtype="ud_ax_mt">
        UPDATE mnt_ref
        SET thread_id=%d
        WHERE object_id=%ld
        AND mnt_id=%ld
      </update>
      <dummy qtype="ud_ax_mt">
        INSERT mntner 
        SET thread_id=%d, object_id=%ld, mntner='%s', dummy=1
      </dummy>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <foreign value="mt"/>

      <queries>
        <sqlquery keytype="wk_mntner" class="oa">
          SELECT i.object_id,0
          FROM   mntner, mnt_ref i
          WHERE  mntner.object_id = i.mnt_id
          AND    mntner.mntner = '%s'
          AND    i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="mnt-domains" code="md">
    <description>
   Specifies the identifier of a registered mntner object used for
   reverse domain authorization. Protects domain objects. The
   authentication method of this maintainer object will be used for
   any encompassing reverse domain object.
    </description>
    <syntax><list/>object-name</syntax>

    <representation>
    <sqltable name="mnt_domains">
      <insert qtype="ud_aux__">
        INSERT mnt_domains
        SELECT %d, %ld, mntner.object_id, %d
        FROM mntner
        WHERE mntner.mntner='%s'
      </insert>
      <update qtype="ud_ax_mt">
        UPDATE mnt_domains
        SET thread_id=%d
        WHERE object_id=%ld
        AND mnt_id=%ld
      </update>
      <dummy qtype="ud_ax_mt">
        INSERT mntner
        SET thread_id=%d, object_id=%ld, mntner='%s', dummy=1
      </dummy>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <foreign value="md"/>

      <queries>
        <sqlquery keytype="wk_mntner" class="ANY">
          SELECT i.object_id,0
          FROM   mntner, mnt_domains i
          WHERE  mntner.object_id = i.mnt_id
          AND    mntner.mntner  = '%s'
          AND    i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="mnt-nfy" code="mn">
    <description>
   Specifies the e-mail address to be notified when an object
   protected by a mntner is successfully updated.
    </description>
    <syntax>e-mail</syntax>

    <representation>
    <sqltable name="mnt_nfy">
      <insert qtype="ud_leaf_">
        INSERT mnt_nfy
        SET thread_id=%d, object_id=%ld, mnt_nfy='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE mnt_nfy
        SET thread_id=%d
        WHERE object_id=%ld
        AND mnt_nfy='%s'
      </update>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <queries>
        <sqlquery keytype="wk_email" class="mt">
          SELECT object_id,0
          FROM   mnt_nfy
          WHERE  mnt_nfy = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="ref-nfy" code="rn">
    <description>
   Specifies the e-mail address to be notified when a reference to the
   organisation object is added or removed.
   This attribute is filtered from the default whois output when at
   least one of the objects returned by the query contains an 
   abuse-mailbox attribute.
    </description>
    <syntax>e-mail</syntax>

    <representation>
    <sqltable name="ref_nfy">
      <insert qtype="ud_leaf_">
        INSERT ref_nfy
        SET thread_id=%d, object_id=%ld, ref_nfy='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE ref_nfy
        SET thread_id=%d
        WHERE object_id=%ld
        AND ref_nfy='%s'
      </update>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <queries>
        <sqlquery keytype="wk_email" class="oa">
          SELECT object_id,0
          FROM   ref_nfy
          WHERE  ref_nfy = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>


 <ripe_attribute name="mnt-routes" code="mu">
    <description>
   This attribute references a maintainer object which is used in
   determining authorisation for the creation of route objects.
   After the reference to the maintainer, an optional list of
   prefix ranges inside of curly braces or the keyword "ANY" may
   follow. The default, when no additional set items are
   specified, is "ANY" or all more specifics. Please refer to
   RFC-2622 for more information.
    </description>
    <syntax>mnt-routes</syntax>

    <representation>
    <sqltable name="mnt_routes">
      <insert qtype="ud_ax_mu">
        INSERT mnt_routes
        SELECT %d, %ld, mntner.object_id, %d
        FROM mntner
        WHERE mntner.mntner='%s'
      </insert>
      <update qtype="ud_ax_mu">
        UPDATE mnt_routes
        SET thread_id=%d
        WHERE object_id=%ld
        AND mnt_id=%ld
      </update>
      <dummy qtype="ud_ax_mt">
        INSERT mntner
        SET thread_id=%d, object_id=%ld, mntner='%s', dummy=1
      </dummy>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <foreign value="mt"/>

      <queries>
        <sqlquery keytype="wk_mntner" class="ANY">
          SELECT i.object_id,0
          FROM   mntner, mnt_routes i
          WHERE  mntner.object_id = i.mnt_id
          AND    mntner.mntner  = '%s'
          AND    i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>  
  </ripe_attribute>

  <ripe_attribute xmlname="mnt-routes6" name="mnt-routes" code="mu">
    <description>
   This attribute references a maintainer object which is used in
   determining authorisation for the creation of route6 objects.
   This entry is for the mnt-routes attribute of route6 and inet6num classes.
   After the reference to the maintainer, an optional list of
   prefix ranges inside of curly braces or the keyword "ANY" may
   follow. The default, when no additional set items are
   specified, is "ANY" or all more specifics.
    </description>
    <syntax>mnt-routes6</syntax>

    <representation>
    <sqltable name="mnt_routes">
      <insert qtype="ud_ax_mu">
        INSERT mnt_routes
        SELECT %d, %ld, mntner.object_id, %d
        FROM mntner
        WHERE mntner.mntner='%s'
      </insert>
      <update qtype="ud_ax_mu">
        UPDATE mnt_routes
        SET thread_id=%d
        WHERE object_id=%ld
        AND mnt_id=%ld
      </update>
      <dummy qtype="ud_ax_mt">
        INSERT mntner
        SET thread_id=%d, object_id=%ld, mntner='%s', dummy=1
      </dummy>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <foreign value="mt"/>

      <queries>
        <sqlquery keytype="wk_mntner" class="ANY">
          SELECT i.object_id
          FROM   mntner, mnt_routes i
          WHERE  mntner.object_id = i.mnt_id
          AND    mntner.mntner  = '%s'
          AND    i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute xmlname="mnt-routes-an" name="mnt-routes" code="mu">
    <description>
   This attribute references a maintainer object which is used in
   determining authorisation for the creation of route6 objects.
   This entry is for the mnt-routes attribute of aut-num class.
   After the reference to the maintainer, an optional list of
   prefix ranges inside of curly braces or the keyword "ANY" may
   follow. The default, when no additional set items are
   specified, is "ANY" or all more specifics.
    </description>
    <syntax>mnt-routes-an</syntax>

    <representation>
    <sqltable name="mnt_routes">
      <insert qtype="ud_ax_mu">
        INSERT mnt_routes
        SELECT %d, %ld, mntner.object_id, %d
        FROM mntner
        WHERE mntner.mntner='%s'
      </insert>
      <update qtype="ud_ax_mu">
        UPDATE mnt_routes
        SET thread_id=%d
        WHERE object_id=%ld
        AND mnt_id=%ld
      </update>
      <dummy qtype="ud_ax_mt">
        INSERT mntner
        SET thread_id=%d, object_id=%ld, mntner='%s', dummy=1
      </dummy>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <foreign value="mt"/>

      <queries>
        <sqlquery keytype="wk_mntner" class="ANY">
          SELECT i.object_id
          FROM   mntner, mnt_routes i
          WHERE  mntner.object_id = i.mnt_id
          AND    mntner.mntner  = '%s'
          AND    i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="mntner" code="mt">
    <description>
   A unique identifier of the mntner object.
    </description>
    <syntax>object-name</syntax>

    <representation>
    <sqltable name="mntner">
      <insert qtype="ud_main_">
        INSERT mntner
        SET thread_id=%d, object_id=%ld, mntner='%s', dummy=0
      </insert>
      <update qtype="ud_main_">
        UPDATE mntner
        SET thread_id=%d
        WHERE object_id=%ld
      </update>
      <select qtype="ud_main_">
        mntner='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>

      <queries>
        <sqlquery keytype="wk_mntner">
          SELECT object_id,0
          FROM   mntner
          WHERE  mntner = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="netname" code="na">
    <description>
   The name of a range of IP address space.
    </description>
    <syntax>netname</syntax>

    <representation>
    <sqltable name="">
      <insert qtype="ud_ma_u2">
        UPDATE %s
        SET thread_id=%d, netname='%s'
        WHERE object_id=%ld
      </insert>
      <update qtype="ud_ma_u2">
        UPDATE %s
        SET thread_id=%d, netname='%s'
        WHERE object_id=%ld
      </update>
    </sqltable>
    </representation>

    <keys searchable="lookup">

      <queries>
        <sqlquery keytype="wk_netname" class="in">
          SELECT object_id,0
          FROM   inetnum
          WHERE  netname = '%s'
          AND    thread_id = 0
        </sqlquery>
        <sqlquery keytype="wk_net6name" class="i6">
          SELECT object_id,0
          FROM   inet6num
          WHERE  netname = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="nic-hdl" code="nh">
    <description>
   Specifies the NIC handle of a role or person object.  When
   creating an object, one can also specify an "AUTO" NIC handle
   by setting the value of the attribute to "AUTO-1" or 
   AUTO-1&lt;Initials&gt;.  In such case the database will assign
   the NIC handle automatically.
    </description>
    <syntax>nic-handle</syntax>

    <representation>
    <sqltable name="person_role">
      <insert qtype="ud_ma_pr">
        INSERT person_role
        SET thread_id=%d, object_type=%d, object_id=%ld, nic_hdl='%s', dummy=0
      </insert>
      <update qtype="ud_ma_pr">
        UPDATE person_role
        SET thread_id=%d, object_type=%d
        WHERE object_id=%ld
      </update>
      <select qtype="ud_main_">
        nic_hdl='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>

      <queries>
        <sqlquery keytype="wk_nic_hdl" class="pn">
          SELECT object_id,0
          FROM   person_role
          WHERE  nic_hdl = '%s'
          AND    object_type = $(C_PN)
          AND    thread_id = 0
        </sqlquery>
        <sqlquery keytype="wk_nic_hdl" class="ro">
          SELECT object_id,0
          FROM   person_role
          WHERE  nic_hdl = '%s'
          AND    object_type = $(C_RO)
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="organisation" code="oa">
    <description>
   Specifies the ID of an organisation object.  When creating
   an object, one has to specify an "AUTO" ID by setting the
   value of the attribute to "AUTO-1" or "AUTO-1&lt;letterCombination&gt;,
   so the database will assign the ID automatically.
    </description>
    <syntax>organisation</syntax>

    <representation>
    <sqltable name="organisation">
      <insert qtype="ud_main_">
        INSERT organisation
        SET thread_id=%d, object_id=%ld, organisation='%s', dummy=0
      </insert>
      <select qtype="ud_main_">
        organisation='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>

      <queries>
        <sqlquery keytype="wk_org_id" class="oa">
          SELECT object_id,0
          FROM   organisation
          WHERE  organisation = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="notify" code="ny">
    <description>
   Specifies the e-mail address to which notifications of changes
   to an object should be sent.
   This attribute is filtered from the default whois output.
    </description>
    <syntax>e-mail</syntax>

    <representation> 
    <sqltable name="notify">
      <insert qtype="ud_lf_ot">
        INSERT notify 
        SET thread_id=%d, object_id=%ld, object_type=%d, notify='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE notify 
        SET thread_id=%d 
        WHERE object_id=%ld 
        AND notify='%s'
      </update>
    </sqltable>
    </representation>

    <keys searchable="inverse">

      <queries>
        <sqlquery keytype="wk_email" class="ANY">
          SELECT object_id,0
          FROM   notify i
          WHERE  i.notify = '%s'
	  AND	 i.thread_id = 0	
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="origin" code="or">
    <description>
   Specifies the AS that originates the route. The corresponding
   aut-num object should be registered in the database.
    </description>
    <syntax>as-number</syntax>
    <representation>
      <sqltable name="route">
        <insert qtype="ud_ma_or">
          UPDATE %s 
          SET thread_id=%d, origin='%s'
          WHERE object_id=%ld
        </insert>
        <update qtype="ud_main_"></update>
        <select qtype="ud_main_">
          origin='%s' AND
        </select>
      </sqltable>
    </representation>
    <keys searchable="inverse">
      <primary/>
      <queries>
        <sqlquery keytype="wk_autnum" class="ANY">
          SELECT i.object_id,0
          FROM   last i, route
          WHERE  route.origin = '%s'
          AND    route.thread_id = 0
          AND    i.object_id = route.object_id
        </sqlquery>
        <sqlquery keytype="wk_autnum" class="ANY">
          SELECT i.object_id,0
          FROM   last i, route6
          WHERE  route6.origin = '%s'
          AND    route6.thread_id = 0
          AND    i.object_id = route6.object_id
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="owner" code="ow">
    <description>
   Specifies the owner of the public key.
    </description>
    <syntax>free-form</syntax>
  </ripe_attribute>

  <ripe_attribute name="peer" code="pe">
    <description>
   Details of any (interior or exterior) router peerings.
    </description>
    <syntax>peer</syntax>
  </ripe_attribute>

  <ripe_attribute name="mp-peer" code="mp">
    <description>
   Details of any (interior or exterior) multiprotocol router peerings.
    </description>
    <syntax>mp-peer</syntax>
  </ripe_attribute>

  <ripe_attribute name="peering" code="pg">
    <description>
   Defines a peering that can be used for importing or exporting
   routes.
    </description>
    <syntax>peering</syntax>
  </ripe_attribute>

  <ripe_attribute name="mp-peering" code="mg">
    <description>
   Defines a multiprotocol peering that can be used for importing or exporting
   routes.
    </description>
    <syntax>mp-peering</syntax>
  </ripe_attribute>

  <ripe_attribute name="person" code="pn">
    <description>
   Specifies the full name of an administrative, technical or
   zone contact person for other objects in the database.  Person
   name cannot contain titles such as "Dr.", "Prof.", "Mv.",
   "Ms.", "Mr.", etc.  It is composed of alphabetic characters.
    </description>
    <syntax>person-name</syntax>

    <representation>
    <sqltable name="names">
      <insert qtype="ud_lf_ot">
        INSERT names
        SET thread_id=%d, object_id=%ld, object_type=%d, name='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE names
        SET thread_id=%d
        WHERE object_id=%ld
        AND name='%s'
      </update>
    </sqltable>
    </representation>

    <keys searchable="lookup">

      <queries>
        <sqlquery keytype="wk_name">
          SELECT N00.object_id,0
          FROM   %s
          WHERE  %s
          AND    N00.object_type = $(C_PN)
          AND    N00.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>


  <ripe_attribute name="org-name" code="on">
    <description>
   Specifies the name of the organisation that this organisation object
   represents in the whois database.  This is an ASCII-only text attribute.  The
   restriction is because this attribute is a look-up key and the whois
   protocol does not allow specifying character sets in queries.  The user can
   put the name of the organisation in non-ASCII character sets in the
   "descr:" attribute if required. 
    </description>
    <syntax>org-name</syntax>

    <representation>
    <sqltable name="org_name">
      <insert qtype="ud_leaf_">
        INSERT org_name
        SET thread_id=%d, object_id=%ld, name='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE org_name
        SET thread_id=%d
        WHERE object_id=%ld
        AND name='%s'
      </update>
    </sqltable>
    </representation>

    <keys searchable="lookup">

      <queries>
        <sqlquery keytype="wk_name" class="oa">
          SELECT N00.object_id,0
          FROM   %s
          WHERE  %s
          AND    N00.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="phone" code="ph">
    <description>
   Specifies a telephone number of the contact.
    </description>
    <syntax>telephone-number</syntax>
  </ripe_attribute>

  <ripe_attribute name="referral-by" code="rb">
    <description>
   This attribute is required in the maintainer object.  It may
   never be altered after the addition of the maintainer.  This
   attribute refers to the maintainer that created this
   maintainer.  It may be multiple if more than one signature
   appeared on the transaction creating the object.
    </description>
    <syntax>object-name</syntax>
    <representation>
    <sqltable name="referral_by">
      <insert qtype="ud_aux__">
        INSERT referral_by
        SELECT %d, %ld, mntner.object_id, %d
        FROM mntner WHERE mntner.mntner='%s'
      </insert>
      <update qtype="ud_ax_mt">
        UPDATE referral_by
        SET thread_id=%d
        WHERE object_id=%ld
        AND mnt_id=%ld
      </update>
      <dummy qtype="ud_ax_mt">
        INSERT mntner
        SET thread_id=%d, object_id=%ld, mntner='%s', dummy=1
      </dummy>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <foreign value="mt"/>
      <queries>
        <sqlquery keytype="wk_mntner" class="ANY">
          SELECT i.object_id,0
          FROM   mntner, referral_by i
          WHERE  mntner.object_id = i.mnt_id
          AND    mntner.mntner = '%s'
          AND    i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="remarks" code="rm">
    <description>
   Contains remarks.
    </description>
    <syntax>free-form</syntax>
  </ripe_attribute>

  <ripe_attribute name="nserver" code="ns">
    <description>
   Specifies the nameservers of the domain.
    </description>
    <syntax>nameserver</syntax>

    <representation>
    <sqltable name="nserver">
      <insert qtype="ud_leaf_">
        INSERT nserver
        SET thread_id=%d, object_id=%ld, host='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE nserver
        SET thread_id=%d
        WHERE object_id=%ld
        AND host='%s'
      </update>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <queries>
        <sqlquery keytype="wk_domain" class="dn">
          SELECT object_id,0
          FROM   nserver
          WHERE  host = '%s'
          AND    thread_id = 0
        </sqlquery>
        <sqlquery keytype="wk_ipaddress" class="dn">
          SELECT object_id,0
          FROM   nserver
          WHERE  host = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="refer" code="rf">
    <description>
   Specifies the referral type, hostname and port that the server
   should use to redirect the query when using referral mechanism
   for lookups for domain objects.
    </description>
    <syntax>refer</syntax>

    <representation>
    <sqltable name="refer">
      <insert qtype="ud_lf_rf">
        INSERT refer
        SET thread_id=%d, object_id=%ld, type=%d, host='%s', port=%d
      </insert>
      <update qtype="ud_lf_rf">
        UPDATE refer
        SET thread_id=%d
        WHERE object_id=%ld
        AND type=%d
        AND host='%s'
        AND port=%d
      </update>
    </sqltable>
    </representation>
  </ripe_attribute>

  <ripe_attribute name="role" code="ro">
    <description>
   Specifies the full name of a role entity, e.g. RIPE DBM.
    </description>
    <syntax>person-name</syntax>

    <representation>
    <sqltable name="names">
      <insert qtype="ud_lf_ot">
        INSERT names
        SET thread_id=%d, object_id=%ld, object_type=%d, name='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE names
        SET thread_id=%d
        WHERE object_id=%ld
        AND name='%s'
      </update>
    </sqltable>
    </representation>

    <keys searchable="lookup">

      <queries>
        <sqlquery keytype="wk_name">
          SELECT N00.object_id,0
          FROM   %s
          WHERE  %s
          AND    N00.object_type = $(C_RO)
          AND    N00.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="route-set" code="rs">
    <description>
   Specifies the name of the route set. It is a primary key for
   the route-set object.
    </description>
    <syntax>route-set</syntax>

    <representation>
    <sqltable name="route_set">
      <insert qtype="ud_main_">
        INSERT route_set
        SET thread_id=%d, object_id=%ld, route_set='%s', dummy=0
      </insert>
      <update qtype="ud_main_">
        UPDATE route_set
        SET thread_id=%d
        WHERE object_id=%ld
      </update>
      <select qtype="ud_main_">
        route_set='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>

      <queries>
        <sqlquery keytype="wk_routesetname">
          SELECT object_id,0
          FROM   route_set
          WHERE  route_set = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="source" code="so">
    <description>
   Specifies the registry where the object is registered.  Should
   be "RIPE" for the RIPE Database.
    </description>
    <syntax>registry-name</syntax>
  </ripe_attribute>

  <ripe_attribute xmlname="status-in" name="status" code="st">
    <description>
   Specifies the status of the address range represented by
   inetnum or inet6num object.
    </description>
    <syntax>status-in</syntax>
  </ripe_attribute>

  <ripe_attribute xmlname="status-i6" name="status" code="st">
    <description>
   Specifies the status of the address range represented by
   inetnum or inet6num object.
    </description>
    <syntax>status-i6</syntax>
  </ripe_attribute>

  <ripe_attribute name="org-type" code="ot">
    <description>
  Specifies the type of the organisation.  The possible values are:
  'IANA' for Internet Assigned Numbers Authority
  'RIR' for Regional Internet Registries
  'NIR' for National Internet Registries
  'LIR' for Local Internet Registries
  WHITEPAGES for special links to industry people
  DIRECT_ASSIGNMENT for direct contract with RIPE NCC
  'OTHER' for all other organisations.
    </description>
    <syntax>org-type</syntax>
  </ripe_attribute>

  <ripe_attribute name="sub-dom" code="sd">
    <description>
   Specifies list of sub-domains of a domain.  Domain names are
   relative to the domain represented by the domain object that
   contains this attribute.
    </description>
    <syntax><ripe-list/>subdomain-name</syntax>

    <representation>
    <sqltable name="sub_dom">
      <insert qtype="ud_leaf_">
        INSERT sub_dom
        SET thread_id=%d, object_id=%ld, domain='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE sub_dom
        SET thread_id=%d
        WHERE object_id=%ld
        AND domain='%s'
      </update>
    </sqltable>
    </representation>

    <keys searchable="inverse">

      <queries>
        <sqlquery keytype="wk_domain" class="dn">
          SELECT object_id,0
          FROM   sub_dom
          WHERE  domain = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="tech-c" code="tc">
    <description>
   References a technical contact.
    </description>
    <syntax>nic-handle</syntax>

    <representation> 
    <sqltable name="tech_c">
      <insert qtype="ud_aux__">
        INSERT tech_c 
        SELECT %d, %ld, person_role.object_id, %d 
        FROM person_role 
        WHERE person_role.nic_hdl='%s'
      </insert>
      <update qtype="ud_ax_pr">
        UPDATE tech_c
        SET thread_id=%d
        WHERE object_id=%ld
        AND pe_ro_id=%ld
      </update>
      <dummy qtype="ud_ax_pr">
        INSERT person_role 
        SET thread_id=%d, object_id=%ld, nic_hdl='%s', object_type=%d, dummy=1
      </dummy>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <foreign value="nh"/>

      <queries>
        <!-- Inverse name queries don't make sense, and are slow
        <sqlquery keytype="wk_name" class="ANY">
          SELECT i.object_id
          FROM   tech_c i, %s
          WHERE  %s
          AND    i.pe_ro_id = N00.object_id
	  AND	 i.thread_id = 0
        </sqlquery>
        -->
        <sqlquery keytype="wk_nic_hdl" class="ANY">
          SELECT i.object_id,0
          FROM   tech_c i, person_role
          WHERE  i.pe_ro_id = person_role.object_id
          AND    person_role.nic_hdl  = '%s'
	  AND	 i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="org" code="og">
    <description>
    Points to an existing organisation object representing the entity that 
    holds the resource.
    </description>
    <syntax>organisation</syntax>

    <representation> 
    <sqltable name="org">
      <insert qtype="ud_aux__">
        INSERT org
        SELECT %d, %ld, organisation.object_id, %d 
        FROM organisation WHERE organisation.organisation='%s'
      </insert>
      <update qtype="ud_ax_oa">
        UPDATE org
        SET thread_id=%d
        WHERE object_id=%ld
        AND org_id=%ld
      </update>
      <dummy qtype="ud_ax_oa">
        INSERT organisation
        SET thread_id=%d, object_id=%ld, organisation='%s', dummy=1
      </dummy>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <foreign value="oa"/>

      <queries>
        <sqlquery keytype="wk_org_id" class="ANY">
          SELECT i.object_id,0
          FROM   organisation, org i
          WHERE  organisation.object_id = i.org_id
          AND    organisation.organisation = '%s'
          AND    i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="text" code="tx">
    <description>
   Text of the limerick. Must be humorous, but not malicious or
   insulting.
    </description>
    <syntax>free-form</syntax>
  </ripe_attribute>

  <ripe_attribute name="upd-to" code="dt">
    <description>
   Specifies the e-mail address to be notified when an object
   protected by a mntner is unsuccessfully updated.
    </description>
    <syntax>e-mail</syntax>

    <representation>
    <sqltable name="upd_to">
      <insert qtype="ud_leaf_">
        INSERT upd_to
        SET thread_id=%d, object_id=%ld, upd_to='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE upd_to
        SET thread_id=%d
        WHERE object_id=%ld
        AND upd_to='%s'
      </update>
    </sqltable>
    </representation>

   <keys searchable="inverse">
      <queries>
        <sqlquery keytype="wk_email" class="mt">
          SELECT object_id,0
          FROM   upd_to
          WHERE  upd_to = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>

  </ripe_attribute>

  <ripe_attribute name="zone-c" code="zc">
    <description>
   References a zone contact.
    </description>
    <syntax>nic-handle</syntax>

    <representation>
    <sqltable name="zone_c">
      <insert qtype="ud_aux__">
        INSERT zone_c
        SELECT %d, %ld, person_role.object_id, %d
        FROM person_role
        WHERE person_role.nic_hdl='%s'
      </insert>
      <update qtype="ud_ax_pr">
        UPDATE zone_c
        SET thread_id=%d
        WHERE object_id=%ld
        AND pe_ro_id=%ld
      </update>
      <dummy qtype="ud_ax_pr">
        INSERT person_role
        SET thread_id=%d, object_id=%ld, nic_hdl='%s', object_type=%d, dummy=1
      </dummy>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <foreign value="nh"/>

      <queries>
        <!-- Inverse name queries don't make sense, and are slow
        <sqlquery keytype="wk_name" class="ANY">
          SELECT i.object_id
          FROM   zone_c i, %s
          WHERE  %s
          AND    i.pe_ro_id = N00.object_id
          AND    i.thread_id = 0
        </sqlquery>
        -->
        <sqlquery keytype="wk_nic_hdl" class="ANY">
          SELECT i.object_id,0
          FROM   zone_c i, person_role
          WHERE  i.pe_ro_id = person_role.object_id
          AND    person_role.nic_hdl  = '%s'
          AND    i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="inet-rtr" code="ir">
    <description>
   Fully qualified DNS name of the inet-rtr without trailing ".".
    </description>
    <syntax>domain-name</syntax>

    <representation>
    <sqltable name="inet_rtr">
      <insert qtype="ud_main_">
        INSERT inet_rtr
        SET thread_id=%d, object_id=%ld, inet_rtr='%s'
      </insert>
      <update qtype="ud_main_"></update>
      <select qtype="ud_main_">
        inet_rtr='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>

      <queries>
        <sqlquery keytype="wk_domain">
          SELECT object_id,0
          FROM   inet_rtr
          WHERE  inet_rtr = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="as-block" code="ak">
    <description>
   Range of AS numbers.
    </description>
    <syntax>as-block</syntax>

    <representation>
    <sqltable name="as_block">
      <insert qtype="ud_ma_ak">
        INSERT as_block
        SET thread_id=%d, object_id=%lu, begin_as=%lu, end_as=%lu
      </insert>
      <update qtype="ud_main_"></update>
      <select qtype="ud_ma_ak">
        begin_as=%lu AND end_as=%lu AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>
      <queries>
        <sqlquery keytype="wk_asrange">
          SELECT object_id,0
          FROM  as_block
          WHERE begin_as &lt;= %lu
          AND   end_as   &gt;= %lu
          AND   thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="aut-num" code="an">
    <description>
   The autonomous system number.
    </description>
    <syntax>as-number</syntax>

    <representation>
    <sqltable name="aut_num">
      <insert qtype="ud_main_">
        INSERT aut_num
        SET thread_id=%d, object_id=%ld, aut_num='%s'
      </insert>
      <update qtype="ud_main_"></update>
      <select qtype="ud_main_">
        aut_num='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>

      <queries>
        <sqlquery keytype="wk_autnum">
          SELECT object_id,0
          FROM   aut_num
          WHERE  aut_num = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="limerick" code="li">
    <description>
   No longer accepted as valid syntax.
   Use poem instead.
    </description>
    <syntax>limerick</syntax>

    <representation>
    <sqltable name="limerick">
      <insert qtype="ud_main_">
        INSERT limerick
        SET thread_id=%d, object_id=%ld, limerick='%s'
      </insert>
      <update qtype="ud_main_"></update>
      <select qtype="ud_main_">
        limerick='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>

      <queries>
        <sqlquery keytype="wk_limerick" >
          SELECT object_id,0
          FROM   limerick
          WHERE  limerick = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="route" code="rt">
    <description>
   Specifies the prefix of the interAS route. Together with the
   "origin:" attribute,  constitutes a primary key of the route
   object.
    </description>
    <syntax>address-prefix</syntax>

    <representation>
    <sqltable name="route">
      <insert qtype="ud_ma_rt">
        INSERT route
        SET thread_id=%d, object_id=%ld, prefix=%u, prefix_length=%d, dummy=0
      </insert>
      <update qtype="ud_main_"></update>
      <select qtype="ud_ma_rt">
        prefix=%u AND prefix_length=%d AND
      </select>
    </sqltable>
    <radixtrees family="RX_FAM_RT">
             <IP_V4>
                SELECT  object_id,prefix,prefix_length,origin
                FROM    route
                WHERE   thread_id = 0
             </IP_V4>
        </radixtrees>
    </representation>

    <keys searchable="lookup">
      <primary/>

      <queries>
        <radixquery keytype="wk_iprange"   space="IP_V4" />
        <radixquery keytype="wk_ipprefix"  space="IP_V4" />
        <radixquery keytype="wk_ipaddress" space="IP_V4" />
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="route6" code="r6">
    <description>
   Specifies the IPv6 prefix of the interAS route. Together with the
   "origin:" attribute,  constitutes a primary key of the route6
   object.
    </description>
    <syntax>inet6num</syntax>

    <representation>
    <sqltable name="route6">
      <insert qtype="ud_ma_r6">
        INSERT route6
        SET thread_id=%d, object_id=%ld, r6_msb='%llu', r6_lsb='%llu', 
            prefix_length=%u
      </insert>
      <update qtype="ud_main_"></update>
      <select qtype="ud_ma_r6">
        r6_msb='%llu' AND r6_lsb='%llu' AND prefix_length=%u AND
      </select>
    </sqltable>
    <radixtrees family="RX_FAM_RT">
             <IP_V6>
                SELECT  object_id,r6_msb,r6_lsb,prefix_length,origin
                FROM    route6
                WHERE   thread_id = 0
             </IP_V6>
        </radixtrees>
    </representation>

    <keys searchable="lookup">
      <primary/>

      <queries>
        <radixquery keytype="wk_ip6prefix" space="IP_V6" />
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="peering-set" code="ps">
    <description>
   Specifies the name of the peering-set.
    </description>
    <syntax>peering-set</syntax>

    <representation>
    <sqltable name="peering_set">
      <insert qtype="ud_main_">
        INSERT peering_set
        SET thread_id=%d, object_id=%ld, peering_set='%s'
      </insert>
      <update qtype="ud_main_"></update>
      <select qtype="ud_main_">
        peering_set='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>
      <queries>
        <sqlquery keytype="wk_peeringset">
        SELECT object_id,0
        FROM   peering_set
        WHERE  peering_set='%s'
        AND    thread_id=0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="rtr-set" code="is">
    <description>
   Defines the name of the rtr-set.
    </description>
    <syntax>rtr-set</syntax>

    <representation>
    <sqltable name="">
      <insert qtype="ud_main_">
        INSERT rtr_set
        SET thread_id=%d, object_id=%ld, rtr_set='%s', dummy=0
      </insert>
      <update qtype="ud_main_"></update>
      <select qtype="ud_main_">
        rtr_set='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>
      <queries>
        <sqlquery keytype="wk_rtrset">
        SELECT object_id,0
        FROM   rtr_set
        WHERE  rtr_set='%s'
        AND    thread_id=0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="local-as" altName="localas" code="la">
    <description>
   Specifies the autonomous system that operates the router.
    </description>
    <syntax>as-number</syntax>

    <representation>
    <sqltable name="">
      <insert qtype="ud_ma_u2">
        UPDATE %s SET thread_id=%d, local_as='%s'
        WHERE object_id=%ld
      </insert>
      <update qtype="ud_ma_u2">
        UPDATE %s SET thread_id=%d, local_as='%s'
        WHERE object_id=%ld
      </update>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <queries>
        <sqlquery keytype="wk_autnum" class="ir">
          SELECT object_id,0
          FROM   inet_rtr
          WHERE  local_as  = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute xmlname="member-of-ir" name="member-of" code="mo">
    <description>
   This attribute can be used in the route, aut-num and inet-rtr
   classes. The value of the "member-of:" attribute identifies a
   set object that this object wants to be a member of.  This
   claim, however, should be acknowledged by a respective
   "mbrs-by-ref:" attribute in the referenced object.
    </description>
    <syntax><list/>rtr-set</syntax>

    <representation>
    <sqltable name="member_of">
      <insert qtype="ud_ax_mo">
        INSERT member_of
        SELECT %d, %ld, %s.object_id, %d
        FROM %s
        WHERE %s.%s='%s'
      </insert>
      <update qtype="ud_ax_mo">
        UPDATE member_of
        SET thread_id=%d
        WHERE object_id=%ld
        AND set_id=%ld
      </update>
      <dummy qtype="ud_ax_mo">
        INSERT %s
        SET thread_id=%d, object_id=%ld, %s='%s', dummy=1
      </dummy>
    </sqltable>
    </representation>

    <keys searchable="inverse">

      <queries>
        <sqlquery keytype="wk_routesetname" class="rt">
<!--          SELECT member_of.object_id
          FROM   route_set, member_of
          WHERE  route_set.object_id = member_of.set_id
          AND    route_set='%s'
          AND    route_set.thread_id = 0
-->
        SELECT member_of.object_id,0
        FROM mbrs_by_ref, route_set, member_of
        LEFT OUTER JOIN mnt_by ON member_of.object_id = mnt_by.object_id
        /* an old object might have no mntner at all */
        WHERE (mbrs_by_ref.mnt_id = 0 OR mbrs_by_ref.mnt_id = mnt_by.mnt_id)
        /* mbrs_by_ref is any or matches the mnt_by of a member */
        AND member_of.set_id = mbrs_by_ref.object_id
        AND route_set.object_id = member_of.set_id
        AND route_set.route_set = '%s'
        AND route_set.thread_id = 0

        </sqlquery>
        <sqlquery keytype="wk_assetname" class="an">
                <!-- the same as for route_set -->
          SELECT member_of.object_id,0
          FROM  mbrs_by_ref, as_set, member_of 
          LEFT OUTER JOIN mnt_by ON member_of.object_id = mnt_by.object_id
          WHERE (mbrs_by_ref.mnt_id = 0 OR mbrs_by_ref.mnt_id = mnt_by.mnt_id)
          AND member_of.set_id = mbrs_by_ref.object_id
          AND as_set.object_id = member_of.set_id
          AND as_set = '%s'
          AND as_set.thread_id = 0

        </sqlquery>
        <sqlquery keytype="wk_rtrset" class="is">
                <!-- the same as for route-set -->
          SELECT member_of.object_id,0
          FROM   mbrs_by_ref, rtr_set, member_of
          LEFT OUTER JOIN mnt_by ON member_of.object_id = mnt_by.object_id
          WHERE (mbrs_by_ref.mnt_id = 0 OR mbrs_by_ref.mnt_id = mnt_by.mnt_id)
          AND member_of.set_id = mbrs_by_ref.object_id
          AND rtr_set.object_id = member_of.set_id
          AND rtr_set = '%s'
          AND rtr_set.thread_id = 0

        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute xmlname="member-of-an" name="member-of" code="mo">
    <description>
   This attribute can be used in the route, aut-num and inet-rtr
   classes. The value of the "member-of:" attribute identifies a
   set object that this object wants to be a member of.  This
   claim, however, should be acknowledged by a respective
   "mbrs-by-ref:" attribute in the referenced object.
    </description>
    <syntax><list/>as-set</syntax>

<!-- For update rules, see member-of-ir  -->

  </ripe_attribute>

  <ripe_attribute xmlname="member-of-rt" name="member-of" code="mo">
    <description>
   This attribute can be used in the route, aut-num and inet-rtr
   classes. The value of the "member-of:" attribute identifies a
   set object that this object wants to be a member of.  This
   claim, however, should be acknowledged by a respective
   "mbrs-by-ref:" attribute in the referenced object.
    </description>
    <syntax><list/>route-set</syntax>

<!-- For update rules, see member-of-ir  -->

  </ripe_attribute>

  <ripe_attribute name="mnt-irt" code="mi">
    <description>
   May appear in an inetnum or inet6num object. It points to an
   irt object representing a Computer Security Incident Response
   Team (CSIRT) that handles security incidents for the address
   space specified by the inetnum or inet6num object.
    </description>
    <syntax><list/>irt</syntax>
    <representation> 
    <sqltable name="mnt_irt">
      <insert qtype="ud_aux__">
        INSERT mnt_irt 
        SELECT %d, %ld, irt.object_id, %d 
        FROM irt WHERE irt.irt='%s'
      </insert>
      <update qtype="ud_ax_it">
        UPDATE mnt_irt
        SET thread_id=%d
        WHERE object_id=%ld
        AND irt_id=%ld
      </update>
      <dummy qtype="ud_ax_it">
        INSERT irt
        SET thread_id=%d, object_id=%ld, irt='%s', dummy=1
      </dummy>
    </sqltable>
    </representation>
    <keys searchable="inverse">
      <foreign value="it"/>

      <queries>
        <sqlquery keytype="wk_irt" class="ANY">
          SELECT b.object_id,0
          FROM   irt a, mnt_irt b
          WHERE  a.object_id = b.irt_id
          AND    a.irt = '%s'
          AND    b.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
 </ripe_attribute>

  <ripe_attribute name="irt" code="it">
    <description>
   Specifies the name of the irt object. The name should start
   with the prefix "IRT-", reserved for this type of object.
    </description>
    <syntax>irt</syntax>
    <representation>
    <sqltable name="irt">
      <insert qtype="ud_main_">
        INSERT irt
        SET thread_id=%d, object_id=%ld, irt='%s', dummy=0
      </insert>
      <update qtype="ud_main_">
        UPDATE irt
        SET thread_id=%d
        WHERE object_id=%ld
      </update>
      <select qtype="ud_main_">
        irt='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>

      <queries>
        <sqlquery keytype="wk_irt">
          SELECT object_id,0
          FROM   irt
          WHERE  irt = '%s'
          AND    thread_id=0
        </sqlquery>
      </queries>
    </keys>
 </ripe_attribute>

  <ripe_attribute name="signature" code="sg">
    <description>
   References a key-cert object representing a CSIRT public key
   used by the team to sign their correspondence.
    </description>
    <syntax>key-cert</syntax>
  </ripe_attribute>

  <ripe_attribute name="encryption" code="en">
    <description>
   References a key-cert object representing a CSIRT public key
   used to encrypt correspondence sent to the CSIRT.
    </description>
    <syntax>key-cert</syntax>
  </ripe_attribute>

  <ripe_attribute name="irt-nfy" code="iy">
    <description>
   Specifies the e-mail address to be notified when a reference
   to the irt object is added or removed.
    </description>
    <syntax>e-mail</syntax>

    <representation>
    <sqltable name="irt_nfy">
      <insert qtype="ud_leaf_">
        INSERT irt_nfy
        SET thread_id=%d, object_id=%ld, irt_nfy='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE irt_nfy
        SET thread_id=%d
        WHERE object_id=%ld
        AND irt_nfy='%s'
      </update>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <queries>
        <sqlquery keytype="wk_email" class="it">
          SELECT object_id,0
          FROM   irt_nfy
          WHERE  irt_nfy = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <!-- "delete" and "override" are not really attributes but we define 
       them as such for ease of use.  They should be tagged as "pseudo" 
       in the class templates, to avoid it showing up in user queries. -->
  <ripe_attribute name="delete" code="ud">
    <description></description>
    <syntax>non-core</syntax>
  </ripe_attribute>
  <ripe_attribute name="override" code="uo">
    <description></description>
    <syntax>non-core</syntax>
  </ripe_attribute>

  <ripe_attribute name="poem" code="po">
    <description>
   Specifies the title of the poem.
    </description>
    <syntax>poem</syntax>

    <representation>
    <sqltable name="poem">
      <insert qtype="ud_main_">
        INSERT poem
        SET thread_id=%d, object_id=%ld, poem='%s'
      </insert>
      <update qtype="ud_main_"></update>
      <select qtype="ud_main_">
        poem='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>

      <queries>
        <sqlquery keytype="wk_poem" >
          SELECT object_id,0
          FROM   poem
          WHERE  poem = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="poetic-form" code="pf">
    <description>
   Specifies the poem type.
    </description>
    <syntax>poetic-form</syntax>

    <representation>
    <sqltable name="poetic_form">
      <insert qtype="ud_ax_pf">
        INSERT poetic_form
        SET thread_id=%d, object_id=%ld, poetic_form='%s', dummy=0
      </insert>
      <select qtype="ud_main_">
        poetic_form='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>

      <queries>
        <sqlquery keytype="wk_poetic_form" class="pf">
          SELECT object_id,0
          FROM   poetic_form
          WHERE  poetic_form = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="form" code="fr">
    <description>
   Specifies the identifier of a registered poem type.
    </description>
    <syntax><list/>poetic-form</syntax>

    <representation>
    <sqltable name="form">
      <insert qtype="ud_aux__">
        INSERT form
        SELECT %d, %ld, poetic_form.object_id, %d
        FROM poetic_form WHERE poetic_form.poetic_form='%s'
      </insert>
      <update qtype="ud_ax_fr">
        UPDATE form
        SET thread_id=%d
        WHERE object_id=%ld
        AND form_id=%ld
      </update>
      <dummy qtype="ud_ax_fr">
        INSERT poetic_form
        SET thread_id=%d, object_id=%ld, poetic_form='%s', dummy=1
      </dummy>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <foreign value="pf"/>

      <queries>
        <sqlquery keytype="wk_poetic_form" class="ANY">
          SELECT i.object_id,0
          FROM   poetic_form, form i
          WHERE  poetic_form.object_id = i.form_id
          AND    poetic_form.poetic_form = '%s'
          AND    i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

</ripe_attributes>
