New expected value for example 1 components test.

import module namespace request = "http://www.28msec.com/modules/http-request";
import module namespace config = "http://apps.28.io/config";

[ {
    "AccessionNumber" : "0000021344-13-000039",
    "EntityRegistrantName" : "COCA COLA CO",
    "CIK" : "http://www.sec.gov/CIK 0000021344",
    "FiscalYear" : 2013,
    "FiscalPeriod" : "Q2",
    "AcceptanceDatetime" : "2013-07-25T12:31:33Z",
    "FormType" : "10-Q",
    "Components" : [ {
      "NetworkLabel" : "0001000 - Document - Document and Entity Information",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/DocumentAndEntityInformation",
      "Category" : "Document",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "DocumentAndEntityInformation",
      "ReportElements" : 15,
      "Tables" : 1,
      "Axis" : 1,
      "Members" : 1,
      "LineItems" : 1,
      "Concepts" : 10,
      "Abstracts" : 2,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FDocumentAndEntityInformation&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FDocumentAndEntityInformation%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "1001000 - Statement - CONDENSED CONSOLIDATED STATEMENTS OF INCOME",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/CondensedConsolidatedStatementsOfIncome",
      "Category" : "Statement",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "IncomeStatement",
      "ReportElements" : 26,
      "Tables" : 1,
      "Axis" : 1,
      "Members" : 1,
      "LineItems" : 1,
      "Concepts" : 21,
      "Abstracts" : 2,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FCondensedConsolidatedStatementsOfIncome&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FCondensedConsolidatedStatementsOfIncome%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "1002000 - Statement - CONDENSED CONSOLIDATED STATEMENTS OF COMPREHENSIVE INCOME",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/CondensedConsolidatedStatementsOfComprehensiveIncome",
      "Category" : "Statement",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "StatementOfComprehensiveIncome",
      "ReportElements" : 14,
      "Tables" : 1,
      "Axis" : 1,
      "Members" : 1,
      "LineItems" : 1,
      "Concepts" : 8,
      "Abstracts" : 3,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FCondensedConsolidatedStatementsOfComprehensiveIncome&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FCondensedConsolidatedStatementsOfComprehensiveIncome%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "1003000 - Statement - CONDENSED CONSOLIDATED BALANCE SHEETS",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/CondensedConsolidatedBalanceSheets",
      "Category" : "Statement",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "BalanceSheet",
      "ReportElements" : 46,
      "Tables" : 1,
      "Axis" : 1,
      "Members" : 1,
      "LineItems" : 1,
      "Concepts" : 36,
      "Abstracts" : 7,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FCondensedConsolidatedBalanceSheets&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FCondensedConsolidatedBalanceSheets%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "1003500 - Statement - CONDENSED CONSOLIDATED BALANCE SHEETS Parentheticals",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/CondensedConsolidatedBalanceSheetsParentheticals",
      "Category" : "Statement",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "BalanceSheetParenthetical",
      "ReportElements" : 11,
      "Tables" : 1,
      "Axis" : 1,
      "Members" : 1,
      "LineItems" : 1,
      "Concepts" : 6,
      "Abstracts" : 2,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FCondensedConsolidatedBalanceSheetsParentheticals&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FCondensedConsolidatedBalanceSheetsParentheticals%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "1004000 - Statement - CONDENSED CONSOLIDATED STATEMENTS OF CASH FLOWS",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/CondensedConsolidatedStatementsOfCashFlows",
      "Category" : "Statement",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "CashFlowStatement",
      "ReportElements" : 38,
      "Tables" : 1,
      "Axis" : 1,
      "Members" : 1,
      "LineItems" : 1,
      "Concepts" : 29,
      "Abstracts" : 6,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FCondensedConsolidatedStatementsOfCashFlows&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FCondensedConsolidatedStatementsOfCashFlows%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2101100 - Disclosure - Summary of Significant Accounting Policies",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/SummaryOfSignificantAccountingPolicies",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "SignificantAccountingPolicies",
      "ReportElements" : 2,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 1,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FSummaryOfSignificantAccountingPolicies&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FSummaryOfSignificantAccountingPolicies%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2102100 - Disclosure - Acquisitions and Divestitures",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/AcquisitionsAndDivestitures",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "BusinessCombinationDisclosure",
      "ReportElements" : 2,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 1,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FAcquisitionsAndDivestitures&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FAcquisitionsAndDivestitures%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2103100 - Disclosure - Investments",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/Investments",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 2,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 1,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FInvestments&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FInvestments%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2104100 - Disclosure - Inventories",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/Inventories",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "InventoryDisclosure",
      "ReportElements" : 2,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 1,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FInventories&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FInventories%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2105100 - Disclosure - Hedging Transactions and Derivative Financial Instruments",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/HedgingTransactionsAndDerivativeFinancialInstruments",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 2,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 1,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FHedgingTransactionsAndDerivativeFinancialInstruments&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FHedgingTransactionsAndDerivativeFinancialInstruments%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2106100 - Disclosure - Debt and Borrowing Arrangements",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/DebtAndBorrowingArrangements",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "DebtDisclosure",
      "ReportElements" : 2,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 1,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FDebtAndBorrowingArrangements&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FDebtAndBorrowingArrangements%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2107100 - Disclosure - Commitments and Contingencies",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/CommitmentsAndContingencies",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "ContingenciesDisclosure",
      "ReportElements" : 2,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 1,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FCommitmentsAndContingencies&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FCommitmentsAndContingencies%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2108100 - Disclosure - Comprehensive Income",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/ComprehensiveIncome",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 2,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 1,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FComprehensiveIncome&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FComprehensiveIncome%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2109100 - Disclosure - Changes in Equity",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/ChangesInEquity",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 2,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 1,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FChangesInEquity&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FChangesInEquity%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2110100 - Disclosure - Significant Operating and Nonoperating Items",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/SignificantOperatingAndNonoperatingItems",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 2,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 1,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FSignificantOperatingAndNonoperatingItems&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FSignificantOperatingAndNonoperatingItems%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2111100 - Disclosure - Productivity, Integration and Restructuring Initiatives",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/ProductivityIntegrationAndRestructuringInitiatives",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 2,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 1,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FProductivityIntegrationAndRestructuringInitiatives&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FProductivityIntegrationAndRestructuringInitiatives%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2112100 - Disclosure - Pension and Other Postretirement Benefit Plans",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/PensionAndOtherPostretirementBenefitPlans",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "PostemploymentBenefits",
      "ReportElements" : 2,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 1,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FPensionAndOtherPostretirementBenefitPlans&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FPensionAndOtherPostretirementBenefitPlans%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2113100 - Disclosure - Income Taxes",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/IncomeTaxes",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "IncomeTaxDisclosure",
      "ReportElements" : 2,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 1,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FIncomeTaxes&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FIncomeTaxes%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2114100 - Disclosure - Fair Value Measurements",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/FairValueMeasurements",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "FairValueMeasurementsOther",
      "ReportElements" : 2,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 1,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FFairValueMeasurements&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FFairValueMeasurements%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2115100 - Disclosure - Operating Segments",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/OperatingSegments",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 2,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 1,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FOperatingSegments&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FOperatingSegments%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2302301 - Disclosure - Acquisitions and Divestitures (Tables)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/AcquisitionsAndDivestituresTables",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "BusinessCombinationDisclosure",
      "ReportElements" : 2,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 1,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FAcquisitionsAndDivestituresTables&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FAcquisitionsAndDivestituresTables%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2303301 - Disclosure - Investments (Tables)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/InvestmentsTables",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 6,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 5,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FInvestmentsTables&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FInvestmentsTables%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2304301 - Disclosure - Inventories (Tables)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/InventoriesTables",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "InventoryDisclosure",
      "ReportElements" : 2,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 1,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FInventoriesTables&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FInventoriesTables%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2305301 - Disclosure - Hedging Transactions and Derivative Financial Instruments (Tables)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/HedgingTransactionsAndDerivativeFinancialInstrumentsTables",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 7,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 6,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FHedgingTransactionsAndDerivativeFinancialInstrumentsTables&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FHedgingTransactionsAndDerivativeFinancialInstrumentsTables%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2308301 - Disclosure - Comprehensive Income (Tables)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/ComprehensiveIncomeTables",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 4,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 3,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FComprehensiveIncomeTables&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FComprehensiveIncomeTables%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2309301 - Disclosure - Changes in Equity (Tables)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/ChangesInEquityTables",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 2,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 1,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FChangesInEquityTables&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FChangesInEquityTables%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2311301 - Disclosure - Productivity, Integration and Restructuring Initiatives (Tables)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/ProductivityIntegrationAndRestructuringInitiativesTables",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 6,
      "Tables" : 1,
      "Axis" : 1,
      "Members" : 1,
      "LineItems" : 1,
      "Concepts" : 1,
      "Abstracts" : 2,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FProductivityIntegrationAndRestructuringInitiativesTables&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FProductivityIntegrationAndRestructuringInitiativesTables%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2312301 - Disclosure - Pension and Other Postretirement Benefit Plans (Tables)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/PensionAndOtherPostretirementBenefitPlansTables",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "PostemploymentBenefits",
      "ReportElements" : 2,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 1,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FPensionAndOtherPostretirementBenefitPlansTables&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FPensionAndOtherPostretirementBenefitPlansTables%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2313301 - Disclosure - Income Taxes (Tables)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/IncomeTaxesTables",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "IncomeTaxDisclosure",
      "ReportElements" : 2,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 1,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FIncomeTaxesTables&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FIncomeTaxesTables%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2314301 - Disclosure - Fair Value Measurements (Tables)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/FairValueMeasurementsTables",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "FairValueMeasurementsOther",
      "ReportElements" : 2,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 1,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FFairValueMeasurementsTables&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FFairValueMeasurementsTables%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2315301 - Disclosure - Operating Segments (Tables)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/OperatingSegmentsTables",
      "Category" : "Disclosure",
      "SubCategory" : "TextBlockLevel1To3",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 2,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 1,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FOperatingSegmentsTables&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FOperatingSegmentsTables%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2402402 - Disclosure - Acquisitions and Divestitures (Details)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/AcquisitionsAndDivestituresDetails",
      "Category" : "Disclosure",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "BusinessCombinationDisclosure",
      "ReportElements" : 13,
      "Tables" : 1,
      "Axis" : 2,
      "Members" : 5,
      "LineItems" : 1,
      "Concepts" : 3,
      "Abstracts" : 2,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FAcquisitionsAndDivestituresDetails&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FAcquisitionsAndDivestituresDetails%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2402403 - Disclosure - Acquisitions and Divestitures (Details 2)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/AcquisitionsAndDivestituresDetails2",
      "Category" : "Disclosure",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "BusinessCombinationDisclosure",
      "ReportElements" : 28,
      "Tables" : 1,
      "Axis" : 1,
      "Members" : 4,
      "LineItems" : 1,
      "Concepts" : 20,
      "Abstracts" : 2,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FAcquisitionsAndDivestituresDetails2&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FAcquisitionsAndDivestituresDetails2%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2403402 - Disclosure - Investments (Details)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/InvestmentsDetails",
      "Category" : "Disclosure",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 11,
      "Tables" : 1,
      "Axis" : 1,
      "Members" : 2,
      "LineItems" : 1,
      "Concepts" : 4,
      "Abstracts" : 3,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FInvestmentsDetails&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FInvestmentsDetails%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2403403 - Disclosure - Investments (Details 2)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/InvestmentsDetails2",
      "Category" : "Disclosure",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 11,
      "Tables" : 1,
      "Axis" : 1,
      "Members" : 3,
      "LineItems" : 1,
      "Concepts" : 4,
      "Abstracts" : 2,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FInvestmentsDetails2&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FInvestmentsDetails2%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2403405 - Disclosure - Investments (Details 4)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/InvestmentsDetails4",
      "Category" : "Disclosure",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 18,
      "Tables" : 1,
      "Axis" : 2,
      "Members" : 4,
      "LineItems" : 1,
      "Concepts" : 9,
      "Abstracts" : 1,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FInvestmentsDetails4&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FInvestmentsDetails4%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2403406 - Disclosure - Investments (Details 5)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/InvestmentsDetails5",
      "Category" : "Disclosure",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 18,
      "Tables" : 1,
      "Axis" : 1,
      "Members" : 2,
      "LineItems" : 1,
      "Concepts" : 11,
      "Abstracts" : 3,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FInvestmentsDetails5&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FInvestmentsDetails5%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2404402 - Disclosure - Inventories (Details)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/InventoriesDetails",
      "Category" : "Disclosure",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "InventoryDisclosure",
      "ReportElements" : 6,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 4,
      "Abstracts" : 2,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FInventoriesDetails&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FInventoriesDetails%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2405402 - Disclosure - Hedging Transactions and Derivative Financial Instruments (Details)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/HedgingTransactionsAndDerivativeFinancialInstrumentsDetails",
      "Category" : "Disclosure",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 24,
      "Tables" : 1,
      "Axis" : 2,
      "Members" : 10,
      "LineItems" : 1,
      "Concepts" : 8,
      "Abstracts" : 3,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FHedgingTransactionsAndDerivativeFinancialInstrumentsDetails&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FHedgingTransactionsAndDerivativeFinancialInstrumentsDetails%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2405403 - Disclosure - Hedging Transactions and Derivative Financial Instruments (Details 2)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/HedgingTransactionsAndDerivativeFinancialInstrumentsDetails2",
      "Category" : "Disclosure",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 36,
      "Tables" : 1,
      "Axis" : 3,
      "Members" : 19,
      "LineItems" : 1,
      "Concepts" : 11,
      "Abstracts" : 2,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FHedgingTransactionsAndDerivativeFinancialInstrumentsDetails2&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FHedgingTransactionsAndDerivativeFinancialInstrumentsDetails2%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2406402 - Disclosure - Debt and Borrowing Arrangements (Details)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/DebtAndBorrowingArrangementsDetails",
      "Category" : "Disclosure",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "DebtDisclosure",
      "ReportElements" : 16,
      "Tables" : 1,
      "Axis" : 1,
      "Members" : 7,
      "LineItems" : 1,
      "Concepts" : 5,
      "Abstracts" : 2,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FDebtAndBorrowingArrangementsDetails&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FDebtAndBorrowingArrangementsDetails%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2407402 - Disclosure - Commitments and Contingencies (Details)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/CommitmentsAndContingenciesDetails",
      "Category" : "Disclosure",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "ContingenciesDisclosure",
      "ReportElements" : 23,
      "Tables" : 1,
      "Axis" : 1,
      "Members" : 4,
      "LineItems" : 1,
      "Concepts" : 12,
      "Abstracts" : 5,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FCommitmentsAndContingenciesDetails&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FCommitmentsAndContingenciesDetails%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2408402 - Disclosure - Comprehensive Income (Details)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/ComprehensiveIncomeDetails",
      "Category" : "Disclosure",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 85,
      "Tables" : 1,
      "Axis" : 3,
      "Members" : 16,
      "LineItems" : 1,
      "Concepts" : 46,
      "Abstracts" : 19,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FComprehensiveIncomeDetails&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FComprehensiveIncomeDetails%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2409402 - Disclosure - Changes in Equity (Details)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/ChangesInEquityDetails",
      "Category" : "Disclosure",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 21,
      "Tables" : 1,
      "Axis" : 1,
      "Members" : 7,
      "LineItems" : 1,
      "Concepts" : 9,
      "Abstracts" : 3,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FChangesInEquityDetails&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FChangesInEquityDetails%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2410401 - Disclosure - Significant Operating and Nonoperating Items (Details)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/SignificantOperatingAndNonoperatingItemsDetails",
      "Category" : "Disclosure",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 35,
      "Tables" : 1,
      "Axis" : 5,
      "Members" : 15,
      "LineItems" : 1,
      "Concepts" : 7,
      "Abstracts" : 7,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FSignificantOperatingAndNonoperatingItemsDetails&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FSignificantOperatingAndNonoperatingItemsDetails%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2411402 - Disclosure - Productivity, Integration and Restructuring Initiatives (Details)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/ProductivityIntegrationAndRestructuringInitiativesDetails",
      "Category" : "Disclosure",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 19,
      "Tables" : 1,
      "Axis" : 2,
      "Members" : 7,
      "LineItems" : 1,
      "Concepts" : 6,
      "Abstracts" : 3,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FProductivityIntegrationAndRestructuringInitiativesDetails&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FProductivityIntegrationAndRestructuringInitiativesDetails%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2412402 - Disclosure - Pension and Other Postretirement Benefit Plans (Details)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/PensionAndOtherPostretirementBenefitPlansDetails",
      "Category" : "Disclosure",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "PostemploymentBenefits",
      "ReportElements" : 15,
      "Tables" : 1,
      "Axis" : 1,
      "Members" : 3,
      "LineItems" : 1,
      "Concepts" : 8,
      "Abstracts" : 2,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FPensionAndOtherPostretirementBenefitPlansDetails&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FPensionAndOtherPostretirementBenefitPlansDetails%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2413402 - Disclosure - Income Taxes (Details)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/IncomeTaxesDetails",
      "Category" : "Disclosure",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "IncomeTaxDisclosure",
      "ReportElements" : 35,
      "Tables" : 1,
      "Axis" : 3,
      "Members" : 9,
      "LineItems" : 1,
      "Concepts" : 18,
      "Abstracts" : 4,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FIncomeTaxesDetails&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FIncomeTaxesDetails%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2414402 - Disclosure - Fair Value Measurements (Details)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/FairValueMeasurementsDetails",
      "Category" : "Disclosure",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "FairValueMeasurementsOther",
      "ReportElements" : 22,
      "Tables" : 1,
      "Axis" : 2,
      "Members" : 11,
      "LineItems" : 1,
      "Concepts" : 6,
      "Abstracts" : 2,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FFairValueMeasurementsDetails&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FFairValueMeasurementsDetails%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2414403 - Disclosure - Fair Value Measurements (Details 2)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/FairValueMeasurementsDetails2",
      "Category" : "Disclosure",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "FairValueMeasurementsOther",
      "ReportElements" : 9,
      "Tables" : 1,
      "Axis" : 2,
      "Members" : 2,
      "LineItems" : 1,
      "Concepts" : 2,
      "Abstracts" : 2,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FFairValueMeasurementsDetails2&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FFairValueMeasurementsDetails2%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2414404 - Disclosure - Fair Value Measurements (Details 3)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/FairValueMeasurementsDetails3",
      "Category" : "Disclosure",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "FairValueMeasurementsOther",
      "ReportElements" : 4,
      "Tables" : 0,
      "Axis" : 0,
      "Members" : 0,
      "LineItems" : 0,
      "Concepts" : 2,
      "Abstracts" : 2,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FFairValueMeasurementsDetails3&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FFairValueMeasurementsDetails3%26profile-name%3Dsec"
    }, {
      "NetworkLabel" : "2415402 - Disclosure - Operating Segments (Details)",
      "NetworkIdentifier" : "http://www.thecoca-colacompany.com/role/OperatingSegmentsDetails",
      "Category" : "Disclosure",
      "SubCategory" : "Detail",
      "Table" : "xbrl28:ImpliedTable",
      "Disclosure" : "UncategorizedInformation",
      "ReportElements" : 39,
      "Tables" : 1,
      "Axis" : 4,
      "Members" : 17,
      "LineItems" : 1,
      "Concepts" : 14,
      "Abstracts" : 3,
      "FactTable" : "http://" || request:server-name() || ":" || request:server-port() || "/v1/_queries/public/api/facttable-for-component.jq?_method=POST&token=" || $config:test-token || "&aid=0000021344-13-000039&format=&role=http%3A%2F%2Fwww.thecoca-colacompany.com%2Frole%2FOperatingSegmentsDetails&profile-name=sec",
      "SpreadSheet" : "http://rendering.secxbrl.info/#?url=http%3A%2F%2F" || request:server-name() || "%3A" || request:server-port() || "%2Fv1%2F_queries%2Fpublic%2Fapi%2Fspreadsheet-for-component.jq%3F_method%3DPOST%26token%3D" || $config:test-token || "%26aid%3D0000021344-13-000039%26format%3D%26role%3Dhttp%253A%252F%252Fwww.thecoca-colacompany.com%252Frole%252FOperatingSegmentsDetails%26profile-name%3Dsec"
    } ]
  } ]


