niemopen / niem-naming-design-rules

NIEM Naming and Design Rules Specification
Other
4 stars 2 forks source link

Require Unique Enumerations? #30

Open cdmgtri opened 1 year ago

cdmgtri commented 1 year ago

Migrated from NIEM/NTAC#45.

Aren't enums supposed to be unique in JSON? How do we translate between NIEM XML and NIEM JSON in this case? Merge overlapping definitions for everybody; just for the JSON representation?

cdmgtri commented 1 year ago

The NTAC decided that enumerations should be unique within a type. For sources with non-unique enumerations, the definitions for overlapping enums will be concatenated.

cdmgtri commented 1 year ago

Affected types

There are 16 types in NIEM 5.2 that do not have unique enumerations. These are listed below, along with the number of overlapping enums and whether or not the overlap is likely able to be resolved at the source. For overlap that cannot be addressed at the source, concatenated definitions are proposed as the work-around.

Type Overlap Count Source adjustable?
can:StreetDirectionCodeSimpleType 10 no
cbrncl:FacilityUsageCodeSimpleType 2 yes
cyber:BreachClassificationCategoryCodeSimpleType 2 yes
dea:DrugCodeSimpleType 103 no
em:BarcodeCodeSimpleType 4 yes
em:NotificationFunctionCategoryCodeSimpleType 2 yes
fips:USCounty3DigitCodeSimpleType 3,057 no (*)
hazmat:HazmatCodeSimpleType 163 no
mmucc:DriverLicenseClassCodeSimpleType 2 yes
mo:FrequencyUnitTemporalCodeSimpleType 2 yes
mo:RegisteredServiceNameCodeSimpleType 8 yes
usmtf:AngleUnitCodeSimpleType 20 yes
usmtf:NauticalMileUnitCodeSimpleType 2 yes
usmtf:RadioactiveHalfLifeCodeSimpleType 2 yes
usmtf:RFPowerUnitDecibelsCodeSimpleType 2 yes
usps:StreetSuffixCodeSimpleType 8 no

Duplicated codes

Note: While several representative examples have been provided, long lists of non-unique enums have been omitted for:

Note that the overlap in codes for the Canada Post street direction code set is intentional. Definitions are provided in both English and French.

