Information technology — Topic Maps — Constraint Language (TMCL)

ISO/IEC 19756:2011 (TMCL) is a constraint language for Topic Maps, allowing definitions of Topic Maps schemas to be written in a precise and machine-readable form. This makes it possible to validate a topic map against a TMCL schema to see if it conforms to the constraints in the schema, and also enables other uses, such as schema-driven editors and object mappings. TMCL is defined as a Topic Maps vocabulary consisting of a number of topic, association, occurrence, and role types, identified by Published Subject Identifiers (PSIs), and defined using English prose. It defines the concept of validation, by which a given topic map is valid according to a schema if it conforms to all the constraints in that schema and a number of global validation rules which apply to all topic maps independent of schema. TMCL does not have any syntax of its own, since it is defined simply as a Topic Maps vocabulary. However, a number of CTM templates are defined in ISO/IEC 19756:2011 in order to facilitate authoring of TMCL schemas using CTM.

Technologies de l'information — Plans relatifs à des sujets — Contraintes de langage (TMCL)

General Information

Status
Published
Publication Date
13-Jun-2011
Current Stage
9093 - International Standard confirmed
Start Date
08-Dec-2021
Completion Date
30-Oct-2025
Ref Project

Relations

Standard
ISO/IEC 19756:2011 - Information technology -- Topic Maps -- Constraint Language (TMCL)
English language
33 pages
sale 15% off
Preview
sale 15% off
Preview

Standards Content (Sample)


INTERNATIONAL ISO/IEC
STANDARD 19756
First edition
2011-06-15
Information technology — Topic Maps —
Constraint Language (TMCL)
Technologies de l'information — Plans relatifs à des sujets —
Contraintes de langage (TMCL)
Reference number
©
ISO/IEC 2011
©  ISO/IEC 2011
All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form or by any means,
electronic or mechanical, including photocopying and microfilm, without permission in writing from either ISO at the address below or
ISO's member body in the country of the requester.
ISO copyright office
Case postale 56 • CH-1211 Geneva 20
Tel. + 41 22 749 01 11
Fax + 41 22 749 09 47
E-mail copyright@iso.org
Web www.iso.org
Published in Switzerland
ii © ISO/IEC 2011 – All rights reserved

Page
Contents
Foreword. v

Introduction. vi
1 Scope. 1
2 Normative references. 1
3 Notation and Conventions. 1
3.1 General. 1
3.2 tmdm:subject. 2
3.3 Following an Association. 2
3.4 Following an Association to Roles of Given Type. 2
3.5 Playing a Role. 2
3.6 Being a Subtype. 2
3.7 Being an Instance. 2
3.8 Matching a Regular Expression. 2
3.9 The Value of an Occurrence. 2
3.10 Comparison of iso:ctm-integer values. 3
4 Validation Semantics. 3
5 TMCL Syntax. 3
6 TMCL Declarations. 4
6.1 General. 4
6.2 Topic Type. 4
6.3 Name Type. 4
6.4 Occurrence Type. 4
6.5 Association Type. 4
6.6 Role Type. 4
6.7 Overlap Declaration. 5
7 TMCL Constraint Types. 5
7.1 General. 5
7.2 Abstract Topic Type Constraint. 5
7.3 Subject Identifier Constraint. 5
7.4 Subject Locator Constraint. 6
7.5 Item Identifier Constraint. 7
7.6 Topic Name Constraint. 7
7.7 Variant Name Constraint. 8
7.8 Topic Occurrence Constraint. 9
7.9 Topic Role Constraint. 9
7.10 Scope Constraint. 10
7.11 Scope Required Constraint. 11
7.12 Reifier Constraint. 12
7.13 Topic Reifies Constraint. 12
7.14 Association Role Constraint. 13
7.15 Role Combination Constraint. 14
7.16 Occurrence Data Type Constraint. 15
7.17 Unique Value Constraint. 15
7.18 Regular Expression Constraint. 16
8 Additional TMCL Templates. 16
9 User-defined Constraints. 16
9.1 General. 16
9.2 Denial Constraint. 17
9.3 Requirement Constraint. 17
10 Schema Documentation. 17
10.1 General. 17
10.2 The Schema Topic. 17
© ISO/IEC 2011 – All rights reserved iii

