webRunes/WRIO-InternetOS

Array records. Total time: 25h+14h

Closed this issue · 5 comments

We have to consider an array record like

...
"dataFeedElement": [
{
    "@type": "DataFeedItem",
    "dateCreated": ["2019-11-21T:00:00:00","2019-11-21T:01:00:00", ...],
    "item": {
        "@type": "Dataset",
        "variableMeasured": {
            "@type": "PropertyValue",
            "name": "battery",
            "unitText": "percent",
            "value": ["29.2", "28", ...]
        }
    }
},
{
    "@type": "DataFeedItem",
    "dateCreated": ["2019-11-21T:00:00:00","2019-11-21T:01:00:00", ...],
    "item": {
        "@type": "Dataset",
        "variableMeasured": {
            "@type": "PropertyValue",
            "name": "temperature",
            "unitText": "celsius",
            "value": ["24.1", "24.0", ...]
        }
    }
},
...

At the moment we are going to store 24h records only. So every array must contain only 24 records. With every new 1h interval delete the first one element in the array and add a new one at the end of it.

We have to update the current pages in the new array format.
Updated version https://github.com/WRIO-Hubs/imec.wr.io/blob/gh-pages/testbed/76489819-868e-426e-946d-f3bae1991a93/feed/index_updated.html

Can be useful https://inter-iot.readthedocs.io/projects/intermw/en/latest/developer-guide/json-ld-messaging/
https://schema.org/docs/iot-gettingstarted.html

P.S. Ignore the discussion below.

items = [{
"@type": "DataFeedItem",
"dateCreated": ["2019-11-21T:23:00:00","2019-12-21T:23:00:00"],
"itemId": '6fa02b33-4983-4818-a355-1b61499c87f0'
}]

itemsReference = [
{
"itemGuid": '6fa02b33-4983-4818-a355-1b61499c87f0'
"@type": "Dataset",
"variableMeasured": {
"@type": "PropertyValue",
"name": "battery",
"unitText": "percent",
"value": ["29.2", "28"]
}
}
] 

What do you think about this structure ?

We can use find to fetch result from itemsReference. If we have more complex data we can add that to itemsReference and fetch the required properties.

Where did you get itemsReference example? Or you invented by yourself? We can use a standard approach only.

We use this approach when creating tables in SQL.
We don't know yet how complex will be dynamic data. I think its better to break it in two arrays instead of one.

We can't use our own approach, since there no point to use non-standard JSON-LD. Let's pause the task. We need to get additional expertise. We will ask our partner for help.