Professional Documents
Culture Documents
Odmg Oql User Manual: Release 5.0 - April 1998
Odmg Oql User Manual: Release 5.0 - April 1998
User Manual
Release 5.0 - April 1998
In for m ation in t h is docu m en t is su bject t o ch an ge with ou t
n ot ice an d sh ou ld n ot be con str u ed as a com m it m en t by
O2 Tech n ology.
1 Introduction 9
2 Getting Started 17
2.6 Conversions..............................................................................37
List to set ......................................................................................37
Set to list.......................................................................................37
6 ODM G OQL User Man u al
TABLE OF CONTENTS
Flatten .......................................................................................... 38
2.7 Combining operators .............................................................. 38
3 OQL Rationale 43
4 OQL Reference 57
4.1 Introduction.............................................................................. 58
4.2 Principles.................................................................................. 58
INDEX 91
C C++ O2 C Java
O2Corba
Database Engine
O2DB
Access
O2Engine
O2Web
O2Store
Fi gu r e 1 .1 : O2 Sy st em Ar ch i t ect u r e
Th e O 2 system can be viewed as con sist in g of t h r ee com pon en t s. Th e
Database Engine pr ovides all t h e feat u r es of a D at abase syst em an d an
object -or ien t ed syst em . Th is en gin e is accessed wit h Development Tools ,
su ch as var iou s pr ogr am m in g lan gu ages, O 2 developm en t t ools an d an y
st an dar d developm en t tool. Nu m er ou s External Interfaces ar e pr ovided.
All en com passin g, O 2 is a ver sat ile, por t able, dist r ibu t ed, h igh -
per for m an ce dyn am ic object -or ien ted dat abase system .
Database En gin e:
• O2 St or e Th e dat abase m an agem en t syst em pr ovides low level
facilit ies, t h r ou gh O2 Stor e API, t o access an d m an age a
dat abase: disk volu m es, files, r ecor ds, in dices an d
t r an sact ion s.
• O2 En gin e Th e object dat abase en gin e pr ovides dir ect con t r ol of
sch em as, classes, object s an d t r an sact ion s, t h r ou gh
O2 En gin e API. It pr ovides fu ll t ext in dexin g an d sear ch
capabilit ies wit h O 2 Sear ch an d spat ial in dexin g an d
r et r ieval capabilit ies wit h O 2 Spat ial. It in clu des a
Not ificat ion m an ager for in for m in g oth er clien t s
con n ect ed t o t h e sam e O 2 ser ver t h at an even t h as
occu r r ed, a Ver sion m an ager for h an dlin g m u lt iple
object ver sion s an d a Replicat ion API for syn ch r on izin g
m u lt iple copies of an O2 system .
O 2 Developm en t Tools:
• O2 Gr aph Cr eat e, m odify an d edit an y t ype of object gr aph .
• O2 Look Design an d develop gr aph ical u ser in ter faces, pr ovides
in t er active m an ipu lation of com plex an d m u ltim edia
object s.
• O2 Kit Libr ar y of pr edefin ed classes an d m et h ods for fast er
developm en t of u ser applicat ion s.
• O2 Tools Com plet e gr aph ical pr ogr am m in g en vir on m en t t o
design an d develop O 2 dat abase applicat ion s.
Exter n al In t er faces:
• O2 Cor ba Cr eat e an O2 / Or bix ser ver t o access an O2 dat abase
wit h CORBA.
• O2 DBAccess Con n ect O2 applicat ion s to r elation al dat abases on
r em ot e h ost s an d in vok e SQL st at em en ts.
• O2 OD BC Con n ect r em ot e ODBC clien t applicat ion s t o O2
dat abases.
• O2 Web Cr eat e an O2 Wor ld Wide Web ser ver t o access an O2
dat abase th r ou gh t h e in t er n et n etwor k .
OQL
Browser Interface
• Unix
Figu r e 1.2 sh ows a t ypical qu er y r esu lt in gr aph ical for m , as gen er ated
by O2 Look .
1. Th e Object Database St an dard: ODMG - 93. At wood, Bar ry, Du h l, Eastm an , Fer ran ,
J ordan , Loom is an d Wade. Edited by R.G.G. Cat tell. © 1996 Mor gan Kau fm an Pu blish -
er s.
Er a ser bu t t on
Object i con s
• Windows NT
Note
Th e r est of th is m an u al will on ly sh ow gr aph ical displays fr om t h e Un ix
plat for m .
Interactive OQL
Note
In a Win dows en vir on m en t ^Z (Con t r ol - Z) is u sed in stead of ^D
(Con t r ol - D).
Embedded OQL
For each feat u r e of th e lan gu age, you get th e syn tax, in in for m al
sem an t ics, an d an exam ple. Fin ally, t h e for m al syn t ax is given .
So t h at you can obt ain t h e exact in for m ation you wan t fr om you r
dat abase, O2 h as an object or ien t ed database qu er y lan gu age OQL.
1. Th e Object Dat abase Stan dard: ODM G - 93, r elease 1.2. Edit ed by R.G.G. Cat t ell. ©
1996 M or gan Kau fm an Pu blish er s.
• In O2 C
• In C++
class Company {
public:
d_String name;
d_Set<d_Ref<Employee> > employees;
d_List<d_Ref<Client> > clients;
char* title() {return name;}
};
class Client {
public:
d_String name;
d_Array<item> order;
};
class Employee {
public:
d_String name;
d_Date birthday;
d_String position;
float salary;
int age();
};
Two per sist en t r oot s ar e also defin ed: An object , Globe an d a collect ion
the_employees.
Globe
Th is r et u r n s:
Note
Th e qu er y r esu lts sh own below ar e all given in th e Un ix gr aph ic for m .
Simple queries
• Atomic values
With at om ic valu es you can car r y ou t ar ith m et ic calcu lat ion s, e.g.,
2 * 2
Th is is a qu er y wh ich r et u r n s t h e in t eger 4.
• Struct values
You can also con sider th e valu e of th e object Globe of class Company as
a st r u ct (or t u ple) valu e wit h t h r ee at tr ibu t es.
Globe.name
For exam ple, you can ext r act t h e f i r st elem en t of t h e list in clients as
follows.
Globe.clients[0]
• Call of a method
Globe.title
Th e select from where clau se en ables you to ext r act t h ose elem en t s
m eetin g a specific con dition fr om a col l ec t i on . O2 collect ion s in clu de
set , bag (a m u lt i-set or set wit h du plicates), l i st (an in ser t able an d
dyn am ic ar r ay) or ar r ay .
Set
select e
from e in Globe.employees
where e.salary > 200.00
Th is collect ion is in fact a bag as du plicat es ar e accept ed. You can also
add t h e k eywor d distinct to elim in at e an y du plicat es fr om t h e
r esu lt in g bag an d t h en pr odu ce a t r u e set .
Join
select e
from e in Globe.employees,
c in Globe.clients
where e.name = c.name
Path expressions
Testing on nil
select c.name
from c in Globe.clients
where c!=nil and count (c.order) = 3
select c.name
from c in Globe.clients
where count (c.order) = 3
List or array
Globe.clients[2]
select e.name
from e in Globe.clients
Note
Th e qu er y r et u r n s a bag an d n ot a list . To r et u r n a list , you m u st defin e
an or der . See “Or der by” on page 35.
Note
You can m an ipu lat e ver y com plex st r u ct u r es. A list can be m ade u p of
t u ples wh ich in t u r n can h ave a set at tr ibu t e, et c. Con sequ en t ly, you
h ave access t o all t h e em bedded com pon en t s of an object .
For m or e det ails, r efer t o Sect ion 2.3 for con str u ctin g qu er y r esu lts an d
Sect ion 2.7 for com bin in g oper at or s.
or sim ply:
You can also bu ild u p em bedded str u ct u r es sim ply by com bin in g
struct oper at or s.
For exam ple, t o get th e iden t it ies an d salar ies of all t h ose em ployees
wor k in g as r epor ter s an d older t h an 22.
Creating an object
You cr eat e valu es u sin g struct, list, array, bag an d set. In OQL,
you can also cr eat e object s u sin g t h e class n am e an d by in it ializin g th e
at t r ibu t es of you r ch oice. An y u n -in it ialized at t r ibu t es ar e set t o th e
defau lt valu e. For exam ple, t o cr eat e an object of t h e class Client:
An object collect ion can be cr eated in t h e sam e way. For exam ple, u se
t h e followin g qu er y t o cr eat e an o2 _l i st _Cl i en t collect ion .
o2_list_Client (list(Client(name:"John"),
(Client(name:"Jack")))
2.4 Operators
Count
count (Globe.employees)
Th is qu er y r et u r n s an in t eger .
Define
define MyEmployees as
select e
from e in Globe.employees
where e.name like "Sp*"
Th is n am es t h e r esu lt of t h e qu er y an d n ot th e qu er y itself.
Note
You can on ly r eu se t h ese n am ed qu er ies in t h e sam e qu er y session ,
i.e., u p t o a com m i t or abor t poin t.
Element
Wh en you h ave a set or a bag t h at con t ain s a sin gle elem en t , you
ext r act th e elem en t dir ect ly u sin g t h e element oper at or . For exam ple,
element ( select e
from e in Globe.employees
where e.name = "Tintin")
Exists
You can add a n ew per sisten t n am e to cover all t h e differ en t com pan ies
t h at exist :
select c.name
from c in TheCompanies
where exists e in c.employees: e.age < 23
Group by
select *
from e in Globe.employees
group by e.salary
Like
Th e qu er y:
Order by
You can obt ain a sor t ed list u sin g t h e order by clau se. For exam ple, t o
sor t t h e em ployees by n am e an d by age:
define YourEmployees as
select e
from e in Globe.employees
where e.name = "Tintin"
MyEmployees + YourEmployees
Th e sim ple addit ion (u n ion ) of t h e two set s of em ployees gives you a set
con tain in g t h e an swer :
pick (MyEmployees)
2.6 Conversions
List to set
Exam ple:
Set to list
You can also u se "*" t o bu ild a list . Th is avoids a r eal sor t algor it h m an d
sh ou ld be u sed wh en th e fin al or der of t h e list is u n im por t an t .
Flatten
r et u r n s a set of clien t s.
You can u se com bin e an d bu ild u p oper at or s, u n iver sal an d exist en t ial
qu an t ifier s, wild-car d oper at or s, st an dar d set oper at or s as well as list
con cat en ation , or der in g an d gr ou pin g oper at or s on set s, bags an d list s.
2.8 Indexes
You can im pr ove per for m an ce if th e syst em is able t o dir ect ly access t h e
m atch in g elem en t s. Th is is don e by est ablish in g an in dex on a
collection .
Exam ple:
• Defin in g an in dex for all em ployees:
select e
from e in the_employees
where e.salary ≥ 1000 and e.salary ≤ 5000
Display index
The "display index" query allows you to see how OQL will use existing indexes in que-
ries you will make. To stop this feature, execute "display index" again.
Note
Please r efer t o t h e Syst em Adm in ist r at ion Gu ide for det ails on h ow t o
cr eat e an d m an age in dexes.
• Basic queries
• Select..from..where
Th e select ... from ... where clau se en ables you to ext r act t h ose
elem en t s m eet in g a specific con dition fr om a list or set .
• Constructing results
• Operators
OQL oper ator s in clu de define, element, order by, count, exists,
group by an d like. Th ey can be com bin ed for com plex qu er ies.
• Indexes
Most com m er cial object dat abase syst em s n ow h ave a com m on data
m odel based on t h e OM G object m odel. Th is data m odel is defin ed in t h e
OD MG 93 r epor t . Based on t h is OD MG m odel, t h e qu er y lan gu age OQL
was defin ed an d adopt ed by t h e ODM G gr ou p.
1. an object m odel
2. an object defin it ion lan gu age for th is m odel, wit h it s own syn t ax, OD L
or its expr ession t h r ou gh C++ an d Sm allt alk syn t ax
5. a J ava bin din g allowin g J ava pr ogr am s t o oper ate on a dat abase
com plian t t o t h e object m odel
Com bin in g r elat ion sh ips an d collect ion s, an object can r elat e t o m or e
t h an on e object t h r ou gh a r elat ion sh ip. Th er efor e, 1-1 r elat ion sh ips, 1-n
r elat ion sh ips an d n -m r elat ion sh ips can be su ppor ted wit h t h e sam e
gu ar an t ee of r efer en t ial in t egr it y.
class Person{
d_String name;
d_Date birthdate;
d_Set < d_Ref<Person> > parents
inverse children;
d_List < d_Ref<Person> > children
inverse parents;
d_Ref<Apartment> lives_in
inverse is_used_by;
Meth ods
Person();
Con st r u ct or : a n ew Per son is bor n
int age();
Retu r n s an atom ic t ype
float salary;
M et h od
virtual d_Set<d_String> activities();
Th is m eth od is r edefin ed
};
d_String grade;
M et h od
virtual d_Set<d_String> activities();
Th e m et h od is r edefin ed
};
class Address{
int number;
d_String street;
};
class Building{
Address address;
A com plex valu e Address em bedded in t h is object
class Apartment{
int number;
d_Ref<Building> building;
d_Ref<Person> is_used_by
inverse lives_in;
};
};
Path expressions
p.lives_in.building.adddress.street
select c.name
from c in p.children
select c.lives_in.building.address
from p in Persons,
c in p.children
• Predicate
select c.lives_in.building.address
from p in Persons,
c in p.children
where
p.lives_in.building.address.street
= "Main Street" and
count(p.children) >= 2 and
c.lives_in != p.lives_in
• Join
In t h e from clau se, collect ion s wh ich ar e n ot dir ect ly r elat ed can also be
declar ed. As in SQL, t h is allows u s t o com pu t e “join s” between t h ese
collect ion s. For in stan ce, t o fin d t h e people livin g in a st r eet an d h avin g
t h e sam e n am e as t h is st r eet , we do th e followin g: th e Building ext en t
is n ot defin ed in th e sch em a, so we h ave t o com pu t e it fr om t h e
Apartments ext en t . To com pu te t h is in t er m ediat e r esu lt , we n eed a
select-from oper ator again . So t h e join is don e as follows:
select p
from p in Persons,
b in (select distinct a.building
from a in Apartments)
where p.name = b.address.street
Data manipulation
To bu ild a com plex valu e, OQL u ses t h e con st r u ct or s struct, set, bag,
list an d array. For exam ple, t o obt ain t h e addr esses of t h e ch ildr en of
each per son , alon g wit h th e addr ess of th is per son , we u se t h e followin g
qu er y:
struct{
String me;
Address my_address;
Bag<struct{String name;
Address address}> my_children;
}
OQL can also cr eat e com plex object s. For th is pu r pose, it u ses t h e n am e
of a class as a con st r u ct or . At t r ibu tes of t h e object of t h is class can be
in itialized explicit ly by an y valid expr ession .
t h e qu er y is:
Building(
address:
Address (number: 10,
street: "Main street"),
apartments:
List_apart(list(Apartment(number: 1),
Apartment(number: 2))))
Method invoking
b.less_expensive.is_used_by.name
Polymorphism
• Late binding
select p.activities
from p in Persons
• Class indicator
Operator composition
OQL is a pu r ely fu n ct ion al lan gu age: all oper at or s can be com posed
fr eely as lon g as t h e t ype syst em is r espect ed. Th is is wh y t h e lan gu age
is so sim ple an d it s m an u al so sh or t . Th is ph ilosoph y is differ en t fr om
SQL, wh ich is an ad-h oc lan gu age wh ose com posit ion r u les ar e n ot
or t h ogon al t o t h e type syst em . Adopt in g a com plet e or th ogon alit y,
m ak es t h e lan gu age easier t o lear n wit h ou t losin g t h e SQL st yle for
sim ple qu er ies. Am on g t h e oper at or s offer ed by OQL bu t n ot yet
in t r odu ced, we can m en t ion t h e set oper at or s (union, intersect,
except), t h e u n iver sal (forall) an d exist en t ial qu an t ifier s (exists), t h e
order by an d group by oper at or s an d t h e aggr egat ive oper at or s
(count, sum, min, max an d avg).
define Employees as
select (Employee) p
from p in Persons
where "has a job" in p.activities
define salary_map as
select street,
average_salary: avg (select p.e.salary
from partition p)
from e in Employees
group by e.lives_in.building.address.street
Th e r esu lt of t h e qu er y is of t ype:
Bag<struct{String street;
float average_salary;}>
define sorted_salary_map as
select s from s in salary_map
order by s.average_salary
Th e r esu lt is of t ype:
List<struct{String street;
float average_salary;}>
sorted_salary_map[0].street
(select street,
average_salary: avg (select p.e.salary
from partition p)
from e in (select (Employee) p
from p in Persons
where "has a job" in p.activities)
group by e.lives_in.building.address.street
order by avg (select p.e.salary from partition p))
[0]. street
1. Th e Object Dat abase St an dar d: ODMG - 93. At wood, Du h l, Ferr an , Loom is an d Wade.
Edit ed by R.G.G. Catt ell. © 1996 M organ Kau fm an Pu blish ers.
4.1 Introduction
4.2 Principles
OQL is an "expr ession " lan gu age. A qu er y expr ession is bu ilt fr om t yped
oper an ds com posed r ecu r sively by oper ator s. We will u se th e t er m
expression t o design at e a valid qu er y in t h is sect ion .
O2 note
Wit h t h e O2 qu er y in t er pr et er you u se CTRL -D (on Un ix) or CTRL-Z (On
Win dows) bet ween t wo qu er ies r at h er t h at ";".
O2 note
• def i n e oper at ion is available on ly wit h t h e in ter act ive qu er y
in t er pr et er . It h as n o m ean in g for OQL em bedded in pr ogr am m in g
lan gu ages (C++, Sm allt alk , O 2 C) becau se st an dar d pr ogr am m in g
lan gu age var iables can be u sed for t h at pu r pose.
• A defin ed n am e is valid u p t o t h e n ext com m it or abor t
• You can get t h e list of cu r r en t defin ed qu er ies by t ypin g t h e qu er y:
d i spl ay qu er i es
Exam ple:
Students
Exam ple:
Doe
Exam ples:
Employee (name: "Peter", boss: Chairman)
vectint (set(1,3,10))
Exam ple:
struct(name: "Peter", age: 25);
Exam ple:
set(1,2,3)
Exam ple:
list(1,2,2,3)
Exam ple:
list(3 .. 5)
Th is r et u r n s t h e list (3,4,5)
O2 note
In O2 t h e k eywor d l i st is m an dat or y.
Exam ple:
bag(1,1,2,3,3)
Exam ple:
array(3,4,2,1,1)
Th is r et u r n s an ar r ay of five elem en t s.
Exam ple:
not true
Th is r et u r n s false.
Exam ple:
count(Students) - count(TA)
s1 || s2, an d s1 + s2
O2 note
In O2 t h e oper ator | | is n ot accept ed. To con cat en at e 2 st r in gs u se "+".
Exam ple:
’a nice string’ like ’%nice%str_ng’
is t r u e.
O2 note
In O2 t h e on ly su ppor ted wildcar d is "*".
Exam ple:
Doe = element(select s from Students s
where s.name = "Doe")
is tr u e.
Exam ple:
Doe.name
Th is r et u r n s Doe.
Exam ple:
Doe->spouse != nil and Doe->spouse->name = "Carol"
O2 note
Accor din g to a r ecen t evolu t ion of t h e ODM G st an dar d, OQL does n ot
n ow r aise an except ion wh en it t r aver ses a pat h wh ich con t ain s a nil.
In st ead of t h is, a pr edicat e in volvin g su ch a pat h is always false. Th is
m ean s th at OQL n ow sk ips su ch elem en t s an d th u s t h e explicit test t o
nil is n ot yet m an dat or y.
Exam ple:
jones->number_of_students
Exam ple:
Doe->apply_course("Maths", Turing)->number
Exam ple:
p1 = p2
*p1 =*p2
Exam ple:
for all x in Students: x.student_id > 0
Exam ple:
exists x in Doe.takes: x.taught_by.name = "Turing"
O2 note
In O 2 t h ese t wo last oper at ion s ar e n ot su ppor ted. On ly t h e for m "ex i st s
x i n e1 : e2 " is valid.
Exam ple:
Doe in Does
Th is r et u r n s true.
Exam ple:
max (select salary from Professors)
an d
select distinct projection from e1 as x1, e2 as x2 ..., en as
xn where e
ar e expr ession s.
Th e r esu lt of t h e qu er y is a set for a select distinct or a bag for a
select.
If you assu m e e1, e2, ..., en ar e all set an d bag expr ession s, t h en
t h e r esu lt is obtain ed as follows: t ak e t h e car t esian pr odu ct 1 of th e set s
e1, e2, ..., en; filt er t h at pr odu ct by expr ession e’ (i.e., elim in at e fr om
t h e r esu lt all object s th at do n ot sat isfy boolean expr ession e’); apply
t h e projection t o each on e of t h e elem en t s of t h is filt er ed set an d get t h e
r esu lt. Wh en t h e r esu lt is a set (dist in ct case) du plicat es ar e
au tom at ically elim in at ed.
Th e situ at ion wh er e on e or m or e of t h e collect ion s e1, e2, ..., en is
an in dexed collect ion is a lit t le m or e com plex. Th e select oper at or fir st
con ver t s all th ese collect ion s in to set s an d applies t h e pr eviou s
oper at ion . Th e r esu lt is a set (dist in ct case) or else a bag. So, in t h is case,
we sim ply t r an sfor m each of t h e ei’s in t o a set an d apply t h e pr eviou s
defin it ion .
4.3.8.1 Projection
Befor e t h e pr oject ion , t h e r esu lt of t h e it er at ion over t h e from var iables is
of t ype
1. Th e car tesian pr odu ct bet ween a set an d a bag is defin ed by fir st con vert in g t h e set in t o
a bag, an d t h en get tin g t h e resu ltin g bag wh ich is t h e cart esian pr odu ct of th e t wo bags.
Exam ple:
Exam ple:
select *
from Students as x,
x.takes as y,
y.taught_by as z
where z.rank = "full professor"select *
Exam ple:
O2 note
In O2 an addit ion al syn t ax is allowed t o declar e a var iable x:
4.3.8.3 Predicate
In a select -fr om -wh er e qu er y, t h e w here clau se can be om it t ed, wit h t h e
m ean in g of a t r u e pr edicat e.
con ven tion ally called partition an d wh ich is t h e bag of all object s
m atch in g t h is par t icu lar valu ed par t it ion .
Exam ple:
select *
from Employees e
group by low: e.salary < 1000,
medium: e.salary >= 1000 and salary < 10000,
high: e.salary >= 10000
Exam ple:
select department,
avg_salary: avg(select p.e.salary from partition p)
from Employees e
group by department: e.deptno
having avg(select p.e.salary from partition p) > 30000
O2 note
In O2 t h e syn t ax of partition_attributes does n ot accept t h e k eywor d
st r u c t an d t h u s is always given as a list of cr iter ia separ at ed by
com m as. See Sect ion 4.4.1.
Exam ple:
Exam ple:
Exam ple:
Th is r et u r n s b.
Exam ple:
element (select x
from Courses x
where x.name = "math" and
x.number ="101").requires[2]
Exam ple:
Th is r et u r n s list (b,c,d).
Exam ple:
element (select x
from Courses x
where x.name="math" and
x.number="101").requires[0:2]
Exam ple:
first(element(select x
from Courses x
where x.name="math" and
x.number="101").requires)
Exam ple:
Exam ples:
Student except Ta
4.3.12.2 Inclusion
Exam ple:
is t r u e.
Exam ple:
Exam ple:
listtoset (list(1,2,3,2))
O2 note
To car r y ou t t h e r ever se oper at ion (set t o list ) you u se th e or der by
oper at or . If you ar e n ot in t er est ed in a given or der you can u se "*" as
sh own in t h e followin g qu er y:
select e from e in aSet order by *
Exam ples:
flatten(list(list(1,2), list(1,2,3)))
Th is r et u r n s list(1,2,1,2,3).
flatten(set(list(1,2), list(1,2,3)))
Exam ple:
Exam ple:
Assu m in g t h at in th e cu r r en t sch em a t h e n am es Per son s an d Cit ies ar e
defin ed.
select scop e1
from Persons,
Cities c
where exists(select scop e2 from children as child)
or count (select scop e3 , (select scop e4 from
partition)
fromchildren p,
scop e5 v
group by age: scop e6
)
O2 note
Im plicit at t r ibu t e scope is n ot available wit h O2 . You m u st always access
an at t r ibu t e with t h e dot n otation : v.att.
Exam ple:
Th is qu er y r et u r n s a bag of st r u ct u r es:
bag<struct(name: string, salary: float, student_id:
integer)>
O2 note
O2 accept s t h e 3 alt er n atives of t h e projection syn t ax in th e select par t ,
as well as t h e struct syn t ax. In t h e group by par t , O 2 accepts t h e 3
alt er n at ives bu t does n ot accept t h e struct syn t ax.
O2 note
O2 does n ot su ppor t Aggr egat e Oper at or abbr eviat ion s.
is t r u e
O2 note
In O2 Com posite Pr edicat e abbr eviat ion s ar e n ot su ppor t ed.
O2 note
In O2 a st r in g m u st be delim it ed by dou ble qu ot es.
4.5.1 Grammar
n ot - (u n ar y) + (u n ar y)
in
* / m od i n t er sect
+ - u n i on ex cep t ||
< > <= >= < som e < an y < al l (et c ... for all com par ison
oper ator s)
= != lik e
an d ex i st s for all
or
.. :
,
(iden t ifier ) th is is t h e cast oper at or
order
having
group by
where
from
select
Sym bol s C
+ 36 C 11
C++
In t er face 11
C++ bin din g 44, 45
A Class in dicat or 54
Collection 22, 44, 49, 79
in dexed expr ession 75
Nam ed 39
Accessor 87 Collection expr ession 87
Addit ion of set s 36 Com bin in g oper at or s 28, 38
Aggr egat ive oper at or s 54 Com par ison 86
Ar ch itect u r e con cat en ation 76
O2 10 Con st r u ction
Ar it h m etic 86 Ar r ay 51
Ar r ay 21, 22, 25 Bag 51
Con st r u ctin g 63 List 51
Set con ver sion 37 Set 51
Str u ct 51
array 27, 29, 51
Ar r ay valu e 21 Con st r u ctor 27, 51, 87
Atom ic valu e 20 Con ver sion 37, 78, 88
Att r ibu t e 66 count 30, 54, 70
avg 30, 54, 70 Cr eat in g object s 29
B D
E I
J
F
J ava 11
J ava bin din g 44
first 76 J oin 50
flatten 38 J oin qu er y 24
Flatt en in g 79
forall ... in 54
from 50
L
G
last 76
Lat e bin din g 53
like 35
group ... by 32, 54, 55, 72 List 21, 22, 25
Con st r u ct in g 62
Set con ver sion 37
Valu es 21
Q T
Qu er y Test in g on n il 25
Basic 18, 86 Typin g 80
Nam ed 30
Resu lt 27, 30
U
R
union 36, 54, 77
Un iver sal qu an t ificat ion 38, 54, 68
Ref 44
Un ix 12
Relation sh ip 44, 49, 66
S V
Valu e
select 55 Ar r ay 21
Select fr om wh er e 70 At om ic 20
select from where 22, 49 List 21
Set 22, 22 Nam ed 20
Con st r u ctin g 62 Str u ct 21
List con ver sion 37
Oper at or s 36, 54
set 27, 29, 51, 77, 78
Set expr ession 88 W
struct 27, 29, 29, 51
St r u ct valu e 21
st r u ct u r e 62
Su bcollect ion 75, 75 where 50
sum 30, 54, 70 Win dows NT 13
Syst em
Ar ch it ectu r e 10