Skip to content

[long-task] [long-task] [Phase 2] データフィールドカタログ用の語彙追加(dbp:DataFieldType / dbp:CompressionHint ほか) (#16) [ready for review] - #17

Merged
nagata-yoshiteru merged 3 commits into
mainfrom
claude/task-16-long-task-phase-2-dbp-datafieldtype-dbp-
Jul 14, 2026
Merged

[long-task] [long-task] [Phase 2] データフィールドカタログ用の語彙追加(dbp:DataFieldType / dbp:CompressionHint ほか) (#16) [ready for review]#17
nagata-yoshiteru merged 3 commits into
mainfrom
claude/task-16-long-task-phase-2-dbp-datafieldtype-dbp-

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Issue #16 の長期タスク。進捗は Issue 内の bot コメントを参照してください。

…mpressionHint)

Issue #16 (Phase 2): add vocabulary for the data field catalogue.

- New class dbp:DataFieldType (rdfs:Class, subClassOf schema:Intangible):
  dataset-independent kind of a data field
- New class dbp:CompressionHint: recommended compression settings per use case
- New properties: dbp:fieldType (RealWorldDataStructureProperty -> DataFieldType),
  dbp:aliases, dbp:provenance, dbp:useCase, dbp:accuracyNote, dbp:compressionHints
- Reused schema.org terms per the generator's existing convention:
  schema:status, schema:version, schema:dateModified, schema:supersededBy,
  schema:unitText, schema:unitCode
- Reused existing dbp properties (itemType, variableScaleType, rangeMin/Max,
  decimalPlaces, isEnumValue, enumList, valueSamples, dbpaDatetimeFormat,
  dbpaTimestampUnitText, isMostly*/isOptional/isNullable, tags,
  compression-related recommendation values)
- ProtoToJsonld.py: update rdfs:subClassOf when a forward-referenced class's
  message definition carries an explicit (subclass of: "...") marker
  (needed so DataFieldType gets schema:Intangible; no change to existing output)

The JSON-LD files are regenerated from the protos with ProtoToJsonld.py.
Diff verified purely additive: no existing definition removed or altered
(existing nodes only gain schema:domainIncludes / schema:rangeIncludes entries),
@context base URI unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
github-actions Bot and others added 2 commits July 12, 2026 20:44
Reflect the DataFieldType / CompressionHint additions (commit 8af6ec8)
into the checked-in generated code:

- src/dbp_schema.rs: regenerated via cargo build (tonic-build 0.9.2 /
  prost-build 0.11.9, protoc 33.1). Purely additive (+119 lines);
  crate compiles.
- dbp_schema.pb.go: regenerated with the exact pinned tool versions
  from the file header (protoc-gen-go v1.36.10, protoc v6.33.1 =
  protobuf release 33.1) via
  `protoc --go_out=. --go_opt=Mdbp_schema.proto=./ dbp_schema.proto`.

Reproducibility verified before regenerating: with main's proto, both
toolchains reproduce the checked-in outputs byte-identically, so the
diffs contain only the vocabulary additions (plus protoc-gen-go's
mechanical descriptor/type-index renumbering, 37 -> 39 messages).

dbp_schema.sql / dbdiagram-oss_exported_data.json are hand-maintained
dbdiagram artifacts (not proto-generated) and are left untouched; see
the progress comment on issue #16.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Reflect the new data field catalogue vocabulary into the manually
maintained diagram sources, per issue author's request:

- dbp_schema.sql (DBML): append DataFieldType / CompressionHint tables
  mirroring the proto fields (tags omitted, matching the existing
  convention of not materializing RealWorldDataTags in the diagram),
  with Refs for supersededBy and compressionHints
- dbdiagram-oss_exported_data.json: append the same tables to the
  embedded DBML source (Text/CRLF style) and add chart layout entries
  (tables 27/28, refs 39/40); existing layout ids 1-26 / 1-38 unchanged

Both DBML sources parse with @dbml/core and are byte-consistent modulo
the established VARCHAR(256)->Text and LF->CRLF substitutions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions github-actions Bot changed the title [long-task] [long-task] [Phase 2] データフィールドカタログ用の語彙追加(dbp:DataFieldType / dbp:CompressionHint ほか) (#16) [long-task] [long-task] [Phase 2] データフィールドカタログ用の語彙追加(dbp:DataFieldType / dbp:CompressionHint ほか) (#16) [ready for review] Jul 13, 2026
@claude

claude Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Claude finished @github-actions[bot]'s task —— View job


PR レビュー: データフィールドカタログ語彙追加(dbp:DataFieldType / dbp:CompressionHint)

  • 変更ファイルの diff を確認
  • JSON-LD / proto / Go / Rust / SQL / dbdiagram 間の整合性チェック
  • バグ・命名・品質の観点でレビュー
  • レビュー結果を投稿

結論: ブロッキングな問題は見つかりませんでした。 6 種類の成果物(proto en/ja、JSON-LD en/ja、Go、Rust、SQL、dbdiagram)の間で語彙定義が一貫しており、マージ可能な品質と判断します。以下、確認内容と軽微な指摘です。

整合性チェック(機械検証済み)

  • proto en/ja: フィールド番号・型・構造が完全一致。コメントも対訳として整合(dbp_schema.proto:519 / dbp_schema.ja.proto:519 以降)。
  • JSON-LD en/ja: @graph のノード ID 列が完全一致(md5 で照合)、重複 ID なし。
  • 参照解決: 新規追加の dbp: 参照はすべて定義ノードに解決。未解決参照は dbp:bytes の 1 件のみで、これは main に元からある既存問題(本 PR 起因ではない)。
  • domainIncludes の更新漏れなし: 既存プロパティ 16 件(decimalPlaces, isMostlyIncremental, useRunLength など)の再利用に伴う domainIncludes 追加、新規プロパティ 6 件(aliases, provenance, compressionHints, useCase, accuracyNote, fieldType)の定義、クラスノードのメンバー一覧(DataFieldType 28 項目 / CompressionHint 14 項目)がすべて proto のフィールド構成と一致。
  • Go/Rust 生成コード: フィールドタグ・型が proto と一致。自己参照の supersededBy は Rust 側で正しく Box<DataFieldType> 化(src/dbp_schema.rs:1060)、StringValue unitText のマッピングも既存パターンと同一。Go の depIdxs / NumMessages(37→39)も新メッセージ追加と整合しており、protoc の正規出力と見て矛盾なし。
  • ProtoToJsonld.py の修正ProtoToJsonld.py:205-207): 前方参照で先に登録されたクラス(今回の DataFieldType がまさに該当。fieldType = 100 がメッセージ定義より先に出現)に (subclass of: ...) 注釈が反映されない問題の修正で、生成された JSON-LD の schema:Intangible と辻褄が合っています。妥当な修正です。

軽微な指摘(任意対応)

  1. ProtoToJsonld.py の優先順位の非対称 — 今回追加された分岐(ProtoToJsonld.py:205-207)では明示注釈が schema.org 由来の subClassOf を上書きしますが、新規クラス登録側(ProtoToJsonld.py:71-73 のコンストラクタ)では逆に schema.org のルックアップが注釈を上書きします。クラス名が schema.org の型名と一致し、かつ注釈を持つケースが将来出ると、前方参照の有無で結果が変わります。現状該当クラスはないため実害なしですが、いずれ「注釈優先」に揃えることを推奨します。
  2. schema:supersededBy の再利用 — schema.org 上の本来の domain は Enumeration / CreativeWork / Product であり、schema:Intangible 系の DataFieldType は厳密には範囲外です。既存の schema:status などと同様の「名前一致で schema.org 語彙を再利用する」本リポジトリの慣習には沿っているため、指摘のみです。
  3. SQL に tags 列がない — proto の DataFieldType.tags に対応する列が dbp_schema.sql にありませんが、既存テーブルもすべて tags 列を持たない慣習のため、意図的な省略として問題なしと判断しました。

未検証の項目

  • サンドボックス権限の制約で cargo check / Go のビルドは実行できませんでした。生成コードは構造チェックのみで、コンパイル可否は CI での確認をお願いします。
  • 本リポジトリにはテストがないため、テストカバレッジの評価対象はありません(スキーマ定義リポジトリとしては妥当)。

セキュリティ・パフォーマンス面の懸念はありません(スキーマ定義のみの変更)。

--- | Branch

@nagata-yoshiteru
nagata-yoshiteru merged commit f0d7f0e into main Jul 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant