Oracle® Database XBRL Extension Developer's Guide 11g Release 2 (11.2) Part Number E17070-04 |
|
|
PDF · Mobi · ePub |
This chapter describes the application programming interfaces (APIs) provided by XBRL Extension to Oracle XML DB. It covers these topics:
Several of the examples in this chapter refer to the downloadable demonstration examples. See "Installing the Sample XBRL Repository and GAAP Demo".
Note:
There are two versions of some of the functions described here. The versions have the same name, except that one name has "2" appended to it. The version whose name ends in "2" returns an instance of data type ORAXBRL_CONCEPTLIST
(or ORAXBRL_ITEMLIST
, in the case of multiple_instance_network2
). The version whose name has no "2" appended to it returns an XMLType
instance.
When, for a given parameter, no default value is declared in the signature of a procedure or function, and no default value for that parameter is mentioned in the text, it means that an error is raised if the argument is NULL
.
The XBRL repository storage APIs are in PL/SQL package DBMS_ORAXBRL
. An application can use this package to load, delete, or retrieve XBRL content from an XBRL repository. (Alternatively, you can manipulate XBRL content using WebDAV files and folders.) An application can also use this package to register a taxonomy schema or investigate discoverable taxonomy set (DTS) information.
Note:
The procedures in packageDBMS_ORAXBRL
that load a single document into the XBRL repository have a parameter whose value is an absolute URI that is used as the base location for any relative URIs that are found in the document to be loaded (and in any documents referenced from that document). More precisely, this base location is used to interpret relative URIs that are the values of attributes xlink:href
and schemaLocation
.
It is your responsibility to ensure that the location parameter you use specifies the proper base location for any such relative URIs.
Table 3-1 DBMS_ORAXBRL Repository Storage APIs
Name | Description |
---|---|
Load a set of XBRL files. |
|
Create an object-relational |
|
Delete an auxiliary document from the XBRL repository. |
|
Forcefully (without DTS integrity check) delete all of the taxonomies under the given XBRL repository folder. |
|
Delete an instance document from the XBRL repository. |
|
Delete a linkbase document from the XBRL repository. Raise an error if the linkbase is referenced by other taxonomies or instance documents in the XBRL repository, unless the |
|
Delete a taxonomy, including its schema and linkbases, given the location of the taxonomy schema. Raise an error if the taxonomy is referenced by other taxonomies or instance documents in the XBRL repository, unless the |
|
Drop the |
|
Return a discoverable taxonomy set (DTS), given a starting document. |
|
Return the discoverable taxonomy set (DTS) for a given URI. |
|
Return an auxiliary document that is associated with a document in the XBRL repository. |
|
Return a document that is in the XBRL repository. |
|
Return the XBRL validity of a document in the XBRL repository. |
|
Load an auxiliary document into the XBRL repository. |
|
Load one instance document into the XBRL repository. If the document is present in the repository, replace it. |
|
Load one linkbase into an XBRL repository. If the document is present in the repository, replace it. DTS integrity is not checked after the call. |
|
Load one taxonomy schema into an XBRL repository. If the document is present in the repository, replace it. Discoverable taxonomy set (DTS) integrity is not checked after the call. |
|
Apply a published location (a URL) recursively to all files and folders under the specified Oracle XML DB Repository folder. Invoke this procedure after uploading XBRL documents if you use protocols to upload. |
|
Register one taxonomy schema with the XBRL repository. Invoke this after |
|
Update the validity status of a document and associate an auxiliary document with it. |
|
Check whether all referenced taxonomy schemas and linkbases exist in the XBRL repository. Return the list of taxonomies as an XML document, indicating which are missing. The return value reflects the state of the repository at the time the procedure is invoked. |
The detailed API information is given the following sections.
Upload a set of files. Before invoking this procedure, create a database directory.
PROCEDURE bulkLoadXBRLFiles(operation NUMBER, directory VARCHAR2, filelist VARCHAR2, target VARCHAR2);
Table 3-2 DBMS_ORAXBRL.BULKLOADXBRLFILES Parameters
Parameter | Description |
---|---|
|
Type of operation to be carried out:
Raise an error if |
|
Database directory where the files reside. Raise an error if |
|
XML document listing the file names to be loaded. Raise an error if |
|
Folder location in Oracle XML DB Repository where documents will be uploaded. If |
Note:
If many documents are to be bulk-loaded, consider using multiple sessions so they are loaded in parallel.Create a tuple data table. The table has these columns:
docid
(RAW16
) – An XBRL instance document identifier.
tupledata
(XMLType
stored object-relationally) – Instance data for a tuple element of an XBRL schema.
PROCEDURE createTupleDataTable(schemaLoc VARCHAR2, table_name VARCHAR2, elem_name VARCHAR2);
Does nothing if any of the arguments is NULL
.
Table 3-3 DBMS_ORAXBRL.CREATETUPLEDATATABLE Parameters
Parameter | Description |
---|---|
|
Location in the XBRL repository of the XBRL schema on which the tuple data table will be based. This must be an absolute URI, by which other documents can refer to this taxonomy schema. Do nothing if |
|
Name of the |
|
Name of the tuple element. Do nothing if |
Delete an auxiliary document from the XBRL repository.
PROCEDURE deleteAuxDocument(auxDocPath VARCHAR2);
Forcefully (without DTS integrity check) delete all of the taxonomies under the given XBRL repository folder.
PROCEDURE deleteFolder(folder VARCHAR2);
Table 3-5 DBMS_ORXBRL.DELETEFOLDER Parameters
Parameter | Description |
---|---|
|
XBRL repository folder that contains the taxonomies to be deleted. Raise an error if To delete the root (top-level) folder, use |
Delete an XBRL instance document from the XBRL repository. Delete the tuple instance data from the tuple data table, if present.
PROCEDURE deleteInstance(instanceLoc VARCHAR2);
Delete a linkbase document from the XBRL repository. Raise an error if the linkbase is referenced by other taxonomies or instance documents in the XBRL repository, unless the force
argument is 1
or greater.
PROCEDURE deleteLinkbase(linkbaseLoc VARCHAR2, force PLS_INTEGER DEFAULT 0);
Table 3-7 DBMS_ORAXBRL.DELETELINKBASE Parameters
Parameter | Description |
---|---|
|
The |
|
Raise an error if |
Delete a taxonomy, including the taxonomy schema and linkbases, given the target namespace of the taxonomy schema. Raise an error if the taxonomy is referenced by other taxonomies or instance documents in the XBRL repository, unless argument force
is 1
or greater. If the taxonomy schema was registered, then delete the schema.
PROCEDURE deleteTaxonomy(repopath VARCHAR2, force PLS_INTEGER DEFAULT 0);
Table 3-8 DBMS_ORAXBRL.DELETETAXONOMY Parameters
Parameter | Description |
---|---|
|
Location in the XBRL repository of an XBRL taxonomy schema. This must be an absolute URI, by which other documents can refer to this taxonomy schema. Raise an error if |
|
Raise an error if |
Drop the tuple data for a tuple element.
PROCEDURE dropTupleDataTable(repopath VARCHAR2, table_name VARCHAR2, elem_name VARCHAR2, force IN PLS_INTEGER DEFAULT 0);
Table 3-9 DBMS_ORAXBRL.DROPTUPLEDATATABLE Parameters
Parameter | Description |
---|---|
|
Location in the XBRL repository of an XBRL schema. This must be an absolute URI, by which other documents can refer to this taxonomy schema. Do nothing if |
|
Name of the tuple data table to be dropped. Do nothing if |
|
Name of the tuple element. Do nothing if |
|
If If
|
Return the discoverable taxonomy set (DTS) for a given URI. The first time you invoke this procedure, it builds a cache for the DTS. Subsequent calls simply return the cached result. Also, calculations of the DTS that are implicit in other procedures and queries use the cached result instead of recomputing the DTS. Use of the cache can make network queries run faster.
If a DTS is expected to be large for a given entry URI, then invoke this procedure after loading all documents and before network generation. As a guideline, if a DTS lists more than 100 documents, then it will take at least a second to compute the DTS. For example, for entry URI 'http://xbrl.us/us-gaap-entryPoint-std/2008-03-31'
, the DTS contains 600 entries, so it takes several seconds to compute the list.
PROCEDURE DTS_files(entryURI IN VARCHAR2);
Return the discoverable taxonomy set (DTS) for a given URI. This function behaves similarly to procedure DTS_files
, but:
It always returns the cached result, if found. If not found, it builds (and caches) the DTS.
It returns NULL
instead of raising an error if the argument is NULL
.
FUNCTION DTS_filelist(entryURI IN VARCHAR2) RETURN ORAXBRL_DTSURLLIST;
Return the auxiliary document that is associated with the document that is at a specified XBRL repository location.
FUNCTION getAuxDocForRepopath(repoPath VARCHAR2) RETURN XMLType;
Return the document that is at a specified XBRL repository location.
FUNCTION getDocument(repoPath VARCHAR2) RETURN XMLType;
Return the XBRL validity of a document in the XBRL repository. 1
means the document is valid; 0
means it is invalid.
FUNCTION isDocPathValid(repoPath VARCHAR2) RETURN PLS_INTEGER;
Load an auxiliary document into the XBRL repository at a specified location.
PROCEDURE loadAuxDocument(auxDocPath VARCHAR2, auxiliaryDoc XMLType);
Load one instance document into the XBRL repository. For a top-level tuple element whose taxonomy schema is registered and whose tuple data table has been created, insert the instance tuple data into the tuple data table.
PROCEDURE loadInstance(instanceLoc VARCHAR2, instanceDoc XMLType, valid IN PLS_INTEGER DEFAULT NULL, auxLoc VARCHAR2 DEFAULT NULL);
Table 3-16 DBMS_ORAXBRL.LOADINSTANCE Parameters
Parameter | Description |
---|---|
|
Location in the XBRL repository of instance document Any relative URIs used as the value of attribute |
|
XBRL instance document. Raise an error if |
|
Validity of document |
|
XBRL repository location of an XBRL auxiliary document that is mapped to |
Load one XBRL linkbase into the XBRL repository. DTS integrity is not checked after the call.
PROCEDURE loadLinkbase(linkbaseLoc VARCHAR2, linkbaseDoc XMLType, valid IN PLS_INTEGER DEFAULT NULL, auxLoc VARCHAR2 DEFAULT NULL);
Table 3-17 DBMS_ORAXBRL.LOADLINKBASE Parameters
Parameter | Description |
---|---|
|
Location in the XBRL repository of linkbase document Any relative URIs used as the value of attribute |
|
XBRL linkbase document. Raise an error if |
|
Validity of document |
|
XBRL repository location of an XBRL auxiliary document that is mapped to |
Load one taxonomy schema into an XBRL repository. DTS integrity is not checked after the call.
PROCEDURE loadSchema(schemaLoc VARCHAR2, schemaDoc XMLType, valid IN PLS_INTEGER DEFAULT NULL, auxLoc VARCHAR2 DEFAULT NULL);
Table 3-18 DBMS_ORAXBRL.LOADSCHEMA Parameters
Parameter | Description |
---|---|
|
Location in the XBRL repository of schema document Any relative URIs used as the values of attributes |
|
XBRL schema document. Raise an error if |
|
Validity of document |
|
XBRL repository location of an XBRL auxiliary document that is mapped to |
Map an Oracle XML DB Repository path to an HTTP URL. This applies a published location (a URL) recursively to all files and folders under the specified Oracle XML DB Repository folder.
Each repository path starts with /XBRL/
followed by a user name. These top two levels of the path are, in effect, replaced by the URL that you provide as the published location.
For example, if a document is loaded into the XBRL repository at path /XBRL/some-user/us-gaap/1.0/elts/us-gaap-std-2008-03-31.xsd
, and you invoke mapPublishedLocation('/XBRL/some-user/us-gaap', 'http://xbrl.us'
) , then the file is published at http://xbrl.us/ us-gaap/1.0/elts/us-gaap-std-2008-03-31.xsd
.
You can optionally exclude all repository documents below a given level from being published. They are then ignored for XBRL purposes; in particular, they are not available for discovery. You do this be specifying the optional parameter levels
. Documents at a depth greater than levels
below folderpath are ignored.
Invoke this procedure after you use protocols to upload XBRL documents.
PROCEDURE mapPublishedLocation (folderpath VARCHAR2, publishedLocation VARCHAR2, levels PLS_INTEGER);
Table 3-19 DBMS_ORAXBRL.MAPPUBLISHEDLOCATION Parameters
Parameter | Description |
---|---|
|
XBRL repository folder to be mapped to |
|
URL to be mapped to |
|
Number of levels below |
Register one taxonomy schema with the XBRL repository. Invoke this after calling loadSchema
. Needed for any schema that has tuple elements.
PROCEDURE registerTaxonomySchema(schemaLoc VARCHAR2, annotation XMLType DEFAULT NULL, force IN PLS_INTEGER DEFAULT 0);
Note:
Before invokingregisterTaxonomySchema
for the first time, you must run the script xbrlregschema.sql
to register the standard XBRL schemas. See "XBRLScripts".Table 3-20 DBMS_ORAXBRL.REGISTERTAXONOMYSCHEMA Parameters
Parameter | Description |
---|---|
|
Location in the XBRL repository of the XBRL schema to be registered. This must be an absolute URI, by which other documents can refer to this taxonomy schema. Raise an error if |
|
List of XBRL tuple elements, with their names and default table names. During registration, create the table with the specified default name for storing the XBRL tuple data. Do not create the table if |
|
|
Example 3-1 shows the XML format for parameter annotation
.
Update the validity status of a document and associate an auxiliary document with it. Use this procedure after validation. (To update the auxiliary document, use procedure loadAuxDocument
.)
PROCEDURE updateDocValidity(xbrlLoc VARCHAR2, valid PLS_INTEGER DEFAULT NULL, auxDocPath VARCHAR2 DEFAULT NULL);
Table 3-21 DBMS_ORAXBRL.UPDATEDOCVALIDITY Parameters
Parameter | Description |
---|---|
|
Location in the XBRL repository of the document whose validity is being updated. |
|
New validation status of the document at location |
|
Location in the XBRL repository of the auxiliary document to associate with the document at location |
Check whether all referenced taxonomy schemas and linkbases exist in the XBRL repository. Return the list of taxonomies as an XML document, indicating which taxonomies are missing. Reflects the state the XBRL repository at the time the procedure is invoked.
FUNCTION validateDTSIntegrity(entryURI VARCHAR2) RETURN XMLType; FUNCTION validateDTSIntegrity2(entryURI VARCHAR2) RETURN ORAXBRL_CONCEPTLIST;
Table 3-22 DBMS_ORAXBRL.VALIDATEDTSINTEGRITY Parameters
Parameter | Description |
---|---|
|
The entry URI into a taxonomy. Raise an error if |
Return an XML document that contains the locations of the documents in the discoverable taxonomy set (DTS) and an indication of whether that XML document is in XBRL repository. Example 3-2 illustrates this.
Example 3-2 validateDTSIntegrity
SELECT DBMS_ORAXBRL.validateDTSIntegrity(' http://xbrl.boa.com/2006-12-31')
FROM DUAL;
<DiscoverSet>
<DocumentPath InRepository="True">boa-20061231.xsd< /DocumentPath>
<DocumentPath InRepository="True">
http://xbrl.us/us-gaap/1.0/elts/us-gaap-std-2008-03-31.xsd</DocumentPath>
<DocumentPath InRepository="True" >
http://xbrl.us/us-gaap/1.0/elts/us-types-2008-03-31.xsd</DocumentPath>
<DocumentPath InRepository="True" >
http://xbrl.us/us-gaap/1.0/elts/us-types-2008-03-31.xsd</DocumentPath>
<DocumentPath InRepository="False" > boa-20061231_pre.xml</DocumentPath>
<DocumentPath InRepository="True" > boa-20061231_cal.xml</DocumentPath>
. . .
</DiscoverSet>
You can query the XBRL content in an XBRL repository directly, using the XQuery language. XBRL Extension to Oracle XML DB also provides the following:
Relational (third normal form) views over XBRL content, for relational queryability – see "XBRL Relational Representation"
Network generation APIs, to reconstruct XBRL networks – see "Instance Network Functions: DBMS_ORAXBRLI" and "Instance Network Functions: DBMS_ORAXBRLI"
Transforming procedures, to construct derived views – see "Transforming Procedures: DBMS_ORAXBRLV"
XBRL Extension to Oracle XML DB provides relational views of your XBRL content. This XBRL relational representation is a third normal form data model. It gives you simple access to attributes of schemas, linkbases, targets of linkbases, and items in an instance document. You can query these views directly, or you can create derived views over them to extract a particular representation (see steps 3 and 5, "Building and Using a Sample XBRL Application: USGAAP 2008").
Table 3-23 Relational Views of XBRL Content
Type | Name | Description |
---|---|---|
Schema |
Target namespace used in an XBRL schema document. |
|
Namespaces referenced by an XBRL schema document. |
||
Schemas imported by an XBRL schema document. |
||
Linkbases referenced by an XBRL schema document |
||
|
||
|
||
Elements used in an XBRL taxonomy. |
||
Element groups used in and XBRL taxonomy. |
||
Complex types defined in an XBRL taxonomy. |
||
Linkbase |
Presentation arcs defined in an XBRL taxonomy. |
|
Calculation arcs defined in an XBRL taxonomy. |
||
Definition arcs defined in an XBRL taxonomy. |
||
|
Label arcs defined in an XBRL taxonomy. |
|
Reference arcs defined in an XBRL taxonomy. |
||
Instance |
XBRL schemas referenced by an XBRL instance document. |
|
Linkbases referenced by anXBRL instance document. |
||
Role references from an XBRL instance document. |
||
|
||
Namespaces used in an XBRL instance document. |
||
Unit definitions in an XBRL instance document. |
||
Context definitions in an XBRL instance document. |
||
Footnotes defined in an XBRL instance document. |
||
Explicit dimensional attributes defined in the segment part of an XBRL instance document. |
||
Explicit dimensional attributes defined in the scenario part of an XBRL instance document. |
||
Typed dimensional attributes defined in the segment part of an XBRL instance document. |
||
Typed dimensional attributes defined in the scenario part of an XBRL instance document. |
||
Fact values reported in an XBRL instance document. |
The instance network functions are part of PL/SQL package DBMS_ORAXBRLI
. You can use these functions to generate XBRL reports that combine taxonomy and instance data.
There are essentially two versions of each function. The version whose name ends in "2" returns an instance of data type ORAXBRL_CONCEPTLIST
(or ORAXBRL_ITEMLIST
, in the case of multiple_instance_network2
). The version whose name has no "2" appended to it returns an XMLType
instance.
Table 3-24 Instance Network Functions: DBMS_ORAXBRLI
Function | Description |
---|---|
Return reported data, organized by a base set of concept-concept relationships, such as a presentation tree. |
|
Return reported data across multiple instance documents, organized by a base set of concept-concept relationships, such as a presentation tree. |
Return reported data, organized by a base set of concept-concept relationships, such as a presentation tree.
FUNCTION instance_network (entryURI VARCHAR2, entity VARCHAR2, periodstart DATE, periodend DATE, network_eLinkRoleURI VARCHAR2, network_arcNSURI VARCHAR2, network_arcLocalName VARCHAR2, network_arcRoleURI VARCHAR2, label_eLinkRoleURI VARCHAR2, label_arcRoleURI VARCHAR2, label_roleURI VARCHAR2, lang VARCHAR2, includeReference PLS_INTEGER) RETURN XMLType;Foot 1
Table 3-25 DBMS_ORAXBRLI.INSTANCENETWORK Parameters
Parameter | Description |
---|---|
|
Entry URI into the taxonomy. Raise an error if |
|
Entity identifier. Raise an error if |
|
Starting period. Raise an error if |
|
Ending period. Raise an error if |
|
Base set extended link role ( Default ( |
|
Base set namespace URI. Default ( |
|
Base set local name. Default ( |
|
Base set resource arc role ( Default ( |
|
Label extended link role ( Default ( |
|
Label resource arc role ( Default ( |
|
Label role ( Default ( |
|
Language ( Default ( |
|
Ignored. |
Return reported data across multiple instance documents, organized by a base set of concept-concept relationships, such as a presentation tree.
FUNCTION multiple_instance_network(entryURI VARCHAR2, entityList VARCHAR2, periodstart DATE, periodend DATE, network_eLinkRoleURI VARCHAR2, network_arcNSURI VARCHAR2, network_arcLocalName VARCHAR2, network_arcRoleURI VARCHAR2, label_eLinkRoleURI VARCHAR2, label_arcRoleURI VARCHAR2, label_roleURI VARCHAR2, lang VARCHAR2, includeReference PLS_INTEGER) RETURN XMLType;Foot 2
Table 3-26 DBMS_ORAXBRI.MULTIPLE_INSTANCE_NETWORK Parameters
Parameter | Description |
---|---|
|
Entry URI into the taxonomy. Raise an error if |
|
A comma-delimited list of entities: |
|
The starting period. Raise an error if |
|
The ending period. Raise an error if |
|
Base set extended link role ( Default ( |
|
Base set namespace URI. Default ( |
|
Base set local name. Default ( |
|
Base set resource arc role ( Default ( |
|
Label extended link role ( Default ( |
|
Label resource arc role ( Default ( |
|
Label role ( Default ( |
|
Language ( Default ( |
|
Ignored. |
The concept network functions are part of PL/SQL package DBMS_ORAXBRLT
. They generate XBRL taxonomy hierarchies. There are essentially two versions of each function. The version whose name ends in "2" returns an instance of data type ORAXBRL_CONCEPTLIST
. The version whose name has no "2" appended to it returns an XMLType
instance.
Table 3-27 Concept Network Functions: DBMS_ORAXBRLT
Function | Description |
---|---|
Return the root nodes that correspond to a given DTS, entry URI, and XLink role. |
|
Return the concepts that are the descendents of a particular node in a base set tree, with labels. If no entry URI is specified, then return all concepts with the specified XLink role. |
|
Return a view of a base set of concept-concept relationships, such as a presentation tree. |
Return a view of a base set of concept-concept relationships, such as a presentation tree.
FUNCTION concepts_network(entryURI VARCHAR2, network_linkRoleURI VARCHAR2, network_arcNSURI VARCHAR2, network_arcLocalName VARCHAR2, network_arcRoleURI VARCHAR2, labeleLinkRoleURI VARCHAR2, labelarcRoleURI VARCHAR2, label_roleURI VARCHAR2, lang VARCHAR2, includeReference PLS_INTEGER) RETURN XMLType;Foot 3
Table 3-28 DBMS_ORAXBRLT.CONCEPTS_NETWORK Parameters
Parameter | Description |
---|---|
|
Entry URI into a taxonomy. Raise an error if |
|
Base set extended link role ( Default ( |
|
Base set namespace URI. Default ( |
|
Base set local name. Default ( |
|
Base set resource arc role ( Default ( |
|
Label extended link role ( Default ( |
|
Label resource arc role ( Default ( |
|
Label role ( Default ( |
|
Language ( Default ( |
|
Ignored. |
Return the root nodes that correspond to a given DTS, entry URI, and XLink role.
FUNCTION concept_roots(entryURI VARCHAR2, network_eLinkRoleURI VARCHAR2(200), network_arcNSURI VARCHAR2(200), network_arcLocalName VARCHAR2(200), network_arcRoleURI VARCHAR2(200), label_eLinkRoleURI VARCHAR2(200), label_arcRoleURI VARCHAR2(200), label_roleURI VARCHAR2(200), lang VARCHAR2(200), includeReference PLS_INTEGER) RETURN XMLType;Foot 4
Table 3-29 DBMS_ORAXBRLT.CONCEPT_ROOTS Parameters
Parameter | Description |
---|---|
|
Entry URI for a taxonomy. Raise an error if |
|
Base set extended link role ( Default ( |
|
Base set namespace URI. Default ( |
|
Base set local name. Default ( |
|
Base set resource arc role ( Default ( |
|
Label extended link role ( Default ( |
|
Label resource arc role ( Default ( |
|
Label role ( Default ( |
|
Language ( Default ( |
|
Ignored. |
Return the concepts that are descendents of a particular node in a base set tree, with labels. If no entry URI is specified, then return all concepts.
FUNCTION concepts_in_tree(entry VARCHAR2, concept_namespaceURI VARCHAR2, concept_name VARCHAR2, network_eLinkRoleURI VARCHAR2, network_arcNSURI VARCHAR2, network_arcLocalName VARCHAR2, network_arcRoleURI VARCHAR2, label_eLinkRoleURI VARCHAR2, label_arcRoleURI VARCHAR2, label_roleURI VARCHAR2, lang VARCHAR2, includeReference PLS_INTEGER) RETURN XMLTYPE;Foot 5
Table 3-30 ORAXBRLT.CONCEPTS_IN_TREE Parameters
Parameter | Description |
---|---|
|
Entry into a taxonomy. Raise an error if |
|
Concept namespace URI. Raise an error if |
|
Concept name. Raise an error if |
|
Base set extended link role ( Default ( |
|
Base set namespace URI. Default ( |
|
Base set local name. Default ( |
|
Base set resource arc role ( Default ( |
|
Label extended link role ( Default ( |
|
Label resource arc role ( Default ( |
|
Label role ( Default ( |
|
Language ( Default ( |
|
Ignored. |
Transforming procedures are used to generate derived views that are based on one of the following:
The XBRL relational representation
The network generation APIs
Dimensional information
The transforming procedures are in PL/SQL package DBMS_ORAXBRLV
.
Table 3-31 Transforming Procedures
Procedure | Description |
---|---|
Create a fact table as a view. |
|
Search the hypercube network of the given primary item to find valid dimensions. Create a star schema, which is a fact table plus dimension tables. Optionally create a join view between the fact table and the dimension tables. |
|
Search for primary items that include the given hypercube. Create a super fact table and dimension tables. Optionally create a join view between the super fact table and the dimension tables. |
|
Search the hypercube network of the given primary item to find valid dimensions. Create a star schema, which is a fact table plus dimension tables. Optionally create a join view between the fact table and the dimension tables. Optionally cache the names of the created tables. |
|
Search for primary items that include the given hypercube. Create a super fact table and dimension tables. Optionally create a join view between the super fact table and the dimension tables. Optionally cache the names of the created tables. |
|
Create a super fact table as a view. |
|
Create a relational view for PL/SQL function |
|
Create a relational view for PL/SQL functions |
|
Create a relational view for PL/SQL functions |
|
Drop a star schema: the fact table or super fact table, dimension tables, and join view (if any) that are identified by a given |
Create a fact table as a view.
Note:
ProcedurecreateFactTable
is deprecated as of XBRL Extension to Oracle XML DB 11g Release 2 (11.2.0.2.1).PROCEDURE createFactTable(tableName VARCHAR2, entity VARCHAR2, entryURI VARCHAR2, conceptNamespaceURI VARCHAR2, conceptLocalName VARCHAR2);
Table 3-32 DBMS_ORAXBRLV.CREATEFACTTABLE Parameters
Parameter | Description |
---|---|
|
Name of the fact-table view. Raise an error if |
|
Entity identifier. Raise an error if |
|
Entry URI into the taxonomy. Raise an error if It must be the target namespace of the schema specified in element |
|
URI for the concept namespace. Raise an error if |
|
Local name of the concept. Raise an error if |
createFactTable('SALES', 'SAMP', 'http://www.SampleCompany.com/Company', 'http://www.example.com/Patterns/Sales', 'Sales');
This creates the fact-table view SALES
. See Example 3-5.
Search the hypercube network of a given primary item to find valid dimensions. Create a star schema, which is a fact table plus dimension tables. If argument tableName
is not NULL
then also create a join view between the fact table and the dimension tables. The pair (entity
, entryURI
) uniquely identifies an XBRL instance document.
PROCEDURE createHyperCubeFactTable(tableName VARCHAR2, entity VARCHAR2, entryURI VARCHAR2, conceptNamespaceURI VARCHAR2, conceptLocalName VARCHAR2, xlinkRole VARCHAR2);
For a factFoot 6 name to be usable as parameter conceptLocalName
, the fact should have associated dimension information. Search instance documents for occurrences of a fact you are interested in. If you find that the fact is associated with dimension information then it is a candidate for use with procedure createHyperCubeFactTable
.
Table 3-33 DBMS_ORAXBRLV.CREATEHYPERCUBEFACTTABLE Parameters
Parameter | Description |
---|---|
|
If Otherwise, create a fact table, dimension tables, and a join (as a view named |
|
Entity identifier. Raise an error if |
|
Entry URI into a taxonomy. The target namespace of the schema that is specified in element |
|
Concept namespace URI. Raise an error if |
|
Concept local name. Raise an error if |
|
Extended link role ( |
createHyperCubeFactTable(t, e, u, cnu, cln, xr)
is equivalent to createStarSchemaFromFact(t, e, u, cnu, cln, xr,
1
, 0)
, if t
is not NULL
.
createHyperCubeFactTable(NULL, e, u, cnu, cln, xr)
is equivalent to createStarSchemaFromFact(
'DUMMY'
, e, u, cnu, cln, xr,
0
, 0)
.
Example 3-4 createHyperCubeFactTable
createHyperCubeFactTable('SALES_DIM', 'SAMP', 'http://www.SampleCompany.com/Company', 'http://www.example.com/Patterns/Sales', 'Sales', 'http://www.SampleCompany.com/PrimaryConcepts');
This creates fact table user
_SALES
, dimension tables user
_BYPRODUCTPLACEHOLDER
and user
_BYREGIONPLACEHOLDER
, and view SALES_DIM
, where user
is the database user logged in when createHyperCubeFactTable
is invoked. These tables are shown in Example 3-5, Example 3-6, and Example 3-7.
Example 3-5 Fact Table user_SALES
Name Null? Type ----------------------------------------- -------- --------------------- CONTEXT_ID VARCHAR2(2048) COMPANY_NAME VARCHAR2(4000) START_DATE DATE END_DATE DATE INSTANT_DATE DATE VALUE CLOB
Example 3-6 Dimension Tables user_BYPRODUCTPLACEHOLDER and user_BYREGIONPLACEHOLDER
Name Null? Type ----------------------------------------- -------- --------------------- CONTEXT_ID VARCHAR2(4000) DOMAIN_VALUE VARCHAR2(4000)
Column CONTEXT_ID
is the primary key for the dimension table, and column DOMAIN_VALUE
contains the value of the dimension domain members.
Search for primary items that include the given hypercube. Create a super fact table and dimension tables. If argument tableName
is not NULL
then also create a join view between the super fact table and the dimension tables.
A super fact table can contain more than one kind of fact. It acts like a collection of fact tables that each contain one kind of fact. It contains all of the primary items associated with a given hyper cube.
PROCEDURE createHyperCubeSuperFactTable(tableName VARCHAR2, entity VARCHAR2, entryURI VARCHAR2, HCNamespaceURI VARCHAR2, HCLocalName VARCHAR2, HCXlinkRole VARCHAR2, HCContextElement VARCHAR2, HCTargetRole VARCHAR2);
Table 3-34 DBMS_ORAXBRLV.CREATEHYPERCUBESUPERFACTTABLE Parameters
Parameter | Description |
---|---|
|
If Otherwise, create a fact table, dimension tables, and a join (as a view named |
|
Entity identifier. Raise an error if |
|
Entry URI into the taxonomy. Raise an error if It must be the target namespace of the schema specified in element |
|
Namespace URI of the hypercube. Raise an error if |
|
Local name of the hypercube. Raise an error if |
|
XLink role ( |
|
Value of attribute |
|
Value of attribute |
createHyperCubeSuperFactTable(t, e, u, nu, ln, xr, ce, tr)
is equivalent to createStarSchemaFromHC(t, e, u, nu, ln, xr, ce, tr,
1
, 0)
, if t
is not NULL
.
createHyperCubeSuperFactTable(NULL, e, u, nu, ln, xr, ce tr)
is equivalent to createStarSchemaFromHC(
'DUMMY'
, e, u, nu, ln, xr, ce, tr,
0
, 0)
.
Example 3-8 createHyperCubeSuperFactTable
createHyperCubeSuperFactTable( 'BOA_STATEMENT', '0000070858', 'http://xbrl.boa.com/2006-12-31', 'http://xbrl.us/us-gaap/2008-03-31', 'StatementTable', 'http://xbrl.boa.com/2006-12-31/ext/StockholdersEquity', 'segment', 'http://xbrl.boa.com/2006-12-31/ext/StockholdersEquity');
This creates fact table user
_STATEMENTTABLE
, dimension table user
_EQUITYCOMPONENTSAXIS
, and join view BOA_STATEMENT
, where user
is the database user logged in when createHyperCubeSuperFactTable
is invoked. These tables and view are shown in Example 3-9, Example 3-10, and Example 3-11.
Example 3-9 Fact Table user_STATEMENTTABLE
Name Null? Type ----------------------------------------- -------- --------------------- ITEM_NAME VARCHAR2(4000) CONTEXT_ID VARCHAR2(2048) COMPANY_NAME VARCHAR2(4000) START_DATE DATE END_DATE DATE INSTANT_DATE DATE VALUE CLOB
Search the hypercube network of the primary item to find valid dimensions. Create a star schema, which is a fact table plus dimension tables. Optionally create a join view between the fact table and the dimension tables. Optionally cache the names of the created tables. Return a list of the names of the created tables.
FUNCTION createStarSchemaFromFact(tableName VARCHAR2, entity VARCHAR2, entryURI VARCHAR2, conceptNamespaceURI VARCHAR2, conceptLocalName VARCHAR2, xlinkRole VARCHAR2, createJoin PLS_INTEGER DEFAULT 1, cache PLS_INTEGER DEFAULT 0) RETURN ORAXBRL_STARSCHEMA;
Together, entity
plus entryURI
uniquely identify an XBRL instance document.
Table 3-35 DBMS_ORAXBRLV.CREATESTARSCHEMAFROMFACT Parameters
Parameter | Description |
---|---|
|
Unique identifier for the set comprising the created fact table and dimension tables. If If If If neither |
|
Entity identifier. Raise an error if |
|
Entry URI into a taxonomy. The target namespace of the schema that is specified in element |
|
Concept namespace URI. Raise an error if |
|
Concept local name. Raise an error if |
|
Extended link role ( |
|
If and only if |
|
If and only if |
The fact table created is named F_
entity
_
conceptLocalName
_
####
, where entity
and conceptLocalName
are the entity and concept local name inputs, and ####
is a four-digit (decimal) number guaranteed to make the name unique.
The dimension tables created are named D_
entity
_
dimensionLocalName
_
####
, where entity
is the entity input, dimensionLocalName
is the local name of the valid dimension found in the hypercube network given the primary item, and ####
is a four-digit (decimal) number guaranteed to make the name unique.
Database table names are limited to a maximum of 30 characters. The concept and dimension local names are truncated as needed to ensure this.
Search for primary items that include the given hypercube. Create a super fact table and dimension tables. Optionally create a join view between the super fact table and the dimension tables. Optionally cache the names of the created tables. Return a list of the names of the created tables.
FUNCTION createStarSchemaFromHC(tableName VARCHAR2, entity VARCHAR2, entryURI VARCHAR2, HCNamespaceURI VARCHAR2, HCLocalName VARCHAR2, HCxlinkRole VARCHAR2, createJoin PLS_INTEGER DEFAULT 1, cache PLS_INTEGER DEFAULT 0) RETURN ORAXBRL_STARSCHEMA;
Together, entity
plus entryURI
uniquely identify an XBRL instance document.
Table 3-36 DBMS_ORAXBRLV.CREATESTARSCHEMAFROMHC Parameters
Parameter | Description |
---|---|
|
Unique identifier for the set comprising the created super fact table and dimension tables. If If If If neither |
|
Entity identifier. Raise an error if |
|
Entry URI into a taxonomy. The target namespace of the schema that is specified in element |
|
Namespace URI of the hypercube. Raise an error if |
|
Local name of the hypercube. Raise an error if |
|
XLink role ( |
|
Value of attribute |
|
Value of attribute |
|
If and only if |
|
If and only if |
The created fact table and dimension tables are named using the same convention as for createStarSchemaFromFact.
Create a super fact table as a view. It contains all of the primary items of the specified hypercube.
Note:
ProcedurecreateSuperFactTable
is deprecated as of XBRL Extension to Oracle XML DB 11g Release 2 (11.2.0.2.1).PROCEDURE createSuperFactTable(tableName VARCHAR2, entity VARCHAR2, entryURI VARCHAR2, hcNamespaceURI VARCHAR2, hcLocalName VARCHAR2, hcXlinkRole VARCHAR2, hcContextElement VARCHAR2, hcTargetRole VARCHAR2);
Table 3-37 DBMS_ORAXBRLV.CREATESUPERFACTTABLE Parameters
Parameter | Description |
---|---|
|
Name of the super fact-table view. Raise an error if |
|
Entity identifier. Raise an error if |
|
Entry URI into the taxonomy. Raise an error if It must be the target namespace of the schema specified in element |
|
URI for the hypercube namespace. Raise an error if |
|
Local name of the hypercube. Raise an error if |
|
Extended link role ( |
|
Value of attribute |
|
Value of attribute |
Example 3-12 createSuperFactTable
createSuperFactTable('STATEMENT', '0000070858', 'http://xbrl.boa.com/2006-12-31', 'http://xbrl.us/us-gaap/2008-03-31', 'StatementTable', 'http://xbrl.boa.com/2006-12-31/ext/StockholdersEquity', 'segment', 'http://xbrl.boa.com/2006-12-31/ext/StockholdersEquity');
This creates super fact-table view STATEMENT
. See Example 3-9.
Create a relational view for PL/SQL function concept_roots
.
PROCEDURE createViewForConceptRoots(viewName VARCHAR2, entryURI VARCHAR2, network_eLinkRoleURI VARCHAR2, network_arcNSURI VARCHAR2, network_arcLocalName VARCHAR2, network_arcRoleURI VARCHAR2, labeleLinkRoleURI VARCHAR2, labelarcRoleURI VARCHAR2, label_roleURI VARCHAR2, lang VARCHAR2);
Table 3-38 DBMS_ORAXBRLV.CREATEVIEWFORCONCEPTROOTS Parameters
Parameter | Description |
---|---|
|
Name of the view. Raise an error if |
|
Entry into a taxonomy. Raise an error if |
|
Base set extended link role ( Default ( |
|
Base set namespace URI. Default ( |
|
Base set local name. Default ( |
|
Base set resource arc role ( Default ( |
|
Label extended link role ( Default ( |
|
Label resource arc role ( Default ( |
|
Label role ( Default ( |
|
Language ( Default ( |
Create a relational view for PL/SQL functions concepts_network
and concepts_in_tree
.
PROCEDURE createViewForConceptTree(viewName VARCHAR2, entryURI VARCHAR2, concept_namespaceURI VARCHAR2, concept_name VARCHAR2, network_eLinkRoleURI VARCHAR2, network_arcNSURI VARCHAR2, network_arcLocalName VARCHAR2, network_arcRoleURI VARCHAR2, labeleLinkRoleURI VARCHAR2, labelarcRoleURI VARCHAR2, label_roleURI VARCHAR2, lang VARCHAR2, treeDepth PLS_INTEGER);
Table 3-39 DBMS_ORAXBRLV.CREATEVIEWFORCONCEPTTREE Parameters
Parameter | Description |
---|---|
|
Name of the view. Raise an error if |
|
Entry into a taxonomy. Raise an error if |
|
Concept namespace URI. Raise an error if |
|
Concept name. By default ( |
|
Base set extended link role ( Default ( |
|
Base set namespace URI. Default ( |
|
Base set local name. Default ( |
|
Base set resource arc role ( Default ( |
|
Label extended link role ( Default ( |
|
Label resource arc role ( Default ( |
|
Label Role ( Default ( |
|
Language ( Default ( |
|
If |
Example 3-14 createViewForConceptTree
createViewForConceptTree( 'my_network', 'http://xbrl.us/us-gaap-entryPoint-std/2008-03-31', 'http://xbrl.us/us-gaap/2008-03-31', 'NetIncomeLossAbstract', 'http://xbrl.us/us-gaap/role/statement/StatementOfIncome', NULL, 'presentationArc', 'http://www.xbrl.org/2003/arcrole/parent-child', NULL, NULL, NULL, 'en-US', -1);
This creates view my_network
:
Name Null? Type ----------------------------------------- -------- --------------------- NAMESPACEURI VARCHAR2(4000) PREFERREDPREFIX VARCHAR2(4000) NAME VARCHAR2(4000) ID VARCHAR2(4000) BALANCE VARCHAR2(4000) PERIODTYPE VARCHAR2(4000) ABSTRACT VARCHAR2(4000) NILLABLE VARCHAR2(4000) TYPEURI VARCHAR2(4000) TYPELOCALNAME VARCHAR2(4000) SGURI VARCHAR2(4000) SGLOCALNAME VARCHAR2(4000) ELEM_HREF VARCHAR2(4000) LABEL VARCHAR2(4000) PREFERRED_LABEL VARCHAR2(4000)
Create a relational view for PL/SQL functions instance_network
and multiple_instance_network
.
PROCEDURE createViewForInstanceNetwork(viewName VARCHAR2, entryURI VARCHAR2, entityList VARCHAR2, startDate DATE, endDate DATE, network_eLinkRoleURI VARCHAR2, network_arcNSURI VARCHAR2, network_arcLocalName VARCHAR2, network_arcRoleURI VARCHAR2, labeleLinkRoleURI VARCHAR2, labelarcRoleURI VARCHAR2, label_roleURI VARCHAR2, lang VARCHAR2);
Table 3-40 DBMS_ORAXBRLV.CREATEVIEWFORINSTANCENETWORK Parameters
Parameter | Description |
---|---|
|
Name of the view. Raise an error if |
|
Entry URI to the taxonomy. Raise an error if |
|
A comma-delimited list of entities: If there is only one entity, it is equivalent to function |
|
Starting period. Raise an error if |
|
Ending period. Raise an error if |
|
Base set extended link role ( Default ( |
|
Base set namespace URI. Default ( |
|
Base set local name. Default ( |
|
Base set resource arc role ( Default ( |
|
Label extended link role ( Default ( |
|
Label resource arc role ( Default ( |
|
Label role ( Default ( |
|
Language ( Default ( |
Example 3-15 createViewForInstanceNetwork
createViewForInstanceNetwork( 'my_instance_network', 'http://xbrl.boa.com/2006-12-31', '0000070858', 1-JAN-05', '01-JAN-06', 'http://xbrl.boa.com/2006-12-31/ext/IncomeStatement', NULL, 'presentationArc', 'http://www.xbrl.org/2003/arcrole/parent-child', NULL, NULL, NULL, 'en-US');
This creates view my_instance_network
:
Name Null? Type ----------------------------------------- -------- --------------------- NAMESPACEURI VARCHAR2(4000) PREFIX VARCHAR2(4000) NAME VARCHAR2(4000) LABEL VARCHAR2(4000) PREFERRED_LABEL VARCHAR2(4000) ENTITY_SCHEME VARCHAR2(4000) ENTITY_IDENTIFIER VARCHAR2(4000) START_DATE DATE END_DATE DATE CONTEXTREF VARCHAR2(4000) UNITREF VARCHAR2(4000) DECIMALS VARCHAR2(4000) VALUE CLOB
Drop a star schema: the fact table or super fact table, dimension tables, and join view (if any) that are collectively identified by the given tableName
, provided such information is cached in a system table. (Do nothing if the information is not cached.)
PROCEDURE dropStarSchema(tableName VARCHAR2);
This section describes data types specific to XBRL Extension to Oracle XML DB. They are all in PL/SQL package XBRLSYS
.
Data type ORAXBRL_CONCEPTLIST
is a varray of ORAXBRL_CONCEPT
, which is an object type with the following attributes that pertain to a concept:
Table 3-42 ORAXBRL_CONCEPT Object Type Attributes
Attribute | Type | Description |
---|---|---|
|
|
Namespace URI of the XML schema that defines the concept. |
|
|
Preferred prefix for the namespace specified by |
|
|
Local name of the concept. |
|
|
Unique identifier of the concept. |
|
|
The credit/debit balance associated with the concept. |
|
|
Type of the reporting period associated with the concept. Possible values: |
|
|
True means that the concept can be used only in a hierarchy, to group related concepts. Possible values: |
|
|
True means that facts for the concept can be empty. Possible values: |
|
|
Namespace URI of the schema type of the concept. |
|
|
Local name of the schema type of the concept. |
|
|
Namespace URI of the substitution group for the concept. |
|
|
Local name of the substitution group for the concept. |
|
|
Absolute path of the concept in the taxonomy schema. |
|
|
Human-readable name for the concept, unique across the taxonomy. |
|
|
The preferred label derived from the |
Data type ORAXBRL_ITEMLIST
is a varray of ORAXBRL_ITEM
, which is an object type with the following attributes that pertain to a fact:
Table 3-43 ORAXBRL_ITEM Object Type Attributes
Attribute | Type | Description |
---|---|---|
|
|
Namespace URI of the XML schema that defines the fact. |
|
|
Prefix for the namespace specified by |
|
|
Local name of the fact. |
|
|
Human-readable name for the fact, unique across the taxonomy. |
|
|
Same as |
|
|
Unique identifier of the fact. |
|
|
Namespace of the entity identification scheme for the fact. |
|
|
Value of the entity identifier for the fact. |
|
|
Start date for the fact, if the period type is |
|
|
End date for the fact, if the period type is |
|
|
A reference to the context associated with the fact. |
|
|
A reference to the unit associated with the fact. |
|
|
Number of decimal places to which numbers have been rounded. |
|
|
Value of the fact. |
Data type ORAXBRL_LOCLIST
is a varray of VARCHAR2(4000)
. Data type ORAXBRL_STARSCHEMA
is an object type with the following attributes that pertain to a star schema:
Data type ORAXBRL_DTSURLLIST
is a varray of ORAXBRL_DTSURL_T
, which is an object type with the following attributes that pertain to a file in the XBRL repository.
Table 3-45 ORAXBRL_DTSURL_T Object Type Attributes
Attribute | Type | Description |
---|---|---|
|
|
Name of the file. |
|
|
Type of the file: |
|
|
Location of the file in the XBRL repository. |
|
|
Location of the file in the Oracle XML DB Repository. |
|
|
Document or file object ID. |
Footnote Legend
Footnote 1: Functioninstance_network2
has the same signature, except it returns an instance of data type ORAXBRL_CONCEPTLIST
.multiple_instance_network2
has the same signature, except it returns an instance of data type ORAXBRL_ITEMLIST
.concepts_network2
has the same signature, except it returns an instance of data type ORAXBRL_CONCEPTLIST
.concept_roots2
has the same signature, except it returns an instance of data type ORAXBRL_CONCEPTLIST
.concepts_in_tree2
has the same signature, except it returns an instance of data type ORAXBRL_CONCEPTLIST
.