API result "Date"

From semantic-mediawiki.org
Date
API result format for data type Date
Keywords
API · API module · API result · action ask · ask · action askargs · askargs · datatype Date

When using the API modules to query for semantic data, different datatypes may have different output formats. This page gives an example for datatype "Date"Holds particular points in time using API-module "ask"Allows to do ask queries. API-module "askargs"Allows to do ask queries with as little ask query specific syntax as possible however uses the same output format.

Example JSON result output[edit]

You can experiment with the api result output yourself by using the API Sandbox. The following example can be reproduced here.

{
    "query": {
        "printrequests": [
            {
                "label": "Has date",
                "key": "Has_date",
                "redi": "",
                "typeid": "_dat",
                "mode": 1,
                "format": ""
            }
        ],
        "results": {
            "Demo:Berlin": {
                "printouts": {
                    "Has date": [
                        {
                            "timestamp": "1343692800",
                            "raw": "1/2012/7/31"
                        }
                    ]
                }
            }
        },
        "serializer": "SMW\\Serializers\\QueryResultSerializer",
        "version": 2,
        "meta": {
            "hash": "3da4ee4adbca7f00aa62d25499f60ebb",
            "count": 1,
            "offset": 0,
            "source": "",
            "time": "0.002212"
        }
    }
}