Query Navigation
Querying object structures requires navigation. An example object structure was shown on the navigating objects page. An example of an ODMG OQL query follows. This query appears in the published ODMG standard. For those of you who know SQL, you will notice that it is similar to an SQL query, but with object extensions. The similarity occurs because OQL is based on SQL-92.
select c.address
from Persons p, p.children c
where p.address.street = "Main Street"
and count(p.children) >= 2
and c.address.city != p.address.city
The "dot" notation used in the query traverses the data structure shown on the navigating objects page. The query inspects all children of all Persons to find people who live on Main Street with at least two children. It returns only those addresses of children who do not live in the same city as their parents. It navigates from the Person class using the child reference to another instance of the Person class and then to the Address and City classes.
ODMG OQL is not the only way to write these object queries. Similar queries can be written using the other query languages used by some of the object database products.
Based on this information, we can now go to the better DBMS Matrix page.
Context for Query Navigation
Related Articles for Query Navigation
Author
Douglas K Barry
Principal
You may use this material for your work or classes. Reprint Policy. Be sure to check the menu at the left for other articles available on this site.
The Savvy Manager's Guide
Douglas K Barry is also the author of a book that explains Web Services, service-oriented architecture, and Cloud Computing in an easy-to-understand, non-technical manner.
Web Services, Service-Oriented Architectures, and Cloud Computing: The Savvy Manager's Guide (Second Edition)
by Douglas K Barry with David Dick
This is a guide for the savvy manager who wants to capitalize on the wave of change that is occurring with Web Services, service-oriented architecture, and—more recently—Cloud Computing. The changes wrought by these technologies will require both a basic grasp of the technologies and an effective way to deal with how these changes will affect the people who build and use the systems in our organizations. This book covers both issues. Managers at all levels of all organizations must be aware of both the changes that we are now seeing and ways to deal with issues created by those changes.