Project

General

Profile

Feature #357 » draft-potvin-dwd-pipe-separated-format.txt

plain text form - Charles Langlois, 02/09/2026 01:45 AM

 
1

    
2

    
3

    
4

    
5
Independent Submission                                         J. Potvin
6
Internet-Draft                                               C. Langlois
7
Intended status: Informational                    Xalgorithms Foundation
8
Expires: 12 August 2026                                  8 February 2026
9

    
10

    
11
            Data With Direction (DWD) Pipe-Separated Format
12
               draft-potvin-dwd-pipe-separated-format-00
13

    
14
Abstract
15

    
16
   This document specifies the Data With Direction (DWD) pipe-separated
17
   file format, a text-based format for encoding rule-based decision
18
   logic.  The format represents rules as collections of metadata and
19
   truth tables that define input conditions and output assertions.
20

    
21
   The format is designed for human readability and editability, machine
22
   parsing and processing, version control system compatibility, and
23
   exchange between rule management systems.
24

    
25
Status of This Memo
26

    
27
   This Internet-Draft is submitted in full conformance with the
28
   provisions of BCP 78 and BCP 79.
29

    
30
   Internet-Drafts are working documents of the Internet Engineering
31
   Task Force (IETF).  Note that other groups may also distribute
32
   working documents as Internet-Drafts.  The list of current Internet-
33
   Drafts is at https://datatracker.ietf.org/drafts/current/.
34

    
35
   Internet-Drafts are draft documents valid for a maximum of six months
36
   and may be updated, replaced, or obsoleted by other documents at any
37
   time.  It is inappropriate to use Internet-Drafts as reference
38
   material or to cite them other than as "work in progress."
39

    
40
   This Internet-Draft will expire on 12 August 2026.
41

    
42
Copyright Notice
43

    
44
   Copyright (c) 2026 IETF Trust and the persons identified as the
45
   document authors.  All rights reserved.
46

    
47

    
48

    
49

    
50

    
51

    
52

    
53

    
54

    
55

    
56
Potvin & Langlois        Expires 12 August 2026                 [Page 1]
57

58
Internet-Draft                   DWD-PSF                   February 2026
59

    
60

    
61
   This document is subject to BCP 78 and the IETF Trust's Legal
62
   Provisions Relating to IETF Documents (https://trustee.ietf.org/
63
   license-info) in effect on the date of publication of this document.
64
   Please review these documents carefully, as they describe your rights
65
   and restrictions with respect to this document.  Code Components
66
   extracted from this document must include Revised BSD License text as
67
   described in Section 4.e of the Trust Legal Provisions and are
68
   provided without warranty as described in the Revised BSD License.
69

    
70
Table of Contents
71

    
72
   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
73
     1.1.  Purpose . . . . . . . . . . . . . . . . . . . . . . . . .   3
74
     1.2.  Scope . . . . . . . . . . . . . . . . . . . . . . . . . .   3
75
     1.3.  Terminology . . . . . . . . . . . . . . . . . . . . . . .   4
76
     1.4.  Notational Conventions  . . . . . . . . . . . . . . . . .   4
77
   2.  Document Structure  . . . . . . . . . . . . . . . . . . . . .   4
78
     2.1.  File Encoding . . . . . . . . . . . . . . . . . . . . . .   4
79
   3.  Line Structure  . . . . . . . . . . . . . . . . . . . . . . .   5
80
   4.  Field Structure . . . . . . . . . . . . . . . . . . . . . . .   5
81
   5.  Record Types  . . . . . . . . . . . . . . . . . . . . . . . .   6
82
   6.  Metadata Section  . . . . . . . . . . . . . . . . . . . . . .   6
83
     6.1.  Metadata Fields . . . . . . . . . . . . . . . . . . . . .   6
84
     6.2.  Nested Metadata . . . . . . . . . . . . . . . . . . . . .   7
85
     6.3.  Reserved Fields . . . . . . . . . . . . . . . . . . . . .   7
86
   7.  Truth Table Section . . . . . . . . . . . . . . . . . . . . .   8
87
     7.1.  Truth Table Structure Overview  . . . . . . . . . . . . .   8
88
     7.2.  Row Identifiers . . . . . . . . . . . . . . . . . . . . .   9
89
     7.3.  Column Headers  . . . . . . . . . . . . . . . . . . . . .  10
90
     7.4.  Data Rows . . . . . . . . . . . . . . . . . . . . . . . .  10
91
     7.5.  Expression Field Content  . . . . . . . . . . . . . . . .  11
92
     7.6.  Truth Value Encoding  . . . . . . . . . . . . . . . . . .  11
93
     7.7.  DWD Storage Formats . . . . . . . . . . . . . . . . . . .  12
94
   8.  Syntax Specification  . . . . . . . . . . . . . . . . . . . .  14
95
     8.1.  ABNF Grammar  . . . . . . . . . . . . . . . . . . . . . .  14
96
     8.2.  Field Value Constraints . . . . . . . . . . . . . . . . .  15
97
   9.  Examples  . . . . . . . . . . . . . . . . . . . . . . . . . .  16
98
     9.1.  Complete Example  . . . . . . . . . . . . . . . . . . . .  16
99
     9.2.  Metadata Only Example . . . . . . . . . . . . . . . . . .  16
100
   10. Security Considerations . . . . . . . . . . . . . . . . . . .  17
101
     10.1.  Input Validation . . . . . . . . . . . . . . . . . . . .  17
102
     10.2.  Field Value Sanitization . . . . . . . . . . . . . . . .  17
