ISO IEC 19756:2011 pdf – Information technology一Topic Maps一 Constraint Language (TMCL).
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 torbidden by the global validation rules. Declarations are in a sense the opposite 0? constraints. in that their effect is to relax constraints built into TMCL.
62 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 per’.on a Topic type:
pcrs* isa Und.iupic-Iype.
Global Validation Rule: any topic t which plays a rOte of type tnidm:Iype in an association of type irndm:ype-insurnce, but which is not an instance of rmcl:wpic-Iype, Is invalid.
6.3 Name Type
Making a topic an instance of Lmd:name-Iypc is a declaration that the topic may be used as a name type. EXAMPLE Declaring nainamc a name type:
nickname ia tindrnanwlvpe.
Global Validation Rule: any topic name item n whose iypc property contains a topic item S where S is not an instance of tmd:nanic-typc is invalid.
6.4 Occurrence Type
Making a topic an instance of tmd:occurrcnc-typc is a declaration that the topic may be used as an occurrence type.
EXAMPLE Declaring datc-of-birth an occurrence type:
dale-of-birth ka lnsd:ocurre1kc-Iypc.
Global Validation Rule: any occurrence Item o whose ltypcI poperty contains a topic Item £ where S’s not an instance of tincl:oecurreni.’ciypc is invalid.
6.5 AssociatIon Type
Making a topic an instance of tnid:as’.ociaiiin-iype is a declaration that the topic may be used as an association type.
EXAMPLE Declaring that borLs-for is an association type:
wo.ts-fo is Inwl:asociation-pe –
Global Validation Rule- any association item a whose IlypeI property contains a topic item twhere tis not an instance of ii cl:itssoiatitm-typc is invalid.
6.6 Role Type
Making a topic an instance of tnid:rtik-type is a declaration that the topic may be used as a role type.
EXAMPLE Declaring i Ibrac a rote type
Global Validation Rule: any association role item r whose (type I property contains a top item t where t is not an instance of tmd:rnlc-typc is invalid.
6.7 Overlap Declaration
The mcl:ovcrlap-dcdaration is used to declare that the sets of instances of Iwo or more topic types are non-disjoint (that is, that they may overlap). The default is that the instance sets of diilerent topic types are disjoint.
EXAMPLE The I ollowrng declares that the topic types perwa and employei overlap:
per%oI) ia tnicl:Iopie-L)pe.
orlap%4rnpkiycr).
The CTM template for the overlaps declaration is defined as:
def ø%erlap%i Sn I. Sn2 I
•k isa tmd:ovcrlap-dcdaration. tmcl:oserlapsitincl:allows : ?c. tmcl:aIkwed : Stifl tmcl:oserbps(tincl:allows : ‘k. 1,ncl:alluwed : $112) end
Global Validation Rule: the set of all the topic types of which a given topic t is an instance is referred to as IT, t is invalid if there exists a pair of different topics 11 and t2 in TT such that:
— U is not a subtype of t2 (or vice versa), and
— there does not exist a C which is an instance of und:i erbp-dedar,ilion and where following the Lmcl:osellap% association from c produces both ti and t2.
7 TMCL Constraint Types
7.1 General
The tmcl:contmint 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
The imd:absiract-vanstraint states that a given topic type shall not have any direct instances.
EXAMPLE The blowing states that ua1wc is an stract topic type:
craturc isa tmcl:topic-ypc:
The CTM template for the abstract constraint is defined as.