Subject: [Ietf-not43] how to scare small children

From: anewton at ecotroph.net (Andrew Newton)
Date: Thu Sep 11 11:56:27 2003

How To Scare Small Children:
Using Generalized Query Mechanisms As Frightening Devices
---------------------------------------------------------

Because the question of using a generalized query mechanism in
IRIS has surfaced, I have taken the time to put together what
one could look like.  As stated previously, it is not that IRIS
cannot do it, it is simply that it has not been done.

Attached is a set of samples of the generalized query syntax
and the XML Schema defining the formal syntax.  I believe this
to be at least comparably powerful to LDAP's query syntax.

WARNING: Just because it CAN be done, does not mean that it
SHOULD be done.  The point of this excercise is to show that
the necessary expressiveness is at our ready.

Personally, I'd favor a much more scaled back version of
this to solve the corner cases, if at all.

-andy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: greg-request.xml
Type: text/xml
Size: 4019 bytes
Desc: not available
Url : http://lists.verisignlabs.com/pipermail/ietf-not43/attachments/20030911/2a1b21bd/greg-request-0001.xml
-------------- next part --------------
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:greg="urn:ietf:params:xml:ns:greg1"
        xmlns:iris="urn:ietf:params:xml:ns:iris1"
        targetNamespace="urn:ietf:params:xml:ns:greg1"
        elementFormDefault="qualified" >

  <import namespace="urn:ietf:params:xml:ns:iris1" />

  <annotation>
    <documentation>
      General registry schema 
      derived from IRIS schema 
    </documentation>
  </annotation>

  <!--             -->
  <!-- Query types -->
  <!--             -->

  <!-- find Object query               -->
  <!-- This is an interesting academic -->
  <!-- notion but a horrible idea.     -->
  <!-- It is provided to show that     -->
  <!-- this sort of thing can be done. -->
  
  <complexType name="findObjectsType">
    <complexContent>
      <extension base="iris:queryType">
        <sequence>

          <!-- 'of result type'           -->
          <!-- specifies which types of   -->
          <!-- entities should be         -->
          <!-- returned.  The values of   -->
          <!-- QName must be derivatives  -->
          <!-- of iris:result.            -->
          
          <element 
            name="ofResultType"
            type="greg:qnameListType"
            minOccurs="0" 
            maxOccurs="1" />

          <choice
            minOccurs="0" 
            maxOccurs="1" >

            <!-- 'by constraints'           -->
            <!-- specifies that the search  -->
            <!-- is to be narrowed by a set -->
            <!-- of constraints.            -->
            <!-- Such constraints are of    -->
            <!-- nature 'is value of x      -->
            <!-- greater than y', etc...    -->
            
            <element
              name="byConstraints"
              type="greg:byConstraintsType" />

            <!-- 'by search function'       -->
            <!-- specifies that the search  -->
            <!-- is to be narrowed by a     -->
            <!-- specific search function   -->
            <!-- that is defined locally.   -->
			      
			      <element
			        name="bySearchFunction"
			        type="greg:bySearchFunctionType" />

          </choice>

          <!-- 'with reference'                       -->
          <!-- allows for the expression of narrowing -->
          <!-- a search via the relationships objects -->
          <!-- have with one another. The selection   -->
          <!-- of the references can also be narrowed -->
          <!-- by constraints or by locally defined   -->
          <!-- search functions. The reference itself -->
          <!-- can be  narrowed with the              -->
          <!-- 'toResultType' (to result type) and    -->
          <!-- the 'asRoleType' (as role type)        -->
          <!-- attributes.  'toResultType' specifies  -->
          <!-- a reference to a type of entity where  -->
          <!-- as 'asRoleType' specifies how the      -->
          <!-- entity is related.                     -->
          
          <element
            name="withReference"
            minOccurs="0" maxOccurs="unbounded" >
            <complexType>
              <choice
                minOccurs="0" 
                maxOccurs="1" >
			          <element
			            name="byConstraints"
			            type="greg:byConstraintsType" />
			          <element
			            name="bySearchFunction"
			            type="greg:bySearchFunctionType" />
              </choice>
              <attribute
                name="toResultType"
                type="QName" />
              <attribute
                name="asRoleType"
                type="QName" />
            </complexType>
          </element>

        </sequence>
      </extension>
    </complexContent>
  </complexType>

  <element name="findObjects"
    type="greg:findObjectsType"
    substitutionGroup="iris:query" />

  <simpleType name="qnameListType">
    <list itemType="QName" />
  </simpleType>

  <complexType name="byConstraintsType">
    <sequence>
      <element
        name="not"
        minOccurs="0"
        maxOccurs="1">
        <complexType />
      </element>
      <element
        name="constraint"
        type="greg:constraintType" />
      <choice
        minOccurs="0"
        maxOccurs="unbounded">
        <choice>
          <element
            name="and">
            <complexType />
          </element>
          <element
            name="or">
            <complexType />
          </element>
        </choice>
	      <element
	        name="not"
	        minOccurs="0"
	        maxOccurs="1">
	        <complexType />
	      </element>
        <element
          name="constraint"
          type="greg:constraintType" />
      </choice>
    </sequence>
  </complexType>

  <complexType name="constraintType">
    <choice>
      <element
        name="before"
        type="dateTime" />
      <element
        name="after"
        type="dateTime" />
      <sequence>
	      <element
	        name="beginsWith"
	        type="normalizedString" 
	        minOccurs="1" maxOccurs="1"/>
	      <element
	        name="endsWith"
	        type="normalizedString" 
	        minOccurs="0" maxOccurs="1"/>
      </sequence>
      <element
        name="exactMatch"
        type="normalizedString" />
      <element
        name="containsToken"
        type="token" />
      <element
        name="greaterThan"
        type="integer" />
      <element
        name="lessThan"
        type="integer" />
      <element
        name="equalTo"
        type="integer" />
      <element
        name="greaterThanOrEqualTo"
        type="integer" />
      <element
        name="lessThanOrEqualTo"
        type="integer" />
      <element
        name="is"
        type="boolean" />
      <element
        name="doesExist">
        <complexType />
      </element>
      <element
        name="doesNotExist">
        <complexType />
      </element>
    </choice>
    <attribute
      name="type"
      type="QName" 
      use="required" />
  </complexType>

  <complexType name="bySearchFunctionType">
    <sequence>
      <element name="parameter">
        <complexType>
          <choice
            minOccurs="1"
            maxOccurs="unbounded" >
            <element
              name="boolean"
              type="boolean" />
            <element
              name="dateTime"
              type="dateTime" />
            <element
              name="integer"
              type="integer" />
            <element
              name="token"
              type="token" />
            <element
              name="undefinedStringData"
              type="string" />
            <element
              name="undefinedBinaryData"
              type="base64Binary" />
            <element
              name="valueOfObjectProperty">
              <complexType />
            </element>
          </choice>
          <attribute
            name="name"
            type="QName"
            use="required" />
        </complexType>
      </element>
    </sequence>
    <attribute
      name="name"
      type="QName"
      use="required" />
  </complexType>

  <!--              -->
  <!-- Result types -->
  <!--              -->

  <complexType name="generalObjectType">
    <complexContent>
      <extension base="iris:resultType">
        <sequence>
          <element
            name="property"
            minOccurs="1" maxOccurs="unbounded">
            <complexType>
              <sequence>
                <choice
                  minOccurs="1" maxOccurs="unbounded">
                  <element
                    name="boolean"
                    type="boolean" />
                  <element
                    name="integer"
                    type="integer" />
                  <element
                    name="dateTime"
                    type="dateTime" />
                  <element
                    name="string"
                    type="normalizedString" />
                  <element
                    name="binaryData"
                    type="base64Binary" />
                  <element
                    name="uri"
                    type="anyURI" />
                </choice>
              </sequence>
            </complexType>
          </element>
          <element name="relation"
            minOccurs="0" maxOccurs="unbounded" >
            <complexType>
              <sequence>
                <element ref="iris:entity" 
                  minOccurs="1" maxOccurs="unbounded" />
              </sequence>
              <attribute
                name="type"
                type="QName" />
            </complexType>
          </element>
        </sequence>
      </extension>
    </complexContent>
  </complexType>

  <element name="generalObject"
    type="greg:generalObjectType"
    substitutionGroup="iris:result" />

