The playground directory structure has three components:
- A directory of Python template classes, with one template for each type defined by the model. Each template lists just the properties of the type, with no property values.
- A directory of Python example classes with property values from a template class filled in,
- A directory of serialized examples for each proposed serialization format, e.g., JSON1.
The template classes are generated from the logical model:
class Sbom:
sbomType: SBOMType = None
context: str = None
element: AnyUri = None
rootElement: AnyUri = None
namespaces: NamespaceMap = None
imports: ExternalMap = None
spdxId: AnyUri = None
name: str = None
summary: str = None
description: str = None
comment: str = None
creationInfo: CreationInfo = None
verifiedUsing: IntegrityMethod = None
externalReference: ExternalReference = None
externalIdentifier: ExternalIdentifier = None
extension: Extension = None
One example for each of the use cases listed in the README. Each example logical value is a copy of the template for that type with property values filled in. Many of the model types will not have a use case, and a few types will have several use cases / examples. Contributors may propose additional example logical values to accompany corresponding serialized data.
These are the logical values to be serialized into various serialization formats. All required properties must have a value; optional properties may be left empty (Python None).
class Sbom:
sbomType: SBOMType = 'source'
context: str = None
... TBSL ...
The contributor of a format shows how an example logical value is serialized and parsed to/from the serialized value for that use case.