ISO/IEC TR 19583-21:2022
(Main)Information technology — Concepts and usage of metadata — Part 21: 11179-3 Data model in SQL
Information technology — Concepts and usage of metadata — Part 21: 11179-3 Data model in SQL
This document provides a possible instantiation of the registry metamodel specified in ISO/IEC 11179-3 using the SQL database language as specified in ISO/IEC 9075-2.
Technologies de l'information — Concepts et utilisation des métadonnées — Partie 21: Titre manque
General Information
Relations
Standards Content (Sample)
TECHNICAL ISO/IEC TR
REPORT 19583-21
First edition
2022-08
Information technology — Concepts
and usage of metadata —
Part 21:
11179-3 Data model in SQL
Reference number
© ISO/IEC 2022
© ISO/IEC 2022
All rights reserved. Unless otherwise specified, or required in the context of its implementation, no part of this publication may
be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, or posting on
the internet or an intranet, without prior written permission. Permission can be requested from either ISO at the address below
or ISO’s member body in the country of the requester.
ISO copyright office
CP 401 • Ch. de Blandonnet 8
CH-1214 Vernier, Geneva
Phone: +41 22 749 01 11
Email: copyright@iso.org
Website: www.iso.org
Published in Switzerland
ii
© ISO/IEC 2022 – All rights reserved
Contents Page
Foreword .iv
Introduction .v
1 Scope . 1
2 Normative references . 1
3 Terms and definitions . 1
4 Overview of the relationship between UML Class Diagrams and SQL .1
5 Generating the SQL for the metamodel . 2
5.1 Overview . 2
5.2 General principles for the translation of a UML Class diagram into SQL statements . 2
5.3 Specific approaches taken for the translation of the metadata registry metamodel . 3
5.3.1 Overview . 3
5.3.2 Obligations . 3
5.3.3 Translation of datatypes . 3
5.3.4 Translation of the basic classes . 4
5.3.5 Translation of the <> stereotypes . 4
5.3.6 Translation of the remaining classes . . 5
5.3.7 Translation of specialization hierarchies . 5
5.3.8 Translation of the association classes . 5
5.3.9 Translation of the attributes of the classes. 5
5.3.10 Translation of the associations . 6
5.3.11 Cross-table constraints . 6
6 Example SQL for instantiation of the metamodel . 6
Annex A (informative) Example SQL to instantiate the ISO/IEC 11179-3 metamodel .8
Bibliography .58
iii
© ISO/IEC 2022 – All rights reserved
Foreword
ISO (the International Organization for Standardization) and IEC (the International Electrotechnical
Commission) form the specialized system for worldwide standardization. National bodies that are
members of ISO or IEC participate in the development of International Standards through technical
committees established by the respective organization to deal with particular fields of technical
activity. ISO and IEC technical committees collaborate in fields of mutual interest. Other international
organizations, governmental and non-governmental, in liaison with ISO and IEC, also take part in the
work.
The procedures used to develop this document and those intended for its further maintenance
are described in the ISO/IEC Directives, Part 1. In particular, the different approval criteria
needed for the different types of document should be noted. This document was drafted in
accordance with the editorial rules of the ISO/IEC Directives, Part 2 (see www.iso.org/directives or
www.iec.ch/members_experts/refdocs).
Attention is drawn to the possibility that some of the elements of this document may be the subject
of patent rights. ISO and IEC shall not be held responsible for identifying any or all such patent
rights. Details of any patent rights identified during the development of the document will be in the
Introduction and/or on the ISO list of patent declarations received (see www.iso.org/patents) or the IEC
list of patent declarations received (see https://patents.iec.ch).
Any trade name used in this document is information given for the convenience of users and does not
constitute an endorsement.
For an explanation of the voluntary nature of standards, the meaning of ISO specific terms and
expressions related to conformity assessment, as well as information about ISO's adherence to
the World Trade Organization (WTO) principles in the Technical Barriers to Trade (TBT) see
www.iso.org/iso/foreword.html. In the IEC, see www.iec.ch/understanding-standards.
This document was prepared by Joint Technical Committee ISO/IEC JTC 1, Information technology,
Subcommittee SC 32, Data management and interchange.
A list of all parts in the ISO/IEC 19583 series can be found on the ISO and IEC websites.
Any feedback or questions on this document should be directed to the user’s national standards
body. A complete listing of these bodies can be found at www.iso.org/members.html and
www.iec.ch/national-committees.
iv
© ISO/IEC 2022 – All rights reserved
Introduction
[1]
ISO/IEC 11179-3 provides a specification for a registry in which information about metadata can be
recorded and maintained.
The metamodel to instantiate such a registry is expressed in text as a conceptual model. This conceptual
model is illustrated with a series of diagrams which use the class diagram notation from the Unified
[2][3]
Modeling Language (UML) .
Instantiaters and users of the registries described in ISO/IEC 11179-3 require further guidance to turn
the conceptual models into concrete instantiations. This document provides a possible instantiation of
the registry metamodel specified in ISO/IEC 11179-3 using the SQL database language as specified in
[4]
ISO/IEC 9075 .
This specimen instantiation is provided to increase the understanding of ISO/IEC 11179-3 and, hence,
to promote its adoption.
v
© ISO/IEC 2022 – All rights reserved
TECHNICAL REPORT ISO/IEC TR 19583-21:2022(E)
Information technology — Concepts and usage of
metadata —
Part 21:
11179-3 Data model in SQL
1 Scope
This document provides a possible instantiation of the registry metamodel specified in ISO/IEC 11179-3
using the SQL database language as specified in ISO/IEC 9075-2.
2 Normative references
There are no normative references in this document.
3 Terms and definitions
No terms and definitions are listed in this document.
ISO and IEC maintain terminology databases for use in standardization at the following addresses:
— ISO Online browsing platform: available at https:// www .iso .org/ obp
— IEC Electropedia: available at https:// www .electropedia .org/
4 Overview of the relationship between UML Class Diagrams and SQL
The Unified Modeling Language (UML) provides a family of graphical notations that can be used in the
analysis and design of software systems. The UML is under the control of the Object Management Group
(OMG) and, as such, it is (a) a relatively ‘open’ standard, and (b) firmly rooted in the object-oriented
paradigm for software engineering. The UML is now at Version 2 and is the subject of two international
standards: ISO/IEC 19505-1 and ISO/IEC 19505-2.
Within the UML, the Class Diagram notation is used to represent information (and, hence, data)
requirements for a particular ‘universe of discourse’, a business area or the scope of a proposed
information system.
A UML Object is often defined as a:
construct within a system for which a set of attributes and operations can be specified.
Whilst this is a reasonable definition within the context of object-oriented system development, a more
appropriate definition of an Object for the purposes of this document is a:
representation of something of interest within the universe of discourse about which
information needs to be recorded.
An Object Class in both contexts can then defined as a:
definition of a set of Objects that share the same attributes, associations, and operations.
The Database Language SQL is a, largely, declarative language used to manage structured data held
in a database under the control of a Relational Database Management System (RDBMS). As such, it
© ISO/IEC 2022 – All rights reserved
[5]
was originally based on Edgar F. Codd’s relational model of data published in 1970 , but its scope has
grown over the years. SQL is the subject of the multi-part set of International Standards, ISO/IEC 9075
series. Most commercial SQL products, however, deviate from the standards to some extent, some more
than others.
5 Generating the SQL for the metamodel
5.1 Overview
The UML (and the Class Diagrams, in particular) and the SQL database language exist in two separate
programming paradigms and there is, therefore, no direct translation from one (the UML) to the other
(SQL). There are, however, approaches that can be taken to achieve a translation. This document uses
one of those approaches to generate a set of SQL statements to instantiate the metadata registry
metamodel, where the SQL statements enable easy reference back to the original UML Class Diagram
and text of the metamodel. This is achieved by using names for the SQL objects that reflect the names
of the UML artefacts and, also, by embedding comments referencing the metamodel within the SQL
statements.
5.2 General principles for the translation of a UML Class diagram into SQL statements
It is good practice to distinguish between SQL keywords and the names given to the SQL objects. One
convention is to use UPPER CASE for the keywords and lower_case (using snake case) for the object
names.
Each UML class is represented by an SQL table. To make correlation to the model easier, the name of a
table that represents a class is the same as that of the class.
Each composite datatype is also represented by an SQL table. To make correlation to the model easier,
the name of the table is the same as that of the datatype.
Each single-valued attribute of a class or a composite datatype is represented by a column in the
appropriate table. The name of this column is the same as that of the attribute in the class or datatype.
The datatype of an attribute column is intuitively selected to be similar to that of the datatype of the
attribute.
If the datatype of an attribute of a class is another class or a composite datatype, the column that
represents that attribute is additionally declared as a foreign key column referencing the relevant table
that represents the class or composite datatype.
Where an attribute is multivalued (that is, it has a multiplicity of [0.*] or [1.*] in the UML diagram)
there are two possible instantiations available. These are:
a) Use one of the collection types, MULTISET or ARRAY, available in SQL.
b) Create a new table, a characteristic table, to hold the multiple values, with each row in the table
having a foreign key referencing the kernel (prime) table and one of the values.
In object-orientation, and, hence, UML, there is no equivalent of the SQL primary key, so each table
that represents a class or a composite datatype has an additional column that is used as a surrogate
identifier. This column then becomes the primary key for the table.
UNIQUE or CHECK constraints may be added to a table where required. The latter are used, for example,
to control the valid values for a column or to control which columns should, or should not, take values in
different circumstances.
Specialization hierarchies (superclasses and their subclasses) can be instantiated in one of two ways
using SQL structures.
1) It is possible to integrate all the classes (the superclass and its subclasses) into one table, named
after the superclass, which includes a column for each attribute of the superclass, with those
© ISO/IEC 2022 – All rights reserved
ISO/IEC TR 19583-2
...
Questions, Comments and Discussion
Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.