[Developers] Scientific notation in MQL

Philip Kendall philip-freebase at shadowmagic.org.uk
Tue Jul 21 20:54:25 UTC 2009


Is it a known issue that scientific notation is not supported in MQL? My
reading of the JSON spec is that it should be (and it's certainly given
as an example at <http://mql.freebaseapps.com/ch02.html#typefloat>), but
yet...

{
  "id":   "/en/philip_kendall",
  "type": "/people/person",
  "height_meters": {
    "connect": "update",
    "value":   1e4
  }
}

returns

{
  "code":          "/api/status/error",
  "messages": [{
    "code":    "/api/status/error/mql/type",
    "info": {
      "expected_type": "/type/float",
      "property":      "e4"
    },
    "message": "Type /type/float does not have property e4",
    "path":    "height_meters",
    "query": {
      "height_meters": {
        "connect":      "update",
        "e4":           null,
        "error_inside": ".",
        "value":        1
      },
      "id":   "/en/philip_kendall",
      "type": "/people/person"
    }
  }],
  "status":        "200 OK",
  "transaction_id": "cache;cache01.sandbox.sjc1:8101;2009-07-21T20:47:36Z;0008"
}

having trashed the 1e4 parameter along the way. (I haven't tried this on
the production graph).

Cheers,

Phil

-- 
  Philip Kendall <philip at shadowmagic.org.uk>
  http://www.shadowmagic.org.uk/


More information about the Developers mailing list