Type Enum Definition
can:StreetDirectionCodeSimpleType E East
can:StreetDirectionCodeSimpleType E Est
can:StreetDirectionCodeSimpleType N Nord
can:StreetDirectionCodeSimpleType N North
can:StreetDirectionCodeSimpleType NE Nord-Est
can:StreetDirectionCodeSimpleType NE Northeast
can:StreetDirectionCodeSimpleType S South
can:StreetDirectionCodeSimpleType S Sud
can:StreetDirectionCodeSimpleType SE Southeast
can:StreetDirectionCodeSimpleType SE Sud-Est
cbrncl:FacilityUsageCodeSimpleType Military Research Facility Buildings used in the direct research, development, testing, and evaluation of military equipment.
cbrncl:FacilityUsageCodeSimpleType Military Research Facility Military Research Facility
cyber:BreachClassificationCategoryCodeSimpleType Medical and Emergency Information Medical and Emergency Information has been accessed, potentially accessed, manipulated, destroyed, or rendered unusable as a result of a breach
cyber:BreachClassificationCategoryCodeSimpleType Medical and emergency information Medical and Emergency Information that has been or potentially has been accessed, potentially accessed, manipulated, destroyed, or rendered unusable as a result of a compromise
dea:DrugCodeSimpleType 1670 Dexfenfluramine
dea:DrugCodeSimpleType 1670 Fenfluramine
...
em:BarcodeCodeSimpleType SCC-14 "Character set C encodes only numbers and the FNC1 function (indicated in blue). Because the numbers are ""interleaved"" into pairs, two numbers are encoded into every bar-code character which makes it a very high-density bar-code."
em:BarcodeCodeSimpleType SCC-14 Interleaved 2 of 5 (ITF) is a numeric-only bar-code used for encoding pairs of numbers in a high density bar-code format
em:BarcodeCodeSimpleType USPS Character set A allows for uppercase characters, punctuation, numbers and several special functions such as a return or tab.Character set B allows for upper and lower case letters, punctuation, numbers and a few select functions
em:BarcodeCodeSimpleType USPS Interleaved 2 of 5 (ITF) is a numeric-only bar-code used for encoding pairs of numbers in a high density bar-code format
em:NotificationFunctionCategoryCodeSimpleType Alert Alert message(s)
em:NotificationFunctionCategoryCodeSimpleType Alert Initial information requiring attention by targeted recipients
fips:USCounty3DigitCodeSimpleType 001 Abbeville County
fips:USCounty3DigitCodeSimpleType 001 Acadia Parish
fips:USCounty3DigitCodeSimpleType 001 Accomack County
fips:USCounty3DigitCodeSimpleType 001 Ada County
fips:USCounty3DigitCodeSimpleType 001 Adair County
fips:USCounty3DigitCodeSimpleType 001 Adair County
fips:USCounty3DigitCodeSimpleType 001 Adair County
fips:USCounty3DigitCodeSimpleType 001 Adair County
...
hazmat:HazmatCodeSimpleType NA1760 Chemical kit
hazmat:HazmatCodeSimpleType NA1760 Compounds, cleaning liquid
hazmat:HazmatCodeSimpleType NA1760 Compounds, tree killing, liquid or Compounds, weed killing, liquid
hazmat:HazmatCodeSimpleType NA1760 Ferrous chloride, solution
hazmat:HazmatCodeSimpleType NA1993 Combustible liquid, n.o.s.
hazmat:HazmatCodeSimpleType NA1993 Compounds, cleaning liquid
hazmat:HazmatCodeSimpleType NA1993 Compounds, tree killing, liquid or Compounds, weed killing, liquid
hazmat:HazmatCodeSimpleType NA1993 Diesel fuel
hazmat:HazmatCodeSimpleType NA1993 Fuel oil (No. 1, 2, 4, 5, or 6)
hazmat:HazmatCodeSimpleType NA2845 Ethyl phosphonous dichloride, anhydrous pyrophoric liquid
hazmat:HazmatCodeSimpleType NA2845 Methyl phosphonous dichloride, pyrophoric liquid
...
mmucc:DriverLicenseClassCodeSimpleType NA None/Not Applicable
mmucc:DriverLicenseClassCodeSimpleType NA Not Applicable
mo:RegisteredServiceNameCodeSimpleType ftp File Transfer Protocol [Control].
mo:RegisteredServiceNameCodeSimpleType ftp FTP.
mo:RegisteredServiceNameCodeSimpleType ftp-data File Transfer [Default Data].
mo:RegisteredServiceNameCodeSimpleType ftp-data FTP.
mo:RegisteredServiceNameCodeSimpleType http HTTP.
mo:RegisteredServiceNameCodeSimpleType http World Wide Web HTTP.
mo:RegisteredServiceNameCodeSimpleType imaps IMAP over TLS protocol.
mo:RegisteredServiceNameCodeSimpleType imaps imap4 protocol over TLS/SSL.
usmtf:AngleUnitCodeSimpleType DGG Degree Grid.
usmtf:AngleUnitCodeSimpleType DGG Degree Grid.
usmtf:AngleUnitCodeSimpleType DGM Degree Magnetic.
usmtf:AngleUnitCodeSimpleType DGM Degree Magnetic.
usmtf:AngleUnitCodeSimpleType DGR Degree Relative.
usmtf:AngleUnitCodeSimpleType DGR Degree Relative.
usmtf:AngleUnitCodeSimpleType DGT Degree True.
usmtf:AngleUnitCodeSimpleType DGT Degree True.
usmtf:AngleUnitCodeSimpleType MIL Mils.
usmtf:AngleUnitCodeSimpleType MIL Mils.
usmtf:AngleUnitCodeSimpleType MIN Minutes.
usmtf:AngleUnitCodeSimpleType MIN Minutes.
usmtf:AngleUnitCodeSimpleType MLG Mils Grid.
usmtf:AngleUnitCodeSimpleType MLG Mils Grid.
usmtf:AngleUnitCodeSimpleType MLM Mils Magnetic.
usmtf:AngleUnitCodeSimpleType MLM Mils Magnetic.
usmtf:AngleUnitCodeSimpleType MLT Mils True.
usmtf:AngleUnitCodeSimpleType MLT Mils True.
usmtf:AngleUnitCodeSimpleType SEC Seconds.
usmtf:AngleUnitCodeSimpleType SEC Seconds.
usmtf:NauticalMileUnitCodeSimpleType NM Nautical Miles.
usmtf:NauticalMileUnitCodeSimpleType NM Nautical Miles.
usmtf:RadioactiveHalfLifeCodeSimpleType 1600.00YR RA-226+ (Radon).
usmtf:RadioactiveHalfLifeCodeSimpleType 1600.00YR SE-75 (Selenium). None
usmtf:RFPowerUnitDecibelsCodeSimpleType DB Decibel.
usmtf:RFPowerUnitDecibelsCodeSimpleType DB Decibel.
usps:StreetSuffixCodeSimpleType PARK PARK
usps:StreetSuffixCodeSimpleType PARK PARKS
usps:StreetSuffixCodeSimpleType PKWY PARKWAY
usps:StreetSuffixCodeSimpleType PKWY PARKWAYS
usps:StreetSuffixCodeSimpleType SPUR SPUR
usps:StreetSuffixCodeSimpleType SPUR SPURS
usps:StreetSuffixCodeSimpleType WALK WALK
usps:StreetSuffixCodeSimpleType WALK WALKS
cdmgtri commented 1 year ago