10.3 Documentation Occurrences. 18
10.4 The Topic Map Topic Type. 19
11 Conformance. 19
Annex A (normative) TMCL Templates CTM. 20
Annex B (normative) TMCL meta-schema. 25
iv © ISO/IEC 2011 – 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. In the field of information
technology, ISO and IEC have established a joint technical committee, ISO/IEC JTC 1.
International Standards are drafted in accordance with the rules given in the ISO/IEC Directives, Part 2.
The main task of the joint technical committee is to prepare International Standards. Draft International
Standards adopted by the joint technical committee are circulated to national bodies for voting. Publication as
an International Standard requires approval by at least 75 % of the national bodies casting a vote.
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.
ISO/IEC 19756 was prepared by Joint Technical Committee ISO/IEC JTC 1, Information technology,
Subcommittee SC 34, Document description and processing languages.

© ISO/IEC 2011 – All rights reserved v

Introduction
TMCL is a constraint language for Topic Maps, allowing definitions of Topic Maps schemas to be written in a precise
and machine-readable form. This makes it possible to validate a topic map against a TMCL schema to see if it
conforms to the constraints in the schema, and also enables other uses, such as schema-driven editors, object
mappings, and so on.
TMCL is defined as a Topic Maps vocabulary consisting of a number of topic, association, occurrence, and role
types, identified by Published Subject Identifiers (PSIs), and defined using English prose. TMCL defines the concept
of validation, by which a given topic map is valid according to a schema if it conforms to all the constraints in that
schema and a number of global validation rules which apply to all topic maps independent of schema.
TMCL does not have any syntax of its own, since it is defined simply as a Topic Maps vocabulary. However, a number
of CTM templates are defined in this International Standard in order to facilitate authoring of TMCL schemas using
CTM.
vi © ISO/IEC 2011 – All rights reserved

INTERNATIONAL STANDARD      ISO/IEC 19756:2011(E)

Information technology — Topic Maps — Constraint Language
(TMCL)
1 Scope
This International Standard defines a Topic Maps vocabulary for representing constraints on Topic Maps instance
data and CTM templates for authoring TMCL schemas.
It does not define a syntax for representing constraints on Topic Maps instance data.
2 Normative references
The following referenced documents are indispensable for the application of this document. For dated references,
only the edition cited applies. For undated references, the latest edition of the referenced document (including any
amendments) applies.
NOTE Each of the following documents has a unique identifier that is used to cite the document in the text. The unique
identifier consists of the part of the reference up to the first comma.
ISO/IEC 13250-2:2006, Information technology — Topic Maps — Part 2: Data model
1)
ISO/IEC 18048, Information technology — SGML applications — Topic Map Query Language (TMQL)
ISO/IEC 13250-6, Information technology — Topic Maps — Part 6: Compact syntax
XML Schema-2, XML Schema Part 2: Datatypes Second Edition, W3C Recommendation, 28 October 2004, available
at
3 Notation and Conventions
3.1 General
The TMCL validation rules are defined in English prose using constructs from ISO/IEC 13250-2:2006 (the TMDM),
and written according to certain conventions, whereby some of the phrases in the text have particular interpretations.
These phrases and their interpretations are given in the following clauses.
Throughout this clause the defined phrases contain placeholders given as variables (written thus: v) in the definitions.
When the phrases are used, these placeholders are defined either by reference to topics already defined in the
foo:bar
context where the phrase is used, or using a qname (an identifying token of the form ). Qnames are expanded
into full IRIs using the prefix declarations in Clause 5, and refer to the topic item which has that IRI in its [subject
identifiers]
property.
The following namespace prefixes are used throughout this International Standard:
%prefix tmcl http://psi.topicmaps.org/tmcl/
%prefix tmdm http://psi.topicmaps.org/iso13250/model/
%prefix xsd http://www.w3.org/2001/XMLSchema#
Thus, tmdm:bar is a shorthand for the IRI http://psi.topicmaps.org/iso13250/model/bar.
Throughout this International Standard the syntax [foo], that is, a name in square brackets, not italicized, is used to
refer to property names from ISO/IEC 13250-2:2006 (the TMDM).
1) To be published
© ISO/IEC 2011 – All rights reserved 1

