36
XBRL Tutorial Arelle ® Tool 24 Nov 2014 open source xbrl pla7orm

XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Embed Size (px)

Citation preview

Page 1: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

XBRL  Tutorial  Arelle®  Tool  

24  Nov  2014  

open  source  xbrl  pla7orm  

Page 2: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Topics  •  Installa3on  •  Valida3on  (GUI,  CmdLine,  WebService)  •  Saving  to  files,  import  Excel  to  DTS  •  Databases  •  Plug-­‐ins  (exis3ng,  developing)  •  Packages  (and  remappings)  •  Performance  &  Profiling  •  Integra3on  (Java,  C#,  other)  •  Tes3ng    

Page 3: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Installa3on  •  Applica3on  installers  

–  Windows  installer  exe  from  website  –  Unix:  Mac  .dmg  installer  –  Linux/Solaris  zip  

•  Python  sources  –  gitHub.com/arelle  –  Issues  reports:  arelle.atlassian.net  –  Python  3.3+  packages:  lxml,  regex,  isodate,  gzip,  zlib  

•  Windows  from:  www.lfd.uci.edu/~gohlke/pythonlibs/  •  Others:  easy_install-­‐3.3  {package}  

–  Plugins:  rdflib,  pg8000,  pymysql,  sqlite3,  pyodbc  –  Distribu3on:  cx_Freeze  

Page 4: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Valida3on,  SEC/SBR  •  Select  disclosure  system  (SEC,  SBR)  •  Check  (√)  Disclosure  system  checks  if  SEC,  SBR  •  File  –  open  (    )  – A  single  file  or  a  zip  archive  

•  Validate  (    )  

Page 5: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Valida3on,  Command  Line  arelleCmdLine  –f  “file  name”  –v          -­‐-­‐disclosureSystem  efm-­‐pragma3c  •  File  name  can  be  URL,  local  file,  or  path  into  a  zip  archive  (e.g.,    …foo.zip/bar.xml)  

•  Looks  inside  file  to  determine  whether  –  Instance,  inline  XBRL  – DTS  file  (schema,  linkbase)  –  Testcase  file,  testcase  index  file  

Page 6: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Valida3on,  Web  Service  Start  web  service  (bat  or  sh  file)  hmp://localhost:8080/help  (for  details)  Simple  valida3on:  hmp://localhost:8080//rest/xbrl/valida3on?  file=c:/a/b/c.xbrl    

Page 7: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Valida3ons,  EBA/EIOPA  Supported  Op3ons  

Valida3on  Basis  Streaming   Formula  

DTS   DPM  DB  

Arelle  

GUI                  

Command  Line                  

Web  Service                  

T4U  

Na3ve                  

with  Arelle  without  DTS                  

with  Arelle  using  DTS                  

Page 8: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Load/Save/Import/Export       Save  to   XBRL  stored  in   Output  Instances   Serializa3on  output  

Excel  Load  from       XML  files   Database   Table   Formula   Plain  XML   CSV   Excel   JSON  

Arelle  

XBRL  in  XML  files                                      

DPD  database                                      

Excel  input                                      

Zip  archives                                      

T4U  

Na3ve                                      

with  Arelle  without  DTS                                      

with  Arelle  using  DTS                                      

Page 9: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Saving  to  csv,  html,  xml…  arelleCmdLine  –f  “file  name”          -­‐-­‐concepts  filename.{csv,  html,  xml,  …}        -­‐-­‐pre  {f}  –cal  {f}  –dim  {f}  –formulae  {f}        -­‐-­‐viewArcrole  {arcrole}  –viewFile  {f}        -­‐-­‐roleTypes  {f}    -­‐-­‐arcroleTypes  {f}        -­‐-­‐logFile  f.{xml,  json,  …}    -­‐-­‐log{Level|Code}Filter        -­‐-­‐internetConnec3vity  {online|offline}    

Page 10: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Excel  Plug-­‐in  •  Create  [extension]  taxonomies  from  Excel  –  XBRL-­‐US,  IFRS,  EDINet,  bare  taxonomy  

•  Plug-­‐in:  –  Save  XBRL  DTS  into  Excel  –  Load/validate  from  Excel  –  Save  from  Excel  into  XBRL  files  

Page 11: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Excel  example  

specifica3on   file  type  

prefix  (schema)  type  (linkbase)  

argument  (other)   file,  href  or  role  defini3on   namespace  URI                                                              extension   schema   test   test.xsd   hmp://abc.com/test  extension   linkbase   presenta3on   test-­‐pre.xml      extension   linkbase   calcula3on   test-­‐cal.xml      extension   linkbase   label  en   test-­‐lab.xml                          extension   role       Property  Plant  Equipment  Extended  Link   hmp://abc.com/role/PPE  

Property Plant Equipment Extended Link                        科目分類 冗長ラベル(英語)

名前空間プレフィックス

要素名 type substitutionGroup periodType balance abstract depth calculation parent calculation

weight

B Property, Plant, and Equipment, Net, Movements [Abstract] test PPENetAbstract xbrli:stringItemType xbrli:item instant   true 0        

B Property, Plant, and Equipment, Net test PPENet xbrli:monetaryItemType xbrli:item instant   false 1        B Land test Land xbrli:monetaryItemType xbrli:item instant   false 2 test:PPENet 1  B Buildings, Net test Bldg xbrli:monetaryItemType xbrli:item instant debit false 2 test:PPENet 1  B Furniture and Fixtures, Net test Furn xbrli:monetaryItemType xbrli:item instant   false 2 test:PPENet 1  B Computer Equipment, Net test CompEqp xbrli:monetaryItemType xbrli:item instant debit false 2 test:PPENet 1  B Other Property, Plant, and Equipment, Net test OtherProp xbrli:monetaryItemType xbrli:item instant debit false 2 test:PPENet 1  

Sheet  2:    Import  and  extension  parameters  

Link  role   Concepts  

Extension  files  

Extension  link  role  

Sheet  1:    Taxonomy  

Page 12: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Databases  Support  •  Bulk  load  &  update  database  –  From  SEC  RSS,  UK  &  FSA  websites  –  From  GUI,  files  &  scripts  

•  Database  Schemas:  –  XBRL-­‐US  Public  

•  Postgres  only  –  XBRL  Abstract  Model  

•  SQL  (Postgres,  SQLite,  MySQL,  MS  SQL,  Oracle)  •  Graph  (Cassandra,  RDF,  JSON)  

–  DPM  Database  (EIOPA  T4U  integrated)  

Page 13: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

XBRL-­‐US  Public  schema  

Page 14: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Installing  XBRL-­‐US  Postgres  DB  •  Install  Postgres  –  Create  database,  user,  password,  load  DDL  

•  Install  Arelle  &  xbrlDB  plugin  •  Run  RSS  feeds  or  cmd  scripts  –  arelleCmdLine -f c:\temp\test.rss -v --

disclosureSystem efm-pragmatic-all-years --store-to-XBRL-DB "host, port,user,pwd,database,90,postgres“

Page 15: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Graph  Model  

semantic_root

-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

accession

accessions documents

documentsaccessions

-acceptance_timestamp-filing_date-entry_url-accession_number

accession

accession_

number accession_number

-url-document_type-aspect_vertices index

document

docum

ent_U

RL

entry_document

entry_document

referenced_document

-namespacedata_dictionary

doc_data_dictionary

-namedata_type

-name-isAbstract-periodType-balance-isItem-...

aspect

-uri-definition

role_type

-uri-definition-cyclesAllowed

arcrole_type data_t

ype aspect

role_type

arcrole_type

data_type

derived_from

substitutes_for

base_xbrli_type

-data_points_set

datapoints

-source_line-xml_id-context id-effective_value-unit_id-precision|decimals-value

data_pointbase_item

-scheme-identifier

entity_identifier

-start_date-end_date-instant-forever

period

-mul measures-div measures

unit

entry_identifier_aspects

period_aspects

unit_a

spects

aspect_value_selection_g

roup

entity_identifier

period

unit aspect

_val

ue_sel

ection

-name-typed_value

aspect_value_selection

aspect_valueaspect

aspect_value_

selection_group

-...relationship_sets

-arcrole-linkrole-arcname-linkname

rel_set

relationship_sets -...dts

dts

dts_data_dictionary

dts

relationship_set

role

arcrole

-value-role

resource

role

datapoint

tuple

-...aspect_proxy

proxydts_aspect_proxy

aspectsaspects

hashedname

rel

root

rel_set

schemes

schemes

concepts

schem

e

-name-documentation-...

concept

-name-documentation-...

collection

schem

e

name

relation

ship

related

broader-

narrower

-...concept_proxy

proxy

definedBy

Page 16: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Graph  Databases  •  Social  networking  technology  (Facebook)  –  Rexter  interface,  Titan  data  store  –  Mul3ple  backends  (Cassandra,  HBase)  –  Gremlin  /  Groovy  query  (3nkerpop)  

•  Run  RSS  feeds  or  cmd  scripts  –  arelleCmdLine -f c:\temp\test.rss -v --

disclosureSystem efm-pragmatic-all-years --store-to-XBRL-DB "host, port,user,pwd,database,90,rexter”

Page 17: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Graph  to    Data  Points  

Page 18: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

RDF  Model  

Page 19: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Storing  into  to  RDF  •  RDF  stores  –  Files  (turtle,  XML)  –  Database  NanoSparqlServer  

•  Run  RSS  feeds  or  cmd  scripts  –  arelleCmdLine -f c:\temp\test.rss -v –

disclosureSystem efm-pragmatic-all-years --store-to-XBRL-DB rdfFile,,,, c:\abc\test.turtle,600,rdfDB”  

Page 20: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

JSON  Model  

Page 21: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Storing  into  JSON  Database  •  JSON  file  sytax  –  MongoDB  interes3ng,  size  issues  

•  Run  RSS  feeds  or  cmd  scripts  –  arelleCmdLine -f c:\temp\test.rss -v –

disclosureSystem efm-pragmatic-all-years --store-to-XBRL-DB jsonFile,,,, c:\abc\test.json,600,json”  

Page 22: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

SQL  Abstract  Model  

Page 23: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Storing  into  SQL  •  Postgres,  SQLite,  MySQL,  MSSQL  &  Oracle  –  arelleCmdLine -f c:\temp\test.rss -v –

disclosureSystem efm-pragmatic-all-years --store-to-XBRL-DB host,port,user,pwd,database600,pgSemantic •  pgSemantic – Postgres •  mysqlSemantic – MySql & Cloud SQL (GAE) •  mssqlSemantic – MS SQL Server (2011) •  orclSemantic – Oracle 11g •  sqliteSemantic – SQLite  

 

Page 24: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

DPM  Model  

Page 25: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Plug-­‐ins  •  GUI  •  Command  line  •  Standard  plug-­‐ins  •  Developing  custom  plug-­‐ins  

Page 26: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Plug-­‐in  Manager  

Page 27: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Command  Line  Plug-­‐in  Use  •   -­‐-­‐plugins=PLUGINS            •  Modify  plug-­‐in  configura3on.      

–  Re-­‐save  unless  'temp’  is  in  the  module  list.      –  'show'  to  show  current  plug-­‐in  configura3on.      –  '|'  separator  (mul3ple  plugins  and  commands)  –  +url  to  add  plug-­‐in  by  its  url  or  filename,    (rela3ve  to  installa3on  plugin  directory)  

–  ~name  to  reload  a  plug-­‐in  by  its  name,    –  -­‐name  to  remove  a  plug-­‐in  by  its  name  –  name  for  temporary  plug-­‐in  (not  saved)  

Page 28: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Wri3ng  a  Plug  In  •  Produc3on  code  in  …/plugin  •  Examples  in  …examples/plugin  •  Structure:  – Methods  for  plugin    –  CmdLine  &  GUI  interfaces  __pluginInfo__  :  plug-­‐in  class  methods  

•  Plugin  is  always  distributed  in  source  

Page 29: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Packages  •  Zip  manifests  (Oasis  Catalog,  XII  Package)  –  (currently  only  first  oasis  catalog  is  found)  

•  Entry  points  named  in  Package  manifest  •  URL  redirec3on  catalog  entries  –  Eliminate  copying  into  cache  –  Support  mul3ple  packaged  versions  

Page 30: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Package  Manager  

Page 31: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Command  Line  Package  Use  •   -­‐-­‐packages=PACKAGES            •  Modify  package  configura3on.      –  Re-­‐save  unless  'temp’  is  in  the  module  list.      –  'show'  to  show  current  package  configura3on.      –  '|'  separator  (mul3ple  packages  and  commands)  –  +url  to  add  package  by  its  url  or  filename,    (url  is  full  path)  –  ~name  to  reload  a  package  by  its  name,    –  -­‐name  to  remove  a  package  by  its  name  –  name  for  temporary  package  (not  saved)  

Page 32: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Other  mapping  redirec3on  •  Config/mappings.xml  – Maps  URL  or  File  to  file,  directory  or  into  a  zip  

Page 33: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Performance  &  Profiling  -­‐-­‐collectProfileStats  -­‐  collect  profile  sta3s3cs    (3me  and  memory  by  processing  phase)  

       GUI  tools  log  menu:  collect/log  profile  stats  -­‐-­‐plugins=profileCmdLine.py              -­‐-­‐saveProfilerReport=filename  Plugin  profileFormula.py            valida3on  menu:  Profile  formula  valida3on              

Page 34: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Integra3on  Topics  •  C#  interface  •  Java  interface  •  Error  messages  op3ons  –  Parameterized  XML  and  JSON  available  

•  Status  bar  updates  •  Database  Integra3on  •  Table  linkbase  error  loca3ng  

Page 35: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Interface  “wrapper”  •  Prepare  parameters  •  Prepare  cache  if  offline,  or  Package  file(s)  •  Ini3ate  in  background  as  appropriate  –  run3me.exec  or  Process.start  –  If  run  from  GUI,  named  pipe  to  display  status  info  

•  Process  resul3ng  log  file  (txt,  .xml  or  .json)  –  Integrate  error  results  to  source  files/tables/etc  

•  href’s  for  each  log  entry  with  tool3p  info  in  .xsml/.json  

Page 36: XBRL%Tutorial% Arelle Tool% - Eurofiling | Contact: … Model# semantic_root-accepted_timestamp-filing_date-entity_id-entity_name-SIC_code-SEC_html_url-entry_url-accessison_number

Regression  Tes3ng  •  Supports  XBRL  valida3on  suites  •  Run  either  by:  –  Command  file  .bat/.sh  scripts  – GUI:  Open  a  test  index  or  test  suite  –  pyTest  

•  Control  file  config/arelle_test.ini  –  tests  &  parameters  •  junitxml  output  for  test  integra3on    •  Test  wrapper  example  arelle_test.py