Code#

Fully qualified class name of the UML model DDI-CDI 1.0: DDICDIModels::DDICDILibrary::Classes::Representations::Code

Definition#

The characters used as a symbol to designate a category within a codelist or classification. (Formally, a sign for which the signifier is non-linguistic alphanumeric string.)

Examples#

The letter M might stand for the category “Male” in the codeList called “Gender”.

Explanatory notes#

A non-linguistic alphanumeric string is one which does not correspond to a word in natural language. For use in a codelist. The representation property (value) is expressed as it would be found in a data file. Multiple representations may relate to the same category but should be expressed as separate codes. It should not be confused with a classification item which is a placeholder for a position in a statistical classification.

Diagram#

Diagram

Attributes#

Attributes
Attributes#

Name

Inherited from

Description

Data Type

Multiplicity

Default value

identifier

- own class -

Identifier for objects requiring short- or long-lasting referencing and management.

Identifier

0..1

Associations#

Associations
Associations#

Direction

Association

Description

Multiplicity of Code

Package of Other Class

Other Class

Multiplicity of other class

Aggregation Kind

Inherited from

from

Code denotes Category

A definition for the code. Specialization of denotes for categories.

0..*

Conceptual

Category

1..1

none

own class

from

Code uses Notation

0..*

DataDescription

Notation

1..1

none

own class

to

CodeList has Code

0..*

- own package -

CodeList

0..*

none

own class

to

CodePosition indexes Code

0..1

- own package -

CodePosition

0..*

none

own class

to

CodeRelationship hasSource Code

0..*

- own package -

CodeRelationship

0..*

none

own class

to

CodeRelationship hasTarget Code

Note that this can be realized as a collection to support tuples.

0..*

- own package -

CodeRelationship

0..*

none

own class

Encodings#

Syntax representations / encodings

All syntax representations except the Canonical XMI are provided as reference points for specific implementations, or for use as defaults if sufficient in the form presented.

Fragment for the class Code (entire model as XMI)

 1<packagedElement xmlns:StandardProfile="http://www.omg.org/spec/UML/20131001/StandardProfile"
 2                  xmlns:uml="http://www.omg.org/spec/UML/20131001"
 3                  xmlns:xmi="http://www.omg.org/spec/XMI/20131001"
 4                  xmi:id="DDICDIModels-DDICDILibrary-Classes-Representations-Code"
 5                  xmi:uuid="http://ddialliance.org/Specification/DDI-CDI/1.0/XMI/#Code"
 6                  xmi:type="uml:Class">
 7   <ownedComment xmi:id="DDICDIModels-DDICDILibrary-Classes-Representations-Code-ownedComment"
 8                  xmi:uuid="http://ddialliance.org/Specification/DDI-CDI/1.0/XMI/#Code-ownedComment"
 9                  xmi:type="uml:Comment">