Feedback from Harmonization subcommittee (2023-06-01):

cdmgtri commented 1 year ago

Harmonization Subcommitee recommendations from 2023-09-15:

Type Enum Definition Resolution
can:StreetDirectionCodeSimpleType E East East; Est
can:StreetDirectionCodeSimpleType E Est
can:StreetDirectionCodeSimpleType N Nord
can:StreetDirectionCodeSimpleType N North
can:StreetDirectionCodeSimpleType NE Nord-Est
can:StreetDirectionCodeSimpleType NE Northeast
can:StreetDirectionCodeSimpleType S South
can:StreetDirectionCodeSimpleType S Sud
can:StreetDirectionCodeSimpleType SE Southeast
can:StreetDirectionCodeSimpleType SE Sud-Est
cbrncl:FacilityUsageCodeSimpleType Military Research Facility Buildings used in the direct research, development, testing, and evaluation of military equipment. choose this one
cbrncl:FacilityUsageCodeSimpleType Military Research Facility Military Research Facility
cyber:BreachClassificationCategoryCodeSimpleType Medical and Emergency Information Medical and Emergency Information has been accessed, potentially accessed, manipulated, destroyed, or rendered unusable as a result of a breach Merge wording
cyber:BreachClassificationCategoryCodeSimpleType Medical and emergency information Medical and Emergency Information that has been or potentially has been accessed, potentially accessed, manipulated, destroyed, or rendered unusable as a result of a compromise
dea:DrugCodeSimpleType 1670 Dexfenfluramine Dexfenfluramine; Fenfluramine, ...
dea:DrugCodeSimpleType 1670 Fenfluramine
...
em:BarcodeCodeSimpleType SCC-14 "Character set C encodes only numbers and the FNC1 function (indicated in blue). Because the numbers are ""interleaved"" into pairs, two numbers are encoded into every bar-code character which makes it a very high-density bar-code." TBD
em:BarcodeCodeSimpleType SCC-14 Interleaved 2 of 5 (ITF) is a numeric-only bar-code used for encoding pairs of numbers in a high density bar-code format
em:BarcodeCodeSimpleType USPS Character set A allows for uppercase characters, punctuation, numbers and several special functions such as a return or tab.Character set B allows for upper and lower case letters, punctuation, numbers and a few select functions
em:BarcodeCodeSimpleType USPS Interleaved 2 of 5 (ITF) is a numeric-only bar-code used for encoding pairs of numbers in a high density bar-code format
em:NotificationFunctionCategoryCodeSimpleType Alert Alert message(s)
em:NotificationFunctionCategoryCodeSimpleType Alert Initial information requiring attention by targeted recipients Choose this one
fips:USCounty3DigitCodeSimpleType 001 Abbeville County 3-digit code set being removed
fips:USCounty3DigitCodeSimpleType 001 Acadia Parish
fips:USCounty3DigitCodeSimpleType 001 Accomack County
fips:USCounty3DigitCodeSimpleType 001 Ada County
fips:USCounty3DigitCodeSimpleType 001 Adair County
fips:USCounty3DigitCodeSimpleType 001 Adair County
fips:USCounty3DigitCodeSimpleType 001 Adair County
fips:USCounty3DigitCodeSimpleType 001 Adair County
...
hazmat:HazmatCodeSimpleType NA1760 Chemical kit Chemical kit; Compounds, cleaning liquid; ...
hazmat:HazmatCodeSimpleType NA1760 Compounds, cleaning liquid
hazmat:HazmatCodeSimpleType NA1760 Compounds, tree killing, liquid or Compounds, weed killing, liquid
hazmat:HazmatCodeSimpleType NA1760 Ferrous chloride, solution
hazmat:HazmatCodeSimpleType NA1993 Combustible liquid, n.o.s.
hazmat:HazmatCodeSimpleType NA1993 Compounds, cleaning liquid
hazmat:HazmatCodeSimpleType NA1993 Compounds, tree killing, liquid or Compounds, weed killing, liquid
hazmat:HazmatCodeSimpleType NA1993 Diesel fuel
hazmat:HazmatCodeSimpleType NA1993 Fuel oil (No. 1, 2, 4, 5, or 6)
hazmat:HazmatCodeSimpleType NA2845 Ethyl phosphonous dichloride, anhydrous pyrophoric liquid
hazmat:HazmatCodeSimpleType NA2845 Methyl phosphonous dichloride, pyrophoric liquid
...
mmucc:DriverLicenseClassCodeSimpleType NA None/Not Applicable
mmucc:DriverLicenseClassCodeSimpleType NA Not Applicable Choose this one (another enum covers "None")
mo:RegisteredServiceNameCodeSimpleType ftp File Transfer Protocol [Control]. TBD
mo:RegisteredServiceNameCodeSimpleType ftp FTP.
mo:RegisteredServiceNameCodeSimpleType ftp-data File Transfer [Default Data].
mo:RegisteredServiceNameCodeSimpleType ftp-data FTP.
mo:RegisteredServiceNameCodeSimpleType http HTTP.
mo:RegisteredServiceNameCodeSimpleType http World Wide Web HTTP.
mo:RegisteredServiceNameCodeSimpleType imaps IMAP over TLS protocol.
mo:RegisteredServiceNameCodeSimpleType imaps imap4 protocol over TLS/SSL.
usmtf:AngleUnitCodeSimpleType DGG Degree Grid. Remove duplicates
usmtf:AngleUnitCodeSimpleType DGG Degree Grid.
usmtf:AngleUnitCodeSimpleType DGM Degree Magnetic.
usmtf:AngleUnitCodeSimpleType DGM Degree Magnetic.
usmtf:AngleUnitCodeSimpleType DGR Degree Relative.
usmtf:AngleUnitCodeSimpleType DGR Degree Relative.
usmtf:AngleUnitCodeSimpleType DGT Degree True.
usmtf:AngleUnitCodeSimpleType DGT Degree True.
usmtf:AngleUnitCodeSimpleType MIL Mils.
usmtf:AngleUnitCodeSimpleType MIL Mils.
usmtf:AngleUnitCodeSimpleType MIN Minutes.
usmtf:AngleUnitCodeSimpleType MIN Minutes.
usmtf:AngleUnitCodeSimpleType MLG Mils Grid.
usmtf:AngleUnitCodeSimpleType MLG Mils Grid.
usmtf:AngleUnitCodeSimpleType MLM Mils Magnetic.
usmtf:AngleUnitCodeSimpleType MLM Mils Magnetic.
usmtf:AngleUnitCodeSimpleType MLT Mils True.
usmtf:AngleUnitCodeSimpleType MLT Mils True.
usmtf:AngleUnitCodeSimpleType SEC Seconds.
usmtf:AngleUnitCodeSimpleType SEC Seconds.
usmtf:NauticalMileUnitCodeSimpleType NM Nautical Miles. Remove duplicate
usmtf:NauticalMileUnitCodeSimpleType NM Nautical Miles.
usmtf:RadioactiveHalfLifeCodeSimpleType 1600.00YR RA-226+ (Radon). TBD
usmtf:RadioactiveHalfLifeCodeSimpleType 1600.00YR SE-75 (Selenium). None
usmtf:RFPowerUnitDecibelsCodeSimpleType DB Decibel. Remove duplicate
usmtf:RFPowerUnitDecibelsCodeSimpleType DB Decibel.
usps:StreetSuffixCodeSimpleType PARK PARK PARK; PARKS
usps:StreetSuffixCodeSimpleType PARK PARKS
usps:StreetSuffixCodeSimpleType PKWY PARKWAY
usps:StreetSuffixCodeSimpleType PKWY PARKWAYS
usps:StreetSuffixCodeSimpleType SPUR SPUR
usps:StreetSuffixCodeSimpleType SPUR SPURS
usps:StreetSuffixCodeSimpleType WALK WALK
usps:StreetSuffixCodeSimpleType WALK WALKS
cdmgtri commented 1 year ago