gcd as a pipe

gcd as a pipe

module {
    name: "math",
    description: "Miscelaneous mathematical functions",
    namespace: "fadado.github.io",
    author: {
        name: "Joan Josep Ordinas Rosa",
        email: "jordinas@gmail.com"
    }
};

include "fadado.github.io/prelude";

########################################################################
# Simple utilities

def abs($n): #:: (number) => number
    $n|length
;

def even($n): #:: (number) => boolean
    $n%2 == 0
;

def odd($n): #:: (number) => boolean
    $n%2 == 1
;

def min($a; $b): #:: (number;number) => number
    if $a < $b then $a else $b end
;

def max($a; $b): #:: (number;number) => number
    if $a > $b then $a else $b end
;

def xgcd($m; $n): #:: (number;number) => number
    if $n == 0
    then $m
    else gcd($n; $m % $n)
    end
;

def ygcd($m; $n): #:: (number;number) => number
    def step:
        .x = .n      |
        .n = .m % .n |
        .m = .x

    ;
    label $pipe
    | {$m, $n}
    | iterate(step)
    | select(.n == 0)
    | (.m, break $pipe)
;

def gcd($m; $n): #:: (number;number) => number
    def step:
        .x = .n      |
        .n = .m % .n |
        .m = .x

    ;
    {$m, $n} | until(.n == 0; step) | .m
