1

我正在尝试解析 SEC edgar xml 数据,并且对可链接的定义感到困惑。以下是苹果10-Q定义链接库的摘录。注意:该roleURI列是从roleRef定义链接库中的元素添加的。

idx order   role    {http://www.w3.org/1999/xlink}arcrole   {http://www.w3.org/1999/xlink}from  roleURI {http://www.w3.org/1999/xlink}to
16  1   http://www.apple.com/taxonomy/role/StatementOfIncome    http://xbrl.org/int/dim/arcrole/dimension-domain    dei_LegalEntityAxis aapl-20151226.xsd#Role_StatementOfIncome    dei_EntityDomain
33  1   http://www.apple.com/taxonomy/role/StatementOfIncome    http://xbrl.org/int/dim/arcrole/hypercube-dimension us-gaap_StatementTable  aapl-20151226.xsd#Role_StatementOfIncome    dei_LegalEntityAxis
17  1.01    http://www.apple.com/taxonomy/role/StatementOfIncome    http://xbrl.org/int/dim/arcrole/domain-member   us-gaap_OperatingExpensesAbstract   aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_ResearchAndDevelopmentExpense
18  1.02    http://www.apple.com/taxonomy/role/StatementOfIncome    http://xbrl.org/int/dim/arcrole/domain-member   us-gaap_OperatingExpensesAbstract   aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_SellingGeneralAndAdministrativeExpense
19  1.03    http://www.apple.com/taxonomy/role/StatementOfIncome    http://xbrl.org/int/dim/arcrole/domain-member   us-gaap_OperatingExpensesAbstract   aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_OperatingExpenses
14  1.04    http://www.apple.com/taxonomy/role/StatementOfIncome    http://xbrl.org/int/dim/arcrole/domain-member   us-gaap_EarningsPerShareAbstract    aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_EarningsPerShareBasic
15  1.05    http://www.apple.com/taxonomy/role/StatementOfIncome    http://xbrl.org/int/dim/arcrole/domain-member   us-gaap_EarningsPerShareAbstract    aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_EarningsPerShareDiluted
21  1.06    http://www.apple.com/taxonomy/role/StatementOfIncome    http://xbrl.org/int/dim/arcrole/domain-member   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_SalesRevenueNet
22  1.07    http://www.apple.com/taxonomy/role/StatementOfIncome    http://xbrl.org/int/dim/arcrole/domain-member   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_CostOfGoodsAndServicesSold
23  1.08    http://www.apple.com/taxonomy/role/StatementOfIncome    http://xbrl.org/int/dim/arcrole/domain-member   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_GrossProfit
24  1.09    http://www.apple.com/taxonomy/role/StatementOfIncome    http://xbrl.org/int/dim/arcrole/domain-member   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_OperatingExpensesAbstract
25  1.1 http://www.apple.com/taxonomy/role/StatementOfIncome    http://xbrl.org/int/dim/arcrole/domain-member   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_OperatingIncomeLoss
26  1.11    http://www.apple.com/taxonomy/role/StatementOfIncome    http://xbrl.org/int/dim/arcrole/domain-member   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_NonoperatingIncomeExpense
27  1.12    http://www.apple.com/taxonomy/role/StatementOfIncome    http://xbrl.org/int/dim/arcrole/domain-member   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest
28  1.13    http://www.apple.com/taxonomy/role/StatementOfIncome    http://xbrl.org/int/dim/arcrole/domain-member   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_IncomeTaxExpenseBenefit
29  1.14    http://www.apple.com/taxonomy/role/StatementOfIncome    http://xbrl.org/int/dim/arcrole/domain-member   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_NetIncomeLoss
30  1.15    http://www.apple.com/taxonomy/role/StatementOfIncome    http://xbrl.org/int/dim/arcrole/domain-member   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_EarningsPerShareAbstract
31  1.16    http://www.apple.com/taxonomy/role/StatementOfIncome    http://xbrl.org/int/dim/arcrole/domain-member   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_WeightedAverageNumberOfSharesOutstandingAbstract
32  1.17    http://www.apple.com/taxonomy/role/StatementOfIncome    http://xbrl.org/int/dim/arcrole/domain-member   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_CommonStockDividendsPerShareDeclared
34  1.19    http://www.apple.com/taxonomy/role/StatementOfIncome    http://xbrl.org/int/dim/arcrole/domain-member   us-gaap_WeightedAverageNumberOfSharesOutstandingAbstract    aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_WeightedAverageNumberOfSharesOutstandingBasic
35  1.2 http://www.apple.com/taxonomy/role/StatementOfIncome    http://xbrl.org/int/dim/arcrole/domain-member   us-gaap_WeightedAverageNumberOfSharesOutstandingAbstract    aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding
20  100 http://www.apple.com/taxonomy/role/StatementOfIncome    http://xbrl.org/int/dim/arcrole/all us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_StatementTable

根据这些数据,我希望能够为Condensed Consolidated Statements of Operations.

我的问题是我不确定如何解析它。我假设一个从arcrole/allwhich states 有一个 from link =us-gaap_StatementLineItems和 to =开始us-gaap_StatementTable。从这一点可以通过表格跟踪以下链接:

from                                 to 
us-gaap_StatementTable               dei_LegalEntityAxis
dei_LegalEntityAxis                  dei_EntityDomain

从这里开始,它停止,因为dei_EntityDomain没有链接到任何东西。我知道结构应该是这样的:

渲染数据:

渲染数据

模型结构:

模型结构

我希望链接库的结构看起来像这样:

from                                 to 
us-gaap_StatementTable               dei_LegalEntityAxis
us-gaap_StatementTable               us-gaap_StatementLineItems

我可以看到这将有效地允许从 Statement 表挂起两个级别,但它显然不是那样工作的。

有人可以告诉我如何使用提供的定义链接库数据来读取它以达到上图所示的预期结构。一旦我了解了定义链接库的工作原理,我就可以提取事实和概念。

4

2 回答 2

2

定义链接库用于指示给定维度上下文中的有效概念,而不是用于渲染。但是我认为您仍然可以使用它来实现您的目标。

有一个表 linkbase,旨在帮助呈现实例文档,但我找不到您正在使用的分类法。

这里的诀窍是不要将定义链接库视为一个表。严格来说,它是一个无环有向图,但将其视为以 XBRL超立方体为根的树可能会有所帮助(在您的摘录中称为“us-gaap_StatementTable”,在分类中称为 { http:// fasb.org/us-gaap/2015-01-31}StatementTable)。

树的一个分支通向概念或行项目。另一个分支通向轴;在这种情况下,单个维度 { http://xbrl.sec.gov/dei/2014-01-31 }LegalEntityAxis 具有单个可能的域值 { http://xbrl.sec.gov/dei/2014-01- 31 }实体域。

超立方体不会出现在实例文档中,但它链接到的维度和域会出现。

在实例文档中,您将查找具有这些值的 { http://www.xbrl.org/2003/instance }上下文元素分别作为子项的维度属性和值 { http://xbrl.org/2006/ xbrldi }explicitMember 节点。与此上下文关联的事实将是您所关注的事实(它们将具有与父上下文的id属性相同的contextRef属性)。上下文节点也是您从中获取经期信息的地方。

在没有我帮助的情况下,您发现这里有一个使用抽象元素(us-gaap_OperatingExpensesAbstract、us-gaap_EarningsPerShareAbstract 和 us-gaap_WeightedAverageNumberOfSharesOutstandingAbstract)作为副标题的约定。由于是抽象的,它们不会出现在实例文档中。

请记住,在您包含的定义链接库提取中,“dei_EntityDomain”不指向任何东西;概念指向超立方体,超立方体指向维度,维度指向域。用于表示维度和域的 XML 元素在实例文档中显示为 xbrli:context 元素的子元素。

于 2016-03-19T10:09:20.527 回答
1

我已经从 StatementofIncome 角色的演示链接库创建了表的模型结构。

order   preferredLabel  role    {http://www.w3.org/1999/xlink}arcrole   {http://www.w3.org/1999/xlink}from  roleURI {http://www.w3.org/1999/xlink}to
1   http://www.xbrl.org/2003/role/terseLabel    http://www.apple.com/taxonomy/role/StatementOfIncome    http://www.xbrl.org/2003/arcrole/parent-child   us-gaap_IncomeStatementAbstract aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_StatementTable
1   http://www.xbrl.org/2003/role/terseLabel    http://www.apple.com/taxonomy/role/StatementOfIncome    http://www.xbrl.org/2003/arcrole/parent-child   us-gaap_StatementTable  aapl-20151226.xsd#Role_StatementOfIncome    dei_LegalEntityAxis
1   http://www.xbrl.org/2003/role/terseLabel    http://www.apple.com/taxonomy/role/StatementOfIncome    http://www.xbrl.org/2003/arcrole/parent-child   dei_LegalEntityAxis aapl-20151226.xsd#Role_StatementOfIncome    dei_EntityDomain
100 http://www.xbrl.org/2003/role/terseLabel    http://www.apple.com/taxonomy/role/StatementOfIncome    http://www.xbrl.org/2003/arcrole/parent-child   us-gaap_StatementTable  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_StatementLineItems
1.06    http://www.xbrl.org/2003/role/terseLabel    http://www.apple.com/taxonomy/role/StatementOfIncome    http://www.xbrl.org/2003/arcrole/parent-child   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_SalesRevenueNet
1.07    http://www.xbrl.org/2003/role/terseLabel    http://www.apple.com/taxonomy/role/StatementOfIncome    http://www.xbrl.org/2003/arcrole/parent-child   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_CostOfGoodsAndServicesSold
1.08    http://www.xbrl.org/2003/role/totalLabel    http://www.apple.com/taxonomy/role/StatementOfIncome    http://www.xbrl.org/2003/arcrole/parent-child   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_GrossProfit
1.09    http://www.xbrl.org/2003/role/terseLabel    http://www.apple.com/taxonomy/role/StatementOfIncome    http://www.xbrl.org/2003/arcrole/parent-child   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_OperatingExpensesAbstract
1.01    http://www.xbrl.org/2003/role/terseLabel    http://www.apple.com/taxonomy/role/StatementOfIncome    http://www.xbrl.org/2003/arcrole/parent-child   us-gaap_OperatingExpensesAbstract   aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_ResearchAndDevelopmentExpense
1.02    http://www.xbrl.org/2003/role/terseLabel    http://www.apple.com/taxonomy/role/StatementOfIncome    http://www.xbrl.org/2003/arcrole/parent-child   us-gaap_OperatingExpensesAbstract   aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_SellingGeneralAndAdministrativeExpense
1.03    http://www.xbrl.org/2003/role/totalLabel    http://www.apple.com/taxonomy/role/StatementOfIncome    http://www.xbrl.org/2003/arcrole/parent-child   us-gaap_OperatingExpensesAbstract   aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_OperatingExpenses
1.04    http://www.xbrl.org/2003/role/terseLabel    http://www.apple.com/taxonomy/role/StatementOfIncome    http://www.xbrl.org/2003/arcrole/parent-child   us-gaap_EarningsPerShareAbstract    aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_EarningsPerShareBasic
1.05    http://www.xbrl.org/2003/role/terseLabel    http://www.apple.com/taxonomy/role/StatementOfIncome    http://www.xbrl.org/2003/arcrole/parent-child   us-gaap_EarningsPerShareAbstract    aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_EarningsPerShareDiluted
1.1 http://www.xbrl.org/2003/role/totalLabel    http://www.apple.com/taxonomy/role/StatementOfIncome    http://www.xbrl.org/2003/arcrole/parent-child   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_OperatingIncomeLoss
1.11    http://www.xbrl.org/2003/role/terseLabel    http://www.apple.com/taxonomy/role/StatementOfIncome    http://www.xbrl.org/2003/arcrole/parent-child   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_NonoperatingIncomeExpense
1.12    http://www.xbrl.org/2003/role/totalLabel    http://www.apple.com/taxonomy/role/StatementOfIncome    http://www.xbrl.org/2003/arcrole/parent-child   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest
1.13    http://www.xbrl.org/2003/role/terseLabel    http://www.apple.com/taxonomy/role/StatementOfIncome    http://www.xbrl.org/2003/arcrole/parent-child   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_IncomeTaxExpenseBenefit
1.14    http://www.xbrl.org/2003/role/totalLabel    http://www.apple.com/taxonomy/role/StatementOfIncome    http://www.xbrl.org/2003/arcrole/parent-child   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_NetIncomeLoss
1.15    http://www.xbrl.org/2003/role/terseLabel    http://www.apple.com/taxonomy/role/StatementOfIncome    http://www.xbrl.org/2003/arcrole/parent-child   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_EarningsPerShareAbstract
1.16    http://www.xbrl.org/2003/role/verboseLabel  http://www.apple.com/taxonomy/role/StatementOfIncome    http://www.xbrl.org/2003/arcrole/parent-child   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_WeightedAverageNumberOfSharesOutstandingAbstract
1.17    http://www.xbrl.org/2003/role/terseLabel    http://www.apple.com/taxonomy/role/StatementOfIncome    http://www.xbrl.org/2003/arcrole/parent-child   us-gaap_StatementLineItems  aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_CommonStockDividendsPerShareDeclared
1.19    http://www.xbrl.org/2003/role/terseLabel    http://www.apple.com/taxonomy/role/StatementOfIncome    http://www.xbrl.org/2003/arcrole/parent-child   us-gaap_WeightedAverageNumberOfSharesOutstandingAbstract    aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_WeightedAverageNumberOfSharesOutstandingBasic
1.2 http://www.xbrl.org/2003/role/terseLabel    http://www.apple.com/taxonomy/role/StatementOfIncome    http://www.xbrl.org/2003/arcrole/parent-child   us-gaap_WeightedAverageNumberOfSharesOutstandingAbstract    aapl-20151226.xsd#Role_StatementOfIncome    us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding

首先,我按顺序排序,然后找到包含单词“Abstract”的第一个“from”行。从这里我遍历“链接}到”链接以使用 order 字段创建以下表结构以创建正确的排序:

us-gaap_IncomeStatementAbstract

Statement [Table]                                           us-gaap_StatementTable
    Legal Entity [Axis]                                     dei_LegalEntityAxis
        Entity [Domain]                                     dei_EntityDomain
    Statement [Line Items]                                  us-gaap_StatementLineItems
        Net sales                                           us-gaap_SalesRevenueNet
        Cost of sales                                       us-gaap_CostOfGoodsAndServicesSold
        Gross margin                                        us-gaap_GrossProfit
        Operating expenses:                                 us-gaap_OperatingExpensesAbstract
            Research and development                        us-gaap_ResearchAndDevelopmentExpense
            Selling, general and administrative             us-gaap_SellingGeneralAndAdministrativeExpense
            Total operating expenses                        us-gaap_OperatingExpenses
        Operating income                                    us-gaap_OperatingIncomeLoss
        Other income/(expense), net                         us-gaap_NonoperatingIncomeExpense
        Income before provision for income taxes            us-gaap_IncomeLossFromContinuingOperationsBeforeIn...
        Provision for income taxes                          us-gaap_IncomeTaxExpenseBenefit
        Net income                                          us-gaap_NetIncomeLoss
        Earnings per share:                                 us-gaap_EarningsPerShareAbstract
            Basic                                           us-gaap_EarningsPerShareBasic
            Diluted                                         us-gaap_EarningsPerShareDiluted
        Shares used in computing earnings per share:        us-gaap_WeightedAverageNumberOfSharesOutstandingAb...
            Basic                                           us-gaap_WeightedAverageNumberOfSharesOutstandingBa...
            Diluted                                         us-gaap_WeightedAverageNumberOfDilutedSharesOutsta...
        Cash dividends declared per share                   us-gaap_CommonStockDividendsPerShareDeclared

这看起来与从渲染应用程序创建的模型结构非常相似:

在此处输入图像描述

于 2016-03-31T12:37:42.717 回答