It's great to see the new model as posted after the 2022-05-17 tech
meeting:
https://github.com/spdx/spdx-3-model/blob/4db2df8f9f9e69f6159fd167fb7dfe7f141b9f66/model.png.
We are making forward progress. It is particularly encouraging to see that
Collection / Document is no longer an Element.  A Document (or
TransferUnit) is a collection of Elements, not an Element.

However that does mean Document does not inherit Element properties and
must define its own. To avoid confusion, I propose that Document be defined
with property names prefixed to indicate that they are properties of the
collection that are default values for Elements where those properties are
omitted.  The Minimal Example would become:

{
  "type": "Document",
  "namespace": "urn:spdx.dev:ids:",
  "defaultSpecVersion": "3.0",
  "defaultProfile": ["core"],
  "defaultDataLicense": "CC0-1.0",
  "defaultCreatedBy": "iamwillbar",
  "defaultCreated": "2022-05-02T20:28:00.000Z",
  "elements": [
    {
      "type": "Person",
      "id": "iamwillbar"
    }
  ]
}

and the deserialized Person element would have five properties and id
prefix from the Document since they are omitted in the serialized Elements:

{
  "type": "Person",
  "id": "urn:spdx.dev:ids:iamwillbar",
  "specVersion": "3.0",
  "profile": ["core"],
  "dataLicense": "CC0-1.0",
  "createdBy": "urn:spdx.dev:ids:iamwillbar",
  "created": "2022-05-02T20:28:00.000Z"
}

Document does not have an id because it is not an Element.  Instead it has
a namespace property that is the prefix for Elements in the document that
have relative (local) ids. If the document is to have
name/summary/description/comment properties they also need to be defined in
the Document type.  They would not be prefixed because they apply to just
the document, not the elements it contains.

Alternatively Document could have a "defaults" property that contains the
five default element properties with names unchanged:

{
  "type": "Document",
  "namespace": "urn:spdx.dev:ids:",
  "defaults": {
    "specVersion": "3.0",
    "profile": ["core"],
    "dataLicense": "CC0-1.0",
    "createdBy": "iamwillbar",
    "created": "2022-05-02T20:28:00.000Z"
  },
  "elements": [
    {
      "type": "Person",
      "id": "iamwillbar"
    }
  ]
}

Regards,
Dave


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#4598): https://lists.spdx.org/g/Spdx-tech/message/4598
Mute This Topic: https://lists.spdx.org/mt/91883091/21656
Group Owner: [email protected]
Unsubscribe: https://lists.spdx.org/g/Spdx-tech/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to