;

def sign($n): #:: (number) => number
    $n|if isnan or type!="number" then nan
    elif . > 0                    then 1
    elif . == 0                   then 0
                                  else -1
    end
;

def tobase($b): #:: number|(number) => ?string
    def digit: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"[.:.+1];
    def div: (. / $b)|floor;
    def mod: . % $b;
    def r: if . < $b then digit else (div|r)+(mod|digit) end;
    # do nothing if base out of range
    select(2 <= $b and $b <= 36)
    | r
;

# Inspired in https://www.rosettacode.org/wiki/URL_decoding#jq
def frombase($base): #:: string|(number) => number
    def downcase:
        when(65 <= . and . <= 90; . + 32)
    ;
    def toint: # "a" ~ 97 => 10 ~ 87
        if . > 96  then . - 87 else . - 48 end
    ;
    reduce (explode | reverse[] | downcase | toint) as $c
       ({power: 1, answer: 0};
        (.power * $base) as $b
        | .answer += (.power * $c)
        | .power = $b)
    | .answer
;

########################################################################
# Reductions

def sum(generator): #:: a|(a->*number) => number
    reduce generator as $item
        (0; . + $item)
;

def product(generator): #:: a|(a->*number) => number
    reduce generator as $item
        (1; . * $item)
;

def maximum(generator): #:: a|(a->*number) => number
    reduce generator as $item
        (0-infinite; max($item; .))
