SCQL. Mapping
Use
SCQL, SQL
SCQL. Mapping. Simple Role
Concept
Use SCQL
Simple Role Concept is a Role Concept º
<All calculated role concepts
and all base role concepts based on simple concepts are simple.>
Complex Role Concept is a Role Concept º
<Each
role concept is simple or complex one.>
<All role concepts
based on complex concepts are complex.>
Simple Role Concept is nested to a Complex Role Concept in a
Position
<Positions are unique within each
complex role concept and are between 1 and positions quantity.>
<Simple role concept has a
simple concept being part of a complex concept of the complex role concept in
the same position.>
<The role names of simple role
concepts are the same as the role name of the appropriate complex role
concept.>
SCQL. Mapping. Column Role
Concept
Use SCQL
Column Role Concept is a Simple Role Concept ®
Exclusive Column Role Concept is a Column Role Concept º
<It is not nested to a complex
role concept.>
<Each simple role concept has
only one exclusive column role concept.>
Nested Column Role Concept is a Column Role Concept º
<It is nested to a complex
role concept.>
<Column role concepts are
exclusive or nested only.>
Nested Column Role Concept is nested to a Complex Role Concept ®
<There is one column role concept for each simple role
concept within the complex role concept.>
<The
role names of column role concepts are the same as the role name of the complex
role concept.>
Nested Column Role Concept has a Position ®
<Each
nested column role concept has the same position as an appropriate simple role
concept within the complex role concept.>
Column Role Concept pertains to a
Column Concept ®
<If the column role concept is
exclusive, then it pertains to an exclusive column concept of a simple concept
of a simple role concept being the exclusive column role concept.>
<If the column role concept is
nested, then it pertains to a nested column concept of a complex concept of a
complex role concept having this column role concept as nested, and the nested
column concept and column role concept are of the same simple concept.>
<All column role concepts
pertains to a column concepts besides calculated ones.>
Calculated Column Role Concept is a Column Role Concept º
<It’s a calculated simple role
concept.>
Selection Operation is based on Column Role Concepts –
<Column role concepts of a
selection operation only are: a) exclusive column role concepts of its simple
role concepts; b) column role concepts nested to its complex role concepts.>
Selection Statement has Column Role Concepts –
<Column role
concepts of a selection statement are of its root selection operation.>
{The result of selection
statement should be able to be visualized directly, without any additional information
(for example, without SCM meta-model). Concept name and role name are
transmitted with column role concepts.}
SCQL. Mapping. Basically Mapped Selection
Statement
Basically Mapped Selection
Statement is a SCQL. Selection Statement º
<Root
and all nested selection operations are basically mapped (BM) ones.>
<All directly or indirectly
nested connection selections of a basically mapped selection statement are to
be reflected to tables. All such SCQL selection statements are basically mapped
ones.> {There can be other selection statements for other mapping types.}
Basically Mapped Selection
Statement is mapped to a SQL. Selection
Statement º
<SQL selection statement has a
root SQL selection operation mapped from root BM selection operation of the BM
selection statement.>
<SQL selection statement field
orders of the SQL selection statement are calculated as mappings of role
concept orders of the BM selection statement.>
{We suppose that SQL selection
statements mapped from different BM selection statements are different even if
they have the same structure.}
SCQL. Mapping. Basically Mapped Role Concept
Order
Basically Mapped Role Concept
Order is a Role Concept Order º
<It is defined for a BM
selection statement. All such role concept orders are basically mapped.>
Basically Mapped Role Concept
Order is mapped to Field Orders ¬
<For each column role concept
of the ordered role concept there is one mapped field order defined for a field
(of the root SQL selection operation) mapped to the column role concept.
Position of each field order is calculated as base position of the BM role
concept order plus position of the column role concept in the ordered role
concept.>
<Order type of role concept
order and all field orders are the same.>
Basically Mapped Role Concept
Order has a base Position ®
<If
the role concept order is the first in the selection statement, then the base
position is 1; otherwise the base position is the base position of the previous
role concept order plus quantity of field orders in the previous BM role
concept order.>
SCQL. Mapping. Basically Mapped Column Role
Concept
Basically Mapped Column Role Concept is a Column Role Concept º
<It is used in at least one
basically mapped selection operation. All such role concepts are basically
mapped ones.>
Basically Mapped Column Role Concept is mapped to Fields ¬
SCQL. Mapping. Basically
Mapped Selection Operation
Basically Mapped Selection
Operation is a SCQL. Selection Operation º
<It is nested to a basically
mapped selection statement directly or indirectly. All such selection
operations are basically mapped ones.>
Basically Mapped Selection
Operation is mapped to a SQL. Selection Operation º
<All BM selection operations besides
logical connection selections are to be mapped to SQL selection operations.>
<All fields of the SQL
selection operation are to be biuniquely
mapped to all column role concepts of the BM selection operation.>
{Since a basically mapped selection operation, being mapped to a SQL selection
operation, has no repeated role concepts.}
<Each connection selection not
nested to a composition is mapped to a table selection according to simple
mapping.> {See below. Others are mapped during the composition mapping.}
<A SCQL transformation is
mapped to a SQL transformation.>
<A composition is mapped to a
SQL filtered join.>
<A SCQL union is mapped to SQL
union.>
<A SCQL minus is mapped to SQL
minus.>
<No logical selection is
mapped to a SQL selection operation directly.>
SCQL. Mapping. Basically
Mapped Connection Selection
Basically Mapped Connection
Selection is a Basically Mapped Selection
Operation º
<All BM selection operations
that are connection selections besides logical connection selections are BM
connection selections.>
Basically Mapped Connection
Selection is simply mapped to a SQL. Table
Selection º
{Every BM connection selection is
simply mapped, but not every mapping is used for result SQL statement
construction if the connection selection is nested to a composition.}
<A BM connection selection is
simply mapped to a table selection based on a table. The table is to reflect a
connection being base for this connection selection.>
Basically Mapped Biequivalent Selection is a Basically Mapped
Connection Selection º
<All BM connection
selections based on biequivalent connection are biequivalent.>
<A BM biequivalent selection
is simply mapped to a table selection, is based on a reflected biequivalent
connection, and is stored in table field elements. Each of the table field
elements is represented in the table selection by two fields.> {It covers basing of fields on table field
elements.}
<Consider two fields of one
table field element. One of them is mapped to a column role concept of a base
concept, having one of simple concepts of the table field element, and another
field is mapped to a column role concept biequivalently connected with the
previous one. Two column role concepts are biequivalently connected within the
biequivalent connection if they are in the same position within the complex
role concepts or the role concepts are simple.> {It covers mapping of fields
to column role concepts.}
Basically Mapped Non-Biequivalent Selection is a Basically Mapped
Connection Selection º
<All BM connection selections
based on non-biequivalent connection are non-biequivalent.>
<A
BM non-biequivalent selection is based on a reflected non-biequivalent
connection stored in table field elements and based on simple concepts. If a
simple concept pertains to two different concepts of the connection (it’s
binary intersected or part-whole in this case), then the table selection has
two fields of the appropriate table field element, otherwise the table
selection has only one field.> {It covers basing of fields on table field elements.}
<Each field of the table
selection is mapped to its own column role concept of that simple concept of
the connection to which a table field element of the field is reflected. If two
fields are mapped to the same table field element, the fields are mapped to
column role concepts of different concepts of the BM connection (the connection
is binary in this case).> {It covers mapping of fields to column role
concepts.}
SCQL. Mapping. Basically
Mapped Transformation
Basically Mapped Transformation is a Basically Mapped Selection Operation º
<All BM selection
operations that are transformations are BM transformations.>
<A nested BM selection
operation is mapped to its own SQL selection operation.>
Basically Mapped Transformation is mapped to a SQL. Transformation º
<SQL selection operation
nested to the SQL transformation is mapped from BM selection operation nested
to the BM transformation.>
<For each transformation
function of the BM transformation there is a SQL function of SQL transformation
mapped from it, and vice versa.>
<Each copied result field of
the SQL transformation is mapped from the same BM column role concept as its
nested field.>
<Each calculated result field
of the SQL transformation is mapped from the BM column role concept calculated
according to a BM function mapped to a mapped function calculating the
field.>
Basically Mapped Transformation
Function is a Transformation Function º
<All transformation
functions of BM transformations are BM ones.>
Basically Mapped Transformation
Function is mapped to a SQL Function º
<Its function is mapped to a
mapped function of the SQL function.>
<Its calculated simple role
concept as exclusive column one is mapped to its own field of the SQL transformation
calculated by the SQL function.>
Basically Mapped Function is a Function º
<All functions of BM
transformation functions are BM ones.>
<All its directly or
indirectly nested functions are BM ones.>
<Each nested function of the
BM function is mapped to its own mapped function nested to the SQL
function.> {See below.}
Mapped Function is a Function º
<All functions directly or
indirectly nested to SQL functions are mapped ones.> {It’s calculated as a
result of mapping.}
Basically Mapped Function is mapped to a Mapped Function º
<If it’s a term function, it’s
mapped to a term with a function variable field (of a selection operation
nested to the BM transformation) mapped
from exclusive column role concept of a function variable simple role
concept of the BM term.>
<If it’s a constant, it’s
mapped to a constant with the same value.>
<If it’s an operation, it’s
mapped to an operation of the same operation type with the same nested
operations quantity. Nested operations mapped each to other have the same
position.>
SCQL. Mapping. Basically
Mapped Composition. Nested Operations
Materialized Selection Operation is a Nested Selection Operation º
<Materialized selection
operation is to be nested to a composition.>
<It’s directly or indirectly
materialized selection operation.>
<All nested selection
operations of a composition besides logical one are to be materialized ones.
Logical selections are not materialized at all.>
Dependent Materialized Selection is a Materialized Selection Operation º
<Dependent materialized
selection is a selection of a calculated connection. All such selections are
dependent materialized.>
Main Materialized Role Concept is a Role Concept º
Dependent Materialized Selection has Main Materialized Role Concepts –
<The
main materialized role concepts are base for the dependent selection.>
<If
the selection is biequivalent, then each mandatory role concept (one or two) is
main.> <If the selection is part-whole, then the whole role concept is
main.>
<If the selection is intersected
functional, then the not determined role concept is main.>
Main Materialized Selection is a Materialized Selection Operation º
Dependent Materialized Selection depends on Main Materialized Selections –
<Dependent materialized
selection depends on those materialized selections of the BM composition which
are based on role concepts being its main materialized role concepts.>
Directly Materialized Selection
Operation is a Nested Selection Operation º
<All nested materialized
selection operations not being dependent are directly materialized.>
<All dependent materialized
selections without main materialized selections are directly materialized.>
<Let’s take a graph of
materialized selections and its graph of connected sub-graphs. There may be
cycles of materialized selections being root in the sub-graph graph and having
only dependent selections not depending (directly or indirectly) on a selection
not being dependent. In this cycles any selection is taken as directly
materialized.> {All other cycles and separate nodes are dependent to this
cycles or to the nodes without main materialized selections, which are directly
materialized (see above).}
<The SQL filtered join has
only the following nested SQL selection operations:
a) Directly materialized selection operations not being connection selections have its mapped SQL selection
operations as nested to a SQL filtered join to which the BM composition is
mapped (it covers all nested selections besides connection selections).
b) Directly materialized connection selections have its grouped (see below) SQL
table selections as nested to the SQL filtered join.>
<BM composition has as nested
only BM selection operations being directly materialized selection operations not being connection selections.>
Indirectly Materialized Selection
Operation is a Nested Selection Operation º
<All materialized selections
of a BM composition not being directly materialized are to be indirectly
materialized.>
<It’s
calculated.>
Directly Materialized Connection
Selection is a Directly Materialized
Selection Operation º
<All connection selections
being directly materialized are this one.>
Directly Materialized Connection
Selection has a Connection Grouping
Criterion ®
<The
following directly materialized connection selections has one connection
grouping criterion: a) they are nested to one BM composition, b) they pertain
to one outer category (outer or not outer), c) they have connections reflected
by one table, d) they are based on common role
concepts reflected as simple role concepts by all PK attributes of the
table.>
Directly Materialized Connection
Selection is grouped to a SQL. Table
Selection ®
<Directly materialized
connection selections having one connection grouping criterion are grouped to
one SQL table selection.>
<The table selection is based
on part of fields of table selections simply
mapped from all DM connection selections grouped to it. For each couple of
column role concept and table field element mapped to it within a simply mapped
table selection, the table selection contains one field of the result table
selection mapped to the column role concept and based on the table field
element.> {For each such column role concept there should be only one table
field element.} {This fields mapping is of nested fields.}
SCQL. Mapping. Basically
Mapped Composition. Join Criterions
Basically Mapped Composition is a Basically Mapped Selection Operation º
<All BM selection operations
that are compositions are BM compositions.>
Basically Mapped Composition is mapped to a SQL. Filtered Join º
Column Role Concept is a Graph Object º
Column Role Concept Graph is a Undirected Graph.
Undirected Graph º
Basically Mapped Composition has a Column Role Concept
Graph º
<Column role concept graph
consists of only column role concepts of selection operations nested to the
basically mapped composition (and of the basically mapped composition since it
contains all nested ones).>
<Two column role concepts of a
nested calculated connection selection are directly linked in column role
concept graph if they are not the same, and a) they are of the same simple
concept, if it’s part-whole, or intersected connection; b) they have the same
position of complex concept or are exclusive column role concepts, if it’s a
non-intersected biequivalent connection.>
Join Field Group consists of Fields –
Basically Mapped Composition may
have Join Field Groups ¬
<A join field group contains
fields of nested SQL selection operations only.>
<Fields of nested operations
mapped to BM column role concepts of one connected sub-graph (or to one BM
column role concept) of the column role concept graph are in the same join
field group.>
Basically Mapped Composition may have
SQL. Join Criterions ¬
<For each join field group
there is one or several join criterions connecting these fields so, that there
is no a cycle between them, the graph is connected, and there is no connections
between outer table selections. Two fields are joined only if they are of
different table field elements or of different selection operations.> {Any
such set of join criterions is taken. The procedure may be creation a tree with
one root being non-outer table selection and leafs, being other table
selections, from this root.}
<The SQL join criterions are
of the SQL filtered join.>
SCQL. Mapping. Basically
Mapped Composition. Fields Mapping
Column Role Concept Connected
Sub-Graph is a Connected Sub-Graph º
Basically Mapped Composition has Column Role Concept Connected Sub-Graphs ¬
<BM composition has connected
sub-graphs of its column role concept graph.>
Base Materialization Column Role
Concept is a Column Role Concept º
Column Role Concept Connected
Sub-Graph has a Base Materialization
Column Role Concept ®
<Each column role concept
connected sub-graph is to contain at least one column role concept of a role
concept participating in any directly materialized selection operation of the
BM composition. Any such column role concept is considered as base
materialization one.>
Base Materialization Field is a Field º
Column Role Concept Connected
Sub-Graph has a Base Materialization
Field ®
<Each column role concept
sub-graph has a base materialization field which is any directly nested field, besides
those of an outer selection operation, mapped to the base materialization
column role concept of the sub-graph.>
<For each column role concept
of the BM composition there is a copied field:
a) if the column role concept is included to a sub-graph, the field is copied
from the base materialization field of the sub-graph;
b) if the column role concept is not included to a sub-graph, the field is
copied from any directly nested field mapped to the same column role concept.
In both cases, the field is mapped to the column role concept.>
SCQL. Mapping. Basically
Mapped Composition. Predicate
Basically Mapped Composition may
have a SQL Predicate º
<SQL predicate of a BM
composition represents a predicate that is a result of conjunction of SQL
predicates of all nested logical selections of the BM composition.>
<The filtered join mapped from
the BM composition has this predicate.>
Nested Logical Selection is a Basically Mapped Selection Operation º
<It’s nested to a BM
composition.>
<All logical selections nested
to the BM composition are nested logical selections of it.>
Nested Logical Selection is mapped to a SQL Predicate º
<It’s a SQL
predicate mapped from an appropriate role concept predicate.>
Basically Mapped Role Concept
Predicate is a Role Concept Predicate º
<All role concept predicates
of all basically mapped logical selections are basically mapped ones.>
Basically Mapped Role Concept
Predicate is mapped to a SQL Predicate º
<BM role concept predicate is
mapped to the mapped predicate as basically mapped predicate.>
Basically Mapped Predicate is a Predicate º
<It’s directly or indirectly
nested to a BM role concept predicate. All such predicates are BM ones.>
Mapped Predicate is a Predicate º
<It’s directly or indirectly nested
to a SQL predicate. All such predicates are mapped ones.>
Basically Mapped Predicate is mapped to a Mapped Predicate º
<Each predicate nested to this
BM predicate is mapped to its own mapped predicate nested to this mapped
predicate.>
<If it’s a logical predicate,
it is mapped to a logical predicate with the same logical operation.>
<If it’s a term predicate,
it’s mapped to a term predicate with the same comparison operation, and with
first and second functions mapped from basically mapped functions of the
initial predicate.>
<All functions of basically
mapped predicates of term kind are basically mapped ones.>
SCQL. Mapping. Basically
Mapped Union
Basically Mapped Union is a Basically Mapped Selection Operation º
<All BM selection operations that
are unions are BM unions.>
Basically Mapped Union is mapped to a SQL. Union º
<SQL selection operation
nested to the SQL union is mapped from BM selection operation nested to the BM
union.>
<For each couple of fields of
different SQL union nested operations mapped to one BM simple role concept
there is one join criterion connecting these fields.>
<Each column role concept of a
BM union is biuniquely mapped to one field of the SQL union. The field is
copied from any nested field mapped to the same column role concept.>
SCQL. Mapping. Basically
Mapped Minus
Basically Mapped Minus is a Basically Mapped Selection Operation º
<All BM selection operations
that are minuses are BM minuses.>
Basically Mapped Minus is mapped to a SQL. Minus º
<SQL selection operation
nested to the SQL minus is mapped from BM selection operation nested to the BM
minus.>
<For each couple of fields of
different SQL minus nested operations mapped to one BM simple role concept
there is one join criterion connecting these fields.>
<Each column role concept of a
BM minus is biuniquely mapped to one field of the SQL minus. The field is
copied from a nested field of a first nested selection operation mapped to the
same column role concept.>
SCQL. Mapping. BM SCQL Result
BM SCQL
Result is a SCQL
Result º
BM SCQL
Result is
calculated for a Basically Mapped Selection Statement ®
BM SCQL
Result is based on
SQL Result ®
<The SQL result is of SQL selection
statement mapped according to the BM selection statement.>
<SCQL result contains transformed rows of
SQL result. Transformation concerns signature only: each SQL result field is
substituted by SCQL column role concept mapped to the
field.>