10      <annotatedElement xmi:idref="DDICDIModels-DDICDILibrary-Classes-Representations-Code"/>
11      <body>Definition 
12============ 
13The characters used as a symbol to designate a category within a codelist or classification. (Formally, a sign for which the signifier is non-linguistic alphanumeric string.)   
14
15Examples 
16========== 
17The letter M might stand for the category "Male" in the codeList called "Gender".  
18
19Explanatory notes 
20=================== 
21A non-linguistic alphanumeric string is one which does not correspond to a word in natural language. For use in a codelist. The representation property (value) is expressed as it would be found in a data file. Multiple representations may relate to the same category but should be expressed as separate codes.  It should not be confused with a classification item which is a placeholder for a position in a statistical classification.</body>
22   </ownedComment>
23   <name>Code</name>
24   <ownedAttribute xmi:id="DDICDIModels-DDICDILibrary-Classes-Representations-Code-identifier"
25                    xmi:uuid="http://ddialliance.org/Specification/DDI-CDI/1.0/XMI/#Code-identifier"
26                    xmi:type="uml:Property">
27      <ownedComment xmi:id="DDICDIModels-DDICDILibrary-Classes-Representations-Code-identifier-ownedComment"
28                     xmi:uuid="http://ddialliance.org/Specification/DDI-CDI/1.0/XMI/#Code-identifier-ownedComment"
29                     xmi:type="uml:Comment">
30         <annotatedElement xmi:idref="DDICDIModels-DDICDILibrary-Classes-Representations-Code-identifier"/>
31         <body>Identifier for objects requiring short- or long-lasting referencing and management.</body>
32      </ownedComment>
33      <lowerValue xmi:id="DDICDIModels-DDICDILibrary-Classes-Representations-Code-identifier-lowerValue"
34                   xmi:uuid="http://ddialliance.org/Specification/DDI-CDI/1.0/XMI/#Code-identifier-lowerValue"
35                   xmi:type="uml:LiteralInteger"/>
36      <upperValue xmi:id="DDICDIModels-DDICDILibrary-Classes-Representations-Code-identifier-upperValue"
37                   xmi:uuid="http://ddialliance.org/Specification/DDI-CDI/1.0/XMI/#Code-identifier-upperValue"
38                   xmi:type="uml:LiteralUnlimitedNatural">
39         <value>1</value>
40      </upperValue>
41      <name>identifier</name>
42      <isID>true</isID>
43      <type xmi:idref="DDICDIModels-DDICDILibrary-DataTypes-StructuredDataTypes-Identifier"/>
44   </ownedAttribute>
45   <ownedAttribute xmi:id="DDICDIModels-DDICDILibrary-Classes-Representations-Code-ownedAttribute_1"
46                    xmi:uuid="http://ddialliance.org/Specification/DDI-CDI/1.0/XMI/#Code-ownedAttribute_1"
47                    xmi:type="uml:Property">
48      <lowerValue xmi:id="DDICDIModels-DDICDILibrary-Classes-Representations-Code-ownedAttribute_1-lowerValue"
49                   xmi:uuid="http://ddialliance.org/Specification/DDI-CDI/1.0/XMI/#Code-ownedAttribute_1-lowerValue"
50                   xmi:type="uml:LiteralInteger">
51         <value>1</value>
52      </lowerValue>
53      <upperValue xmi:id="DDICDIModels-DDICDILibrary-Classes-Representations-Code-ownedAttribute_1-upperValue"
54                   xmi:uuid="http://ddialliance.org/Specification/DDI-CDI/1.0/XMI/#Code-ownedAttribute_1-upperValue"
55                   xmi:type="uml:LiteralUnlimitedNatural">
56         <value>1</value>
57      </upperValue>
58      <association xmi:idref="DDICDIModels-DDICDILibrary-Classes-Conceptual-Code_denotes_Category"/>
59      <type xmi:idref="DDICDIModels-DDICDILibrary-Classes-Conceptual-Category"/>
60   </ownedAttribute>
61   <ownedAttribute xmi:id="DDICDIModels-DDICDILibrary-Classes-Representations-Code-ownedAttribute_2"
62                    xmi:uuid="http://ddialliance.org/Specification/DDI-CDI/1.0/XMI/#Code-ownedAttribute_2"
63                    xmi:type="uml:Property">
64      <lowerValue xmi:id="DDICDIModels-DDICDILibrary-Classes-Representations-Code-ownedAttribute_2-lowerValue"
65                   xmi:uuid="http://ddialliance.org/Specification/DDI-CDI/1.0/XMI/#Code-ownedAttribute_2-lowerValue"
66                   xmi:type="uml:LiteralInteger">
67         <value>1</value>
68      </lowerValue>
69      <upperValue xmi:id="DDICDIModels-DDICDILibrary-Classes-Representations-Code-ownedAttribute_2-upperValue"
70                   xmi:uuid="http://ddialliance.org/Specification/DDI-CDI/1.0/XMI/#Code-ownedAttribute_2-upperValue"
71                   xmi:type="uml:LiteralUnlimitedNatural">
72         <value>1</value>
73      </upperValue>
74      <association xmi:idref="DDICDIModels-DDICDILibrary-Classes-DataDescription-Code_uses_Notation"/>
75      <type xmi:idref="DDICDIModels-DDICDILibrary-Classes-DataDescription-Notation"/>
76   </ownedAttribute>
77</packagedElement>

