Querying on multiple LINKMAP items with SQL

Skip to first unread message


Nov 13, 2017, 6:42:54 PM11/13/17
to orient-...@googlegroups.com

I have a class that contains a LINKMAP field called links. This class is used recursively to create arbitrary hierarchical groupings (something like the time-series example, but not with the fixed year/month/day structure).

A query like this:

select expand(links['2017'].links['07'].links['15'].links['10'].links) from data where key='AAA'

Returns the actual records contained in the last layer of "links". This works exactly as expected.

But a query like this (note the 10,11 in the second to last layer of "links"):

select expand(links['2017'].links['07'].links['15'].links['10','11'].links) from data where key='AAA'

Returns two rows of the last layer of "links" instead:


Using unionAll or intersect (with or without UNWIND) results in this single record:


But nothing I've tried (including various attempts at "compound" SELECTs) will get the expand to work as it does with the original example (i.e. return the actual records represented in the last LINKMAP).

Is there a SQL syntax that will achieve this?

Note: Even this (slightly modified) example from the ODB docs does not result in a list of linked records:

select expand(records) from
(select unionAll(years['2017'].links['07'].links['15'].links['10'].links, years['2017'].links['07'].links['15'].links['11'].links) as records from data where key='AAA')

Ref: https://orientdb.com/docs/2.2/Time-series-use-case.html

Reply all
Reply to author
0 new messages