Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-16154

[fiware-stackoverflow] How to calculate max in sth-comet?

    Details

      Description

      Created question in FIWARE Q/A platform on 15-09-2019 at 20:09
      Please, ANSWER this question AT https://stackoverflow.com/questions/57947258/how-to-calculate-max-in-sth-comet

      Question:
      How to calculate max in sth-comet?

      Description:
      sth-comet offers the possibility of calculate max, min and other functions, as described [here]https://github.com/telefonicaid/fiware-sth-comet/blob/master/doc/manuals/aggregated-data-retrieval.md

      But I have tried different types and it doesn't gives the aggregated result.

      A simplified version of my entity (I use the attribute temperature in this example) is:

      {
      "id": "Beach:27",
      "type": "Beach",
      "flag":

      { "type": "Property", "value": "Verde" }

      ,
      "temperature":

      { "type": "Number", "value": 45 }

      I have make this query that should give the maximum value:

      http://sth-comet/STH/v1/contextEntities/type/Beach/id/Beach:27/attributes/temperature?aggrMethod=max&hLimit=100&hOffset=0

      but the result is not the max but all the changes of the attribute:

      {
      "contextResponses": [
      {
      "contextElement": {
      "attributes": [
      {
      "name": "temperature",
      "values": [

      { "recvTime": "2019-09-15T18:32:18.166Z", "attrType": "Number", "attrValue": "43" }

      ,

      { "recvTime": "2019-09-15T18:32:24.645Z", "attrType": "Number", "attrValue": "44" }

      ,

      { "recvTime": "2019-09-15T18:32:28.931Z", "attrType": "Number", "attrValue": "45" }

      ]
      }
      ],
      "id": "Beach:27",
      "isPattern": false,
      "type": "Beach"
      },
      "statusCode":

      { "code": "200", "reasonPhrase": "OK" }

      }
      ]
      }

      Which is the type that the property must have to work correctly? I tried "Number", "integer","string", "Property" but I don't obtain the "max" value.

      Thank you for your time

        Activity

        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        backlogmanager Backlog Manager made changes -
        Resolution Done [ 10000 ]
        Status Answered [ 10104 ] Closed [ 6 ]
        backlogmanager Backlog Manager made changes -
        Status In Progress [ 3 ] Answered [ 10104 ]
        backlogmanager Backlog Manager made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        fla Fernando Lopez made changes -
        HD-Enabler Unknown [ 10910 ] STH-Comet [ 11303 ]
        Description
        Created question in FIWARE Q/A platform on 15-09-2019 at 20:09
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/57947258/how-to-calculate-max-in-sth-comet


        +Question:+
        How to calculate max in sth-comet?

        +Description:+
        sth-comet offers the possibility of calculate max, min and other functions, as described [here]https://github.com/telefonicaid/fiware-sth-comet/blob/master/doc/manuals/aggregated-data-retrieval.md

        But I have tried different types and it doesn't gives the aggregated result.

        A simplified version of my entity (I use the attribute temperature in this example) is:

        {
             "id": "Beach:27",
             "type": "Beach",
             "flag": {
               "type": "Property",
               "value": "Verde"
             },
             "temperature": {
               "type": "Number",
               "value": 45
             }


        I have make this query that should give the maximum value:

        http://{{sth-comet}}/STH/v1/contextEntities/type/Beach/id/Beach:27/attributes/temperature?aggrMethod=max&hLimit=100&hOffset=0


        but the result is not the max but all the changes of the attribute:

        {
            "contextResponses": [
                {
                    "contextElement": {
                        "attributes": [
                            {
                                "name": "temperature",
                                "values": [
                                    {
                                        "recvTime": "2019-09-15T18:32:18.166Z",
                                        "attrType": "Number",
                                        "attrValue": "43"
                                    },
                                    {
                                        "recvTime": "2019-09-15T18:32:24.645Z",
                                        "attrType": "Number",
                                        "attrValue": "44"
                                    },
                                    {
                                        "recvTime": "2019-09-15T18:32:28.931Z",
                                        "attrType": "Number",
                                        "attrValue": "45"
                                    }
                                ]
                            }
                        ],
                        "id": "Beach:27",
                        "isPattern": false,
                        "type": "Beach"
                    },
                    "statusCode": {
                        "code": "200",
                        "reasonPhrase": "OK"
                    }
                }
            ]
        }


        Which is the type that the property must have to work correctly? I tried "Number", "integer","string", "Property" but I don't obtain the "max" value.

        Thank you for your time
        Created question in FIWARE Q/A platform on 15-09-2019 at 20:09
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/57947258/how-to-calculate-max-in-sth-comet


        +Question:+
        How to calculate max in sth-comet?

        +Description:+
        sth-comet offers the possibility of calculate max, min and other functions, as described [here]https://github.com/telefonicaid/fiware-sth-comet/blob/master/doc/manuals/aggregated-data-retrieval.md

        But I have tried different types and it doesn't gives the aggregated result.

        A simplified version of my entity (I use the attribute temperature in this example) is:

        {
             "id": "Beach:27",
             "type": "Beach",
             "flag": {
               "type": "Property",
               "value": "Verde"
             },
             "temperature": {
               "type": "Number",
               "value": 45
             }


        I have make this query that should give the maximum value:

        http://{{sth-comet}}/STH/v1/contextEntities/type/Beach/id/Beach:27/attributes/temperature?aggrMethod=max&hLimit=100&hOffset=0


        but the result is not the max but all the changes of the attribute:

        {
            "contextResponses": [
                {
                    "contextElement": {
                        "attributes": [
                            {
                                "name": "temperature",
                                "values": [
                                    {
                                        "recvTime": "2019-09-15T18:32:18.166Z",
                                        "attrType": "Number",
                                        "attrValue": "43"
                                    },
                                    {
                                        "recvTime": "2019-09-15T18:32:24.645Z",
                                        "attrType": "Number",
                                        "attrValue": "44"
                                    },
                                    {
                                        "recvTime": "2019-09-15T18:32:28.931Z",
                                        "attrType": "Number",
                                        "attrValue": "45"
                                    }
                                ]
                            }
                        ],
                        "id": "Beach:27",
                        "isPattern": false,
                        "type": "Beach"
                    },
                    "statusCode": {
                        "code": "200",
                        "reasonPhrase": "OK"
                    }
                }
            ]
        }


        Which is the type that the property must have to work correctly? I tried "Number", "integer","string", "Property" but I don't obtain the "max" value.

        Thank you for your time
        fla Fernando Lopez made changes -
        Assignee Fermín Galán [ fermin ]
        backlogmanager Backlog Manager made changes -
        HD-Enabler Unknown [ 10910 ]
        HD-Chapter Unknown [ 10845 ]
        HD-Node Unknown [ 10852 ]
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        backlogmanager Backlog Manager created issue -

          People

          • Assignee:
            fermin Fermín Galán
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: