JSON deserialization error in RdfSerializationExample

オープン
#848 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
java
領域
backend, data

調査の方向性

Start by running the reported Maven command in Wikidata-Toolkit-Examples and inspect how JSON deserialization handles the supplied datavalue with a null value and an error field. The payload names no source files or tests, so trace the failure from RdfSerializationExample into the deserializer and identify the relevant tests. Done means the example can read this serialization without throwing; the issue has had no comments or linked pull requests for 969 days.

索引モデルが issue の本文から書いたものです。

説明

Running mvn exec:java -Dexec.mainClass="examples.RdfSerializationExample" in Wikidata-Toolkit-Examples, I get:

2024-02-28 08:49:15 ERROR - Error when reading JSON for entity: Cannot construct instance of `org.wikidata.wdtk.datamodel.implementation.StringValueImpl`, problem: A string value must provide a non-null string
 at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: java.util.ArrayList[0]->org.wikidata.wdtk.datamodel.implementation.FormDocumentImpl["claims"]->java.util.LinkedHashMap["P7243"]->java.util.ArrayList[0]->org.wikidata.wdtk.datamodel.implementation.StatementImpl$PreStatement["qualifiers"]->java.util.LinkedHashMap["P898"]->java.util.ArrayList[0]->org.wikidata.wdtk.datamodel.implementation.ValueSnakImpl["datavalue"])

This is due to the following lexeme which has an invalid IPA transcription:
https://www.wikidata.org/wiki/Lexeme:L1259271

Arguably that's a Wikibase bug: https://phabricator.wikimedia.org/T358644
But it could be worth making sure we don't choke on such JSON serializations, if they can happen.

{
    "snaktype": "value",
    "property": "P898",
    "hash": "e49ad5fcdc05da78bac23b8373d04a80fecf16aa",
    "datavalue": {
        "value": null,
        "type": "string",
        "error": "Can only construct StringValue from strings"
    },
    "datatype": "string"
}
主要言語
Java
スター
412
フォーク
116
平均マージ
3日 23時間
マージ済み PR(30日)
2

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Wikidata-Toolkit/Wikidata-Toolkit のほかの issue

Wikidata-Toolkit/Wikidata-Toolkit の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。