103
     10.3.  External References  . . . . . . . . . . . . . . . . . .  18
104
     10.4.  Privacy Considerations . . . . . . . . . . . . . . . . .  18
105
   11. IANA Considerations . . . . . . . . . . . . . . . . . . . . .  18
106
   12. References  . . . . . . . . . . . . . . . . . . . . . . . . .  18
107
     12.1.  Normative References . . . . . . . . . . . . . . . . . .  18
108
     12.2.  Informative References . . . . . . . . . . . . . . . . .  19
109

    
110

    
111

    
112
Potvin & Langlois        Expires 12 August 2026                 [Page 2]
113

114
Internet-Draft                   DWD-PSF                   February 2026
115

    
116

    
117
   Appendix A.  Acknowledgments  . . . . . . . . . . . . . . . . . .  19
118
   Appendix B.  Appendix A.  Comparison with Related Formats . . . .  20
119
     B.1.  CSV (Comma-Separated Values)  . . . . . . . . . . . . . .  20
120
     B.2.  TSV (Tab-Separated Values)  . . . . . . . . . . . . . . .  20
121
     B.3.  JSON  . . . . . . . . . . . . . . . . . . . . . . . . . .  20
122
   Appendix C.  Appendix B.  Implementation Guidelines . . . . . . .  20
123
     C.1.  Parsing Strategy  . . . . . . . . . . . . . . . . . . . .  20
124
     C.2.  Error Handling  . . . . . . . . . . . . . . . . . . . . .  21
125
     C.3.  Round-Trip Preservation . . . . . . . . . . . . . . . . .  21
126
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  21
127

    
128
1.  Introduction
129

    
130
1.1.  Purpose
131

    
132
   This document specifies the Data With Direction (DWD) pipe-separated
133
   file format.  The format represents rules as collections of metadata
134
   and truth tables that define input conditions and output assertions.
135

    
136
   The format is designed for:
137

    
138
   *  Human readability and editability
139

    
140
   *  Machine parsing and processing
141

    
142
   *  Version control system compatibility
143

    
144
   *  Exchange between rule management systems
145

    
146
1.2.  Scope
147

    
148
   This specification defines:
149

    
150
   *  The syntax and structure of DWD pipe-separated files
151

    
152
   *  The interpretation of metadata fields
153

    
154
   *  The encoding of truth tables
155

    
156
   *  Constraints on field values
157

    
158
   This specification does NOT define:
159

    
160
   *  The semantics of specific rule domains
161

    
162
   *  Processing algorithms for truth tables
163

    
164
   *  Storage or transmission mechanisms
165

    
166

    
167

    
168
Potvin & Langlois        Expires 12 August 2026                 [Page 3]
169

170
Internet-Draft                   DWD-PSF                   February 2026
171

    
172

    
173
   *  User interface representations
174

    
175
1.3.  Terminology
176

    
177
   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
178
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
179
   "OPTIONAL" in this document are to be interpreted as described in
180
   BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all
181
   capitals, as shown here.
182

    
183
   Additional terms used in this specification:
184

    
185
   DWD Document:  A file conforming to this specification containing
186
      rule metadata and truth table data.
187

    
188
   Record:  A single line in a DWD document representing either metadata
189
      or truth table data.
190

    
191
   Field:  A data element within a record, separated by pipe characters.
192

    
193
   Truth Table:  A tabular representation of input conditions mapped to
194
      output assertions.
195

    
196
   Scenario:  A specific combination of input conditions identified by a
197
      column in the truth table.
198

    
199
1.4.  Notational Conventions
200

    
201
   This specification uses ABNF [RFC5234] for formal syntax definitions.
202

    
203
   The pipe character '|' is used as both a delimiter in the format and
204
   in ABNF grammar.  In ABNF examples, the pipe character as a delimiter
205
   is represented as %d124 (ASCII decimal value).
206

    
207
2.  Document Structure
208

    
209
2.1.  File Encoding
210

    
211
   DWD documents MUST be encoded using UTF-8 [RFC3629].
212

    
213
   DWD documents SHOULD use Unix-style line endings (LF, %d10).
214
   Implementations MAY also accept Windows-style line endings (CRLF,
215
   %d13 %d10) for interoperability.
216

    
217
   The byte order mark (BOM) MUST NOT be present in DWD documents.
218

    
219

    
220

    
221

    
222

    
223

    
224
Potvin & Langlois        Expires 12 August 2026                 [Page 4]
225

226
Internet-Draft                   DWD-PSF                   February 2026
227

    
228

    
229
3.  Line Structure
230

    
231
   A DWD document consists of a sequence of lines.  Each line represents
232
   either a metadata record or a truth table record.
233

    
234
   Lines are delimited by line ending characters.  The final line of a
235
   document SHOULD be terminated with a line ending.  Parser
236
   implementations MAY handle a final line without a line ending for
237
   robustness against unconforming implementations or legacy or
238
   corrupted data files.
239

    
240
   Blank lines (lines containing only whitespace or empty) SHOULD be
241
   ignored by parsers and SHOULD NOT be generated.
242

    
243
   Lines SHOULD NOT exceed 1000 characters in length.  Implementations
244
   MUST support lines of at least 2000 characters for robustness.
245

    
246
4.  Field Structure
247

    
248
   Each line is composed of fields separated by the pipe character (|,
249
   ASCII 124).  The pipe character serves as the field delimiter.
250

    
251
   Field Structure Rules:
252

    
253
   1.  Every line MUST begin with a pipe character.  For
254
       retrocompatibility and robustness, implementations SHOULD handle
255
       a missing leading pipe character with no functional degradation.