Fragment for the class Code (entire XML Schema)

  1<xs:element name="Code"
  2            type="CodeXsdType"
  3            xml:id="Code">
  4  <!-- based on the UML class DDICDIModels::DDICDILibrary::Classes::Representations::Code -->
  5  <xs:annotation>
  6    <xs:documentation>Definition 
  7          ============ 
  8          The characters used as a symbol to designate a category within a codelist or classification. (Formally, a sign for which the signifier is non-linguistic alphanumeric string.)   
  9          
 10          Examples 
 11          ========== 
 12          The letter M might stand for the category "Male" in the codeList called "Gender".  
 13          
 14          Explanatory notes 
 15          =================== 
 16          A non-linguistic alphanumeric string is one which does not correspond to a word in natural language. For use in a codelist. The representation property (value) is expressed as it would be found in a data file. Multiple representations may relate to the same category but should be expressed as separate codes.  It should not be confused with a classification item which is a placeholder for a position in a statistical classification.</xs:documentation>
 17  </xs:annotation>
 18</xs:element>
 19<xs:complexType name="CodeXsdType"
 20                xml:id="CodeXsdType">
 21  <xs:annotation>
 22    <xs:documentation>Definition 
 23          ============ 
 24          The characters used as a symbol to designate a category within a codelist or classification. (Formally, a sign for which the signifier is non-linguistic alphanumeric string.)   
 25          
 26          Examples 
 27          ========== 
 28          The letter M might stand for the category "Male" in the codeList called "Gender".  
 29          
 30          Explanatory notes 
 31          =================== 
 32          A non-linguistic alphanumeric string is one which does not correspond to a word in natural language. For use in a codelist. The representation property (value) is expressed as it would be found in a data file. Multiple representations may relate to the same category but should be expressed as separate codes.  It should not be confused with a classification item which is a placeholder for a position in a statistical classification.</xs:documentation>
 33  </xs:annotation>
 34  <xs:sequence>
 35    <xs:element name="identifier"
 36                type="IdentifierXsdType"
 37                minOccurs="0"
 38                maxOccurs="1"
 39                xml:id="Code-identifier">
 40      <xs:annotation>
 41        <xs:documentation>Identifier for objects requiring short- or long-lasting referencing and management.</xs:documentation>
 42      </xs:annotation>
 43    </xs:element>
 44    <xs:element name="Code_denotes_Category"
 45                minOccurs="1"
 46                maxOccurs="1"
 47                xml:id="Code_denotes_Category">
 48      <xs:annotation>
 49        <xs:documentation>A definition for the code. Specialization of denotes for categories.</xs:documentation>
 50      </xs:annotation>
 51      <xs:complexType>
 52        <xs:complexContent>
 53          <xs:restriction base="AssociationReferenceXsdType">
 54            <xs:sequence>
 55              <xs:element name="ddiReference"
 56                          type="InternationalRegistrationDataIdentifierXsdType"
 57                          minOccurs="0"
 58                          maxOccurs="1"
 59                          xml:id="Code_denotes_Category-ddiReference"/>
 60              <xs:element name="validType"
 61                          minOccurs="0"
 62                          maxOccurs="unbounded"
 63                          xml:id="Code_denotes_Category-validType">
 64                <xs:simpleType>
 65                  <xs:restriction base="xs:NMTOKEN">
 66                    <xs:enumeration value="Category"/>
 67                  </xs:restriction>
 68                </xs:simpleType>
 69              </xs:element>
 70            </xs:sequence>
 71          </xs:restriction>
 72        </xs:complexContent>
 73      </xs:complexType>
 74    </xs:element>
 75    <xs:element name="Code_uses_Notation"
 76                minOccurs="1"
 77                maxOccurs="1"
 78                xml:id="Code_uses_Notation">
 79      <xs:annotation>
 80        <xs:documentation></xs:documentation>
 81      </xs:annotation>
 82      <xs:complexType>
 83        <xs:complexContent>
 84          <xs:restriction base="AssociationReferenceXsdType">
 85            <xs:sequence>
 86              <xs:element name="ddiReference"
 87                          type="InternationalRegistrationDataIdentifierXsdType"
 88                          minOccurs="0"
 89                          maxOccurs="1"
 90                          xml:id="Code_uses_Notation-ddiReference"/>
 91              <xs:element name="validType"
 92                          minOccurs="0"
 93                          maxOccurs="unbounded"
 94                          xml:id="Code_uses_Notation-validType">
 95                <xs:simpleType>
 96                  <xs:restriction base="xs:NMTOKEN">
 97                    <xs:enumeration value="Notation"/>
 98                  </xs:restriction>
 99                </xs:simpleType>