</schema>

---

From: wessorh at ar.com (Rick Wesson)
Date: Tue Sep 16 10:23:48 2003

from a policy perspective I would not encourage gTLD Registrars to
implement this on a publicly facing service.

its great for a under-the-hood thingy but for the public, frankly, its
just asking for abuse.

-rick

---

From: anewton at ecotroph.net (Andrew Newton)
Date: Tue Sep 16 11:10:21 2003

> its great for a under-the-hood thingy but for the public, frankly, its

You are being generous.  It is not even good for that.

Given the lack of response, it would seem that this working group does 
not care for a generic query syntax.

-andy

---

From: richard at shockey.us (Richard Shockey)
Date: Tue Sep 16 11:50:47 2003

At 11:40 AM 9/16/2003 -0400, Andrew Newton wrote:

>Given the lack of response, it would seem that this working group does not 
>care for a generic query syntax.

I would'nt say that, but crawl before you run .. solve the known problem 
first.  There is always room for V 2.0.

Richard Shockey, Senior Manager, Strategic Technology Initiatives
NeuStar Inc.
46000 Center Oak Plaza  -   Sterling, VA  20166
sip:rshockey(at)iptel.org   ENUM +87810-13313-31331
PSTN Office +1 571.434.5651 PSTN Mobile: +1 703.593.2683,  Fax: +1 815.333.1237
<mailto:richard(at)shockey.us> or <mailto:richard.shockey(at)neustar.biz>
<http://www.neustar.biz> ; <http://www.enum.org>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<