GithubHelp home page GithubHelp logo

Comments (3)

bobeal avatar bobeal commented on July 30, 2024

Hi @lucboj-htag,

Yes, this is the expected behavior. Better than my explanations, you can have a look at Annex C.6 (Date Representation) of the NGSI-LD API specification which explains this in details.

Btw, why don't you use the native temporal properties from NGSI-LD? For instance, you could define your entity in the following way:

{
    "id": "urn:ngsi:TestObserved:123",
    "type": "TestObserved",
    "temperature": {
        "type": "Property",
        "value": 20.5,
        "observedAt": "2024-02-19T12:32:52.98601Z"
    },
    "@context": [
        "https://smartdatamodels.org/context.jsonld"
    ]
}

That makes the temperature and the observation date more related and it allows you to use the NGSI-LD Temporal API on the temperature attribute (for instance, asking for the last values over a period of time, with aggregations,...)

PS: Fiware-ServicePath is an NGSIv2 concept (it will be ignored when calling an NGSI-LD context broker). If you want to use a similar concept in NGSI-LD, have a look at scopes (introduced in section 4.18 of the NGSI-LD API specification)

from stellio-context-broker.

lucboj-htag avatar lucboj-htag commented on July 30, 2024

HI @bobeal,

thank you for your reply!

Annex C.6 explained it well and thank you for your tip on Fiware-ServicePath.

I am using "dateObserved" because I am migrating an existing NGSI V2 data model to NGSI-LD where "dateObserved" exist. Furthermore, many https://smartdatamodels.org require the field "dateObserved" to be used.

I do though add the "observedAt" field to fields where the NGSI-LD Temporal API is needed.

from stellio-context-broker.

bobeal avatar bobeal commented on July 30, 2024

I am using "dateObserved" because I am migrating an existing NGSI V2 data model to NGSI-LD where "dateObserved" exist. Furthermore, many https://smartdatamodels.org require the field "dateObserved" to be used.

Indeed, smart data models have a "constraint" to maintain compatibility with NGSIv2 and NGSI-LD. And it can sometimes add some fuzz in the data models :(

Closing this issue, don't hesitate to open a new one if you have other questions.

from stellio-context-broker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.