API result "Number"

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

When using the API modules to query for semantic data, different datatypes may have different output formats. This page gives an example for datatype "Number"Holds integer and decimal numbers, with an optional exponent 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 number",
                "key": "Has_number",
                "redi": "",
                "typeid": "_num",
                "mode": 1,
                "format": ""
            }
        ],
        "results": {
            "Demo:D3chart/Bubble chart# 0c7287dd9bc64f128346c70ca7f6a957": {
                "printouts": {
                    "Has number": [
                        21
                    ]
                }
            }
        },
        "serializer": "SMW\\Serializers\\QueryResultSerializer",
        "version": 2,
        "meta": {
            "hash": "dadb84feacd754be18ea75fb33a667a6",
            "count": 1,
            "offset": 0,
            "source": "",
            "time": "0.010163"
        }
    }
}