100              </xs:element>
101            </xs:sequence>
102          </xs:restriction>
103        </xs:complexContent>
104      </xs:complexType>
105    </xs:element>
106  </xs:sequence>
107</xs:complexType>

Fragment for the class Code (entire JSON Schema)

  1"cls-Code": {
  2  "description": "http://ddialliance.org/Specification/DDI-CDI/1.0/RDF/Code",
  3  "type": "object",
  4  "properties": {
  5    "@context": {
  6      "$ref": "#/defs/at-context"
  7    },
  8    "@id": {
  9      "type": "string",
 10      "format": "iri-reference"
 11    },
 12    "@type": {
 13      "const": "Code"
 14    },
 15    "identifier": {
 16      "$comment": "cardinality 0..1 – from cdi:Code",
 17      "$ref": "#/defs/dt-Identifier"
 18    },
 19    "denotes": {
 20      "description": "Code_denotes_Category",
 21      "$comment": "cardinality 1..1",
 22       "$ref": "#/defs/target-Category"
 23    },
 24    "uses_Notation": {
 25      "description": "Code_uses_Notation",
 26      "$comment": "cardinality 1..1",
 27       "$ref": "#/defs/target-Notation"
 28    },
 29    "has_Code_OF_CodeList": {
 30      "description": "CodeList_has_Code",
 31      "$comment": "cardinality 0..-1",
 32      "anyOf": [
 33        {
 34          "$ref": "#/defs/target-CodeList"
 35        },
 36        {
 37          "type": "array",
 38          "items": {
 39            "$ref": "#/defs/target-CodeList"
 40          }
 41        }
 42      ]
 43    },
 44    "indexes_OF_CodePosition": {
 45      "description": "CodePosition_indexes_Code",
 46      "$comment": "cardinality 0..-1",
 47      "anyOf": [
 48        {
 49          "$ref": "#/defs/target-CodePosition"
 50        },
 51        {
 52          "type": "array",
 53          "items": {
 54            "$ref": "#/defs/target-CodePosition"
 55          }
 56        }
 57      ]
 58    },
 59    "hasSource_OF_CodeRelationship": {
 60      "description": "CodeRelationship_hasSource_Code",
 61      "$comment": "cardinality 0..-1",
 62      "anyOf": [
 63        {
 64          "$ref": "#/defs/target-CodeRelationship"
 65        },
 66        {
 67          "type": "array",
 68          "items": {
 69            "$ref": "#/defs/target-CodeRelationship"
 70          }
 71        }
 72      ]
 73    },
 74    "hasTarget_OF_CodeRelationship": {
 75      "description": "CodeRelationship_hasTarget_Code",
 76      "$comment": "cardinality 0..-1",
 77      "anyOf": [
 78        {
 79          "$ref": "#/defs/target-CodeRelationship"
 80        },
 81        {
 82          "type": "array",
 83          "items": {
 84            "$ref": "#/defs/target-CodeRelationship"
 85          }
 86        }
 87      ]
 88    },
 89    "sameAs": {
 90      "$ref": "#/defs/owl:sameAs"
 91    }
 92  },
 93  "required": ["denotes", "uses_Notation","@type"],
 94  "additionalProperties": false
 95},
 96"target-Code": {
 97  "description": "all subclasses of http://ddialliance.org/Specification/DDI-CDI/1.0/RDF/Code",
 98  "anyOf": [
 99    { "$ref": "#/defs/cls-Code" },
100    { "type": "string", "format": "iri-reference" }
101  ]
102},

