#\#CIF_2.0
##############################################################################
#                                                                            #
#       TEST DICTIONARY THAT CONTAINS INVALID SUBCATEGORY DEFINITIONS        #
#                                                                            #
##############################################################################
data_TEST_INVALID_SUBCATEGORY_DIC
_dictionary.title            TEST_INVALID_SUBCATEGORY_DIC
_dictionary.class            Instance
_dictionary.version          1.0.0
_dictionary.date             2023-07-08
_dictionary.uri              https://www.example.com/test_invalid_subcategory.dic
_dictionary.ddl_conformance  4.1.0
_dictionary.namespace        SoftwareTest
_description.text
;
 This dictionary purposely contains invalid subcategory definitions.
;
loop_
_dictionary_audit.version
_dictionary_audit.date
_dictionary_audit.revision
1.0.0 2023-07-08 'Initial release of the dictionary.'

save_TEST_INVALID_SUBCATEGORY_HEAD

_definition.id               TEST_INVALID_SUBCATEGORY_HEAD
_definition.scope            Category
_definition.class            HEAD
_definition.update           2023-07-06
_description.text
;
 The HEAD category of the dictionary.
;
_name.category_id            TEST_INVALID_SUBCATEGORY_DIC
_name.object_id              TEST_INVALID_SUBCATEGORY_HEAD

save_

#
# LOOPED CATEGORY THAT HAS VALID AND INVALID LOOPED SUBCATEGORIES
#
save_MAIN_CATEGORY

    _definition.id               MAIN_CATEGORY
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2023-07-06
    _description.text
;
    A looped parent category.
;
    _name.category_id            TEST_INVALID_SUBCATEGORY_HEAD
    _name.object_id              MAIN_CATEGORY

    loop_
      _category_key.name
        '_main_category.key_item_1'
        '_main_category.key_item_2'
        '_main_category.key_item_3'

save_

save_main_category.key_item_1

    _definition.id               '_main_category.key_item_1'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-06
    _description.text
;
    Data item that serves as one of the keys of the MAIN_CATEGORY
    category.
;
    _name.category_id            main_category
    _name.object_id              key_item_1
    _type.purpose                Describe
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text

save_

save_main_category.key_item_2

    _definition.id               '_main_category.key_item_2'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-06
    _description.text
;
    Data item that serves as one of the keys of the MAIN_CATEGORY
    category.
;
    _name.category_id            main_category
    _name.object_id              key_item_2
    _type.purpose                Describe
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text

save_

save_main_category.key_item_3

    _definition.id               '_main_category.key_item_3'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-06
    _description.text
;
    Data item that serves as one of the keys of the MAIN_CATEGORY
    category.
;
    _name.category_id            main_category
    _name.object_id              key_item_3
    _type.purpose                Describe
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text

save_

save_main_category.not_key_item_1

    _definition.id               '_main_category.not_key_item_1'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-06
    _description.text
;
    Data item that that belongs to the MAIN_CATEGORY category, but that does
    not serve as a category key.
;
    _name.category_id            main_category
    _name.object_id              not_key_item_1
    _type.purpose                Describe
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text

save_

#
# VALID LOOPED SUBCATEGORY
#
save_VALID_SUB_CATEGORY

    _definition.id               VALID_SUB_CATEGORY
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2023-07-06
    _description.text
;
    The looped VALID_SUB_CATEGORY category is a properly defined looped
    subcategory of the MAIN_CATEGORY category.
;
    _name.category_id            MAIN_CATEGORY
    _name.object_id              VALID_SUB_CATEGORY

    loop_
      _category_key.name
        '_valid_sub_category.key_item_1'
        '_valid_sub_category.key_item_2'
        '_valid_sub_category.key_item_3'

save_

save_valid_sub_category.key_item_1

    _definition.id               '_valid_sub_category.key_item_1'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-06
    _description.text
;
    Data item that serves as one of the keys of the VALID_SUB_CATEGORY
    category.
;
    _name.category_id            valid_sub_category
    _name.object_id              key_item_1
    _type.purpose                Link
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
    _name.linked_item_id         '_main_category.key_item_1'

save_

save_valid_sub_category.key_item_2

    _definition.id               '_valid_sub_category.key_item_2'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-06
    _description.text
;
    Data item that serves as one of the keys of the VALID_SUB_CATEGORY
    category.
;
    _name.category_id            valid_sub_category
    _name.object_id              key_item_2
    _type.purpose                Link
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
    _name.linked_item_id         '_main_category.key_item_2'

save_

save_valid_sub_category.key_item_3

    _definition.id               '_valid_sub_category.key_item_3'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-06
    _description.text
;
    Data item that serves as one of the keys of the VALID_SUB_CATEGORY
    category.