;

def minimum(generator): #:: a|(a->*number) => number
    reduce generator as $item
        (infinite; min($item; .))
;

# vim:ai:sw=4:ts=4:et:syntax=jq

module {
    name: "math",
    description: "Miscelaneous mathematical functions",
    namespace: "fadado.github.io",
    author: {
        name: "Joan Josep Ordinas Rosa",
        email: "jordinas@gmail.com"
    }
};

include "fadado.github.io/prelude";

########################################################################
# Simple utilities

def abs($n): #:: (number) => number
    $n|length
;

def even($n): #:: (number) => boolean
    $n%2 == 0
;

def odd($n): #:: (number) => boolean
    $n%2 == 1
;

def min($a; $b): #:: (number;number) => number
    if $a < $b then $a else $b end
;

def max($a; $b): #:: (number;number) => number
    if $a > $b then $a else $b end
;

def gcd($m; $n): #:: (number;number) => number
    if $n == 0
    then $m
    else gcd($n; $m % $n)
    end
;

def sign($n): #:: (number) => number
    $n|if isnan or type!="number" then nan
    elif . > 0                    then 1
    elif . == 0                   then 0
                                  else -1
    end
;

def tobase($b): #:: number|(number) => ?string
    def digit: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"[.:.+1];
    def div: (. / $b)|floor;
    def mod: . % $b;
    def r: if . < $b then digit else (div|r)+(mod|digit) end;
    # do nothing if base out of range
    select(2 <= $b and $b <= 36)
    | r
