Select … From …

Relational model versus Semantic arrays dml

The basic Select … From … statement is used to select one or more attributes from a table. Assume the following SQL Statement:

Select Street, Number, Zipcode, Town From Appartment

This statement can be applied on our relation model, resulting in the following data:

For such a SQL statement, in the GeoDMS no new domain-unit needs to be configured. The source domain is identical to the domain of the result. The SQL statement can be configured in the GeoDMS in two ways (the Appartment domain unit is configured in a src container):

example 1:

container result
{
   attribute<string> Street  (src/Appartment) := src/Appartment/Street;
   attribute<uint32> Number  (src/Appartment) := src/Appartment/Number;
   attribute<string> ZipCode (src/Appartment) := src/Appartment/ZipCode;
   attribute<string> Town    (src/Appartment) := src/Appartment/Town;
}

example 2:

unit<uint32> resultdomain := src/Appartment
{
   attribute<string> Street  := src/Appartment/Street;
   attribute<uint32> Number  := src/Appartment/Number;
   attribute<string> ZipCode := src/Appartment/ZipCode;
   attribute<string> Town    := src/Appartment/Town;
 }

In the first example a result container is configured. The subitems are the fields to be selected. As the resulting items are identical to the source items, the simple equal to (=) operator is used in the expressions. The domain units of the resulting items are not their parent items, therefore they need to be configured explicitly.

in the second example first a resultdomain domain unit is configured, equal to the source domain (src/Appartment). The same subitems are now configured, but as their parent items are now a domain unit equal to the src domain, the domain units do not have to be configured explicitly. This second approach is advisable if multiple subitems are requested.

Select * From …

In SQL an * asterisk is used to refer to all fields of a table. In the GeoDMS attributes with the same domain unit can be configured at different locations in the configuration. The meaning of an * asterisk is less clear and therefore not used in the GeoDMS.

With the subitem_propvalues / inherited_propvalues / subtree_propvalues it is possible to make a list of all (full) names of data items with the same domain unit in a container, branche or whole configuration. With a for_each expression such a list can be used to select all these items.