Fragment for the class Code (main ontology)

 1# class Code
 2# based on the UML class DDICDIModels::DDICDILibrary::Classes::Representations::Code
 3cdi:Code
 4  a rdfs:Class, owl:Class, ucmis:Class;
 5  rdfs:label "Code";
 6  rdfs:comment "Definition \n============ \nThe characters used as a symbol to designate a category within a codelist or classification. (Formally, a sign for which the signifier is non-linguistic alphanumeric string.)   \n\nExamples \n========== \nThe letter M might stand for the category \"Male\" in the codeList called \"Gender\".  \n\nExplanatory notes \n=================== \nA non-linguistic alphanumeric string is one which does not correspond to a word in natural language. For use in a codelist. The representation property (value) is expressed as it would be found in a data file. Multiple representations may relate to the same category but should be expressed as separate codes.  It should not be confused with a classification item which is a placeholder for a position in a statistical classification."@en;
 7  
 8.
 9
10cdi:Code-identifier
11  a rdf:Property, owl:ObjectProperty, ucmis:Attribute;
12  rdfs:label "identifier";
13  rdfs:comment "Identifier for objects requiring short- or long-lasting referencing and management."@en;
14  rdfs:domain cdi:Code;
15  rdfs:range cdi:Identifier;
16.
17
18
19cdi:Code_denotes_Category
20  a rdf:Property, owl:ObjectProperty, ucmis:Association;
21  # ASSOCIATION
22  rdfs:label "denotes";
23  skos:altLabel "Code_denotes_Category";
24  rdfs:comment "A definition for the code. Specialization of denotes for categories."@en;
25  rdfs:domain cdi:Code;
26  rdfs:range cdi:Category;
27.
28
29cdi:Code_uses_Notation
30  a rdf:Property, owl:ObjectProperty, ucmis:Association;
31  # ASSOCIATION
32  rdfs:label "uses_Notation";
33  skos:altLabel "Code_uses_Notation";
34  
35  rdfs:domain cdi:Code;
36  rdfs:range cdi:Notation;
37.

Fragment for the class Code (entire JSON-LD)

 1{
 2  "@context": [
 3    {
 4      "cdi": "http://ddialliance.org/Specification/DDI-CDI/1.0/RDF/",
 5      "xsd": "http://www.w3.org/2001/XMLSchema#",
 6
 7      "identifier": {
 8        "@id": "cdi:Code-identifier",
 9        "@type": "@id",
10        "@context": "Identifier.jsonld"
11      },
12      
13      "denotes": {
14        "@id": "cdi:Code_denotes_Category",
15        "@type": "@id",
16        "@context": "Category.jsonld"
17      },
18      "uses_Notation": {
19        "@id": "cdi:Code_uses_Notation",
20        "@type": "@id",
21        "@context": "Notation.jsonld"
22      },
23      "has_Code_OF_CodeList": {
24        "@reverse": "cdi:CodeList_has_Code",
25        "@type": "@id",
26        "@context": "CodeList.jsonld"
27      },
28      "indexes_OF_CodePosition": {
29        "@reverse": "cdi:CodePosition_indexes_Code",
30        "@type": "@id",
31        "@context": "CodePosition.jsonld"
32      },
33      "hasSource_OF_CodeRelationship": {
34        "@reverse": "cdi:CodeRelationship_hasSource_Code",
35        "@type": "@id",
36        "@context": "CodeRelationship.jsonld"
37      },
38      "hasTarget_OF_CodeRelationship": {
39        "@reverse": "cdi:CodeRelationship_hasTarget_Code",
40        "@type": "@id",
41        "@context": "CodeRelationship.jsonld"
42      },
43      " comment ": "tag:json-should-support-trailing-commas"
44    }
45  ],
46  "generatedBy": "This code was generated by the Eclipse Acceleo project UCMIS M2T on 2025-08-29 14:34:54.",
47  "basedOn": "based on the UML data type DDICDIModels::DDICDILibrary::Classes::Representations::Code"
48}