;

# Inspired in https://www.rosettacode.org/wiki/URL_decoding#jq
def frombase($base): #:: string|(number) => number
    def downcase:
        when(65 <= . and . <= 90; . + 32)
    ;
    def toint: # "a" ~ 97 => 10 ~ 87
        if . > 96  then . - 87 else . - 48 end
    ;
    reduce (explode | reverse[] | downcase | toint) as $c
       ({power: 1, answer: 0};
        (.power * $base) as $b
        | .answer += (.power * $c)
        | .power = $b)
    | .answer
;

########################################################################
# Reductions

def sum(generator): #:: a|(a->*number) => number
    reduce generator as $item
        (0; . + $item)
;

def product(generator): #:: a|(a->*number) => number
    reduce generator as $item
        (1; . * $item)
;

def maximum(generator): #:: a|(a->*number) => number
    reduce generator as $item
        (0-infinite; max($item; .))
;

def minimum(generator): #:: a|(a->*number) => number
    reduce generator as $item
        (infinite; min($item; .))
;

# vim:ai:sw=4:ts=4:et:syntax=jq


:pencil: Add support.

:pencil: Add support.

jsoniq version "1.0";

import module namespace components = "http://28.io/modules/xbrl/components";
import module namespace filings = "http://28.io/modules/xbrl/profiles/sec/filings";
import module namespace entities = "http://28.io/modules/xbrl/entities";
import module namespace hypercubes = "http://28.io/modules/xbrl/hypercubes";
import module namespace conversion = "http://28.io/modules/xbrl/conversion";
import module namespace networks = "http://28.io/modules/xbrl/networks";
import module namespace concept-maps = "http://28.io/modules/xbrl/concept-maps";
import module namespace rules = "http://28.io/modules/xbrl/rules";
import module namespace facts = "http://28.io/modules/xbrl/facts";
import module namespace labels = "http://28.io/modules/xbrl/labels";

import module namespace multiplexer = "http://28.io/modules/xbrl/profiles/multiplexer";
import module namespace fiscal-core = "http://28.io/modules/xbrl/profiles/sec/fiscal/core";

import module namespace config = "http://apps.28.io/config";
import module namespace session = "http://apps.28.io/session";
import module namespace api = "http://apps.28.io/api";

declare option rest:response "first-item";

(: Query parameters :)
declare  %rest:case-insensitive                 variable $token              as string? external;
declare  %rest:env                              variable $request-uri        as string  external;
declare  %rest:case-insensitive                 variable $format             as string? external;
declare  %rest:case-insensitive %rest:distinct  variable $cik                as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $edinetcode         as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $tag                as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $ticker             as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $sic                as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $fiscalYear         as string* external := "ALL";
declare  %rest:case-insensitive %rest:distinct  variable $fiscalPeriod       as string* external := "ALL";
declare  %rest:case-insensitive %rest:distinct  variable $fiscalPeriodType   as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $filingKind         as string* external := ();
declare  %rest:case-insensitive %rest:distinct  variable $eid                as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $aid                as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $section            as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $networkIdentifier  as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $cid                as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $concept            as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $reportElement      as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $disclosure         as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $label              as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $rollup             as string* external;
declare  %rest:case-insensitive                 variable $map                as string? external;
declare  %rest:case-insensitive                 variable $validate           as boolean external := false;
declare  %rest:case-insensitive                 variable $labels             as boolean external := true;
declare  %rest:case-insensitive                 variable $merge              as boolean external := true;
declare  %rest:case-insensitive                 variable $additional-rules   as string? external;
declare  %rest:case-insensitive                 variable $profile-name       as string  external := $config:profile-name;
declare  %rest:case-insensitive %rest:distinct  variable $role               as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $hypercube          as string* external;
declare  %rest:case-insensitive                 variable $language           as string  external := "en-US";
declare  %rest:case-insensitive                 variable $count              as boolean external := false;
declare  %rest:case-insensitive                 variable $override           as boolean external := false;
declare  %rest:case-insensitive                 variable $most-recent-version-aspect as string external :=
    switch($profile-name)
    case "sec" return "sec:Accepted"
    case "japan" return "fsa:Submitted"
    default return "NONE";

(: Post-processing :)
let $format as string? := api:preprocess-format($format, $request-uri)
let $fiscalYear as integer* := api:preprocess-fiscal-years($fiscalYear)
let $fiscalPeriod as string* := api:preprocess-fiscal-periods($fiscalPeriod)
let $tag as string* := api:preprocess-tags($tag)
let $reportElement := ($reportElement, $concept)
let $section := distinct-values(($section, $networkIdentifier, $role))

let $cik as string* :=
    switch($profile-name)
    case "sec" return $cik
    case "japan" return $edinetcode
    default return ()

(: Entity resolution :)
let $entities as object* := multiplexer:entities(
  $profile-name,
  $eid,
  $cik,
  $tag,
  $ticker,
  $sic,
  (),
  (),
  (),
  ())

let $archives as object* := multiplexer:filings(
  $profile-name,
  $entities,
  $fiscalPeriod,
  $fiscalYear,
  $filingKind,
  $aid)