256

    
257
   2.  Every line MUST end with a pipe character and line ending.  For
258
       retrocompatibility and robustness, Implementations SHOULD handle
259
       a missing trailing pipe character with no functional degradation.
260

    
261
   3.  Fields are the text between pipe delimiters.
262

    
263
   4.  Empty fields (consecutive pipes) are valid and represent empty
264
       string values.
265

    
266
   5.  Leading and trailing whitespace within fields SHOULD be preserved
267
       but MAY be trimmed by implementations.
268

    
269
   Example field structure:
270

    
271
   |field1|field2|field3|
272

    
273
   This line contains three fields: "field1", "field2", and "field3".
274

    
275
   |field1||field3|
276

    
277

    
278

    
279

    
280
Potvin & Langlois        Expires 12 August 2026                 [Page 5]
281

282
Internet-Draft                   DWD-PSF                   February 2026
283

    
284

    
285
   This line contains three fields: "field1", "" (empty), and "field3".
286

    
287
5.  Record Types
288

    
289
   DWD documents contain two main sections:
290

    
291
   1.  Metadata Section - Contains descriptive information _about_ the
292
       rule
293

    
294
   2.  Truth Table Section - Contains the decision logic concerned by
295
       the rule as a truth table
296

    
297
   Record type is determined by the content of the first field:
298

    
299
   *  Records with a first field containing a dot-separated identifier
300
      (e.g., "metadata.rule.120_title") are metadata records.  (See
301
      Section 6).
302

    
303
   *  Records with a first field starting with "INDEX" are truth table
304
      column header records.  (See Section 7).
305

    
306
   *  Records with a first field starting with a letter followed by
307
      digits and dots (e.g., "W1.1", "T_W1.1_W2.1_W3.1") are truth table
308
      data records.  (See Section 7).
309

    
310
6.  Metadata Section
311

    
312
6.1.  Metadata Fields
313

    
314
   Metadata records use a key-value pair structure.  The first field
315
   contains the metadata key (a hierarchical identifier), and the second
316
   field contains the value.
317

    
318
   Metadata Record Format:
319

    
320
   |key|value|
321

    
322
   The key uses dot notation to represent hierarchy:
323

    
324
   *  Top-level categories (e.g., "rule_id", "version_standard_url")
325

    
326
   *  Nested properties (e.g., "metadata.rule.120_title")
327

    
328
   *  Array indices (e.g., "metadata.rule.rulemaker_manager.1.name")
329

    
330
   Required Metadata Fields:
331

    
332

    
333

    
334

    
335

    
336
Potvin & Langlois        Expires 12 August 2026                 [Page 6]
337

338
Internet-Draft                   DWD-PSF                   February 2026
339

    
340

    
341
   +==================+=========================+=====================+
342
   | Field            | Description             | Value type          |
343
   +==================+=========================+=====================+
344
   | rule_id          | Unique rule identifier  | UUID                |
345
   +------------------+-------------------------+---------------------+
346
   | ruledata_version | Format version (SemVer) | Dotted digit string |
347
   +------------------+-------------------------+---------------------+
348

    
349
                                 Table 1
350

    
351
   (See Section 8.2).
352

    
353
   Other metadata fields to expect are outside the scope of this
354
   specification, and may evolve independently.  Those two required
355
   fields are considered critical for the technical considerations of
356
   this file format (a unique identifier to distinguish rules
357
   efficiently, and a format version specifier to establish which
358
   specification version was used to produce the file, and allow parser
359
   implementations to efficiently handle different versions).
360

    
361
   A separate specification should be expected to distinguish other
362
   mandatory and optional fields for semantic purpose, detail the
363
   validation rules for the values of those fields, any semantics
364
   attached to them, and constraints on user-specific metadata.
365

    
366
6.2.  Nested Metadata
367

    
368
   Metadata supports nested structures using dot notation and numeric
369
   indices for arrays.
370

    
371
   Object Properties:
372

    
373
   |metadata.rule.rulemaker_manager.1.name|John Doe|
374
   |metadata.rule.rulemaker_manager.1.email|[email protected]|
375

    
376
   Array Representation:
377

    
378
   Arrays are represented using 1-based numeric indices.  The index
379
   appears as the final component of the key path.
380

    
381
   |metadata.rule.rulemaker_manager.1.name|Manager One|
382
   |metadata.rule.rulemaker_manager.2.name|Manager Two|
383

    
384
6.3.  Reserved Fields
385

    
386
   The following field names are reserved and have special meaning:
387

    
388
   *  INDEX - Marks the beginning of the truth table column header row
389

    
390

    
391

    
392
Potvin & Langlois        Expires 12 August 2026                 [Page 7]
393

394
Internet-Draft                   DWD-PSF                   February 2026
395

    
396

    
397
   *  W1, W2... - Truth table row identifiers (World/Condition
398
      identifiers)
399

    
400
   *  T_... - Truth table cell entries (Transaction/Truth entries)
401

    
402
   Reserved field patterns:
403

    
404
   *  /^W\d+(.\d+)*$/ - World/scenario identifiers
405

    
406
   *  /^T_W\d+_W\d+_W\d+/ - Truth table cell identifiers
407

    
408
   *  /^INDEX/ - Column header marker
409

    
410
7.  Truth Table Section
411

    
412
7.1.  Truth Table Structure Overview
413

    
414
   DWD truth tables use a hierarchical organization with three main
415
   categories of rows:
416

    
417
   W1 (World/Scenario):  Defines the possible scenarios or cases being
418
      considered.  Each W1.x row represents a distinct scenario
