lineage-data-format 0.2.0__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,29 @@ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
8
  ---
9
9
 
10
+ ## [0.3.0] - 2026-11-03
11
+
12
+ ### Added
13
+
14
+ - Alias compression, on by default (`aliases` option; `--no-aliases` on the CLI;
15
+ `aliases` argument of `convert_json_file_to_lineage`). New constructs:
16
+ `REF` section with `@Rn` references in `HP` / `ATTR` / `DSD`, `*` default entry in
17
+ `HP` / `DSD`, `IKP` section with `ikp=` node token, `NDEF` section with default node
18
+ tokens, `E` grouped by source (`N1>N2,N3`), default `EP` lines (`*>* etype=…`,
19
+ `* etype=…`).
20
+ - The decoder reads all of the above and the older, expanded form.
21
+
22
+ ### Changed
23
+
24
+ - **The default output is different.** Documents written with the default options are
25
+ smaller (e.g. 30% / 43% of the previous size on `out.json` / `big_query_lineage.json`)
26
+ and need a reader from this version. Use `aliases=False` / `--no-aliases` for the
27
+ 0.2.0 form.
28
+ - The order of the edge list is not preserved with `aliases` on. The set of edges and
29
+ their types is.
30
+
31
+ ---
32
+
10
33
  ## [0.2.0] - 2026-11-02
11
34
 
12
35
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: lineage-data-format
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: Lineage Definition Format — token-optimized serialization for data lineage graphs
5
5
  Project-URL: Homepage, https://github.com/IBM/lineage-data-format
6
6
  Project-URL: Repository, https://github.com/IBM/lineage-data-format
@@ -129,6 +129,9 @@ convert_lineage_file_to_json('input.ldf', 'output.json')
129
129
  # Compact mode (single blank line between sections instead of two)
130
130
  ldf_compact = json_to_lineage_format(backend_response, {'compact': True})
131
131
 
132
+ # Legacy, fully expanded output (no alias compression)
133
+ ldf_expanded = json_to_lineage_format(backend_response, {'aliases': False})
134
+
132
135
  # Exclude fields from the output (applied to the input, before serialization)
