[Developers] query for topic data at a specific timestamp

Christine Begle xtine at metaweb.com
Wed Apr 2 19:15:40 UTC 2008


Hey, Jack.

You can use the "as_of_time" attribute in the mql envelope -- here's an example:


this query:
{
  "q1" : {
    "as_of_time" : "2007-01-09T22:00:56.0000Z",
    "query" : [
      {
        "domain" : "/architecture",
        "id" : null,
        "return" : "count",
        "timestamp" : null,
        "type" : "/type/type"
      }
    ]
  }
}

returns 12 (there were 12 types in the /architecture domain last january).
{
  "q1": {
    "code": "/api/status/ok",
    "result": [
      12
    ]
  },
  "status": "200 OK",
  "code": "/api/status/ok"
}


this query (no as_of_time attribute):
{
  "q1" : {
    "query" : [
      {
        "domain" : "/architecture",
        "id" : null,
        "return" : "count",
        "timestamp" : null,
        "type" : "/type/type"
      }
    ]
  }
}

returns the current number of types in the architecture domain:
{
  "q1": {
    "code": "/api/status/ok",
    "result": [
      25
    ]
  },
  "status": "200 OK",
  "code": "/api/status/ok"
}


----- Original Message -----
From: "Jack Alves" <jack.alves at gmail.com>
To: developers at freebase.com
Sent: Wednesday, April 2, 2008 12:01:00 PM (GMT-0800) America/Los_Angeles
Subject: [Developers] query for topic data at a specific timestamp

_______________________________________________
Developers mailing list
Developers at freebase.com
http://lists.freebase.com/mailman/listinfo/developers



More information about the Developers mailing list