let $archives-not-found as boolean :=
  exists(($entities, $fiscalPeriod, $fiscalYear, $filingKind, $aid)) and empty($archives)

let $entities as object* :=
    ($entities[entities:eid($$) = $archives.Entity],
    let $not-found := $archives.Entity[not entities:eid($entities) = $$]
    where exists($not-found)
    return entities:entities($not-found))

let $entities-not-found as boolean :=
  exists(($eid, $cik, $tag, $ticker, $sic)) and empty($entities)

let $component as object? :=
    multiplexer:component(
      $profile-name,
      $archives,
      $cid,
      $reportElement,
      $disclosure,
      $section,
      $label[$profile-name ne "sec"],
      $label[$profile-name eq "sec"],
      $hypercube,
      $merge
    )

let $component-not-found as boolean :=
  exists(($archives, $cid, $reportElement, $disclosure, $section, $label)) and empty($component)

let $selected-hypercube as string? := multiplexer:hypercube(
    $component,
    $hypercube)

let $hypercube-not-found as boolean := exists($hypercube) and empty($selected-hypercube)

let $cid as string? := components:cid($component)
let $rules as object* := if(exists($additional-rules)) then rules:rules($additional-rules) else ()

let $filter-override as object? :=
    if($profile-name eq "sec")
    then fiscal-core:filter-override(
        $entities,
        $fiscalYear,
        $fiscalPeriod,
        $fiscalPeriodType,
        $aid)
    else components:filter-override($entities, $aid)

(: Fact resolution :)
let $facts :=
    switch(true)
    case (exists($rollup) and $profile-name eq "sec")
         return
             let $calc-network := networks:networks-for-components-and-short-names($component, $networks:CALCULATION_NETWORK)
             let $hc := hypercubes:hypercubes-for-components($component)[][$$.Name = $selected-hypercube]
             let $hc := hypercubes:modify-hypercube($hc, {
                 "sec:FiscalYear" : { Type: "integer", Default: null },
                 "sec:FiscalPeriod" : { Type: "string", Default: null },
                 "sec:FiscalPeriodType" : { Type: "string", Default: null }
             })
             let $options as object? := if(exists($rules)) then { Rules: [ $rules ] } else ()
             let $p := hypercubes:populate-networks-with-facts($calc-network, $hc, $archives, $options)
             let $map := concept-maps:concept-maps($map)
             let $concepts :=
                if (not $map instance of null)
                then
                    for $d in $rollup[]
                    return
                        descendant-objects($p)[$$.Name = ($map.Trees[])[$$.Name eq $d].To[].Name][1].To[].Name
                else
                    for $d in $rollup[]
                    return ($d, keys(descendant-objects($p)[$$.Name eq $d].To))
             return facts:facts-for-archives-and-concepts(
                 $archives,
                 $concepts,
                 {|
                     { Hypercube: $hc },
                     { MostRecentVersionAspect: $most-recent-version-aspect }[$most-recent-version-aspect ne "NONE"]
                 |})
    case exists($selected-hypercube)
          return components:facts(
              $component,
              $selected-hypercube,
              {|
                  { FilterOverride: $filter-override }[$override],
                  { Validate: $validate },
                  { Rules : [ $rules ] }[exists($rules)],
                  { MostRecentVersionAspect: $most-recent-version-aspect }[$most-recent-version-aspect ne "NONE"]
              |}
          )
    default return ()

let $facts :=
    if(not $labels)
    then $facts
    else
        (: if labels are requested by the labels=true parameter then also add labels for concepts :)
        let $concepts as object* := $component.Concepts[]
        for $fact in $facts
        let $labels := labels:labels-for-facts(
          $fact,
          $labels:STANDARD_LABEL_ROLE,
          $language,
          $concepts,
          $entities,
          ()
        )
        return
            {|
                trim($fact, "Labels"),
                { Labels : $labels }
            |}
let $facts := api:normalize-facts($facts)

let $result :=
  switch($profile-name)
  case "sec" return {
    CIK : entities:eid($entities),
    EntityRegistrantName : $entities.Profiles.SEC.CompanyName,
    Archive : $component.Archive,
    Section : $component.Label,
    SectionURI: $component.Role,
    HypercubeName : $selected-hypercube,
    FormType : $archives.Profiles.SEC.FormType,
    FiscalPeriod : $archives.Profiles.SEC.Fiscal.DocumentFiscalPeriodFocus,
    FiscalYear : $archives.Profiles.SEC.Fiscal.DocumentFiscalYearFocus,
    AcceptanceDatetime : ($archives ! filings:acceptance-dateTimes($$)),
    Disclosure : $component.Profiles.SEC.Disclosure,
    FactTable : [ if($count) then () else $facts ]
  } default return {
    Archive : $component.Archive,
    Section : $component.Label,
    SectionURI: $component.Role,
    HypercubeName : $selected-hypercube,
    FactTable : [ if($count) then () else $facts ]
  }

let $comment := {
    NumFacts : count($facts),
    TotalNumFacts: session:num-facts(),
    TotalNumArchives: session:num-archives(),
    TotalNumEntities: session:num-entities()
}