419
      identifier (e.g., A, B, C, D).
420

    
421
   W2 (Function):  Specifies whether a row represents an input condition
422
      or an output assertion: * W2.1: Input Condition - Conditions that
423
      must be evaluated * W2.2: Output Assertion - Results or actions to
424
      be taken
425

    
426
   W3 (Expression):  Contains the actual logical expressions or values
427
      associated with the conditions.  These may be: * Human-readable
428
      descriptions * Machine-readable JSON structures * References to
429
      external data
430

    
431
   For Lookup Tables, a similar structure uses K-rows:
432

    
433
   K1, K2, K3... (Key Categories):  Hierarchical key dimensions for
434
      multi-dimensional lookup tables.  Each Kx.y represents a specific
435
      key value within a category.
436

    
437
   The relationship between these components creates a three-dimensional
438
   logical space where: * W1 defines the scenario/case dimension * W2
439
   defines the functional dimension (input/output) * W3 provides the
440
   semantic content
441

    
442
   Truth table entries (T-rows) connect these dimensions:
443
   T_W{x}_W{y}_W{z} indicates the truth value at the intersection of
444
   scenario W1.x, function W2.y, and expression W3.z.
445

    
446

    
447

    
448
Potvin & Langlois        Expires 12 August 2026                 [Page 8]
449

450
Internet-Draft                   DWD-PSF                   February 2026
451

    
452

    
453
7.2.  Row Identifiers
454

    
455
   W-Row Identifier Format:
456

    
457
   *  W{n} - Category header (e.g., W1, W2, W3)
458

    
459
   *  W{n}.{m} - Specific condition within category (e.g., W1.1, W1.2)
460

    
461
   *  W{n}.{m}.{o} - Further subdivision (e.g., W1.1.1, W1.1.2)
462

    
463
   W-Row Types:
464

    
465
            +======+==========+==============================+
466
            | Type | Pattern  | Purpose                      |
467
            +======+==========+==============================+
468
            | W1   | W1, W1.x | Scenario/World identifiers   |
469
            +------+----------+------------------------------+
470
            | W2   | W2, W2.x | Function type (Input/Output) |
471
            +------+----------+------------------------------+
472
            | W3   | W3, W3.x | Expression/Value definitions |
473
            +------+----------+------------------------------+
474

    
475
                                 Table 2
476

    
477
   K-Row Identifier Format (for Lookup Tables):
478

    
479
   *  K{n} - Key category header (e.g., K1, K2, K3)
480

    
481
   *  K{n}.{m} - Specific key value (e.g., K1.1, K1.2)
482

    
483
   K-Row Types:
484

    
485
   +===========+================+=====================================+
486
   | Type      | Pattern        | Purpose                             |
487
   +===========+================+=====================================+
488
   | K1, K2... | K1, K1.x, etc. | Key dimension categories            |
489
   +-----------+----------------+-------------------------------------+
490
   | V_...     | V_Kx.y_Kz.w... | Value assertions at key coordinates |
491
   +-----------+----------------+-------------------------------------+
492

    
493
                                 Table 3
494

    
495
   Identifier Constraints:
496

    
497
   *  Numbers are 1-indexed (start at 1, not 0)
498

    
499
   *  Hierarchical depth is theoretically unlimited
500

    
501

    
502

    
503

    
504
Potvin & Langlois        Expires 12 August 2026                 [Page 9]
505

506
Internet-Draft                   DWD-PSF                   February 2026
507

    
508

    
509
   *  Each identifier within a category MUST be unique
510

    
511
   *  Labels (second field) provide human-readable descriptions
512

    
513
7.3.  Column Headers
514

    
515
   The truth table section begins with a column header row.  This row
516
   defines the columns of the truth table and their indices.
517

    
518
   Column Header Format:
519

    
520
   |INDEX|DATA|1|2|3|4|5|...|n|
521

    
522
   Where: * "INDEX" - Identifies this as the column header row * "DATA"
523
   - Indicates data columns follow * "1" through "n" - Column numbers
524
   (positive integers)
525

    
526
   The column header row establishes the numbering for all subsequent
527
   truth table data rows.
528

    
529
7.4.  Data Rows
530

    
531
   Truth table data rows represent either:
532

    
533
   a) Row headers (labels for conditions or assertions) b) Truth values
534
   (the actual decision logic)
535

    
536
   Row Header Format:
537

    
538
   |identifier|label|index1|index2|...|indexN|
539

    
540
   Examples:
541

    
542
   |W1|COLUMNHEADER|1|2|3|4|5|...|
543
   |W1.1|A|1|10|19|28|...|
544
   |W2|Function|1|2|3|4|5|...|
545

    
546
   Truth Value Format:
547

    
548
   |T_W{row}_W{col}_W{expr}|value|column|
549

    
550
   Examples:
551

    
552
   |T_W1.1_W2.1_W3.1|01|1|
553
   |T_W1.2_W2.1_W3.1|00|2|
554

    
555

    
556

    
557

    
558

    
559

    
560
Potvin & Langlois        Expires 12 August 2026                [Page 10]
561

562
Internet-Draft                   DWD-PSF                   February 2026
563

    
564

    
565
7.5.  Expression Field Content
566

    
567
   W3 (Expression) rows contain the semantic definitions of conditions
568
   and assertions.  These fields MAY contain:
569

    
570
   Plain Text: * Human-readable descriptions of conditions * Natural
571
   language statements
572

    
573
   JSON Structures: * Machine-parseable structured data * Semantic
574
   triples or property-value pairs * References to external vocabularies
