2014: Posts In Review

The WordPress.com stats helper monkeys prepared a 2014 annual report for the Gepsio blog.

Here’s an excerpt:

A San Francisco cable car holds 60 people. This blog was viewed about 2,600 times in 2014. If it were a cable car, it would take about 43 trips to carry that many people.

Click here to see the complete report.

Advertisements

Redesigning Linkbase Document Support

I recently added support for presentation linkbase documents to the Gepsio code base. As a part of that addition, I added support for presentation linkbase documents appearing as a part of an XbrlSchema class’ LinkbaseDocuments collection. After that addition, that part of the object model looked like this:

XbrlSchema
 List<LinkbaseDocument> LinkbaseDocuments
 LinkbaseDocument
  List<DefinitionLink> DefinitionLinks
  List<CalculationLink> CalculationLinks
  List<LabelLink> LabelLinks
  List<PresentationLink> PresentationLinks // NEW!

In that design, an XbrlSchema object maintained a collection of LinkbaseDocument objects. Each LinkbaseDocument object, in turn, maintained four collections:

  • a collection of definition links
  • a collection of calculation links
  • a collection of label links
  • a collection of presentation links

As I looked at that design, I noticed that it didn’t quite match the way linkbase documents are actually structured in XBRL. The problem is that, in XBRL, a single linkbase document can have only one type of links. In other words, a single linkbase document can contain one of the following:

  • definition links,
  • OR calculation links,
  • OR label links,
  • OR presentation links.

This determination can be made through the value of the xlink:role attribute on a linkbase reference document, as in the following example:

<link:linkbaseRef
 xlink:type="simple"
 xlink:href="aig-20130630_pre.xml"
 xlink:role="http://www.xbrl.org/2003/role/presentationLinkbaseRef"
 xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase"
/>

In the example above, the linkbase reference is known to contain presentation linkbases because the role is http://www.xbrl.org/2003/role/presentationLinkbaseRef, which is used for presentation linkbase references. Gepsio’s linkbase document class design, however, can make it seem as though more than one linkbase type can appear in a document, since it manages four collections of all different types.

LinkbaseDocument
 List<DefinitionLink> DefinitionLinks
 List<CalculationLink> CalculationLinks
 List<LabelLink> LabelLinks
 List<PresentationLink> PresentationLinks

A better design would more accurately reflect the actual usage of a linkbase document. Specifically, it makes more sense to change the existing LinkbaseDocument class, which is currently a standalone class with no base or derived classes, to be a base class of derived classes that represent each of the possible linkbase document types. Each derived linkbase document type would then have a link collection specific to the containing linkbase document type. This would look something like this:

 LinkbaseDocument
 DefinitionLinkbaseDocument, derived from LinkbaseDocument
  List<DefinitionLink> DefinitionLinks
 CalculationLinkbaseDocument, derived from LinkbaseDocument
  List<CalculationLink> CalculationLinks
 LabelLinkbaseDocument, derived from LinkbaseDocument
  List<LabelLink> LabelLinks
 PresentationLinkbaseDocument, derived from LinkbaseDocument
  List<PresentationLink> PresentationLinks

The XbrlSchema object, then would have a reference to each type of linkbase document, which would, in turn, maintain a collection of links found in the document:

 XbrlSchema
  DefinitionLinkbaseDocument
   List<DefinitionLink> DefinitionLinks
  CalculationLinkbaseDocument
   List<CalculationLink> CalculationLinks
  LabelLinkbaseDocument
   List<LabelLink> LabelLinks
  PresentationLinkbaseDocument
   List<PresentationLink> PresentationLinks

Once implemented, this will be a breaking change from previous CTPs.

Gepsio and the Money Tree Investing Podcast

Gepsio made its way onto a list of XBRL APIs as a part of a discussion last month on the Money Tree Investing Podcast. Episode 13 of the podcast was titled “XBRL and Financial Data with Nate Anderson” and features a good discussion of the current landscape of XBRL tools and technologies.

Nate Anderson, the guest for the episode, is an XBRL Enthusiast and Software Developer at KPMG. He started his XBRL career as a “tagger”; he helped Fortune-500 companies navigate the US GAAP taxonomy, map their financial statements to XBRL elements, and create XBRL to meet SEC rules and XBRL US best practices. He maintains a nice XBRL blog, which you can find here.

Thanks go to Nate for including Gepsio in his list of XBRL libraries!