{"id":473364,"date":"2025-09-02T16:16:36","date_gmt":"2025-09-02T16:16:36","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=473364"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=473364","title":{"rendered":"<span>6NF File Format<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/976\/693\/a27\/976693a2736d86096f65fec6bf75f4d0.png\" width=\"720\" height=\"540\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/976\/693\/a27\/976693a2736d86096f65fec6bf75f4d0.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/976\/693\/a27\/976693a2736d86096f65fec6bf75f4d0.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p><strong>Filename Extension<\/strong>: <code>.6nf<\/code><\/p>\n<h4>1. Introduction<\/h4>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Sixth_normal_form\" rel=\"noopener noreferrer nofollow\">6NF<\/a> File Format is a new bitemporal, sixth-normal-form (6NF)-inspired data exchange format designed for DWH and for reporting. It replaces complex hierarchical formats like XBRL, XML, JSON, and YAML.<\/p>\n<h4>2. Design Principles<\/h4>\n<ul>\n<li>\n<p><strong>Database Friendly Flat Structure<\/strong>: No nested objects or arrays. No need for parsing<\/p>\n<\/li>\n<li>\n<p><strong>6NF Compatibility<\/strong>: Direct mapping to 6NF database tables. No need for normalization<\/p>\n<\/li>\n<li>\n<p><strong>Bitemporal Database Compatibility<\/strong>: All data includes valid_from and recorded_at timestamps<\/p>\n<\/li>\n<li>\n<p><strong>UTC Time Standard<\/strong>: All timestamps must be in UTC format, denoted by the &#8216;Z&#8217; suffix (e.g., 2023-01-01T12:00:00Z)<\/p>\n<\/li>\n<li>\n<p><strong>Struct Grouping<\/strong>: Multiple attributes with shared temporal context<\/p>\n<\/li>\n<li>\n<p><strong>Compactness<\/strong>: Uses <a href=\"https:\/\/www.crockford.com\/base32.html\" rel=\"noopener noreferrer nofollow\">Crockford\u2019s Base32<\/a> &#8212; encoded <a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc9562#name-uuid-version-7\" rel=\"noopener noreferrer nofollow\">UUIDv7<\/a> for identifiers<\/p>\n<\/li>\n<li>\n<p><strong>Readability<\/strong>: Clean syntax with minimal punctuation<\/p>\n<\/li>\n<li>\n<p><strong>PostgreSQL Style<\/strong>: Uses snake_case notation of identifiers (names)<\/p>\n<\/li>\n<li>\n<p><strong>Case Sensitivity<\/strong>: Keywords are UPPERCASE and case-sensitive. Identifiers (names) are lowercase and case-sensitive<\/p>\n<\/li>\n<li>\n<p><strong>UTF-8 Encoding<\/strong>: Files use UTF-8 encoding<\/p>\n<\/li>\n<\/ul>\n<h4>3. Syntax (EBNF)<\/h4>\n<pre><code class=\"bash\">6nf             = [version] { entity | reference | attribute | attribute_ref | struct | relationship } ; version         = \"VERSION\" number \"\\n\" ; entity          = \"ENTITY\" entity_name entity_id \"\\n\" ; reference       = \"REFERENCE\" name reference_id value \"\\n\" ; attribute       = \"ATTRIBUTE_OF\" entity_name entity_id name value valid_from recorded_at \"\\n\" ; attribute_ref   = \"ATTRIBUTE_REF_OF\" entity_name entity_id name reference_id valid_from recorded_at \"\\n\" ; struct          = \"STRUCT_OF\" entity_name entity_id name valid_from recorded_at \"\\n\"                   { name (value | reference_id) \"\\n\" } ; relationship    = \"RELATIONSHIP\" name relationship_id valid_from recorded_at \"\\n\"                   { name ( entity_id | reference_id ) \"\\n\" } ; value           = string | number | iso8601 | \"true\" | \"false\" ; string          = \"\\\"\" { character } \"\\\"\" ; number          = [ \"-\" ] digit { digit } [ \".\" digit { digit } ] ; valid_from      = iso8601 ; recorded_at     = iso8601 ; entity_name     = ( letter | \"_\" ) { letter | digit | \"_\" } ; name            = ( letter | \"_\" ) { letter | digit | \"_\" } ; entity_id       = 26 * base32_char ; reference_id    = 26 * base32_char ; relationship_id = 26 * base32_char ; base32_char     = \"0\" | \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\" | \"7\" | \"8\" | \"9\"                  | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\" | \"H\" | \"J\" | \"K\"                  | \"M\" | \"N\" | \"P\" | \"Q\" | \"R\" | \"S\" | \"T\" | \"V\" | \"W\" | \"X\" | \"Y\" | \"Z\" ;<\/code><\/pre>\n<h4>4. Example<\/h4>\n<pre><code class=\"lua\">VERSION 7 ENTITY bank 01K3Y0690AJCRFEJ2J49X6ZECY REFERENCE country_code 01K3Y07Z94DGJWVMB0JG4YSDBV \"US\" ATTRIBUTE_OF bank 01K3Y0690AJCRFEJ2J49X6ZECY bank_name \"Bank Alpha\" 2023-01-01T00:00:00Z 2023-01-01T12:00:00Z ATTRIBUTE_REF_OF bank 01K3Y0690AJCRFEJ2J49X6ZECY country_code 01K3Y07Z94DGJWVMB0JG4YSDBV 2023-01-01T00:00:00Z 2023-01-01T12:00:00Z STRUCT_OF bank 01K3Y0690AJCRFEJ2J49X6ZECY bank_address 2023-01-01T00:00:00Z 2023-01-01T12:00:00Z   country_code 01K3Y07Z94DGJWVMB0JG4YSDBV   street \"123 Main St\"   city \"New York\"   zip \"10001\" ENTITY account 01K3Y0G45CP4GMGE94BYQ09DFM ATTRIBUTE_OF account 01K3Y0G45CP4GMGE94BYQ09DFM account_balance 100000.50 2023-01-01T00:00:00Z 2023-01-01T12:00:00Z ATTRIBUTE_OF account 01K3Y0G45CP4GMGE94BYQ09DFM account_expiration 2025-12-31T23:59:59Z 2023-01-01T00:00:00Z 2023-01-01T12:00:00Z RELATIONSHIP bank_x_account 01K3Y0NR1Q3KTA9A6J9KYPK6YB 2023-01-01T00:00:00Z 2023-01-01T12:00:00Z   bank 01K3Y0690AJCRFEJ2J49X6ZECY   account 01K3Y0G45CP4GMGE94BYQ09DFM<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/942516\/\"> https:\/\/habr.com\/ru\/articles\/942516\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p><strong>Filename Extension<\/strong>: <code>.6nf<\/code><\/p>\n<h4>1. Introduction<\/h4>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Sixth_normal_form\" rel=\"noopener noreferrer nofollow\">6NF<\/a> File Format is a new bitemporal, sixth-normal-form (6NF)-inspired data exchange format designed for DWH and for reporting. It replaces complex hierarchical formats like XBRL, XML, JSON, and YAML.<\/p>\n<h4>2. Design Principles<\/h4>\n<ul>\n<li>\n<p><strong>Database Friendly Flat Structure<\/strong>: No nested objects or arrays. No need for parsing<\/p>\n<\/li>\n<li>\n<p><strong>6NF Compatibility<\/strong>: Direct mapping to 6NF database tables. No need for normalization<\/p>\n<\/li>\n<li>\n<p><strong>Bitemporal Database Compatibility<\/strong>: All data includes valid_from and recorded_at timestamps<\/p>\n<\/li>\n<li>\n<p><strong>UTC Time Standard<\/strong>: All timestamps must be in UTC format, denoted by the &#8216;Z&#8217; suffix (e.g., 2023-01-01T12:00:00Z)<\/p>\n<\/li>\n<li>\n<p><strong>Struct Grouping<\/strong>: Multiple attributes with shared temporal context<\/p>\n<\/li>\n<li>\n<p><strong>Compactness<\/strong>: Uses <a href=\"https:\/\/www.crockford.com\/base32.html\" rel=\"noopener noreferrer nofollow\">Crockford\u2019s Base32<\/a> &#8212; encoded <a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc9562#name-uuid-version-7\" rel=\"noopener noreferrer nofollow\">UUIDv7<\/a> for identifiers<\/p>\n<\/li>\n<li>\n<p><strong>Readability<\/strong>: Clean syntax with minimal punctuation<\/p>\n<\/li>\n<li>\n<p><strong>PostgreSQL Style<\/strong>: Uses snake_case notation of identifiers (names)<\/p>\n<\/li>\n<li>\n<p><strong>Case Sensitivity<\/strong>: Keywords are UPPERCASE and case-sensitive. Identifiers (names) are lowercase and case-sensitive<\/p>\n<\/li>\n<li>\n<p><strong>UTF-8 Encoding<\/strong>: Files use UTF-8 encoding<\/p>\n<\/li>\n<\/ul>\n<h4>3. Syntax (EBNF)<\/h4>\n<pre><code class=\"bash\">6nf             = [version] { entity | reference | attribute | attribute_ref | struct | relationship } ; version         = \"VERSION\" number \"\\n\" ; entity          = \"ENTITY\" entity_name entity_id \"\\n\" ; reference       = \"REFERENCE\" name reference_id value \"\\n\" ; attribute       = \"ATTRIBUTE_OF\" entity_name entity_id name value valid_from recorded_at \"\\n\" ; attribute_ref   = \"ATTRIBUTE_REF_OF\" entity_name entity_id name reference_id valid_from recorded_at \"\\n\" ; struct          = \"STRUCT_OF\" entity_name entity_id name valid_from recorded_at \"\\n\"                   { name (value | reference_id) \"\\n\" } ; relationship    = \"RELATIONSHIP\" name relationship_id valid_from recorded_at \"\\n\"                   { name ( entity_id | reference_id ) \"\\n\" } ; value           = string | number | iso8601 | \"true\" | \"false\" ; string          = \"\\\"\" { character } \"\\\"\" ; number          = [ \"-\" ] digit { digit } [ \".\" digit { digit } ] ; valid_from      = iso8601 ; recorded_at     = iso8601 ; entity_name     = ( letter | \"_\" ) { letter | digit | \"_\" } ; name            = ( letter | \"_\" ) { letter | digit | \"_\" } ; entity_id       = 26 * base32_char ; reference_id    = 26 * base32_char ; relationship_id = 26 * base32_char ; base32_char     = \"0\" | \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\" | \"7\" | \"8\" | \"9\"                  | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\" | \"H\" | \"J\" | \"K\"                  | \"M\" | \"N\" | \"P\" | \"Q\" | \"R\" | \"S\" | \"T\" | \"V\" | \"W\" | \"X\" | \"Y\" | \"Z\" ;<\/code><\/pre>\n<h4>4. Example<\/h4>\n<pre><code class=\"lua\">VERSION 7 ENTITY bank 01K3Y0690AJCRFEJ2J49X6ZECY REFERENCE country_code 01K3Y07Z94DGJWVMB0JG4YSDBV \"US\" ATTRIBUTE_OF bank 01K3Y0690AJCRFEJ2J49X6ZECY bank_name \"Bank Alpha\" 2023-01-01T00:00:00Z 2023-01-01T12:00:00Z ATTRIBUTE_REF_OF bank 01K3Y0690AJCRFEJ2J49X6ZECY country_code 01K3Y07Z94DGJWVMB0JG4YSDBV 2023-01-01T00:00:00Z 2023-01-01T12:00:00Z STRUCT_OF bank 01K3Y0690AJCRFEJ2J49X6ZECY bank_address 2023-01-01T00:00:00Z 2023-01-01T12:00:00Z   country_code 01K3Y07Z94DGJWVMB0JG4YSDBV   street \"123 Main St\"   city \"New York\"   zip \"10001\" ENTITY account 01K3Y0G45CP4GMGE94BYQ09DFM ATTRIBUTE_OF account 01K3Y0G45CP4GMGE94BYQ09DFM account_balance 100000.50 2023-01-01T00:00:00Z 2023-01-01T12:00:00Z ATTRIBUTE_OF account 01K3Y0G45CP4GMGE94BYQ09DFM account_expiration 2025-12-31T23:59:59Z 2023-01-01T00:00:00Z 2023-01-01T12:00:00Z RELATIONSHIP bank_x_account 01K3Y0NR1Q3KTA9A6J9KYPK6YB 2023-01-01T00:00:00Z 2023-01-01T12:00:00Z   bank 01K3Y0690AJCRFEJ2J49X6ZECY   account 01K3Y0G45CP4GMGE94BYQ09DFM<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/942516\/\"> https:\/\/habr.com\/ru\/articles\/942516\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-473364","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/473364","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=473364"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/473364\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=473364"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=473364"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=473364"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}