575

    
576
   Example JSON in expression field:
577

    
578
|W3.1|{"determiner":"The","noun":"box","past_participle_verb":"measured","attribute":"type","predicate_verb":"is","description":"standard"}|
579

    
580
   JSON Escaping Rules:
581

    
582
   *  Double quotes within JSON MUST be escaped as "
583

    
584
   *  Backslashes MUST be escaped as \
585

    
586
   *  Newlines within JSON SHOULD be avoided; use \n if necessary
587

    
588
   *  The entire JSON object MUST be valid JSON when unescaped
589

    
590
   Parsers SHOULD: * Detect JSON content by attempting to parse the
591
   field value * Fall back to treating content as plain text if JSON
592
   parsing fails * Validate JSON structure according to application-
593
   specific schemas
594

    
595
   Note: The JSON structure shown in examples uses a specific vocabulary
596
   for rule expressions.  The exact schema is application-dependent and
597
   outside the scope of this specification.
598

    
599
7.6.  Truth Value Encoding
600

    
601
   DWD uses a four-valued logic system encoded as two-character strings.
602
   This supports classical binary logic as well as reasoning under
603
   uncertainty and paraconsistent scenarios.
604

    
605

    
606

    
607

    
608

    
609

    
610

    
611

    
612

    
613

    
614

    
615

    
616
Potvin & Langlois        Expires 12 August 2026                [Page 11]
617

618
Internet-Draft                   DWD-PSF                   February 2026
619

    
620

    
621
     +=======+=======================================================+
622
     | Value | Meaning                                               |
623
     +=======+=======================================================+
624
     | "00"  | FALSE / Absent - Condition not met, assertion invalid |
625
     +-------+-------------------------------------------------------+
626
     | "01"  | TRUE / Present - Condition met, assertion valid       |
627
     +-------+-------------------------------------------------------+
628
     | "10"  | MAYBE / UNKNOWN - Undetermined, uncertain, or         |
629
     |       | requires further evaluation                           |
630
     +-------+-------------------------------------------------------+
631
     | "11"  | BOTH / CONTRADICTION - Inconsistent state, both true  |
632
     |       | and false simultaneously                              |
633
     +-------+-------------------------------------------------------+
634

    
635
                                  Table 4
636

    
637
   The four-valued logic allows DWD to represent: * Classical binary
638
   decisions (00, 01) * Uncertainty or incomplete information (10) *
639
   Inconsistent or contradictory states (11)
640

    
641
   Processing Behavior:
642

    
643
   *  When evaluating truth tables, implementations SHOULD handle all
644
      four values according to the logic semantics appropriate for the
645
      application domain.
646

    
647
   *  The "10" (unknown) value indicates that the truth of the condition
648
      cannot be determined from available data, and MAY trigger
649
      additional data collection or default handling.
650

    
651
   *  The "11" (contradiction) value indicates a logical inconsistency
652
      that SHOULD be flagged for review or resolution.
653

    
654
   Note: Earlier versions of DWD used "--" to indicate "don't care"
655
   conditions.  This is now deprecated in favor of explicit four-valued
656
   encoding.
657

    
658
7.7.  DWD Storage Formats
659

    
660
   DWD supports two complementary storage formats for truth table data:
661

    
662
   DWD Array Format (KVa) ~~~~~~~~~~~~~~~~~~~~~
663

    
664
   The full matrix representation with explicit 00/01/10/11 values in
665
   every cell.  This format is human-readable and suitable for direct
666
   inspection and auditing.
667

    
668

    
669

    
670

    
671

    
672
Potvin & Langlois        Expires 12 August 2026                [Page 12]
673

674
Internet-Draft                   DWD-PSF                   February 2026
675

    
676

    
677
   Characteristics: * Complete truth table matrix with all cells
678
   populated * Binary patterns clearly visible for validation * Identity
679
   matrix structure for value assertions * Suitable for visualization
680
   and debugging
681

    
682
   Example (truncated):
683

    
684
   |K1.1|Label|01|00|00|01|00|00|
685
   |K1.2|Label|00|01|00|00|01|00|
686
   |T_K1.1_K2.1_K3.1|Value|01|00|00|00|00|00|
687

    
688
   DWD Coordinates Format (KVc) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
689

    
690
   A compressed representation listing only the column indices where
691
   values are present (01).  This format is optimized for storage and
692
   transmission.
693

    
694
   Characteristics: * Lists only column numbers where value is "01" *
695
   Compact representation suitable for large tables * Easily auditable
696
   via text search on index numbers * Can be expanded to full array
697
   format when needed
698

    
699
   Format:
700

    
701
   |identifier|label|column1|column2|...|columnN|
702

    
703
   Where column numbers are 1-indexed positions where the value is "01".
704

    
705
   Example:
706

    
707
   |K1.1|Label|1|4|7|10|
708
   |K1.2|Label|2|5|8|11|
709
   |V_K1.1_K2.1_K3.1|Value|1|
710

    
711
   Conversion:
712

    
713
   *  Array to Coordinates: For each row, record column indices where
714
      value equals "01"
715

    
716
   *  Coordinates to Array: Create matrix with "00" in all cells, then
717
      set "01" at specified coordinates
718

    
719
   Implementation Note:
720

    
721
   RuleMaker generates the Coordinates format for storage efficiency.
722
   The Array format is useful for visualization, debugging, and direct
723
   human audit.  Both formats contain identical semantic information.
724

    
725

    
726

    
727

    
728
Potvin & Langlois        Expires 12 August 2026                [Page 13]
729

