Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON deserialization error in RdfSerializationExample #848

Open
wetneb opened this issue Feb 28, 2024 · 0 comments
Open

JSON deserialization error in RdfSerializationExample #848

wetneb opened this issue Feb 28, 2024 · 0 comments

Comments

@wetneb
Copy link
Member

wetneb commented Feb 28, 2024

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"
}
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

No branches or pull requests

1 participant