Packages

  • package root
    Definition Classes
    root
  • package eu
    Definition Classes
    root
  • package cdevreeze
    Definition Classes
    eu
  • package tqa

    Root package of the Taxonomy Query API.

    Root package of the Taxonomy Query API. This package itself contains commonly used data classes and many constants for namespaces and expanded names.

    There are 3 layers in TQA. The lowest layer is the type-safe taxonomy DOM model. It uses yaidom (https://github.com/dvreeze/yaidom) for its "XML dialect support", where the XML dialect is XBRL taxonomy data. It knows only about individual DOM trees.

    On top of the type-safe DOM layer is the relationship layer. It resolves the arcs of the DOM layer as relationships. Of course, to resolve arcs we need other documents as context.

    On top of the relationship layer is the taxonomy query API layer. It uses the underlying layers to offer a query API in which taxonomy elements (such as concept declarations) and relationships can easily be queried.

    It is important to note that higher layers do not abstract away lower layers. Think of the layering more in terms of dependencies. The "taxonomy DOM" layer depends only on yaidom, the relationship layer only depends on the taxonomy DOM layer, and the query API layer depends on both the taxonomy DOM and relationship layers. On the other hand, relationships are indeed abstractions of the underlying XLink arcs and locators/resources.

    These 3 layers are as follows in terms of packages, from low to high:

    Usage

    How do we query XBRL taxonomies with TQA? For some examples, see package eu.cdevreeze.tqa.base.queryapi.

    It should be noted that typical queries involve all 3 packages eu.cdevreeze.tqa.base.queryapi, eu.cdevreeze.tqa.base.relationship and eu.cdevreeze.tqa.base.dom.

    It should also be noted that TQA is deeply rooted in the yaidom XML query API (https://github.com/dvreeze/yaidom). This is true internally and externally. Internally TQA has been built in a bottom-up manner on top of yaidom, and this is in particular visible in the internals of the TQA DOM package. Externally many TQA query methods remind of yaidom query methods, but taking and returning type-safe TQA DOM taxonomy content instead of arbitrary XML content. In other words, knowing yaidom helps in getting to know TQA. Of course, knowing the basics of XBRL taxonomies and XBRL dimensions also helps in getting to know TQA.

    For all TQA queries, it is possible to write an equivalent lower level query, possibly even a low level yaidom query. Doing so may be time-consuming, but it can also be a good learning experience if one intends to use TQA extensively.

    TQA tries to follow the XBRL Core and Dimensions specifications. For example, TQA knows about networks of relationships, XPointer in an XBRL context, embedded linkbases etc.

    TQA feels like an API designed in a bottom-up manner on top of yaidom, and that is indeed what it is. So, although TQA can help in learning more about XBRL taxonomies, it is not an API for users who have no knowledge about XBRL. From the lower level DOM-like operations to the higher level dimensional bulk query methods, TQA is useful only for users who know what data they are looking for in a taxonomy.

    See package eu.cdevreeze.tqa.base.queryapi for some examples, and navigate to the eu.cdevreeze.tqa.base.relationship and eu.cdevreeze.tqa.base.dom packages for specific relationships and type-safe taxonomy DOM content, respectively.

    Backing XML DOM implementations

    TQA is flexible in the DOM implementation used. It is pluggable, as long as it offers a yaidom BackingNodes.Elem facade and we have a eu.cdevreeze.tqa.docbuilder.DocumentBuilder for it.

    Out of the box, 2 backing DOM implementations are available:

    • A yaidom BackingNodes.Elem implementation wrapping Saxon NodeInfo objects, and typically implemented using Saxon tiny trees
    • A yaidom BackingNodes.Elem native implementation using yaidom "indexed" elements

    The Saxon (9.7) wrapper implementation, especially when tiny trees are used under the hood, is efficient in space and time, so it should be preferred for production code. The native yaidom implementation is less efficient, in particular in memory footprint, but it is easy to debug and therefore a nice choice in test code. Whichever the choice of underlying DOM implementation, most code using TQA is completely unaffected by it.

    Definition Classes
    cdevreeze
  • package docbuilder

    Document builders for yaidom BackingNodes.Elem implementations that can be used as underlying element implementation in the TQA taxonomy DOM.

    Document builders for yaidom BackingNodes.Elem implementations that can be used as underlying element implementation in the TQA taxonomy DOM.

    The document builder abstraction must be useful both in the JVM and in JavaScript runtimes.

    Definition Classes
    tqa
  • DocumentBuilder
  • SimpleCatalog

trait DocumentBuilder extends AnyRef

Any builder of a ("backing") document. Typical document builders convert the document URI to a local URI, parse the document using that local URI, and after parsing store the original URI as document URI in the returned document. Some document builders are capable of parsing documents inside ZIP files.

Document builders can be stacked, for example to perform some "post-processing". For example, some taxonomy documents may have a broken link in the schema location attribute, and such a post-processing step can fix that before the document is used to build a type-safe taxonomy DOM tree from it.

Other "decorating" document builders can cache parsed documents, for example.

Note that document builders backed by typical XML parsers are not thread-safe in the JVM!

Note that this document builder abstraction is useful both in the JVM and in JavaScript runtimes.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DocumentBuilder
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract type BackingDoc <: BackingDocumentApi

Abstract Value Members

  1. abstract def build(uri: URI): BackingDoc

    Returns the document that has the given URI as BackingDoc.

    Returns the document that has the given URI as BackingDoc. The URI is typically the canonical, published URI of the document. This URI is also typically stored in the resulting document as document URI. If the document builder uses an XML catalog, the document is typically parsed from a local (mirror) URI.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  16. def toString(): String
    Definition Classes
    AnyRef → Any
  17. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped