[orient-database] New TRAVERSE operator (available since v0.9.10)

Showing 1-1 of 1 messages
[orient-database] New TRAVERSE operator (available since v0.9.10) Lvc@ 4/23/10 3:00 AM
Hi all,
I'd like to use this group also to announcements about cool features
just released. This time is the turn of the new TRAVERSE operator in
SQL queries. The aim of TRAVERSE is to check a condition by traversing
a graph of relationship.

Since OrientDB is a Document-Graph DBMS it handles relationships as
physical links between documents. it's straightforward to follow
complex graph of thousands of documents in ms.

This is the schema:

Profile {name, surname, nick, addresses (as collection of links to
Address), friends (as collection of links to the same Profile)

and

Address {city, street, country}

Query #1:

select from Profile where addresses traverse
( street.indexOf( 'Navona') > -1 )

Means to retrieve all the documents of type "Profile" where addresses
have the property "street" with the occurrence of the pattern
"Navona".

Query #2:

select from Profile where any() traverse ( street.indexOf( 'Navona') >
-1 )

This query applies to all the fields of Profile and therefore also to
"friends". In this way it will return all the Profiles that have a
friend or a friend of a friend, or a friend of a friend of a friend
(recursively up to the infinite) with at least an address with the
street containing "Navona".

Query #3:

select from Profile where any() traverse(0,2)
( street.indexOf( 'Navona') > -1 )

As before, but limiting the condition only to the current profile and
2 level nested more.

Query #1 and #2 are supported with v.0.9.10. The Query #3 is in
progress yet.


--
Subscription settings: http://groups.google.com/group/orient-database/subscribe?hl=en