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

[fiware-stackoverflow] How to add TimeInstant, CreationDate and ModifiedDate into CrateDB with Orion Context Broker?

    Details

      Description

      Created question in FIWARE Q/A platform on 18-09-2019 at 10:09
      Please, ANSWER this question AT https://stackoverflow.com/questions/57987944/how-to-add-timeinstant-creationdate-and-modifieddate-into-cratedb-with-orion-co

      Question:
      How to add TimeInstant, CreationDate and ModifiedDate into CrateDB with Orion Context Broker?

      Description:
      I'm setting up a Firmware-Framework, where I unforutunately have to add historically Sensor Values. But I also need the creationDate and the modificationDate for other usecases.

      Therefore I add the Attribute "Metadata" with the variable "TimeInstant". Then I create an Entity, create an Orion-Subscription for that Entity and update the Entity with my old Sensor-Valses.

      The Json-File I send to the Orion-Context Broker to update the Attribute looks like this:

      {
      "metadata": {
      "TimeInstant":

      { "type": "DateTime", "value": "2015-02-02T11:35:25.0000Z" }

      },
      "type": "Number",
      "value": 0.0132361 }

      The Output in my Mongo-DB like this:

      "_id":

      { "id": "urn:ngsi-ld:SensorB-K1200____", "type": "Sensor", "servicePath": "/test/servicepath" }

      ,
      "attrNames": [
      "Sensor_value"
      ],
      "attrs": {
      "Sensor_value": {
      "value": 0.01632361,
      "type": "Number",
      "md": {
      "TimeInstant":

      { "type": "DateTime", "value": 1422876989 }

      },
      "mdNames": [
      "TimeInstant"
      ],
      "creDate": 1568712813,
      "modDate": 1568735930
      }
      },
      "creDate": 1568712813,
      "modDate": 1568735930,
      "lastCorrelator": "0a129232-d964-11e9-8e5a-0242ac130009" }

      But my Crate-DB only has the columns:
      entity_id entity_type fiware_servicepath sensor_value time_index

      My Subscription File looks like this:

      {
      "expires": "2019-12-24T18:00:00",
      "notification": {
      "http":

      { "url": "http://quantumleap:8668/v2/notify" }

      ,
      "metadata": [
      "dateCreated",
      "dateModified",
      "TimeInstant"
      ]
      },
      "subject": {
      "entities": [

      { "id": "urn:ngsi-ld:SensorB-K1200____", "type": "Sensor" }

      ]
      },
      "throttling": 0 }

      I've tried changing the "Metadata" Attributes in the Subscription-File, also tried restartig Crate-DB, ContextBroker e.g..

      I excpect the CrateDb to show all three values: "dateCreated", "dateModified" and "TimeInstant".

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        27d 5h 59m 1 Backlog Manager 15/Oct/19 6:06 PM
        In Progress In Progress Answered Answered
        3h 1 Backlog Manager 15/Oct/19 9:06 PM
        Answered Answered Closed Closed
        29d 15h 59m 1 Backlog Manager 14/Nov/19 12:06 PM
        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2019-11-14 12:06|UPDATED status: transition Finish| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2019-11-14 12:06|UPDATED status: transition Finish| # answers= 1, accepted answer= True
        backlogmanager Backlog Manager made changes -
        Resolution Done [ 10000 ]
        Status Answered [ 10104 ] Closed [ 6 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2019-10-15 21:06|UPDATED status: transition Answered| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2019-10-15 21:06|UPDATED status: transition Answered| # answers= 1, accepted answer= False
        backlogmanager Backlog Manager made changes -
        Status In Progress [ 3 ] Answered [ 10104 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2019-10-15 18:06|UPDATED status: transition Answer| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2019-10-15 18:06|UPDATED status: transition Answer| # answers= 1, accepted answer= False
        backlogmanager Backlog Manager made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        fla Fernando Lopez made changes -
        Assignee MARTEL [ smartsdk_martel ]
        fla Fernando Lopez made changes -
        HD-Enabler Quantum-Leap [ 11558 ]
        Description
        Created question in FIWARE Q/A platform on 18-09-2019 at 10:09
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/57987944/how-to-add-timeinstant-creationdate-and-modifieddate-into-cratedb-with-orion-co


        +Question:+
        How to add TimeInstant, CreationDate and ModifiedDate into CrateDB with Orion Context Broker?

        +Description:+
        I'm setting up a Firmware-Framework, where I unforutunately have to add historically Sensor Values. But I also need the creationDate and the modificationDate for other usecases.

        Therefore I add the Attribute "Metadata" with the variable "TimeInstant". Then I create an Entity, create an Orion-Subscription for that Entity and update the Entity with my old Sensor-Valses.

        The Json-File I send to the Orion-Context Broker to update the Attribute looks like this:

        {
        "metadata": {
            "TimeInstant": {
                "type": "DateTime",
                "value": "2015-02-02T11:35:25.0000Z"
            }
        },
        "type": "Number",
        "value": 0.0132361 }


        The Output in my Mongo-DB like this:

        "_id": {
            "id": "urn:ngsi-ld:SensorB-K1200____",
            "type": "Sensor",
            "servicePath": "/test/servicepath"
        },
        "attrNames": [
            "Sensor_value"
        ],
        "attrs": {
            "Sensor_value": {
                "value": 0.01632361,
                "type": "Number",
                "md": {
                    "TimeInstant": {
                        "type": "DateTime",
                        "value": 1422876989
                    }
                },
                "mdNames": [
                    "TimeInstant"
                ],
                "creDate": 1568712813,
                "modDate": 1568735930
            }
        },
        "creDate": 1568712813,
        "modDate": 1568735930,
        "lastCorrelator": "0a129232-d964-11e9-8e5a-0242ac130009" }


        But my Crate-DB only has the columns:
        entity_id entity_type fiware_servicepath sensor_value time_index

        My Subscription File looks like this:

        {
        "expires": "2019-12-24T18:00:00",
        "notification": {
            "http": {
                "url": "http://quantumleap:8668/v2/notify"
            },
            "metadata": [
                "dateCreated",
                "dateModified",
                "TimeInstant"
            ]
        },
        "subject": {
            "entities": [
                {
                    "id": "urn:ngsi-ld:SensorB-K1200____",
                    "type": "Sensor"
                }
            ]
        },
        "throttling": 0 }


        I've tried changing the "Metadata" Attributes in the Subscription-File, also tried restartig Crate-DB, ContextBroker e.g..

        I excpect the CrateDb to show all three values: "dateCreated", "dateModified" and "TimeInstant".
        Created question in FIWARE Q/A platform on 18-09-2019 at 10:09
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/57987944/how-to-add-timeinstant-creationdate-and-modifieddate-into-cratedb-with-orion-co


        +Question:+
        How to add TimeInstant, CreationDate and ModifiedDate into CrateDB with Orion Context Broker?

        +Description:+
        I'm setting up a Firmware-Framework, where I unforutunately have to add historically Sensor Values. But I also need the creationDate and the modificationDate for other usecases.

        Therefore I add the Attribute "Metadata" with the variable "TimeInstant". Then I create an Entity, create an Orion-Subscription for that Entity and update the Entity with my old Sensor-Valses.

        The Json-File I send to the Orion-Context Broker to update the Attribute looks like this:

        {
        "metadata": {
            "TimeInstant": {
                "type": "DateTime",
                "value": "2015-02-02T11:35:25.0000Z"
            }
        },
        "type": "Number",
        "value": 0.0132361 }


        The Output in my Mongo-DB like this:

        "_id": {
            "id": "urn:ngsi-ld:SensorB-K1200____",
            "type": "Sensor",
            "servicePath": "/test/servicepath"
        },
        "attrNames": [
            "Sensor_value"
        ],
        "attrs": {
            "Sensor_value": {
                "value": 0.01632361,
                "type": "Number",
                "md": {
                    "TimeInstant": {
                        "type": "DateTime",
                        "value": 1422876989
                    }
                },
                "mdNames": [
                    "TimeInstant"
                ],
                "creDate": 1568712813,
                "modDate": 1568735930
            }
        },
        "creDate": 1568712813,
        "modDate": 1568735930,
        "lastCorrelator": "0a129232-d964-11e9-8e5a-0242ac130009" }


        But my Crate-DB only has the columns:
        entity_id entity_type fiware_servicepath sensor_value time_index

        My Subscription File looks like this:

        {
        "expires": "2019-12-24T18:00:00",
        "notification": {
            "http": {
                "url": "http://quantumleap:8668/v2/notify"
            },
            "metadata": [
                "dateCreated",
                "dateModified",
                "TimeInstant"
            ]
        },
        "subject": {
            "entities": [
                {
                    "id": "urn:ngsi-ld:SensorB-K1200____",
                    "type": "Sensor"
                }
            ]
        },
        "throttling": 0 }


        I've tried changing the "Metadata" Attributes in the Subscription-File, also tried restartig Crate-DB, ContextBroker e.g..

        I excpect the CrateDb to show all three values: "dateCreated", "dateModified" and "TimeInstant".
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2019-09-18 12:06|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2019-09-18 12:06|CREATED monitor | # answers= 0, accepted answer= False
        backlogmanager Backlog Manager created issue -

          People

          • Assignee:
            smartsdk_martel MARTEL
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: