WikiClientLibrary icon indicating copy to clipboard operation
WikiClientLibrary copied to clipboard

ArgumentException for WbGlobeCoordinate with precision = null

Open j-bbr opened this issue 2 years ago • 1 comments

During processing of a recent wikidata dump I noticed that WbGlobeCoordinate throws an ArgumentException if the precision field is null. Here is the relevant portion from an example entity (Berlin TV Tower) from the dump where that occurs:

"P625": [
            {
                "mainsnak": {
                    "snaktype": "value",
                    "property": "P625",
                    "datavalue": {
                        "value": {
                            "latitude": 52.520833333333,
                            "longitude": 13.409444444444,
                            "altitude": null,
                            "precision": null,
                            "globe": "http:\/\/www.wikidata.org\/entity\/Q2"
                        },
                        "type": "globecoordinate"
                    },
                    "datatype": "globe-coordinate"
                },
                "type": "statement",
                "id": "q151356$2200165A-750E-42AB-BC62-4F23EF25F202",
                "rank": "normal"
            }
        ]

Maybe the precision field could be made nullable in WbGlobeCoordinate?

j-bbr avatar Nov 07 '23 11:11 j-bbr