-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhwp_ir_v1.json
More file actions
1262 lines (1262 loc) · 40.6 KB
/
hwp_ir_v1.json
File metadata and controls
1262 lines (1262 loc) · 40.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://danmeon.github.io/rhwp-python/schema/hwp_ir/v1/schema.json",
"$defs": {
"CaptionBlock": {
"additionalProperties": false,
"description": "캡션 블록 — 그림/표 등에 부착되는 보조 설명.\n\nHWP 는 ``Picture.caption: Option<Caption>`` / ``Table.caption: Option<Caption>``\n으로 항상 1:1 부착 관계 — 캡션은 부모 블록의 필드로 컨테인먼트 (ref-id 미도입).\nAzure DI / Docling 의 string-ref 패턴은 1:N 주소가 가능하지만 HWP 사용처에서\n이점이 없고 소비자가 JSON-Pointer resolver 를 구현해야 하므로 거부 (spec § 5).\n\n``blocks`` 가 재귀 ``Block`` 리스트 — 캡션 안의 인라인 수식·필드도 자연스럽게\n표현 (예: ``\"<그림 1> 회로도 ${}^{2}$\"`` 같은 캡션).\n\n``direction`` 은 캡션 배치 방향. 상류 ``CaptionDirection`` (Left/Right/Top/Bottom)\n을 lowercase Literal 로 매핑. 기본값 ``\"bottom\"`` 은 HWP 기본 + Docling 관례\n일치.",
"properties": {
"kind": {
"const": "caption",
"default": "caption",
"title": "Kind",
"type": "string"
},
"blocks": {
"items": {
"oneOf": [
{
"$ref": "#/$defs/ParagraphBlock"
},
{
"$ref": "#/$defs/TableBlock"
},
{
"$ref": "#/$defs/PictureBlock"
},
{
"$ref": "#/$defs/FormulaBlock"
},
{
"$ref": "#/$defs/FootnoteBlock"
},
{
"$ref": "#/$defs/EndnoteBlock"
},
{
"$ref": "#/$defs/ListItemBlock"
},
{
"$ref": "#/$defs/CaptionBlock"
},
{
"$ref": "#/$defs/TocBlock"
},
{
"$ref": "#/$defs/FieldBlock"
},
{
"$ref": "#/$defs/UnknownBlock"
}
]
},
"title": "Blocks",
"type": "array"
},
"direction": {
"default": "bottom",
"enum": [
"top",
"bottom",
"left",
"right"
],
"title": "Direction",
"type": "string"
},
"prov": {
"$ref": "#/$defs/Provenance"
}
},
"required": [
"prov"
],
"title": "CaptionBlock",
"type": "object"
},
"DocumentMetadata": {
"additionalProperties": false,
"description": "문서 레벨 메타데이터. 시각은 ISO 8601 문자열로 출고한다.",
"properties": {
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Title"
},
"author": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Author"
},
"creation_time": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Creation Time"
},
"modification_time": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Modification Time"
}
},
"title": "DocumentMetadata",
"type": "object"
},
"DocumentSource": {
"additionalProperties": false,
"description": "문서 출처 — RAG 응답 역추적 시 \"이 답이 어느 파일에서 나왔나\" 에 응답한다.\n\n스키마는 ``uri`` 형식을 강제하지 않으므로 소비자가 file://, https://, 혹은\n``mem://{hash}`` 같은 custom 스킴으로 정규화할 수 있다. 향후 ``format``,\n``bytes_size``, ``sha256`` 등 재현성 필드는 기본값 있는 옵셔널로만 추가 —\n이 경로는 기존 JSON 과 MINOR 호환 유지.",
"properties": {
"uri": {
"description": "파일 시스템 경로, URL, 혹은 소비자 정의 식별자. RFC 3986 URI reference 로 해석 가능한 문자열이면 충분하다.",
"title": "Uri",
"type": "string"
}
},
"required": [
"uri"
],
"title": "DocumentSource",
"type": "object"
},
"EndnoteBlock": {
"additionalProperties": false,
"description": "미주 블록 — HWP ``Control::Endnote``.\n\n각주와 같은 구조지만 배치가 다르다 (각주: 페이지 하단, 미주: 문서/구역 끝).\nHWP 가 별도 struct 로 분리하므로 IR 도 분리 — 통합 시 정보 손실.",
"properties": {
"kind": {
"const": "endnote",
"default": "endnote",
"title": "Kind",
"type": "string"
},
"number": {
"title": "Number",
"type": "integer"
},
"blocks": {
"items": {
"oneOf": [
{
"$ref": "#/$defs/ParagraphBlock"
},
{
"$ref": "#/$defs/TableBlock"
},
{
"$ref": "#/$defs/PictureBlock"
},
{
"$ref": "#/$defs/FormulaBlock"
},
{
"$ref": "#/$defs/FootnoteBlock"
},
{
"$ref": "#/$defs/EndnoteBlock"
},
{
"$ref": "#/$defs/ListItemBlock"
},
{
"$ref": "#/$defs/CaptionBlock"
},
{
"$ref": "#/$defs/TocBlock"
},
{
"$ref": "#/$defs/FieldBlock"
},
{
"$ref": "#/$defs/UnknownBlock"
}
]
},
"title": "Blocks",
"type": "array"
},
"marker_prov": {
"$ref": "#/$defs/Provenance"
},
"prov": {
"$ref": "#/$defs/Provenance"
}
},
"required": [
"number",
"marker_prov",
"prov"
],
"title": "EndnoteBlock",
"type": "object"
},
"FieldBlock": {
"additionalProperties": false,
"description": "필드 컨트롤 — HWP ``Control::Field`` (TOC 제외 13 종 + Unknown).\n\n상류 ``FieldType`` 14 종 → 닫힌 ``FieldKind`` Literal 매핑. ``TableOfContents``\n는 별도 ``TocBlock`` 으로 라우팅되므로 ``FieldBlock`` 에는 ``\"toc\"`` 가\n원칙적으로 등장 안 함 — Literal 로 보존만 하고 (사용자가 직접 구성 시 호환).\n\n``InlineRun.href`` 와의 중복: HWP ``Hyperlink`` / ``Bookmark`` Field 는 본문\nInlineRun 의 ``href`` 로 표현될 수도 있지만 v0.3.0 은 모든 Field control 을\n별도 FieldBlock 으로 emit 한다 — InlineRun.href 자동 채움 path 는 미구현.\n\n``raw_instruction`` 은 round-trip 보존용 — Word ``<w:instrText>`` 와 같은 raw\n명령 문자열. v0.3.0 소비자는 보통 ``cached_value`` 만 사용하지만, 미래\nwriteback 시 raw 가 필요.\n\n``field_type_code`` 는 forward-compat — 상류가 새 FieldType 을 추가하면\n매퍼는 ``field_kind=\"unknown\"`` + ``field_type_code=<raw>`` 로 출고하고,\n다음 MINOR (v0.4.0) 에서 Literal 확장.",
"properties": {
"kind": {
"const": "field",
"default": "field",
"title": "Kind",
"type": "string"
},
"field_kind": {
"default": "unknown",
"enum": [
"date",
"doc_date",
"path",
"bookmark",
"mailmerge",
"crossref",
"calc",
"clickhere",
"summary",
"userinfo",
"hyperlink",
"memo",
"private_info",
"toc",
"unknown"
],
"title": "Field Kind",
"type": "string"
},
"cached_value": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "저장 시점 표시 값 (예: ``\"2026-04-26\"``). 동적 필드는 stale 가능.",
"title": "Cached Value"
},
"raw_instruction": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "HWP field command (Word ``<w:instrText>`` 대응) — round-trip 보존.",
"title": "Raw Instruction"
},
"field_type_code": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "미지의 raw 코드 — 상류 FieldType 추가 시 forward-compat.",
"title": "Field Type Code"
},
"prov": {
"$ref": "#/$defs/Provenance"
}
},
"required": [
"prov"
],
"title": "FieldBlock",
"type": "object"
},
"FootnoteBlock": {
"additionalProperties": false,
"description": "각주 블록 — HWP ``Control::Footnote``.\n\n각주 본문은 ``furniture.footnotes`` 로 라우팅되어 RAG 의 body 검색을 오염시키지\n않는다. ``marker_prov`` 는 본문 인용 마커 (``…기존 연구[3]…`` 의 ``[3]`` 위치) 의\nparent paragraph (section_idx, para_idx) 를 가리킨다 — 정확한 char_offset 까지는\n상류 ``field_ranges`` 매핑이 필요해 v0.4.0+ 검토. ``prov`` 는 각주 본문 자체의\n위치 = 마커가 등장한 paragraph 와 동일 (각주는 그 paragraph 에서 파생).\n\n``blocks`` 가 재귀 ``Block`` 리스트라 각주 본문 안의 표·그림·수식도 자연 지원.",
"properties": {
"kind": {
"const": "footnote",
"default": "footnote",
"title": "Kind",
"type": "string"
},
"number": {
"description": "표시 번호 (1, 2, 3, ...).",
"title": "Number",
"type": "integer"
},
"blocks": {
"items": {
"oneOf": [
{
"$ref": "#/$defs/ParagraphBlock"
},
{
"$ref": "#/$defs/TableBlock"
},
{
"$ref": "#/$defs/PictureBlock"
},
{
"$ref": "#/$defs/FormulaBlock"
},
{
"$ref": "#/$defs/FootnoteBlock"
},
{
"$ref": "#/$defs/EndnoteBlock"
},
{
"$ref": "#/$defs/ListItemBlock"
},
{
"$ref": "#/$defs/CaptionBlock"
},
{
"$ref": "#/$defs/TocBlock"
},
{
"$ref": "#/$defs/FieldBlock"
},
{
"$ref": "#/$defs/UnknownBlock"
}
]
},
"title": "Blocks",
"type": "array"
},
"marker_prov": {
"$ref": "#/$defs/Provenance",
"description": "본문 인용 마커 위치 — RAG 가 각주가 어디서 인용됐는지 역추적."
},
"prov": {
"$ref": "#/$defs/Provenance"
}
},
"required": [
"number",
"marker_prov",
"prov"
],
"title": "FootnoteBlock",
"type": "object"
},
"FormulaBlock": {
"additionalProperties": false,
"description": "수식 블록 — HWP ``Control::Equation``.\n\nHWP 수식은 자체 스크립트 (``script``) 로 저장된다 (예: ``\"1 over 2 + sqrt{x^2}\"``).\nHWP equation script → LaTeX/MathML 자동 변환은 공개 도구 부재로 v0.3.0 미제공\n(spec § 비목표). ``script_kind=\"hwp_eq\"`` 로 raw 출고 → 사용자가 외부 변환 후\n``model_copy(update={\"script\": tex, \"script_kind\": \"latex\"})`` 로 재구성 가능.\n\n``text_alt`` 는 RAG 폴백 — 단순 정규화 (``over`` → ``/``, ``sqrt{...}`` → ``√(...)``)\n까지만 적용. 실패 시 None.",
"properties": {
"kind": {
"const": "formula",
"default": "formula",
"title": "Kind",
"type": "string"
},
"script": {
"title": "Script",
"type": "string"
},
"script_kind": {
"default": "hwp_eq",
"enum": [
"hwp_eq",
"latex",
"mathml"
],
"title": "Script Kind",
"type": "string"
},
"text_alt": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "평문 근사 — RAG fallback. ``script`` 의 사람이 읽을 수 있는 형태 (``over`` → ``/`` 등) 를 단순 정규화. 실패 시 None.",
"title": "Text Alt"
},
"inline": {
"default": false,
"description": "True: 본문 인라인 수식, False: 별도 디스플레이 수식.",
"title": "Inline",
"type": "boolean"
},
"prov": {
"$ref": "#/$defs/Provenance"
}
},
"required": [
"script",
"prov"
],
"title": "FormulaBlock",
"type": "object"
},
"Furniture": {
"additionalProperties": false,
"description": "장식 노드 컨테이너 — RAG 가 임베딩에서 필터링 가능.\n\nv0.3.0 S1 부터 ``page_headers`` / ``page_footers`` 가 실제 채워진다.\nv0.3.0 S2 부터 ``footnotes`` / ``endnotes`` 도 실제 채워지며 타입이\n``list[FootnoteBlock]`` / ``list[EndnoteBlock]`` 으로 강화된다.\n\niter_blocks(scope=\"furniture\") 순서: page_headers → page_footers →\nfootnotes → endnotes (spec § 8 furniture 순서 계약).",
"properties": {
"page_headers": {
"items": {
"oneOf": [
{
"$ref": "#/$defs/ParagraphBlock"
},
{
"$ref": "#/$defs/TableBlock"
},
{
"$ref": "#/$defs/PictureBlock"
},
{
"$ref": "#/$defs/FormulaBlock"
},
{
"$ref": "#/$defs/FootnoteBlock"
},
{
"$ref": "#/$defs/EndnoteBlock"
},
{
"$ref": "#/$defs/ListItemBlock"
},
{
"$ref": "#/$defs/CaptionBlock"
},
{
"$ref": "#/$defs/TocBlock"
},
{
"$ref": "#/$defs/FieldBlock"
},
{
"$ref": "#/$defs/UnknownBlock"
}
]
},
"title": "Page Headers",
"type": "array"
},
"page_footers": {
"items": {
"oneOf": [
{
"$ref": "#/$defs/ParagraphBlock"
},
{
"$ref": "#/$defs/TableBlock"
},
{
"$ref": "#/$defs/PictureBlock"
},
{
"$ref": "#/$defs/FormulaBlock"
},
{
"$ref": "#/$defs/FootnoteBlock"
},
{
"$ref": "#/$defs/EndnoteBlock"
},
{
"$ref": "#/$defs/ListItemBlock"
},
{
"$ref": "#/$defs/CaptionBlock"
},
{
"$ref": "#/$defs/TocBlock"
},
{
"$ref": "#/$defs/FieldBlock"
},
{
"$ref": "#/$defs/UnknownBlock"
}
]
},
"title": "Page Footers",
"type": "array"
},
"footnotes": {
"items": {
"$ref": "#/$defs/FootnoteBlock"
},
"title": "Footnotes",
"type": "array"
},
"endnotes": {
"items": {
"$ref": "#/$defs/EndnoteBlock"
},
"title": "Endnotes",
"type": "array"
}
},
"title": "Furniture",
"type": "object"
},
"ImageRef": {
"additionalProperties": false,
"description": "이미지 참조 — binary 자체는 IR JSON 에 inline 되지 않는다.\n\nURI 스킴:\n\n- ``bin://<bin_data_id>`` (기본): 상류 ``Picture.image_attr.bin_data_id`` 그대로.\n ``Document.bytes_for_image(picture)`` 로 raw bytes 해석.\n- ``data:image/...;base64,...``: embedded 모드 (v0.4.0+ opt-in 검토)\n- ``file://path``: external 모드 (v0.4.0+ opt-in 검토)\n\n``uri`` 는 strict 검증 회피를 위해 plain ``str`` — JSON Schema strict mode 가\n``format: uri`` 를 거부하는 경우가 있고, ``bin://`` / ``data:`` 모두 허용해야 하므로.\nURL 검증은 사용자 책임.\n\nwidth/height/dpi 는 v0.3.0 S1 에서 항상 ``None`` — 상류 Picture 가 픽셀\ndimension 을 직접 노출하지 않으며 (border 좌표만 노출) HWPUNIT 계산은\nv0.4.0+ 에서 검토.",
"properties": {
"uri": {
"title": "Uri",
"type": "string"
},
"mime_type": {
"title": "Mime Type",
"type": "string"
},
"width": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Width"
},
"height": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Height"
},
"dpi": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Dpi"
}
},
"required": [
"uri",
"mime_type"
],
"title": "ImageRef",
"type": "object"
},
"InlineRun": {
"additionalProperties": false,
"description": "서식이 동일한 연속 문자 런.\n\nbold/italic/underline/strikethrough/href/ruby 외의 서식 속성 (폰트, 크기,\n색상 등) 은 ``raw_style_id`` 로 escape 된다 — 상류 ``doc_info`` 스타일 인덱스.",
"properties": {
"text": {
"title": "Text",
"type": "string"
},
"bold": {
"default": false,
"title": "Bold",
"type": "boolean"
},
"italic": {
"default": false,
"title": "Italic",
"type": "boolean"
},
"underline": {
"default": false,
"title": "Underline",
"type": "boolean"
},
"strikethrough": {
"default": false,
"title": "Strikethrough",
"type": "boolean"
},
"href": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Href"
},
"ruby": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Ruby"
},
"raw_style_id": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Upstream doc_info 스타일 인덱스. 폰트/크기/색상 등 non-binary 서식을 escape 한다. None 은 char_shape 레코드가 없는 손상/비정상 입력 방어 경로 — 정상 HWP 는 모든 런이 char_shape 에 대응되어 항상 값이 채워진다.",
"title": "Raw Style Id"
}
},
"required": [
"text"
],
"title": "InlineRun",
"type": "object"
},
"ListItemBlock": {
"additionalProperties": false,
"description": "목록 항목 — HWP ``ParaShape`` 의 ``head_type`` 가 비-None 인 단락.\n\nHWP 상류는 list group 컨테이너가 없다 (``ParaShape.head_type`` 가\nNumber/Bullet/Outline 인 단락이 곧 list item) — group container 는 도입하지\n않고 평면 (``level + marker + enumerated``) 으로 표현. RAG 청킹 시 항목 단위\n검색에 그대로 매핑.\n\n``marker`` 는 v0.3.0 단순 정책: ``\"•\"`` (bullet) / ``\"1.\"`` (number/outline).\n상류 ``Numbering.level_formats`` lookup 으로 정확한 마커 (예: ``\"가.\"``,\n``\"(a)\"``) 추출은 v0.4.0+ 에서 검토 — 현 시점은 placeholder 만.\n\n``text`` 는 마커 제외 본문 (``ParagraphBlock`` 과 동일) — 마커는\n``marker`` 필드로 별도. ``\"1. 제목\"`` 이 아니라 ``marker=\"1.\"``,\n``text=\"제목\"`` 형태.",
"properties": {
"kind": {
"const": "list_item",
"default": "list_item",
"title": "Kind",
"type": "string"
},
"text": {
"default": "",
"title": "Text",
"type": "string"
},
"inlines": {
"items": {
"$ref": "#/$defs/InlineRun"
},
"title": "Inlines",
"type": "array"
},
"enumerated": {
"default": false,
"description": "True: 번호 매김 (1./가./i. 등), False: 글머리표 (•/■/▶ 등).",
"title": "Enumerated",
"type": "boolean"
},
"marker": {
"default": "-",
"description": "표시 마커 placeholder. v0.3.0 은 ``\"•\"`` / ``\"1.\"`` 만 출고 — 정확 마커는 상류 Numbering lookup 필요해 v0.4.0+ 검토.",
"title": "Marker",
"type": "string"
},
"level": {
"default": 0,
"description": "0-indexed nesting depth. 상류 ``ParaShape.para_level`` (0~6, 1~7 수준 표시) 를 그대로 매핑.",
"title": "Level",
"type": "integer"
},
"prov": {
"$ref": "#/$defs/Provenance"
}
},
"required": [
"prov"
],
"title": "ListItemBlock",
"type": "object"
},
"ParagraphBlock": {
"additionalProperties": false,
"description": "단락 블록. 서식 런 리스트 + 평탄 텍스트 파생 필드를 병기한다.\n\n``text`` 는 ``inlines`` 의 ``text`` 필드를 이어붙인 결과 — LLM 에 넘기는\n평문화 경로. 원본 서식 보존이 필요한 소비자만 ``inlines`` 를 직접 순회한다.",
"properties": {
"kind": {
"const": "paragraph",
"default": "paragraph",
"title": "Kind",
"type": "string"
},
"text": {
"default": "",
"title": "Text",
"type": "string"
},
"inlines": {
"items": {
"$ref": "#/$defs/InlineRun"
},
"title": "Inlines",
"type": "array"
},
"prov": {
"$ref": "#/$defs/Provenance"
}
},
"required": [
"prov"
],
"title": "ParagraphBlock",
"type": "object"
},
"PictureBlock": {
"additionalProperties": false,
"description": "그림 블록 — HWP ``Control::Picture``.\n\n``image is None`` 은 명시적 broken reference — 상류 ``Picture.image_attr.bin_data_id``\n가 0 (미할당) 인 케이스만 해당. ``bin_data_id`` 가 0 이 아니어도 실제 binary\nlookup 이 실패할 수 있다 (Link 타입이거나 bin_data_content 누락) — 이 경우\nImageRef 는 ``mime_type=\"application/octet-stream\"`` 으로 출고되고 실패는\n``Document.bytes_for_image`` 호출 시점에 ValueError 로 표면화된다 (forensics\n위해 bin_data_id 자체는 URI 에 보존).\n\n``caption`` 은 v0.3.0 S3 부터 채워지는 구조화 캡션 — 부모 ``PictureBlock`` 의\n필드로 컨테인먼트 (ref-id 없이 직접 연결, spec § 5).\n\n``description`` 은 HWP 의 alt-text 슬롯 — caption paragraph 의 평문 fallback\n(S1 호환 보존). v0.4.0+ 에서 caption 충실하게 채워지면 description 은 deprecate\n검토.",
"properties": {
"kind": {
"const": "picture",
"default": "picture",
"title": "Kind",
"type": "string"
},
"image": {
"anyOf": [
{
"$ref": "#/$defs/ImageRef"
},
{
"type": "null"
}
],
"default": null
},
"caption": {
"anyOf": [
{
"$ref": "#/$defs/CaptionBlock"
},
{
"type": "null"
}
],
"default": null,
"description": "구조화 캡션 — v0.3.0 S3 부터 채워짐. ``blocks`` 안에 표/수식/필드도 재귀 표현. None 은 캡션 부재 (HWP Picture.caption == None)."
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "HWP 의 alt-text — 상류 caption paragraph 평문 fallback (S1 보존). 구조화 캡션이 필요하면 ``caption`` 필드 사용.",
"title": "Description"
},
"prov": {
"$ref": "#/$defs/Provenance"
}
},
"required": [
"prov"
],
"title": "PictureBlock",
"type": "object"
},
"Provenance": {
"additionalProperties": false,
"description": "블록의 원본 문서 내 위치. 다운스트림 청커가 원본을 역추적 가능하게 한다.",
"properties": {
"section_idx": {
"title": "Section Idx",
"type": "integer"
},
"para_idx": {
"title": "Para Idx",
"type": "integer"
},
"char_start": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Start character index (Unicode codepoints, 0-indexed). Compatible with Python str slicing: text[char_start:char_end].",
"title": "Char Start"
},
"char_end": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "End character index (Unicode codepoints, 0-indexed, exclusive).",
"title": "Char End"
},
"page_range": {
"anyOf": [
{
"maxItems": 2,
"minItems": 2,
"prefixItems": [
{
"type": "integer"
},
{
"type": "integer"
}
],
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Inclusive (start_page, end_page). 렌더 단계에서만 계산되므로 파싱 경로는 None 을 출고한다.",
"title": "Page Range"
}
},
"required": [
"section_idx",
"para_idx"
],
"title": "Provenance",
"type": "object"
},
"Section": {
"additionalProperties": false,
"description": "HWP 구역 식별자. 용지·단·헤더 레퍼런스 등 상세 속성은 향후 추가된다.",
"properties": {
"section_idx": {
"title": "Section Idx",
"type": "integer"
}
},
"required": [
"section_idx"
],
"title": "Section",
"type": "object"
},
"TableBlock": {
"additionalProperties": false,
"description": "표 블록. 단일 표현으로 RAG 품질 최대화 불가 → 3중 표현 병기.\n\n- ``cells`` : 프로그래매틱 접근 (SQL 생성, 셀 순회)\n- ``html`` : LLM 에 제공, rowspan/colspan 보존 (HtmlRAG 호환)\n- ``text`` : 단순 검색·diff 용 폴백 (행은 개행, 셀은 탭 구분)\n\n``caption`` (str) 은 v0.2.0 호환 평문 슬롯 — caption_block 의 첫 paragraph\n텍스트 fallback. 구조화 캡션이 필요하면 ``caption_block`` 사용.",
"properties": {
"kind": {
"const": "table",
"default": "table",
"title": "Kind",
"type": "string"
},
"rows": {
"title": "Rows",
"type": "integer"
},
"cols": {
"title": "Cols",
"type": "integer"
},
"cells": {
"items": {
"$ref": "#/$defs/TableCell"
},
"title": "Cells",
"type": "array"
},
"html": {
"default": "",
"title": "Html",
"type": "string"
},
"text": {
"default": "",
"title": "Text",
"type": "string"
},
"caption": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "v0.2.0 호환 평문 캡션 — ``caption_block.blocks`` 첫 ParagraphBlock 의 평문이면 일관성 유지. 구조화 캡션은 ``caption_block`` 사용.",
"title": "Caption"
},
"caption_block": {
"anyOf": [
{
"$ref": "#/$defs/CaptionBlock"
},
{
"type": "null"
}
],
"default": null,
"description": "v0.3.0 S3 신규 — 구조화 캡션. v0.2.0 ``caption: str`` 필드는 그대로 유지하고 옵셔널 신설."
},
"prov": {
"$ref": "#/$defs/Provenance"
}
},
"required": [
"rows",
"cols",
"prov"
],
"title": "TableBlock",
"type": "object"
},
"TableCell": {
"additionalProperties": false,
"description": "표 셀. ``blocks`` 가 재귀 ``Block`` 리스트라 중첩 표를 자연 지원한다.\n\n``role`` 어휘는 DocLayNet 파생. ``\"layout\"`` 은 구조 유지용 비의미 셀\n(병합된 빈 영역 등) — LLM 이 \"데이터 없음이 아닌 레이아웃 요소\" 로 인식하도록 태깅한다.",
"properties": {
"row": {
"title": "Row",
"type": "integer"
},
"col": {
"title": "Col",
"type": "integer"
},
"row_span": {
"default": 1,
"title": "Row Span",
"type": "integer"
},
"col_span": {
"default": 1,
"title": "Col Span",
"type": "integer"
},
"grid_index": {
"description": "Anchor cell position in row-major flat index (row * table.cols + col). Not a reverse-lookup key; span-covered positions do not appear as separate cells.",
"title": "Grid Index",
"type": "integer"
},
"role": {
"default": "data",
"description": "DocLayNet-derived cell role. Current producer maps HWP 'is_header' to 'column_header' and tags merged-empty cells as 'layout'; 'row_header' is reserved for producers that can distinguish row vs column headers.",
"enum": [
"data",
"column_header",
"row_header",
"layout"
],
"title": "Role",
"type": "string"
},
"blocks": {
"items": {
"oneOf": [
{
"$ref": "#/$defs/ParagraphBlock"
},
{
"$ref": "#/$defs/TableBlock"
},
{