Menu

Completing Networks

Help
Anonymous
2011-01-24
2013-05-02
  • Anonymous

    Anonymous - 2011-01-24

    I'm trying to use the API to gather data from SEC filings.   Most of the Concepts I want to gather are at a high-level, but sometimes only the lower level items are available in the filing.  

    For example in this filing (http://www.sec.gov/Archives/edgar/data/39368/000119312511010956/ful-20101127.xml) the following facts are available:

    NetCashProvidedByUsedInOperatingActivitiesContinuingOperations
    NetCashProvidedByUsedInInvestingActivitiesContinuingOperations
    NetChangeInCashAndCashEquivalentsFromContinuingOperations

    Which are children of the fact I really want which is  'NetCashProvidedByUsedInOperatingActivities'.   But when I use 'getActiveNetworksFrom' for this Concept I get no relationships. 

    What I'd like is to see is that  this concept is missing and be able to use the US-GAAP calculation linkbase to find the children so I can calculate this value from the available concepts.  

    Does anyone know if this can be done and which API calls I would use to fill in the network for concepts which aren't active in the current filing?  Of course if I'm going about this all wrong I'd be happy to hear any advise as well.

    Thanks,
    Jeff

     
  • Anonymous

    Anonymous - 2011-01-24

    Sorry there is a typo in the list of child concepts…   That should be:

    Net Cash Provided by (Used in) Operating Activities, Continuing Operations
    +
    Cash Provided by (Used in) Operating Activities, Discontinued Operations
    =
    Net Cash Provided by (Used in) Operating Activities

     
  • Geoffrey Shuetrim

    What you are asking can be done but it does involve some relatively low-level API functionality.

    You need to begin with networks of relationships between concepts (see the org.xbrlapi.networks package).  Create the network that you require (using the org.xbrlapi.Store interface). That will enable you to analyse the calculation relationships and any other XLink relationships between concepts to determine what calculation substitutes are available for the sought after but missing fact values.  You can then seek the parts of the calculation equation by extracting the necessary facts from the XBRL instance (there are a variety of ways to do this (get all facts in the instance and filter them to determine which have the required local name and namespace for example.  Alternatively you can craft a custom XQuery to get the exact facts you want from the instance and no others.  Perhaps that custom XQuery should be added to the instance interface and/or to the store interface).

    Given the necessary facts, you do need to do context comparisons to ensure that the facts match up in a way that supports the calculation.  I would encourage use of the org.xbrapi.aspects package to do this analysis.  Create a FactSet and then use that to match up facts based upon their aspects.  Use a DImensionalAspectModel to ensure that XDT dimensions are being treated properly.

    Given the matching facts, you can do the appropriate mathematical operations.

    That all looks a bit longwinded right now.  I would be happy to work with you to encapsulate key parts of the process in higher level API features if you have the energy.

    Regards

    Geoff Shuetrim

     
  • Anonymous

    Anonymous - 2011-02-21

    In a nutshell that is what I'm trying to do.   I basically query for the concept I want (within the desired context) and if I don't find it I use 'store.getNetworksFrom(…)' to find the children.  But it seems like even though the children are there this isn't returning any relationships. 

    To summarize when the parent isn't in the instance trying to find its children comes up empty.  But this relationship is in the taxonomy so how do I go about accessing that information?

    private double getValueForFragment(Fragment fragment, PeriodAspectValue pav) throws XBRLException, URISyntaxException
    {
    double sum = 0;
    double order = 0;

    for(Network network: store.getNetworksFrom(fragment.getIndex(), calculation))
    {
    store.augmentNetworkForFragment(fragment, network);
    network.complete();

    for(Relationship relation: network.getActiveRelationshipsFrom(fragment.getIndex()))
    {
    String targetIdx = relation.getTargetIndex();
    Fragment target = network.get(targetIdx);
    double newOrder = relation.getArcOrder();
    if(newOrder > order)
    {
    String weightStr = relation.getArcAttributeValue("weight");
    double weight = Double.parseDouble(weightStr);
    double value = getValue(target, pav);

    sum += (value * weight);
    order = newOrder;

    String sign = weight>0?"+":"-";
    System.out.println("          " + sign + " " + getLabel(target) + " = " + formatter.format(value));

    }
    else
    break;
    }
    }

    return sum;
                }

     

Log in to post a comment.