;
    _name.category_id            valid_sub_category
    _name.object_id              key_item_3
    _type.purpose                Link
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
    _name.linked_item_id         '_main_category.key_item_3'

save_

#
# INVALID LOOPED SUBCATEGORY WITH INCORRECTLY LINKED KEYS
#
save_INVALID_SUB_CATEGORY_A

    _definition.id               INVALID_SUB_CATEGORY_A
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2023-07-06
    _description.text
;
    The looped INVALID_SUB_CATEGORY_A category has key items that are not all
    properly linked to the key items of the parent MAIN_CATEGORY category.
;
    _name.category_id            MAIN_CATEGORY
    _name.object_id              INVALID_SUB_CATEGORY_A

    loop_
      _category_key.name
        '_invalid_sub_category_A.key_item_1'
        '_invalid_sub_category_A.key_item_2'
        '_invalid_sub_category_A.key_item_3'

save_

save_invalid_sub_category_A.key_item_1

    _definition.id               '_invalid_sub_category_A.key_item_1'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-06
    _description.text
;
    Data item that serves as one of the keys of the INVALID_SUB_CATEGORY_A,
    but is not linked to any data items.
;
    _name.category_id            invalid_sub_category_A
    _name.object_id              key_item_1
    _type.purpose                Key
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text

save_

save_invalid_sub_category_A.key_item_2

    _definition.id               '_invalid_sub_category_A.key_item_2'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-06
    _description.text
;
    Data item that serves as one of the keys of the INVALID_SUB_CATEGORY_A
    category.
;
    _name.category_id            invalid_sub_category_A
    _name.object_id              key_item_2
    _type.purpose                Link
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
    _name.linked_item_id         '_main_category.not_key_item_1'

save_

save_invalid_sub_category_A.key_item_3

    _definition.id               '_invalid_sub_category_A.key_item_3'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-06
    _description.text
;
    Data item that serves as one of the keys of the INVALID_SUB_CATEGORY_A
    category.
;
    _name.category_id            invalid_sub_category_A
    _name.object_id              key_item_3
    _type.purpose                Link
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
    _name.linked_item_id         '_main_category.key_item_3'

save_

#
# INVALID LOOPED SUBCATEGORY THAT HAS MORE KEY ITEMS THAN THE PARENT CATEGORY.
# ONE OF THE KEY ITEMS IS NOT LINKED TO ANY OF THE KEY ITEMS OF THE PARENT
# CATEGORY.
#
save_INVALID_SUB_CATEGORY_B

    _definition.id               INVALID_SUB_CATEGORY_B
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2023-07-06
    _description.text
;
    The looped INVALID_SUB_CATEGORY_B category has key items that are not all
    properly linked to the key items of the parent MAIN_CATEGORY category.
;
    _name.category_id            MAIN_CATEGORY
    _name.object_id              INVALID_SUB_CATEGORY_B

    loop_
      _category_key.name
        '_invalid_sub_category_B.key_item_1'
        '_invalid_sub_category_B.key_item_2'
        '_invalid_sub_category_B.key_item_3'
        '_invalid_sub_category_B.key_item_4'

save_

save_invalid_sub_category_B.key_item_1

    _definition.id               '_invalid_sub_category_B.key_item_1'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-06
    _description.text
;
    Data item that serves as one of the keys of the INVALID_SUB_CATEGORY_B
    category.
;
    _name.category_id            invalid_sub_category_B
    _name.object_id              key_item_1
    _type.purpose                Link
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
    _name.linked_item_id         '_main_category.key_item_1'

save_

save_invalid_sub_category_B.key_item_2

    _definition.id               '_invalid_sub_category_B.key_item_2'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-06
    _description.text
;
    Data item that serves as one of the keys of the INVALID_SUB_CATEGORY_B
    category.
;
    _name.category_id            invalid_sub_category_B
    _name.object_id              key_item_2
    _type.purpose                Link
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
    _name.linked_item_id         '_main_category.key_item_2'

save_

save_invalid_sub_category_B.key_item_3

    _definition.id               '_invalid_sub_category_B.key_item_3'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-06
    _description.text
;
    Data item that serves as one of the keys of the INVALID_SUB_CATEGORY_B
    category.
;
    _name.category_id            invalid_sub_category_B
    _name.object_id              key_item_3
    _type.purpose                Link
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
    _name.linked_item_id         '_main_category.key_item_3'

save_

save_invalid_sub_category_B.key_item_4

    _definition.id               '_invalid_sub_category_B.key_item_4'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-06
    _description.text
;
    Data item that serves as one of the keys of the INVALID_SUB_CATEGORY_B,
    but is not linked to any data items.
