Skip to content

Commit 3dcda5b

Browse files
author
James (ODSC)
authored
Merge pull request #469 from OpenDataServices/issue-468
docs/usage-bods.rst: Start new content for 0.4
2 parents 1dc7899 + c854e94 commit 3dcda5b

File tree

1 file changed

+33
-5
lines changed

1 file changed

+33
-5
lines changed

docs/usage-bods.rst

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,36 @@
11
Flatten Tool for BODS
22
+++++++++++++++++++++
33

4+
BODS 0.4
5+
========
6+
7+
Flatten tool can be used to flatten and unflatten BODS 0.4 data.
8+
9+
Flatten tool has not yet been updated to handle the BODS 0.4 schema. (For the moment the ``--schema`` option should not be used when handling BODS 0.4 data.) This documentation will be updated when the work is complete.
10+
11+
12+
413
flatten and unflatten
14+
---------------------
15+
16+
This data standard has a list as the root element,
17+
as opposed to other standards where the root element is a dict with meta data and a list of data.
18+
When flattening and unflattening, use the ``--root-is-list`` option.
19+
20+
The id element is ``statementId``, so also use the ``--id-name`` option.
21+
22+
.. code-block:: bash
23+
24+
flatten-tool flatten -f csv --root-is-list --id-name=statementId -o examples/bods-one-flatten examples/bods-one.json
25+
flatten-tool unflatten -f csv --root-is-list --id-name=statementId -o examples/bods-one-unflattened.json examples/bods-one-flatten
26+
27+
28+
BODS 0.3 and previous
529
=====================
630

31+
flatten and unflatten
32+
---------------------
33+
734
This data standard has a list as the root element,
835
as opposed to other standards where the root element is a dict with meta data and a list of data.
936
When flattening and unflattening, use the ``--root-is-list`` option.
@@ -17,7 +44,7 @@ The id element is ``statementID``, so also use the ``--id-name`` option.
1744
1845
1946
flatten
20-
=======
47+
-------
2148

2249
This data standard has three types of statement - ``entityStatement``, ``personStatement`` or ``ownershipOrControlStatement``.
2350
When using flatten, the spreadsheets produced can become very mixed up.
@@ -64,10 +91,10 @@ If you want to use Excel mode, you'll need to specify 3 separate output files an
6491
flatten-tool flatten --sheet-prefix=3_ownership_ --filter-field=statementType --filter-value=ownershipOrControlStatement -f xlsx -o example1/part3.xlsx example1.json --root-is-list --id-name=statementID
6592
6693
unflatten
67-
=========
94+
---------
6895

6996
Schema
70-
------
97+
~~~~~~
7198

7299
As well as the options above, also pass the ``--schema`` option so that types are set correctly. Note the boolean and the integer in the output.
73100

@@ -79,7 +106,7 @@ As well as the options above, also pass the ``--schema`` option so that types ar
79106

80107

81108
Order is important
82-
------------------
109+
~~~~~~~~~~~~~~~~~~
83110

84111
In the BODS schema, statements must appear in a certain order. Each of the ``entityStatements`` or ``personStatements``
85112
referenced by a particular ``ownershipOrControlStatement`` must appear before that particular statement in the ordered array.
@@ -118,7 +145,7 @@ For instance:
118145
* 3main-control-own.csv
119146

120147
create-template
121-
===============
148+
---------------
122149

123150
You can run this directly on ``bods-package.json``:
124151

@@ -209,3 +236,4 @@ The advantages are:
209236

210237

211238

239+

0 commit comments

Comments
 (0)