I agree that rootElements is the simpler and preferred approach.  Bringing
up the relationship approach in the discussion made me wonder if I was
missing something, and the element type is what I might be missing.

document
  id: id0
  namespace: foo
  rootElements:
    id1
    id2
  elements:
    id: id1
    type?: file?

What part of the element tells you that the element is a snippet or file or
package or sbom?

Dave



On Thu, Jul 22, 2021 at 8:56 PM William Bartholomew <iamwill...@github.com>
wrote:

> Wouldn't the root element list be in a known location near the beginning?
> rootElements is a property on Document which is at the root of the file,
> for example:
>
> document:
>   rootElements:
>     - namespace#id1
>     - namespace#id2
>
> I am a little concerned about us re-opening some of these things,
> rootElements have been in the SPDX 3.0 model since early February.
> Comparing the logic for finding SBOMs between the two implementations:
>
> * rootElements approach: Navigate to document.rootElements, loop through
> each entry, load the elements it references filtering to those of type SBOM.
> * relationships approach: Navigate to document.relationships, loop through
> each entry that has relationship type DESCRIBES, filter to those where the
> from is the document and the to is of type SBOM.
>
> It feels that the rootElements approach solves this problem simpler than
> the relationships approach unless I'm missing something.
>
> William
>
>>


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#4116): https://lists.spdx.org/g/Spdx-tech/message/4116
Mute This Topic: https://lists.spdx.org/mt/84386487/21656
Group Owner: spdx-tech+ow...@lists.spdx.org
Unsubscribe: https://lists.spdx.org/g/Spdx-tech/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to