;
    _name.category_id            invalid_sub_category_B
    _name.object_id              key_item_4
    _type.purpose                Key
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text

save_

#
# INVALID LOOPED SUBCATEGORY THAT HAS MORE KEY ITEMS THAN THE PARENT CATEGORY.
# TWO OF THE KEY ITEMS ARE LINKED TO THE SAME KEY ITEM OF THE PARENT CATEGORY.
#
save_INVALID_SUB_CATEGORY_C

    _definition.id               INVALID_SUB_CATEGORY_C
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2023-07-06
    _description.text
;
    The looped INVALID_SUB_CATEGORY_C category has more key items that the
    parent MAIN_CATEGORY category. Two of the key items are linked to the
    same key item of the parent category. 
;
    _name.category_id            MAIN_CATEGORY
    _name.object_id              INVALID_SUB_CATEGORY_C

    loop_
      _category_key.name
        '_invalid_sub_category_C.key_item_1'
        '_invalid_sub_category_C.key_item_2'
        '_invalid_sub_category_C.key_item_3'
        '_invalid_sub_category_C.key_item_4'

save_

save_invalid_sub_category_C.key_item_1

    _definition.id               '_invalid_sub_category_C.key_item_1'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-06
    _description.text
;
    Data item that serves as one of the keys of the INVALID_SUB_CATEGORY_C
    category.
;
    _name.category_id            invalid_sub_category_C
    _name.object_id              key_item_1
    _type.purpose                Link
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
    _name.linked_item_id         '_main_category.key_item_1'

save_

save_invalid_sub_category_C.key_item_2

    _definition.id               '_invalid_sub_category_C.key_item_2'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-06
    _description.text
;
    Data item that serves as one of the keys of the INVALID_SUB_CATEGORY_C
    category.
;
    _name.category_id            invalid_sub_category_C
    _name.object_id              key_item_2
    _type.purpose                Link
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
    _name.linked_item_id         '_main_category.key_item_2'

save_

save_invalid_sub_category_C.key_item_3

    _definition.id               '_invalid_sub_category_C.key_item_3'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-06
    _description.text
;
    Data item that serves as one of the keys of the INVALID_SUB_CATEGORY_C
    category.
;
    _name.category_id            invalid_sub_category_C
    _name.object_id              key_item_3
    _type.purpose                Link
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
    _name.linked_item_id         '_main_category.key_item_3'

save_

save_invalid_sub_category_C.key_item_4

    _definition.id               '_invalid_sub_category_C.key_item_4'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-06
    _description.text
;
    Data item that serves as one of the keys of the INVALID_SUB_CATEGORY_C,
    but is not linked to any data items.
;
    _name.category_id            invalid_sub_category_C
    _name.object_id              key_item_4
    _type.purpose                Link
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
    _name.linked_item_id         '_main_category.key_item_3'

save_

#
# INVALID LOOPED SUBCATEGORY THAT HAS LESS KEY ITEMS THAN THE PARENT CATEGORY.
#
save_INVALID_SUB_CATEGORY_D

    _definition.id               INVALID_SUB_CATEGORY_D
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2023-07-06
    _description.text
;
    The looped INVALID_SUB_CATEGORY_D category has less key items than the
    the parent MAIN_CATEGORY category.
;
    _name.category_id            MAIN_CATEGORY
    _name.object_id              INVALID_SUB_CATEGORY_D

    loop_
      _category_key.name
        '_invalid_sub_category_D.key_item_1'
        '_invalid_sub_category_D.key_item_2'

save_

save_invalid_sub_category_D.key_item_1

    _definition.id               '_invalid_sub_category_D.key_item_1'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-06
    _description.text
;
    Data item that serves as one of the keys of the INVALID_SUB_CATEGORY_D,
    but is not linked to any data items.
;
    _name.category_id            invalid_sub_category_D
    _name.object_id              key_item_1
    _type.purpose                Link
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
    _name.linked_item_id         '_main_category.key_item_1'

save_

save_invalid_sub_category_D.key_item_2

    _definition.id               '_invalid_sub_category_D.key_item_2'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-06
    _description.text
;
    Data item that serves as one of the keys of the INVALID_SUB_CATEGORY_D
    category.
;
    _name.category_id            invalid_sub_category_D
    _name.object_id              key_item_2
    _type.purpose                Link
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
    _name.linked_item_id         '_main_category.key_item_2'

save_

#
# LOOPED CATEGORY THAT HAS INVALID LOOPED CHILD CATEGORIES
#
save_SPECIAL_CASE_CATEGORY_A

    _definition.id               SPECIAL_CASE_CATEGORY_A
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2023-07-06
    _description.text
;
    A looped parent category.
