Addshore added a comment.

  +1 better errors could be nice. I believe this is currently based on the same 
JSON validation for the datavalues as the action API, which has always been a 
little lacking in its responses to users.
  
  Briefly looking at this, the JSON that would currently work for these 
datavalues would be:
  
  **time**
  
  before and after were missing, calendarmodel was incorrect
  
    {
      "statement": {
        "mainsnak": {
          "snaktype": "value",
          "property": "P706",
          "datatype": "time",
          "datavalue": {
            "type": "time",
            "value": {
              "time": "+2022-08-12T00:00:00Z",
              "timezone": 0,
              "precision": 11,
                                        "before": 0,
                                        "after": 0,
              "calendarmodel": "http://www.wikidata.org/entity/Q1985727";
            }
          }
        },
        "qualifiers": {},
        "references": [],
        "rank": "normal",
        "type": "statement"
      },
      "bot": true
    }
  
  **quantity**
  
  With unit of 1
  
    {
      "statement": {
        "mainsnak": {
          "snaktype": "value",
          "property": "P937",
          "datatype": "quantity",
          "datavalue": {
            "type": "quantity",
            "value": {
              "amount": "+1",
              "unit": "1"
            }
          }
        },
        "qualifiers": {},
        "references": [],
        "rank": "normal",
        "type": "statement"
      },
      "bot": true
    }
  
  or with a beta wikidata unit
  
    {
      "statement": {
        "mainsnak": {
          "snaktype": "value",
          "property": "P937",
          "datatype": "quantity",
          "datavalue": {
            "type": "quantity",
            "value": {
              "amount": "+1",
              "unit": "https://wikidata.beta.wmflabs.org/entity/Q358085";
            }
          }
        },
        "qualifiers": {},
        "references": [],
        "rank": "normal",
        "type": "statement"
      },
      "bot": true
    }
  
  as far as I remember the `upperBound` and `lowerBound` will be ignored.
  
  **globe coordinate**
  
  This was using https not http for the globe
  
    {
      "statement": {
        "mainsnak": {
          "snaktype": "value",
          "property": "P740",
          "datatype": "globe-coordinate",
          "datavalue": {
            "type": "globecoordinate",
            "value": {
              "latitude": 52.516666666667,
              "longitude": 13.383333333333,
              "precision": 0.016666666666667,
              "globe": "http://www.wikidata.org/entity/Q2";
            }
          }
        },
        "qualifiers": {},
        "references": [],
        "rank": "normal",
        "type": "statement"
      },
      "bot": true
    }

TASK DETAIL
  https://phabricator.wikimedia.org/T315158

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Addshore
Cc: Addshore, Ollie.Shotton_WMDE, connorshea, Aklapper, Astuthiodit_1, 
karapayneWMDE, Invadibot, maantietaja, ItamarWMDE, Akuckartz, Nandana, Lahi, 
Gq86, GoranSMilovanovic, QZanden, LawExplorer, _jensen, rosalieper, Scott_WUaS, 
Wikidata-bugs, aude, Lydia_Pintscher, Mbch331
_______________________________________________
Wikidata-bugs mailing list -- wikidata-bugs@lists.wikimedia.org
To unsubscribe send an email to wikidata-bugs-le...@lists.wikimedia.org

Reply via email to