Code Monkey home page Code Monkey logo

Comments (7)

wmkamerman avatar wmkamerman commented on June 18, 2024 1

Thank you! I have contacted the data provider to see if they can modify their packets, but this will surely take time if they even will do this at all. I will contact the spec authors :)

from senml.

dborovcanin avatar dborovcanin commented on June 18, 2024 1

Thanks, @wmkamerman. Please keep us posted if we should update, it's really a simple task, as you mentioned.

from senml.

wmkamerman avatar wmkamerman commented on June 18, 2024 1

@dusanb94 I have an update from the spec authors. You are right: the example in the spec is wrong, and every record needs to have a value or a sum.

Thank you for your email and indeed finding an error in the example of the SenML specification.

During the standardization work in the CoRE WG we discussed for some time whether the first record could have "only base values" and eventually we concluded that the benefits of allowing that are smaller than the downsides. Hence the RFC says you must always have either value or sum. Seems that we missed to update one of the examples and we should file an errata on the RFC to make that clear.

We can close this issue - I will reach out to our data provider.

from senml.

dborovcanin avatar dborovcanin commented on June 18, 2024

This design is driven by the spec, Section 4.2:

Value: Value of the entry. Optional if a Sum value is present;
otherwise, it's required. Values are represented using basic data
types. This specification defines floating-point numbers ("v"
field for "Value"), booleans ("vb" for "Boolean Value"), strings
("vs" for "String Value"), and binary data ("vd" for "Data
Value"). Exactly one Value field MUST appear unless there is a
Sum field, in which case it is allowed to have no Value field.

The particular example from the spec, however, does not have any of the sum value, base value, or any of the value fields. It looks to me that's the only such example.

from senml.

wmkamerman avatar wmkamerman commented on June 18, 2024

Hi @dusanb94, thank you for responding! If I understand you correctly, this particular example in the spec is incorrect? In that case I will have to contact the third party that is sending data to us.

Or would it be possible to allow a base Record without a Value using some flag?

from senml.

dborovcanin avatar dborovcanin commented on June 18, 2024

Hello, @wmkamerman, you're welcome. TBH, I can't be sure if the example is incorrect or the spec, but it looks like the example to me. Spec is very precise and this is the only example that does not meet requirements.

Or would it be possible to allow a base Record without a Value using some flag?

It would definitely be possible, but I would not like to do that because 1) the doc per se does not specify validation is configurable and 2) it looks to me that the spec is correct, it's just the example that isn't. Is it possible for the data provider to modify packets? Also, you can contact the original spec authors to check if the example is wrong, or I can write them an email.

from senml.

dborovcanin avatar dborovcanin commented on June 18, 2024

@wmkamerman Thanks for the explanation.

from senml.

Related Issues (2)

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.