SchemaApi

trait SchemaApi

Purely abstract trait offering a schema API. It offers methods to regard a taxonomy as a collection of schema documents, without any knowledge about XBRL in particular.

Purely abstract trait offering a schema API. It offers methods to regard a taxonomy as a collection of schema documents, without any knowledge about XBRL in particular.

Implementations should make sure that looking up schema content by EName is fast. Lookup up global element declarations by URI must also be fast.

Implementations may be strict or lenient in enforced requirements on the schema. For example, implementations are free to check or ignore that within a "schema" "target" expanded names of global element declarations, type definitions etc. must be unique.

Only methods for querying "global" schema content are offered. The returned objects themselves can be used to query for nested content.

Finder methods for schema root elements and their (expected) children (like global element declarations, named type definitions etc.) are free to stop searching beyond topmost found elements. Hence, in schema-invalid taxonomies, it is possible that these finder methods do not find all elements of the expected type.

Authors

Chris de Vreeze

class Object
trait Matchable
class Any

Value members

Abstract methods

def filterXsdSchemas(p: XsdSchema => Boolean): IndexedSeq[XsdSchema]

Returns schema root elements obeying some predicate. To find certain taxonomy schema elements, the following pattern can be used:

Returns schema root elements obeying some predicate. To find certain taxonomy schema elements, the following pattern can be used:

filterXsdSchemas(p).flatMap(_.filterElemsOrSelfOfType(classTag[E])(pred))
def findAllXsdSchemas: IndexedSeq[XsdSchema]

Returns the schema root elements. To find certain taxonomy schema elements, the following pattern can be used:

Returns the schema root elements. To find certain taxonomy schema elements, the following pattern can be used:

findAllXsdSchemas.flatMap(_.filterElemsOrSelfOfType(classTag[E])(pred))
def findBaseTypeOrSelfUntil(typeEName: EName, p: EName => Boolean): Option[EName]

If the given type obeys the type predicate, returns it, wrapped in an Option. Otherwise, returns the optional base type if that type obeys the type predicate, and so on, until either the predicate holds or no further base type can be found in the taxonomy.

If the given type obeys the type predicate, returns it, wrapped in an Option. Otherwise, returns the optional base type if that type obeys the type predicate, and so on, until either the predicate holds or no further base type can be found in the taxonomy.

def findNamedTypeDefinition(ename: EName): Option[NamedTypeDefinition]
def findNamedTypeOfGlobalElementDeclaration(ename: EName): Option[EName]

Finds the named type of the global element declaration with the given target EName, recursively trying to obtain the type via the substitution group ancestry chain, if needed.

Finds the named type of the global element declaration with the given target EName, recursively trying to obtain the type via the substitution group ancestry chain, if needed.

def findXsdSchema(p: XsdSchema => Boolean): Option[XsdSchema]

Finds an optional schema root element obeying some predicate. To find certain taxonomy schema elements, the following pattern can be used:

Finds an optional schema root element obeying some predicate. To find certain taxonomy schema elements, the following pattern can be used:

findXsdSchema(p).toIndexedSeq.flatMap(_.filterElemsOrSelfOfType(classTag[E])(pred))

Returns the known substitution groups as SubstitutionGroupMap. If the taxonomy is closed under DTS discovery, these substitution groups are found within the taxonomy. Otherwise they may partly be external.

Returns the known substitution groups as SubstitutionGroupMap. If the taxonomy is closed under DTS discovery, these substitution groups are found within the taxonomy. Otherwise they may partly be external.

Implementations should store this as a field, in order to make substitution group lookups as fast as possible.