select o
from Order o
where o.items[0].id = 1234

select p
from Person p, Calendar c
where c.holidays['national day'] = p.birthDay
  and p.nationality.calendar = c

select i
from Item i, Order o
where o.items[ o.deliveredItemIndices[0] ] = i
  and o.id = 11

select i
from Item i, Order o
where o.items[ maxindex(o.items) ] = i
  and o.id = 11

select i
from Item i, Order o
where o.items[ size(o.items) - 1 ] = i