URI application

Topic: Object-Oriented Database Management System
       Query Language using URI syntax.

Let me tell about this task in brief. My co-workers and I develop
Object-Oriented DBMS and network protocol for it.  It is not usual
DBMS because it is based not so much on the data storage as on the
network data representation. It has allowed to minimize data
transformations in a chain between the disk file and the end-client
screen. I want to tell that this DBMS is very integrated with
network technologies. And so there was an idea to develop a query
language on a basis of URI syntax instead of SQL-like syntax.
It will be much more convenient for object-oriented tasks.
However there were difficulties in the definition of such URI scheme.
Probably, there are similar decisions and already developed query
construction rules.

If you know about good ideas, please, give me references.

If this theme is interesting to you,
I shall pass to technical details.

According to URI Generic Syntax (RFC-2396) there would be
a following suitable format:

  <scheme>://<authority>/<alias>/<path>?<conditions>#<fields>

The meaning of <scheme> and <authority> components are determined
in the specified document;
<alias> - specifies a database name;
<path> - masks a path to object on a hierarchical key;
<conditions> - specifies a selecting conditions;
<fields> - defines a set of fields.

Let's consider <path> component.
For object identification in the database a hierarchical key
are used. It allows to build a tree as we usually do with
filesystem pathnames. In object-oriented languages it is
common way to separate the path components by "." delimiter.
URI gives certain freedom in <scheme-specific-part> definition,
however it is accepted to use "/" for components separating.
The character "." is used in URI to separate a hierarchical
<authority> name components. It would be necessary to know your
opinion of this conflict solution.

Fore example, URI may look like:

  uod://hostname.com/DatabaseName/Root.Node.Object

The primary applicability of the scheme is OODBMS queries.
On this, it is necessary to describe masking rules and
<conditions> representation format.
It is convenient to use "*" for any character sequence masking
(including empty), and "**" for masking any path component
sequence.  Traditionally the masking symbol for one character
is "?" but this symbol is used for <query> (or <conditions>
in this case) component separating in URI string.
Examples (it is obvious without explanation, i suppose):

  /Root.*.Object1       /Root.**.Object1
  /Root.abc!def.*       /Root.**.abc*def

I shall notice that masked path may satisfy a set of objects
(or empty set). How it will be represented in reply message is
the task of certain protocol.

Each object in OODBMS can be also masked by Class name. For Class
specification we can use usual structure "Object:Class".

Using name and class mask together it is possible to create such
complex expressions:

  /Root.*:Class1.Object1
  /Root.ab!!25*:*A
  /Root.Node1.**.A*:Class1
  /Root.A*:C,*A:D.Node1,Node7,Node8.Object1

For <conditions> specification it is possible to use any expression
after "?". The following examples demonstrate simple and complex
conditions using mathematical operations, masking, enumeration, etc.:

  /Root.Path.Object?Field1
  /Root.Path.Object?Field1=Value1
  /Root.Path.Object?(Field1+Field2)<Value1
  /Root.Path.Object?Field1=Value1&Field2>=Value2
  /Root.Path.Object?Field1=Value1,Value2
  /Root.Path.Object?Field1=Value1..Value2
  /Root.Path.Object?Field1=ab*cd!ef

Here it is necessary to think about realization of complex conditions,
for example, if it is necessary to select objects on a logical
condition:

  ( A>5 and B=8 and C<=3 ) or ( A<5 and B=2 and C<=100 )

In http URI it is accepted to express so:

  ...?A>5&B=8&C<=3+A<5&B=2&C<=100

Various WEB searching systems converts a logical operation
"and" into "&" character and logical "or" into "+". But a operation
order can not be expressed so. Furthermore, the "+" in this example
can confuse a user because "3+A" is looked as a first priority
operation.

Using brackets it is possible to writ out something like:

  ...?(A>5&B=8&C<=3)+(A<5&B=2&C<=100)
or
  ...?((A>5)&(B=8)&(C<=3))+((A<5)&(B=2)&(C<=100))

This example can be also written down using words "and", "or":

  ...?((A>5)and(B=8)and(C<=3))or((A<5)and(B=2)and(C<=100))

There is another variant of "and" coding using ";", for
example "A=2;B=3". And if it is necessary to unite some
conditions together through "or" operation we can write them so:

  ...?<Condition1>?<Condition2>?<Condition3>

For example:

  ...?A>5;B=8;C<=3?A<5;B=2;C<=100

If using of "?" is not desirable, it is possible to replace it
with "/", for example:

  ...?<Condition1>/<condition2>/<condition3>

If you want to receive a table or a report form with listed fields
instead of a objects set as a query result, is possible is specify
a fields list. For example:

  /Root.Object1#Field1,Field2,Field3

Using all URL components together:

  /Root.**.Name!mask*:Class#Field1,Field2,Field3?Field4>5;Field5=ABCD

I purposely use "#" before "?" because field list specification is
logically follows <path> component.

It is a large and complex topic, because such syntax can be used
in any scheme solving data selecting task. I wait for your comments.
Thanks.

Received on Thursday, 19 December 2002 12:42:00 UTC