Fragment for the class Code (entire SHACL - Shapes Constraint Language)

 1# class Code
 2# based on the UML class DDICDIModels::DDICDILibrary::Classes::Representations::Code
 3<#Code> a sh:NodeShape;
 4    sh:targetClass cdi:Code;
 5	sh:message "See http://ddialliance.org/Specification/DDI-CDI/1.0/RDF/Code";
 6	sh:closed true;
 7	sh:ignoredProperties ( owl:sameAs );
 8    sh:property [
 9			sh:path rdf:type;
10			sh:in (   cdi:Code
11			 ) ;
12    ];
13    # attributes
14    sh:property <#Code-identifier>;
15    # associations from Code
16    sh:property <#Code_denotes_Category>;
17    sh:property <#Code_uses_Notation>;
18    # associations to Code
19    sh:property <#rev_CodeList_has_Code>;
20    sh:property <#rev_CodePosition_indexes_Code>;
21    sh:property <#rev_CodeRelationship_hasSource_Code>;
22    sh:property <#rev_CodeRelationship_hasTarget_Code>;
23
24
25
26.
27
28<#Code-identifier> a sh:PropertyShape ;
29    sh:path cdi:Code-identifier;
30    sh:node [ sh:property [ sh:path rdf:type; sh:minCount 1; sh:in (
31        cdi:Identifier
32      
33    ) ]];
34    sh:maxCount 1;
35.
36
37<#Code_denotes_Category> a sh:PropertyShape ;
38    sh:path cdi:Code_denotes_Category;
39	sh:node [ sh:property [ sh:path rdf:type; sh:minCount 1; sh:in (
40        cdi:Category
41      
42    ) ]];
43    sh:minCount 1;
44    sh:maxCount 1;
45.
46<#rev_Code_denotes_Category> a sh:PropertyShape ;
47    sh:path [ sh:inversePath cdi:Code_denotes_Category ];
48.
49<#Code_uses_Notation> a sh:PropertyShape ;
50    sh:path cdi:Code_uses_Notation;
51	sh:node [ sh:property [ sh:path rdf:type; sh:minCount 1; sh:in (
52        cdi:Notation
53      
54    ) ]];
55    sh:minCount 1;
56    sh:maxCount 1;
57.
58<#rev_Code_uses_Notation> a sh:PropertyShape ;
59    sh:path [ sh:inversePath cdi:Code_uses_Notation ];
60.

Fragment for the class Code (entire ShEx - Shape Expressions)

 1# class Code
 2# based on the UML class DDICDIModels::DDICDILibrary::Classes::Representations::Code
 3cdi:CodeShape CLOSED {
 4	a [cdi:Code];
 5	cdi:Code-identifier	@cdi:IdentifierShape?;
 6	cdi:Code_denotes_Category	@cdi:CategoryShape ;
 7	
 8	cdi:Code_uses_Notation	@cdi:NotationShape ;
 9	
10	^cdi:CodeList_has_Code @cdi:CodeListShape *;
11	^cdi:CodePosition_indexes_Code @cdi:CodePositionShape *;
12	^cdi:CodeRelationship_hasSource_Code @cdi:CodeRelationshipShape *;
13	^cdi:CodeRelationship_hasTarget_Code @cdi:CodeRelationshipShape *;
14	}