Code Monkey home page Code Monkey logo

Comments (5)

maxhbr avatar maxhbr commented on August 20, 2024

optional values (or NOASSERTION) is also something that is necessary for non enum values.

from spdx-3-model.

seabass-labrax avatar seabass-labrax commented on August 20, 2024

I completely agree - 'no assertion' is a concept, one which is permitted for some fields (the value is said to be optional) and prohibited for other fields (the value is said to be required).

It makes sense for 'no assertion' to be expressed in a serialisation format or programming language's 'native' way, if available. Thus, in a Clojure implementation I would use nil for 'no assertion', and for the JSON serialisation format, we (SPDX) might decide that, say, it's the omission of the field's key-value pair that signifies 'no assertion'.

If an Element declares that it conforms to a specific SPDX profile, that may make some fields required where they would otherwise be optional.

As a clarification, when you say:

Further, the default value and cardinallity of an enum should be decided by the user and not by the enum.

...I presume you are referring to SPDX Element types that have an Enum field, not the 'end user' of SPDX data?

from spdx-3-model.

davaya avatar davaya commented on August 20, 2024

+1

It should be noted that UNKNOWN is distinct from NOASSERTION -- it is an explicit statement rather than the lack of a statement, so UNKNOWN Is a legitimate enumerated item.

For fields that are optional in some contexts and required in others, both application behavior and serialization must be carefully considered.

  • Logical: does an application variable with field=nil compare as equal to the same object with field absent? It should, but in practice programming languages may not make it so.
  • Physical: a serialized value with field=nil definitely hashes to a different value than with the field absent.

from spdx-3-model.

maxhbr avatar maxhbr commented on August 20, 2024

this is a duplicate of #76?

from spdx-3-model.

kestewart avatar kestewart commented on August 20, 2024

Close this issue as it's being tracked in #76

from spdx-3-model.

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.