A Sphinx 2.0 processor is available as a plug-in. The initial capability is to process Sphinx validation rules, formulas, and report rules, and alternatively to compile a limited subset of Sphinx into XBRL formula linkbase.

Sphinx is a rules creation language by CoreFiling, see http://www.corefiling.com/products/sphinx/index.html.  Arelle provides an independent open source implementation of the Sphinx 2.0 syntax and semantics.  Paul Warren’s blog on Sphinx is at http://blogs.corefiling.com/category/sphinx/.)

To install the plug-in: Help(menu)->Manage plug-ins, Find plug-in modules: Locally. Select plugin\sphinx\__init__.py.

Sphinx rules processing

Sphinx may be loaded by the GUI or Command Line/Web Service, and may be applied to RSS Watch processing of SEC submissions.

Unlike XBRL formula linkbases, Sphinx is not linkbaseRef’ed from a DTS.

  • To load from the GUI, use tools(menu)->import sphinx files (you may multi-select more than one file).
  • To load from the command line or web service, use –import-sphinx=”files or directories”.
  • Multiple files or directories are pipe-separated (“|”).
  • Sphinx is processed in the same manner as XBRL Formula, as part of validation.
  • To apply Sphinx to RSS feed processing, select sphinx file(s) and check off for Sphinx rules.

To debug Sphinx, use these GUI formula options (tools->formula->parameters):

  • variable set trace expression result (expression results),
  • variable set trace expression evaluation (trace each sphinx processing step),
  • variables trace expression result (hypercube results) or
  • variables trace filter winnowing (to see each filtering or where step as it is processed).

From command line, use these corresponding options:

  • –formulaVarSetExprEval
  • –formulaVarSetExprResult
  • –formulaVarExpressionEvaluation
  • –formulaVarFiltersResult
  • –formulaVarFilterWinnowing.

For any support issues, please e-mail to support@arelle.org or enter an issue to http://arelle.atlassian.net; please include any Sphinx and instance/DTS to reproduce reported issues.

(A sample Sphinx file to scan RSS feed SEC filings for common ratios is at: http://archives.arelle.org/2013/03/US-GAAP%20Ratios%20Example.xsr)

Status of this Sphinx implementation is as follows:

  • The Sphinx processor is pretty clean on the examples and tests provided to the developers, but there isn’t yet a test suite like those of XBRL Formulas or Dimensions (e.g., one test case with multiple positive and negative variations per feature in language).
  • This implementation will continue to improve as more examples get tested and more integration of Sphinx into user’s workflow procedures works out differences in logging and messaging between Sphinx implementations.
  • There’s fuzziness about how multiple separate hyperspace expressions combine with each other (the equivalent of implicit filtering in XBRL Formula with covered aspects, under values-set chaining), including the notion that covered aggregational functions force balancing outside expressions to covered aspect’s uncovered defaults (instead of not filtered).  As more test cases are provided, and the definition tightened up, there will be improvements.
  • The procedural nature of Sphinx may make debugging easier than with XBRL Formula, feedback is needed on the debugging trace options now provided.  File and line numbers are provided throughout the trace, making it easy to search for expression evaluations.
  • Optimization is provided for those hyperspace filtering steps only where the equivalents have been optimized in XBRL Formula, primarily filter expressions which are static (or macro-provided statically) in nature (e.g., primary and explicit dimension tests by equality or set membership).  Hyperspace filtering expressions with where clauses (like the use of dependent XPath expressions in XBRL Formula filters) can lead to performance concerns with larger instances.
  • Deduplication has not been implemented yet.  Use cases and test examples are requested.  A definition of consistent duplicates that can be used for the SEC is required (as xml:lang is not an axis aspect, and not a duplicate).
  • Transformation has not been implemented yet.  Additional clarification and test cases cases particularly regarding reference to the transformed concept’s schema definitions and linkbases are needed.

Compile Sphinx to XBRL Formula linkbase

To compile Sphinx rules files into XBRL Formula linkbase files:

  • Interactively from GUI:  Load the set of Sphinx files from Tools(menu)->Compile Sphinx to Formula.  Select sphinx files (multiple).  Second dialog chooses directory in which to save the generated XBRL Formula linkbase files.
  • Command line:  –generate-sphinx-formula-linkbase input-sphinx-files –generated-sphinx-formulas-directory directory-for-output-formula-files

The Sphinx processor compiles and outputs one formula linkbase per sphinx file.  It produces one value assertion per sphinx formula, reporting, or validation rule.  Fact and general variables are used to emulate Sphinx behavior, but only a subset of functionality can be mapped to Formula.

The compiler to Formula is a work-in-progress, because patterns of Sphinx behavior are emulated in Formula where the processing paradigm and fact-filtering behaviors are different.  As more use cases and tests are contributed, the breadth of Sphinx supported by compiled Formula will evolve.

 

Comments are closed.