730
Internet-Draft                   DWD-PSF                   February 2026
731

    
732

    
733
8.  Syntax Specification
734

    
735
8.1.  ABNF Grammar
736

    
737
   The following grammar defines the formal syntax of DWD documents
738
   using ABNF [RFC5234].
739

    
740
   ; Basic Definitions
741
   PIPE           = %d124           ; "|" character
742
   CR             = %d13            ; Carriage return
743
   LF             = %d10            ; Line feed
744
   CRLF           = CR LF           ; Internet standard newline
745
   VCHAR          = %d33-126        ; Visible characters
746
   WSP            = SP / HTAB       ; White space
747
   SP             = %d32            ; Space
748
   HTAB           = %d9             ; Horizontal tab
749
   DIGIT          = %d48-57         ; 0-9
750
   ALPHA          = %d65-90 / %d97-122  ; A-Z / a-z
751

    
752
   ; Document Structure
753
   dwd-document   = *metadata-record
754
                    truth-table-section
755

    
756
   ; Line Ending (Unix-style preferred, Windows accepted)
757
   line-ending    = LF / CRLF
758

    
759
   ; Metadata Records
760
   metadata-record = PIPE metadata-key PIPE field-value PIPE line-ending
761

    
762
   metadata-key   = key-segment *("." key-segment)
763
   key-segment    = 1*(ALPHA / DIGIT / "_" / "-")
764
                  / array-index
765
   array-index    = 1*DIGIT        ; 1-based indexing
766

    
767
   ; Truth Table Section
768
   truth-table-section = column-header
769
                         *row-header
770
                         *truth-value-row
771

    
772
   column-header  = PIPE "INDEX" PIPE "DATA" *column-number PIPE line-ending
773
   column-number  = PIPE 1*DIGIT
774

    
775
   row-header     = PIPE row-id PIPE row-label *column-reference PIPE line-ending
776
   row-id         = world-id / key-id
777
   world-id       = "W" 1*DIGIT *("." 1*DIGIT)
778
   key-id         = "K" 1*DIGIT *("." 1*DIGIT)
779
   row-label      = 1*VCHAR
780
   column-reference = PIPE 1*DIGIT
781

    
782

    
783

    
784
Potvin & Langlois        Expires 12 August 2026                [Page 14]
785

786
Internet-Draft                   DWD-PSF                   February 2026
787

    
788

    
789
   truth-value-row = PIPE truth-id PIPE truth-value PIPE column-index PIPE line-ending
790
   truth-id       = "T_" world-id "_" world-id "_" world-id
791
   truth-value    = "00" / "01" / "10" / "11"
792
   column-index   = 1*DIGIT
793

    
794
   ; Coordinates Format (KVc)
795
   coordinates-row = PIPE coords-id PIPE coords-label *column-number PIPE line-ending
796
   coords-id      = value-id / key-id
797
   value-id       = "V_" key-id *("_" key-id)
798

    
799
   ; Field Values
800
   field-value    = *safe-char
801
   safe-char      = VCHAR / WSP / UTF8-char
802
   UTF8-char      = %x80-FF        ; UTF-8 multibyte sequences
803

    
804
   ; Reserved Identifiers
805
   reserved-id    = "INDEX" / "DATA" / "W" 1*DIGIT / "K" 1*DIGIT / "V_" / "T_"
806

    
807
8.2.  Field Value Constraints
808

    
809
   Metadata Field Value Constraints:
810

    
811
    +=========================+======================================+
812
    | Field                   | Constraints                          |
813
    +=========================+======================================+
814
    | rule_id                 | UUID format [RFC4122]                |
815
    +-------------------------+--------------------------------------+
816
    | ruledata_version        | Semantic Versioning (SemVer 2.0.0)   |
817
    +-------------------------+--------------------------------------+
818
    | version_standard_url    | Valid URL [RFC3986]                  |
819
    +-------------------------+--------------------------------------+
820
    | properties.id           | UUID format                          |
821
    +-------------------------+--------------------------------------+
822
    | metadata.rule.url       | Valid URL                            |
823
    +-------------------------+--------------------------------------+
824
    | linked_rules_or_lookups | JSON array format or empty [RFC8259] |
825
    +-------------------------+--------------------------------------+
826

    
827
                                 Table 5
828

    
829
   UUID Format:
830

    
831
   UUIDs MUST conform to RFC 4122 format:
832

    
833
   xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
834

    
835
   Where x is a hexadecimal digit (0-9, a-f, A-F).
836

    
837

    
838

    
839

    
840
Potvin & Langlois        Expires 12 August 2026                [Page 15]
841

842
Internet-Draft                   DWD-PSF                   February 2026
843

    
844

    
845
   Semantic Versioning:
846

    
847
   Versions MUST follow SemVer 2.0.0 format:
848

    
849
   MAJOR.MINOR.PATCH
850

    
851
9.  Examples
852

    
853
9.1.  Complete Example
854

    
855
   The following example demonstrates a complete DWD document with both
856
   metadata and truth table sections.
857

    
858
   |rule_id|933e80c7-72d8-4990-8445-97ea6799322d|
859
   |rulereserve_nodes|*|
860
   |version_standard_url|https://semver.org/|
861
   |ruledata_version|0.0.0|
862
   |properties.id|933e80c7-72d8-4990-8445-97ea6799322d|
863
   |metadata.rule.120_title|Test Rule|
864
   |metadata.rule.240_summary|Example summary text|
865
   |metadata.rule.960_explanation|Detailed explanation of rule logic|
866
   |metadata.rule.rule_group|test-group|
