Logical access path
From Wiki
Logical access path is a sequence of operations projection and de-projection. This sequence is applied to a set of elements and returns a set of elements.
Logical access path allows us to retrieve data elements using only the structure of the model without the need to use numerous join conditions. One projection or de-projection are called segments of the logical access path which coincide with dimensions of the model. It is opposed to physical access path which is a sequence of identities where each next identity is specified in the context of the previous one.
In the concept-oriented query language (CoQL) it is written as a sequence of collection names and dimension names separated by right (projection) or left (de-projection) arrows.
Example
Let us assume that each employee (collection Employees) belongs to one department (collection Departments) and each department has one manager (collection Managers). If we have a set of employees then we can find all employees in all departments where they work using the following query:
(Employees e | e.age > 30)
-> department –> Departments
<- department <– Employees
This query projects the selected employees to departments and then de-projects these departments back to employees by finding all people working there.
We can restrict the departments by those having more than 10 projects and employees in the departments by those younger than 40:
(Employees e | e.age > 30)
-> department –> (Departments | d.proj > 10)
<- department <– (Employees | e.age < 40)
We can also use projection and de-projection as an internal constraint to select elements of an intermediate collection. For example, we might want to consider only departments with more than 10 employees:
(Employees e | e.age > 30)
-> department –> (Departments |
d <- department <- Employees > 10
)
<- department <– (Employees | e.age < 40)
To compute the number of employees in the current department we de-project it to employees and then compare the size of this collection with 10. We use a shortcut where comparison of a collection with a number means finding the number of elements in the collection using SUM.