133
136
  ldf_slim = json_to_lineage_format(
134
137
  backend_response,
@@ -136,6 +139,13 @@ ldf_slim = json_to_lineage_format(
136
139
  )
137
140
  ```
138
141
 
142
+ #### `aliases`
143
+
144
+ A `bool` in the options dict, `True` by default. It removes repeated values from
145
+ the output (see [Alias compression](#alias-compression)). `False` writes the
146
+ expanded form of version 0.2.0. The decoder reads both forms. Command line:
147
+ `--no-aliases`.
148
+
139
149
  #### `exclude_fields`
140
150
 
141
151
  A list of `str` passed in the options dict. The default is an empty list, in which
@@ -167,6 +177,9 @@ ldf json-to-lineage input.json output.ldf
167
177
  # Convert with compact format (minimal blank lines)
168
178
  ldf json-to-lineage input.json output.ldf --compact
169
179
 
180
+ # Expanded output without alias compression
181
+ ldf json-to-lineage input.json output.ldf --no-aliases
182
+
170
183
  # Exclude fields (comma-separated and/or repeated; names, dotted paths, wildcards)
171
184
  ldf json-to-lineage input.json output.ldf --exclude children,descendant_statistics,is_favorite,source_code_snippets
172
185
 
@@ -187,8 +200,10 @@ The Lineage Definition Format is a compact, plain-text format that defines repea
187
200
  |---|---|---|
188
201
  | `GRAPH` | Structural | Marker line + optional `dt=` / `ts=` meta |
189
202
  | `START` | Structural | Alias of the first asset |
190
- | `E` | Structural | Directed edges: `N1>N2`; an edge without a target (end edge) is just the source alias: `N7` |
191
- | `EP` | Structural | Edge properties: `N1>N2 etype=direct` (end edge: `N7 etype=summary`), listed in `E` order |
203
+ | `E` | Structural | Directed edges: `N1>N2`, grouped by source `N1>N2,N3`; an edge without a target (end edge) is just the source alias: `N7` |
204
+ | `EP` | Structural | Edge properties: `N1>N2 etype=direct` (end edge: `N7 etype=summary`), listed in `E` order; `*>* etype=X` / `* etype=Y` are the defaults |
205
+ | `NDEF` | Defaults | Node tokens shared by most nodes: `origin=design path=T1 flags=7` |
206
+ | `IKP` | Lookup | `identity_key` prefixes: `P1=<encoded prefix>` |
192
207
  | `N` | Structural | Node definitions (see format below) |
193
208
  | `T` | Lookup | Technology names: `T1=PostgreSQL` |
194
209
  | `TID` | Lookup | Technology UUIDs: `T1=<uuid>` |
@@ -204,6 +219,25 @@ The Lineage Definition Format is a compact, plain-text format that defines repea
204
219
  | `PA` | Per-node | Project assignments (JSON): `N1=[…]` |
205
220
  | `SA` | Per-node | Space assignments (JSON): `N1=[…]` |
206
221
  | `DSD` | Per-node | Data source definition asset: `N1=id:name` |
222
+ | `REF` | Lookup | Shared values of `HP` / `ATTR` / `DSD`: `R1=<value>`, used as `@R1` |
223
+
224
+ ### Alias compression
225
+
226
+ With `aliases` on, repeated values are written once:
227
+
228
+ | Construct | Example | Meaning |
229
+ |---|---|---|
230
+ | `REF` + `@Rn` | `R1=TRANSFORMATION_TAG=TRANSFORMING`, entry `N1=@R1\|@R2` | a whole entry value or one `\|`-separated element is replaced by the reference; a reference may refer to other references. An `@…` that is not defined in `REF` is a literal |
231
+ | `*` entry | `HP:` `*=<value>`, `N3=<other>`, `N4=` | default value of `HP` / `DSD`. A node with its own entry keeps it; an empty entry (`N4=`) means none |
232
+ | `IKP` | `P1=uuid/dsd%5BDatabase%5D/`, node `ikp=P1 ik=Asset%201…` | `identity_key` = prefix + `ik` |
233
+ | `NDEF` | `origin=design flags=7` | tokens inherited by every node. A node's own token overrides it, an empty one (`origin=`) removes it; `flags=0` is written explicitly |
234
+ | grouped `E` | `N1>N2,N3` | all targets of one source on one line |
235
+ | default `EP` | `*>* etype=direct`, `* etype=summary` | type of edges with a target / of end edges; `N1>N2 etype=X` overrides it, `etype=` means no type |
236
+
237
+ The text is smaller, the data is the same: assets and the set of edges (with their
238
+ types) survive a roundtrip. The order of the edge list does not: sources keep their
239
+ first-occurrence order and targets keep their original order. A section is written
240
+ only when it saves space.
207
241
 
208
242
  ### Node Line Format
209
243
 
@@ -101,6 +101,9 @@ convert_lineage_file_to_json('input.ldf', 'output.json')
101
101
  # Compact mode (single blank line between sections instead of two)
102
102
  ldf_compact = json_to_lineage_format(backend_response, {'compact': True})
103
103
 
104
+ # Legacy, fully expanded output (no alias compression)
105
+ ldf_expanded = json_to_lineage_format(backend_response, {'aliases': False})
106
+
104
107
  # Exclude fields from the output (applied to the input, before serialization)
105
108
  ldf_slim = json_to_lineage_format(
106
109
  backend_response,
@@ -108,6 +111,13 @@ ldf_slim = json_to_lineage_format(
108
111
  )
109
112
  ```
110
113
 
114
+ #### `aliases`
115
+
116
+ A `bool` in the options dict, `True` by default. It removes repeated values from
117
+ the output (see [Alias compression](#alias-compression)). `False` writes the
118
+ expanded form of version 0.2.0. The decoder reads both forms. Command line:
119
+ `--no-aliases`.
120
+
111
121
  #### `exclude_fields`
112
122
 
113
123
  A list of `str` passed in the options dict. The default is an empty list, in which
@@ -139,6 +149,9 @@ ldf json-to-lineage input.json output.ldf
139
149
  # Convert with compact format (minimal blank lines)
140
150
  ldf json-to-lineage input.json output.ldf --compact
141
151
 
152
+ # Expanded output without alias compression
153
+ ldf json-to-lineage input.json output.ldf --no-aliases
154
+
142
155
  # Exclude fields (comma-separated and/or repeated; names, dotted paths, wildcards)
143
156
  ldf json-to-lineage input.json output.ldf --exclude children,descendant_statistics,is_favorite,source_code_snippets
144
157
 
@@ -159,8 +172,10 @@ The Lineage Definition Format is a compact, plain-text format that defines repea
159
172
  |---|---|---|
160
173
  | `GRAPH` | Structural | Marker line + optional `dt=` / `ts=` meta |
161
174
  | `START` | Structural | Alias of the first asset |
162
- | `E` | Structural | Directed edges: `N1>N2`; an edge without a target (end edge) is just the source alias: `N7` |
163
- | `EP` | Structural | Edge properties: `N1>N2 etype=direct` (end edge: `N7 etype=summary`), listed in `E` order |
175
+ | `E` | Structural | Directed edges: `N1>N2`, grouped by source `N1>N2,N3`; an edge without a target (end edge) is just the source alias: `N7` |
176
+ | `EP` | Structural | Edge properties: `N1>N2 etype=direct` (end edge: `N7 etype=summary`), listed in `E` order; `*>* etype=X` / `* etype=Y` are the defaults |
177
+ | `NDEF` | Defaults | Node tokens shared by most nodes: `origin=design path=T1 flags=7` |
178
+ | `IKP` | Lookup | `identity_key` prefixes: `P1=<encoded prefix>` |
164
179
  | `N` | Structural | Node definitions (see format below) |
165
180
  | `T` | Lookup | Technology names: `T1=PostgreSQL` |
166
181
  | `TID` | Lookup | Technology UUIDs: `T1=<uuid>` |
@@ -176,6 +191,25 @@ The Lineage Definition Format is a compact, plain-text format that defines repea
176
191
  | `PA` | Per-node | Project assignments (JSON): `N1=[…]` |
177
192
  | `SA` | Per-node | Space assignments (JSON): `N1=[…]` |
178
193
  | `DSD` | Per-node | Data source definition asset: `N1=id:name` |
194
+ | `REF` | Lookup | Shared values of `HP` / `ATTR` / `DSD`: `R1=<value>`, used as `@R1` |
195
+
196
+ ### Alias compression
197
+
198
+ With `aliases` on, repeated values are written once:
199
+
200
+ | Construct | Example | Meaning |
201
+ |---|---|---|
202
+ | `REF` + `@Rn` | `R1=TRANSFORMATION_TAG=TRANSFORMING`, entry `N1=@R1\|@R2` | a whole entry value or one `\|`-separated element is replaced by the reference; a reference may refer to other references. An `@…` that is not defined in `REF` is a literal |
203
+ | `*` entry | `HP:` `*=<value>`, `N3=<other>`, `N4=` | default value of `HP` / `DSD`. A node with its own entry keeps it; an empty entry (`N4=`) means none |
204
+ | `IKP` | `P1=uuid/dsd%5BDatabase%5D/`, node `ikp=P1 ik=Asset%201…` | `identity_key` = prefix + `ik` |
205
+ | `NDEF` | `origin=design flags=7` | tokens inherited by every node. A node's own token overrides it, an empty one (`origin=`) removes it; `flags=0` is written explicitly |
206
+ | grouped `E` | `N1>N2,N3` | all targets of one source on one line |
207
+ | default `EP` | `*>* etype=direct`, `* etype=summary` | type of edges with a target / of end edges; `N1>N2 etype=X` overrides it, `etype=` means no type |
208
+
209
+ The text is smaller, the data is the same: assets and the set of edges (with their
210
+ types) survive a roundtrip. The order of the edge list does not: sources keep their
211
+ first-occurrence order and targets keep their original order. A section is written
212
+ only when it saves space.
179
213
 
180
214
  ### Node Line Format
181
215
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "lineage-data-format"
7
- version = "0.2.0"
7
+ version = "0.3.0"
8
8
  description = "Lineage Definition Format — token-optimized serialization for data lineage graphs"
9
9
  readme = "README.md"
10
10
  license = "BSD-3-Clause"
@@ -12,7 +12,7 @@ from .converter import (
12
12
  convert_lineage_file_to_json,
13
13
  )
14
14
 
15
- __version__ = "0.2.0"
15
+ __version__ = "0.3.0"
16
16
 
17
17
  __all__ = [
18
18
  "json_to_lineage_format",
@@ -46,6 +46,11 @@ Examples:
46
46
  action='store_true',
47
47
  help='Use compact format (no extra whitespace)'
48
48
  )
49
+ json_parser.add_argument(
50
+ '--no-aliases',
51
+ action='store_true',
52
+ help='Disable alias compression (write the legacy, fully expanded form)'
53
+ )
49
54
  json_parser.add_argument(
50
55
  '--exclude',
51
56
  action='append',
@@ -84,7 +89,8 @@ Examples:
84
89
  args.input,
85
90
  args.output,
86
91
  compact=args.compact,
87
- exclude_fields=exclude_fields
92
+ exclude_fields=exclude_fields,
93
+ aliases=not args.no_aliases
88
94
  )
89
95
  print(f"✓ Converted {args.input} → {args.output}")
90
96