3.2 tmdm:subject
tmdm:subject http://psi.topicmaps.org/iso13250/model/subject
The topic ( ) represents the concept of a subject as defined
in ISO/IEC 13250-2:2006. It is the type of which all topics, statements, and association roles are instances, and the
common supertype of all types. In TMCL it is used in constraints to make it clear that any topic whatsoever may
appear in a particular position in an ontology.
3.3 Following an Association
To follow an association of type at from a topic t means traversing all associations of type at. A is the set of all the
[parent] [roles played]
association items a in the properties of all the role items in the property of t where a's [type]
property contains at or some subtype of at.
[player] [roles]
The end result of the traversal is the set of topic items in the property of each role item r in a's property,
except where r is contained in t's [roles played] property.
3.4 Following an Association to Roles of Given Type
To follow an association of type at to roles of type rt from a topic t means traversing all associations of type at. A
[parent] [roles played]
is the set of all the association items a in the properties of all the role items in the property of
t where a's [type] property contains at or a subtype of at.
[player] [roles]
The end result of the traversal is the set of topic items in the property of each role item r in a's property,
except where r is contained in t's [roles played] property, or where r's [type] property does not contain rt or some
subtype of rt.
3.5 Playing a Role
[roles played]
A topic t is said to play a role of type rt in an association of type at when t's property contains at least one
role item r whose [type] property contains rt (or some subtype of rt) and r's [parent] property contains an association
[type]
item whose property contains at or some subtype of at.
3.6 Being a Subtype
tmdm:supertype-subtype
A topic type t1 is said to be an subtype of the topic type t2 if following the association type
from t1 to roles of type tmdm:supertype produces either t2 or a subtype of t2. If t2 is tmdm:subject then t1 is a subtype
tmdm:supertype-subtype
of it even if the necessary associations are not present.
3.7 Being an Instance
tmdm:type-instance
A topic t is said to be an instance of the topic type tt if following the association type from t produces
either tt, a subtype of tt, or if tt is tmdm:subject.
A statement s (as defined in ISO/IEC 13250-2:2006) is said to be an instance of the statement type st if the s's [type]
property contains either st, a subtype of st, or if st is tmdm:subject.
3.8 Matching a Regular Expression
A string s matches a regular expression r if the string is a member of the set of strings L(r) denoted by r as defined
in appendix F of [XML Schema-2].
3.9 The Value of an Occurrence
The value of a topic t's occurrence of type ot is referred to as v, and produced by finding the occurrence item o in t's
[occurrences] property whose [type] property contains ot or some subtype of ot. If no such occurrence exists there is
no given value. It is an error if there is more than one such occurrence.
© ISO/IEC 2011 – All rights reserved
3.10 Comparison of iso:ctm-integer values
tmcl:card-min tmcl:card-max
When comparing and values, in addition to the ordinary integers, one may encounter the
special value * of datatype iso:ctm-integer. This special value is used to indicate unlimited cardinality, and compares
as larger than any specific integer.
4 Validation Semantics
This International Standard defines two kinds of rules:
— Constraint validation rules, which specify how to validate the constraint represented by an individual topic that
is an instance of some subclass of tmcl:constraint.
— Global validation rules, which are not tied to any specific constraint topic, and which apply to the entire topic
map.
A schema is a set of constraint topics, declaration topics, topic types, association types, role types, name types, and
occurrence types contained in a topic map.
A topic map is valid according to a schema if the topic map is valid according to each individual constraint in the
schema, and if the topic map is valid according to all the global validation rules specified in this International Standard.
NOTE 1 This is a very strict form of validation, which may not be suitable for all situations. Implementations may allow users
to turn off any set of constraints they choose in order to allow more flexible forms of validation.
A topic map is valid according to a constraint if the topic map satisifies the constraint validation rule defined for the
constraint type of which the constraint topic is an instance.
NOTE 2 TMCL does not dictate when constraints should be applied, nor does it state what it means to a controlling application
when it is found that a given constraint is violated.
The validation rules defined in this International Standard assume that the schema and the instance data are located
in the same topic map. If this is not the case, implementations shall behave as though the schema and instance topic
tmcl:includes-schema
maps were merged. This includes any schemas included by using , even though these schemas
may physically reside in other topic maps.
Implementations shall also behave as though the topic map in Annex B were merged into the topic map being
validated.
5 TMCL Syntax
TMCL has no syntax of its own, but since TMCL schemas are represented as topic maps, any Topic Maps
representation can be used to create a TMCL schema. The schema shall, however, be valid according to the TMCL
tmcl:regexp
meta-schema in Annex B. The values of all occurrences of type shall be valid regular expressions as
defined in [XML Schema-2].
Throughout this International Standard all examples are given using the CTM syntax (defined in ISO/IEC 13250-6),
and to facilitate the authoring of TMCL in CTM a number of templates are defined. These templates exist in a resource
http://www.isotopicmaps.org/tmcl/templates.ctm
that can be downloaded and included in any CTM file.
To include the TMCL templates the following CTM include directive can be used:
%include http://www.isotopicmaps.org/tmcl/templates.ctm
© ISO/IEC 2011 – All rights reserved
6 TMCL Declarations
6.1 General
TMCL provides a number of constructs known as declarations, which allow Topic Maps constructs to be used in
ways which would otherwise be forbidden by the global validation rules. Declarations are in a sense the opposite of
constraints, in that their effect is to relax constraints built into TMCL.
6.2 Topic Type
Making a topic an instance of tmcl:topic-type is a declaration that the topic may be used as a topic type.
EXAMPLE Declaring person a topic type:
person isa tmcl:topic-type .
tmdm:type tmdm:type-instance
Global Validation Rule: any topic t which plays a role of type in an association of type ,
but which is not an instance of tmcl:topic-type, is invalid.
6.3 Name Type
Making a topic an instance of tmcl:name-type is a declaration that the topic may be used as a name type.
EXAMPLE Declaring nickname a name type:
nickname isa tmcl:name-type .
[type]
Global Validation Rule: any topic name item n whose property contains a topic item t where t is not an instance
of tmcl:name-type is invalid.
6.4 Occurrence Type
Making a topic an instance of tmcl:occurrence-type is a declaration that the topic may be used as an occurrence type.
EXAMPLE Declaring date-of-birth an occurrence type:
date-of-birth isa tmcl:occurrence-type .
[type]
Global Validation Rule: any occurrence item o whose property contains a topic item t where t is not an instance
of tmcl:occurrence-type is invalid.
6.5 Association Type
Making a topic an instance of tmcl:association-type is a declaration that the topic may be used as an association type.
EXAMPLE Declaring that works-for is an association type:
works-for isa tmcl:association-type .
[type]
Global Validation Rule: any association item a whose property contains a topic item t where t is not an instance
of tmcl:association-type is invalid.
6.6 Role Type
Making a topic an instance of tmcl:role-type is a declaration that the topic may be used as a role type.
EXAMPLE Declaring containee a role type:
containee isa tmcl:role-type .
© ISO/IEC 2011 – All rights reserved
Global Validation Rule: any association role item r whose [type] property contains a topic item t where t is not an
tmcl:role-type
instance of is invalid.
6.7 Overlap Declaration
tmcl:overlap-declaration
The is used to declare that the sets of instances of two or more topic types are non-disjoint
(that is, that they may overlap). The default is that the instance sets of different topic types are disjoint.
EXAMPLE The following declares that the topic types person and employee overlap:
person isa tmcl:topic-type;
overlaps(employee).
The CTM template for the overlaps declaration is defined as:
def overlaps($tt1, $tt2)
?c isa tmcl:overlap-declaration.
tmcl:overlaps(tmcl:allows : ?c, tmcl:allowed : $tt1)
tmcl:overlaps(tmcl:allows : ?c, tmcl:allowed : $tt2)
end
Global Validation Rule: the set of all the topic types of which a given topic t is an instance is referred to as TT. t is
invalid if there exists a pair of different topics t1 and t2 in TT such that:
— t1 is not a subtype of t2 (or vice versa), and
tmcl:overlap-declaration tmcl:overlaps
— there does not exist a c which is an instance of and where following the
association from c produces both t1 and t2.
7 TMCL Constraint Types
7.1 General
The tmcl:constraint topic type is used as the base type for all topic types that are considered constraint types. It is an
abstract type used simply to group the constraint types for ease of schema introspection.
7.2 Abstract Topic Type Constraint
tmcl:abstract-constraint
The states that a given topic type shall not have any direct instances.
creature
EXAMPLE The following states that is an abstract topic type:
creature isa tmcl:topic-type;
is-abstract().
The CTM template for the abstract constraint is defined as:
def is-abstract($tt)
?c isa tmcl:abstract-constraint.
tmcl:constrained-topic-type(tmcl:constraint : ?c, tmcl:constrained : $tt)
end
Constraint Validation Rule for all constraints c of type tmcl:abstract-constraint: c applies to a topic type t, which can be
tmcl:constrained-topic-type
found by following associations of type from the c topic. t violates the constraint if it plays
the role of type tmdm:type in any association of type tmdm:type-instance.
7.3 Subject Identifier Constraint
A subject identifier constraint constrains the subject identifiers of instances of a given topic type. The constraint has
the following properties:
© ISO/IEC 2011 – All rights reserved
— card-min, indicating the minimum number of subject identifiers a valid instance shall have
card-max
— , indicating the maximum number of subject identifiers a valid instance can have, and
— regexp, a regular expression the subject identifier shall match.
EXAMPLE The following states that topics of type person shall have zero or one subject identifier:
person isa tmcl:topic-type;
has-subject-identifier(0, 1, ".*").
The CTM template for the subject identifier constraint is defined as:
def has-subject-identifier($tt, $min, $max, $regexp)
?c isa tmcl:subject-identifier-constraint;
tmcl:card-min: $min;
tmcl:card-max: $max;
tmcl:regexp: $regexp.
tmcl:constrained-topic-type(tmcl:constraint : ?c, tmcl:constrained : $tt)
end
Constraint Validation Rule for all constraints c of type tmcl:subject-identifier-constraint: c applies to a topic type t, which
tmcl:constrained-topic-type c
can be found by following the association from . The constraint has the following properties:
— r, which is the value of c's occurrence of type tmcl:regexp if given, and ".*" if not,
tmcl:card-min 0
— min, which is the value of c's occurrence, if given, and , if not, and
— max, which is the value of c's tmcl:card-max occurrence, if given, and undefined, if not.
For each instance i of t the set of its subject identifiers which match r is referred to as S. i violates c if the cardinality
of S is lower than min or greater than max (provided max is not undefined).
7.4 Subject Locator Constraint
A subject locator constraint constrains the subject locators of instances of a given topic type. The constraint has the
following properties:
— card-min, indicating the minimum number of subject locators a valid instance shall have
card-max
— , indicating the maximum number of subject locators a valid instance can have, and
— regexp, a regular expression that the subject locator shall match.
EXAMPLE The following states that topics of type document shall have at least one subject locator:
document isa tmcl:topic-type;
has-subject-locator(1, *, ".*").
The CTM template for the subject locator constraint is defined as:
def has-subject-locator($tt, $min, $max, $regexp)
?c isa tmcl:subject-locator-constraint;
tmcl:card-min: $min;
tmcl:card-max: $max;
tmcl:regexp: $regexp.
tmcl:constrained-topic-type(tmcl:constraint : ?c, tmcl:constrained : $tt)
end
Constraint Validation Rule for all constraints c of type tmcl:subject-locator-constraint: c applies to a topic type t, which
tmcl:constrained-topic-type c
can be found by following the association from . The constraint has the following properties:
— r, which is the value of c's occurrence of type tmcl:regexp if given, and ".*" if not,
tmcl:card-min 0
— min, which is the value of c's occurrence, if given, and , if not, and
© ISO/IEC 2011 – All rights reserved
— max, which is the value of c's tmcl:card-max occurrence, if given, and undefined, if not.
For each instance i of t the set of its subject locators which match r is referred to as S. i violates c if the cardinality
of S is lower than min or greater than max (provided max is not undefined).
7.5 Item Identifier Constraint
An item identifier constraint constrains the item identifiers of topic map constructs of a given type. The constraint has
the following properties:
— card-min, indicating the minimum number of item identifiers a valid instance shall have
card-max
— , indicating the maximum number of item identifiers a valid instance can have, and
— regexp, a regular expression that the item identifier shall match.
EXAMPLE The following states that topics of type document shall have at least one item identifier:
document isa tmcl:topic-type;
has-item-identifier(1, *, ".*").
The CTM template for the item identifier constraint is defined as:
def has-item-identifier($tt, $min, $max, $regexp)
?c isa tmcl:item-identifier-constraint;
tmcl:card-min: $min;
tmcl:card-max: $max;
tmcl:regexp: $regexp.
tmcl:constrained-construct(tmcl:constraint : ?c, tmcl:constrained : $tt)
end
Constraint Validation Rule for all constraints c of type tmcl:item-identifier-constraint: c applies to a Topic Maps construct
tmcl:constrained-construct c
t, which can be found by following the association from . The constraint has the following
properties:
tmcl:regexp ".*"
— r, which is the value of c's occurrence of type if given, and if not,
— min, which is the value of c's tmcl:card-min occurrence, if given, and 0, if not, and
tmcl:card-max
— max, which is the value of c's occurrence, if given, and undefined, if not.
For each instance i of t the set of its item identifiers which match r is referred to as S. i violates c if the cardinality of
S is lower than min or greater than max (provided max is not undefined).
7.6 Topic Name Constraint
A topic name constraint constrains the type and cardinality of topic names for instances of a given topic type. The
constraint has the following properties:
card-min
— , indicating the minimum number of names a valid instance shall have, and
— card-max, indicating the maximum number of names a valid instance shall have.
EXAMPLE The following states that topics of type person shall have exactly one name of type tmdm:topic-name:
person isa tmcl:topic-type;
has-name(tmdm:topic-name, 1, 1).
The CTM template for the topic name constraint is defined as:
def has-name($tt, $nt, $min, $max)
?c isa tmcl:topic-name-constraint;
tmcl:card-min: $min;
tmcl:card-max: $max.
© ISO/IEC 2011 – All rights reserved
tmcl:constrained-topic-type(tmcl:constraint : ?c, tmcl:constrained : $tt)
tmcl:constrained-statement(tmcl:constraint : ?c, tmcl:constrained : $nt)
end
Constraint Validation Rule for all constraints c of type tmcl:topic-name-constraint: c applies to a topic type t, which can be
tmcl:constrained-topic-type
found by following associations of type from c. The constraint has the following properties:
— nt, which is obtained by following associations of type tmcl:constrained-statement from c,
tmcl:card-min 0
— min, which is the value of c's occurrence, if given, and , if not, and
— max, which is the value of c's tmcl:card-max occurrence, if given, and undefined, if not.
For each instance i of t the set of its topic names of type nt is referred to as N. i violates c if the cardinality of N is
lower than min or greater than max (provided max is not undefined).
Global Validation Rule: any topic name n, whose type is referred to as t, is invalid if no constraint c that is an instance of
tmcl:topic-name-constraint can be found such that the topic found by following c's tmcl:constrained-statement associations
is t.
7.7 Variant Name Constraint
A variant name constraint constrains the scope and cardinality of variant names for topic names on instances of a
given topic type. The constraint has the following properties:
card-min
— , indicating the minimum number of names a valid instance shall have for each topic name, and
— card-max, indicating the maximum number of names a valid instance shall have for each topic name.
EXAMPLE The following states that for topics of type person the tmdm:topic-names shall have exactly one variant with xtm:sort
in its scope:
person isa tmcl:topic-type;
has-variant(tmdm:topic-name, xtm:sort, 1, 1).
The CTM template for the variant name constraint is defined as:
def has-variant($tt, $nt, $t, $min, $max)
?c isa tmcl:variant-name-constraint;
tmcl:card-min: $min;
tmcl:card-max: $max.
tmcl:constrained-topic-type(tmcl:constraint : ?c, tmcl:constrained : $tt)
tmcl:constrained-statement(tmcl:constraint : ?c, tmcl:constrained : $nt)
tmcl:constrained-scope-topic(tmcl:constraint : ?c, tmcl:constrained : $t)
end
tmcl:variant-name-constraint
Constraint Validation Rule for all constraints c of type : c applies to a topic type t, which
can be found by following associations of type tmcl:constrained-topic-type from c. The constraint has the following
properties:
— nt, which is obtained by following associations of type tmcl:constrained-statement from c,
tmcl:constrained-scope-topic
— s, which is obtained by following associations of type from c,
— min, which is the value of c's tmcl:card-min occurrence, if given, and 0, if not, and
tmcl:card-max
— max, which is the value of c's occurrence, if given, and undefined, if not.
For each instance i of nt which is attached to a topic of type tt the set of its variant names whose scopes contain
s is referred to as N. i violates c if the cardinality of N is lower than min or greater than max (provided max is not
undefined).
© ISO/IEC 2011 – All rights reserved
Global Validation Rule: any variant name v, whose scope is referred to as S, is invalid if no constraint c that is an
tmcl:variant-name-constraint
instance of can be found such that
— the topic found by following c's tmcl:constrained-statement associations is the same as the type of v's topic name,
tmcl:constrained-topic-type
— the topic found by following c's associations is the same as the type of v's topic
name's topic, and
tmcl:constrained-scope-topic
— the topic found by following c's associations is an element of S.
7.8 Topic Occurrence Constraint
A topic occurrence constraint constrains the type and cardinality of occurrences connected to a topic of a given type.
The constraint has the following properties:
card-min
— , indicating the minimum number of occurrences a valid instance shall have, and
— card-max, indicating the maximum number of occurrences a valid instance may have.
EXAMPLE The following states that topics of type person shall have exactly one occurrence of type date-of-birth:
person isa tmcl:topic-type;
has-occurrence(date-of-birth, 1, 1).
The CTM template for the topic occurrence constraint is defined as:
def has-occurrence($tt, $ot, $min, $max)
?c isa tmcl:topic-occurrence-constraint;
tmcl:card-min: $min;
tmcl:card-max: $max.
tmcl:constrained-topic-type(tmcl:constraint : ?c, tmcl:constrained : $tt)
tmcl:constrained-statement(tmcl:constraint : ?c, tmcl:constrained : $ot)
end
tmcl:topic-occurrence-constraint
Constraint Validation Rule for all constraints c of type : c applies to a topic type t, which
can be found by following the association of type tmcl:constrained-topic-type from c. The constraint has the following
properties:
— ot, which is obtained by following associations of type tmcl:constrained-statement from c,
tmcl:card-min 0
— min, which is the value of c's occurrence, if given, and , if not, and
— max, which is the value of c's tmcl:card-max occurrence, if given, and undefined, if not.
For each instance i of t the set of its occurrences of type ot is referred to as O. i violates c if the cardinality of O is
lower than min or greater than max (provided max is not undefined).
Global Validation Rule: any occurrence o, whose type is referred to as t, is invalid if no constraint c that is an instance
of tmcl:topic-occurrence-constraint can be found such that the topic found by following c's tmcl:constrained-statement
associations is t.
7.9 Topic Role Constraint
A topic role constraint constrains the types of roles topics of a given type can play in associations of a given type. It
can also be seen as constraining the types of topics which may play roles of a given type in associations of a given
type. The constraint has the following properties:
— card-min, indicating the minimum number of roles a valid instance shall have, and
card-max
— , indicating the maximum number of roles a valid instance can have.
person employee
EXAMPLE The following states that topics of type shall have exactly one role of type in associations of type
works-for:
© ISO/IEC 2011 – All rights reserved
person isa tmcl:topic-type;
plays-role(employee, works-for, 1, 1).
The CTM template for the topic role constraint is defined as:
def plays-role($tt, $rt, $at, $min, $max)
?c isa tmcl:topic-role-constraint;
tmcl:card-min: $min;
tmcl:card-max: $max.
tmcl:constrained-topic-type(tmcl:constraint : ?c, tmcl:constrained : $tt)
tmcl:constrained-statement(tmcl:constraint : ?c, tmcl:constrained : $at)
tmcl:constrained-role(tmcl:constraint : ?c, tmcl:constrained : $rt)
end
Constraint Validation Rule for all constraints c of type tmcl:topic-role-constraint: c applies to a topic type tt, which
tmcl:constrained-topic-type
can be found by following the association of type from c. The constraint has the following
properties:
tmcl:constrained-role
— rt, which is obtained by following associations of type from c,
— at, which is obtained by following associations of type tmcl:constrained-statement from c,
tmcl:card-min 0
— min, which is the value of c's occurrence, if given, and , if not, and
— max, which is the value of c's tmcl:card-max occurrence, if given, and undefined, if not.
For each instance i of tt the set of its roles of type rt is referred to as R. i violates c if the cardinality of R is lower
than min or greater than max (provided max is not undefined).
Global Validation Rule: any association role r, whose type is referred to as rt, and the type of whose containing
association is referred to as at, is invalid if no constraint c that is an instance of tmcl:topic-role-constraint can be found
tmcl:constrained-statement
such that the topic found by following c's associations is at and such that the topic found
by following c's tmcl:constrained-role associations is rt.
7.10 Scope Constraint
A tmcl:scope-constraint constrains the types of topics which may appear in the scope of a name, occurrence, or
association of a particular type. The constraint has the following properties:
— card-min, indicating the minimum number of scoping topics a valid instance shall have, and
card-max
— , indicating the maximum number of scoping topics a valid instance can have.
description language
EXAMPLE The following states that every occurrence of type shall have exactly one topic of type in its scope:
description isa tmcl:occurrence-type;
has-scope(language, 1, 1).
The CTM template for the scope constraint is defined as:
def has-scope($st, $tt, $min, $max)
?c isa tmcl:scope-constraint;
tmcl:card-min: $min;
tmcl:card-max: $max.
tmcl:constrained-statement(tmcl:constraint : ?c, tmcl:constrained : $st)
tmcl:constrained-scope(tmcl:constraint : ?c, tmcl:constrained : $tt)
end
Constraint Validation Rule for all constraints c of type tmcl:scope-constraint: c applies to a name, occurrence, or
tmcl:constrained-statement
association type st, which can be found by following associations of type from c. It has the
following properties:
© ISO/IEC 2011 – All rights reserved
— t, which can be found by following associations of type tmcl:constrained-scope from c,
tmcl:card-min 0
— min, which is the value of c's occurrence, if given, and , if not, and
— max, which is the value of c's tmcl:card-max occurrence, if given, and undefined, if not.
For any name, occurrence, or association s of type st the set of topics in its scope which are instances of t is referred
to as S. s violates c if the cardinality of S is lower than min or greater than max (provided max is not undefined).
Global Validation Rule: For every topic t in the scope of a name, occurrence, or association s, where s's type is
referred to as st, t is invalid if the following does not hold. There shall exist a constraint c, which shall be an instance
tmcl:scope-constraint tmcl:constrained-statement
of , where following associations of type from c shall produce st, and
following associations of type tmcl:constrained-scope from c shall produce at least one topic type of which t is an
instance.
7.11 Scope Required Constraint
tmcl:scope-required-constraint
A constrains the appearance of a name, occurrence, or association of a particular type
on topics of a particular type with a given instance topic in its scope. The constraint has the following properties:
card-min
— , indicating the minimum number of times the given statement shall appear on topics of the given
type, and
card-max
— , indicating the maximum number of times the given statement shall appear on topics of the given type.
category english
EXAMPLE The following states that every topic of type shall have a description in the scope , and another in
the scope norwegian:
description isa tmcl:occurrence-type;
has-scope(language, 1, 1).
category isa tmcl:topic-type;
has-occurrence(description, 2, 2);
requires-scope(description, english, 1, 1);
requires-scope(description, norwegian, 1, 1).
The CTM template for the scope required constraint is defined as:
def requires-scope($tt, $st, $t, $min, $max)
?c isa tmcl:scope-required-constraint;
tmcl:card-min: $min;
tmcl:card-max: $max.
tmcl:constrained-topic-type(tmcl:constraint : ?c, tmcl:constrained : $tt)
tmcl:constrained-statement(tmcl:constraint : ?c, tmcl:constrained : $st)
tmcl:constrained-scope-topic(tmcl:constraint : ?c, tmcl:constrained : $t)
end
tmcl:scope-required-constraint
Constraint Validation Rule for all constraints c of type : c applies to a name, occurrence,
or association type st, which can be found by following associations of type tmcl:constrained-statement from c. It has
the following properties:
— tt, which can be found by following associations of type tmcl:constrained-topic-type from c,
tmcl:constrained-scope-topic
— t, which can be found by following associations of type from c,
— min, which is the value of c's tmcl:card-min occurrence, if given, and 0, if not, and
tmcl:card-max
— max, which is the value of c's occurrence, if given, and undefined, if not.
For any topic i of type tt the set of its names, occurrences, and associations of type st whose scopes contain t is
known as S. i violates c if the cardinality of S is greater than max (provided max is not
...

Questions, Comments and Discussion

Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.

Loading comments...