867
   |metadata.rule.rule_criticality|experimental|
868
   |metadata.rule.url|https://example.com/rule|
869
   |metadata.rule.rulemaker_manager.1.name|John Doe|
870
   |metadata.rule.rulemaker_manager.1.email|[email protected]|
871
   |linked_rules_or_lookups|[]|
872
   |in_effect.1.country|US|
873
   |in_effect.1.subcountry|US-CA|
874
   |in_effect.1.timezone|2025-07-07T11:49:51-05:00|
875
   |INDEX|DATA|1|2|3|4|5|
876
   |W1|COLUMNHEADER|1|2|3|4|5|
877
   |W1.1|A|1|2|3|4|5|
878
   |W1.2|B|6|7|8|9|10|
879
   |W2|Function|1|2|3|4|5|
880
   |W2.1|Input Condition|1|2|3||
881
   |W2.2|Output Assertion||4|5||
882
   |W3|Expression|1|2|3|4|5|
883
   |W3.1|{"noun":"test"}|1|2||4|5|
884
   |T_W1.1_W2.1_W3.1|01|1|
885
   |T_W1.2_W2.1_W3.1|00|2|
886
   |T_W1.1_W2.2_W3.1|01|4|
887

    
888
9.2.  Metadata Only Example
889

    
890
   A DWD document containing only metadata:
891

    
892

    
893

    
894

    
895

    
896
Potvin & Langlois        Expires 12 August 2026                [Page 16]
897

898
Internet-Draft                   DWD-PSF                   February 2026
899

    
900

    
901
   |rule_id|a1b2c3d4-e5f6-7890-abcd-ef1234567890|
902
   |ruledata_version|1.0.0|
903
   |version_standard_url|https://semver.org/|
904
   |properties.id|a1b2c3d4-e5f6-7890-abcd-ef1234567890|
905
   |metadata.rule.120_title|Simple Rule|
906
   |metadata.rule.240_summary|A rule with only metadata|
907

    
908
10.  Security Considerations
909

    
910
   This section discusses security considerations when processing DWD
911
   documents.
912

    
913
10.1.  Input Validation
914

    
915
   Parsers MUST validate input to prevent:
916

    
917
   *  Buffer overflow attacks via excessively long lines
918

    
919
   *  Memory exhaustion via deeply nested structures
920

    
921
   *  Injection attacks through field values
922

    
923
   Implementations SHOULD enforce reasonable limits on:
924

    
925
   *  Maximum line length (recommended: 10,000 characters)
926

    
927
   *  Maximum number of fields per line (recommended: 10,000)
928

    
929
   *  Maximum file size (recommended: 100 MB)
930

    
931
   *  Maximum nesting depth for metadata keys (recommended: 10 levels)
932

    
933
10.2.  Field Value Sanitization
934

    
935
   Field values MAY contain arbitrary text including:
936

    
937
   *  HTML/XML markup
938

    
939
   *  JSON data structures
940

    
941
   *  SQL fragments
942

    
943
   *  Script code
944

    
945
   Applications processing DWD documents MUST NOT execute field values
946
   as code without proper sanitization and validation.
947

    
948

    
949

    
950

    
951

    
952
Potvin & Langlois        Expires 12 August 2026                [Page 17]
953

954
Internet-Draft                   DWD-PSF                   February 2026
955

    
956

    
957
10.3.  External References
958

    
959
   Metadata fields such as "url" and "version_standard_url" contain
960
   external references.  Applications SHOULD:
961

    
962
   *  Validate URL schemes (allow only http, https)
963

    
964
   *  Implement timeouts for external resource fetching
965

    
966
   *  Cache external resources to prevent repeated requests
967

    
968
   *  Not automatically dereference URLs without user consent
969

    
970
10.4.  Privacy Considerations
971

    
972
   DWD documents may contain personally identifiable information (PII)
973
   in metadata fields such as:
974

    
975
   *  Rule maker names and email addresses
976

    
977
   *  Organization-specific identifiers
978

    
979
   *  Jurisdictional information
980

    
981
   Implementations SHOULD:
982

    
983
   *  Allow redaction or anonymization of PII fields
984

    
985
   *  Implement access controls for sensitive rule documents
986

    
987
   *  Log access to documents containing PII
988

    
989
11.  IANA Considerations
990

    
991
   This document has no IANA actions.
992

    
993
12.  References
994

    
995
12.1.  Normative References
996

    
997
   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
998
              Requirement Levels", BCP 14, RFC 2119,
999
              DOI 10.17487/RFC2119, March 1997,
1000
              <https://www.rfc-editor.org/info/rfc2119>.
1001

    
1002
   [RFC3629]  Yergeau, F., "UTF-8, a transformation format of ISO
1003
              10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November
1004
              2003, <https://www.rfc-editor.org/info/rfc3629>.
1005

    
1006

    
1007

    
1008
Potvin & Langlois        Expires 12 August 2026                [Page 18]
1009

1010
Internet-Draft                   DWD-PSF                   February 2026
1011

    
1012

    
1013
   [RFC3986]  Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
1014
              Resource Identifier (URI): Generic Syntax", STD 66,
1015
              RFC 3986, DOI 10.17487/RFC3986, January 2005,
1016
              <https://www.rfc-editor.org/info/rfc3986>.
1017

    
1018
   [RFC4122]  Leach, P., Mealling, M., and R. Salz, "A Universally
1019
              Unique IDentifier (UUID) URN Namespace", RFC 4122,
1020
              DOI 10.17487/RFC4122, July 2005,
1021
              <https://www.rfc-editor.org/info/rfc4122>.