let $serializers := {
    to-xml : function($res as object) as node() {
        switch($profile-name)
        case "sec" return <FactTable entityRegistrantName="{$res.EntityRegistrantName}"
            cik="{$res.CIK}"
            hypercubeName="{$res.HypercubeName}"
            section="{$res.Section}"
            archive="{$res.Archive}"
            sectionURI="{$res.SectionURI}"
            formType="{$res.FormType}"
            fiscalPeriod="{$res.FiscalPeriod}"
            fiscalYear="{$res.FiscalYear}"
            acceptanceDatetime="{$res.AcceptanceDatetime}"
            disclosure="{$res.Disclosure}"
            >{
            conversion:facts-to-xml($res.FactTable[], { Caller: "Component" })
        }</FactTable>
        default return <FactTable
            tableName="{$res.TableName}"
            label="{$res.Label}"
            archive="{$res.Archive}"
            role="{$res.Role}"
            >{
            conversion:facts-to-xml($res.FactTable[], { Caller: "Component" })
        }</FactTable>
    },
    to-csv : function($res as object) as string {
        string-join(conversion:facts-to-csv($res.FactTable[], { Caller: "Component"}))
    },
    to-odata : function($res as object) as node()* {
        <feed xmlns='http://www.w3.org/2005/Atom'
            xmlns:m='http://docs.oasis-open.org/odata/ns/metadata'
            xmlns:d='http://docs.oasis-open.org/odata/ns/data'
            xml:base='http://www.28.io/'>
        <id>{"odata:transient:"|| current-dateTime() }</id>
        <title type='text'>Cell store facts</title>
        <updated>{current-dateTime()}</updated>
       {
            conversion:facts-to-odata($res.FactTable[], {token: $token, most-recent-version-aspect: $most-recent-version-aspect})
       }
       </feed>
    }
}
let $results as item* :=
    api:serialize($result, $comment, $serializers, $format, "facttable-" || $cid)
return switch(true)
       case $entities-not-found return api:not-found("entity")
       case $archives-not-found return api:not-found("archive")
       case $component-not-found return api:not-found("component")
       case $hypercube-not-found return api:not-found("hypercube")
       default return api:check-and-return-results($token, $results, $format)

jsoniq version "1.0";

import module namespace components = "http://28.io/modules/xbrl/components";
import module namespace filings = "http://28.io/modules/xbrl/profiles/sec/filings";
import module namespace entities = "http://28.io/modules/xbrl/entities";
import module namespace hypercubes = "http://28.io/modules/xbrl/hypercubes";
import module namespace conversion = "http://28.io/modules/xbrl/conversion";
import module namespace networks = "http://28.io/modules/xbrl/networks";
import module namespace concept-maps = "http://28.io/modules/xbrl/concept-maps";
import module namespace rules = "http://28.io/modules/xbrl/rules";
import module namespace facts = "http://28.io/modules/xbrl/facts";
import module namespace labels = "http://28.io/modules/xbrl/labels";

import module namespace multiplexer = "http://28.io/modules/xbrl/profiles/multiplexer";
import module namespace fiscal-core = "http://28.io/modules/xbrl/profiles/sec/fiscal/core";

import module namespace config = "http://apps.28.io/config";
import module namespace session = "http://apps.28.io/session";
import module namespace api = "http://apps.28.io/api";

declare option rest:response "first-item";

(: Query parameters :)
declare  %rest:case-insensitive                 variable $token              as string? external;
declare  %rest:env                              variable $request-uri        as string  external;
declare  %rest:case-insensitive                 variable $format             as string? external;
declare  %rest:case-insensitive %rest:distinct  variable $cik                as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $edinetcode         as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $tag                as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $ticker             as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $sic                as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $fiscalYear         as string* external := "ALL";
declare  %rest:case-insensitive %rest:distinct  variable $fiscalPeriod       as string* external := "ALL";
declare  %rest:case-insensitive %rest:distinct  variable $fiscalPeriodType   as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $filingKind         as string* external := ();
declare  %rest:case-insensitive %rest:distinct  variable $eid                as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $aid                as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $section            as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $networkIdentifier  as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $cid                as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $concept            as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $reportElement      as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $disclosure         as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $label              as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $rollup             as string* external;
declare  %rest:case-insensitive                 variable $map                as string? external;
declare  %rest:case-insensitive                 variable $validate           as boolean external := false;
declare  %rest:case-insensitive                 variable $labels             as boolean external := true;
declare  %rest:case-insensitive                 variable $merge              as boolean external := true;
declare  %rest:case-insensitive                 variable $additional-rules   as string? external;
declare  %rest:case-insensitive                 variable $profile-name       as string  external := $config:profile-name;
declare  %rest:case-insensitive %rest:distinct  variable $role               as string* external;
declare  %rest:case-insensitive %rest:distinct  variable $hypercube          as string* external;
declare  %rest:case-insensitive                 variable $language           as string  external := "en-US";
declare  %rest:case-insensitive                 variable $count              as boolean external := false;
declare  %rest:case-insensitive                 variable $override           as boolean external := false;
declare  %rest:case-insensitive                 variable $most-recent-version-aspect as string external :=
    switch($profile-name)
    case "sec" return "sec:Accepted"
    case "japan" return "fsa:Submitted"
    default return "NONE";

(: Post-processing :)
let $format as string? := api:preprocess-format($format, $request-uri)
let $fiscalYear as integer* := api:preprocess-fiscal-years($fiscalYear)
let $fiscalPeriod as string* := api:preprocess-fiscal-periods($fiscalPeriod)
let $tag as string* := api:preprocess-tags($tag)
let $reportElement := ($reportElement, $concept)
let $section := distinct-values(($section, $networkIdentifier, $role))

let $cik as string* :=
    switch($profile-name)
    case "sec" return $cik
    case "japan" return $edinetcode
    default return ()

(: Entity resolution :)
let $entities as object* := multiplexer:entities(
  $profile-name,
  $eid,
  $cik,
  $tag,
  $ticker,
  $sic,
  (),
  (),
  (),
  ())

let $archives as object* := multiplexer:filings(
  $profile-name,
  $entities,
  $fiscalPeriod,
  $fiscalYear,
  $filingKind,
  $aid)

let $archives-not-found as boolean :=
  exists(($entities, $fiscalPeriod, $fiscalYear, $filingKind, $aid)) and empty($archives)

let $entities as object* :=
    ($entities[entities:eid($$) = $archives.Entity],
    let $not-found := $archives.Entity[not entities:eid($entities) = $$]
    where exists($not-found)
    return entities:entities($not-found))

let $entities-not-found as boolean :=
  exists(($eid, $cik, $tag, $ticker, $sic)) and empty($entities)

let $component as object? :=
    multiplexer:component(
      $profile-name,
      $archives,
      $cid,
      $reportElement,
      $disclosure,
      $section,
      $label[$profile-name ne "sec"],
      $label[$profile-name eq "sec"],
      $hypercube,
      $merge
    )