The following overlapping code definitions still need to be resolved:

Type Enum Definition Resolution
em:BarcodeCodeSimpleType SCC-14 "Character set C encodes only numbers and the FNC1 function (indicated in blue). Because the numbers are ""interleaved"" into pairs, two numbers are encoded into every bar-code character which makes it a very high-density bar-code."
em:BarcodeCodeSimpleType SCC-14 Interleaved 2 of 5 (ITF) is a numeric-only bar-code used for encoding pairs of numbers in a high density bar-code format
em:BarcodeCodeSimpleType USPS Character set A allows for uppercase characters, punctuation, numbers and several special functions such as a return or tab.Character set B allows for upper and lower case letters, punctuation, numbers and a few select functions
em:BarcodeCodeSimpleType USPS Interleaved 2 of 5 (ITF) is a numeric-only bar-code used for encoding pairs of numbers in a high density bar-code format
mo:RegisteredServiceNameCodeSimpleType ftp File Transfer Protocol [Control]. File Transfer Protocol [Control]; FTP.
mo:RegisteredServiceNameCodeSimpleType ftp FTP.
mo:RegisteredServiceNameCodeSimpleType ftp-data File Transfer [Default Data].
mo:RegisteredServiceNameCodeSimpleType ftp-data FTP.
mo:RegisteredServiceNameCodeSimpleType http HTTP.
mo:RegisteredServiceNameCodeSimpleType http World Wide Web HTTP.
mo:RegisteredServiceNameCodeSimpleType imaps IMAP over TLS protocol.
mo:RegisteredServiceNameCodeSimpleType imaps imap4 protocol over TLS/SSL.
usmtf:RadioactiveHalfLifeCodeSimpleType 1600.00YR RA-226+ (Radon). Keep as is
usmtf:RadioactiveHalfLifeCodeSimpleType 1600.00YR SE-75 (Selenium). None Change code to "119.80DA" and remove "None" from definition
cdmgtri commented 1 year ago

Model changes merged into the dev branch for 6.0.