;
    _name.category_id            TEST_INVALID_SUBCATEGORY_HEAD
    _name.object_id              SPECIAL_CASE_CATEGORY_A
    _category_key.name           '_special_case_category_A.key_item'

save_

save_special_case_category_A.key_item

    _definition.id               '_special_case_category_A.key_item'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-06
    _description.text
;
    Data item that serves as the key of the SPECIAL_CASE_CATEGORY_A category.
    but is not linked to any data items.
;
    _name.category_id            special_case_category_A
    _name.object_id              key_item
    _type.purpose                Key
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text

save_

#
# Invalid looped subcategory that references a key item that is not defined
# in the dictionary.
#
save_SPECIAL_CASE_SUB_CATEGORY_A_1

    _definition.id               SPECIAL_INVALID_SUB_CATEGORY_E
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2023-07-06
    _description.text
;
    The looped INVALID_SUB_CATEGORY_E category incorrectly does not contain
    the _category_key.name attribute.
;
    _name.category_id            SPECIAL_CASE_CATEGORY_A
    _name.object_id              SPECIAL_CASE_SUB_CATEGORY_A_1

    _category_key.name           '_special_case_sub_category_A_1.undefined_item'

save_

#
# A looped category without the _name.category_id attribute.
#
save_SPECIAL_CASE_CATEGORY_B

    _definition.id               SPECIAL_CASE_CATEGORY_B
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2023-07-08
    _description.text
;
    A looped category that incorrectly does not contain the _name.category_id
    attribute.
;
    _name.object_id              SPECIAL_CASE_CATEGORY_B
    _category_key.name           '_special_case_category_B.key_item'

save_

save_special_case_category_B.key_item

    _definition.id               '_special_case_category_B.key_item'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-07
    _description.text
;
    The key data item of the SPECIAL_CASE_CATEGORY_B category.
;
    _name.category_id            special_case_category_B
    _name.object_id              key_item
    _type.purpose                Key
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text

save_

#
# A looped category without the _name.category_id attribute.
#
save_SPECIAL_CASE_CATEGORY_C

    _definition.id               SPECIAL_CASE_CATEGORY_C
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2023-07-08
    _description.text
;
    A looped category that has an unrecognised parent directory which is not
    defined in the dictionary.
;
    _name.category_id            UNRECOGNISED_PARENT
    _name.object_id              SPECIAL_CASE_CATEGORY_C
    _category_key.name           '_special_case_category_C.key_item'

save_

save_special_case_category_C.key_item

    _definition.id               '_special_case_category_C.key_item'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-07
    _description.text
;
    The key data item of the SPECIAL_CASE_CATEGORY_C category.
;
    _name.category_id            special_case_category_C
    _name.object_id              key_item
    _type.purpose                Key
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text

save_

#
# A looped category that incorrectly does not contain the _category_key.name
# attribute.
#
save_SPECIAL_CASE_CATEGORY_D

    _definition.id               SPECIAL_CASE_CATEGORY_D
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2021-10-14
    _description.text
;
    The SPECIAL_CASE_CATEGORY_D category has the the '_definition.class'
    attribute with value 'Loop', but does not contain the '_category_key.name'
    attribute.
;
    _name.category_id            TEST_INVALID_SUBCATEGORY_HEAD
    _name.object_id              SPECIAL_CASE_CATEGORY_D

save_

save_special_case_category_D.item

    _definition.id               '_special_case_category_D.item'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-08
    _description.text
;
    Data item that belongs to the SPECIAL_CASE_CATEGORY_D category.
;
    _name.category_id            special_case_category_D
    _name.object_id              item
    _type.purpose                Key
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text

save_

#
# A valid looped child category of a looped parent category that incorrectly
# does not contain the _category_key.name attribute.
#
save_SPECIAL_CASE_SUB_CATEGORY_D_1

    _definition.id               SPECIAL_CASE_SUB_CATEGORY_D_1
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2023-07-08
    _description.text
;
    A valid looped child category of a looped parent category that incorrectly
    does not contain the _category_key.name attribute.
;
    _name.category_id            SPECIAL_CASE_CATEGORY_D
    _name.object_id              SPECIAL_CASE_SUB_CATEGORY_D_1
    _category_key.name           '_special_case_sub_category_D_1.key_item'

save_

save_special_case_sub_category_D_1.key_item

    _definition.id               '_special_case_sub_category_D_1.key_item'
    _definition.scope            Item
    _definition.class            Datum
    _definition.update           2023-07-08
    _description.text
;
    Data item that serves as the key of the SPECIAL_CASE_CATEGORY_D category.
;
    _name.category_id            special_case_sub_category_D_1
    _name.object_id              key_item
    _type.purpose                Link
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
    _name.linked_item_id         '_special_case_category_D.item'

save_