let $component-not-found as boolean :=
  exists(($archives, $cid, $reportElement, $disclosure, $section, $label)) and empty($component)

let $selected-hypercube as string? := multiplexer:hypercube(
    $component,
    $hypercube)

let $hypercube-not-found as boolean := exists($hypercube) and empty($selected-hypercube)

let $cid as string? := components:cid($component)
let $rules as object* := if(exists($additional-rules)) then rules:rules($additional-rules) else ()

let $filter-override as object? :=
    if($profile-name eq "sec")
    then fiscal-core:filter-override(
        $entities,
        $fiscalYear,
        $fiscalPeriod,
        $fiscalPeriodType,
        $aid)
    else components:filter-override($entities, $aid)

(: Fact resolution :)
let $facts :=
    switch(true)
    case (exists($rollup) and $profile-name eq "sec")
         return
             let $calc-network := networks:networks-for-components-and-short-names($component, $networks:CALCULATION_NETWORK)
             let $hc := hypercubes:hypercubes-for-components($component)[][$$.Name = $selected-hypercube]
             let $hc := hypercubes:modify-hypercube($hc, {
                 "sec:FiscalYear" : { Type: "integer", Default: null },
                 "sec:FiscalPeriod" : { Type: "string", Default: null },
                 "sec:FiscalPeriodType" : { Type: "string", Default: null }
             })
             let $options as object? := if(exists($rules)) then { Rules: [ $rules ] } else ()
             let $p := hypercubes:populate-networks-with-facts($calc-network, $hc, $archives, $options)
             let $map := concept-maps:concept-maps($map)
             let $concepts :=
                if (not $map instance of null)
                then
                    for $d in $rollup[]
                    return
                        descendant-objects($p)[$$.Name = ($map.Trees[])[$$.Name eq $d].To[].Name][1].To[].Name
                else
                    for $d in $rollup[]
                    return ($d, keys(descendant-objects($p)[$$.Name eq $d].To))
             return facts:facts-for-archives-and-concepts(
                 $archives,
                 $concepts,
                 {|
                     { Hypercube: $hc },
                     { MostRecentVersionAspect: $most-recent-version-aspect }[$most-recent-version-aspect ne "NONE"]
                 |})
    case exists($selected-hypercube)
          return components:facts(
              $component,
              $selected-hypercube,
              {|
                  { FilterOverride: $filter-override }[$override],
                  { Validate: $validate },
                  { Rules : [ $rules ] }[exists($rules)],
                  { MostRecentVersionAspect: $most-recent-version-aspect }[$most-recent-version-aspect ne "NONE"]
              |}
          )
    default return ()

let $facts :=
    if(not $labels)
    then $facts
    else
        (: if labels are requested by the labels=true parameter then also add labels for concepts :)
        let $concepts as object* := $component.Concepts[]
        for $fact in $facts
        let $labels := labels:labels-for-facts(
          $fact,
          $labels:STANDARD_LABEL_ROLE,
          $language,
          $concepts,
          $entities,
          ()
        )
        return
            {|
                trim($fact, "Labels"),
                { Labels : $labels }
            |}
let $facts := api:normalize-facts($facts)

let $result :=
  switch($profile-name)
  case "sec" return {
    CIK : entities:eid($entities),
    EntityRegistrantName : $entities.Profiles.SEC.CompanyName,
    Archive : $component.Archive,
    Section : $component.Label,
    SectionURI: $component.Role,
    HypercubeName : $selected-hypercube,
    FormType : $archives.Profiles.SEC.FormType,
    FiscalPeriod : $archives.Profiles.SEC.Fiscal.DocumentFiscalPeriodFocus,
    FiscalYear : $archives.Profiles.SEC.Fiscal.DocumentFiscalYearFocus,
    AcceptanceDatetime : ($archives ! filings:acceptance-dateTimes($$)),
    Disclosure : $component.Profiles.SEC.Disclosure,
    FactTable : [ if($count) then () else $facts ]
  } default return {
    Archive : $component.Archive,
    Section : $component.Label,
    SectionURI: $component.Role,
    HypercubeName : $selected-hypercube,
    FactTable : [ if($count) then () else $facts ]
  }

let $comment := {
    NumFacts : count($facts),
    TotalNumFacts: session:num-facts(),
    TotalNumArchives: session:num-archives(),
    TotalNumEntities: session:num-entities()
}

let $serializers := {
    to-xml : function($res as object) as node() {
        switch($profile-name)
        case "sec" return <FactTable entityRegistrantName="{$res.EntityRegistrantName}"
            cik="{$res.CIK}"
            hypercubeName="{$res.HypercubeName}"
            section="{$res.Section}"
            archive="{$res.Archive}"
            sectionURI="{$res.SectionURI}"
            formType="{$res.FormType}"
            fiscalPeriod="{$res.FiscalPeriod}"
            fiscalYear="{$res.FiscalYear}"
            acceptanceDatetime="{$res.AcceptanceDatetime}"
            disclosure="{$res.Disclosure}"
            >{
            conversion:facts-to-xml($res.FactTable[], { Caller: "Component" })
        }</FactTable>
        default return <FactTable
            tableName="{$res.TableName}"
            label="{$res.Label}"
            archive="{$res.Archive}"
            role="{$res.Role}"
            >{
            conversion:facts-to-xml($res.FactTable[], { Caller: "Component" })
        }</FactTable>
    },
    to-csv : function($res as object) as string {
        string-join(conversion:facts-to-csv($res.FactTable[], { Caller: "Component"}))
    }
}
let $results as item* :=
    api:serialize($result, $comment, $serializers, $format, "facttable-" || $cid)
return switch(true)
       case $entities-not-found return api:not-found("entity")
       case $archives-not-found return api:not-found("archive")
       case $component-not-found return api:not-found("component")
       case $hypercube-not-found return api:not-found("hypercube")
       default return api:check-and-return-results($token, $results, $format)


:green_heart: Fix warning.

:green_heart: Fix warning.