1022

    
1023
   [RFC5234]  Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax
1024
              Specifications: ABNF", STD 68, RFC 5234,
1025
              DOI 10.17487/RFC5234, January 2008,
1026
              <https://www.rfc-editor.org/info/rfc5234>.
1027

    
1028
   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
1029
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
1030
              May 2017, <https://www.rfc-editor.org/info/rfc8174>.
1031

    
1032
12.2.  Informative References
1033

    
1034
   [RFC5322]  Resnick, P., Ed., "Internet Message Format", RFC 5322,
1035
              DOI 10.17487/RFC5322, October 2008,
1036
              <https://www.rfc-editor.org/info/rfc5322>.
1037

    
1038
   [RFC4287]  Nottingham, M., Ed. and R. Sayre, Ed., "The Atom
1039
              Syndication Format", RFC 4287, DOI 10.17487/RFC4287,
1040
              December 2005, <https://www.rfc-editor.org/info/rfc4287>.
1041

    
1042
   [SemVer]   Preston-Werner, T., "Semantic Versioning 2.0.0", June
1043
              2013, <https://semver.org/spec/v2.0.0.html>.
1044

    
1045
   [RFC8259]  Bray, T., Ed., "The JavaScript Object Notation (JSON) Data
1046
              Interchange Format", STD 90, RFC 8259,
1047
              DOI 10.17487/RFC8259, December 2017,
1048
              <https://www.rfc-editor.org/info/rfc8259>.
1049

    
1050
Appendix A.  Acknowledgments
1051

    
1052
   The authors would like to thank the Xalgorithms Foundation and all
1053
   contributors to the Data With Direction Specification.
1054

    
1055
   Special thanks to Wayne Cunneyworth for pioneering Table Driven
1056
   Design, and to all members of the Xalgorithms Alliance who have
1057
   contributed to the development and refinement of the DWD format.
1058

    
1059

    
1060

    
1061

    
1062

    
1063

    
1064
Potvin & Langlois        Expires 12 August 2026                [Page 19]
1065

1066
Internet-Draft                   DWD-PSF                   February 2026
1067

    
1068

    
1069
Appendix B.  Appendix A.  Comparison with Related Formats
1070

    
1071
   This appendix provides a non-normative comparison between DWD pipe-
1072
   separated format and similar data formats.
1073

    
1074
B.1.  CSV (Comma-Separated Values)
1075

    
1076
        +=============+==================+=======================+
1077
        | Aspect      | CSV              | DWD Pipe-Separated    |
1078
        +=============+==================+=======================+
1079
        | Delimiter   | Comma (,)        | Pipe (|)              |
1080
        +-------------+------------------+-----------------------+
1081
        | Quoting     | Double quotes    | No quoting required   |
1082
        +-------------+------------------+-----------------------+
1083
        | Header row  | Single header    | Multiple header types |
1084
        +-------------+------------------+-----------------------+
1085
        | Metadata    | Not standardized | Native support        |
1086
        +-------------+------------------+-----------------------+
1087
        | Nested data | Flat structure   | Dot notation support  |
1088
        +-------------+------------------+-----------------------+
1089

    
1090
                                 Table 6
1091

    
1092
B.2.  TSV (Tab-Separated Values)
1093

    
1094
   Similar to CSV but uses tab characters as delimiters.  DWD format
1095
   differs by using visible pipe characters and supporting structured
1096
   metadata alongside tabular data.
1097

    
1098
B.3.  JSON
1099

    
1100
   JSON provides hierarchical data representation but lacks the human-
1101
   editable tabular format of DWD.  DWD truth tables can be converted to
1102
   JSON arrays, and DWD documents often have equivalent JSON
1103
   representations.
1104

    
1105
Appendix C.  Appendix B.  Implementation Guidelines
1106

    
1107
C.1.  Parsing Strategy
1108

    
1109
   Implementations are RECOMMENDED to use a two-pass parsing approach:
1110

    
1111
   1.  First pass: Identify line types (metadata vs. truth table)
1112

    
1113
   2.  Second pass: Parse fields according to line type
1114

    
1115

    
1116

    
1117

    
1118

    
1119

    
1120
Potvin & Langlois        Expires 12 August 2026                [Page 20]
1121

1122
Internet-Draft                   DWD-PSF                   February 2026
1123

    
1124

    
1125
C.2.  Error Handling
1126

    
1127
   Parsers SHOULD provide detailed error information including:
1128

    
1129
   *  Line number where error occurred
1130

    
1131
   *  Type of error (syntax, validation, constraint violation)
1132

    
1133
   *  Suggested correction if applicable
1134

    
1135
C.3.  Round-Trip Preservation
1136

    
1137
   Implementations SHOULD preserve the following when reading and
1138
   writing DWD documents:
1139

    
1140
   *  Field order within records
1141

    
1142
   *  Whitespace within field values
1143

    
1144
   *  Presence or absence of optional fields
1145

    
1146
   *  Comment lines (if supported)
1147

    
1148
Authors' Addresses
1149

    
1150
   Joseph Potvin
1151
   Xalgorithms Foundation
1152
   Email: [email protected]
1153

    
1154

    
1155
   Charles Langlois
1156
   Xalgorithms Foundation
1157
   Email: [email protected]
1158

    
1159

    
1160

    
1161

    
1162

    
1163

    
1164

    
1165

    
1166

    
1167

    
1168

    
1169

    
1170

    
1171

    
1172

    
1173

    
1174

    
1175

    
1176
Potvin & Langlois        Expires 12 August 2026                [Page 21]
(5-5/5)