Re: revised gda-xml-query.dtd



On ven, 14 jui 2000, you wrote:
> 
> Hi Vivien,
> 
> in the attachment you find the revised gda-xml-query.dtd and two examples.
> 
> new features:
> - create/drop of table/view/sequence/index
> - intersect/minus
> 
> As usual comments and suggestions appreciated.
> 

I have some questions about the last DTD:

<!ELEMENT query (target?, sources?, joins*, values?, qual?, chain*, sort?)>
<!ATTLIST query
          id NMTOKEN #IMPLIED
          op (select|insert|update|delete|create|drop) #REQUIRED>

<!ELEMENT target (table|view|sequence|index)*>

<!ELEMENT sources (table|view)*>

<!ELEMENT joins (and|or|not|eq|ne|lt|le|gt|ge)*>
<!ATTLIST joins
          type (inner|left|right) "inner"
          left  IDREF #REQUIRED
          right IDREF #REQUIRED>

<!ELEMENT values (const|query|field|func|aggregate)+>

<!ELEMENT qual (and|or|not|eq|ne|lt|le|gt|ge|null|like|between|in|exists)>

<!ELEMENT chain (sources, joins*, values, qual?)>
<!ATTLIST chain 
          type (union|unionall|intersect|minus) #REQUIRED>



----> I'll have to think a bit more about this, since I first thought it would
be better to chain entire queries.



<!ELEMENT sort (COLUMN)+>

<!ELEMENT table (fielddef*,primary?,foreign*)?>
<!ATTLIST table
          id      ID       #IMPLIED
          name    NMTOKEN  #REQUIRED
          columns NMTOKENS #IMPLIED
          temp (yes|no) "no">

<!ELEMENT view EMPTY EMPTY>
<!ATTLIST view
          id      ID       #IMPLIED
          name    NMTOKEN  #REQUIRED
          columns NMTOKENS #IMPLIED>

<!ELEMENT const EMPTY>
<!ATTLIST const
          value CDATA   #IMPLIED
          alias NMTOKEN #IMPLIED
          null (yes|no) "no">

<!ELEMENT field EMPTY>
<!ATTLIST field
          source IDREF   #REQUIRED
          name   NMTOKEN #REQUIRED
          alias  NMTOKEN #IMPLIED
          group (yes|no) "no">

<!ELEMENT func (field|const|func)*>
<!ATTLIST func 
          name  NMTOKEN #REQUIRED
          alias NMTOKEN #IMPLIED>

---------> Add the aggregate attibut as you mentionned it. It was a better idea
than the aggregate element!


<!ELEMENT and (and|or|not|eq|ne|lt|le|gt|ge|null|like|between|in|exists)+>

<!ELEMENT or (and|or|not|eq|ne|lt|le|gt|ge|null|like|between|in|exists)+>

<!ELEMENT not (and|or|not|eq|ne|lt|le|gt|ge|null|like|between|in|exists)>

<!ELEMENT eq ((const|field|func),(const|query|field|func))>

<!ELEMENT ne ((const|field|func),(const|query|field|func))>

<!ELEMENT lt ((const|field|func),(const|query|field|func))>

<!ELEMENT le ((const|field|func),(const|query|field|func))>

<!ELEMENT gt ((const|field|func),(const|query|field|func))>

<!ELEMENT ge ((const|field|func),(const|query|field|func))>

<!ELEMENT null (const|field|func)>

<!ELEMENT like ((const|field|func),(const|query|field|func))>

<!ELEMENT between ((const|field|func),(const|field|func),(const|field|func))>

<!ELEMENT in (field,query)>

<!ELEMENT exists (query)>

<!ELEMENT column EMPTY>
<!ATTLIST column num  CDATA #REQUIRED
                 order (asc|desc) "asc">

<!ELEMENT fielddef EMPTY>
<!ATTLIST fielddef
          id   ID      #IMPLIED
          name NMTOKEN #REQUIRED
          type (int|float|varchar|fixedchar|datetime) #REQUIRED
          size CDATA   #IMPLIED
          notnull (yes|nos) "no">


--------> The type is too much limited like this, we should put a NMTOKEN
instead. But I don't know how to care about data types which require one or
more arguments (such as varchar(30) or varchar(50)). Any idea?


<!ELEMENT primary EMPTY>
<ATTLIST  primary
          key IDREFS #REQUIRED>

<!ELEMENT foreign EMPTY>
<ATTLIST  key   IDREFS   #REQUIRED
          table NMTOKEN  #REQUIRED
          ref   NMTOKENS #REQUIRED>

<!ELEMENT sequence EMPTY>
<ATTLIST  sequence
          name  NMTOKEN #REQUIRED
          start CDATA   #IMPLIED
          inc   CDATA   #IMPLIED>


---------> I wonder if it is enough to define sequences for ALL the DBMS (I
know that postgres allow the user to set more attributes, what about the
others). We have to think more about it :)


<!ELEMENT index EMPTY>
<ATTLIST  index
          name    NMTOKEN  #REQUIRED
          table   NMTOKEN  #REQUIRED
          columns NMTOKENS #REQUIRED
          unique  (yes|no) "no">




Anyway, you are doing a real good job with the DTD (I wouldn't have done that
much!)

 Regards,

Vivien




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]