diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 13c91a23..a8be7ad2 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
- go-version: '1.18'
+ go-version: '1.23'
- name: Run tests
run: make test
- name: Send coverage report to coveralls
diff --git a/Makefile b/Makefile
index 4dd9d534..c05de945 100644
--- a/Makefile
+++ b/Makefile
@@ -13,9 +13,14 @@ format:
.PHONY: unit
unit:
- go test -v -covermode=count -coverprofile=profile.cov ./...
+ go test -v -covermode=count -coverprofile=profile.cov.tmp ./...
+ cat profile.cov.tmp | grep -v /internal/ | grep -v /model.go | grep -v /model_validations.go > profile.cov # ignore generated model file
.PHONY: fuzz
fuzz:
go test -v -run=Fuzz -fuzz=FuzzShouldIgnore ./utils -fuzztime=10s
go test -v -run=Fuzz -fuzz=FuzzPackageCanGetVerificationCode ./utils -fuzztime=10s
+
+.PHONY: generate
+generate:
+ go run ./spdx/v3/internal/generate
diff --git a/convert/chain.go b/convert/chain.go
index ac96733c..ea010f7b 100644
--- a/convert/chain.go
+++ b/convert/chain.go
@@ -9,16 +9,19 @@ import (
converter "github.com/anchore/go-struct-converter"
"github.com/spdx/tools-golang/spdx/common"
- "github.com/spdx/tools-golang/spdx/v2/v2_1"
"github.com/spdx/tools-golang/spdx/v2/v2_2"
"github.com/spdx/tools-golang/spdx/v2/v2_3"
+ "github.com/spdx/tools-golang/spdx/v3/v3_0"
)
-var DocumentChain = converter.NewChain(
- v2_1.Document{},
- v2_2.Document{},
- v2_3.Document{},
-)
+func DocumentChain() converter.FuncChain {
+ return converter.NewFuncChain(
+ v2_2.From_v2_1, v2_2.To_v2_1,
+ v2_3.From_v2_2, v2_3.To_v2_2,
+ v3_0.From_v2_3,
+ // for future v3.x to v3.y conversions, see funcChain.AutoPackageConverter()
+ )
+}
// Document converts from one document to another document
// For example, converting a document to the latest version could be done like:
@@ -35,5 +38,5 @@ func Document(from common.AnyDocument, to common.AnyDocument) error {
reflect.ValueOf(to).Elem().Set(reflect.ValueOf(from))
return nil
}
- return DocumentChain.Convert(from, to)
+ return DocumentChain().Convert(from, to)
}
diff --git a/go.mod b/go.mod
index 5366c619..da5a37ce 100644
--- a/go.mod
+++ b/go.mod
@@ -1,18 +1,33 @@
module github.com/spdx/tools-golang
-go 1.22
+go 1.23.5
require (
- github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092
+ github.com/anchore/go-struct-converter v0.0.0-20251008145103-b79fc8ba4f45
+ github.com/dave/jennifer v1.7.1
+ github.com/deiu/rdf2go v0.0.0-20241212211204-b661ba0dfd25
+ github.com/gertd/go-pluralize v0.2.1
github.com/google/go-cmp v0.7.0
+ github.com/google/uuid v1.6.0
+ github.com/piprate/json-gold v0.7.0
+ github.com/pmezard/go-difflib v1.0.0
github.com/spdx/gordf v0.0.0-20201111095634-7098f93598fb
github.com/stretchr/testify v1.11.1
+ mvdan.cc/gofumpt v0.7.0
sigs.k8s.io/yaml v1.6.0
)
require (
- github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/pmezard/go-difflib v1.0.0 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
+
+require (
+ github.com/davecgh/go-spew v1.1.1 // indirect
+ github.com/deiu/gon3 v0.0.0-20241212124032-93153c038193 // indirect
+ github.com/linkeddata/gojsonld v0.0.0-20170418210642-4f5db6791326 // indirect
+ github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 // indirect
+ github.com/rychipman/easylex v0.0.0-20160129204217-49ee7767142f // indirect
+ golang.org/x/mod v0.14.0 // indirect
+ golang.org/x/tools v0.17.0 // indirect
+)
diff --git a/go.sum b/go.sum
index 61d50058..57f11ee8 100644
--- a/go.sum
+++ b/go.sum
@@ -1,11 +1,37 @@
-github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092 h1:aM1rlcoLz8y5B2r4tTLMiVTrMtpfY0O8EScKJxaSaEc=
-github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092/go.mod h1:rYqSE9HbjzpHTI74vwPvae4ZVYZd1lue2ta6xHPdblA=
+github.com/anchore/go-struct-converter v0.0.0-20251008145103-b79fc8ba4f45 h1:sqkP57/1/85SgWDHHJmY4ubBJUIpGlto6JZql6Dpp34=
+github.com/anchore/go-struct-converter v0.0.0-20251008145103-b79fc8ba4f45/go.mod h1:SxEY1rkVuDSqQOnD1+G4A45wAKXPMum/a51ywvN/8o4=
+github.com/dave/jennifer v1.7.1 h1:B4jJJDHelWcDhlRQxWeo0Npa/pYKBLrirAQoTN45txo=
+github.com/dave/jennifer v1.7.1/go.mod h1:nXbxhEmQfOZhWml3D1cDK5M1FLnMSozpbFN/m3RmGZc=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/deiu/gon3 v0.0.0-20241212124032-93153c038193 h1:EQBdXSCO7r+0KQE/pN6v+RAH7p6+yz+6pbCfHh+ETME=
+github.com/deiu/gon3 v0.0.0-20241212124032-93153c038193/go.mod h1:EdezkFZtCJELxMo+YIX5B5i5ofz9U+n+xSxWku6mOS0=
+github.com/deiu/rdf2go v0.0.0-20241212211204-b661ba0dfd25 h1:drltZW/t3SgIHpURgCii68Jq0zvpcGhtkWRf3zmbxpc=
+github.com/deiu/rdf2go v0.0.0-20241212211204-b661ba0dfd25/go.mod h1:AAL3UBTBShUaH3y68LyhlSjz6S6DoHoMSpAWvnCiTCs=
+github.com/gertd/go-pluralize v0.2.1 h1:M3uASbVjMnTsPb0PNqg+E/24Vwigyo/tvyMTtAlLgiA=
+github.com/gertd/go-pluralize v0.2.1/go.mod h1:rbYaKDbsXxmRfr8uygAEKhOWsjyrrqrkHVpZvoOp8zk=
+github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI=
+github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
+github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
+github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
+github.com/linkeddata/gojsonld v0.0.0-20170418210642-4f5db6791326 h1:YP3lfXXYiQV5MKeUqVnxRP5uuMQTLPx+PGYm1UBoU98=
+github.com/linkeddata/gojsonld v0.0.0-20170418210642-4f5db6791326/go.mod h1:nfqkuSNlsk1bvti/oa7TThx4KmRMBmSxf3okHI9wp3E=
+github.com/piprate/json-gold v0.7.0 h1:bEMirgA5y8Z2loTQfxyIFfY+EflxH1CTP6r/KIlcJNw=
+github.com/piprate/json-gold v0.7.0/go.mod h1:RVhE35veDX19r5gfUAR+IYHkAUuPwJO8Ie/qVeFaIzw=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 h1:J9b7z+QKAmPf4YLrFg6oQUotqHQeUNWwkvo7jZp1GLU=
+github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA=
+github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
+github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
+github.com/rychipman/easylex v0.0.0-20160129204217-49ee7767142f h1:L2/fBPABieQnQzfV40k2Zw7IcvZbt0CN5TgwUl8zDCs=
+github.com/rychipman/easylex v0.0.0-20160129204217-49ee7767142f/go.mod h1:MZ2GRTcqmve6EoSbErWgCR+Ash4p8Gc5esHe8MDErss=
github.com/spdx/gordf v0.0.0-20201111095634-7098f93598fb h1:bLo8hvc8XFm9J47r690TUKBzcjSWdJDxmjXJZ+/f92U=
github.com/spdx/gordf v0.0.0-20201111095634-7098f93598fb/go.mod h1:uKWaldnbMnjsSAXRurWqqrdyZen1R7kxl8TkmWk2OyM=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
@@ -14,9 +40,15 @@ go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=
go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=
go.yaml.in/yaml/v3 v3.0.3 h1:bXOww4E/J3f66rav3pX3m8w6jDE4knZjGOw8b5Y6iNE=
go.yaml.in/yaml/v3 v3.0.3/go.mod h1:tBHosrYAkRZjRAOREWbDnBXUf08JOwYq++0QNwQiWzI=
+golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
+golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
+golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc=
+golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+mvdan.cc/gofumpt v0.7.0 h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU=
+mvdan.cc/gofumpt v0.7.0/go.mod h1:txVFJy/Sc/mvaycET54pV8SW8gWxTlUuGHVEcncmNUo=
sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs=
sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4=
diff --git a/json/reader.go b/json/reader.go
index f1a0b989..ec161281 100644
--- a/json/reader.go
+++ b/json/reader.go
@@ -7,6 +7,7 @@ import (
"encoding/json"
"fmt"
"io"
+ "regexp"
"github.com/spdx/tools-golang/convert"
"github.com/spdx/tools-golang/spdx"
@@ -14,6 +15,7 @@ import (
"github.com/spdx/tools-golang/spdx/v2/v2_1"
"github.com/spdx/tools-golang/spdx/v2/v2_2"
"github.com/spdx/tools-golang/spdx/v2/v2_3"
+ "github.com/spdx/tools-golang/spdx/v3/v3_0"
)
// Read takes an io.Reader and returns a fully-parsed current model SPDX Document
@@ -48,8 +50,19 @@ func ReadInto(content io.Reader, doc common.AnyDocument) error {
return fmt.Errorf("not a valid SPDX JSON document")
}
- version, ok := val["spdxVersion"]
- if !ok {
+ version, _ := val["spdxVersion"].(string)
+ if version == "" {
+ version, _ = val["@context"].(string)
+ if version != "" {
+ extract := regexp.MustCompile(`https://spdx.org/rdf/(\d+(?:\.\d+)+)/spdx-context\.jsonld`)
+ matches := extract.FindStringSubmatch(version)
+ if len(matches) == 2 {
+ version = matches[1]
+ }
+ }
+ }
+
+ if version == "" {
return fmt.Errorf("JSON document does not contain spdxVersion field")
}
@@ -75,6 +88,20 @@ func ReadInto(content io.Reader, doc common.AnyDocument) error {
return err
}
data = doc
+ case "3.0.0":
+ fallthrough
+ case v3_0.Version:
+ // support older 3.0.x versions
+ contents := buf.Bytes()
+ if version != v3_0.Version {
+ contents = bytes.Replace(contents, []byte(version), []byte(fmt.Sprintf("https://spdx.org/rdf/%s/spdx-context.jsonld", v3_0.Version)), 1)
+ }
+ var in v3_0.Document
+ err = json.Unmarshal(contents, &in)
+ if err != nil {
+ return err
+ }
+ data = in
default:
return fmt.Errorf("unsupported SDPX version: %s", version)
}
diff --git a/json/reader_test.go b/json/reader_test.go
index 31c81f32..e1b383e4 100644
--- a/json/reader_test.go
+++ b/json/reader_test.go
@@ -3,6 +3,8 @@ package json
import (
"os"
"testing"
+
+ "github.com/spdx/tools-golang/spdx/v3/v3_0"
)
// TestRead tests that the SPDX Reader can still parse json documents correctly
@@ -28,3 +30,29 @@ func TestRead(t *testing.T) {
})
}
}
+
+// TestRead tests that the SPDX Reader can still parse json documents correctly
+// this protects against any of the custom unmarshalling code breaking given a new change set
+func TestReadV3(t *testing.T) {
+ tt := []struct {
+ filename string
+ }{
+ {"test_fixtures/spdx2_3.json"},
+ {"../spdx/v3/v3_0/testdata/test.json"},
+ }
+
+ for _, tc := range tt {
+ t.Run(tc.filename, func(t *testing.T) {
+ file, err := os.Open(tc.filename)
+ if err != nil {
+ t.Errorf("error opening %s: %v", tc.filename, err)
+ }
+ defer file.Close()
+ doc := v3_0.Document{}
+ err = ReadInto(file, &doc)
+ if err != nil {
+ t.Errorf("error reading %s: %v", tc.filename, err)
+ }
+ })
+ }
+}
diff --git a/spdx/v2/v2_1/document.go b/spdx/v2/v2_1/document.go
index bd6b41d4..5f69a790 100644
--- a/spdx/v2/v2_1/document.go
+++ b/spdx/v2/v2_1/document.go
@@ -4,8 +4,6 @@
package v2_1
import (
- converter "github.com/anchore/go-struct-converter"
-
"github.com/spdx/tools-golang/spdx/v2/common"
)
@@ -70,10 +68,3 @@ type Document struct {
// DEPRECATED in version 2.0 of spec
Reviews []*Review `json:"-"`
}
-
-func (d *Document) ConvertFrom(_ interface{}) error {
- d.SPDXVersion = Version
- return nil
-}
-
-var _ converter.ConvertFrom = (*Document)(nil)
diff --git a/spdx/v2/v2_2/document.go b/spdx/v2/v2_2/document.go
index 5fcd33aa..b0371571 100644
--- a/spdx/v2/v2_2/document.go
+++ b/spdx/v2/v2_2/document.go
@@ -7,9 +7,8 @@ import (
"encoding/json"
"fmt"
- converter "github.com/anchore/go-struct-converter"
-
"github.com/spdx/tools-golang/spdx/v2/common"
+ "github.com/spdx/tools-golang/spdx/v2/v2_1"
)
const Version = "SPDX-2.2"
@@ -74,12 +73,13 @@ type Document struct {
Reviews []*Review `json:"-"`
}
-func (d *Document) ConvertFrom(_ interface{}) error {
+func From_v2_1(_ v2_1.Document, d *Document) {
d.SPDXVersion = Version
- return nil
}
-var _ converter.ConvertFrom = (*Document)(nil)
+func To_v2_1(_ Document, d *v2_1.Document) {
+ d.SPDXVersion = v2_1.Version
+}
func (d *Document) UnmarshalJSON(b []byte) error {
type doc Document
diff --git a/spdx/v2/v2_2/example/example.go b/spdx/v2/v2_2/example/example.go
index 501eb773..dd867074 100644
--- a/spdx/v2/v2_2/example/example.go
+++ b/spdx/v2/v2_2/example/example.go
@@ -1,427 +1,416 @@
package example
import (
- "fmt"
-
- converter "github.com/anchore/go-struct-converter"
-
"github.com/spdx/tools-golang/spdx/v2/common"
spdx "github.com/spdx/tools-golang/spdx/v2/v2_2"
)
// Copy provides a deep copy of the example
func Copy() spdx.Document {
- out := spdx.Document{}
- err := converter.Convert(example, &out)
- if err != nil {
- panic(fmt.Errorf("unable to convert example doc: %w", err))
- }
- return out
-}
-
-// Example is handwritten translation of an official example SPDX document into a Go struct.
-// We expect that the result of parsing the official document should be this value.
-// We expect that the result of writing this struct should match the official example document.
-var example = spdx.Document{
- DataLicense: spdx.DataLicense,
- SPDXVersion: spdx.Version,
- SPDXIdentifier: "DOCUMENT",
- DocumentName: "SPDX-Tools-v2.0",
- DocumentNamespace: "http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301",
- CreationInfo: &spdx.CreationInfo{
- LicenseListVersion: "3.9",
- Creators: []common.Creator{
- {CreatorType: "Tool", Creator: "LicenseFind-1.0"},
- {CreatorType: "Organization", Creator: "ExampleCodeInspect ()"},
- {CreatorType: "Person", Creator: "Jane Doe ()"},
- },
- Created: "2010-01-29T18:30:22Z",
- CreatorComment: "This package has been shipped in source and binary form.\nThe binaries were created with gcc 4.5.1 and expect to link to\ncompatible system run time libraries.",
- },
- DocumentComment: "This document was created using SPDX 2.0 using licenses from the web site.",
- ExternalDocumentReferences: []spdx.ExternalDocumentRef{
- {
- DocumentRefID: "DocumentRef-spdx-tool-1.2",
- URI: "http://spdx.org/spdxdocs/spdx-tools-v1.2-3F2504E0-4F89-41D3-9A0C-0305E82C3301",
- Checksum: common.Checksum{
- Algorithm: common.SHA1,
- Value: "d6a770ba38583ed4bb4525bd96e50461655d2759",
+ // Example is handwritten translation of an official example SPDX document into a Go struct.
+ // We expect that the result of parsing the official document should be this value.
+ // We expect that the result of writing this struct should match the official example document.
+ return spdx.Document{
+ DataLicense: spdx.DataLicense,
+ SPDXVersion: spdx.Version,
+ SPDXIdentifier: "DOCUMENT",
+ DocumentName: "SPDX-Tools-v2.0",
+ DocumentNamespace: "http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301",
+ CreationInfo: &spdx.CreationInfo{
+ LicenseListVersion: "3.9",
+ Creators: []common.Creator{
+ {CreatorType: "Tool", Creator: "LicenseFind-1.0"},
+ {CreatorType: "Organization", Creator: "ExampleCodeInspect ()"},
+ {CreatorType: "Person", Creator: "Jane Doe ()"},
},
+ Created: "2010-01-29T18:30:22Z",
+ CreatorComment: "This package has been shipped in source and binary form.\nThe binaries were created with gcc 4.5.1 and expect to link to\ncompatible system run time libraries.",
},
- },
- OtherLicenses: []*spdx.OtherLicense{
- {
- LicenseIdentifier: "LicenseRef-1",
- ExtractedText: "/*\n * (c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. The name of the author may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/",
- },
- {
- LicenseIdentifier: "LicenseRef-2",
- ExtractedText: "This package includes the GRDDL parser developed by Hewlett Packard under the following license:\n� Copyright 2007 Hewlett-Packard Development Company, LP\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: \n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. \nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. \nThe name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. \nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
- },
- {
- LicenseIdentifier: "LicenseRef-4",
- ExtractedText: "/*\n * (c) Copyright 2009 University of Bristol\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. The name of the author may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/",
- },
- {
- LicenseIdentifier: "LicenseRef-Beerware-4.2",
- ExtractedText: "\"THE BEER-WARE LICENSE\" (Revision 42):\nphk@FreeBSD.ORG wrote this file. As long as you retain this notice you\ncan do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return Poul-Henning Kamp",
- LicenseComment: "The beerware license has a couple of other standard variants.",
- LicenseName: "Beer-Ware License (Version 42)",
- LicenseCrossReferences: []string{"http://people.freebsd.org/~phk/"},
- },
- {
- LicenseIdentifier: "LicenseRef-3",
- ExtractedText: "The CyberNeko Software License, Version 1.0\n\n \n(C) Copyright 2002-2005, Andy Clark. All rights reserved.\n \nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer. \n\n2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in\n the documentation and/or other materials provided with the\n distribution.\n\n3. The end-user documentation included with the redistribution,\n if any, must include the following acknowledgment: \n \"This product includes software developed by Andy Clark.\"\n Alternately, this acknowledgment may appear in the software itself,\n if and wherever such third-party acknowledgments normally appear.\n\n4. The names \"CyberNeko\" and \"NekoHTML\" must not be used to endorse\n or promote products derived from this software without prior \n written permission. For written permission, please contact \n andyc@cyberneko.net.\n\n5. Products derived from this software may not be called \"CyberNeko\",\n nor may \"CyberNeko\" appear in their name, without prior written\n permission of the author.\n\nTHIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED\nWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\nOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS\nBE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, \nOR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT \nOF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR \nBUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \nWHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE \nOR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, \nEVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
- LicenseName: "CyberNeko License",
- LicenseCrossReferences: []string{
- "http://people.apache.org/~andyc/neko/LICENSE",
- "http://justasample.url.com",
+ DocumentComment: "This document was created using SPDX 2.0 using licenses from the web site.",
+ ExternalDocumentReferences: []spdx.ExternalDocumentRef{
+ {
+ DocumentRefID: "DocumentRef-spdx-tool-1.2",
+ URI: "http://spdx.org/spdxdocs/spdx-tools-v1.2-3F2504E0-4F89-41D3-9A0C-0305E82C3301",
+ Checksum: common.Checksum{
+ Algorithm: common.SHA1,
+ Value: "d6a770ba38583ed4bb4525bd96e50461655d2759",
+ },
},
- LicenseComment: "This is tye CyperNeko License",
},
- },
- Annotations: []*spdx.Annotation{
- {
- Annotator: common.Annotator{
- Annotator: "Jane Doe ()",
- AnnotatorType: "Person",
+ OtherLicenses: []*spdx.OtherLicense{
+ {
+ LicenseIdentifier: "LicenseRef-1",
+ ExtractedText: "/*\n * (c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. The name of the author may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/",
},
- AnnotationDate: "2010-01-29T18:30:22Z",
- AnnotationType: "OTHER",
- AnnotationComment: "Document level annotation",
- },
- {
- Annotator: common.Annotator{
- Annotator: "Joe Reviewer",
- AnnotatorType: "Person",
+ {
+ LicenseIdentifier: "LicenseRef-2",
+ ExtractedText: "This package includes the GRDDL parser developed by Hewlett Packard under the following license:\n� Copyright 2007 Hewlett-Packard Development Company, LP\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: \n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. \nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. \nThe name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. \nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
},
- AnnotationDate: "2010-02-10T00:00:00Z",
- AnnotationType: "REVIEW",
- AnnotationComment: "This is just an example. Some of the non-standard licenses look like they are actually BSD 3 clause licenses",
- },
- {
- Annotator: common.Annotator{
- Annotator: "Suzanne Reviewer",
- AnnotatorType: "Person",
+ {
+ LicenseIdentifier: "LicenseRef-4",
+ ExtractedText: "/*\n * (c) Copyright 2009 University of Bristol\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. The name of the author may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/",
+ },
+ {
+ LicenseIdentifier: "LicenseRef-Beerware-4.2",
+ ExtractedText: "\"THE BEER-WARE LICENSE\" (Revision 42):\nphk@FreeBSD.ORG wrote this file. As long as you retain this notice you\ncan do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return Poul-Henning Kamp",
+ LicenseComment: "The beerware license has a couple of other standard variants.",
+ LicenseName: "Beer-Ware License (Version 42)",
+ LicenseCrossReferences: []string{"http://people.freebsd.org/~phk/"},
+ },
+ {
+ LicenseIdentifier: "LicenseRef-3",
+ ExtractedText: "The CyberNeko Software License, Version 1.0\n\n \n(C) Copyright 2002-2005, Andy Clark. All rights reserved.\n \nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer. \n\n2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in\n the documentation and/or other materials provided with the\n distribution.\n\n3. The end-user documentation included with the redistribution,\n if any, must include the following acknowledgment: \n \"This product includes software developed by Andy Clark.\"\n Alternately, this acknowledgment may appear in the software itself,\n if and wherever such third-party acknowledgments normally appear.\n\n4. The names \"CyberNeko\" and \"NekoHTML\" must not be used to endorse\n or promote products derived from this software without prior \n written permission. For written permission, please contact \n andyc@cyberneko.net.\n\n5. Products derived from this software may not be called \"CyberNeko\",\n nor may \"CyberNeko\" appear in their name, without prior written\n permission of the author.\n\nTHIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED\nWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\nOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS\nBE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, \nOR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT \nOF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR \nBUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \nWHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE \nOR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, \nEVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
+ LicenseName: "CyberNeko License",
+ LicenseCrossReferences: []string{
+ "http://people.apache.org/~andyc/neko/LICENSE",
+ "http://justasample.url.com",
+ },
+ LicenseComment: "This is tye CyperNeko License",
},
- AnnotationDate: "2011-03-13T00:00:00Z",
- AnnotationType: "REVIEW",
- AnnotationComment: "Another example reviewer.",
},
- },
- Packages: []*spdx.Package{
- {
- PackageName: "glibc",
- PackageSPDXIdentifier: "Package",
- PackageVersion: "2.11.1",
- PackageFileName: "glibc-2.11.1.tar.gz",
- PackageSupplier: &common.Supplier{
- Supplier: "Jane Doe (jane.doe@example.com)",
- SupplierType: "Person",
+ Annotations: []*spdx.Annotation{
+ {
+ Annotator: common.Annotator{
+ Annotator: "Jane Doe ()",
+ AnnotatorType: "Person",
+ },
+ AnnotationDate: "2010-01-29T18:30:22Z",
+ AnnotationType: "OTHER",
+ AnnotationComment: "Document level annotation",
},
- PackageOriginator: &common.Originator{
- Originator: "ExampleCodeInspect (contact@example.com)",
- OriginatorType: "Organization",
+ {
+ Annotator: common.Annotator{
+ Annotator: "Joe Reviewer",
+ AnnotatorType: "Person",
+ },
+ AnnotationDate: "2010-02-10T00:00:00Z",
+ AnnotationType: "REVIEW",
+ AnnotationComment: "This is just an example. Some of the non-standard licenses look like they are actually BSD 3 clause licenses",
},
- PackageDownloadLocation: "http://ftp.gnu.org/gnu/glibc/glibc-ports-2.15.tar.gz",
- FilesAnalyzed: true,
- IsFilesAnalyzedTagPresent: true,
- PackageVerificationCode: common.PackageVerificationCode{
- Value: "d6a770ba38583ed4bb4525bd96e50461655d2758",
- ExcludedFiles: []string{"./package.spdx"},
+ {
+ Annotator: common.Annotator{
+ Annotator: "Suzanne Reviewer",
+ AnnotatorType: "Person",
+ },
+ AnnotationDate: "2011-03-13T00:00:00Z",
+ AnnotationType: "REVIEW",
+ AnnotationComment: "Another example reviewer.",
},
- PackageChecksums: []common.Checksum{
- {
- Algorithm: "MD5",
- Value: "624c1abb3664f4b35547e7c73864ad24",
+ },
+ Packages: []*spdx.Package{
+ {
+ PackageName: "glibc",
+ PackageSPDXIdentifier: "Package",
+ PackageVersion: "2.11.1",
+ PackageFileName: "glibc-2.11.1.tar.gz",
+ PackageSupplier: &common.Supplier{
+ Supplier: "Jane Doe (jane.doe@example.com)",
+ SupplierType: "Person",
},
- {
- Algorithm: "SHA1",
- Value: "85ed0817af83a24ad8da68c2b5094de69833983c",
+ PackageOriginator: &common.Originator{
+ Originator: "ExampleCodeInspect (contact@example.com)",
+ OriginatorType: "Organization",
},
- {
- Algorithm: "SHA256",
- Value: "11b6d3ee554eedf79299905a98f9b9a04e498210b59f15094c916c91d150efcd",
+ PackageDownloadLocation: "http://ftp.gnu.org/gnu/glibc/glibc-ports-2.15.tar.gz",
+ FilesAnalyzed: true,
+ IsFilesAnalyzedTagPresent: true,
+ PackageVerificationCode: common.PackageVerificationCode{
+ Value: "d6a770ba38583ed4bb4525bd96e50461655d2758",
+ ExcludedFiles: []string{"./package.spdx"},
},
- },
- PackageHomePage: "http://ftp.gnu.org/gnu/glibc",
- PackageSourceInfo: "uses glibc-2_11-branch from git://sourceware.org/git/glibc.git.",
- PackageLicenseConcluded: "(LGPL-2.0-only OR LicenseRef-3)",
- PackageLicenseInfoFromFiles: []string{
- "GPL-2.0-only",
- "LicenseRef-2",
- "LicenseRef-1",
- },
- PackageLicenseDeclared: "(LGPL-2.0-only AND LicenseRef-3)",
- PackageLicenseComments: "The license for this project changed with the release of version x.y. The version of the project included here post-dates the license change.",
- PackageCopyrightText: "Copyright 2008-2010 John Smith",
- PackageSummary: "GNU C library.",
- PackageDescription: "The GNU C Library defines functions that are specified by the ISO C standard, as well as additional features specific to POSIX and other derivatives of the Unix operating system, and extensions specific to GNU systems.",
- PackageComment: "",
- PackageExternalReferences: []*spdx.PackageExternalReference{
- {
- Category: "SECURITY",
- RefType: "cpe23Type",
- Locator: "cpe:2.3:a:pivotal_software:spring_framework:4.1.0:*:*:*:*:*:*:*",
+ PackageChecksums: []common.Checksum{
+ {
+ Algorithm: "MD5",
+ Value: "624c1abb3664f4b35547e7c73864ad24",
+ },
+ {
+ Algorithm: "SHA1",
+ Value: "85ed0817af83a24ad8da68c2b5094de69833983c",
+ },
+ {
+ Algorithm: "SHA256",
+ Value: "11b6d3ee554eedf79299905a98f9b9a04e498210b59f15094c916c91d150efcd",
+ },
},
- {
- Category: "OTHER",
- RefType: "http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301#LocationRef-acmeforge",
- Locator: "acmecorp/acmenator/4.1.3-alpha",
- ExternalRefComment: "This is the external ref for Acme",
+ PackageHomePage: "http://ftp.gnu.org/gnu/glibc",
+ PackageSourceInfo: "uses glibc-2_11-branch from git://sourceware.org/git/glibc.git.",
+ PackageLicenseConcluded: "(LGPL-2.0-only OR LicenseRef-3)",
+ PackageLicenseInfoFromFiles: []string{
+ "GPL-2.0-only",
+ "LicenseRef-2",
+ "LicenseRef-1",
},
- },
- PackageAttributionTexts: []string{
- "The GNU C Library is free software. See the file COPYING.LIB for copying conditions, and LICENSES for notices about a few contributions that require these additional notices to be distributed. License copyright years may be listed using range notation, e.g., 1996-2015, indicating that every year in the range, inclusive, is a copyrightable year that would otherwise be listed individually.",
- },
- Files: nil,
- Annotations: []spdx.Annotation{
- {
- Annotator: common.Annotator{
- Annotator: "Package Commenter",
- AnnotatorType: "Person",
+ PackageLicenseDeclared: "(LGPL-2.0-only AND LicenseRef-3)",
+ PackageLicenseComments: "The license for this project changed with the release of version x.y. The version of the project included here post-dates the license change.",
+ PackageCopyrightText: "Copyright 2008-2010 John Smith",
+ PackageSummary: "GNU C library.",
+ PackageDescription: "The GNU C Library defines functions that are specified by the ISO C standard, as well as additional features specific to POSIX and other derivatives of the Unix operating system, and extensions specific to GNU systems.",
+ PackageComment: "",
+ PackageExternalReferences: []*spdx.PackageExternalReference{
+ {
+ Category: "SECURITY",
+ RefType: "cpe23Type",
+ Locator: "cpe:2.3:a:pivotal_software:spring_framework:4.1.0:*:*:*:*:*:*:*",
+ },
+ {
+ Category: "OTHER",
+ RefType: "http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301#LocationRef-acmeforge",
+ Locator: "acmecorp/acmenator/4.1.3-alpha",
+ ExternalRefComment: "This is the external ref for Acme",
},
- AnnotationDate: "2011-01-29T18:30:22Z",
- AnnotationType: "OTHER",
- AnnotationComment: "Package level annotation",
},
- },
- },
- {
- PackageSPDXIdentifier: "fromDoap-1",
- PackageCopyrightText: "NOASSERTION",
- PackageDownloadLocation: "NOASSERTION",
- FilesAnalyzed: false,
- IsFilesAnalyzedTagPresent: true,
- PackageHomePage: "http://commons.apache.org/proper/commons-lang/",
- PackageLicenseConcluded: "NOASSERTION",
- PackageLicenseDeclared: "NOASSERTION",
- PackageName: "Apache Commons Lang",
- },
- {
- PackageName: "Jena",
- PackageSPDXIdentifier: "fromDoap-0",
- PackageCopyrightText: "NOASSERTION",
- PackageDownloadLocation: "https://search.maven.org/remotecontent?filepath=org/apache/jena/apache-jena/3.12.0/apache-jena-3.12.0.tar.gz",
- PackageExternalReferences: []*spdx.PackageExternalReference{
- {
- Category: "PACKAGE-MANAGER",
- RefType: "purl",
- Locator: "pkg:maven/org.apache.jena/apache-jena@3.12.0",
+ PackageAttributionTexts: []string{
+ "The GNU C Library is free software. See the file COPYING.LIB for copying conditions, and LICENSES for notices about a few contributions that require these additional notices to be distributed. License copyright years may be listed using range notation, e.g., 1996-2015, indicating that every year in the range, inclusive, is a copyrightable year that would otherwise be listed individually.",
},
- },
- FilesAnalyzed: true,
- IsFilesAnalyzedTagPresent: false,
- PackageHomePage: "http://www.openjena.org/",
- PackageLicenseConcluded: "NOASSERTION",
- PackageLicenseDeclared: "NOASSERTION",
- PackageVersion: "3.12.0",
- },
- {
- PackageSPDXIdentifier: "Saxon",
- PackageChecksums: []common.Checksum{
- {
- Algorithm: "SHA1",
- Value: "85ed0817af83a24ad8da68c2b5094de69833983c",
+ Files: nil,
+ Annotations: []spdx.Annotation{
+ {
+ Annotator: common.Annotator{
+ Annotator: "Package Commenter",
+ AnnotatorType: "Person",
+ },
+ AnnotationDate: "2011-01-29T18:30:22Z",
+ AnnotationType: "OTHER",
+ AnnotationComment: "Package level annotation",
+ },
},
},
- PackageCopyrightText: "Copyright Saxonica Ltd",
- PackageDescription: "The Saxon package is a collection of tools for processing XML documents.",
- PackageDownloadLocation: "https://sourceforge.net/projects/saxon/files/Saxon-B/8.8.0.7/saxonb8-8-0-7j.zip/download",
- FilesAnalyzed: false,
- IsFilesAnalyzedTagPresent: true,
- PackageHomePage: "http://saxon.sourceforge.net/",
- PackageLicenseComments: "Other versions available for a commercial license",
- PackageLicenseConcluded: "MPL-1.0",
- PackageLicenseDeclared: "MPL-1.0",
- PackageName: "Saxon",
- PackageFileName: "saxonB-8.8.zip",
- PackageVersion: "8.8",
- },
- },
- Files: []*spdx.File{
- {
- FileName: "./src/org/spdx/parser/DOAPProject.java",
- FileSPDXIdentifier: "DoapSource",
- FileTypes: []string{
- "SOURCE",
+ {
+ PackageSPDXIdentifier: "fromDoap-1",
+ PackageCopyrightText: "NOASSERTION",
+ PackageDownloadLocation: "NOASSERTION",
+ FilesAnalyzed: false,
+ IsFilesAnalyzedTagPresent: true,
+ PackageHomePage: "http://commons.apache.org/proper/commons-lang/",
+ PackageLicenseConcluded: "NOASSERTION",
+ PackageLicenseDeclared: "NOASSERTION",
+ PackageName: "Apache Commons Lang",
},
- Checksums: []common.Checksum{
- {
- Algorithm: "SHA1",
- Value: "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12",
+ {
+ PackageName: "Jena",
+ PackageSPDXIdentifier: "fromDoap-0",
+ PackageCopyrightText: "NOASSERTION",
+ PackageDownloadLocation: "https://search.maven.org/remotecontent?filepath=org/apache/jena/apache-jena/3.12.0/apache-jena-3.12.0.tar.gz",
+ PackageExternalReferences: []*spdx.PackageExternalReference{
+ {
+ Category: "PACKAGE-MANAGER",
+ RefType: "purl",
+ Locator: "pkg:maven/org.apache.jena/apache-jena@3.12.0",
+ },
},
+ FilesAnalyzed: true,
+ IsFilesAnalyzedTagPresent: false,
+ PackageHomePage: "http://www.openjena.org/",
+ PackageLicenseConcluded: "NOASSERTION",
+ PackageLicenseDeclared: "NOASSERTION",
+ PackageVersion: "3.12.0",
},
- LicenseConcluded: "Apache-2.0",
- LicenseInfoInFiles: []string{
- "Apache-2.0",
- },
- FileCopyrightText: "Copyright 2010, 2011 Source Auditor Inc.",
- FileContributors: []string{
- "Protecode Inc.",
- "SPDX Technical Team Members",
- "Open Logic Inc.",
- "Source Auditor Inc.",
- "Black Duck Software In.c",
- },
- },
- {
- FileSPDXIdentifier: "CommonsLangSrc",
- Checksums: []common.Checksum{
- {
- Algorithm: "SHA1",
- Value: "c2b4e1c67a2d28fced849ee1bb76e7391b93f125",
+ {
+ PackageSPDXIdentifier: "Saxon",
+ PackageChecksums: []common.Checksum{
+ {
+ Algorithm: "SHA1",
+ Value: "85ed0817af83a24ad8da68c2b5094de69833983c",
+ },
},
+ PackageCopyrightText: "Copyright Saxonica Ltd",
+ PackageDescription: "The Saxon package is a collection of tools for processing XML documents.",
+ PackageDownloadLocation: "https://sourceforge.net/projects/saxon/files/Saxon-B/8.8.0.7/saxonb8-8-0-7j.zip/download",
+ FilesAnalyzed: false,
+ IsFilesAnalyzedTagPresent: true,
+ PackageHomePage: "http://saxon.sourceforge.net/",
+ PackageLicenseComments: "Other versions available for a commercial license",
+ PackageLicenseConcluded: "MPL-1.0",
+ PackageLicenseDeclared: "MPL-1.0",
+ PackageName: "Saxon",
+ PackageFileName: "saxonB-8.8.zip",
+ PackageVersion: "8.8",
},
- FileComment: "This file is used by Jena",
- FileCopyrightText: "Copyright 2001-2011 The Apache Software Foundation",
- FileContributors: []string{"Apache Software Foundation"},
- FileName: "./lib-source/commons-lang3-3.1-sources.jar",
- FileTypes: []string{"ARCHIVE"},
- LicenseConcluded: "Apache-2.0",
- LicenseInfoInFiles: []string{"Apache-2.0"},
- FileNotice: "Apache Commons Lang\nCopyright 2001-2011 The Apache Software Foundation\n\nThis product includes software developed by\nThe Apache Software Foundation (http://www.apache.org/).\n\nThis product includes software from the Spring Framework,\nunder the Apache License 2.0 (see: StringUtils.containsWhitespace())",
},
- {
- FileSPDXIdentifier: "JenaLib",
- Checksums: []common.Checksum{
- {
- Algorithm: "SHA1",
- Value: "3ab4e1c67a2d28fced849ee1bb76e7391b93f125",
+ Files: []*spdx.File{
+ {
+ FileName: "./src/org/spdx/parser/DOAPProject.java",
+ FileSPDXIdentifier: "DoapSource",
+ FileTypes: []string{
+ "SOURCE",
},
- },
- FileComment: "This file belongs to Jena",
- FileCopyrightText: "(c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP",
- FileContributors: []string{"Apache Software Foundation", "Hewlett Packard Inc."},
- FileName: "./lib-source/jena-2.6.3-sources.jar",
- FileTypes: []string{"ARCHIVE"},
- LicenseComments: "This license is used by Jena",
- LicenseConcluded: "LicenseRef-1",
- LicenseInfoInFiles: []string{"LicenseRef-1"},
- },
- {
- FileSPDXIdentifier: "File",
- Annotations: []spdx.Annotation{
- {
- Annotator: common.Annotator{
- Annotator: "File Commenter",
- AnnotatorType: "Person",
+ Checksums: []common.Checksum{
+ {
+ Algorithm: "SHA1",
+ Value: "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12",
},
- AnnotationDate: "2011-01-29T18:30:22Z",
- AnnotationType: "OTHER",
- AnnotationComment: "File level annotation",
},
- },
- Checksums: []common.Checksum{
- {
- Algorithm: "SHA1",
- Value: "d6a770ba38583ed4bb4525bd96e50461655d2758",
+ LicenseConcluded: "Apache-2.0",
+ LicenseInfoInFiles: []string{
+ "Apache-2.0",
},
- {
- Algorithm: "MD5",
- Value: "624c1abb3664f4b35547e7c73864ad24",
+ FileCopyrightText: "Copyright 2010, 2011 Source Auditor Inc.",
+ FileContributors: []string{
+ "Protecode Inc.",
+ "SPDX Technical Team Members",
+ "Open Logic Inc.",
+ "Source Auditor Inc.",
+ "Black Duck Software In.c",
},
},
- FileComment: "The concluded license was taken from the package level that the file was included in.\nThis information was found in the COPYING.txt file in the xyz directory.",
- FileCopyrightText: "Copyright 2008-2010 John Smith",
- FileContributors: []string{"The Regents of the University of California", "Modified by Paul Mundt lethal@linux-sh.org", "IBM Corporation"},
- FileName: "./package/foo.c",
- FileTypes: []string{"SOURCE"},
- LicenseComments: "The concluded license was taken from the package level that the file was included in.",
- LicenseConcluded: "(LGPL-2.0-only OR LicenseRef-2)",
- LicenseInfoInFiles: []string{"GPL-2.0-only", "LicenseRef-2"},
- FileNotice: "Copyright (c) 2001 Aaron Lehmann aaroni@vitelus.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the �Software�), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: \nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED �AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
- },
- },
- Snippets: []spdx.Snippet{
- {
- SnippetSPDXIdentifier: "Snippet",
- SnippetFromFileSPDXIdentifier: "DoapSource",
- Ranges: []common.SnippetRange{
- {
- StartPointer: common.SnippetRangePointer{
- Offset: 310,
- FileSPDXIdentifier: "DoapSource",
+ {
+ FileSPDXIdentifier: "CommonsLangSrc",
+ Checksums: []common.Checksum{
+ {
+ Algorithm: "SHA1",
+ Value: "c2b4e1c67a2d28fced849ee1bb76e7391b93f125",
},
- EndPointer: common.SnippetRangePointer{
- Offset: 420,
- FileSPDXIdentifier: "DoapSource",
+ },
+ FileComment: "This file is used by Jena",
+ FileCopyrightText: "Copyright 2001-2011 The Apache Software Foundation",
+ FileContributors: []string{"Apache Software Foundation"},
+ FileName: "./lib-source/commons-lang3-3.1-sources.jar",
+ FileTypes: []string{"ARCHIVE"},
+ LicenseConcluded: "Apache-2.0",
+ LicenseInfoInFiles: []string{"Apache-2.0"},
+ FileNotice: "Apache Commons Lang\nCopyright 2001-2011 The Apache Software Foundation\n\nThis product includes software developed by\nThe Apache Software Foundation (http://www.apache.org/).\n\nThis product includes software from the Spring Framework,\nunder the Apache License 2.0 (see: StringUtils.containsWhitespace())",
+ },
+ {
+ FileSPDXIdentifier: "JenaLib",
+ Checksums: []common.Checksum{
+ {
+ Algorithm: "SHA1",
+ Value: "3ab4e1c67a2d28fced849ee1bb76e7391b93f125",
},
},
- {
- StartPointer: common.SnippetRangePointer{
- LineNumber: 5,
- FileSPDXIdentifier: "DoapSource",
+ FileComment: "This file belongs to Jena",
+ FileCopyrightText: "(c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP",
+ FileContributors: []string{"Apache Software Foundation", "Hewlett Packard Inc."},
+ FileName: "./lib-source/jena-2.6.3-sources.jar",
+ FileTypes: []string{"ARCHIVE"},
+ LicenseComments: "This license is used by Jena",
+ LicenseConcluded: "LicenseRef-1",
+ LicenseInfoInFiles: []string{"LicenseRef-1"},
+ },
+ {
+ FileSPDXIdentifier: "File",
+ Annotations: []spdx.Annotation{
+ {
+ Annotator: common.Annotator{
+ Annotator: "File Commenter",
+ AnnotatorType: "Person",
+ },
+ AnnotationDate: "2011-01-29T18:30:22Z",
+ AnnotationType: "OTHER",
+ AnnotationComment: "File level annotation",
},
- EndPointer: common.SnippetRangePointer{
- LineNumber: 23,
- FileSPDXIdentifier: "DoapSource",
+ },
+ Checksums: []common.Checksum{
+ {
+ Algorithm: "SHA1",
+ Value: "d6a770ba38583ed4bb4525bd96e50461655d2758",
+ },
+ {
+ Algorithm: "MD5",
+ Value: "624c1abb3664f4b35547e7c73864ad24",
},
},
+ FileComment: "The concluded license was taken from the package level that the file was included in.\nThis information was found in the COPYING.txt file in the xyz directory.",
+ FileCopyrightText: "Copyright 2008-2010 John Smith",
+ FileContributors: []string{"The Regents of the University of California", "Modified by Paul Mundt lethal@linux-sh.org", "IBM Corporation"},
+ FileName: "./package/foo.c",
+ FileTypes: []string{"SOURCE"},
+ LicenseComments: "The concluded license was taken from the package level that the file was included in.",
+ LicenseConcluded: "(LGPL-2.0-only OR LicenseRef-2)",
+ LicenseInfoInFiles: []string{"GPL-2.0-only", "LicenseRef-2"},
+ FileNotice: "Copyright (c) 2001 Aaron Lehmann aaroni@vitelus.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the �Software�), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: \nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED �AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
},
- SnippetLicenseConcluded: "GPL-2.0-only",
- LicenseInfoInSnippet: []string{"GPL-2.0-only"},
- SnippetLicenseComments: "The concluded license was taken from package xyz, from which the snippet was copied into the current file. The concluded license information was found in the COPYING.txt file in package xyz.",
- SnippetCopyrightText: "Copyright 2008-2010 John Smith",
- SnippetComment: "This snippet was identified as significant and highlighted in this Apache-2.0 file, when a commercial scanner identified it as being derived from file foo.c in package xyz which is licensed under GPL-2.0.",
- SnippetName: "from linux kernel",
- },
- },
- Relationships: []*spdx.Relationship{
- {
- RefA: common.MakeDocElementID("", "DOCUMENT"),
- RefB: common.MakeDocElementID("", "Package"),
- Relationship: "CONTAINS",
- },
- {
- RefA: common.MakeDocElementID("", "Package"),
- RefB: common.MakeDocElementID("", "CommonsLangSrc"),
- Relationship: "CONTAINS",
- },
- {
- RefA: common.MakeDocElementID("", "Package"),
- RefB: common.MakeDocElementID("", "DoapSource"),
- Relationship: "CONTAINS",
- },
- {
- RefA: common.MakeDocElementID("", "DOCUMENT"),
- RefB: common.MakeDocElementID("spdx-tool-1.2", "ToolsElement"),
- Relationship: "COPY_OF",
- },
- {
- RefA: common.MakeDocElementID("", "DOCUMENT"),
- RefB: common.MakeDocElementID("", "File"),
- Relationship: "DESCRIBES",
- },
- {
- RefA: common.MakeDocElementID("", "DOCUMENT"),
- RefB: common.MakeDocElementID("", "Package"),
- Relationship: "DESCRIBES",
- },
- {
- RefA: common.MakeDocElementID("", "Package"),
- RefB: common.MakeDocElementID("", "JenaLib"),
- Relationship: "CONTAINS",
},
- {
- RefA: common.MakeDocElementID("", "Package"),
- RefB: common.MakeDocElementID("", "Saxon"),
- Relationship: "DYNAMIC_LINK",
- },
- {
- RefA: common.MakeDocElementID("", "CommonsLangSrc"),
- RefB: common.MakeDocElementSpecial("NOASSERTION"),
- Relationship: "GENERATED_FROM",
- },
- {
- RefA: common.MakeDocElementID("", "JenaLib"),
- RefB: common.MakeDocElementID("", "Package"),
- Relationship: "CONTAINS",
+ Snippets: []spdx.Snippet{
+ {
+ SnippetSPDXIdentifier: "Snippet",
+ SnippetFromFileSPDXIdentifier: "DoapSource",
+ Ranges: []common.SnippetRange{
+ {
+ StartPointer: common.SnippetRangePointer{
+ Offset: 310,
+ FileSPDXIdentifier: "DoapSource",
+ },
+ EndPointer: common.SnippetRangePointer{
+ Offset: 420,
+ FileSPDXIdentifier: "DoapSource",
+ },
+ },
+ {
+ StartPointer: common.SnippetRangePointer{
+ LineNumber: 5,
+ FileSPDXIdentifier: "DoapSource",
+ },
+ EndPointer: common.SnippetRangePointer{
+ LineNumber: 23,
+ FileSPDXIdentifier: "DoapSource",
+ },
+ },
+ },
+ SnippetLicenseConcluded: "GPL-2.0-only",
+ LicenseInfoInSnippet: []string{"GPL-2.0-only"},
+ SnippetLicenseComments: "The concluded license was taken from package xyz, from which the snippet was copied into the current file. The concluded license information was found in the COPYING.txt file in package xyz.",
+ SnippetCopyrightText: "Copyright 2008-2010 John Smith",
+ SnippetComment: "This snippet was identified as significant and highlighted in this Apache-2.0 file, when a commercial scanner identified it as being derived from file foo.c in package xyz which is licensed under GPL-2.0.",
+ SnippetName: "from linux kernel",
+ },
},
- {
- RefA: common.MakeDocElementID("", "File"),
- RefB: common.MakeDocElementID("", "fromDoap-0"),
- Relationship: "GENERATED_FROM",
+ Relationships: []*spdx.Relationship{
+ {
+ RefA: common.MakeDocElementID("", "DOCUMENT"),
+ RefB: common.MakeDocElementID("", "Package"),
+ Relationship: "CONTAINS",
+ },
+ {
+ RefA: common.MakeDocElementID("", "Package"),
+ RefB: common.MakeDocElementID("", "CommonsLangSrc"),
+ Relationship: "CONTAINS",
+ },
+ {
+ RefA: common.MakeDocElementID("", "Package"),
+ RefB: common.MakeDocElementID("", "DoapSource"),
+ Relationship: "CONTAINS",
+ },
+ {
+ RefA: common.MakeDocElementID("", "DOCUMENT"),
+ RefB: common.MakeDocElementID("spdx-tool-1.2", "ToolsElement"),
+ Relationship: "COPY_OF",
+ },
+ {
+ RefA: common.MakeDocElementID("", "DOCUMENT"),
+ RefB: common.MakeDocElementID("", "File"),
+ Relationship: "DESCRIBES",
+ },
+ {
+ RefA: common.MakeDocElementID("", "DOCUMENT"),
+ RefB: common.MakeDocElementID("", "Package"),
+ Relationship: "DESCRIBES",
+ },
+ {
+ RefA: common.MakeDocElementID("", "Package"),
+ RefB: common.MakeDocElementID("", "JenaLib"),
+ Relationship: "CONTAINS",
+ },
+ {
+ RefA: common.MakeDocElementID("", "Package"),
+ RefB: common.MakeDocElementID("", "Saxon"),
+ Relationship: "DYNAMIC_LINK",
+ },
+ {
+ RefA: common.MakeDocElementID("", "CommonsLangSrc"),
+ RefB: common.MakeDocElementSpecial("NOASSERTION"),
+ Relationship: "GENERATED_FROM",
+ },
+ {
+ RefA: common.MakeDocElementID("", "JenaLib"),
+ RefB: common.MakeDocElementID("", "Package"),
+ Relationship: "CONTAINS",
+ },
+ {
+ RefA: common.MakeDocElementID("", "File"),
+ RefB: common.MakeDocElementID("", "fromDoap-0"),
+ Relationship: "GENERATED_FROM",
+ },
},
- },
+ }
}
diff --git a/spdx/v2/v2_2/rdf/reader/parse_license_test.go b/spdx/v2/v2_2/rdf/reader/parse_license_test.go
index 969112bf..bef6fc79 100644
--- a/spdx/v2/v2_2/rdf/reader/parse_license_test.go
+++ b/spdx/v2/v2_2/rdf/reader/parse_license_test.go
@@ -193,7 +193,6 @@ func Test_rdfParser2_2_getAnyLicenseFromNode(t *testing.T) {
`)
node := parser.gordfParserObj.Triples[0].Subject
_, err = parser.getAnyLicenseFromNode(node)
- t.Log(err)
if err == nil {
t.Errorf("should've raised an error for invalid input")
}
diff --git a/spdx/v2/v2_2/rdf/reader/parser_test.go b/spdx/v2/v2_2/rdf/reader/parser_test.go
index d008ed39..d9acc276 100644
--- a/spdx/v2/v2_2/rdf/reader/parser_test.go
+++ b/spdx/v2/v2_2/rdf/reader/parser_test.go
@@ -127,7 +127,6 @@ func Test_rdfParser2_2_getSpdxDocNode(t *testing.T) {
`)
_, err = parser.getSpdxDocNode()
- t.Log(err)
if err == nil {
t.Errorf("expected and error due to more than one type triples for the SpdxDocument Node, got %v", err)
}
@@ -139,7 +138,6 @@ func Test_rdfParser2_2_getSpdxDocNode(t *testing.T) {
`)
_, err = parser.getSpdxDocNode()
- t.Log(err)
if err == nil {
t.Errorf("rootNode must be associated with exactly one triple of predicate rdf:type, got %v", err)
}
diff --git a/spdx/v2/v2_3/document.go b/spdx/v2/v2_3/document.go
index 62b7619b..eaf3463f 100644
--- a/spdx/v2/v2_3/document.go
+++ b/spdx/v2/v2_3/document.go
@@ -7,9 +7,8 @@ import (
"encoding/json"
"fmt"
- converter "github.com/anchore/go-struct-converter"
-
"github.com/spdx/tools-golang/spdx/v2/common"
+ "github.com/spdx/tools-golang/spdx/v2/v2_2"
)
const Version = "SPDX-2.3"
@@ -73,12 +72,13 @@ type Document struct {
Reviews []*Review `json:"-" yaml:"-"`
}
-func (d *Document) ConvertFrom(_ interface{}) error {
+func From_v2_2(_ v2_2.Document, d *Document) {
d.SPDXVersion = Version
- return nil
}
-var _ converter.ConvertFrom = (*Document)(nil)
+func To_v2_2(_ Document, d *v2_2.Document) {
+ d.SPDXVersion = v2_2.Version
+}
func (d *Document) UnmarshalJSON(b []byte) error {
type doc Document
diff --git a/spdx/v2/v2_3/example/example.go b/spdx/v2/v2_3/example/example.go
index e426d876..30ba9936 100644
--- a/spdx/v2/v2_3/example/example.go
+++ b/spdx/v2/v2_3/example/example.go
@@ -1,442 +1,431 @@
package example
import (
- "fmt"
-
- converter "github.com/anchore/go-struct-converter"
-
"github.com/spdx/tools-golang/spdx/v2/common"
spdx "github.com/spdx/tools-golang/spdx/v2/v2_3"
)
// Copy provides a deep copy of the example
func Copy() spdx.Document {
- out := spdx.Document{}
- err := converter.Convert(example, &out)
- if err != nil {
- panic(fmt.Errorf("unable to convert example doc: %w", err))
- }
- return out
-}
-
-// Example is handwritten translation of an official example SPDX document into a Go struct.
-// We expect that the result of parsing the official document should be this value.
-// We expect that the result of writing this struct should match the official example document.
-var example = spdx.Document{
- DataLicense: spdx.DataLicense,
- SPDXVersion: spdx.Version,
- SPDXIdentifier: "DOCUMENT",
- DocumentName: "SPDX-Tools-v2.0",
- DocumentNamespace: "http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301",
- CreationInfo: &spdx.CreationInfo{
- LicenseListVersion: "3.9",
- Creators: []common.Creator{
- {CreatorType: "Tool", Creator: "LicenseFind-1.0"},
- {CreatorType: "Organization", Creator: "ExampleCodeInspect ()"},
- {CreatorType: "Person", Creator: "Jane Doe ()"},
- },
- Created: "2010-01-29T18:30:22Z",
- CreatorComment: "This package has been shipped in source and binary form.\nThe binaries were created with gcc 4.5.1 and expect to link to\ncompatible system run time libraries.",
- },
- DocumentComment: "This document was created using SPDX 2.0 using licenses from the web site.",
- ExternalDocumentReferences: []spdx.ExternalDocumentRef{
- {
- DocumentRefID: "DocumentRef-spdx-tool-1.2",
- URI: "http://spdx.org/spdxdocs/spdx-tools-v1.2-3F2504E0-4F89-41D3-9A0C-0305E82C3301",
- Checksum: common.Checksum{
- Algorithm: common.SHA1,
- Value: "d6a770ba38583ed4bb4525bd96e50461655d2759",
+ // Example is handwritten translation of an official example SPDX document into a Go struct.
+ // We expect that the result of parsing the official document should be this value.
+ // We expect that the result of writing this struct should match the official example document.
+ return spdx.Document{
+ DataLicense: spdx.DataLicense,
+ SPDXVersion: spdx.Version,
+ SPDXIdentifier: "DOCUMENT",
+ DocumentName: "SPDX-Tools-v2.0",
+ DocumentNamespace: "http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301",
+ CreationInfo: &spdx.CreationInfo{
+ LicenseListVersion: "3.9",
+ Creators: []common.Creator{
+ {CreatorType: "Tool", Creator: "LicenseFind-1.0"},
+ {CreatorType: "Organization", Creator: "ExampleCodeInspect ()"},
+ {CreatorType: "Person", Creator: "Jane Doe ()"},
},
+ Created: "2010-01-29T18:30:22Z",
+ CreatorComment: "This package has been shipped in source and binary form.\nThe binaries were created with gcc 4.5.1 and expect to link to\ncompatible system run time libraries.",
},
- },
- OtherLicenses: []*spdx.OtherLicense{
- {
- LicenseIdentifier: "LicenseRef-1",
- ExtractedText: "/*\n * (c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. The name of the author may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/",
- },
- {
- LicenseIdentifier: "LicenseRef-2",
- ExtractedText: "This package includes the GRDDL parser developed by Hewlett Packard under the following license:\n� Copyright 2007 Hewlett-Packard Development Company, LP\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: \n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. \nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. \nThe name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. \nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
- },
- {
- LicenseIdentifier: "LicenseRef-4",
- ExtractedText: "/*\n * (c) Copyright 2009 University of Bristol\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. The name of the author may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/",
- },
- {
- LicenseIdentifier: "LicenseRef-Beerware-4.2",
- ExtractedText: "\"THE BEER-WARE LICENSE\" (Revision 42):\nphk@FreeBSD.ORG wrote this file. As long as you retain this notice you\ncan do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return Poul-Henning Kamp",
- LicenseComment: "The beerware license has a couple of other standard variants.",
- LicenseName: "Beer-Ware License (Version 42)",
- LicenseCrossReferences: []string{"http://people.freebsd.org/~phk/"},
- },
- {
- LicenseIdentifier: "LicenseRef-3",
- ExtractedText: "The CyberNeko Software License, Version 1.0\n\n \n(C) Copyright 2002-2005, Andy Clark. All rights reserved.\n \nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer. \n\n2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in\n the documentation and/or other materials provided with the\n distribution.\n\n3. The end-user documentation included with the redistribution,\n if any, must include the following acknowledgment: \n \"This product includes software developed by Andy Clark.\"\n Alternately, this acknowledgment may appear in the software itself,\n if and wherever such third-party acknowledgments normally appear.\n\n4. The names \"CyberNeko\" and \"NekoHTML\" must not be used to endorse\n or promote products derived from this software without prior \n written permission. For written permission, please contact \n andyc@cyberneko.net.\n\n5. Products derived from this software may not be called \"CyberNeko\",\n nor may \"CyberNeko\" appear in their name, without prior written\n permission of the author.\n\nTHIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED\nWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\nOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS\nBE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, \nOR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT \nOF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR \nBUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \nWHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE \nOR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, \nEVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
- LicenseName: "CyberNeko License",
- LicenseCrossReferences: []string{
- "http://people.apache.org/~andyc/neko/LICENSE",
- "http://justasample.url.com",
+ DocumentComment: "This document was created using SPDX 2.0 using licenses from the web site.",
+ ExternalDocumentReferences: []spdx.ExternalDocumentRef{
+ {
+ DocumentRefID: "DocumentRef-spdx-tool-1.2",
+ URI: "http://spdx.org/spdxdocs/spdx-tools-v1.2-3F2504E0-4F89-41D3-9A0C-0305E82C3301",
+ Checksum: common.Checksum{
+ Algorithm: common.SHA1,
+ Value: "d6a770ba38583ed4bb4525bd96e50461655d2759",
+ },
},
- LicenseComment: "This is tye CyperNeko License",
},
- },
- Annotations: []*spdx.Annotation{
- {
- Annotator: common.Annotator{
- Annotator: "Jane Doe ()",
- AnnotatorType: "Person",
+ OtherLicenses: []*spdx.OtherLicense{
+ {
+ LicenseIdentifier: "LicenseRef-1",
+ ExtractedText: "/*\n * (c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. The name of the author may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/",
},
- AnnotationDate: "2010-01-29T18:30:22Z",
- AnnotationType: "OTHER",
- AnnotationComment: "Document level annotation",
- },
- {
- Annotator: common.Annotator{
- Annotator: "Joe Reviewer",
- AnnotatorType: "Person",
+ {
+ LicenseIdentifier: "LicenseRef-2",
+ ExtractedText: "This package includes the GRDDL parser developed by Hewlett Packard under the following license:\n� Copyright 2007 Hewlett-Packard Development Company, LP\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: \n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. \nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. \nThe name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. \nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
},
- AnnotationDate: "2010-02-10T00:00:00Z",
- AnnotationType: "REVIEW",
- AnnotationComment: "This is just an example. Some of the non-standard licenses look like they are actually BSD 3 clause licenses",
- },
- {
- Annotator: common.Annotator{
- Annotator: "Suzanne Reviewer",
- AnnotatorType: "Person",
+ {
+ LicenseIdentifier: "LicenseRef-4",
+ ExtractedText: "/*\n * (c) Copyright 2009 University of Bristol\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. The name of the author may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/",
+ },
+ {
+ LicenseIdentifier: "LicenseRef-Beerware-4.2",
+ ExtractedText: "\"THE BEER-WARE LICENSE\" (Revision 42):\nphk@FreeBSD.ORG wrote this file. As long as you retain this notice you\ncan do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return Poul-Henning Kamp",
+ LicenseComment: "The beerware license has a couple of other standard variants.",
+ LicenseName: "Beer-Ware License (Version 42)",
+ LicenseCrossReferences: []string{"http://people.freebsd.org/~phk/"},
+ },
+ {
+ LicenseIdentifier: "LicenseRef-3",
+ ExtractedText: "The CyberNeko Software License, Version 1.0\n\n \n(C) Copyright 2002-2005, Andy Clark. All rights reserved.\n \nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer. \n\n2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in\n the documentation and/or other materials provided with the\n distribution.\n\n3. The end-user documentation included with the redistribution,\n if any, must include the following acknowledgment: \n \"This product includes software developed by Andy Clark.\"\n Alternately, this acknowledgment may appear in the software itself,\n if and wherever such third-party acknowledgments normally appear.\n\n4. The names \"CyberNeko\" and \"NekoHTML\" must not be used to endorse\n or promote products derived from this software without prior \n written permission. For written permission, please contact \n andyc@cyberneko.net.\n\n5. Products derived from this software may not be called \"CyberNeko\",\n nor may \"CyberNeko\" appear in their name, without prior written\n permission of the author.\n\nTHIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED\nWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\nOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS\nBE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, \nOR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT \nOF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR \nBUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \nWHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE \nOR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, \nEVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
+ LicenseName: "CyberNeko License",
+ LicenseCrossReferences: []string{
+ "http://people.apache.org/~andyc/neko/LICENSE",
+ "http://justasample.url.com",
+ },
+ LicenseComment: "This is tye CyperNeko License",
},
- AnnotationDate: "2011-03-13T00:00:00Z",
- AnnotationType: "REVIEW",
- AnnotationComment: "Another example reviewer.",
},
- },
- Packages: []*spdx.Package{
- {
- PackageName: "glibc",
- PackageSPDXIdentifier: "Package",
- PackageVersion: "2.11.1",
- PackageFileName: "glibc-2.11.1.tar.gz",
- PackageSupplier: &common.Supplier{
- Supplier: "Jane Doe (jane.doe@example.com)",
- SupplierType: "Person",
+ Annotations: []*spdx.Annotation{
+ {
+ Annotator: common.Annotator{
+ Annotator: "Jane Doe ()",
+ AnnotatorType: "Person",
+ },
+ AnnotationDate: "2010-01-29T18:30:22Z",
+ AnnotationType: "OTHER",
+ AnnotationComment: "Document level annotation",
},
- PackageOriginator: &common.Originator{
- Originator: "ExampleCodeInspect (contact@example.com)",
- OriginatorType: "Organization",
+ {
+ Annotator: common.Annotator{
+ Annotator: "Joe Reviewer",
+ AnnotatorType: "Person",
+ },
+ AnnotationDate: "2010-02-10T00:00:00Z",
+ AnnotationType: "REVIEW",
+ AnnotationComment: "This is just an example. Some of the non-standard licenses look like they are actually BSD 3 clause licenses",
},
- PackageDownloadLocation: "http://ftp.gnu.org/gnu/glibc/glibc-ports-2.15.tar.gz",
- FilesAnalyzed: true,
- IsFilesAnalyzedTagPresent: true,
- PackageVerificationCode: &common.PackageVerificationCode{
- Value: "d6a770ba38583ed4bb4525bd96e50461655d2758",
- ExcludedFiles: []string{"./package.spdx"},
+ {
+ Annotator: common.Annotator{
+ Annotator: "Suzanne Reviewer",
+ AnnotatorType: "Person",
+ },
+ AnnotationDate: "2011-03-13T00:00:00Z",
+ AnnotationType: "REVIEW",
+ AnnotationComment: "Another example reviewer.",
},
- PackageChecksums: []common.Checksum{
- {
- Algorithm: "MD5",
- Value: "624c1abb3664f4b35547e7c73864ad24",
+ },
+ Packages: []*spdx.Package{
+ {
+ PackageName: "glibc",
+ PackageSPDXIdentifier: "Package",
+ PackageVersion: "2.11.1",
+ PackageFileName: "glibc-2.11.1.tar.gz",
+ PackageSupplier: &common.Supplier{
+ Supplier: "Jane Doe (jane.doe@example.com)",
+ SupplierType: "Person",
},
- {
- Algorithm: "SHA1",
- Value: "85ed0817af83a24ad8da68c2b5094de69833983c",
+ PackageOriginator: &common.Originator{
+ Originator: "ExampleCodeInspect (contact@example.com)",
+ OriginatorType: "Organization",
},
- {
- Algorithm: "SHA256",
- Value: "11b6d3ee554eedf79299905a98f9b9a04e498210b59f15094c916c91d150efcd",
+ PackageDownloadLocation: "http://ftp.gnu.org/gnu/glibc/glibc-ports-2.15.tar.gz",
+ FilesAnalyzed: true,
+ IsFilesAnalyzedTagPresent: true,
+ PackageVerificationCode: &common.PackageVerificationCode{
+ Value: "d6a770ba38583ed4bb4525bd96e50461655d2758",
+ ExcludedFiles: []string{"./package.spdx"},
},
- },
- PackageHomePage: "http://ftp.gnu.org/gnu/glibc",
- PackageSourceInfo: "uses glibc-2_11-branch from git://sourceware.org/git/glibc.git.",
- PackageLicenseConcluded: "(LGPL-2.0-only OR LicenseRef-3)",
- PackageLicenseInfoFromFiles: []string{
- "GPL-2.0-only",
- "LicenseRef-2",
- "LicenseRef-1",
- },
- PackageLicenseDeclared: "(LGPL-2.0-only AND LicenseRef-3)",
- PackageLicenseComments: "The license for this project changed with the release of version x.y. The version of the project included here post-dates the license change.",
- PackageCopyrightText: "Copyright 2008-2010 John Smith",
- PackageSummary: "GNU C library.",
- PackageDescription: "The GNU C Library defines functions that are specified by the ISO C standard, as well as additional features specific to POSIX and other derivatives of the Unix operating system, and extensions specific to GNU systems.",
- PackageComment: "",
- PackageExternalReferences: []*spdx.PackageExternalReference{
- {
- Category: "SECURITY",
- RefType: "cpe23Type",
- Locator: "cpe:2.3:a:pivotal_software:spring_framework:4.1.0:*:*:*:*:*:*:*",
+ PackageChecksums: []common.Checksum{
+ {
+ Algorithm: "MD5",
+ Value: "624c1abb3664f4b35547e7c73864ad24",
+ },
+ {
+ Algorithm: "SHA1",
+ Value: "85ed0817af83a24ad8da68c2b5094de69833983c",
+ },
+ {
+ Algorithm: "SHA256",
+ Value: "11b6d3ee554eedf79299905a98f9b9a04e498210b59f15094c916c91d150efcd",
+ },
},
- {
- Category: "OTHER",
- RefType: "http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301#LocationRef-acmeforge",
- Locator: "acmecorp/acmenator/4.1.3-alpha",
- ExternalRefComment: "This is the external ref for Acme",
+ PackageHomePage: "http://ftp.gnu.org/gnu/glibc",
+ PackageSourceInfo: "uses glibc-2_11-branch from git://sourceware.org/git/glibc.git.",
+ PackageLicenseConcluded: "(LGPL-2.0-only OR LicenseRef-3)",
+ PackageLicenseInfoFromFiles: []string{
+ "GPL-2.0-only",
+ "LicenseRef-2",
+ "LicenseRef-1",
},
- },
- PackageAttributionTexts: []string{
- "The GNU C Library is free software. See the file COPYING.LIB for copying conditions, and LICENSES for notices about a few contributions that require these additional notices to be distributed. License copyright years may be listed using range notation, e.g., 1996-2015, indicating that every year in the range, inclusive, is a copyrightable year that would otherwise be listed individually.",
- },
- Files: nil,
- Annotations: []spdx.Annotation{
- {
- Annotator: common.Annotator{
- Annotator: "Package Commenter",
- AnnotatorType: "Person",
+ PackageLicenseDeclared: "(LGPL-2.0-only AND LicenseRef-3)",
+ PackageLicenseComments: "The license for this project changed with the release of version x.y. The version of the project included here post-dates the license change.",
+ PackageCopyrightText: "Copyright 2008-2010 John Smith",
+ PackageSummary: "GNU C library.",
+ PackageDescription: "The GNU C Library defines functions that are specified by the ISO C standard, as well as additional features specific to POSIX and other derivatives of the Unix operating system, and extensions specific to GNU systems.",
+ PackageComment: "",
+ PackageExternalReferences: []*spdx.PackageExternalReference{
+ {
+ Category: "SECURITY",
+ RefType: "cpe23Type",
+ Locator: "cpe:2.3:a:pivotal_software:spring_framework:4.1.0:*:*:*:*:*:*:*",
+ },
+ {
+ Category: "OTHER",
+ RefType: "http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301#LocationRef-acmeforge",
+ Locator: "acmecorp/acmenator/4.1.3-alpha",
+ ExternalRefComment: "This is the external ref for Acme",
},
- AnnotationDate: "2011-01-29T18:30:22Z",
- AnnotationType: "OTHER",
- AnnotationComment: "Package level annotation",
},
- },
- },
- {
- PackageSPDXIdentifier: "fromDoap-1",
- PackageCopyrightText: "NOASSERTION",
- PackageDownloadLocation: "NOASSERTION",
- FilesAnalyzed: false,
- IsFilesAnalyzedTagPresent: true,
- PackageHomePage: "http://commons.apache.org/proper/commons-lang/",
- PackageLicenseConcluded: "NOASSERTION",
- PackageLicenseDeclared: "NOASSERTION",
- PackageName: "Apache Commons Lang",
- },
- {
- PackageName: "Jena",
- PackageSPDXIdentifier: "fromDoap-0",
- PackageCopyrightText: "NOASSERTION",
- PackageDownloadLocation: "https://search.maven.org/remotecontent?filepath=org/apache/jena/apache-jena/3.12.0/apache-jena-3.12.0.tar.gz",
- PackageExternalReferences: []*spdx.PackageExternalReference{
- {
- Category: "PACKAGE-MANAGER",
- RefType: "purl",
- Locator: "pkg:maven/org.apache.jena/apache-jena@3.12.0",
+ PackageAttributionTexts: []string{
+ "The GNU C Library is free software. See the file COPYING.LIB for copying conditions, and LICENSES for notices about a few contributions that require these additional notices to be distributed. License copyright years may be listed using range notation, e.g., 1996-2015, indicating that every year in the range, inclusive, is a copyrightable year that would otherwise be listed individually.",
},
- },
- FilesAnalyzed: true,
- IsFilesAnalyzedTagPresent: false,
- PackageHomePage: "http://www.openjena.org/",
- PackageLicenseConcluded: "NOASSERTION",
- PackageLicenseDeclared: "NOASSERTION",
- PackageVersion: "3.12.0",
- },
- {
- PackageSPDXIdentifier: "Saxon",
- PackageChecksums: []common.Checksum{
- {
- Algorithm: "SHA1",
- Value: "85ed0817af83a24ad8da68c2b5094de69833983c",
+ Files: nil,
+ Annotations: []spdx.Annotation{
+ {
+ Annotator: common.Annotator{
+ Annotator: "Package Commenter",
+ AnnotatorType: "Person",
+ },
+ AnnotationDate: "2011-01-29T18:30:22Z",
+ AnnotationType: "OTHER",
+ AnnotationComment: "Package level annotation",
+ },
},
},
- PackageCopyrightText: "Copyright Saxonica Ltd",
- PackageDescription: "The Saxon package is a collection of tools for processing XML documents.",
- PackageDownloadLocation: "https://sourceforge.net/projects/saxon/files/Saxon-B/8.8.0.7/saxonb8-8-0-7j.zip/download",
- FilesAnalyzed: false,
- IsFilesAnalyzedTagPresent: true,
- PackageHomePage: "http://saxon.sourceforge.net/",
- PackageLicenseComments: "Other versions available for a commercial license",
- PackageLicenseConcluded: "MPL-1.0",
- PackageLicenseDeclared: "MPL-1.0",
- PackageName: "Saxon",
- PackageFileName: "saxonB-8.8.zip",
- PackageVersion: "8.8",
- },
- {
- PrimaryPackagePurpose: "CONTAINER",
- PackageSPDXIdentifier: "CentOS-7",
- PackageCopyrightText: "NOASSERTION",
- PackageDescription: "The CentOS container used to run the application.",
- PackageDownloadLocation: "NOASSERTION",
- FilesAnalyzed: true,
- PackageHomePage: "https://www.centos.org/",
- PackageName: "centos",
- PackageFileName: "saxonB-8.8.zip",
- PackageVersion: "centos7.9.2009",
- BuiltDate: "2021-09-15T02:38:00Z",
- ValidUntilDate: "2022-10-15T02:38:00Z",
- ReleaseDate: "2021-10-15T02:38:00Z",
- },
- },
- Files: []*spdx.File{
- {
- FileName: "./src/org/spdx/parser/DOAPProject.java",
- FileSPDXIdentifier: "DoapSource",
- FileTypes: []string{
- "SOURCE",
+ {
+ PackageSPDXIdentifier: "fromDoap-1",
+ PackageCopyrightText: "NOASSERTION",
+ PackageDownloadLocation: "NOASSERTION",
+ FilesAnalyzed: false,
+ IsFilesAnalyzedTagPresent: true,
+ PackageHomePage: "http://commons.apache.org/proper/commons-lang/",
+ PackageLicenseConcluded: "NOASSERTION",
+ PackageLicenseDeclared: "NOASSERTION",
+ PackageName: "Apache Commons Lang",
},
- Checksums: []common.Checksum{
- {
- Algorithm: "SHA1",
- Value: "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12",
+ {
+ PackageName: "Jena",
+ PackageSPDXIdentifier: "fromDoap-0",
+ PackageCopyrightText: "NOASSERTION",
+ PackageDownloadLocation: "https://search.maven.org/remotecontent?filepath=org/apache/jena/apache-jena/3.12.0/apache-jena-3.12.0.tar.gz",
+ PackageExternalReferences: []*spdx.PackageExternalReference{
+ {
+ Category: "PACKAGE-MANAGER",
+ RefType: "purl",
+ Locator: "pkg:maven/org.apache.jena/apache-jena@3.12.0",
+ },
},
+ FilesAnalyzed: true,
+ IsFilesAnalyzedTagPresent: false,
+ PackageHomePage: "http://www.openjena.org/",
+ PackageLicenseConcluded: "NOASSERTION",
+ PackageLicenseDeclared: "NOASSERTION",
+ PackageVersion: "3.12.0",
},
- LicenseConcluded: "Apache-2.0",
- LicenseInfoInFiles: []string{
- "Apache-2.0",
+ {
+ PackageSPDXIdentifier: "Saxon",
+ PackageChecksums: []common.Checksum{
+ {
+ Algorithm: "SHA1",
+ Value: "85ed0817af83a24ad8da68c2b5094de69833983c",
+ },
+ },
+ PackageCopyrightText: "Copyright Saxonica Ltd",
+ PackageDescription: "The Saxon package is a collection of tools for processing XML documents.",
+ PackageDownloadLocation: "https://sourceforge.net/projects/saxon/files/Saxon-B/8.8.0.7/saxonb8-8-0-7j.zip/download",
+ FilesAnalyzed: false,
+ IsFilesAnalyzedTagPresent: true,
+ PackageHomePage: "http://saxon.sourceforge.net/",
+ PackageLicenseComments: "Other versions available for a commercial license",
+ PackageLicenseConcluded: "MPL-1.0",
+ PackageLicenseDeclared: "MPL-1.0",
+ PackageName: "Saxon",
+ PackageFileName: "saxonB-8.8.zip",
+ PackageVersion: "8.8",
},
- FileCopyrightText: "Copyright 2010, 2011 Source Auditor Inc.",
- FileContributors: []string{
- "Protecode Inc.",
- "SPDX Technical Team Members",
- "Open Logic Inc.",
- "Source Auditor Inc.",
- "Black Duck Software In.c",
+ {
+ PrimaryPackagePurpose: "CONTAINER",
+ PackageSPDXIdentifier: "CentOS-7",
+ PackageCopyrightText: "NOASSERTION",
+ PackageDescription: "The CentOS container used to run the application.",
+ PackageDownloadLocation: "NOASSERTION",
+ FilesAnalyzed: true,
+ PackageHomePage: "https://www.centos.org/",
+ PackageName: "centos",
+ PackageFileName: "saxonB-8.8.zip",
+ PackageVersion: "centos7.9.2009",
+ BuiltDate: "2021-09-15T02:38:00Z",
+ ValidUntilDate: "2022-10-15T02:38:00Z",
+ ReleaseDate: "2021-10-15T02:38:00Z",
},
},
- {
- FileSPDXIdentifier: "CommonsLangSrc",
- Checksums: []common.Checksum{
- {
- Algorithm: "SHA1",
- Value: "c2b4e1c67a2d28fced849ee1bb76e7391b93f125",
+ Files: []*spdx.File{
+ {
+ FileName: "./src/org/spdx/parser/DOAPProject.java",
+ FileSPDXIdentifier: "DoapSource",
+ FileTypes: []string{
+ "SOURCE",
},
- },
- FileComment: "This file is used by Jena",
- FileCopyrightText: "Copyright 2001-2011 The Apache Software Foundation",
- FileContributors: []string{"Apache Software Foundation"},
- FileName: "./lib-source/commons-lang3-3.1-sources.jar",
- FileTypes: []string{"ARCHIVE"},
- LicenseConcluded: "Apache-2.0",
- LicenseInfoInFiles: []string{"Apache-2.0"},
- FileNotice: "Apache Commons Lang\nCopyright 2001-2011 The Apache Software Foundation\n\nThis product includes software developed by\nThe Apache Software Foundation (http://www.apache.org/).\n\nThis product includes software from the Spring Framework,\nunder the Apache License 2.0 (see: StringUtils.containsWhitespace())",
- },
- {
- FileSPDXIdentifier: "JenaLib",
- Checksums: []common.Checksum{
- {
- Algorithm: "SHA1",
- Value: "3ab4e1c67a2d28fced849ee1bb76e7391b93f125",
+ Checksums: []common.Checksum{
+ {
+ Algorithm: "SHA1",
+ Value: "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12",
+ },
+ },
+ LicenseConcluded: "Apache-2.0",
+ LicenseInfoInFiles: []string{
+ "Apache-2.0",
+ },
+ FileCopyrightText: "Copyright 2010, 2011 Source Auditor Inc.",
+ FileContributors: []string{
+ "Protecode Inc.",
+ "SPDX Technical Team Members",
+ "Open Logic Inc.",
+ "Source Auditor Inc.",
+ "Black Duck Software In.c",
},
},
- FileComment: "This file belongs to Jena",
- FileCopyrightText: "(c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP",
- FileContributors: []string{"Apache Software Foundation", "Hewlett Packard Inc."},
- FileName: "./lib-source/jena-2.6.3-sources.jar",
- FileTypes: []string{"ARCHIVE"},
- LicenseComments: "This license is used by Jena",
- LicenseConcluded: "LicenseRef-1",
- LicenseInfoInFiles: []string{"LicenseRef-1"},
- },
- {
- FileSPDXIdentifier: "File",
- Annotations: []spdx.Annotation{
- {
- Annotator: common.Annotator{
- Annotator: "File Commenter",
- AnnotatorType: "Person",
+ {
+ FileSPDXIdentifier: "CommonsLangSrc",
+ Checksums: []common.Checksum{
+ {
+ Algorithm: "SHA1",
+ Value: "c2b4e1c67a2d28fced849ee1bb76e7391b93f125",
},
- AnnotationDate: "2011-01-29T18:30:22Z",
- AnnotationType: "OTHER",
- AnnotationComment: "File level annotation",
},
+ FileComment: "This file is used by Jena",
+ FileCopyrightText: "Copyright 2001-2011 The Apache Software Foundation",
+ FileContributors: []string{"Apache Software Foundation"},
+ FileName: "./lib-source/commons-lang3-3.1-sources.jar",
+ FileTypes: []string{"ARCHIVE"},
+ LicenseConcluded: "Apache-2.0",
+ LicenseInfoInFiles: []string{"Apache-2.0"},
+ FileNotice: "Apache Commons Lang\nCopyright 2001-2011 The Apache Software Foundation\n\nThis product includes software developed by\nThe Apache Software Foundation (http://www.apache.org/).\n\nThis product includes software from the Spring Framework,\nunder the Apache License 2.0 (see: StringUtils.containsWhitespace())",
},
- Checksums: []common.Checksum{
- {
- Algorithm: "SHA1",
- Value: "d6a770ba38583ed4bb4525bd96e50461655d2758",
- },
- {
- Algorithm: "MD5",
- Value: "624c1abb3664f4b35547e7c73864ad24",
+ {
+ FileSPDXIdentifier: "JenaLib",
+ Checksums: []common.Checksum{
+ {
+ Algorithm: "SHA1",
+ Value: "3ab4e1c67a2d28fced849ee1bb76e7391b93f125",
+ },
},
+ FileComment: "This file belongs to Jena",
+ FileCopyrightText: "(c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP",
+ FileContributors: []string{"Apache Software Foundation", "Hewlett Packard Inc."},
+ FileName: "./lib-source/jena-2.6.3-sources.jar",
+ FileTypes: []string{"ARCHIVE"},
+ LicenseComments: "This license is used by Jena",
+ LicenseConcluded: "LicenseRef-1",
+ LicenseInfoInFiles: []string{"LicenseRef-1"},
},
- FileComment: "The concluded license was taken from the package level that the file was included in.\nThis information was found in the COPYING.txt file in the xyz directory.",
- FileCopyrightText: "Copyright 2008-2010 John Smith",
- FileContributors: []string{"The Regents of the University of California", "Modified by Paul Mundt lethal@linux-sh.org", "IBM Corporation"},
- FileName: "./package/foo.c",
- FileTypes: []string{"SOURCE"},
- LicenseComments: "The concluded license was taken from the package level that the file was included in.",
- LicenseConcluded: "(LGPL-2.0-only OR LicenseRef-2)",
- LicenseInfoInFiles: []string{"GPL-2.0-only", "LicenseRef-2"},
- FileNotice: "Copyright (c) 2001 Aaron Lehmann aaroni@vitelus.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the �Software�), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: \nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED �AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
- },
- },
- Snippets: []spdx.Snippet{
- {
- SnippetSPDXIdentifier: "Snippet",
- SnippetFromFileSPDXIdentifier: "DoapSource",
- Ranges: []common.SnippetRange{
- {
- StartPointer: common.SnippetRangePointer{
- Offset: 310,
- FileSPDXIdentifier: "DoapSource",
- },
- EndPointer: common.SnippetRangePointer{
- Offset: 420,
- FileSPDXIdentifier: "DoapSource",
+ {
+ FileSPDXIdentifier: "File",
+ Annotations: []spdx.Annotation{
+ {
+ Annotator: common.Annotator{
+ Annotator: "File Commenter",
+ AnnotatorType: "Person",
+ },
+ AnnotationDate: "2011-01-29T18:30:22Z",
+ AnnotationType: "OTHER",
+ AnnotationComment: "File level annotation",
},
},
- {
- StartPointer: common.SnippetRangePointer{
- LineNumber: 5,
- FileSPDXIdentifier: "DoapSource",
+ Checksums: []common.Checksum{
+ {
+ Algorithm: "SHA1",
+ Value: "d6a770ba38583ed4bb4525bd96e50461655d2758",
},
- EndPointer: common.SnippetRangePointer{
- LineNumber: 23,
- FileSPDXIdentifier: "DoapSource",
+ {
+ Algorithm: "MD5",
+ Value: "624c1abb3664f4b35547e7c73864ad24",
},
},
+ FileComment: "The concluded license was taken from the package level that the file was included in.\nThis information was found in the COPYING.txt file in the xyz directory.",
+ FileCopyrightText: "Copyright 2008-2010 John Smith",
+ FileContributors: []string{"The Regents of the University of California", "Modified by Paul Mundt lethal@linux-sh.org", "IBM Corporation"},
+ FileName: "./package/foo.c",
+ FileTypes: []string{"SOURCE"},
+ LicenseComments: "The concluded license was taken from the package level that the file was included in.",
+ LicenseConcluded: "(LGPL-2.0-only OR LicenseRef-2)",
+ LicenseInfoInFiles: []string{"GPL-2.0-only", "LicenseRef-2"},
+ FileNotice: "Copyright (c) 2001 Aaron Lehmann aaroni@vitelus.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the �Software�), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: \nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED �AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
},
- SnippetLicenseConcluded: "GPL-2.0-only",
- LicenseInfoInSnippet: []string{"GPL-2.0-only"},
- SnippetLicenseComments: "The concluded license was taken from package xyz, from which the snippet was copied into the current file. The concluded license information was found in the COPYING.txt file in package xyz.",
- SnippetCopyrightText: "Copyright 2008-2010 John Smith",
- SnippetComment: "This snippet was identified as significant and highlighted in this Apache-2.0 file, when a commercial scanner identified it as being derived from file foo.c in package xyz which is licensed under GPL-2.0.",
- SnippetName: "from linux kernel",
- // omitted: SnippetAttributionTexts: []string{"Snippet attribution"},
- },
- },
- Relationships: []*spdx.Relationship{
- {
- RefA: common.MakeDocElementID("", "DOCUMENT"),
- RefB: common.MakeDocElementID("", "Package"),
- Relationship: "CONTAINS",
- RelationshipComment: "A relationship comment",
- },
- {
- RefA: common.MakeDocElementID("", "DOCUMENT"),
- RefB: common.MakeDocElementID("spdx-tool-1.2", "ToolsElement"),
- Relationship: "COPY_OF",
- },
- {
- RefA: common.MakeDocElementID("", "DOCUMENT"),
- RefB: common.MakeDocElementID("", "File"),
- Relationship: "DESCRIBES",
- },
- {
- RefA: common.MakeDocElementID("", "DOCUMENT"),
- RefB: common.MakeDocElementID("", "Package"),
- Relationship: "DESCRIBES",
},
- {
- RefA: common.MakeDocElementID("", "Package"),
- RefB: common.MakeDocElementID("", "JenaLib"),
- Relationship: "CONTAINS",
- },
- {
- RefA: common.MakeDocElementID("", "Package"),
- RefB: common.MakeDocElementID("", "Saxon"),
- Relationship: "DYNAMIC_LINK",
- },
- {
- RefA: common.MakeDocElementID("", "CommonsLangSrc"),
- RefB: common.MakeDocElementSpecial("NOASSERTION"),
- Relationship: "GENERATED_FROM",
- },
- {
- RefA: common.MakeDocElementID("", "JenaLib"),
- RefB: common.MakeDocElementID("", "Package"),
- Relationship: "CONTAINS",
+ Snippets: []spdx.Snippet{
+ {
+ SnippetSPDXIdentifier: "Snippet",
+ SnippetFromFileSPDXIdentifier: "DoapSource",
+ Ranges: []common.SnippetRange{
+ {
+ StartPointer: common.SnippetRangePointer{
+ Offset: 310,
+ FileSPDXIdentifier: "DoapSource",
+ },
+ EndPointer: common.SnippetRangePointer{
+ Offset: 420,
+ FileSPDXIdentifier: "DoapSource",
+ },
+ },
+ {
+ StartPointer: common.SnippetRangePointer{
+ LineNumber: 5,
+ FileSPDXIdentifier: "DoapSource",
+ },
+ EndPointer: common.SnippetRangePointer{
+ LineNumber: 23,
+ FileSPDXIdentifier: "DoapSource",
+ },
+ },
+ },
+ SnippetLicenseConcluded: "GPL-2.0-only",
+ LicenseInfoInSnippet: []string{"GPL-2.0-only"},
+ SnippetLicenseComments: "The concluded license was taken from package xyz, from which the snippet was copied into the current file. The concluded license information was found in the COPYING.txt file in package xyz.",
+ SnippetCopyrightText: "Copyright 2008-2010 John Smith",
+ SnippetComment: "This snippet was identified as significant and highlighted in this Apache-2.0 file, when a commercial scanner identified it as being derived from file foo.c in package xyz which is licensed under GPL-2.0.",
+ SnippetName: "from linux kernel",
+ // omitted: SnippetAttributionTexts: []string{"Snippet attribution"},
+ },
},
- {
- RefA: common.MakeDocElementID("", "File"),
- RefB: common.MakeDocElementID("", "fromDoap-0"),
- Relationship: "GENERATED_FROM",
+ Relationships: []*spdx.Relationship{
+ {
+ RefA: common.MakeDocElementID("", "DOCUMENT"),
+ RefB: common.MakeDocElementID("", "Package"),
+ Relationship: "CONTAINS",
+ RelationshipComment: "A relationship comment",
+ },
+ {
+ RefA: common.MakeDocElementID("", "DOCUMENT"),
+ RefB: common.MakeDocElementID("spdx-tool-1.2", "ToolsElement"),
+ Relationship: "COPY_OF",
+ },
+ {
+ RefA: common.MakeDocElementID("", "DOCUMENT"),
+ RefB: common.MakeDocElementID("", "File"),
+ Relationship: "DESCRIBES",
+ },
+ {
+ RefA: common.MakeDocElementID("", "DOCUMENT"),
+ RefB: common.MakeDocElementID("", "Package"),
+ Relationship: "DESCRIBES",
+ },
+ {
+ RefA: common.MakeDocElementID("", "Package"),
+ RefB: common.MakeDocElementID("", "JenaLib"),
+ Relationship: "CONTAINS",
+ },
+ {
+ RefA: common.MakeDocElementID("", "Package"),
+ RefB: common.MakeDocElementID("", "Saxon"),
+ Relationship: "DYNAMIC_LINK",
+ },
+ {
+ RefA: common.MakeDocElementID("", "CommonsLangSrc"),
+ RefB: common.MakeDocElementSpecial("NOASSERTION"),
+ Relationship: "GENERATED_FROM",
+ },
+ {
+ RefA: common.MakeDocElementID("", "JenaLib"),
+ RefB: common.MakeDocElementID("", "Package"),
+ Relationship: "CONTAINS",
+ },
+ {
+ RefA: common.MakeDocElementID("", "File"),
+ RefB: common.MakeDocElementID("", "fromDoap-0"),
+ Relationship: "GENERATED_FROM",
+ },
},
- },
- // omitted: Reviews: []*spdx.Review{
- // {
- // Reviewer: "joe@example.com",
- // ReviewerType: "Person",
- // ReviewDate: "2021-11-03T05:43:21Z",
- // ReviewComment: "This is a review comment",
- // },
- //},
+ // omitted: Reviews: []*spdx.Review{
+ // {
+ // Reviewer: "joe@example.com",
+ // ReviewerType: "Person",
+ // ReviewDate: "2021-11-03T05:43:21Z",
+ // ReviewComment: "This is a review comment",
+ // },
+ //},
+ }
}
diff --git a/spdx/v2/v2_3/rdf/reader/parse_license_test.go b/spdx/v2/v2_3/rdf/reader/parse_license_test.go
index cd852b6c..78015504 100644
--- a/spdx/v2/v2_3/rdf/reader/parse_license_test.go
+++ b/spdx/v2/v2_3/rdf/reader/parse_license_test.go
@@ -193,7 +193,6 @@ func Test_rdfParser2_3_getAnyLicenseFromNode(t *testing.T) {
`)
node := parser.gordfParserObj.Triples[0].Subject
_, err = parser.getAnyLicenseFromNode(node)
- t.Log(err)
if err == nil {
t.Errorf("should've raised an error for invalid input")
}
diff --git a/spdx/v2/v2_3/rdf/reader/parser_test.go b/spdx/v2/v2_3/rdf/reader/parser_test.go
index 439eb993..6012b2a6 100644
--- a/spdx/v2/v2_3/rdf/reader/parser_test.go
+++ b/spdx/v2/v2_3/rdf/reader/parser_test.go
@@ -127,7 +127,6 @@ func Test_rdfParser2_3_getSpdxDocNode(t *testing.T) {
`)
_, err = parser.getSpdxDocNode()
- t.Log(err)
if err == nil {
t.Errorf("expected and error due to more than one type triples for the SpdxDocument Node, got %v", err)
}
@@ -139,7 +138,6 @@ func Test_rdfParser2_3_getSpdxDocNode(t *testing.T) {
`)
_, err = parser.getSpdxDocNode()
- t.Log(err)
if err == nil {
t.Errorf("rootNode must be associated with exactly one triple of predicate rdf:type, got %v", err)
}
diff --git a/spdx/v3/internal/generate/main.go b/spdx/v3/internal/generate/main.go
new file mode 100644
index 00000000..5cc01dac
--- /dev/null
+++ b/spdx/v3/internal/generate/main.go
@@ -0,0 +1,94 @@
+package main
+
+import (
+ "fmt"
+ "os"
+ "path/filepath"
+ "regexp"
+ "strings"
+
+ "github.com/spdx/tools-golang/spdx/v3/internal/ld/shaclgen"
+)
+
+func main() {
+ versions := []string{
+ "3.0.1",
+ }
+
+ for _, version := range versions {
+ packageName := "v" + strings.ReplaceAll(version, ".", "_")
+ packageName = strings.Join(strings.Split(packageName, "_")[:2], "_") // only generate the latest patch for each minor version
+ fileName, err := filepath.Abs(fmt.Sprintf("spdx/v3/%s/model.go", packageName))
+ if err != nil {
+ panic(err)
+ }
+ err = os.MkdirAll(fmt.Sprintf("spdx/v3/%s", packageName), 0o755)
+ if err != nil {
+ panic(err)
+ }
+
+ fmt.Printf("Generating SPDX %s to %s\n", version, fileName)
+
+ shaclgen.Generate(
+ shaclgen.EnableLog(),
+ shaclgen.UseFlatStruct(true),
+ shaclgen.PackageName(packageName),
+ shaclgen.LicenseID("MIT"),
+ shaclgen.OutputFile(fileName),
+ shaclgen.RenameFunc(renameFunc),
+ shaclgen.JsonLDContext(fmt.Sprintf("https://spdx.org/rdf/%s/spdx-context.jsonld", version)),
+ shaclgen.SHACLTypes(fmt.Sprintf("https://spdx.org/rdf/%s/spdx-model.ttl", version)),
+ )
+
+ contents, err := os.ReadFile(fileName)
+ if err != nil {
+ panic(err)
+ }
+ // hack to work around go-ld not compacting certain types
+ regexp.MustCompile(`(?m)": map[string]any{.*?},\n`).ReplaceAll(contents, []byte(`": map[string]any{
+ },`))
+ }
+}
+
+func renameFunc(typ shaclgen.NameType, name string, c *shaclgen.Class) string {
+ if typ == shaclgen.NameTypeField {
+ // get rid of property stutters
+ if c != nil && c.GoName != name && !strings.EqualFold(name, "PackageURL") {
+ shortName := strings.TrimPrefix(name, c.GoName)
+ if !strings.EqualFold(shortName, "id") {
+ name = shortName
+ }
+ }
+
+ return replaceSuffixes(name, map[string]string{
+ "Bies": "By",
+ "Tos": "To",
+ "Usings": "Using",
+ "Id": "ID",
+ "Url": "URL",
+ })
+ }
+ switch name {
+ case "AnyLicenseInfo":
+ return "LicenseInfo"
+ case "Bom":
+ return "BOM"
+ case "BOMS":
+ return "BOMs"
+ case "Sbom":
+ return "SBOM"
+ case "SBOMS":
+ return "SBOMs"
+ }
+ return ""
+}
+
+func replaceSuffixes(value string, suffixToReplacement map[string]string) string {
+ for suffix, replacement := range suffixToReplacement {
+ if strings.HasSuffix(value, suffix) {
+ value = strings.TrimSuffix(value, suffix)
+ return value + replacement
+ }
+ }
+ return value
+}
diff --git a/spdx/v3/internal/ld/README.md b/spdx/v3/internal/ld/README.md
new file mode 100644
index 00000000..4c87d3ab
--- /dev/null
+++ b/spdx/v3/internal/ld/README.md
@@ -0,0 +1,6 @@
+# JSON-LD utilities
+
+This package contains JSON-LD utilities shared across the SPDX 3 data models, including a JSON-LD reader & graph writer
+using the official JSON-LD go language implementation: `github.com/piprate/go-ld`, which is able to map to and from
+go object models. Subpackage `shaclgen` contains a generator for go source code from SHACL, which has only implemented
+the functionality to support SPDX 3.
diff --git a/spdx/v3/internal/ld/decode_test.go b/spdx/v3/internal/ld/decode_test.go
new file mode 100644
index 00000000..769f5e41
--- /dev/null
+++ b/spdx/v3/internal/ld/decode_test.go
@@ -0,0 +1,53 @@
+package ld_test
+
+import (
+ "testing"
+
+ "github.com/google/go-cmp/cmp"
+)
+
+func Test_decode(t *testing.T) {
+ tests := []struct {
+ name string
+ graph l
+ want func() a
+ }{
+ {
+ name: "simple graph",
+ graph: l{
+ o{"@type": "software_Package", "@id": "pkg-1", "name": "pkg 1"},
+ o{"@type": "software_File", "@id": "file-1", "contents": "file 1"},
+ o{"@type": "Relationship", "from": "file-1", "to": l{"pkg-1"}},
+ },
+ want: func() a {
+ p := &Package{Element: Element{ID: "pkg-1", Name: "pkg 1"}}
+ f := &File{Element: Element{ID: "file-1"}, Contents: "file 1"}
+ r := &Relationship{From: f, To: l{p}}
+ return l{p, f, r}
+ },
+ },
+ {
+ name: "top level named individual",
+ graph: l{
+ o{
+ "@id": "https://example.org/iri/file/dev/null",
+ },
+ },
+ want: func() a {
+ return l{File_DevNull}
+ },
+ },
+ }
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ graph := testGraph(t, tt.graph)
+
+ want := tt.want()
+
+ if diff := cmp.Diff(want, graph); diff != "" {
+ t.Fatalf("(-want +got):\n%s", diff)
+ }
+ })
+ }
+}
diff --git a/spdx/v3/internal/ld/document_loader.go b/spdx/v3/internal/ld/document_loader.go
new file mode 100644
index 00000000..620e508e
--- /dev/null
+++ b/spdx/v3/internal/ld/document_loader.go
@@ -0,0 +1,23 @@
+package ld
+
+import (
+ "fmt"
+
+ "github.com/piprate/json-gold/ld"
+)
+
+type offlineDocumentLoader struct {
+ ctx *context
+}
+
+func (d offlineDocumentLoader) LoadDocument(u string) (*ld.RemoteDocument, error) {
+ sc := d.ctx.contextMap[u]
+ if sc != nil {
+ return &ld.RemoteDocument{
+ DocumentURL: u,
+ ContextURL: u,
+ Document: sc.ldContext,
+ }, nil
+ }
+ return nil, fmt.Errorf("context is not known: %v", u)
+}
diff --git a/spdx/v3/internal/ld/graph_builder.go b/spdx/v3/internal/ld/graph_builder.go
new file mode 100644
index 00000000..07217580
--- /dev/null
+++ b/spdx/v3/internal/ld/graph_builder.go
@@ -0,0 +1,360 @@
+package ld
+
+import (
+ "errors"
+ "fmt"
+ "reflect"
+ "strconv"
+
+ "github.com/piprate/json-gold/ld"
+)
+
+type graphBuilder struct {
+ ctx *context
+ input reflect.Value
+ graph []any // graph stores all the serialized objects in the graph
+ nextID map[reflect.Type]int
+ ids map[uintptr]string
+ pointerRefs map[reflect.Value]map[string]any // pointerRefs stores references to each serialized pointer
+}
+
+func (b *graphBuilder) toCompactMaps(graph ...any) (map[string]any, error) {
+ expanded, errs := b.toExpandedMaps(graph...)
+ if errs != nil {
+ return nil, errors.Join(errs...)
+ }
+
+ proc := ld.NewJsonLdProcessor()
+ opts := ld.NewJsonLdOptions("")
+ // all options:
+ //opts.Base
+ opts.CompactArrays = true
+ //opts.ExpandContext = false
+ opts.ProcessingMode = ld.JsonLd_1_1
+ opts.DocumentLoader = offlineDocumentLoader{ctx: b.ctx}
+ //opts.Embed
+ //opts.Explicit
+ //opts.RequireAll
+ //opts.FrameDefault = false
+ //opts.OmitDefault
+ //opts.OmitGraph
+ //opts.UseRdfType
+ //opts.UseNativeTypes = true
+ //opts.ProduceGeneralizedRdf
+ //opts.InputFormat
+ //opts.Format
+ //opts.Algorithm
+ //opts.UseNamespaces
+ //opts.OutputForm
+ //opts.SafeMode
+
+ var compactionContext map[string]any
+ switch len(b.ctx.contextMap) {
+ case 0:
+ return nil, fmt.Errorf("no contexts defined, unable to serialize")
+ case 1:
+ compactionContext = map[string]interface{}{
+ "@context": firstKey(b.ctx.contextMap),
+ }
+ default:
+ prefixes := map[string]any{}
+ for i, url := range sortedKeys(b.ctx.contextMap) {
+ prefixes["ns"+strconv.Itoa(i)] = url
+ }
+ compactionContext = map[string]interface{}{
+ "@context": prefixes,
+ }
+ }
+
+ compact, err := proc.Compact(expanded, compactionContext, opts)
+ return compact, err
+}
+
+func (b *graphBuilder) toExpandedMaps(graph ...any) ([]any, []error) {
+ b.input = reflect.ValueOf(graph)
+ b.graph = nil
+ for _, v := range graph {
+ val := reflect.ValueOf(v)
+ _, err := b.serialize(val)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return b.graph, nil
+}
+
+// serialize outputs the top-level nodes in the graph; these have the behavior that they are always returned in
+// serialized form rather than potentially returning an ID reference. pointers with multiple references will also
+// ensure the @id field is set in order to be referenced later
+func (b *graphBuilder) serialize(v reflect.Value) (any, []error) {
+ if !v.IsValid() {
+ return nil, nil
+ }
+ ptrV := v
+ if v.Kind() == reflect.Pointer {
+ if v.IsNil() {
+ return nil, nil
+ }
+ if debug {
+ ptr := fmt.Sprintf("%v", v.Pointer())
+ fmt.Printf("got pointer: %v\n", ptr)
+ }
+ id := b.ids[v.Pointer()]
+ if id != "" {
+ return id, nil
+ }
+ v = v.Elem()
+ }
+
+ val, ok := b.serializePrimitiveValue(v)
+ if ok {
+ return val, nil
+ }
+
+ switch v.Kind() {
+ case reflect.Interface:
+ return b.serialize(v.Elem())
+ case reflect.Slice:
+ return b.serializeSlice(v)
+ case reflect.Struct:
+ return b.serializeStruct(ptrV, v)
+ default:
+ panic(fmt.Errorf("unsupported type: %v", v))
+ }
+}
+
+func (b *graphBuilder) serializeSlice(slice reflect.Value) ([]any, []error) {
+ if slice.Kind() != reflect.Slice {
+ panic("expected slice")
+ }
+ var out []any
+ for i := 0; i < slice.Len(); i++ {
+ value, err := b.serialize(slice.Index(i))
+ if err != nil {
+ return nil, err
+ }
+ out = append(out, value)
+ }
+ return out, nil
+}
+
+func (b *graphBuilder) serializeStruct(ptrV, v reflect.Value) (value any, err []error) {
+ t := v.Type()
+ if t.Kind() != reflect.Struct {
+ panic("expected struct, got: " + stringify(v))
+ }
+
+ out := map[string]any{}
+
+ tc := b.ctx.typeToContext[t]
+ if tc != nil {
+ err = b.serializeProps(tc.ctx, tc, ptrV, v, out)
+ if err != nil {
+ return out, err
+ }
+
+ // always append the type unless the only value we have is an external IRI reference
+ if len(out) > 0 {
+ out[JsonTypeProp] = []any{
+ tc.iri,
+ }
+ }
+ }
+
+ id := out[JsonIdProp]
+ if id != "" {
+ b.graph = append(b.graph, out)
+ return id, nil
+ }
+
+ // skip objects with no properties whatsoever
+ if len(out) == 0 {
+ return nil, nil
+ }
+ return out, nil
+}
+
+func (b *graphBuilder) serializeProps(context *serializationContext, tc *typeContext, ptrV, v reflect.Value, out map[string]any) []error {
+ t := v.Type()
+ for i := 0; i < t.NumField(); i++ {
+ f := t.Field(i)
+ if skipField(f) { // ID is set outside of this function
+ continue
+ }
+
+ prop := f.Tag.Get(GoIriTagName)
+ fieldV := v.Field(i)
+
+ if prop == JsonIdProp {
+ if tc.blankNodeAllowed {
+ if RefCount(ptrV, b.input) == 1 {
+ continue // don't create an ID, output inline
+ }
+ }
+ id := ""
+ if isUnset(fieldV) {
+ id = b.getID(ptrV)
+ if debug {
+ val := ptrV.Interface()
+ fmt.Printf("%#v\n", val)
+ }
+ } else {
+ id = fieldV.String()
+ //if !strings.HasPrefix(id, "_:") {
+ // id = "_:" + id
+ //}
+ }
+ if debug {
+ ptr := fmt.Sprintf("%v", ptrV.Pointer())
+ fmt.Printf("setting id for pointer: %v\n", ptr)
+ }
+ if ptrV.Kind() == reflect.Pointer {
+ b.ids[ptrV.Pointer()] = id
+ }
+ out[JsonIdProp] = id
+ continue
+ }
+
+ // embedded struct, recursively call this function to get all struct values
+ if f.Anonymous && f.Type.Kind() == reflect.Struct {
+ err := b.serializeProps(context, tc, ptrV, v.Field(i), out)
+ if err != nil {
+ return err
+ }
+ continue
+ }
+
+ optional := !isRequired(f)
+
+ if optional && isEmpty(fieldV) {
+ continue
+ }
+
+ if debug {
+ val := fieldV.Interface()
+ str := fmt.Sprintf("serializing prop %v: %#v", f, val)
+ fmt.Println(str)
+ }
+ val, err := b.serialize(fieldV)
+ if err != nil {
+ return err
+ }
+
+ if val == nil && optional {
+ continue
+ }
+
+ out[prop] = val
+ }
+
+ return nil
+}
+
+func (b *graphBuilder) serializePrimitiveValue(v reflect.Value) (map[string]any, bool) {
+ if !v.IsValid() || !v.CanInterface() {
+ return nil, false
+ }
+
+ value := v.Interface()
+ c := typeToConverter[v.Type()]
+ if c != nil {
+ if c.Serialize != nil {
+ value = c.Serialize(value)
+ }
+ return map[string]any{
+ JsonTypeProp: c.IRI,
+ JsonValueProp: value,
+ }, true
+ }
+
+ return nil, false
+}
+
+// getID will return an ID for the given struct pointer, creating one if needed
+// it does not append structs to the graph
+func (b *graphBuilder) getID(ptrV reflect.Value) string {
+ if ptrV.Type().Kind() != reflect.Pointer {
+ panic("expected pointer, got: " + stringify(ptrV))
+ }
+ id, _ := b.ids[ptrV.Pointer()]
+ if id != "" {
+ return id
+ }
+
+ v := ptrV.Elem()
+ t := v.Type()
+
+ // check if the struct has an ID set directly, and use that if so
+ id, _ = getID(v)
+ if id != "" {
+ return id
+ }
+
+ nextID := b.nextID[t] + 1
+ b.nextID[t] = nextID
+ return fmt.Sprintf("_:%s-%v", t.Name(), nextID)
+}
+
+func (b *graphBuilder) findContext(t reflect.Type) *serializationContext {
+ t = baseType(t) // map[string]any may be a pointer, but we want the base types
+ tc := b.ctx.typeToContext[t]
+ if tc != nil {
+ return tc.ctx
+ }
+ return nil
+}
+
+func stringify(o any) string {
+ switch o := o.(type) {
+ case reflect.Value:
+ if !o.IsValid() {
+ return ""
+ }
+ if o.CanInterface() {
+ return typeName(o.Type()) + ": " + stringify(o.Interface())
+ }
+ case reflect.Type:
+ return fmt.Sprintf("%s.%s", o.PkgPath(), o.Name())
+ }
+ return fmt.Sprintf("%#v", o)
+}
+
+func isEmpty(v reflect.Value) bool {
+ return !v.IsValid() || v.IsZero()
+}
+
+func isRequired(f reflect.StructField) bool {
+ return f.Tag.Get("required") == "true"
+}
+
+func getValue(v reflect.Value) any {
+ switch v.Kind() {
+ case reflect.String:
+ return v.String()
+ case reflect.Bool:
+ return v.Bool()
+ case reflect.Float32, reflect.Float64:
+ return v.Float()
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ return v.Int()
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
+ return v.Uint()
+ default:
+ if !v.CanInterface() {
+ return nil
+ }
+ return v.Interface()
+ }
+}
+
+func isUnset(fv reflect.Value) bool {
+ if !fv.IsValid() {
+ return true
+ }
+ switch fv.Kind() {
+ case reflect.Pointer, reflect.Interface, reflect.Slice, reflect.Map:
+ return fv.IsNil()
+ default:
+ return fv.IsZero()
+ }
+}
diff --git a/spdx/v3/internal/ld/graph_builder_test.go b/spdx/v3/internal/ld/graph_builder_test.go
new file mode 100644
index 00000000..570c0212
--- /dev/null
+++ b/spdx/v3/internal/ld/graph_builder_test.go
@@ -0,0 +1,223 @@
+package ld
+
+import (
+ "testing"
+ "time"
+
+ "github.com/google/go-cmp/cmp"
+ "github.com/stretchr/testify/require"
+)
+
+func Test_graphBuilder(t *testing.T) {
+ type typ struct {
+ _ Type `iri:"http://t-iri"`
+ Id string `iri:"@id"`
+ Str string `iri:"http://str-iri"`
+ Bool bool `iri:"http://bool-iri"`
+ Int int `iri:"http://int-iri"`
+ Float float64 `iri:"http://float-iri"`
+ Time time.Time `iri:"http://time-iri"`
+ }
+
+ type typ2 struct {
+ _ Type `iri:"http://t2-iri"`
+ Identifier string `iri:"@id"`
+ T1 *typ `iri:"http://t2-to-t1-iri"`
+ }
+
+ typContext := o{
+ "t": "http://t-iri",
+ "t2": "http://t2-iri",
+ "s": o{
+ "@id": "http://str-iri",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "b": o{
+ "@id": "http://bool-iri",
+ "@type": "http://www.w3.org/2001/XMLSchema#boolean",
+ },
+ "i": o{
+ "@id": "http://int-iri",
+ "@type": "http://www.w3.org/2001/XMLSchema#integer",
+ },
+ "f": o{
+ "@id": "http://float-iri",
+ "@type": "http://www.w3.org/2001/XMLSchema#decimal",
+ },
+ "tm": o{
+ "@id": "http://time-iri",
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
+ },
+ "t2t1": "http://t2-to-t1-iri",
+ }
+
+ contextWithIdTypeOverride := merge(typContext, o{
+ "aliased-type": "@type",
+ "aliased-id": "@id",
+ })
+
+ contextURI := "http://example.org/uri"
+
+ tests := []struct {
+ name string
+ context o
+ graph func() any
+ expected any
+ wantErr require.ErrorAssertionFunc
+ }{
+ {
+ name: "basic no context full iri",
+ context: o{},
+ graph: func() any {
+ return &typ{
+ Str: "str-val",
+ Bool: true,
+ Int: 101,
+ Float: 940.33,
+ Time: mar25noon,
+ }
+ },
+ expected: o{
+ "@context": contextURI,
+ "@type": "http://t-iri",
+ "@id": "_:typ-1",
+ "http://str-iri": expanded("str-val"),
+ "http://bool-iri": expanded(true),
+ "http://int-iri": expanded(101),
+ "http://float-iri": expanded(940.33),
+ "http://time-iri": expanded(mar25noon),
+ },
+ },
+ {
+ name: "basic all aliases context",
+ context: typContext,
+ graph: func() any {
+ return &typ{
+ Str: "str-val",
+ Bool: true,
+ Int: 101,
+ Float: 940.33,
+ Time: mar25noon,
+ }
+ },
+ expected: o{
+ "@context": contextURI,
+ "@type": "t",
+ "@id": "_:typ-1",
+ "s": "str-val",
+ "b": true,
+ "i": 101,
+ "f": 940.33,
+ "tm": mar25noon.Format(time.RFC3339),
+ },
+ },
+ {
+ name: "all aliases overridden id type",
+ context: contextWithIdTypeOverride,
+ graph: func() any {
+ return &typ{}
+ },
+ expected: o{
+ "@context": contextURI,
+ "aliased-id": "_:typ-1",
+ "aliased-type": "t",
+ },
+ },
+ {
+ name: "multiple refs gets id",
+ context: contextWithIdTypeOverride,
+ graph: func() any {
+ t1 := &typ{
+ Str: "a-val",
+ }
+ return l{
+ &typ2{
+ T1: t1,
+ },
+ &typ2{
+ T1: t1,
+ },
+ }
+ },
+ expected: o{
+ "@context": contextURI,
+ "@graph": l{
+ o{
+ "aliased-type": "t",
+ "aliased-id": "_:typ-1",
+ "s": "a-val",
+ },
+ o{
+ "aliased-type": "t2",
+ "aliased-id": "_:typ2-1",
+ "t2t1": "_:typ-1",
+ },
+ o{
+ "aliased-type": "t2",
+ "aliased-id": "_:typ2-2",
+ "t2t1": "_:typ-1",
+ },
+ },
+ },
+ },
+ }
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ ctx := NewContext()
+ ctx.Register(contextURI, o{"@context": tt.context}, typ{}, typ2{})
+ expected := tt.expected
+
+ var graphs l
+ graph := tt.graph()
+ if g, ok := graph.(l); ok {
+ graphs = g
+ } else {
+ graphs = append(graphs, graph)
+ }
+ var got any
+ got, err := ctx.(*context).toMaps(graphs...)
+
+ wantErr := require.NoError
+ if tt.wantErr != nil {
+ wantErr = tt.wantErr
+ }
+ wantErr(t, err)
+
+ d := cmp.Diff(expected, got)
+ if d != "" {
+ t.Fatal(d)
+ }
+ })
+ }
+}
+
+func expanded[T any](value T) any {
+ var v any = value
+ t := ""
+ var out any
+ switch v := v.(type) {
+ case string:
+ t = "http://www.w3.org/2001/XMLSchema#string"
+ out = v
+ case bool:
+ t = "http://www.w3.org/2001/XMLSchema#boolean"
+ out = v
+ case float32, float64:
+ t = "http://www.w3.org/2001/XMLSchema#decimal"
+ out = v
+ case byte, int, int8, int16, int32, int64:
+ t = "http://www.w3.org/2001/XMLSchema#integer"
+ out = v
+ case time.Time:
+ t = "http://www.w3.org/2001/XMLSchema#dateTimeStamp"
+ out = v.Format(time.RFC3339)
+ default:
+ panic("unsupported type")
+ }
+
+ return o{
+ JsonTypeProp: t,
+ JsonValueProp: out,
+ }
+}
diff --git a/spdx/v3/internal/ld/ld_context.go b/spdx/v3/internal/ld/ld_context.go
new file mode 100644
index 00000000..fb140e45
--- /dev/null
+++ b/spdx/v3/internal/ld/ld_context.go
@@ -0,0 +1,290 @@
+package ld
+
+import (
+ "encoding/json"
+ "fmt"
+ "io"
+ "reflect"
+ "strings"
+
+ "github.com/piprate/json-gold/ld"
+)
+
+// Type is a 0-size data holder property type for type-level ld information
+type Type struct{}
+
+// Context is the holder for all known LD contexts and required definitions
+type Context interface {
+ Register(contextURI string, contextDefinition map[string]any, typesAndInstances ...any) Context
+ Merge(ctx Context) Context
+ ToJSON(writer io.Writer, graph ...any) error
+ FromJSON(reader io.Reader) ([]any, error)
+}
+
+const (
+ JsonIdProp = "@id"
+ JsonTypeProp = "@type"
+ JsonValueProp = "@value"
+ JsonContextProp = "@context"
+ JsonGraphProp = "@graph"
+ JsonVocabProp = "@vocab"
+ GoTypeField = "_"
+ GoIdField = "ID"
+ GoIriTagName = "iri"
+ GoTypeTagName = "type"
+ GoNodeKindTagName = "node-kind"
+ GoRequiredTagName = "required"
+)
+
+type context struct {
+ contextMap map[string]*serializationContext
+ // iriToType contains full IRIs and aliases to the appropriate typeContext
+ iriToType map[string]*typeContext
+ // typeToContext contains references from the go type(s) to appropriate typeContext
+ typeToContext map[reflect.Type]*typeContext
+ // iriToInstance are directly registered instances in code
+ iriToInstance map[string]reflect.Value
+ // typeToExternalIriFunc holds registered functions to construct external placeholders IRIs
+ typeToExternalIriFunc map[reflect.Type]func(string) reflect.Value
+}
+
+func NewContext() Context {
+ return &context{
+ contextMap: map[string]*serializationContext{},
+ iriToType: map[string]*typeContext{},
+ typeToContext: map[reflect.Type]*typeContext{},
+ iriToInstance: map[string]reflect.Value{},
+ typeToExternalIriFunc: map[reflect.Type]func(string) reflect.Value{},
+ }
+}
+
+// Merge returns a new context, with the values from both contexts merged together
+func (c *context) Merge(ctx Context) Context {
+ c2 := ctx.(*context)
+ return &context{
+ contextMap: merge(c.contextMap, c2.contextMap),
+ iriToType: merge(c.iriToType, c2.iriToType),
+ typeToContext: merge(c.typeToContext, c2.typeToContext),
+ iriToInstance: merge(c.iriToInstance, c2.iriToInstance),
+ }
+}
+
+// Register registers types and aliases to be used when serializing/deserializing documents
+func (c *context) Register(contextURI string, ldContext map[string]any, types ...any) Context {
+ ctx := c.getContext(contextURI)
+ ctx.ldContext = merge(ctx.ldContext, ldContext)
+ ctx.parsedLdContext = ld.NewContext(ldContext, nil)
+ c.registerContextAliases(ctx, ldContext)
+ for _, typ := range types {
+ switch {
+ case isFunc(typ):
+ registerFunc(c, typ)
+ default:
+ registerType(c, ctx, typ)
+ }
+ }
+ return c
+}
+
+// TypeAliases returns all the registered types and IRIs with corresponding aliases
+func (c *context) TypeAliases() ([]reflect.Type, map[string]string) {
+ iriToAlias := map[string]string{}
+ for _, cm := range c.contextMap {
+ for alias, iri := range cm.aliasToIri {
+ iriToAlias[iri] = alias
+ }
+ }
+ var out []reflect.Type
+ for t := range c.typeToContext {
+ out = append(out, t)
+ }
+ return out, iriToAlias
+}
+
+// LDContexts returns all the registered JSON-LD contexts
+func (c *context) LDContexts() map[string]map[string]any {
+ out := map[string]map[string]any{}
+ for uri, cm := range c.contextMap {
+ out[uri] = cm.ldContext
+ }
+ return out
+}
+
+// registerContextAliases registers compact name aliases for the given IRIs in the given context
+func (c *context) registerContextAliases(ctx *serializationContext, ldContext map[string]any) {
+ subContext, _ := ldContext[JsonContextProp].(map[string]any)
+ if subContext != nil {
+ c.registerContextAliases(ctx, subContext)
+ return
+ }
+ for alias, v := range ldContext {
+ if alias == JsonContextProp {
+ continue
+ }
+ switch v := v.(type) {
+ case string:
+ c.registerContextAlias(ctx, v, alias)
+ case map[string]any:
+ iri, _ := v[JsonIdProp].(string)
+ if iri != "" {
+ c.registerContextAlias(ctx, iri, alias)
+ }
+ // should this be checked? if v[JsonTypeProp] == JsonVocabProp {
+ subContext, _ = v[JsonContextProp].(map[string]any)
+ if subContext != nil {
+ contextPrefix, _ := subContext[JsonVocabProp].(string)
+ ctx.aliasContext[alias] = contextPrefix
+ }
+ }
+ }
+}
+
+// registerContextAlias registers compact name aliases for the given IRIs in the given context
+func (c *context) registerContextAlias(ctx *serializationContext, iri, alias string) {
+ if ctx.aliasToIri[alias] != "" {
+ panic("duplicate alias set globally: " + alias + "; iri: " + iri + "; existing: " + ctx.aliasToIri[alias])
+ }
+ ctx.aliasToIri[alias] = iri
+}
+
+func (c *context) getContext(contextUrl string) *serializationContext {
+ ctx := c.contextMap[contextUrl]
+ if ctx == nil {
+ ctx = &serializationContext{
+ contextUrl: contextUrl,
+ aliasToIri: map[string]string{},
+ aliasContext: map[string]string{},
+ //iriToAlias: map[string]string{},
+ }
+ c.contextMap[contextUrl] = ctx
+ }
+ return ctx
+}
+
+func (c *context) ToJSON(writer io.Writer, graph ...any) error {
+ out, err := c.toMaps(graph...)
+ if err != nil {
+ return err
+ }
+ enc := json.NewEncoder(writer)
+ enc.SetEscapeHTML(false)
+ enc.SetIndent("", " ")
+ return enc.Encode(out)
+}
+
+func (c *context) toMaps(graph ...any) (values map[string]any, errors error) {
+ builder := graphBuilder{
+ ctx: c,
+ nextID: map[reflect.Type]int{},
+ ids: map[uintptr]string{},
+ pointerRefs: map[reflect.Value]map[string]any{},
+ }
+ return builder.toCompactMaps(graph...)
+}
+
+func (c *context) FromJSON(reader io.Reader) ([]any, error) {
+ var decoded any
+ dec := json.NewDecoder(reader)
+ err := dec.Decode(&decoded)
+ if err != nil {
+ return nil, err
+ }
+ switch values := decoded.(type) {
+ case map[string]any:
+ return c.fromMaps(values)
+ case []any:
+ return c.fromSlice(values)
+ }
+ return nil, fmt.Errorf("unable to decode, unsupported JSON type: %v", decoded)
+}
+
+func (c *context) fromMaps(values map[string]any) ([]any, error) {
+ rdr := mapReader{ctx: c}
+ return rdr.FromMaps(values)
+}
+
+func (c *context) fromSlice(values []any) ([]any, error) {
+ rdr := mapReader{ctx: c}
+ return rdr.FromSlice(values)
+}
+
+type typeContext struct {
+ ctx *serializationContext
+ typ reflect.Type
+ iri string
+ alias string
+ setters map[string]func(instance reflect.Value, value reflect.Value)
+ blankNodeAllowed bool
+}
+
+type serializationContext struct {
+ contextUrl string
+ // the full JSON LD context provided
+ ldContext map[string]any
+ parsedLdContext *ld.Context
+ // aliasToIri contains field aliases to the respective IRIs
+ aliasToIri map[string]string
+ // aliasContext
+ aliasContext map[string]string
+ //iriToAlias map[string]string
+}
+
+func registerFunc(c *context, fn any) {
+ f := reflect.ValueOf(fn)
+ t := f.Type()
+
+ if t.NumIn() != 1 || t.In(0).Kind() != reflect.String {
+ panic("external IRI functions must have one parameter, accepting an IRI string")
+ }
+
+ if t.NumOut() != 1 {
+ panic("external IRI functions must have one return value")
+ }
+
+ rVal := t.Out(0)
+ c.typeToExternalIriFunc[rVal] = func(s string) reflect.Value {
+ out := f.Call([]reflect.Value{reflect.ValueOf(s)})
+ return out[0]
+ }
+}
+
+func registerType(c *context, ctx *serializationContext, instancePointer any) {
+ t := reflect.TypeOf(instancePointer)
+ instance := reflect.ValueOf(instancePointer)
+ t = baseType(t) // types may be passed as pointers, but we want the base types
+
+ tc := c.typeToContext[t]
+ if tc == nil {
+ meta, ok := FieldByType[Type](t)
+ if ok {
+ iri := meta.Tag.Get(GoIriTagName)
+ if iri == "" {
+ panic("no type IRI specified for: " + stringify(instancePointer))
+ }
+ tc = &typeContext{
+ iri: iri,
+ ctx: ctx,
+ typ: t,
+ setters: map[string]func(instance reflect.Value, value reflect.Value){},
+ blankNodeAllowed: strings.Contains(meta.Tag.Get(GoNodeKindTagName), "BlankNode"),
+ }
+ c.iriToType[tc.iri] = tc
+ c.typeToContext[t] = tc
+ }
+ }
+
+ // capture all the registered types
+ id, err := getID(instance)
+ if err != nil {
+ // we should not have invalid types registered
+ panic(err)
+ }
+ if id != "" {
+ switch instance.Type().Kind() {
+ case reflect.Pointer, reflect.Struct:
+ default:
+ panic("expected instance registration to be a pointer or a struct, got: " + stringify(instance))
+ }
+ c.iriToInstance[id] = instance
+ }
+}
diff --git a/spdx/v3/internal/ld/ld_context_test.go b/spdx/v3/internal/ld/ld_context_test.go
new file mode 100644
index 00000000..ebbcbcfe
--- /dev/null
+++ b/spdx/v3/internal/ld/ld_context_test.go
@@ -0,0 +1,100 @@
+package ld
+
+import (
+ "testing"
+
+ "github.com/google/go-cmp/cmp"
+ "github.com/stretchr/testify/require"
+)
+
+func Test_registeredInstances(t *testing.T) {
+ type AType struct {
+ _ Type `iri:"https://example.org/context/thing-a"`
+ ID string `iri:"@id"`
+ Name string `iri:"https://example.org/context/name"`
+ Values []any `iri:"https://example.org/context/values"`
+ }
+
+ inst := &AType{
+ ID: "https://example.org/context/an-instance",
+ Name: "an-instance",
+ }
+
+ contextName := "https://example.org/context"
+ ctx := NewContext().Register(contextName, o{"@context": o{
+ "thing-a": "https://example.org/context/thing-a",
+ "name": o{
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ "@id": "https://example.org/context/name",
+ },
+ "values": o{
+ "@type": "@vocab",
+ "@id": "https://example.org/context/values",
+ },
+ }}, inst)
+
+ g, err := ctx.(*context).fromMaps(o{
+ "@context": contextName,
+ //"@graph": l{
+ // o{
+ "@type": "thing-a",
+ "name": "some-name",
+ "values": l{
+ "https://example.org/context/an-instance",
+ },
+ // },
+ //},
+ })
+ require.NoError(t, err)
+
+ got := g[0].(*AType)
+ require.Equal(t, "some-name", got.Name)
+ require.Len(t, got.Values, 1)
+ require.Equal(t, inst, got.Values[0])
+}
+
+func Test_MultiRegistration(t *testing.T) {
+ type AType struct {
+ _ Type `iri:"https://example.org/context/thing-a"`
+ AnID string `iri:"@id"`
+ Name string `iri:"https://example.org/context/name"`
+ }
+
+ contextName := "https://example.org/context"
+ ctx := NewContext().Register(contextName, o{"@context": o{
+ "name": o{
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ "@id": "https://example.org/context/name",
+ },
+ }}, AType{})
+ require.Len(t, ctx.(*context).contextMap, 1)
+
+ type BType struct {
+ _ Type `iri:"https://example.org/context/thing-b"`
+ AnotherID string `iri:"@id"`
+ Name string `iri:"https://example.org/context/name"`
+ }
+
+ ctx = ctx.Register(contextName, o{"@context": o{}}, BType{})
+ require.Len(t, ctx.(*context).contextMap, 1)
+
+ maps, err := ctx.(*context).toMaps(&AType{
+ AnID: "id1",
+ Name: "A",
+ }, &BType{
+ AnotherID: "id2",
+ Name: "B",
+ })
+ require.NoError(t, err)
+
+ diff := cmp.Diff(o{
+ "@context": "https://example.org/context",
+ "@graph": l{
+ o{"@type": "https://example.org/context/thing-a", "name": "A", "@id": "id1"},
+ o{"@type": "https://example.org/context/thing-b", "name": "B", "@id": "id2"},
+ },
+ }, maps)
+ if diff != "" {
+ t.Fatal(diff)
+ }
+}
diff --git a/spdx/v3/internal/ld/model_test.go b/spdx/v3/internal/ld/model_test.go
new file mode 100644
index 00000000..a5cf4fd2
--- /dev/null
+++ b/spdx/v3/internal/ld/model_test.go
@@ -0,0 +1,178 @@
+package ld_test
+
+import (
+ "bytes"
+ "encoding/json"
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ "github.com/spdx/tools-golang/spdx/v3/internal/ld"
+)
+
+// convenience for writing json as code:
+
+type o = map[string]any // object
+type l = []any // list
+type a = any // any
+
+var testJsonLdContext = o{"@context": o{
+ "type": "@type",
+ "spdxId": "@id",
+ "spdx": "https://spdx.org/rdf/3.0.1/terms/",
+ "software_Package": "https://spdx.org/rdf/3.0.1/terms/Software/Package",
+ "software_File": "https://spdx.org/rdf/3.0.1/terms/Software/File",
+ "Relationship": "https://spdx.org/rdf/3.0.1/terms/Core/relationship",
+ "software_primaryPurpose": o{
+ "@context": o{
+ "@vocab": "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/",
+ },
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Software/primaryPurpose",
+ "@type": "@vocab",
+ },
+ "software_additionalPurpose": o{
+ "@context": o{
+ "@vocab": "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/",
+ },
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Software/additionalPurpose",
+ "@type": "@vocab",
+ },
+ "from": o{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/from",
+ "@type": "@vocab",
+ },
+ "to": o{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/to",
+ "@type": "@vocab",
+ },
+ "specVersion": o{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/specVersion",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "Element": "https://spdx.org/rdf/3.0.1/terms/Core/Element",
+ "element": o{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/element",
+ "@type": "@vocab",
+ },
+ "contents": o{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Software/File/contents",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "name": o{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/name",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+}}
+
+type Document struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/Document"`
+ ID string `iri:"@id"`
+ Elements ElementList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/element"`
+}
+
+type AnyElement interface {
+ asElement() *Element
+}
+
+type ElementList []AnyElement
+
+type Element struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ ID string `iri:"@id"`
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name"`
+}
+
+func (e *Element) asElement() *Element {
+ return e
+}
+
+type SoftwarePurpose struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose"`
+ ID string `iri:"@id"`
+}
+
+type Package struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Software/Package"`
+ Element
+ SoftwarePurpose SoftwarePurpose `iri:"https://spdx.org/rdf/3.0.1/terms/Software/primaryPurpose"`
+ AdditionalPurposes []SoftwarePurpose `iri:"https://spdx.org/rdf/3.0.1/terms/Software/primaryPurpose"`
+}
+
+type File struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Software/File"`
+ Element
+ Contents string `iri:"https://spdx.org/rdf/3.0.1/terms/Software/File/contents"`
+}
+
+type Relationship struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/relationship"`
+ ID string `iri:"@id"`
+ From any `iri:"https://spdx.org/rdf/3.0.1/terms/Core/from"`
+ To []any `iri:"https://spdx.org/rdf/3.0.1/terms/Core/to"`
+}
+
+type AnyRelationship interface {
+ asRelationship() *Relationship
+}
+
+func (r *Relationship) asRelationship() *Relationship {
+ return r
+}
+
+var File_DevNull = &File{Element: Element{ID: "https://example.org/iri/file/dev/null"}}
+
+// SubRelationship implements inheritance by embedding
+type SubRelationship struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/sub-relationship"`
+ Relationship
+}
+
+type ExternalIRI struct {
+ ExternalID string `iri:"@id"`
+}
+
+func (r *ExternalIRI) asRelationship() *Relationship {
+ return nil
+}
+
+func testGraph(t *testing.T, graph l) []any {
+ ctx, contextURL := testContext()
+
+ in := o{
+ "@context": contextURL,
+ "@graph": graph,
+ }
+
+ buf := bytes.Buffer{}
+
+ enc := json.NewEncoder(&buf)
+ enc.SetEscapeHTML(false)
+ err := enc.Encode(in)
+ require.NoError(t, err)
+
+ graph, err = ctx.FromJSON(&buf)
+ if err != nil {
+ t.Fatal(err)
+ }
+ return graph
+}
+
+func testContext() (ld.Context, string) {
+ contextURL := "https://example.org/test-context"
+ return ld.NewContext().Register(contextURL, testJsonLdContext,
+ Package{},
+ File{},
+ File_DevNull,
+ Relationship{},
+ ), contextURL
+}
+
+func toJSON(t *testing.T, o any) string {
+ buf := bytes.Buffer{}
+ enc := json.NewEncoder(&buf)
+ enc.SetEscapeHTML(false)
+ enc.SetIndent("", " ")
+ err := enc.Encode(o)
+ require.NoError(t, err)
+ return buf.String()
+}
diff --git a/spdx/v3/internal/ld/primitives.go b/spdx/v3/internal/ld/primitives.go
new file mode 100644
index 00000000..aa3dfab3
--- /dev/null
+++ b/spdx/v3/internal/ld/primitives.go
@@ -0,0 +1,149 @@
+package ld
+
+import (
+ "fmt"
+ "net/url"
+ "reflect"
+ "time"
+)
+
+type URI string
+
+func (u URI) Validate() error {
+ if u == "" { // this is handled by required check
+ return nil
+ }
+ _, err := url.Parse(string(u))
+ return err
+}
+
+type PositiveInt int
+
+func (i PositiveInt) Validate() error {
+ if i < 0 {
+ return fmt.Errorf("positive integer required, got: %v", i)
+ }
+ return nil
+}
+
+type NonNegativeInt int
+
+func (i NonNegativeInt) Validate() error {
+ if i < 0 {
+ return fmt.Errorf("non-negative integer required, got: %v", i)
+ }
+ return nil
+}
+
+// DateTime is a specifically typed time.Time, validation inherently not needed
+type DateTime time.Time
+
+var converters = []converter{
+ {
+ IRI: "http://www.w3.org/2001/XMLSchema#string",
+ Type: typeOf[string](),
+ },
+ {
+ IRI: "http://www.w3.org/2001/XMLSchema#anyURI",
+ Type: typeOf[URI](),
+ },
+ {
+ IRI: "http://www.w3.org/2001/XMLSchema#integer",
+ Type: typeOf[int](),
+ },
+ {
+ IRI: "http://www.w3.org/2001/XMLSchema#positiveInteger",
+ Type: typeOf[PositiveInt](),
+ },
+ {
+ IRI: "http://www.w3.org/2001/XMLSchema#nonNegativeInteger",
+ Type: typeOf[NonNegativeInt](),
+ },
+ {
+ IRI: "http://www.w3.org/2001/XMLSchema#boolean",
+ Type: typeOf[bool](),
+ },
+ {
+ IRI: "http://www.w3.org/2001/XMLSchema#decimal",
+ Type: typeOf[float64](),
+ },
+ {
+ IRI: "http://www.w3.org/2001/XMLSchema#dateTime",
+ Type: typeOf[DateTime](),
+ Serialize: serializeTime[DateTime],
+ Deserialize: deserializeTime[DateTime],
+ },
+ {
+ IRI: "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
+ Type: typeOf[time.Time](),
+ Serialize: serializeTime[time.Time],
+ Deserialize: deserializeTime[time.Time],
+ },
+}
+
+var iriToConverter = getIriToConverter()
+
+var typeToConverter = getTypeToConverter()
+
+func TypeForIRI(iri string) reflect.Type {
+ c := iriToConverter[iri]
+ if c != nil {
+ return c.Type
+ }
+ return nil
+}
+
+func typeOf[T any]() reflect.Type {
+ var t T
+ return reflect.TypeOf(t)
+}
+
+type converter struct {
+ Type reflect.Type
+ IRI string
+ Serialize func(any) any
+ Deserialize func(any) any
+}
+
+func getTypeToConverter() map[reflect.Type]*converter {
+ out := map[reflect.Type]*converter{}
+ for i := range converters {
+ c := &converters[i]
+ if _, ok := out[c.Type]; ok {
+ continue
+ }
+ out[c.Type] = c
+ }
+ return out
+}
+
+func getIriToConverter() map[string]*converter {
+ out := map[string]*converter{}
+ for i := range converters {
+ c := &converters[i]
+ if c.IRI == "" {
+ panic("no IRI set")
+ }
+ if _, ok := out[c.IRI]; ok {
+ panic("duplicate IRI set: " + c.IRI)
+ }
+ out[c.IRI] = c
+ }
+ return out
+}
+
+func serializeTime[T time.Time | DateTime](goValue any) any {
+ if t, ok := goValue.(T); ok {
+ return time.Time(t).Format(time.RFC3339)
+ }
+ return nil
+}
+
+func deserializeTime[T time.Time | DateTime](incoming any) any {
+ s, _ := incoming.(string)
+ if s != "" {
+ parsed, _ := time.Parse(time.RFC3339, s)
+ return T(parsed)
+ }
+ return nil
+}
diff --git a/spdx/v3/internal/ld/reader.go b/spdx/v3/internal/ld/reader.go
new file mode 100644
index 00000000..8ccb685d
--- /dev/null
+++ b/spdx/v3/internal/ld/reader.go
@@ -0,0 +1,378 @@
+package ld
+
+import (
+ "errors"
+ "fmt"
+ "io"
+ "maps"
+ "reflect"
+ "runtime"
+ "strconv"
+ "strings"
+
+ "github.com/piprate/json-gold/ld"
+)
+
+type mapReader struct {
+ ctx *context
+ errs []error
+ logOut io.Writer // logOut if set will result in lots of log messages about the processing
+ link bool // link indicates this is a second pass to link previously created instances
+ instances map[string]reflect.Value // instances holds id -> initialized instances
+}
+
+func (c *mapReader) FromMaps(values map[string]any) ([]any, error) {
+ proc := ld.NewJsonLdProcessor()
+ opts := ld.NewJsonLdOptions("")
+ opts.ProcessingMode = ld.JsonLd_1_1_Frame
+ opts.DocumentLoader = offlineDocumentLoader{ctx: c.ctx}
+ //opts.Embed= EmbedLast,
+ //opts.Explicit= false,
+ //opts.RequireAll= true,
+ opts.FrameDefault = true
+
+ //opts.OmitDefault = true
+ //opts.OmitGraph= false,
+
+ //opts.UseRdfType = false
+ //opts.UseNativeTypes= false,
+ //opts.ProduceGeneralizedRdf: false,
+ //opts.InputFormat= "",
+ //opts.Format= "",
+ //opts.Algorithm= AlgorithmURGNA2012,
+ //opts.UseNamespaces= false,
+ //opts.OutputForm= "",
+ //opts.SafeMode = true
+ expanded, err := proc.Expand(values, opts)
+ c.log(nil, "expanded graph: %v", expanded)
+ if err != nil {
+ return nil, err
+ }
+ return c.FromSlice(expanded)
+}
+
+func (c *mapReader) FromSlice(expanded []any) ([]any, error) {
+ c.instances = map[string]reflect.Value{}
+
+ path := []string{JsonGraphProp}
+
+ // one pass to create all the instances
+ _ = c.readSlice(path, anyType, expanded)
+
+ // second pass captures all errors, and links all instances which were created previously
+ c.link = true
+
+ // the ld expansion above reads @graph and returns a fully expanded graph
+ var out []any
+ for _, value := range c.readSlice(path, anyType, expanded) {
+ out = append(out, value.Interface())
+ }
+
+ return out, errors.Join(c.errs...)
+}
+
+// readSlice takes a fully expanded list of nodes and returns the go struct representations
+func (c *mapReader) readSlice(path []string, targetType reflect.Type, values []any) []reflect.Value {
+ var out []reflect.Value
+ for i, node := range values {
+ got := c.getNode(append(path, strconv.Itoa(i)), targetType, node)
+ // only valid objects which can be returned via .Interface() are allowed
+ if got.IsValid() && got.CanInterface() {
+ out = append(out, got)
+ }
+ }
+ return out
+}
+
+// readNode gets object instances and primitives based on a node value, creating new instances as needed, we only expect
+// to get a map[string]any as input here
+func (c *mapReader) getNode(path []string, targetType reflect.Type, incoming any) reflect.Value {
+ values, ok := incoming.(map[string]any)
+ if !ok {
+ c.err(path, "expected object, got: %v", incoming)
+ return emptyValue
+ }
+ // not a primitive expected is some sort of struct (pointer, interface, etc.)
+ id, _ := values[JsonIdProp].(string)
+ typeIRI := singleValue[string](values[JsonTypeProp])
+ value, _ := values[JsonValueProp]
+
+ // type & value is an external IRI
+ if typeIRI != "" && value != nil {
+ cnv := iriToConverter[typeIRI]
+ if cnv != nil {
+ if cnv.Deserialize != nil {
+ value = cnv.Deserialize(value)
+ }
+ if value != nil {
+ v := reflect.ValueOf(value)
+ // can directly assign, value is good
+ if v.Type().AssignableTo(cnv.Type) {
+ return v
+ }
+ // can convert, still good
+ if v.CanConvert(cnv.Type) {
+ return v.Convert(cnv.Type)
+ }
+ c.err(path, "invalid value: %v", value)
+ }
+ }
+
+ return emptyValue
+ }
+
+ tc := c.ctx.iriToType[typeIRI]
+ if tc == nil {
+ if id != "" {
+ // first look up any known named individuals, we do not populate these
+ if v, ok := c.ctx.iriToInstance[id]; ok {
+ return v
+ }
+
+ // if there isn't a named individual, and we don't have a type, it may be a reference in the same document,
+ // but it may not have been created yet, here we just want to return
+ // we may have created this instance already
+ instance, ok := c.instances[id]
+ if ok {
+ return instance
+ }
+
+ if c.link { // only need external IRI references on the second pass
+ // if we have no type and don't have an instance created, return an external IRI
+ return c.externalIRI(path, targetType, id)
+ }
+ }
+ return emptyValue
+ }
+
+ // // TODO support setting map values
+ // if typ.Kind() != reflect.Struct {
+ // c.err(path, "unable to set struct properties on non-struct type: %s", typeName(instance.Type()))
+ // return
+ // }
+
+ return c.readObject(path, targetType, id, tc, values)
+}
+
+func (c *mapReader) readObject(path []string, targetType reflect.Type, id string, tc *typeContext, incoming map[string]any) reflect.Value {
+ // we created this instance already during the first pass, look up that instance
+ instance, ok := c.instances[id]
+ if !ok {
+ instance, ok = c.ctx.iriToInstance[id]
+ if ok {
+ return instance
+ }
+ // if not, create it now
+ instance = reflect.New(baseType(tc.typ)) // New(T) returns *T
+ if id != "" {
+ // only set instance references when an ID is provided
+ c.instances[id] = instance
+ }
+ }
+ c.setStructFields(path, instance, id, tc, incoming)
+ return instance
+}
+
+func (c *mapReader) setStructFields(path []string, instance reflect.Value, id string, tc *typeContext, incoming map[string]any) {
+ typ := instance.Type()
+ if typ.Kind() == reflect.Pointer {
+ instance = instance.Elem()
+ typ = instance.Type()
+ }
+
+ for i := 0; i < typ.NumField(); i++ {
+ f := typ.Field(i)
+ if skipField(f) {
+ continue
+ }
+
+ fieldVal := instance.Field(i)
+ c.log(path, "readObject %v field %v", typeName(typ), f.Name)
+
+ // embedded struct is how inheritance is handled, so recursively call this function to set all struct values
+ if f.Anonymous {
+ c.setStructFields(append(path, f.Name), fieldVal, id, tc, incoming)
+ }
+
+ propIRI := f.Tag.Get(GoIriTagName)
+ if propIRI == "" {
+ continue
+ }
+
+ if propIRI == JsonIdProp {
+ // don't set blank node IDs, these will be regenerated on output
+ if id != "" && !isBlankNodeID(id) {
+ fieldVal.SetString(id)
+ }
+ continue
+ }
+
+ incomingVal, ok := incoming[propIRI]
+ if !ok {
+ continue
+ }
+
+ c.setFieldValue(append(path, f.Name), fieldVal, incomingVal)
+ }
+}
+
+func (c *mapReader) setFieldValue(path []string, targetValue reflect.Value, incoming any) {
+ incomingValues, ok := incoming.([]any)
+ if !ok {
+ c.err(path, "expected []any for property value, got: %v", incomingValues)
+ return
+ }
+
+ targetType := targetValue.Type()
+ if targetType.Kind() == reflect.Slice {
+ c.setSliceValue(path, targetValue, incomingValues)
+ return
+ }
+
+ // values are stored as a slice, even single values
+ values := c.readSlice(path, targetType, incomingValues)
+
+ // no valid values
+ if len(values) == 0 {
+ return
+ }
+
+ // any values returned from readSlice should be valid
+ value := values[0]
+ typ := value.Type()
+ if typ.AssignableTo(targetType) {
+ targetValue.Set(value)
+ } else if typ.ConvertibleTo(targetType) {
+ targetValue.Set(value.Convert(targetType))
+ } else {
+ c.err(path, "unable to set value expected: %s to: %s, dropping: %v", typeName(targetType), typeName(typ), incoming)
+ }
+}
+
+func (c *mapReader) setSliceValue(path []string, targetValue reflect.Value, incoming []any) {
+ sliceType := targetValue.Type()
+ if sliceType.Kind() != reflect.Slice {
+ panic("expected slice")
+ }
+ sz := len(incoming)
+ if sz > 0 {
+ elemType := sliceType.Elem()
+ newSlice := reflect.MakeSlice(sliceType, 0, sz)
+ values := c.readSlice(path, elemType, incoming)
+ for i, value := range values {
+ if value.Type().AssignableTo(elemType) {
+ newSlice = reflect.Append(newSlice, value)
+ } else if value.CanConvert(elemType) {
+ newSlice = reflect.Append(newSlice, value)
+ } else {
+ c.err(append(path, strconv.Itoa(i)), "unable to convert value type: %s to: %s: %v", typeName(value.Type()), typeName(elemType), value)
+ }
+ }
+ targetValue.Set(newSlice)
+ }
+}
+
+//func (c *mapReader) findExternalReferenceType(expectedType reflect.Type) (reflect.Type, bool) {
+// tc := c.ctx.typeToContext[expectedType]
+// if tc != nil {
+// return tc.typ, true
+// }
+// bestMatch := anyType
+// for t := range c.ctx.typeToContext {
+// if t.Kind() != reflect.Struct {
+// continue
+// }
+// // the type with the fewest fields assignable to the target is a good candidate to be an abstract type
+// if reflect.PointerTo(t).AssignableTo(expectedType) && (bestMatch == anyType || bestMatch.NumField() > t.NumField()) {
+// bestMatch = t
+// }
+// }
+// if bestMatch != anyType {
+// c.ctx.typeToContext[expectedType] = &typeContext{
+// typ: bestMatch,
+// }
+// return bestMatch, true
+// }
+// return anyType, false
+//}
+
+type contextMap map[string]*serializationContext
+
+func (c contextMap) getPrefix(ctx *serializationContext) string {
+ for pfx, sc := range c {
+ if sc == ctx {
+ return pfx
+ }
+ }
+ return ""
+}
+
+func (c *mapReader) getContextMap(currentContext contextMap, values map[string]any) (contextMap, error) {
+ ctx := values[JsonContextProp]
+ if ctx == nil {
+ if currentContext == nil {
+ return nil, fmt.Errorf("unable to find " + JsonContextProp)
+ }
+ return currentContext, nil
+ }
+ // TODO support named contexts, e.g.
+ //namedContexts, _ := ctx.(map[string]any)
+
+ context, _ := ctx.(string)
+ sc := c.ctx.contextMap[context]
+ if sc == nil {
+ return nil, fmt.Errorf("unknown %s: '%s' must be in %v", JsonContextProp, context, maps.Keys(c.ctx.contextMap))
+ }
+ return merge(currentContext, contextMap{
+ "": sc,
+ }), nil
+}
+
+func (c *mapReader) externalIRI(path []string, targetType reflect.Type, id string) reflect.Value {
+ for typ, f := range c.ctx.typeToExternalIriFunc {
+ if typ.AssignableTo(targetType) {
+ return f(id)
+ }
+ }
+ c.err(path, "unable to find viable external IRI for: %s for ID: %s", typeName(targetType), id)
+ return emptyValue
+}
+
+func (c *mapReader) err(path []string, format string, args ...any) {
+ if c.link { // only capture errors during second pass
+ c.errs = append(c.errs, fmt.Errorf("[%s] "+format, append([]any{strings.Join(path, "/")}, args...)...))
+ }
+}
+
+func (c *mapReader) log(path []string, format string, args ...any) {
+ if c.logOut != nil {
+ caller := ""
+ pc, _, _, ok := runtime.Caller(1)
+ if ok {
+ details := runtime.FuncForPC(pc)
+ file, line := details.FileLine(pc)
+ caller = details.Name() + " (" + file + ":" + strconv.Itoa(line) + "): "
+ }
+ _, _ = fmt.Fprintf(c.logOut, "[%s] "+caller+format+"\n", append([]any{strings.Join(path, "/")}, args...)...)
+ }
+}
+
+func convertTo(v reflect.Value, typ reflect.Type) reflect.Value {
+ if v.CanConvert(typ) {
+ return v.Convert(typ)
+ }
+ return emptyValue
+}
+
+func singleValue[T any](v any) T {
+ switch v := v.(type) {
+ case []any:
+ if len(v) > 0 {
+ return singleValue[T](v[0])
+ }
+ case T:
+ return v
+ }
+ var t T
+ return t
+}
diff --git a/spdx/v3/internal/ld/reader_test.go b/spdx/v3/internal/ld/reader_test.go
new file mode 100644
index 00000000..12357243
--- /dev/null
+++ b/spdx/v3/internal/ld/reader_test.go
@@ -0,0 +1,317 @@
+package ld
+
+import (
+ "reflect"
+ "testing"
+ "time"
+
+ "github.com/google/go-cmp/cmp"
+ "github.com/stretchr/testify/require"
+)
+
+func Test_nestedDeserialization(t *testing.T) {
+ type t1 struct {
+ _ Type `iri:"https://example.org/test-1"`
+ Id string `iri:"@id"`
+ Child any `iri:"https://example.org/test-1/child"`
+ }
+
+ contextURI := "http://example.org/uri"
+
+ ctx := NewContext().Register(contextURI, o{"@context": o{
+ "t": "https://example.org/test-1",
+ "child": o{
+ "@id": "https://example.org/test-1/child",
+ "@type": "@vocab",
+ },
+ }}, t1{})
+
+ graph, err := ctx.(*context).fromMaps(o{
+ "@context": contextURI,
+ "@graph": l{
+ o{
+ "@id": "_:t1",
+ "@type": "t",
+ "child": "_:t2",
+ },
+ o{
+ "@id": "_:t2",
+ "@type": "t",
+ "child": "_:t3",
+ },
+ o{
+ "@id": "_:t3",
+ "@type": "t",
+ "child": "_:t1",
+ },
+ },
+ })
+ got := graph[0].(*t1)
+ require.NoError(t, err)
+ require.True(t, got.Child.(*t1).Child != nil)
+}
+
+func Test_readerAliasFields(t *testing.T) {
+ type typ struct {
+ _ Type `iri:"https://example.org/test-iri"`
+ Id string `iri:"@id"`
+ Str string `iri:"https://example.org/test-iri/str-iri"`
+ Bool bool `iri:"https://example.org/test-iri/bool-iri"`
+ Int int `iri:"https://example.org/test-iri/int-iri"`
+ Float float64 `iri:"https://example.org/test-iri/float-iri"`
+ Time time.Time `iri:"https://example.org/test-iri/time-iri"`
+ }
+
+ typContext := o{
+ "t": "https://example.org/test-iri",
+ "s": o{
+ "@id": "https://example.org/test-iri/str-iri",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "b": o{
+ "@id": "https://example.org/test-iri/bool-iri",
+ "@type": "http://www.w3.org/2001/XMLSchema#boolean",
+ },
+ "i": o{
+ "@id": "https://example.org/test-iri/int-iri",
+ "@type": "http://www.w3.org/2001/XMLSchema#integer",
+ },
+ "f": o{
+ "@id": "https://example.org/test-iri/float-iri",
+ "@type": "http://www.w3.org/2001/XMLSchema#decimal",
+ },
+ "tm": o{
+ "@id": "https://example.org/test-iri/time-iri",
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
+ },
+ }
+
+ idTypeAliasedContext := merge(typContext, o{
+ "myId": "@id",
+ "myType": "@type",
+ })
+
+ tests := []struct {
+ name string
+ context o
+ graph any
+ expected func() any
+ wantErr require.ErrorAssertionFunc
+ }{
+ {
+ name: "all aliases, @context prop",
+ context: typContext,
+ graph: o{
+ "@type": "t",
+ "s": "joe",
+ "b": true,
+ "i": 12,
+ "f": 39.11,
+ "tm": mar25noon.Format(time.RFC3339),
+ },
+ expected: func() any {
+ return &typ{
+ Str: "joe",
+ Bool: true,
+ Int: 12,
+ Float: 39.11,
+ Time: mar25noon,
+ }
+ },
+ },
+ {
+ name: "all aliases, no @context prop",
+ context: typContext,
+ graph: o{
+ "@type": "t",
+ "s": "joe",
+ "b": true,
+ "i": 12,
+ "f": 39.11,
+ "tm": mar25noon.Format(time.RFC3339),
+ },
+ expected: func() any {
+ return &typ{
+ Str: "joe",
+ Bool: true,
+ Int: 12,
+ Float: 39.11,
+ Time: mar25noon,
+ }
+ },
+ },
+ {
+ name: "full IRI, no aliases",
+ context: o{},
+ graph: o{
+ "@type": "https://example.org/test-iri",
+ "https://example.org/test-iri/str-iri": o{
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ "@value": "joe",
+ },
+ "https://example.org/test-iri/bool-iri": o{
+ "@type": "http://www.w3.org/2001/XMLSchema#boolean",
+ "@value": true,
+ },
+ "https://example.org/test-iri/int-iri": o{
+ "@type": "http://www.w3.org/2001/XMLSchema#integer",
+ "@value": 12,
+ },
+ "https://example.org/test-iri/float-iri": o{
+ "@type": "http://www.w3.org/2001/XMLSchema#decimal",
+ "@value": 39.11,
+ },
+ "https://example.org/test-iri/time-iri": o{
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
+ "@value": mar25noon.Format(time.RFC3339),
+ },
+ },
+ expected: func() any {
+ return &typ{
+ Str: "joe",
+ Bool: true,
+ Int: 12,
+ Float: 39.11,
+ Time: mar25noon,
+ }
+ },
+ },
+ {
+ name: "full IRI, all aliases",
+ context: typContext,
+ graph: o{
+ "@type": "https://example.org/test-iri",
+ "https://example.org/test-iri/str-iri": o{
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ "@value": "joe",
+ },
+ "https://example.org/test-iri/bool-iri": o{
+ "@type": "http://www.w3.org/2001/XMLSchema#boolean",
+ "@value": true,
+ },
+ "https://example.org/test-iri/int-iri": o{
+ "@type": "http://www.w3.org/2001/XMLSchema#integer",
+ "@value": 12,
+ },
+ "https://example.org/test-iri/float-iri": o{
+ "@type": "http://www.w3.org/2001/XMLSchema#decimal",
+ "@value": 39.11,
+ },
+ "https://example.org/test-iri/time-iri": o{
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
+ "@value": mar25noon.Format(time.RFC3339),
+ },
+ },
+ expected: func() any {
+ return &typ{
+ Str: "joe",
+ Bool: true,
+ Int: 12,
+ Float: 39.11,
+ Time: mar25noon,
+ }
+ },
+ },
+ {
+ name: "mixed IRI and aliases",
+ context: typContext,
+ graph: o{
+ "@type": "t",
+ "https://example.org/test-iri/str-iri": o{
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ "@value": "joe",
+ },
+ "b": true,
+ "https://example.org/test-iri/int-iri": o{
+ "@type": "http://www.w3.org/2001/XMLSchema#integer",
+ "@value": 12,
+ },
+ "f": 39.11,
+ "https://example.org/test-iri/time-iri": o{
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
+ "@value": mar25noon.Format(time.RFC3339),
+ },
+ },
+ expected: func() any {
+ return &typ{
+ Str: "joe",
+ Bool: true,
+ Int: 12,
+ Float: 39.11,
+ Time: mar25noon,
+ }
+ },
+ },
+ {
+ name: "id and type aliases",
+ context: idTypeAliasedContext,
+ graph: o{
+ "myType": "t",
+ "s": "joe",
+ "b": true,
+ "i": 12,
+ "f": 39.11,
+ "tm": mar25noon.Format(time.RFC3339),
+ },
+ expected: func() any {
+ return &typ{
+ Str: "joe",
+ Bool: true,
+ Int: 12,
+ Float: 39.11,
+ Time: mar25noon,
+ }
+ },
+ },
+ }
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ expected := tt.expected()
+ contextURI := "http://example.org/uri"
+
+ ctx := NewContext().Register(contextURI, o{"@context": tt.context},
+ // register an empty instance of the returned type:
+ reflect.New(reflect.TypeOf(expected).Elem()).Interface())
+ graph := tt.graph
+ if _, ok := tt.graph.(l); !ok {
+ graph = l{graph}
+ }
+ var got any
+ gotList, err := ctx.(*context).fromMaps(o{
+ "@context": contextURI,
+ "@graph": graph,
+ })
+
+ wantErr := require.NoError
+ if tt.wantErr != nil {
+ wantErr = tt.wantErr
+ }
+ wantErr(t, err)
+
+ got = gotList
+ if _, ok := expected.(l); !ok {
+ if len(gotList) > 0 {
+ got = gotList[0]
+ }
+ }
+
+ d := cmp.Diff(expected, got)
+ if d != "" {
+ t.Fatal(d)
+ }
+ })
+ }
+}
+
+var mar25noon = get(time.Parse(time.RFC3339, "2025-03-25T12:00:00Z"))
+
+func get[T any](t T, err error) T {
+ if err != nil {
+ panic(err)
+ }
+ return t
+}
+
+type o = map[string]any
+type l = []any
diff --git a/spdx/v3/internal/ld/ref_count.go b/spdx/v3/internal/ld/ref_count.go
new file mode 100644
index 00000000..8295a1ac
--- /dev/null
+++ b/spdx/v3/internal/ld/ref_count.go
@@ -0,0 +1,59 @@
+package ld
+
+import "reflect"
+
+// RefCount returns the reference count of the value in the container map[string]any
+func RefCount(find any, container any) int {
+ findV, ok := find.(reflect.Value)
+ if !ok {
+ findV = reflect.ValueOf(find)
+ }
+ if !findV.IsValid() {
+ return 0
+ }
+
+ containerV, ok := container.(reflect.Value)
+ if !ok {
+ containerV = reflect.ValueOf(container)
+ }
+
+ return refCountR(findV, map[reflect.Value]struct{}{}, containerV)
+}
+
+// refCountR recursively searches for the value, find, in the value v
+func refCountR(find reflect.Value, visited map[reflect.Value]struct{}, v reflect.Value) int {
+ if !v.IsValid() {
+ return 0
+ }
+ if _, ok := visited[v]; ok {
+ return 0
+ }
+ visited[v] = struct{}{}
+ switch v.Kind() {
+ case reflect.Interface:
+ return refCountR(find, visited, v.Elem())
+ case reflect.Pointer:
+ if v.IsNil() {
+ return 0
+ }
+ count := refCountR(find, visited, v.Elem())
+ if find.Equal(v) {
+ return count + 1
+ }
+ return count
+ case reflect.Struct:
+ count := 0
+ for i := 0; i < v.NumField(); i++ {
+ count += refCountR(find, visited, v.Field(i))
+ }
+ return count
+ case reflect.Slice:
+ count := 0
+ for i := 0; i < v.Len(); i++ {
+ count += refCountR(find, visited, v.Index(i))
+ }
+ return count
+ default:
+ return 0
+ }
+}
diff --git a/spdx/v3/internal/ld/ref_count_test.go b/spdx/v3/internal/ld/ref_count_test.go
new file mode 100644
index 00000000..e69bcc6a
--- /dev/null
+++ b/spdx/v3/internal/ld/ref_count_test.go
@@ -0,0 +1,122 @@
+package ld
+
+import (
+ "testing"
+)
+
+func Test_refCount(t *testing.T) {
+ type O1 struct {
+ Name string
+ }
+
+ type O2 struct {
+ Name string
+ O1s []*O1
+ }
+
+ o1 := &O1{"o1"}
+ o2 := &O1{"o2"}
+ o3 := &O1{"o3"}
+ o21 := &O2{"o21", []*O1{o1, o1, o2, o3}}
+ o22 := []*O2{
+ {"o22-1", []*O1{o1, o1, o1, o1, o2, o3}},
+ {"o22-2", []*O1{o1, o1, o1, o1, o2, o3}},
+ {"o22-3", []*O1{o1, o1, o1, o1, o2, o3}},
+ }
+
+ type O3 struct {
+ Name string
+ Ref []*O3
+ }
+ o31 := &O3{"o31", nil}
+ o32 := &O3{"o32", []*O3{o31}}
+ o33 := &O3{"o33", []*O3{o32}}
+ o31.Ref = []*O3{o33}
+ o34 := &O3{"o34", []*O3{o31, o32}}
+ o35 := &O3{"o35", []*O3{o31, o32, o31, o32}}
+
+ type O4 struct {
+ Name string
+ Ref any
+ }
+ o41 := &O4{"o41", nil}
+ o42 := &O4{"o42", o41}
+
+ tests := []struct {
+ name string
+ checkObj any
+ checkIn any
+ expected int
+ }{
+ {
+ name: "none",
+ checkObj: o33,
+ checkIn: o21,
+ expected: 0,
+ },
+ {
+ name: "interface",
+ checkObj: o41,
+ checkIn: o42,
+ expected: 1,
+ },
+ {
+ name: "single",
+ checkObj: o3,
+ checkIn: o21,
+ expected: 1,
+ },
+ {
+ name: "multiple",
+ checkObj: o1,
+ checkIn: o21,
+ expected: 2,
+ },
+
+ {
+ name: "multiple 2",
+ checkObj: o1,
+ checkIn: o22,
+ expected: 12,
+ },
+ {
+ name: "circular 1",
+ checkObj: o31,
+ checkIn: o31,
+ expected: 2, // this returns 2 because it needs to find a circular reference to itself
+ },
+ {
+ name: "circular 2",
+ checkObj: o32,
+ checkIn: o31,
+ expected: 1,
+ },
+ {
+ name: "circular 3",
+ checkObj: o33,
+ checkIn: o31,
+ expected: 1,
+ },
+ {
+ name: "circular multiple",
+ checkObj: o32,
+ checkIn: o34,
+ expected: 2,
+ },
+ {
+ name: "circular multiple 2",
+ checkObj: o32,
+ checkIn: o35,
+ expected: 3,
+ },
+ }
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ cnt := RefCount(tt.checkObj, tt.checkIn)
+ if cnt != tt.expected {
+ t.Errorf("wrong reference count: %v != %v", tt.expected, cnt)
+ }
+ })
+ }
+}
diff --git a/spdx/v3/internal/ld/shaclgen/gen.go b/spdx/v3/internal/ld/shaclgen/gen.go
new file mode 100644
index 00000000..8d828ee7
--- /dev/null
+++ b/spdx/v3/internal/ld/shaclgen/gen.go
@@ -0,0 +1,819 @@
+package shaclgen
+
+import (
+ "encoding/json"
+ "fmt"
+ "os"
+ "reflect"
+ "regexp"
+ "slices"
+ "strings"
+
+ . "github.com/dave/jennifer/jen"
+ "github.com/gertd/go-pluralize"
+ "mvdan.cc/gofumpt/format"
+
+ "github.com/spdx/tools-golang/spdx/v3/internal/ld"
+)
+
+// Generate generates a data model and supporting functions to be able to serialize and deserialize
+// JSON LD documents with compaction and including inhertiance.
+func Generate(opts ...Option) {
+ g := &generator{
+ pkgName: "model",
+ license: "UNKNOWN",
+ outputValidations: true,
+ useEnums: true,
+ flatStruct: false,
+ gettersSetters: false,
+ classes: map[string]*Class{},
+ contexts: map[string]map[string]any{},
+ namedIndividuals: map[string][]*Individual{},
+ nameToIRI: map[string]string{},
+ iriToType: map[string]*Class{},
+ customTypes: map[string]string{},
+ pluralizer: pluralize.NewClient(),
+ renameFunc: func(typ NameType, name string, c *Class) string {
+ return ""
+ },
+ }
+ for _, opt := range opts {
+ opt(g)
+ }
+ g.idField = g.name(NameTypeField, ld.GoIdField, nil)
+ g.Generate()
+}
+
+type Option func(*generator)
+
+func EnableLog() Option {
+ return func(generator *generator) {
+ logEnabled = true
+ }
+}
+
+func RenameFunc(fn func(typ NameType, name string, c *Class) string) Option {
+ return func(generator *generator) {
+ generator.renameFunc = fn
+ }
+}
+
+func OutputFile(path string) Option {
+ return func(generator *generator) {
+ generator.outputFile = strings.TrimSuffix(path, ".go")
+ }
+}
+
+func PackageName(pkg string) Option {
+ return func(generator *generator) {
+ generator.pkgName = pkg
+ }
+}
+
+func LicenseID(spdxLicenseID string) Option {
+ return func(generator *generator) {
+ generator.license = spdxLicenseID
+ }
+}
+
+func UseEnums(useEnums bool) Option {
+ return func(generator *generator) {
+ generator.useEnums = useEnums
+ }
+}
+
+func UseFlatStruct(useFlatStruct bool) Option {
+ return func(generator *generator) {
+ generator.flatStruct = useFlatStruct
+ }
+}
+
+func GenerateGettersSetters(gettersSetters bool) Option {
+ return func(generator *generator) {
+ generator.gettersSetters = gettersSetters
+ }
+}
+
+func JsonLDContext(url string) Option {
+ return func(generator *generator) {
+ if generator.contexts[url] != nil {
+ panic("duplicate contexts registered: " + url)
+ }
+ contents := fetch(url)
+ var ctx map[string]any
+ must(json.Unmarshal(contents, &ctx))
+ generator.contexts[url] = ctx
+ }
+}
+
+func SHACLTypes(url string) Option {
+ return func(generator *generator) {
+ classes, namedIndividuals := ParseSHACLFromUrl(url)
+ for k, v := range classes {
+ if generator.classes[k] != nil {
+ panic("duplicate class iri defined: " + k)
+ }
+ generator.classes[k] = v
+ }
+ for _, ni := range namedIndividuals {
+ generator.namedIndividuals[ni.TypeIRI] = append(generator.namedIndividuals[ni.TypeIRI], ni)
+ }
+ }
+}
+
+type NameType int
+
+const (
+ NameTypeType NameType = iota
+ NameTypeField
+ NameTypeFunc
+ NameTypeFile
+ NameTypeComment
+)
+
+type renameFunc func(typ NameType, name string, c *Class) string
+
+type generator struct {
+ pkgName string
+ license string
+ contexts map[string]map[string]any
+ classes map[string]*Class // classes by IRI
+ namedIndividuals map[string][]*Individual // individuals by IRI, sorted
+ outputFile string
+ outputValidations bool
+ nameToIRI map[string]string
+ iriToType map[string]*Class
+ pluralizer *pluralize.Client
+ renameFunc renameFunc
+ customTypes map[string]string
+ idField string
+ useEnums bool
+ flatStruct bool
+ gettersSetters bool
+}
+
+func (g *generator) Generate() {
+ f := g.newCode()
+
+ totalTypes := 0
+ totalProps := 0
+
+ // get all the final type names so we can output things alphabetically
+ for _, c := range g.classes {
+ totalTypes++
+ renamed := g.className(c.IRI)
+ c.GoName = renamed
+ g.nameToIRI[renamed] = c.IRI
+ g.iriToType[c.IRI] = c
+
+ totalProps += len(c.Properties)
+ }
+
+ // set all prop go names
+ for _, c := range g.classes {
+ totalProps += len(c.Properties)
+ for _, p := range c.Properties {
+ p.GoName = g.propName(c, p)
+ }
+ }
+
+ for iri := range g.namedIndividuals {
+ slices.SortFunc(g.namedIndividuals[iri], func(a, b *Individual) int {
+ return strings.Compare(a.IRI, b.IRI)
+ })
+ }
+
+ log("SUMMARY -- classes:", totalTypes, ", properties:", totalProps, ", individuals:", len(g.namedIndividuals))
+
+ // sort output alphabetically by type name, the names have already been replaced
+ for _, name := range keys(g.nameToIRI) {
+ iri := g.nameToIRI[name]
+ c := g.iriToType[iri]
+
+ // append the interface for this struct, can be extended
+ if !g.isEnum(c.IRI) {
+ f.Type().Id(interfacePrefix + name).Interface(g.appendInterfaceDefinition(c)...)
+ }
+
+ if c.Comment != "" {
+ f.Comment(prefixWith(fixWhitespace(c.Comment), name))
+ }
+
+ if c.Abstract && g.flatStruct {
+ log("skipping abstract type:", c.GoName)
+ } else {
+ // append the actual struct
+ f.Type().Id(name).Struct(
+ g.typeFields(c)...,
+ )
+
+ // implement the interface for this struct
+ if !g.isEnum(c.IRI) {
+ g.appendStructImplFuncs(f, name, c)
+ } else if g.gettersSetters || g.flatStruct {
+ g.appendGetID(f, name, c)
+ }
+
+ // add all the named individuals defined for this type
+ g.appendNamedIndividualsForType(f, c.IRI)
+ }
+
+ // append the list type for this struct
+ if g.isObject(c.IRI) && !g.isEnum(c.IRI) {
+ g.appendListType(f, c)
+ }
+ }
+
+ // append external IRI type
+ g.appendExternalIRI(f)
+
+ if !g.flatStruct {
+ // append cast functions
+ g.appendCastFuncs(f)
+ }
+
+ // append custom type names like ld.URI
+ g.appendCustomTypes(f)
+
+ // append context registration
+ g.appendContextRegistration(f)
+
+ log()
+
+ commentText := []byte(g.name(NameTypeComment, fmt.Sprintf("// Generated by %s\n//\n// SPDX-License-Identifier: %s\n\n", ldImport, g.license), nil))
+ if g.outputFile != "" {
+ must(os.WriteFile(g.name(NameTypeFile, g.outputFile+".go", nil), append(commentText, formattedSource(f)...), 0777))
+ }
+
+ if g.outputValidations && g.outputFile != "" {
+ f = g.newCode()
+ }
+
+ g.appendValidations(f)
+ if g.outputFile != "" {
+ must(os.WriteFile(g.name(NameTypeFile, g.outputFile+"_validations.go", nil), append(commentText, formattedSource(f)...), 0777))
+ }
+
+ if g.outputFile == "" {
+ _, _ = os.Stdout.Write(append(commentText, f.GoString()...))
+ }
+}
+
+func formattedSource(f *File) []byte {
+ return get(format.Source([]byte(f.GoString()), format.Options{}))
+}
+
+func (g *generator) newCode() *File {
+ f := NewFile(g.pkgName)
+ f.ImportNames(map[string]string{
+ "time": "time",
+ ldImport: "ld",
+ })
+ return f
+}
+
+func (g *generator) typeFields(c *Class) []Code {
+ var out []Code
+ if c.Abstract {
+ log("skipping type for abstract:", c.GoName)
+ } else {
+ out = []Code{
+ Id(ld.GoTypeField).Qual(ldImport, "Type").Tag(map[string]string{
+ ld.GoIriTagName: c.IRI,
+ ld.GoNodeKindTagName: c.Kind,
+ }),
+ }
+ }
+ out = append(out, g.embedSupertypeOrID(c)...)
+ out = append(out, g.addDirectProperties(c)...)
+ return out
+}
+
+func (g *generator) propName(c *Class, p *Property) string {
+ iri := p.IRI
+
+ iri = cleanIRI(iri)
+ parts := strings.Split(iri, "/")
+ slices.Reverse(parts)
+ name := ""
+ for i, part := range parts {
+ name = upperFirst(part) + name
+ if requireMultipleSegments && i < 1 {
+ continue
+ }
+ break
+ }
+ if g.isList(c, p) {
+ name = g.pluralize(name)
+ }
+
+ return g.name(NameTypeField, name, c)
+}
+
+func (g *generator) isEnum(typeIRI string) bool {
+ if !g.useEnums {
+ return false
+ }
+ c := g.iriToType[typeIRI]
+ if c != nil {
+ // no parent, no properties, and no children
+ return c.ParentIRI == "" && len(c.Properties) == 0 && !g.hasSubtypes(typeIRI)
+ }
+ return false
+}
+
+func (g *generator) hasSubtypes(iri string) bool {
+ for _, c := range g.classes {
+ if c.ParentIRI == iri {
+ return true
+ }
+ }
+ return false
+}
+
+func (g *generator) isList(_ *Class, p *Property) bool {
+ return p.MaxCount != 1
+}
+
+func (g *generator) embedSupertypeOrID(c *Class) []Code {
+ var out []Code
+ if !g.flatStruct && c.ParentIRI != "" {
+ p := g.iriToType[c.ParentIRI]
+ if p == nil {
+ panic("Unknown parent: " + c.ParentIRI)
+ }
+ out = append(out, Id(p.GoName))
+ } else {
+ idField := g.idField
+ if g.isEnum(c.IRI) {
+ idField = unexport(idField)
+ }
+ out = append(out, Id(idField).Id("string").Tag(map[string]string{
+ ld.GoIriTagName: ld.JsonIdProp,
+ }))
+ }
+ return out
+}
+
+func (g *generator) addDirectProperties(c *Class) []Code {
+ var out []Code
+ if parent := g.iriToType[c.ParentIRI]; g.flatStruct && parent != nil {
+ out = g.addDirectProperties(parent)
+ }
+ for _, p := range c.Properties {
+ name := g.fieldName(c, p)
+ if p.Comment != "" {
+ out = append(out, Comment(prefixWith(fixWhitespace(p.Comment), name)))
+ }
+ tags := map[string]string{
+ ld.GoIriTagName: p.IRI,
+ ld.GoTypeTagName: p.TypeIRI,
+ }
+ if p.MinCount > 0 {
+ tags[ld.GoRequiredTagName] = "true"
+ }
+ out = append(out, Id(name).Add(g.fieldType(c, p)).Tag(tags))
+ }
+ return out
+}
+
+func (g *generator) appendInterfaceDefinition(c *Class) []Code {
+ var params []Code
+ if c.ParentIRI != "" {
+ // extend parent types for proper type safety e.g. assign AnyExtension to AnyElement
+ parent := g.iriToType[c.ParentIRI]
+ params = append(params, Id(interfacePrefix+parent.GoName))
+ } else {
+ params = append(params,
+ Id(getterPrefix+g.idField).Params().Id("string"),
+ Id(setterPrefix+g.idField).Params(Id("string")),
+ )
+ }
+ if g.flatStruct {
+ // append the asThing() method to the interface
+ params = append(params, Id(viewPrefix+c.GoName).Params())
+
+ // append getters and setters for properties
+ for _, p := range c.Properties {
+ typ := g.fieldType(c, p)
+ params = append(params,
+ Id(getterPrefix+p.GoName).Params().Add(typ),
+ Id(setterPrefix+p.GoName).Params(typ),
+ )
+ }
+ } else {
+ // append the asThing() method to the interface
+ params = append(params, Id(viewPrefix+c.GoName).Params().Op("*").Id(c.GoName))
+ }
+ return params
+}
+
+func (g *generator) appendStructImplFuncs(f *File, name string, c *Class) {
+ if g.flatStruct {
+ f.Func().Params(Id("o").Op("*").Id(name)).Id(viewPrefix + c.GoName).Params().Block()
+ if parent := g.iriToType[c.ParentIRI]; parent != nil {
+ g.appendStructImplFuncs(f, name, parent)
+ } else {
+ // append id getter and setter once, for the top-most type
+ g.appendGetID(f, name, c)
+ f.Func().Params(Id("o").Op("*").Id(name)).Id(setterPrefix + g.idField).Params(Id("v").Id("string")).Block(
+ Id("o").Dot(g.idField).Op("=").Id("v"),
+ )
+ }
+ } else {
+ f.Func().Params(Id("o").Op("*").Id(name)).Id(viewPrefix + c.GoName).Params().Op("*").Id(c.GoName).Block(
+ Return(Id("o")),
+ )
+ }
+
+ if g.gettersSetters || g.flatStruct {
+ // append getters and setters for properties
+ for _, p := range c.Properties {
+ typ := g.fieldType(c, p)
+ f.Func().Params(Id("o").Op("*").Id(name)).Id(getterPrefix + p.GoName).Params().Add(typ).Block(
+ Return(Id("o").Dot(p.GoName)),
+ )
+ f.Func().Params(Id("o").Op("*").Id(name)).Id(setterPrefix + p.GoName).Params(Id("v").Add(typ)).Block(
+ Id("o").Dot(p.GoName).Op("=").Id("v"),
+ )
+ }
+ }
+}
+
+func (g *generator) fieldType(c *Class, p *Property) Code {
+ isObj := g.isObject(p.TypeIRI)
+ isList := g.isList(c, p)
+ isEnum := isObj && g.isEnum(p.TypeIRI)
+
+ pkg, typ := g.baseType(c, p)
+ if isObj && !isEnum {
+ if isList {
+ typ += listSuffix
+ } else {
+ typ = interfacePrefix + typ
+ }
+ }
+ t := Id(typ)
+ if pkg != "" {
+ if pkg == reflect.TypeOf(ld.URI("")).PkgPath() {
+ if g.customTypes[typ] == "" {
+ g.customTypes[typ] = g.name(NameTypeType, typ, nil)
+ }
+ t = Id(g.customTypes[typ])
+ } else {
+ t = Qual(pkg, typ)
+ }
+ }
+ switch {
+ case !isObj && isList, isObj && isEnum && isList:
+ t = Index().Add(t)
+ }
+ return t
+}
+
+func (g *generator) isObject(iri string) bool {
+ return g.iriToType[iri] != nil
+}
+
+// baseType returns the golang base type to output, with "primitive" values based on the type mappings defined in ld.TypeIRI2Go
+func (g *generator) baseType(c *Class, p *Property) (pkg string, typ string) {
+ iri := cleanIRI(p.TypeIRI)
+ goTyp := ld.TypeForIRI(iri)
+ if goTyp != nil {
+ return goTyp.PkgPath(), goTyp.Name()
+ }
+
+ c = g.iriToType[iri]
+ if c == nil {
+ panic("Unknown type for IRI: " + iri)
+ }
+ name := g.name(NameTypeType, c.GoName, c)
+ parts := strings.Split(name, ".")
+ if len(parts) > 1 {
+ return strings.Join(parts[0:len(parts)-1], "."), parts[len(parts)-1]
+ }
+ return "", name
+}
+
+func (g *generator) fieldName(c *Class, p *Property) string {
+ return g.name(NameTypeField, p.GoName, c)
+}
+
+func (g *generator) className(iri string) string {
+ iri = strings.Trim(iri, "<>")
+ parts := strings.Split(iri, "/")
+ slices.Reverse(parts)
+ name := ""
+ for i, part := range parts {
+ name = upperFirst(part) + name
+ if requireMultipleSegments && i < 1 {
+ continue
+ }
+ if in(g.iriToType, name) {
+ continue
+ }
+ break
+ }
+ return g.name(NameTypeType, name, nil)
+}
+
+func (g *generator) appendListType(f *File, c *Class) {
+ listType := g.className(c.IRI) + listSuffix
+
+ // append the list type
+ f.Type().Id(listType).Id("[]" + g.interfaceName(c.IRI))
+
+ // append all the typed getters
+ g.appendListTypeGetters(f, listType, c)
+}
+
+func (g *generator) appendListTypeGetters(f *File, listTypeName string, listTyp *Class) {
+ for _, name := range keys(g.nameToIRI) {
+ iri := g.nameToIRI[name]
+ if g.isEnum(iri) {
+ continue
+ }
+ c := g.iriToType[iri]
+ if c == listTyp || g.isSubtypeOf(listTyp, c) {
+ getterName := g.name(NameTypeFunc, g.pluralize(g.className(c.IRI)), c)
+ if g.flatStruct {
+ // func (o ThingList) SubType() []AnySubType {
+ // var out []AnySubType
+ // for _, v := range o {
+ // if v2, ok := v.(AnySubType); ok {
+ // out = append(out, v)
+ // }
+ // return out
+ // }
+ g.className(c.IRI)
+ f.Func().Params(Id("v").Id(listTypeName)).Id(getterName).Params().Index().Id(g.interfaceName(c.IRI)).Block(
+ Return(Qual(ldImport, "SliceOf").Index(Id(g.interfaceName(c.IRI))).Params(Id("v"))),
+ )
+ } else {
+ castName := g.name(NameTypeFunc, castPrefix+g.className(c.IRI), c)
+ f.Func().Params(Id("o").Op("*").Id(listTypeName)).Id(getterName).Params().Qual(ldImport, "TypeSeq").Index(Id(g.interfaceName(listTyp.IRI)).Op(",").Op("*").Id(g.className(c.IRI))).Block(
+ Return().Qual(ldImport, "NewTypeSeq").Params(Op("*").Id("o"), Id(castName)),
+ )
+ }
+ }
+ }
+}
+
+func (g *generator) pluralize(name string) string {
+ return g.pluralizer.Plural(name)
+}
+
+func (g *generator) appendExternalIRI(f *File) {
+ structName := g.name(NameTypeType, externalIriName, nil)
+
+ // append type without type info, these will only output as an id
+ f.Type().Id(structName).Struct(
+ Id(unexport(g.idField)).Id("string").Tag(map[string]string{
+ ld.GoIriTagName: ld.JsonIdProp,
+ }),
+ Id("value").Any(),
+ )
+
+ // append creation function
+ f.Func().Id(g.externalIRIName()).Params(Id("id").Id("string")).Op("*").Id(structName).Block(
+ Return().Op("&").Id(structName).Block(
+ Id(unexport(g.idField)).Op(":").Id("id").Op(","),
+ ),
+ )
+
+ if !g.flatStruct {
+ for _, name := range keys(g.nameToIRI) {
+ iri := g.nameToIRI[name]
+ if g.isEnum(iri) {
+ continue
+ }
+ castName := g.name(NameTypeFunc, castPrefix+name, nil)
+ f.Func().Params(Id("o").Op("*").Id(structName)).Id(viewPrefix + name).Params().Op("*").Id(name).Block(
+ Return().Id(castName).Params(Id("o").Dot("value")),
+ )
+ }
+ }
+}
+
+func (g *generator) appendCastFuncs(f *File) {
+ // append individual cast functions for each non-enum type
+ for _, name := range keys(g.nameToIRI) {
+ iri := g.nameToIRI[name]
+ if g.isEnum(iri) {
+ continue
+ }
+ castName := g.name(NameTypeFunc, castPrefix+name, nil)
+ f.Func().Id(castName).Params(Id("o").Any()).Op("*").Id(name).Block(
+ If(Id("o").Op(",").Id("ok").Op(":=").Id("o").Op(".").Params(Id(interfacePrefix+name)).Op(";").Id("ok").Block(
+ Return().Id("o").Op(".").Id(viewPrefix+name).Params(),
+ )),
+ Return().Nil(),
+ )
+ }
+
+ castFuncName := g.name(NameTypeFunc, upperFirst(castPrefix), nil)
+ // append a singular cast function
+ f.Func().Id(castFuncName).Index(Id("T").Id("any")).Params(Id("value").Id("any")).Op("*").Id("T").BlockFunc(func(f *Group) {
+ f.Var().Id("t").Id("T")
+ f.Switch(Any().Params(Id("t")).Op(".").Params(Type())).BlockFunc(func(f *Group) {
+ for _, name := range keys(g.nameToIRI) {
+ iri := g.nameToIRI[name]
+ if g.isEnum(iri) {
+ continue
+ }
+ castName := g.name(NameTypeFunc, castPrefix+name, nil)
+ f.Case(Id(name)).Block(
+ If(Id("v").Op(",").Id("ok").Op(":=").Any().Params(Id(castName).Params(Id("value"))).Op(".").Params(Op("*").Id("T")).Op(";").Id("ok")).Block(
+ Return(Id("v")),
+ ),
+ )
+ }
+ })
+ f.Panic(Lit("invalid type cast, unknown type: ").Op("+").Qual("reflect", "TypeOf").Params(Id("t")).Op(".").Id("String").Params())
+ })
+
+ // append "As" function
+ f.Func().Id("As").Index(Id("T").Any().Op(",").Id("R").Any()).Params(Id("value").Any(), Id("fn").Func().Params(Id("v").Op("*").Id("T")).Id("R")).Id("R").Block(
+ Id("v").Op(":=").Id(castFuncName).Index(Id("T")).Params(Id("value")),
+ If(Id("v").Op("!=").Nil().Block(
+ Return(Id("fn").Params(Id("v"))),
+ )),
+ Var().Id("r").Id("R"),
+ Return(Id("r")),
+ )
+}
+
+func (g *generator) interfaceName(iri string) string {
+ return interfacePrefix + g.className(iri)
+}
+
+func (g *generator) isSubtypeOf(parent *Class, typ *Class) bool {
+ if typ.ParentIRI != "" {
+ if typ.ParentIRI == parent.IRI {
+ return true
+ }
+ next := g.iriToType[typ.ParentIRI]
+ return g.isSubtypeOf(parent, next)
+ }
+ return false
+}
+
+func (g *generator) appendNamedIndividualsForType(f *File, typeIRI string) {
+ for _, ni := range g.namedIndividuals[typeIRI] {
+ varName := g.namedIndividualName(ni)
+ if ni.Comment != "" {
+ f.Comment(prefixWith(ni.Comment, varName))
+ }
+ if g.useEnums && g.isEnum(typeIRI) {
+ c := g.iriToType[typeIRI]
+ typeName := g.className(typeIRI)
+ f.Var().Id(varName).Op("=").Id(typeName).Block(
+ g.setId(c, ni.IRI),
+ )
+ } else if g.flatStruct {
+ c := g.iriToType[typeIRI]
+ f.Var().Id(varName).Id(g.interfaceName(typeIRI)).Op("=").Op("&").Id(c.GoName).Block(
+ Id(g.idField).Op(":").Lit(ni.IRI).Op(","),
+ )
+ } else {
+ f.Var().Id(varName).Id(g.interfaceName(typeIRI)).Op("=").Op("&").Id(externalIriName).Block(
+ Id(unexport(g.idField)).Op(":").Lit(ni.IRI).Op(","),
+ )
+ }
+ }
+}
+
+func (g *generator) setId(c *Class, iri string) Code {
+ if c.ParentIRI != "" {
+ parent := g.iriToType[c.ParentIRI]
+ typeName := g.className(parent.IRI)
+ return Id(typeName).Op(":").Id(typeName).Block(
+ g.setId(parent, iri),
+ ).Op(",")
+ }
+ if g.isEnum(c.IRI) {
+ return Id(unexport(g.idField)).Op(":").Lit(iri).Op(",")
+ }
+ return Id(g.idField).Op(":").Lit(iri).Op(",")
+}
+
+func (g *generator) appendCustomTypes(f *File) {
+ for _, typ := range keys(g.customTypes) {
+ pkg := reflect.TypeOf(ld.URI("")).PkgPath()
+ f.Type().Id(g.customTypes[typ]).Op("=").Qual(pkg, typ)
+ }
+}
+
+func (g *generator) appendContextRegistration(f *File) {
+ contextCreateName := g.name(NameTypeFunc, "context", nil)
+ f.Func().Id(contextCreateName).Params().Qual(ldImport, "Context").BlockFunc(func(f *Group) {
+ val := Return().Qual(ldImport, "NewContext").Params()
+ for contextURI, contextJSON := range g.contexts {
+ params := []Code{
+ Lit(contextURI),
+ getMap(contextJSON),
+ Line().Id(g.externalIRIName()),
+ }
+ for _, name := range keys(g.nameToIRI) {
+ iri := g.nameToIRI[name]
+ c := g.iriToType[iri]
+ if g.flatStruct && c.Abstract {
+ continue
+ }
+ params = append(params, Line().Id(c.GoName).Block())
+ for _, ni := range g.namedIndividuals[iri] {
+ params = append(params, Line().Id(g.namedIndividualName(ni)))
+ }
+ }
+ params = append(params, Line())
+ val.Dot("Register").Params(params...)
+ }
+ f.Add(val)
+ })
+}
+
+func (g *generator) name(typ NameType, name string, c *Class) string {
+ renamed := g.renameFunc(typ, name, c)
+ if renamed != "" {
+ return renamed
+ }
+ return name
+}
+
+func (g *generator) namedIndividualName(ni *Individual) string {
+ label := cleanText(ni.Label)
+ if label == "" {
+ parts := strings.Split(ni.IRI, "/")
+ label = parts[len(parts)-1]
+ }
+ label = g.name(NameTypeField, label, g.iriToType[ni.TypeIRI])
+ typeName := g.className(ni.TypeIRI)
+ return typeName + "_" + upperFirst(label)
+}
+
+func (g *generator) externalIRIName() string {
+ structName := g.name(NameTypeType, externalIriName, nil)
+ funcName := g.name(NameTypeFunc, "New"+structName, nil)
+ funcName = upperFirst(funcName)
+ return funcName
+}
+
+func (g *generator) appendGetID(f *File, name string, c *Class) {
+ idField := g.idField
+ if g.isEnum(c.IRI) {
+ idField = unexport(idField)
+ }
+ f.Func().Params(Id("o").Op("*").Id(name)).Id(getterPrefix + g.idField).Params().Id("string").Block(
+ Return(Id("o").Dot(idField)),
+ )
+}
+
+func getMap(contextJSON map[string]any) Code {
+ values := Dict{}
+ for k, v := range contextJSON {
+ switch v := v.(type) {
+ case map[string]any:
+ values[Lit(k)] = getMap(v)
+ case []any:
+ panic("unsupported list in context")
+ default:
+ values[Lit(k)] = Lit(v)
+ }
+ }
+ return Map(String()).Any().Values(values)
+}
+
+func upperFirst(part string) string {
+ return strings.ToUpper(part[:1]) + part[1:]
+}
+
+func unexport(part string) string {
+ return strings.ToLower(part)
+}
+
+func fixWhitespace(s string) string {
+ s = strings.ReplaceAll(s, "\\n", "\n")
+ s = whitespace.ReplaceAllString(s, " ")
+ return strings.TrimSpace(s)
+}
+
+func prefixWith(text string, prefix string) string {
+ prefix = strings.TrimSpace(prefix) + " "
+ if !strings.HasPrefix(text, prefix) {
+ text = prefix + text
+ }
+ return text
+}
+
+var (
+ whitespace = regexp.MustCompile(`\s+`)
+ requireMultipleSegments = os.Getenv("REQUIRE_MULTIPLE_SEGMENTS") == "true"
+ interfacePrefix = "Any"
+ listSuffix = "List"
+ viewPrefix = "as"
+ castPrefix = "cast"
+ ldImport = reflect.TypeOf(ld.Type{}).PkgPath()
+ externalIriName = "ExternalIRI"
+ getterPrefix = "Get"
+ setterPrefix = "Set"
+)
diff --git a/spdx/v3/internal/ld/shaclgen/reader.go b/spdx/v3/internal/ld/shaclgen/reader.go
new file mode 100644
index 00000000..53ee0454
--- /dev/null
+++ b/spdx/v3/internal/ld/shaclgen/reader.go
@@ -0,0 +1,229 @@
+package shaclgen
+
+import (
+ "bytes"
+ "slices"
+ "strconv"
+ "strings"
+
+ "github.com/deiu/rdf2go"
+)
+
+func ParseSHACLFromUrl(url string) (map[string]*Class, []*Individual) {
+ ttl := fetch(url)
+ return ParseSHACL(url, ttl)
+}
+
+func ParseSHACL(url string, ttl []byte) (map[string]*Class, []*Individual) {
+ g := rdf2go.NewGraph(url)
+ must(g.Parse(bytes.NewReader(ttl), "text/turtle"))
+
+ iriToClass := map[string]*Class{}
+ individuals := []*Individual{}
+
+ var allUsedProps []*rdf2go.Triple
+ used := func(triples ...*rdf2go.Triple) []*rdf2go.Triple {
+ allUsedProps = append(allUsedProps, triples...)
+ return triples
+ }
+
+ classes := used(g.All(nil, rdfType, owlClass)...)
+ for _, class := range sorted(classes, bySubject) {
+ log("Class", class)
+
+ out := &Class{
+ IRI: cleanIRI(class.Subject.String()),
+ Comment: getComment(used, g, class.Subject),
+ Kind: getNodeKind(used, g, class.Subject),
+ }
+ if _, ok := iriToClass[out.IRI]; ok {
+ panic("duplicate type definition: " + out.IRI)
+ }
+ iriToClass[out.IRI] = out
+
+ superclass := oneOptional(used, g.All(class.Subject, rdfSubclassOf, nil))
+ if superclass != nil {
+ out.ParentIRI = cleanIRI(superclass.Object.String())
+ log(" extends: ", out.ParentIRI)
+ }
+
+ properties := used(g.All(class.Subject, shaclProperty, nil)...)
+
+ for _, property := range sorted(properties, byObject) {
+ path := oneRequired(used, g.All(property.Object, shaclPath, nil))
+ used(path)
+ log(" property:", class.Subject.String(), "path", path.Object.String())
+
+ if path.Object.Equal(rdfType) {
+ log("marking class %v as abstract due to path requirement:", out.GoName, path)
+ out.Abstract = true
+ continue
+ }
+
+ prop := &Property{
+ IRI: cleanIRI(path.Object.String()),
+ Comment: getComment(used, g, path.Object),
+ }
+ out.Properties = append(out.Properties, prop)
+
+ // get the data type
+ typeIRI := oneOptional(used, g.All(property.Object, shaclClass, nil))
+ if typeIRI == nil {
+ typeIRI = oneOptional(used, g.All(property.Object, shaclDatatype, nil))
+ }
+ if typeIRI != nil {
+ prop.TypeIRI = cleanIRI(typeIRI.Object.String())
+ } else {
+ panic("No type IRI for: " + property.Object.String())
+ }
+
+ minCount := oneOptional(used, g.All(property.Object, shaclMinCount, nil))
+ used(minCount)
+ if minCount != nil {
+ prop.MinCount = parseIntegerValue(minCount)
+ }
+
+ maxCount := oneOptional(used, g.All(property.Object, shaclMaxCount, nil))
+ if maxCount != nil {
+ prop.MaxCount = parseIntegerValue(maxCount)
+ } else {
+ prop.MaxCount = -1 // how is * represented?
+ }
+
+ allowedValues := oneOptional(used, g.All(property.Object, shaclIn, nil))
+ var usedPropertyNodes []*rdf2go.Triple
+ for allowedValues != nil {
+ usedPropertyNodes = append(usedPropertyNodes, allowedValues)
+ validation := oneOptional(used, g.All(allowedValues.Object, rdfFirst, nil))
+ if validation != nil {
+ used(validation)
+ log(" validation:", nodeDisplay(validation))
+ prop.Validations = append(prop.Validations, AllowedIRIValidation(validation.Object.String()))
+ }
+ allowedValues = oneOptional(used, g.All(allowedValues.Object, rdfRest, nil))
+ }
+
+ pattern := oneOptional(used, g.All(property.Object, shaclPattern, nil))
+ if pattern != nil {
+ prop.Validations = append(prop.Validations, MatchPatternValidation(cleanText(pattern.Object.String())))
+ }
+
+ //allProps := g.All(property.Object, nil, nil)
+ //for _, p := range sorted(allProps, byObject) {
+ // if slices.Contains(append(usedPropertyNodes, path, property), p) {
+ // continue
+ // }
+ // log(" ... extra prop prop:", p)
+ //}
+ }
+
+ //allprops := g.All(class.Subject, nil, nil)
+ //for _, p := range sorted(allprops, byObject) {
+ // if slices.Contains(allUsedProps, p) {
+ // continue
+ // }
+ // log(" ... unused class prop:", p)
+ //}
+
+ }
+
+ // read all the named individuals
+ namedIndividuals := used(g.All(nil, rdfType, owlNamedIndividual)...)
+ for _, namedIndividual := range sorted(namedIndividuals, bySubject) {
+ entries := used(g.All(namedIndividual.Subject, rdfType, nil)...)
+ for _, entry := range entries {
+ if entry == namedIndividual {
+ continue
+ }
+ typeIRI := cleanIRI(entry.Object.String())
+ if c := iriToClass[typeIRI]; c != nil {
+ label := ""
+ if l := oneOptional(used, g.All(namedIndividual.Subject, rdfLabel, nil)); l != nil {
+ label = cleanText(l.Object.String())
+ }
+ ni := Individual{
+ IRI: cleanIRI(namedIndividual.Subject.String()),
+ Label: label,
+ Comment: getComment(used, g, namedIndividual.Subject),
+ TypeIRI: typeIRI,
+ }
+ individuals = append(individuals, &ni)
+ }
+ }
+ }
+
+ log("------------------- UNUSED PROPS -------------------")
+ for p := range g.IterTriples() {
+ if slices.Contains(allUsedProps, p) {
+ continue
+ }
+ log(" ... unused triple:", p)
+ }
+
+ return iriToClass, individuals
+}
+
+func getNodeKind(used usedFunc, g *rdf2go.Graph, subject rdf2go.Term) string {
+ propNodeKind := oneOptional(used, g.All(subject, shaclNodeKind, nil))
+ if propNodeKind != nil {
+ return cleanIRI(propNodeKind.Object.RawValue())
+ }
+ return ""
+}
+
+func getComment(used usedFunc, g *rdf2go.Graph, subject rdf2go.Term) string {
+ allComments := g.All(subject, rdfComment, nil)
+ var comment *rdf2go.Triple
+ for _, c := range allComments {
+ value := c.Object.String()
+ comment = c
+ if strings.HasSuffix(value, "@en") {
+ // use English comment
+ break
+ }
+ }
+ if comment != nil {
+ used(comment)
+ value := comment.Object.String()
+ parts := strings.Split(value, "@")
+ value = strings.Join(parts[:len(parts)-1], "@")
+ return strings.TrimSpace(strings.Trim(value, "\""))
+ }
+ return ""
+}
+
+func parseIntegerValue(count *rdf2go.Triple) int {
+ if count == nil {
+ return 0
+ }
+ val := count.Object.String()
+ val = strings.Split(val, "^")[0]
+ val = strings.Trim(val, "\"")
+ return get(strconv.Atoi(val))
+}
+
+var (
+ rdfType = rdf2go.NewResource("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")
+ rdfFirst = rdf2go.NewResource("http://www.w3.org/1999/02/22-rdf-syntax-ns#first")
+ rdfRest = rdf2go.NewResource("http://www.w3.org/1999/02/22-rdf-syntax-ns#rest")
+ rdfSubclassOf = rdf2go.NewResource("http://www.w3.org/2000/01/rdf-schema#subClassOf")
+ rdfComment = rdf2go.NewResource("http://www.w3.org/2000/01/rdf-schema#comment")
+ rdfLabel = rdf2go.NewResource("http://www.w3.org/2000/01/rdf-schema#label")
+ //rdfSchemaRange = rdf2go.NewResource("http://www.w3.org/2000/01/rdf-schema#range")
+ owlClass = rdf2go.NewResource("http://www.w3.org/2002/07/owl#Class")
+ owlNamedIndividual = rdf2go.NewResource("http://www.w3.org/2002/07/owl#NamedIndividual")
+ //owlObjectProperty = rdf2go.NewResource("http://www.w3.org/2002/07/owl#ObjectProperty")
+ //owlDatatypeProperty = rdf2go.NewResource("http://www.w3.org/2002/07/owl#DatatypeProperty")
+ //shaclNodeShape = rdf2go.NewResource("http://www.w3.org/ns/shacl#NodeShape")
+ //shaclIRI = rdf2go.NewResource("http://www.w3.org/ns/shacl#IRI")
+ //shaclBlankNodeOrIRI = rdf2go.NewResource("http://www.w3.org/ns/shacl#BlankNodeOrIRI")
+ shaclNodeKind = rdf2go.NewResource("http://www.w3.org/ns/shacl#nodeKind")
+ shaclProperty = rdf2go.NewResource("http://www.w3.org/ns/shacl#property")
+ shaclClass = rdf2go.NewResource("http://www.w3.org/ns/shacl#class")
+ shaclPath = rdf2go.NewResource("http://www.w3.org/ns/shacl#path")
+ shaclDatatype = rdf2go.NewResource("http://www.w3.org/ns/shacl#datatype")
+ shaclIn = rdf2go.NewResource("http://www.w3.org/ns/shacl#in")
+ shaclMinCount = rdf2go.NewResource("http://www.w3.org/ns/shacl#minCount")
+ shaclMaxCount = rdf2go.NewResource("http://www.w3.org/ns/shacl#maxCount")
+ shaclPattern = rdf2go.NewResource("http://www.w3.org/ns/shacl#pattern")
+)
diff --git a/spdx/v3/internal/ld/shaclgen/types.go b/spdx/v3/internal/ld/shaclgen/types.go
new file mode 100644
index 00000000..508a8d96
--- /dev/null
+++ b/spdx/v3/internal/ld/shaclgen/types.go
@@ -0,0 +1,32 @@
+package shaclgen
+
+type Individual struct {
+ IRI string
+ TypeIRI string
+ Label string
+ Comment string
+}
+
+type Class struct {
+ IRI string
+ Abstract bool
+ GoName string
+ Kind string
+ Comment string
+ ParentIRI string
+ Properties []*Property
+}
+
+type Property struct {
+ IRI string
+ GoName string
+ Comment string
+ TypeIRI string
+ MinCount int
+ MaxCount int
+ Validations []any
+}
+
+type AllowedIRIValidation string
+
+type MatchPatternValidation string
diff --git a/spdx/v3/internal/ld/shaclgen/util.go b/spdx/v3/internal/ld/shaclgen/util.go
new file mode 100644
index 00000000..15dea86a
--- /dev/null
+++ b/spdx/v3/internal/ld/shaclgen/util.go
@@ -0,0 +1,129 @@
+package shaclgen
+
+import (
+ "cmp"
+ "fmt"
+ "io"
+ "maps"
+ "net/http"
+ "os"
+ "slices"
+ "strings"
+
+ "github.com/deiu/rdf2go"
+)
+
+type usedFunc func(...*rdf2go.Triple) []*rdf2go.Triple
+
+func oneOptional(used usedFunc, all []*rdf2go.Triple) *rdf2go.Triple {
+ if len(all) > 1 {
+ panic(fmt.Errorf("too many results for: %#v", all))
+ }
+ if len(all) > 0 {
+ used(all[0])
+ return all[0]
+ }
+ return nil
+}
+
+func oneRequired(used usedFunc, all []*rdf2go.Triple) *rdf2go.Triple {
+ if len(all) != 1 {
+ panic(fmt.Errorf("required exactly 1 result for: %#v", all))
+ }
+ used(all[0])
+ return all[0]
+}
+
+func cleanIRI(iri string) string {
+ return strings.Trim(iri, "<>")
+}
+
+func cleanText(iri string) string {
+ return strings.Trim(iri, "\"")
+}
+
+var logEnabled = false
+
+func log(msg ...any) {
+ if !logEnabled {
+ return
+ }
+ for _, m := range msg {
+ switch m := m.(type) {
+ case *rdf2go.Triple:
+ _, _ = fmt.Fprint(os.Stderr, nodeDisplay(m))
+ default:
+ _, _ = fmt.Fprint(os.Stderr, m)
+ }
+ _, _ = fmt.Fprint(os.Stderr, " ")
+ }
+ _, _ = fmt.Fprintln(os.Stderr)
+}
+
+func nodeDisplay(triple *rdf2go.Triple) string {
+ return join("Subject: ", triple.Subject.String(), ", Predicate: ", triple.Predicate.String(), ", Object: ", triple.Object.String())
+}
+
+func join(parts ...string) string {
+ return strings.Join(parts, "")
+}
+
+func bySubject(t *rdf2go.Triple) string {
+ return t.Subject.String()
+}
+
+func byObject(t *rdf2go.Triple) string {
+ return t.Object.String()
+}
+
+func sorted(values []*rdf2go.Triple, by func(triple *rdf2go.Triple) string) []*rdf2go.Triple {
+ slices.SortFunc(values, func(a, b *rdf2go.Triple) int {
+ if a == nil && b == nil {
+ return 0
+ }
+ if a == nil {
+ return 1
+ }
+ if b == nil {
+ return -1
+ }
+ return strings.Compare(by(a), by(b))
+ })
+ return values
+}
+
+func fetch(definitions string) []byte {
+ spdxTTLRes := get(http.Get(definitions))
+ defer func(Body io.ReadCloser) {
+ err := Body.Close()
+ if err != nil {
+ _, _ = os.Stderr.Write([]byte(fmt.Sprint(err)))
+ }
+ }(spdxTTLRes.Body)
+ return get(io.ReadAll(spdxTTLRes.Body))
+}
+
+func get[T any](t T, err error) T {
+ must(err)
+ return t
+}
+
+func must(err error) {
+ if err != nil {
+ panic(err)
+ }
+}
+
+func in[K comparable, V any](values map[K]V, value K) bool {
+ _, ok := values[value]
+ return ok
+}
+
+func keys[K cmp.Ordered, V any](values map[K]V) []K {
+ out := make([]K, 0, len(values))
+ for v := range maps.Keys(values) {
+ out = append(out, v)
+ }
+ slices.Sort(out)
+ return out
+}
diff --git a/spdx/v3/internal/ld/shaclgen/validations.go b/spdx/v3/internal/ld/shaclgen/validations.go
new file mode 100644
index 00000000..b21b570a
--- /dev/null
+++ b/spdx/v3/internal/ld/shaclgen/validations.go
@@ -0,0 +1,99 @@
+package shaclgen
+
+import (
+ "reflect"
+ "slices"
+ "strings"
+ "time"
+
+ . "github.com/dave/jennifer/jen"
+
+ "github.com/spdx/tools-golang/spdx/v3/internal/ld"
+)
+
+func (g *generator) appendValidations(f *File) {
+ for _, name := range keys(g.nameToIRI) {
+ iri := g.nameToIRI[name]
+ c := g.iriToType[iri]
+
+ if g.flatStruct && c.Abstract {
+ continue
+ }
+
+ validationFunc := Func().Params(Id("o").Op("*").Id(g.className(iri))).Id("Validate").Params().Id("error").Block(
+ Return(Qual(ldImport, "JoinErrors").ParamsFunc(func(f *Group) {
+ g.appendValidationFuncs(f, c)
+ })),
+ )
+ f.Add(validationFunc)
+ }
+}
+
+func (g *generator) appendValidationFuncs(f *Group, c *Class) {
+ if c.ParentIRI != "" {
+ if g.flatStruct {
+ g.appendValidationFuncs(f, g.iriToType[c.ParentIRI])
+ } else {
+ f.Line().Qual(ldImport, "ValidateProperty").Params(Id("o"), Op("&").Id("o").Dot(g.className(c.ParentIRI)))
+ }
+ }
+ for _, p := range c.Properties {
+ fieldType := g.fieldType(c, p)
+
+ validatePropParams := []Code{Id("o"), Op("&").Id("o").Dot(g.propName(c, p))}
+
+ // some validations are unnecessary such as time.Time, since we store a time representation instead of arbitrary string
+ skipTypeValidations := slices.Contains(validatingTypes, ld.TypeForIRI(p.TypeIRI))
+ if g.isList(c, p) && p.MinCount > 0 {
+ validatePropParams = append(validatePropParams, Line().Qual(ldImport, "ValidateMinCount").Index(fieldType).Params(Lit(p.MinCount)))
+ }
+
+ if g.isList(c, p) && p.MaxCount > 1 {
+ validatePropParams = append(validatePropParams, Line().Qual(ldImport, "ValidateMaxCount").Index(fieldType).Params(Lit(p.MaxCount)))
+ }
+
+ var allowedIRIs []string
+ for _, validation := range p.Validations {
+ switch v := validation.(type) {
+ case AllowedIRIValidation:
+ allowedIRIs = append(allowedIRIs, string(v))
+ case MatchPatternValidation:
+ if skipTypeValidations {
+ continue
+ }
+ expr := strings.ReplaceAll(string(v), "\\\\", "\\")
+ validatePropParams = append(validatePropParams, Line().Qual(ldImport, "ValidateExpression").Params(Lit(expr)))
+ }
+ }
+
+ if len(allowedIRIs) > 0 {
+ var validateValuesParams []Code
+ for _, allowedIRI := range allowedIRIs {
+ validateValuesParams = append(validateValuesParams, Line().Id(g.namedIndividualName(&Individual{
+ IRI: cleanIRI(allowedIRI),
+ TypeIRI: p.TypeIRI,
+ })))
+ }
+ idCheck := Qual(ldImport, "ValidateIRI").Params(append(validateValuesParams, Line())...)
+ if g.isList(c, p) {
+ idCheck = Qual(ldImport, "ValidateAll").Params(idCheck)
+ }
+ validatePropParams = append(validatePropParams, Line().Add(idCheck))
+ }
+
+ // first 2 params are initialized as object, property --
+ // only append a property validation if we added any validations or if the property is required
+ if len(validatePropParams) > 2 || p.MinCount > 0 {
+ f.Line().Qual(ldImport, "ValidateProperty").Params(validatePropParams...)
+ }
+ }
+}
+
+// these types do not need further pattern validation or otherwise implement their own Validate function
+var validatingTypes = []reflect.Type{
+ reflect.TypeOf(ld.URI("")),
+ reflect.TypeOf(time.Time{}),
+ reflect.TypeOf(ld.DateTime{}),
+ reflect.TypeOf(ld.PositiveInt(0)),
+ reflect.TypeOf(ld.NonNegativeInt(0)),
+}
diff --git a/spdx/v3/internal/ld/struct_reader.go b/spdx/v3/internal/ld/struct_reader.go
new file mode 100644
index 00000000..10de45ea
--- /dev/null
+++ b/spdx/v3/internal/ld/struct_reader.go
@@ -0,0 +1,127 @@
+package ld
+
+import (
+ "fmt"
+ "reflect"
+ "sync"
+)
+
+type reader[T any] func(reflect.Value) (T, error)
+
+var idReaders = map[reflect.Type]reader[string]{}
+var idReaderLock = sync.RWMutex{}
+
+func idReader(t reflect.Type) (reader[string], error) {
+ var err error
+ idReaderLock.RLock()
+ r := idReaders[t]
+ idReaderLock.RUnlock()
+ if r != nil {
+ return r, nil
+ }
+ idReaderLock.Lock()
+ r = idReaders[t]
+ if r != nil {
+ idReaderLock.Unlock()
+ return r, nil
+ }
+ switch t.Kind() {
+ case reflect.String:
+ r = func(value reflect.Value) (string, error) {
+ return value.String(), nil
+ }
+ case reflect.Struct:
+ r, err = structIdFunc(t)
+ case reflect.Map:
+ // only map[string] supported
+ if t.Key().Kind() != reflect.String {
+ return nil, fmt.Errorf("unsupported map key type: %v", stringify(t.Key()))
+ }
+ r = func(value reflect.Value) (string, error) {
+ v := value.MapIndex(reflect.ValueOf(JsonIdProp))
+ if v.IsValid() && v.Type().Kind() == reflect.String {
+ return v.String(), nil
+ }
+ return "", fmt.Errorf("unable to find @id")
+ }
+ default:
+ err = fmt.Errorf("unable to create ID reader, unsupported type: %v", stringify(t))
+ }
+ idReaders[t] = r
+ idReaderLock.Unlock()
+ return r, err
+}
+
+func structIdFunc(t reflect.Type) (reader[string], error) {
+ for i := 0; i < t.NumField(); i++ {
+ f := t.Field(i)
+ if f.Anonymous && hasIDField(f.Type) {
+ getter, err := structIdFunc(f.Type)
+ if err != nil {
+ return nil, fmt.Errorf("field: %v :%w", f.Name, err)
+ }
+ return func(value reflect.Value) (string, error) {
+ v := value.Field(i)
+ return getter(v)
+ }, nil
+ }
+ if f.Tag.Get(GoIriTagName) == JsonIdProp {
+ if f.Type.Kind() != reflect.String {
+ return nil, fmt.Errorf("invalid @id type for field: %v in %v", f.Name, stringify(t))
+ }
+ return func(value reflect.Value) (string, error) {
+ return value.Field(i).String(), nil
+ }, nil
+ }
+ }
+ // this struct type does not have an id
+ return nil, fmt.Errorf("unable to find ID field in %v", stringify(t))
+}
+
+func hasIDField(t reflect.Type) bool {
+ if t.Kind() != reflect.Struct {
+ return false
+ }
+ for i := 0; i < t.NumField(); i++ {
+ f := t.Field(i)
+ if f.Tag.Get(GoIriTagName) == JsonIdProp {
+ return true
+ }
+ if f.Anonymous {
+ if hasIDField(f.Type) {
+ return true
+ }
+ }
+ }
+ return false
+}
+
+func getID(v reflect.Value) (string, error) {
+ if !v.IsValid() {
+ return "", fmt.Errorf("invalid value")
+ }
+ switch v.Type().Kind() {
+ case reflect.String:
+ return v.String(), nil
+ case reflect.Pointer:
+ return getID(v.Elem())
+ case reflect.Struct, reflect.Map:
+ r, err := idReader(v.Type())
+ if err != nil {
+ return "", err
+ }
+ return r(v)
+ default:
+ return "", fmt.Errorf("unsupported type: %v", stringify(v.Type()))
+ }
+}
+
+func GetID(v any) (string, error) {
+ if v == nil {
+ return "", fmt.Errorf("value is nil")
+ }
+ if v, ok := v.(reflect.Value); ok {
+ return getID(v)
+ }
+ return getID(reflect.ValueOf(v))
+}
diff --git a/spdx/v3/internal/ld/struct_reader_test.go b/spdx/v3/internal/ld/struct_reader_test.go
new file mode 100644
index 00000000..41094aeb
--- /dev/null
+++ b/spdx/v3/internal/ld/struct_reader_test.go
@@ -0,0 +1,157 @@
+package ld
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/require"
+)
+
+func Test_getId(t *testing.T) {
+ tests := []struct {
+ name string
+ instance func() any
+ expected string
+ wantErr require.ErrorAssertionFunc
+ }{
+ {
+ name: "no id string",
+ instance: func() any {
+ return ""
+ },
+ expected: "",
+ },
+ {
+ name: "an id string",
+ instance: func() any {
+ return "an-id"
+ },
+ expected: "an-id",
+ },
+ {
+ name: "no id struct",
+ instance: func() any {
+ type ty struct {
+ id string `iri:"not_id"`
+ }
+ return ty{
+ id: "a-val",
+ }
+ },
+ expected: "",
+ wantErr: require.Error,
+ },
+ {
+ name: "direct id struct",
+ instance: func() any {
+ type ty struct {
+ id string `iri:"@id"`
+ }
+ return ty{
+ id: "a-val",
+ }
+ },
+ expected: "a-val",
+ },
+ {
+ name: "exported single embedded id struct",
+ instance: func() any {
+ type Ty struct {
+ Id string `iri:"@id"`
+ }
+ type ta struct {
+ Ty
+ }
+ return ta{
+ Ty: Ty{
+ Id: "ta-val",
+ },
+ }
+ },
+ expected: "ta-val",
+ },
+ {
+ name: "unexported embedded id struct",
+ instance: func() any {
+ type ty struct {
+ id string `iri:"@id"`
+ }
+ type tb struct {
+ ty
+ }
+ return tb{
+ ty: ty{
+ id: "tb-val",
+ },
+ }
+ },
+ expected: "tb-val",
+ },
+ {
+ name: "multiple embedded id struct",
+ instance: func() any {
+ type Ta struct {
+ Name string `iri:"not_id"`
+ }
+ type Tb struct {
+ ID string `iri:"@id"`
+ }
+ type Ty struct {
+ Ta
+ Tb
+ }
+ return Ty{
+ Ta: Ta{
+ Name: "no-id",
+ },
+ Tb: Tb{
+ ID: "tb-val",
+ },
+ }
+ },
+ expected: "tb-val",
+ },
+ {
+ name: "recursive embedded id struct",
+ instance: func() any {
+ type Ty struct {
+ ID string `iri:"@id"`
+ }
+ type Tb struct {
+ Ty
+ }
+ type Tc struct {
+ Tb
+ }
+ return Tc{
+ Tb: Tb{
+ Ty: Ty{
+ ID: "tc-val",
+ },
+ },
+ }
+ },
+ expected: "tc-val",
+ },
+ {
+ name: "invalid data type returns error",
+ instance: func() any {
+ return 1
+ },
+ expected: "",
+ wantErr: require.Error,
+ },
+ }
+ for _, test := range tests {
+ t.Run(test.name, func(t *testing.T) {
+ t.Parallel() // this function must be safe to call in parallel
+ v := test.instance()
+ got, err := GetID(v)
+ wantErr := test.wantErr
+ if wantErr == nil {
+ wantErr = require.NoError
+ }
+ wantErr(t, err)
+ require.Equal(t, test.expected, got)
+ })
+ }
+}
diff --git a/spdx/v3/internal/ld/type_iter.go b/spdx/v3/internal/ld/type_iter.go
new file mode 100644
index 00000000..1e73e165
--- /dev/null
+++ b/spdx/v3/internal/ld/type_iter.go
@@ -0,0 +1,39 @@
+package ld
+
+import "iter"
+
+func SliceOf[To, From any, List ~[]From](values List) []To {
+ var out []To
+ for _, v := range values {
+ if cast, ok := any(v).(To); ok {
+ out = append(out, cast)
+ }
+ }
+ return out
+}
+
+type TypeSeq[Element, View any] iter.Seq2[Element, View]
+
+func (s TypeSeq[Element, View]) Len() int {
+ cnt := 0
+ for range s {
+ cnt++
+ }
+ return cnt
+}
+
+func NewTypeSeq[T any, E any](values []E, cast func(any) *T) TypeSeq[E, *T] {
+ if values == nil {
+ return func(yield func(E, *T) bool) {}
+ }
+ return func(yield func(E, *T) bool) {
+ for _, value := range values {
+ v := cast(value)
+ if v != nil {
+ if !yield(value, v) {
+ return
+ }
+ }
+ }
+ }
+}
diff --git a/spdx/v3/internal/ld/util.go b/spdx/v3/internal/ld/util.go
new file mode 100644
index 00000000..3bae1488
--- /dev/null
+++ b/spdx/v3/internal/ld/util.go
@@ -0,0 +1,175 @@
+package ld
+
+import (
+ "cmp"
+ "os"
+ "path"
+ "reflect"
+ "slices"
+ "strings"
+)
+
+var (
+ debug = os.Getenv("GO_LD_DEBUG") == "true"
+ emptyValue reflect.Value
+ anyType = reflect.TypeOf((*any)(nil)).Elem()
+)
+
+// baseType returns the base type if this is a pointer or interface
+func baseType(t reflect.Type) reflect.Type {
+ switch t.Kind() {
+ case reflect.Pointer:
+ return baseType(t.Elem())
+ default:
+ return t
+ }
+}
+
+func isFunc(o any) bool {
+ return reflect.TypeOf(o).Kind() == reflect.Func
+}
+
+// isBlankNodeID indicates this is a blank node ID, e.g. _:CreationInfo-1
+func isBlankNodeID(id string) bool {
+ return strings.HasPrefix(id, "_:")
+}
+
+func typeName(t reflect.Type) string {
+ switch {
+ case isPointer(t):
+ return "*" + typeName(t.Elem())
+ case isSlice(t):
+ return "[]" + typeName(t.Elem())
+ case isMap(t):
+ return "map[" + typeName(t.Key()) + "]" + typeName(t.Elem())
+ case isPrimitive(t):
+ return t.Name()
+ }
+ return path.Base(t.PkgPath()) + "." + t.Name()
+}
+
+func isSlice(t reflect.Type) bool {
+ return t.Kind() == reflect.Slice
+}
+
+func isMap(t reflect.Type) bool {
+ return t.Kind() == reflect.Map
+}
+
+func isPointer(t reflect.Type) bool {
+ return t.Kind() == reflect.Pointer
+}
+
+func isPrimitive(t reflect.Type) bool {
+ switch t.Kind() {
+ case reflect.String,
+ reflect.Int,
+ reflect.Int8,
+ reflect.Int16,
+ reflect.Int32,
+ reflect.Int64,
+ reflect.Uint,
+ reflect.Uint8,
+ reflect.Uint16,
+ reflect.Uint32,
+ reflect.Uint64,
+ reflect.Float32,
+ reflect.Float64,
+ reflect.Bool:
+ return true
+ default:
+ return false
+ }
+}
+
+// FieldByType returns a field defined on type StructType matching the provided type, t
+func FieldByType[StructType any](t reflect.Type) (reflect.StructField, bool) {
+ var v StructType
+ typ := reflect.TypeOf(v)
+ for i := 0; i < t.NumField(); i++ {
+ f := t.Field(i)
+ if f.Type == typ {
+ return f, true
+ }
+ }
+ return reflect.StructField{}, false
+}
+
+// skipField indicates whether the field should be skipped
+func skipField(field reflect.StructField) bool {
+ return field.Type.Size() == 0
+}
+
+// merge returns a new map with all map values merged together
+func merge[K comparable, V any](maps ...map[K]V) map[K]V {
+ out := map[K]V{}
+ for _, m := range maps {
+ if m == nil {
+ continue
+ }
+ for k, v := range m {
+ if in1, ok := out[k]; ok {
+ // existing value, recursively merge nested maps
+ map1, ok1 := any(in1).(map[K]V)
+ map2, ok2 := any(v).(map[K]V)
+ if ok1 && ok2 {
+ out[k] = any(merge[K, V](map1, map2)).(V)
+ continue
+ }
+ panic("Context key already defined: " + stringify(k))
+ }
+ out[k] = v
+ }
+ }
+ return out
+}
+
+func firstKey[K cmp.Ordered, V any](m map[K]V) K {
+ return sortedKeys(m)[0]
+}
+
+func sortedKeys[K cmp.Ordered, V any](m map[K]V) []K {
+ out := make([]K, 0, len(m))
+ for k := range m {
+ out = append(out, k)
+ }
+ slices.Sort(out)
+ return out
+}
+
+func elemImplements[T any](v reflect.Value) bool {
+ switch v.Type().Kind() {
+ case reflect.Pointer, reflect.Interface:
+ e := v.Elem()
+ if !e.IsValid() {
+ return false
+ }
+ if !e.CanInterface() {
+ return false
+ }
+ _, ok := e.Interface().(T)
+ return ok
+ default:
+ return false
+ }
+}
+
+func trimCommonPrefixes(values []string) (prefix string, trimmed []string) {
+ out := values[:]
+ slices.Sort(out)
+ last := len(out) - 1
+ common := 0
+ for ; common < len(out[0]); common++ {
+ if out[0][common] != out[last][common] {
+ break
+ }
+ }
+ if common < 0 {
+ return "", values
+ }
+ prefix = values[0][:common]
+ for i := range out {
+ out[i] = out[i][common:]
+ }
+ return prefix, out
+}
diff --git a/spdx/v3/internal/ld/validation_error.go b/spdx/v3/internal/ld/validation_error.go
new file mode 100644
index 00000000..54e165a5
--- /dev/null
+++ b/spdx/v3/internal/ld/validation_error.go
@@ -0,0 +1,81 @@
+package ld
+
+import (
+ "errors"
+ "fmt"
+ "reflect"
+ "strconv"
+)
+
+// JoinErrors returns errors.Join'd errors, taking into account nested joined errors, flattening these to a single joined set
+func JoinErrors(errs ...error) error {
+ var out []error
+ for _, err := range errs {
+ out = append(out, flattenErrors(err)...)
+ }
+ switch len(out) {
+ case 0:
+ return nil
+ case 1:
+ return out[0]
+ default:
+ return errors.Join(out...)
+ }
+}
+
+func flattenErrors(err error) []error {
+ var out []error
+ if joined, ok := err.(interface{ Unwrap() []error }); ok {
+ for _, e := range joined.Unwrap() {
+ out = append(out, flattenErrors(e)...)
+ }
+ } else {
+ if err != nil {
+ return []error{err}
+ }
+ }
+ return out
+}
+
+var validatorInterface = reflect.TypeOf((*Validator)(nil)).Elem()
+
+type validationError struct {
+ Path []any
+ Err error
+}
+
+func (v *validationError) String() string {
+ path := ""
+ for i := 0; i < len(v.Path); i++ {
+ part := v.Path[i]
+ switch p := part.(type) {
+ case int:
+ path += "[" + strconv.Itoa(p) + "]"
+ case reflect.StructField:
+ if !p.Anonymous {
+ path += "." + p.Name
+ }
+ case reflect.Type:
+ path += "<" + p.Name() + ">"
+ default:
+ path += "/" + fmt.Sprint(p)
+ }
+ }
+ return path + ": " + v.Err.Error()
+}
+
+func (v *validationError) Error() string {
+ return v.String()
+}
+
+func newValidationError(err error, path ...any) *validationError {
+ // if the error is a validation error, prepend the path
+ if vErr, ok := err.(*validationError); ok {
+ vErr.Path = append(path, vErr.Path...)
+ return vErr
+ }
+ return &validationError{
+ Path: path,
+ Err: err,
+ }
+}
diff --git a/spdx/v3/internal/ld/validations.go b/spdx/v3/internal/ld/validations.go
new file mode 100644
index 00000000..c600eb82
--- /dev/null
+++ b/spdx/v3/internal/ld/validations.go
@@ -0,0 +1,155 @@
+package ld
+
+import (
+ "fmt"
+ "reflect"
+ "regexp"
+ "strings"
+)
+
+// Validator interface should be implemented by
+type Validator interface {
+ Validate() error
+}
+
+// ValidateGraph recursively calls all Validator(s) on all values in the graph and returns a joined error
+// of all the errors found
+func ValidateGraph(graph any) error {
+ var errs []error
+ err := VisitObjectGraph(graph, func(path []any, value reflect.Value) error {
+ // avoid double-validation, this will be called with both pointer and struct references
+ if elemImplements[Validator](value) {
+ return nil
+ }
+ if value.Type().Implements(validatorInterface) {
+ if validator, ok := value.Interface().(Validator); ok {
+ for _, err := range flattenErrors(validator.Validate()) {
+ errs = append(errs, newValidationError(err, append(path[:], baseType(value.Type()))...))
+ }
+ }
+ }
+ return nil
+ })
+ if err != nil {
+ return err
+ }
+ return JoinErrors(errs...)
+}
+
+// Validation functions are provided to ValidateProperty calls and will be executed if a property is set
+type Validation[T any] func(value T) error
+
+// ValidateProperty is used by generated code, typically, to validate a specific property against all defined validations
+// it might have such as whether it is required, matches a pattern, has enough elements, or is in a specific defined set.
+// This function needs to be called with a struct reference and a pointer to the property, e.g. ValidateProperty(obj, &obj.Prop, ...)
+// due to looking up field tags and names based on the property reference. This will panic if called any other way.
+func ValidateProperty[T any](object any, property *T, validations ...Validation[T]) error {
+ value := reflect.ValueOf(property)
+
+ // object is always a pointer to the base struct
+ o := reflect.ValueOf(object).Elem()
+ var f reflect.StructField
+ for i := 0; i < o.NumField(); i++ {
+ if o.Field(i).Addr() == value {
+ f = o.Type().Field(i)
+ break
+ }
+ }
+ if f.Name == "" {
+ panic(fmt.Sprintf("property: %v not found in object: %v", property, object))
+ }
+
+ var errs []error
+ if f.Anonymous { // inherited type validation
+ if validator, ok := any(property).(Validator); ok {
+ errs = flattenErrors(validator.Validate())
+ }
+ } else {
+ // value is pointer to field, which always points to a valid elem
+ if value.Elem().IsZero() {
+ if f.Tag.Get("required") == "true" {
+ return newValidationError(fmt.Errorf("required"), f)
+ }
+ return nil // don't process other validators, this is simply not set and not required
+ }
+ }
+
+ for _, validation := range validations {
+ err := validation(*property)
+ if err != nil {
+ errs = append(errs, newValidationError(err, f))
+ }
+ }
+ return JoinErrors(errs...)
+}
+
+// ValidateIRI validates the value is in the set of provided values by comparing IDs
+func ValidateIRI[T any](values ...T) Validation[T] {
+ ids := map[string]struct{}{}
+ for _, v := range values {
+ id, err := GetID(v)
+ if err != nil {
+ panic(err)
+ }
+ ids[id] = struct{}{}
+ }
+ return func(value T) error {
+ id, err := GetID(value)
+ if err != nil {
+ return err
+ }
+ if _, ok := ids[id]; ok {
+ return nil
+ }
+ prefix, parts := trimCommonPrefixes(sortedKeys(ids))
+ return fmt.Errorf("value is not allowed: '%v', expected: %s{%s}", id, prefix, strings.Join(parts, " | "))
+ }
+}
+
+// ValidateAll applies the provided validation to all elements in a slice
+func ValidateAll[T any](validation Validation[T]) Validation[[]T] {
+ return func(values []T) error {
+ var errs []error
+ for i, value := range values {
+ err := validation(value)
+ if err != nil {
+ errs = append(errs, newValidationError(err, i))
+ }
+ }
+ return JoinErrors(errs...)
+ }
+}
+
+// ValidateMinCount validates there are a minimum number of elements present in a slice
+func ValidateMinCount[S ~[]T, T any](minCount int) Validation[S] {
+ return func(values S) error {
+ if minCount > len(values) {
+ return fmt.Errorf("must have at least: %v item(s), got: %v", minCount, len(values))
+ }
+ return nil
+ }
+}
+
+// ValidateMaxCount validates that the maximum number of elements has not been exceeded
+func ValidateMaxCount[T any](maxCount int) Validation[[]T] {
+ return func(values []T) error {
+ if maxCount < len(values) {
+ return fmt.Errorf("must have fewer than: %v item(s), got: %v", maxCount, len(values))
+ }
+ return nil
+ }
+}
+
+// ValidateExpression validates that the value matches the provided expression
+func ValidateExpression(expression string) Validation[string] {
+ return func(value string) error {
+ r, err := regexp.Compile(expression)
+ if err != nil {
+ return fmt.Errorf("invalid expression: %s", expression)
+ }
+ if !r.MatchString(value) {
+ return fmt.Errorf("must match expression: %s: value: %v", expression, value)
+ }
+ return nil
+ }
+}
diff --git a/spdx/v3/internal/ld/validations_test.go b/spdx/v3/internal/ld/validations_test.go
new file mode 100644
index 00000000..3caa57ac
--- /dev/null
+++ b/spdx/v3/internal/ld/validations_test.go
@@ -0,0 +1,178 @@
+package ld
+
+import (
+ "fmt"
+ "testing"
+ "time"
+
+ "github.com/stretchr/testify/require"
+)
+
+func Test_Validate(t *testing.T) {
+ tests := []struct {
+ name string
+ graph any
+ errs int
+ }{
+ {
+ name: "no validators",
+ graph: 1,
+ errs: 0,
+ },
+ {
+ name: "no validators slice struct",
+ graph: []any{
+ time.Time{},
+ },
+ errs: 0,
+ },
+ {
+ name: "one invalid",
+ graph: []any{
+ PositiveInt(1),
+ notValid("invalid"),
+ },
+ errs: 1,
+ },
+ {
+ name: "multiple invalid",
+ graph: []any{
+ notValid("invalid1"),
+ notValid("invalid2"),
+ },
+ errs: 2,
+ },
+ {
+ name: "positive int valid",
+ graph: []any{
+ ptr(PositiveInt(1)),
+ },
+ errs: 0,
+ },
+ {
+ name: "positive int invalid",
+ graph: []any{
+ ptr(PositiveInt(-1)),
+ },
+ errs: 1,
+ },
+ {
+ name: "non negative int valid",
+ graph: []any{
+ ptr(NonNegativeInt(1)),
+ },
+ errs: 0,
+ },
+ {
+ name: "non negative int invalid",
+ graph: []any{
+ ptr(NonNegativeInt(-1)),
+ },
+ errs: 1,
+ },
+ {
+ name: "single invalid ptr",
+ graph: []any{
+ ptr(notValidP("invalid")),
+ },
+ errs: 1,
+ },
+ {
+ name: "nested valid",
+ graph: []any{
+ ptr(notValidP("invalid")),
+ },
+ errs: 1,
+ },
+ {
+ name: "nested single invalid",
+ graph: []any{
+ ptr(nested{ // valid
+ PositiveVal: -1, // invalid
+ NonNegativeVal: 8, // valid
+ }),
+ },
+ errs: 1,
+ },
+ {
+ name: "nested multiple invalid",
+ graph: []any{
+ ptr(nested{ // invalid
+ PositiveVal: 11, // valid
+ NonNegativeVal: -1, // invalid
+ }),
+ },
+ errs: 2,
+ },
+ {
+ name: "time valid",
+ graph: time.Now(),
+ errs: 0,
+ },
+ {
+ name: "DateTime valid",
+ graph: DateTime(time.Now()),
+ errs: 0,
+ },
+ {
+ name: "Pattern valid",
+ graph: validateExpression{
+ value: "text/plain",
+ pattern: "^[^\\/]+\\/[^\\/]+$",
+ },
+ errs: 0,
+ },
+ {
+ name: "Pattern invalid",
+ graph: validateExpression{
+ value: "text-plain",
+ pattern: "^[^\\/]+\\/[^\\/]+$",
+ },
+ errs: 1,
+ },
+ }
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ err := ValidateGraph(tt.graph)
+ require.Len(t, flattenErrors(err), tt.errs)
+ })
+ }
+}
+
+type notValid string
+
+func (n notValid) Validate() error {
+ return fmt.Errorf(string(n))
+}
+
+type notValidP string
+
+func (n *notValidP) Validate() error {
+ return fmt.Errorf(string(*n))
+}
+
+func ptr[T any](v T) *T {
+ return &v
+}
+
+type nested struct {
+ PositiveVal PositiveInt
+ NonNegativeVal NonNegativeInt
+}
+
+func (v *nested) Validate() error {
+ if v.PositiveVal >= 10 || v.NonNegativeVal >= 10 {
+ return fmt.Errorf("values should be < 10")
+ }
+ return nil
+}
+
+type validateExpression struct {
+ value string
+ pattern string
+}
+
+func (v validateExpression) Validate() error {
+ return ValidateExpression(v.pattern)(v.value)
+}
diff --git a/spdx/v3/internal/ld/visitor.go b/spdx/v3/internal/ld/visitor.go
new file mode 100644
index 00000000..615350e7
--- /dev/null
+++ b/spdx/v3/internal/ld/visitor.go
@@ -0,0 +1,84 @@
+package ld
+
+import (
+ "fmt"
+ "reflect"
+)
+
+var StopTraversing = fmt.Errorf("stop-traversing-graph")
+
+// VisitObjectGraph traverses the object graph, taking into account cycles, calling the visitor function for each
+// step along the traversal, including field properties, pointer and subsequent struct values, elements in
+// slices and both keys and values of maps, as well as some context such as the path within the graph and any
+// containing struct field. The value is always able to have Interface() and Set() called.
+func VisitObjectGraph(graph any, visitor func(path []any, value reflect.Value) error) error {
+ t := reflect.TypeOf(graph)
+ return visitObjectGraph(map[reflect.Value]struct{}{}, []any{baseType(t)}, reflect.ValueOf(graph), visitor)
+}
+
+func visitObjectGraph(visited map[reflect.Value]struct{}, path []any, v reflect.Value, visitor func([]any, reflect.Value) error) error {
+ if !v.IsValid() {
+ return nil
+ }
+ if _, ok := visited[v]; ok {
+ return nil
+ }
+ visited[v] = struct{}{}
+
+ var err error
+ if v.CanInterface() {
+ err = visitor(path, v)
+ if err == StopTraversing {
+ return nil
+ } else if err != nil {
+ return err
+ }
+ }
+
+ t := v.Type()
+
+ switch t.Kind() {
+ case reflect.Interface:
+ return visitObjectGraph(visited, path, v.Elem(), visitor)
+ case reflect.Pointer:
+ return visitObjectGraph(visited, path, v.Elem(), visitor)
+ case reflect.Struct:
+ for i := 0; i < v.NumField(); i++ {
+ f := t.Field(i)
+ subPath := path[:]
+ if !f.Anonymous {
+ subPath = append(subPath, f)
+ }
+ fv := v.Field(i)
+ err = visitObjectGraph(visited, subPath, fv, visitor)
+ if err != nil {
+ return err
+ }
+ }
+ case reflect.Map:
+ iter := v.MapRange()
+ if iter == nil {
+ return nil
+ }
+ for iter.Next() {
+ path := append(path[:], fmt.Sprintf("%v", iter.Key().Interface()))
+ err = visitObjectGraph(visited, path, iter.Key(), visitor)
+ if err != nil {
+ return err
+ }
+ err = visitObjectGraph(visited, path, iter.Value(), visitor)
+ if err != nil {
+ return err
+ }
+ }
+ case reflect.Slice:
+ for i := 0; i < v.Len(); i++ {
+ err = visitObjectGraph(visited, append(path[:], i), v.Index(i), visitor)
+ if err != nil {
+ return err
+ }
+ }
+ default:
+ }
+ return nil
+}
diff --git a/spdx/v3/internal/ld/visitor_test.go b/spdx/v3/internal/ld/visitor_test.go
new file mode 100644
index 00000000..41310b91
--- /dev/null
+++ b/spdx/v3/internal/ld/visitor_test.go
@@ -0,0 +1,50 @@
+package ld
+
+import (
+ "fmt"
+ "reflect"
+ "testing"
+
+ "github.com/stretchr/testify/require"
+)
+
+func Test_visitor(t *testing.T) {
+ type typ struct {
+ Name string
+ Slice []int
+ Map map[string]int
+ }
+
+ v := &typ{
+ Name: "a name",
+ Slice: []int{2, 4, 6},
+ Map: map[string]int{
+ "key1": 10,
+ "key2": 20,
+ },
+ }
+
+ err := VisitObjectGraph(v, func(path []any, value reflect.Value) error {
+ f := path[len(path)-1]
+ if f, ok := f.(reflect.StructField); ok {
+ if f.Name == "Name" {
+ require.Equal(t, value.String(), "a name")
+ value.SetString("a new name")
+ }
+ }
+ //fmt.Println(path)
+ //if intSlice, ok := value.Interface().([]int); ok {
+ // fmt.Println(intSlice)
+ // //intSlice = append(intSlice, 12)
+ // newValue := reflect.Append(value, reflect.ValueOf(12))
+ // value.Set(newValue)
+ //}
+ if mapVal, ok := value.Interface().(map[string]int); ok {
+ fmt.Println(mapVal)
+ mapVal["new"] = 100
+ }
+ return nil
+ })
+ fmt.Println(v)
+ require.NoError(t, err)
+}
diff --git a/spdx/v3/internal/serialize_json.go b/spdx/v3/internal/serialize_json.go
new file mode 100644
index 00000000..5c0ab819
--- /dev/null
+++ b/spdx/v3/internal/serialize_json.go
@@ -0,0 +1,403 @@
+package internal
+
+import (
+ "encoding/json"
+ "errors"
+ "fmt"
+ "io"
+ "os"
+ "reflect"
+ "strings"
+ "time"
+
+ "github.com/google/uuid"
+
+ "github.com/spdx/tools-golang/spdx/v3/internal/ld"
+)
+
+var Debug = os.Getenv("SPDX_DEBUG") == "true"
+
+type ldContextProvider interface {
+ LDContexts() map[string]map[string]any
+}
+
+func ToJSON(spdxContext string, ldContext ld.Context, document any, writer io.Writer) error {
+ // we only compact the spdx context, not extensions, so ignore any other contexts
+ ctx := ldContext.(ldContextProvider).LDContexts()[spdxContext]
+ if ctx == nil {
+ return fmt.Errorf("spdx context %v not found", spdxContext)
+ }
+
+ ctx, _ = ctx[ld.JsonContextProp].(map[string]any)
+ if ctx == nil {
+ return fmt.Errorf("spdx @context %v not found", spdxContext)
+ }
+
+ aliases := map[string]string{}
+ prefixes := map[string]string{}
+
+ for k, v := range ctx {
+ switch v := v.(type) {
+ case string:
+ aliases[v] = k
+ case map[string]any:
+ fieldIRI, _ := v[ld.JsonIdProp].(string)
+ if fieldIRI != "" {
+ aliases[fieldIRI] = k
+ subContext, _ := v[ld.JsonContextProp].(map[string]any)
+ if subContext != nil {
+ prefix, _ := subContext[ld.JsonVocabProp].(string)
+ if prefix != "" {
+ prefixes[fieldIRI] = prefix
+ }
+ }
+ }
+ }
+ }
+
+ s := &serializer{
+ contextURL: spdxContext,
+ aliases: aliases,
+ prefixes: prefixes,
+ nextID: map[reflect.Type]int{},
+ ids: map[reflect.Value]string{},
+ in: document,
+ }
+
+ maps, err := s.toMaps(document)
+ if err != nil {
+ return err
+ }
+ enc := json.NewEncoder(writer)
+ enc.SetEscapeHTML(false)
+ enc.SetIndent("", "")
+ return enc.Encode(maps)
+}
+
+type serializer struct {
+ contextURL string
+ nextID map[reflect.Type]int
+ ids map[reflect.Value]string
+ aliases map[string]string
+ prefixes map[string]string
+ graph []any
+ in any
+}
+
+func (s *serializer) toMaps(document any) (map[string]any, error) {
+ _, errs := s.serialize(reflect.ValueOf(document), "")
+ return map[string]any{
+ "@context": s.contextURL,
+ "@graph": s.graph,
+ }, errors.Join(errs...)
+}
+
+func (s *serializer) serialize(v reflect.Value, prefix string) (any, []error) {
+ out, err := s.serializeValue(v, prefix)
+ if sv, ok := out.(string); ok {
+ return strings.TrimPrefix(sv, prefix), err
+ }
+ return out, err
+}
+
+func (s *serializer) serializeValue(v reflect.Value, prefix string) (any, []error) {
+ id := s.ids[v]
+ if id != "" {
+ return id, nil
+ }
+ if !v.IsValid() {
+ return nil, nil
+ }
+ ptrV := v
+ if v.Kind() == reflect.Pointer {
+ if v.IsNil() {
+ return nil, nil
+ }
+ id := s.ids[v]
+ if id != "" {
+ return id, nil
+ }
+ v = v.Elem()
+ }
+
+ switch v.Kind() {
+ case reflect.String, reflect.Bool, reflect.Float32, reflect.Float64,
+ reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
+ reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
+ return s.serializeSingleValue(v)
+ case reflect.Interface:
+ return s.serialize(v.Elem(), prefix)
+ case reflect.Slice:
+ return s.serializeSlice(v, prefix)
+ case reflect.Struct:
+ return s.serializeStruct(ptrV, v)
+ default:
+ panic(fmt.Errorf("unsupported type: %v", v))
+ }
+}
+
+func (s *serializer) serializeSingleValue(v reflect.Value) (any, []error) {
+ return getValue(v), nil
+}
+
+func (s *serializer) serializeSlice(v reflect.Value, prefix string) (any, []error) {
+ // if this function is called, we have a non-nil slice that may be empty, we always
+ // want to return a slice rather than nil
+ sz := v.Len()
+ serialized := make([]any, 0, sz)
+ var errs []error
+ for i := 0; i < v.Len(); i++ {
+ elem := v.Index(i)
+ if Debug {
+ tmp := fmt.Sprintf("%#v", elem)
+ fmt.Println(tmp)
+ }
+ got, err := s.serialize(elem, prefix)
+ if err != nil {
+ errs = append(errs, err...)
+ } else {
+ serialized = append(serialized, got)
+ }
+ }
+ return serialized, errs
+}
+
+func (s *serializer) serializeStruct(ptrV reflect.Value, v reflect.Value) (any, []error) {
+ var errs []error
+ data, ok := s.serializeDataStruct(v)
+ if ok {
+ return data, nil
+ }
+
+ typeName := s.typeName(ptrV)
+ if typeName == "" {
+ if Debug {
+ tmp := fmt.Sprintf("no type for: %#v", ptrV)
+ fmt.Println(tmp)
+ }
+ // structs without types must have an external ID
+ id, err := ld.GetID(v)
+ if err != nil {
+ return "", []error{err}
+ }
+ if isExternalID(id) {
+ return id, nil
+ }
+ panic(fmt.Errorf("unable to get typeName or ID for: %v", ptrV.Interface()))
+ }
+
+ serialized := map[string]any{}
+ idField := ""
+ errs = append(errs, s.serializeProps(ptrV, v, &idField, serialized)...)
+
+ id, _ := serialized[idField].(string)
+ switch len(serialized) {
+ case 0:
+ return nil, nil
+ case 1:
+ // if the only field output is an external ID, output directly as a string
+ if isExternalID(id) {
+ return id, nil
+ }
+ }
+
+ typeField := s.aliases[ld.JsonTypeProp]
+ if typeField == "" {
+ typeField = ld.JsonTypeProp
+ }
+
+ serialized[typeField] = typeName
+
+ // move elements to top-level graph
+ if id != "" {
+ // this struct needs to be serialized to the graph, and return the id reference to it
+ s.graph = append(s.graph, serialized)
+ return id, errs
+ }
+
+ return serialized, errs
+}
+
+func (s *serializer) serializeProps(ptrV reflect.Value, v reflect.Value, idField *string, serialized map[string]any) (errs []error) {
+ t := v.Type()
+ for i := 0; i < v.NumField(); i++ {
+ f := t.Field(i)
+
+ fv := v.Field(i)
+
+ iri := f.Tag.Get(ld.GoIriTagName)
+ if iri == "" {
+ if f.Anonymous && f.Type.Kind() == reflect.Struct { // embedded parent type
+ errs = append(errs, s.serializeProps(ptrV, fv, idField, serialized)...)
+ }
+ continue
+ }
+
+ k := s.aliases[iri]
+ if k == "" {
+ k = iri
+ }
+
+ if iri == ld.JsonIdProp {
+ // some types must use @id and allow blank node IDs
+ if blankNodeAllowed(ptrV) {
+ //if ld.RefCount(ptrV, s.in) == 1 {
+ // continue // don't create an ID, output inline
+ //}
+ if outputInline(ptrV) {
+ continue // don't create an ID, output inline
+ }
+ k = iri
+ }
+ *idField = k
+ if isUnset(fv) {
+ newID := s.newID(ptrV)
+ s.ids[ptrV] = newID
+ fv = reflect.ValueOf(newID)
+ } else {
+ id := fv.String()
+ // FIXME -- figure out the right way to deal with SPDX IDs, which are of the form
+ // SPDXRef- many users will be outputting today, which are not valid URIs
+ if !isURI(id) {
+ id = "spdxid:" + id
+ fv.SetString(id)
+ }
+ //if !strings.HasPrefix(id, "_:") {
+ // id = "_:" + id
+ //}
+ s.ids[ptrV] = id
+ }
+ }
+
+ if isUnset(fv) {
+ if f.Tag.Get("required") != "true" {
+ continue
+ } else if f.Type.Kind() == reflect.Slice {
+ // always output arrays instead of nil
+ fv = reflect.MakeSlice(f.Type, 0, 0)
+ }
+ }
+
+ serializedField, err := s.serialize(fv, s.prefixes[iri])
+ if err != nil {
+ errs = append(errs, err...)
+ continue
+ }
+
+ serialized[k] = serializedField
+ }
+ return errs
+}
+
+func isURI(id string) bool {
+ return strings.HasPrefix(id, "http://") || strings.HasPrefix(id, "https://") || strings.HasPrefix(id, "urn:")
+}
+
+func outputInline(v reflect.Value) bool {
+ for v.Kind() == reflect.Ptr {
+ v = v.Elem()
+ }
+ if v.Kind() != reflect.Struct {
+ return true
+ }
+ // FIXME determine the correct way to output inline vs reference
+ t := v.Type()
+ _, isElement := t.MethodByName("asElement")
+ if t.Name() == "CreationInfo" || isElement {
+ return false
+ }
+ return true
+}
+
+func blankNodeAllowed(v reflect.Value) bool {
+ if v.Kind() == reflect.Pointer {
+ t := v.Type().Elem()
+ f, ok := ld.FieldByType[ld.Type](t)
+ if ok {
+ return strings.Contains(f.Tag.Get(ld.GoNodeKindTagName), "BlankNode")
+ }
+ }
+ return false
+}
+
+func (s *serializer) getId(v reflect.Value) (string, error) {
+ id, _ := ld.GetID(v)
+ if id != "" {
+ return id, nil
+ }
+ id = s.ids[v]
+ return id, nil
+}
+
+func (s *serializer) newID(v reflect.Value) string {
+ if blankNodeAllowed(v) {
+ t := v.Elem().Type()
+ num := s.nextID[t] + 1
+ s.nextID[t] = num
+ return fmt.Sprintf("_:%s_%d", t.Name(), num)
+ }
+ u := uuid.New()
+ return fmt.Sprintf("urn:uuid:%v", u.String())
+}
+
+func (s *serializer) typeName(v reflect.Value) string {
+ for v.Kind() == reflect.Pointer {
+ v = v.Elem()
+ }
+ f, ok := ld.FieldByType[ld.Type](v.Type())
+ if ok {
+ iri := f.Tag.Get(ld.GoIriTagName)
+ alias := s.aliases[iri]
+ if alias != "" {
+ return alias
+ }
+ return iri
+ }
+ return ""
+}
+
+func (s *serializer) serializeDataStruct(v reflect.Value) (any, bool) {
+ if v.CanInterface() {
+ switch val := v.Interface().(type) {
+ case time.Time:
+ return val.UTC().Format(time.RFC3339), true
+ }
+ }
+ return nil, false
+}
+
+func isUnset(fv reflect.Value) bool {
+ if !fv.IsValid() {
+ return true
+ }
+ switch fv.Kind() {
+ case reflect.Pointer, reflect.Interface, reflect.Slice, reflect.Map:
+ return fv.IsNil()
+ default:
+ return fv.IsZero()
+ }
+}
+
+func getValue(v reflect.Value) any {
+ switch v.Kind() {
+ case reflect.String:
+ return v.String()
+ case reflect.Bool:
+ return v.Bool()
+ case reflect.Float32, reflect.Float64:
+ return v.Float()
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ return v.Int()
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
+ return v.Uint()
+ default:
+ if !v.CanInterface() {
+ return nil
+ }
+ return v.Interface()
+ }
+}
+
+func isExternalID(id string) bool {
+ return strings.HasPrefix(id, "http://") || strings.HasPrefix(id, "https://")
+}
diff --git a/spdx/v3/v3_0/convert.go b/spdx/v3/v3_0/convert.go
new file mode 100644
index 00000000..8bdad15f
--- /dev/null
+++ b/spdx/v3/v3_0/convert.go
@@ -0,0 +1,855 @@
+package v3_0
+
+import (
+ "fmt"
+ "os"
+ "reflect"
+ "regexp"
+ "slices"
+ "strings"
+ "time"
+
+ "github.com/spdx/tools-golang/spdx/v2/common"
+ "github.com/spdx/tools-golang/spdx/v2/v2_3"
+ "github.com/spdx/tools-golang/spdx/v3/internal"
+ "github.com/spdx/tools-golang/spdx/v3/internal/ld"
+)
+
+func From_v2_3(doc v2_3.Document, d *Document) {
+ c := newDocumentConverter(d)
+
+ // namespace is used to prefix document IDs
+ if doc.DocumentNamespace != "" {
+ d.NamespaceMaps = NamespaceMapList{
+ &NamespaceMap{
+ Namespace: URI(doc.DocumentNamespace),
+ },
+ }
+ c.namespace = "ns"
+ }
+
+ // set creationInfo of the converter so all created objects use the original
+ c.creationInfo = c.convert23creationInfo(doc.CreationInfo)
+
+ if d.CreationInfo == nil {
+ d.CreationInfo = c.creationInfo
+ }
+
+ if len(d.ProfileConformances) == 0 {
+ d.ProfileConformances = []ProfileIdentifierType{ProfileIdentifierType_Core, ProfileIdentifierType_Software}
+ }
+
+ d.ID = string(doc.SPDXIdentifier)
+ d.Comment = doc.DocumentComment
+ d.Imports = list[ExternalMapList](c.convert23externalDocumentRef, doc.ExternalDocumentReferences...)
+ d.Name = doc.DocumentName
+ d.DataLicense = c.convert23licenseString(doc.DataLicense)
+
+ var converted ElementList
+ for _, l := range doc.OtherLicenses {
+ converted = append(converted, c.convert23license(l))
+ }
+
+ for _, pkg := range doc.Packages {
+ converted = append(converted, c.convert23package(pkg))
+ }
+
+ for _, file := range doc.Files {
+ converted = append(converted, c.convert23file(file))
+ }
+
+ for _, a := range doc.Annotations {
+ converted = append(converted, c.convert23annotation(a))
+ }
+
+ for _, s := range doc.Snippets {
+ converted = append(converted, c.convert23snippet(s))
+ }
+
+ var relationships ElementList
+ for _, rel := range doc.Relationships {
+ r := c.convert23relationship(rel)
+ if r != nil {
+ c.sbom.Elements = append(c.sbom.Elements, r)
+ converted = append(relationships, r)
+ }
+ }
+
+ // if the user did not add elements to the document via relationships,
+ // just add all elements directly
+ if len(c.sbom.RootElements) == 0 {
+ c.sbom.RootElements = append(notNil(converted), notNil(relationships)...)
+ } else {
+ c.sbom.Elements = append(c.sbom.Elements, notNil(converted)...)
+ }
+}
+
+func newDocumentConverter(d *Document) *documentConverter {
+ if d.LDContext == nil {
+ d.LDContext = context()
+ }
+ sbom := &SBOM{}
+ d.RootElements = ElementList{sbom}
+ c := &documentConverter{
+ emailExtractor: regexp.MustCompile(`(.*)\s*[(<]([^)>]+)[)>]$`),
+ relationshipMap: map[any][]*Relationship{},
+ sbom: sbom,
+ idMap: duplicateLower(map[string]any{
+ "DOCUMENT": sbom,
+ "SPDXRef-DOCUMENT": sbom,
+ }),
+ lifecycleMap: duplicateLower(map[string]LifecycleScopeType{
+ "BUILD_TOOL_OF": LifecycleScopeType_Build,
+ "DEPENDS_ON": LifecycleScopeType_Build,
+ "DEV_DEPENDENCY_OF": LifecycleScopeType_Development,
+ "DEV_TOOL_OF": LifecycleScopeType_Development,
+ "RUNTIME_DEPENDENCY_OF": LifecycleScopeType_Runtime,
+ "TEST_DEPENDENCY_OF": LifecycleScopeType_Test,
+ "TEST_TOOL_OF": LifecycleScopeType_Test,
+ }),
+ inverseRelationshipMap: duplicateLower(map[string]RelationshipType{
+ "DESCRIBED_BY": RelationshipType_Describes,
+ "BUILD_TOOL_OF": RelationshipType_UsesTool,
+ "CONTAINED_BY": RelationshipType_Contains,
+ "COPY_OF": RelationshipType_CopiedTo,
+ "DATA_FILE_OF": RelationshipType_HasDataFile,
+ "DOCUMENTATION_OF": RelationshipType_HasDocumentation,
+ "DYNAMIC_LINK": RelationshipType_HasDynamicLink,
+ "EXPANDED_FROM_ARCHIVE": RelationshipType_ExpandsTo,
+ "FILE_ADDED": RelationshipType_HasAddedFile,
+ "FILE_DELETED": RelationshipType_HasDeletedFile,
+ "GENERATED_FROM": RelationshipType_Generates,
+ "METAFILE_OF": RelationshipType_HasMetadata,
+ "OPTIONAL_COMPONENT_OF": RelationshipType_HasOptionalComponent,
+ "PACKAGE_OF": RelationshipType_PackagedBy,
+ "PATCH_APPLIED": RelationshipType_PatchedBy,
+ "PATCH_FOR": RelationshipType_PatchedBy,
+ "AMENDS": RelationshipType_AmendedBy,
+ "TEST_CASE_OF": RelationshipType_HasTestCase,
+ "PREREQUISITE_FOR": RelationshipType_HasPrerequisite,
+ "VARIANT_OF": RelationshipType_HasVariant,
+ "BUILD_DEPENDENCY_OF": RelationshipType_DependsOn,
+ "DEPENDENCY_MANIFEST_OF": RelationshipType_HasDependencyManifest,
+ "DEPENDENCY_OF": RelationshipType_DependsOn,
+ "DEV_DEPENDENCY_OF": RelationshipType_DependsOn,
+ "DEV_TOOL_OF": RelationshipType_UsesTool,
+ "EXAMPLE_OF": RelationshipType_HasExample,
+ "OPTIONAL_DEPENDENCY_OF": RelationshipType_HasOptionalDependency,
+ "PROVIDED_DEPENDENCY_OF": RelationshipType_HasProvidedDependency,
+ "RUNTIME_DEPENDENCY_OF": RelationshipType_DependsOn,
+ "TEST_DEPENDENCY_OF": RelationshipType_DependsOn,
+ "TEST_OF": RelationshipType_HasTest,
+ "TEST_TOOL_OF": RelationshipType_UsesTool,
+ "REQUIREMENT_DESCRIPTION_FOR": RelationshipType_HasRequirement,
+ "SPECIFICATION_FOR": RelationshipType_HasSpecification,
+ }),
+ relationshipTypeMap: duplicateLower(map[string]RelationshipType{
+ "DESCRIBES": RelationshipType_Describes,
+ "ANCESTOR_OF": RelationshipType_AncestorOf,
+ "CONTAINS": RelationshipType_Contains,
+ "DESCENDANT_OF": RelationshipType_DescendantOf,
+ "DISTRIBUTION_ARTIFACT": RelationshipType_HasDistributionArtifact,
+ "FILE_MODIFIED": RelationshipType_ModifiedBy,
+ "GENERATES": RelationshipType_Generates,
+ "OTHER": RelationshipType_Other,
+ "STATIC_LINK": RelationshipType_HasStaticLink,
+ "HAS_PREREQUISITE": RelationshipType_HasPrerequisite,
+ "DEPENDS_ON": RelationshipType_DependsOn,
+ }),
+ hashAlgorithmMap: duplicateLower(map[string]HashAlgorithm{
+ "ADLER32": HashAlgorithm_Other,
+ "BLAKE2b_256": HashAlgorithm_Blake2b256,
+ "BLAKE2b_384": HashAlgorithm_Blake2b384,
+ "BLAKE2b_512": HashAlgorithm_Blake2b512,
+ "BLAKE3": HashAlgorithm_Blake3,
+ "MD2": HashAlgorithm_Md2,
+ "MD4": HashAlgorithm_Md4,
+ "MD5": HashAlgorithm_Md5,
+ "MD6": HashAlgorithm_Md6,
+ "SHA1": HashAlgorithm_Sha1,
+ "SHA224": HashAlgorithm_Sha224,
+ "SHA256": HashAlgorithm_Sha256,
+ "SHA384": HashAlgorithm_Sha384,
+ "SHA3_256": HashAlgorithm_Sha3_256,
+ "SHA3_384": HashAlgorithm_Sha3_384,
+ "SHA3_512": HashAlgorithm_Sha3_512,
+ "SHA512": HashAlgorithm_Sha3_512,
+ }),
+ annotationTypeMap: duplicateLower(map[string]AnnotationType{
+ "OTHER": AnnotationType_Other,
+ "REVIEW": AnnotationType_Review,
+ }),
+ contentIdentifierTypeMap: duplicateLower(map[string]ContentIdentifierType{
+ "gitoid": ContentIdentifierType_Gitoid,
+ "swh": ContentIdentifierType_Swhid,
+ }),
+ externalIdentifierTypeMap: duplicateLower(map[string]ExternalIdentifierType{
+ "cpe22Type": ExternalIdentifierType_Cpe22,
+ "cpe23Type": ExternalIdentifierType_Cpe23,
+ "swid": ExternalIdentifierType_Swid,
+ "purl": ExternalIdentifierType_PackageURL,
+ }),
+ externalRefTypeMap: duplicateLower(map[string]ExternalRefType{
+ "maven-central": ExternalRefType_MavenCentral,
+ "npm": ExternalRefType_Npm,
+ "nuget": ExternalRefType_Nuget,
+ "bower": ExternalRefType_Bower,
+ "advisory": ExternalRefType_SecurityAdvisory,
+ "fix": ExternalRefType_SecurityFix,
+ "url": ExternalRefType_SecurityOther,
+ }),
+ primaryPurposeMap: duplicateLower(map[string]SoftwarePurpose{
+ "APPLICATION": SoftwarePurpose_Application,
+ "ARCHIVE": SoftwarePurpose_Archive,
+ "CONTAINER": SoftwarePurpose_Container,
+ "DEVICE": SoftwarePurpose_Device,
+ "FILE": SoftwarePurpose_File,
+ "FIRMWARE": SoftwarePurpose_Firmware,
+ "FRAMEWORK": SoftwarePurpose_Framework,
+ "INSTALL": SoftwarePurpose_Install,
+ "LIBRARY": SoftwarePurpose_Library,
+ "OPERATING_SYSTEM": SoftwarePurpose_OperatingSystem,
+ "OTHER": SoftwarePurpose_Other,
+ "SOURCE": SoftwarePurpose_Source,
+ }),
+ }
+ return c
+}
+
+type documentConverter struct {
+ sbom *SBOM
+ namespace string
+ idMap map[string]any
+ creationInfo AnyCreationInfo
+ relationshipMap map[any][]*Relationship
+ relationshipTypeMap map[string]RelationshipType
+ inverseRelationshipMap map[string]RelationshipType
+ lifecycleMap map[string]LifecycleScopeType
+ hashAlgorithmMap map[string]HashAlgorithm
+ annotationTypeMap map[string]AnnotationType
+ contentIdentifierTypeMap map[string]ContentIdentifierType
+ externalIdentifierTypeMap map[string]ExternalIdentifierType
+ externalRefTypeMap map[string]ExternalRefType
+ primaryPurposeMap map[string]SoftwarePurpose
+ emailExtractor *regexp.Regexp
+}
+
+func (c *documentConverter) addRelationship(r *Relationship) {
+ rels := c.relationshipMap[r.From]
+ for _, existing := range rels {
+ if existing.Type == r.Type {
+ if r.Comment != existing.Comment {
+ continue
+ }
+ existing.To = appendUnique(existing.To, r.To...)
+ return
+ }
+ }
+ c.relationshipMap[r.From] = append(c.relationshipMap[r.From], r)
+}
+
+func (c *documentConverter) convert23relationship(rel *v2_3.Relationship) AnyRelationship {
+ if rel == nil {
+ return nil
+ }
+ from, _ := c.idMap[string(rel.RefA.ElementRefID)].(AnyElement)
+ to, _ := c.idMap[string(rel.RefB.ElementRefID)].(AnyElement)
+ if from == nil || to == nil {
+ c.logDropped(rel)
+ return nil
+ }
+
+ typ, invert := c.convert23relationshipType(rel.Relationship)
+ if invert {
+ to, from = from, to
+ }
+
+ // SPDX 3 direct document elements are in RootElement list, not relationships
+ if from == c.sbom {
+ // TODO are there special cases depending on type?
+ c.sbom.RootElements = append(c.sbom.RootElements, to)
+ return nil
+ }
+
+ r := &Relationship{
+ Comment: rel.RelationshipComment,
+ From: from,
+ Type: typ,
+ To: ElementList{to},
+ }
+ c.addRelationship(r)
+ return r
+}
+
+func (c *documentConverter) convert23relationshipType(typ string) (RelationshipType, bool) {
+ typ = strings.ToUpper(typ)
+ out, ok := c.relationshipTypeMap[typ]
+ if ok {
+ return out, false
+ }
+ out, ok = c.inverseRelationshipMap[typ]
+ if ok {
+ return out, true
+ }
+ return RelationshipType{}, false
+}
+
+func (c *documentConverter) convert23creationInfo(info *v2_3.CreationInfo) AnyCreationInfo {
+ if info == nil || len(info.Creators) == 0 {
+ return nil
+ }
+ ci := &CreationInfo{
+ Comment: info.CreatorComment,
+ Created: c.convert23time(info.Created),
+ CreatedBy: list[AgentList](c.convert23creator, info.Creators...),
+ CreatedUsing: list[ToolList](c.convert23tool, info.Creators...),
+ SpecVersion: Version, // specVersion is always the current version
+ }
+
+ // update circular references, which will be set to nil by default
+ for _, a := range ci.CreatedBy.Agents() {
+ a.SetCreationInfo(ci)
+ }
+ for _, a := range ci.CreatedUsing.Tools() {
+ a.SetCreationInfo(ci)
+ }
+
+ return ci
+}
+
+func (c *documentConverter) convert23tool(creator common.Creator) AnyTool {
+ if strings.ToLower(creator.CreatorType) != "tool" {
+ return nil
+ }
+
+ if creator.Creator != "" {
+ c.logDropped(creator)
+ return nil
+ }
+
+ return &Tool{
+ CreationInfo: c.creationInfo,
+ Name: creator.Creator,
+ }
+}
+
+func (c *documentConverter) convert23creator(creator common.Creator) AnyAgent {
+ return c.convert23agent(creator.CreatorType, creator.Creator)
+}
+
+func (c *documentConverter) convert23originator(creator *common.Originator) AnyAgent {
+ if creator == nil {
+ return nil
+ }
+ return c.convert23agent(creator.OriginatorType, creator.Originator)
+}
+
+func (c *documentConverter) convert23supplier(creator *common.Supplier) AnyAgent {
+ if creator == nil {
+ return nil
+ }
+ return c.convert23agent(creator.SupplierType, creator.Supplier)
+}
+
+func (c *documentConverter) convert23annotator(creator *common.Annotator) AnyAgent {
+ return c.convert23agent(creator.AnnotatorType, creator.Annotator)
+}
+
+func (c *documentConverter) convert23contributors(contributors ...string) AgentList {
+ var agents AgentList
+ for _, contributor := range contributors {
+ parts := strings.Split(contributor, ":")
+ if len(parts) > 1 && strings.EqualFold(parts[0], "person") {
+ contributor = parts[1]
+ }
+ agent := c.convert23agent("person", contributor)
+ if agent != nil {
+ agents = append(agents, agent)
+ }
+ }
+ return agents
+}
+
+func (c *documentConverter) convert23agent(typ, name string) AnyAgent {
+ name = strings.TrimSpace(name)
+ if name == "" {
+ return nil
+ }
+ emailValue := ""
+ match := c.emailExtractor.FindStringSubmatch(name)
+ if len(match) > 2 {
+ name = strings.TrimSpace(match[1])
+ emailValue = strings.TrimSpace(match[2])
+ }
+ var out AnyAgent
+ switch strings.ToLower(typ) {
+ case "person":
+ out = &Person{
+ CreationInfo: c.creationInfo,
+ Name: name,
+ }
+ case "organization", "org":
+ out = &Organization{
+ CreationInfo: c.creationInfo,
+ Name: name,
+ }
+ case "tool": // handled elsewhere
+ default:
+ c.logDropped(fmt.Sprintf("unknown agent type: %v with value: %v", typ, name))
+ }
+ if emailValue != "" {
+ out.SetExternalIdentifiers(externalIdentifierListEmail(emailValue))
+ }
+ return out
+}
+
+func (c *documentConverter) convert23file(f *v2_3.File) AnyFile {
+ if f == nil {
+ return nil
+ }
+
+ out := &File{
+ ID: string(f.FileSPDXIdentifier),
+ Comment: f.FileComment,
+ Name: f.FileName,
+ Description: f.FileNotice,
+ ExternalRefs: nil,
+ Summary: "",
+ VerifiedUsing: list[IntegrityMethodList](c.convert23checksum, f.Checksums...),
+ StandardNames: nil,
+ BuiltTime: time.Time{},
+ ReleaseTime: time.Time{},
+ SupportLevels: nil,
+ SuppliedBy: nil,
+ OriginatedBy: c.convert23contributors(f.FileContributors...),
+ ValidUntilTime: time.Time{},
+ AttributionTexts: f.FileAttributionTexts,
+ CopyrightText: f.FileCopyrightText,
+ ContentType: "",
+ Kind: FileKindType_File,
+ }
+
+ for _, s := range f.Snippets {
+ v3 := c.convert23snippet(*s)
+ c.addRelationship(&Relationship{
+ Type: RelationshipType_Contains,
+ From: out,
+ To: ElementList{v3},
+ })
+ }
+
+ for _, a := range f.Annotations {
+ v3 := c.convert23annotation(&a)
+ c.addRelationship(&Relationship{
+ Type: RelationshipType_Describes,
+ From: v3,
+ To: ElementList{out},
+ })
+ }
+
+ c.idMap[string(f.FileSPDXIdentifier)] = out
+ return out
+}
+
+func (c *documentConverter) convert23package(pkg *v2_3.Package) AnyPackage {
+ if pkg == nil {
+ return nil
+ }
+
+ verificationCodes := list[IntegrityMethodList](c.convert23packageVerificationCode, pkg.PackageVerificationCode)
+
+ for _, checksum := range pkg.PackageChecksums {
+ ck := c.convert23checksum(checksum)
+ if ck != nil {
+ verificationCodes = append(verificationCodes, ck)
+ }
+ }
+
+ id := string(pkg.PackageSPDXIdentifier)
+ out := &Package{
+ ID: id,
+ Name: pkg.PackageName,
+ Summary: pkg.PackageSummary,
+ Comment: pkg.PackageComment,
+ Description: pkg.PackageDescription,
+ ExternalIdentifiers: list[ExternalIdentifierList](c.convert23externalIdentifier, pkg.PackageExternalReferences...),
+ VerifiedUsing: verificationCodes,
+ BuiltTime: c.convert23time(pkg.BuiltDate),
+ OriginatedBy: list[AgentList](c.convert23originator, pkg.PackageOriginator),
+ ReleaseTime: c.convert23time(pkg.ReleaseDate),
+ SuppliedBy: c.convert23supplier(pkg.PackageSupplier),
+ ValidUntilTime: c.convert23time(pkg.ValidUntilDate),
+ AttributionTexts: pkg.PackageAttributionTexts,
+ CopyrightText: pkg.PackageCopyrightText,
+ PrimaryPurpose: c.convert23purpose(pkg.PrimaryPackagePurpose),
+ Version: pkg.PackageVersion,
+ DownloadLocation: c.convert23uri(pkg.PackageDownloadLocation),
+ HomePage: c.convert23uri(pkg.PackageHomePage),
+ PackageURL: c.convert23packageUrl(pkg.PackageExternalReferences),
+ SourceInfo: pkg.PackageSourceInfo,
+ }
+
+ // move the first valid PURL to the PackageURL field
+ for _, ident := range out.ExternalIdentifiers.ExternalIdentifiers() {
+ if ident.GetType() == ExternalIdentifierType_PackageURL {
+ if ident.GetComment() != "" {
+ continue
+ }
+ purl := URI(ident.GetIdentifier())
+ if purl.Validate() == nil {
+ out.PackageURL = purl
+ out.ExternalIdentifiers = slices.DeleteFunc(out.ExternalIdentifiers, func(identifier AnyExternalIdentifier) bool {
+ return identifier.GetIdentifier() == string(purl)
+ })
+ break
+ }
+ }
+ }
+
+ c.idMap[id] = out
+
+ if pkg.PackageLicenseComments != "" {
+ if out.Comment == "" {
+ out.Comment = pkg.PackageLicenseComments
+ } else {
+ // this appears to be the behavior from the Java tools:
+ // https://github.com/spdx/Spdx-Java-Library/blob/e3640e27a423a5562c52bcc4075cce9ac35f433a/src/main/java/org/spdx/library/conversion/Spdx2to3Converter.java#L1233
+ out.Comment += ";" + pkg.PackageLicenseComments
+ }
+ }
+
+ for _, l := range pkg.PackageLicenseInfoFromFiles {
+ d := c.convert23licenseString(l)
+ if d != nil {
+ c.addRelationship(&Relationship{
+ Type: RelationshipType_HasConcludedLicense,
+ From: out,
+ To: ElementList{d},
+ })
+ }
+ }
+ d := c.convert23licenseString(pkg.PackageLicenseDeclared)
+ if d != nil {
+ c.addRelationship(&Relationship{
+ Type: RelationshipType_HasDeclaredLicense,
+ From: out,
+ To: ElementList{d},
+ })
+ }
+
+ d = c.convert23licenseString(pkg.PackageLicenseConcluded)
+ if d != nil {
+ c.addRelationship(&Relationship{
+ Type: RelationshipType_HasConcludedLicense,
+ From: out,
+ To: ElementList{d},
+ })
+ }
+
+ for _, f := range pkg.Files {
+ v3file := c.convert23file(f)
+ if v3file == nil {
+ continue
+ }
+ c.addRelationship(&Relationship{
+ Type: RelationshipType_Contains,
+ From: out,
+ To: ElementList{v3file},
+ })
+ }
+
+ return out
+}
+
+func (c *documentConverter) convert23time(date string) time.Time {
+ if date == "" {
+ return time.Time{}
+ }
+ t, err := time.Parse(time.RFC3339, date)
+ if err != nil {
+ c.logDropped(err)
+ }
+ return t
+}
+
+func (c *documentConverter) convert23uri(uri string) ld.URI {
+ out := ld.URI(uri)
+ if out.Validate() == nil {
+ return out
+ }
+ c.logDropped(out)
+ return ""
+}
+
+func (c *documentConverter) logDropped(value any) {
+ if value == nil || !internal.Debug {
+ return
+ }
+ _, _ = fmt.Fprintf(os.Stderr, "dropped: %v", value)
+}
+
+func (c *documentConverter) convert23packageUrl(references []*v2_3.PackageExternalReference) ld.URI {
+ for _, ref := range references {
+ if ref != nil && ref.RefType == common.TypePackageManagerPURL {
+ return c.convert23uri(ref.Locator)
+ }
+ }
+ return ""
+}
+
+func (c *documentConverter) convert23purpose(purpose string) SoftwarePurpose {
+ return c.primaryPurposeMap[strings.ToLower(purpose)]
+}
+
+func (c *documentConverter) convert23packageVerificationCode(v *common.PackageVerificationCode) AnyIntegrityMethod {
+ if v == nil || v.Value == "" {
+ c.logDropped(v)
+ return nil
+ }
+ return &PackageVerificationCode{
+ Algorithm: HashAlgorithm_Sha1,
+ HashValue: v.Value,
+ ExcludedFiles: v.ExcludedFiles,
+ }
+}
+
+func (c *documentConverter) convert23externalIdentifier(r *v2_3.PackageExternalReference) AnyExternalIdentifier {
+ if r == nil {
+ return nil
+ }
+ typ, ok := c.externalIdentifierTypeMap[r.RefType]
+ if !ok || r.Locator == "" {
+ c.logDropped(r)
+ return nil
+ }
+ return &ExternalIdentifier{
+ Comment: r.ExternalRefComment,
+ Type: typ,
+ Identifier: r.Locator,
+ }
+}
+
+func (c *documentConverter) convert23license(l *v2_3.OtherLicense) AnyLicenseInfo {
+ if l == nil {
+ return nil
+ }
+
+ var seeAlso []ld.URI
+ for _, ref := range l.LicenseCrossReferences {
+ seeAlso = append(seeAlso, ld.URI(ref))
+ }
+
+ out := &CustomLicense{
+ Name: l.LicenseName,
+ Comment: l.LicenseComment,
+ SeeAlsos: seeAlso,
+ Text: l.ExtractedText,
+ }
+
+ c.idMap[l.LicenseIdentifier] = out
+
+ return out
+}
+
+func (c *documentConverter) convert23licenseString(licenseString string) AnyLicenseInfo {
+ if licenseString == "" {
+ return nil
+ }
+
+ var out AnyLicenseInfo
+ if strings.HasPrefix(licenseString, "LicenseRef-") {
+ license, _ := c.idMap[licenseString].(AnyLicenseInfo)
+ if license != nil {
+ return license
+ }
+ out = &CustomLicense{
+ Name: licenseString,
+ Text: licenseString,
+ }
+ } else {
+ out = &ListedLicense{
+ Name: licenseString,
+ }
+ }
+
+ return out
+}
+
+func (c *documentConverter) convert23externalDocumentRef(r v2_3.ExternalDocumentRef) AnyExternalMap {
+ if r.DocumentRefID == "" || r.URI == "" {
+ c.logDropped(r)
+ return nil
+ }
+ return &ExternalMap{
+ ExternalSpdxID: ld.URI(r.DocumentRefID),
+ LocationHint: ld.URI(r.URI),
+ VerifiedUsing: list[IntegrityMethodList](c.convert23checksum, r.Checksum),
+ }
+}
+
+func (c *documentConverter) convert23checksum(checksum common.Checksum) AnyIntegrityMethod {
+ if checksum.Value == "" {
+ c.logDropped(checksum)
+ return nil
+ }
+ return &Hash{
+ Value: checksum.Value,
+ Algorithm: c.hashAlgorithmMap[string(checksum.Algorithm)],
+ }
+}
+
+func (c *documentConverter) convert23annotation(a *v2_3.Annotation) AnyAnnotation {
+ if a == nil {
+ return nil
+ }
+
+ typ, ok := c.annotationTypeMap[strings.ToUpper(a.AnnotationType)]
+ if !ok {
+ c.logDropped(a)
+ return nil
+ }
+
+ out := &Annotation{
+ CreationInfo: &CreationInfo{
+ Created: c.convert23time(a.AnnotationDate),
+ CreatedBy: list[AgentList](c.convert23annotator, &a.Annotator),
+ },
+ Type: typ,
+ Statement: a.AnnotationComment,
+ }
+
+ to, _ := c.idMap[string(a.AnnotationSPDXIdentifier.ElementRefID)].(AnyElement)
+ if to != nil {
+ c.addRelationship(&Relationship{
+ Type: RelationshipType_Describes,
+ From: out,
+ To: ElementList{to},
+ })
+ }
+ return out
+}
+
+func (c *documentConverter) convert23snippet(s v2_3.Snippet) AnyElement {
+ snippetFile, _ := c.idMap[string(s.SnippetFromFileSPDXIdentifier)].(AnyFile)
+
+ var licenses LicenseInfoList
+ d := c.convert23licenseString(s.SnippetLicenseConcluded)
+ d.SetComment(s.SnippetLicenseComments)
+ licenses = append(licenses, d)
+
+ for _, licenseInfo := range s.LicenseInfoInSnippet {
+ d = c.convert23licenseString(licenseInfo)
+ if d != nil {
+ d.SetComment(s.SnippetLicenseComments)
+ licenses = append(licenses, d)
+ }
+ }
+
+ var allSnippets ElementList
+
+ for _, r := range s.Ranges {
+ // there are 2 spots that might hold references to the file, try to handle them both:
+ f, _ := c.idMap[string(r.StartPointer.FileSPDXIdentifier)].(AnyFile)
+ if f == nil {
+ f = snippetFile
+ }
+ if snippetFile == nil {
+ snippetFile = f
+ }
+ newSnippet := &Snippet{
+ ID: string(s.SnippetSPDXIdentifier),
+ Comment: s.SnippetComment,
+ Name: s.SnippetName,
+ CopyrightText: s.SnippetCopyrightText,
+ AttributionTexts: s.SnippetAttributionTexts,
+ FromFile: f,
+ LineRange: &PositiveIntegerRange{
+ BeginIntegerRange: ld.PositiveInt(r.StartPointer.LineNumber),
+ EndIntegerRange: ld.PositiveInt(r.EndPointer.LineNumber),
+ },
+ ByteRange: &PositiveIntegerRange{
+ BeginIntegerRange: ld.PositiveInt(r.StartPointer.Offset),
+ EndIntegerRange: ld.PositiveInt(r.EndPointer.Offset),
+ },
+ }
+
+ for _, l := range licenses {
+ c.addRelationship(&Relationship{
+ Type: RelationshipType_HasConcludedLicense,
+ From: newSnippet,
+ To: ElementList{l},
+ })
+ }
+
+ allSnippets = append(allSnippets, newSnippet)
+ }
+
+ var out AnyElement
+ switch len(allSnippets) {
+ case 0:
+ case 1:
+ out = allSnippets[0]
+ default:
+ out = &Bundle{
+ Elements: allSnippets,
+ }
+ }
+
+ c.idMap[string(s.SnippetSPDXIdentifier)] = out
+
+ if snippetFile != nil {
+ c.addRelationship(&Relationship{
+ Type: RelationshipType_Describes,
+ From: out,
+ To: ElementList{snippetFile},
+ })
+ }
+
+ return out
+}
+
+func appendUnique[T comparable](existing []T, adding ...T) []T {
+ for _, add := range adding {
+ if isNil(add) || slices.Contains(existing, add) {
+ continue
+ }
+ existing = append(existing, add)
+ }
+ return existing
+}
+
+func list[ListType ~[]To, From, To any](convertFunc func(From) To, values ...From) ListType {
+ var out ListType
+ for _, v := range values {
+ if isNil(v) {
+ continue
+ }
+ o := convertFunc(v)
+ if isNil(o) {
+ continue
+ }
+ out = append(out, o)
+ }
+ return out
+}
+
+func isNil(o any) bool {
+ v := reflect.ValueOf(o)
+ return !v.IsValid() || v.IsZero()
+}
+
+func externalIdentifierListEmail(emailAddr string) ExternalIdentifierList {
+ return ExternalIdentifierList{
+ &ExternalIdentifier{
+ Type: ExternalIdentifierType_Email,
+ Identifier: emailAddr,
+ },
+ }
+}
+
+func duplicateLower[T any](m map[string]T) map[string]T {
+ for k, v := range m {
+ m[strings.ToLower(k)] = v
+ }
+ return m
+}
diff --git a/spdx/v3/v3_0/convert_test.go b/spdx/v3/v3_0/convert_test.go
new file mode 100644
index 00000000..bf85fc1f
--- /dev/null
+++ b/spdx/v3/v3_0/convert_test.go
@@ -0,0 +1,173 @@
+package v3_0
+
+import (
+ "testing"
+
+ "github.com/google/go-cmp/cmp"
+ "github.com/google/go-cmp/cmp/cmpopts"
+ "github.com/stretchr/testify/require"
+)
+
+func Test_convertElements(t *testing.T) {
+ tests := []struct {
+ name string
+ expected any
+ convert func(*documentConverter) any
+ }{
+ {
+ name: "creationInfo",
+ expected: v301creationInfo(),
+ convert: func(c *documentConverter) any {
+ return c.convert23creationInfo(v23creationInfo())
+ },
+ },
+ {
+ name: "externalDocumentRef",
+ expected: v301externalMap1(),
+ convert: func(c *documentConverter) any {
+ return c.convert23externalDocumentRef(*v23externalDocumentRef1())
+ },
+ },
+ {
+ name: "snippet",
+ expected: first(v301snippet1(nil)),
+ convert: func(c *documentConverter) any {
+ return c.convert23snippet(*v23snippet1())
+ },
+ },
+ {
+ name: "annotation",
+ expected: v301annotation1(nil),
+ convert: func(c *documentConverter) any {
+ return c.convert23annotation(v23annotation1())
+ },
+ },
+ {
+ name: "otherLicense",
+ expected: v301customLicense1(),
+ convert: func(c *documentConverter) any {
+ return c.convert23license(v23customLicense1())
+ },
+ },
+ {
+ name: "file",
+ expected: first(v301file1()),
+ convert: func(c *documentConverter) any {
+ return c.convert23file(v23file1())
+ },
+ },
+ {
+ name: "package",
+ expected: first(v301package1()),
+ convert: func(c *documentConverter) any {
+ return c.convert23package(v23package1())
+ },
+ },
+ {
+ name: "full document",
+ expected: v301doc(),
+ convert: func(c *documentConverter) any {
+ d := &Document{}
+ From_v2_3(*v23doc(), d)
+ return d
+ },
+ },
+ }
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ c := newTestConverter()
+ got := tt.convert(c)
+ if tt.expected == nil {
+ require.Nil(t, got)
+ return
+ }
+ require.NotNil(t, got)
+ diff := cmp.Diff(tt.expected, got, diffOpts()...)
+ if diff != "" {
+ t.Errorf("mismatch (-want +got):\n%s", diff)
+ }
+ })
+ }
+}
+
+func Test_documentConversion(t *testing.T) {
+ expected := v301doc()
+
+ converted := &Document{}
+ From_v2_3(*v23doc(), converted)
+
+ startPkgs := expected.Elements.Packages()
+ gotPkgs := converted.Elements.Packages()
+ if diff := cmp.Diff(startPkgs, gotPkgs, diffOpts()...); diff != "" {
+ t.Errorf("mismatch (-want +got):\n%s", diff)
+ }
+
+ startRels := expected.Elements.Relationships()
+ gotRels := converted.Elements.Relationships()
+ if diff := cmp.Diff(startRels, gotRels, diffOpts()...); diff != "" {
+ t.Errorf("mismatch (-want +got):\n%s", diff)
+ }
+}
+
+func diffOpts() []cmp.Option {
+ var out []cmp.Option
+ for _, t := range []any{
+ Package{},
+ AIPackage{},
+ Relationship{},
+ File{},
+ Snippet{},
+ Annotation{},
+ Tool{},
+ Person{},
+ Organization{},
+ CustomLicense{},
+ ListedLicense{},
+ SpdxDocument{},
+ SBOM{},
+ } {
+ out = append(out,
+ cmpopts.IgnoreUnexported(t),
+ cmpopts.IgnoreFields(t, "ID", "CreationInfo"),
+ )
+ }
+ for _, t := range []any{
+ SpdxDocument{},
+ SBOM{},
+ Bundle{},
+ } {
+ out = append(out,
+ cmpopts.IgnoreFields(t, "Elements"),
+ )
+ }
+ out = append(out,
+ cmpopts.IgnoreFields(Document{}, "LDContext"),
+ cmpopts.IgnoreFields(CreationInfo{}, "CreatedUsing"),
+ cmpopts.EquateComparable(
+ ExternalIdentifierType{},
+ HashAlgorithm{},
+ FileKindType{},
+ SoftwarePurpose{},
+ PresenceType{},
+ SafetyRiskAssessmentType{},
+ RelationshipCompleteness{},
+ RelationshipType{},
+ AnnotationType{},
+ ProfileIdentifierType{},
+ ExternalIRI{},
+ ),
+ )
+ return out
+}
+
+func newTestConverter() *documentConverter {
+ d := Document{
+ LDContext: context(),
+ }
+ return newDocumentConverter(&d)
+}
+
+func first[T1, T2 any](v1 T1, _ T2) T1 {
+ return v1
+}
diff --git a/spdx/v3/v3_0/convert_v23_test.go b/spdx/v3/v3_0/convert_v23_test.go
new file mode 100644
index 00000000..9822d4e1
--- /dev/null
+++ b/spdx/v3/v3_0/convert_v23_test.go
@@ -0,0 +1,336 @@
+package v3_0
+
+import (
+ "github.com/spdx/tools-golang/spdx/v2/common"
+ "github.com/spdx/tools-golang/spdx/v2/v2_3"
+)
+
+func v23doc() *v2_3.Document {
+ return &v2_3.Document{
+ SPDXVersion: v2_3.Version,
+ DataLicense: v2_3.DataLicense,
+ SPDXIdentifier: "SPDXRef-DOCUMENT",
+ DocumentName: "Example Software Package",
+ DocumentComment: "This is a sample SPDX document for testing purposes.",
+ CreationInfo: v23creationInfo(),
+ DocumentNamespace: "https://example.com/spdx/example-software-1.0.0",
+ ExternalDocumentReferences: []v2_3.ExternalDocumentRef{
+ *v23externalDocumentRef1(),
+ *v23externalDocumentRef2(),
+ },
+ Packages: []*v2_3.Package{
+ v23package1(),
+ v23package2(),
+ },
+ Files: []*v2_3.File{
+ v23file1(),
+ v23file2(),
+ },
+ OtherLicenses: []*v2_3.OtherLicense{
+ v23customLicense1(),
+ v23customLicense2(),
+ },
+ Annotations: []*v2_3.Annotation{
+ v23annotation1(),
+ v23annotation2(),
+ },
+ Snippets: []v2_3.Snippet{
+ *v23snippet1(),
+ *v23snippet2(),
+ },
+ Relationships: []*v2_3.Relationship{
+ {
+ RefA: common.DocElementID{ElementRefID: "SPDXRef-DOCUMENT"},
+ RefB: common.DocElementID{ElementRefID: "SPDXRef-Package-ExampleLib"}, // pkg1
+ Relationship: common.TypeRelationshipDescribe,
+ RelationshipComment: "Document describes the main package",
+ },
+ {
+ RefA: common.DocElementID{ElementRefID: "SPDXRef-Package-ExampleLib"},
+ RefB: common.DocElementID{ElementRefID: "SPDXRef-Package-UtilityTools"},
+ Relationship: common.TypeRelationshipDependsOn,
+ RelationshipComment: "Main package depends on utility tools",
+ },
+ {
+ RefA: common.DocElementID{ElementRefID: "SPDXRef-Package-ExampleLib"},
+ RefB: common.DocElementID{ElementRefID: "SPDXRef-File-Main"},
+ Relationship: common.TypeRelationshipContains,
+ RelationshipComment: "Package contains main source file",
+ },
+ },
+ // Reviews are dropped
+ }
+}
+
+func v23creationInfo() *v2_3.CreationInfo {
+ return &v2_3.CreationInfo{
+ Created: "2023-01-15T10:30:00Z",
+ Creators: []common.Creator{
+ {CreatorType: "Person", Creator: "John Doe (john@example.com)"},
+ {CreatorType: "Tool", Creator: "tools-golang-v1.1.0"},
+ },
+ LicenseListVersion: "3.19",
+ CreatorComment: "Created during automated build process",
+ }
+}
+
+func v23package1() *v2_3.Package {
+ return &v2_3.Package{
+ Annotations: []v2_3.Annotation{
+ *v23annotation1(),
+ },
+ PackageName: "example-library",
+ PackageSPDXIdentifier: "SPDXRef-Package-ExampleLib",
+ PackageDescription: "This is a detailed description of the example library package.",
+ PackageVersion: "1.2.3",
+ PackageSupplier: &common.Supplier{
+ Supplier: "Example Corp (support@example.com)",
+ SupplierType: "Organization",
+ },
+ PackageOriginator: &common.Originator{
+ Originator: "Jane Smith (jane@example.com)",
+ OriginatorType: "Person",
+ },
+ PackageDownloadLocation: "https://github.com/example/library/archive/v1.2.3.tar.gz",
+ FilesAnalyzed: true,
+ Files: []*v2_3.File{
+ v23file1(),
+ },
+ IsFilesAnalyzedTagPresent: true,
+ PackageVerificationCode: &common.PackageVerificationCode{
+ Value: "d6a770ba38583ed4bb4525bd96e50461655d2758",
+ ExcludedFiles: []string{"./exclude1.txt", "./exclude2.txt"},
+ },
+ PackageChecksums: []common.Checksum{
+ {Algorithm: common.SHA1, Value: "aabbccdd"},
+ {Algorithm: common.SHA256, Value: "11223344"},
+ },
+ PackageHomePage: "https://example.com/library",
+ PackageSourceInfo: "Built from git tag v1.2.3",
+ PackageLicenseConcluded: "MIT",
+ PackageLicenseInfoFromFiles: []string{"MIT", "Apache-2.0"},
+ PackageLicenseDeclared: "MIT",
+ PackageLicenseComments: "License determined from LICENSE file",
+ PackageCopyrightText: "Copyright 2023 Example Corp",
+ PackageSummary: "A sample library for demonstration",
+ PackageComment: "Package built with standard configuration",
+ PackageExternalReferences: []*v2_3.PackageExternalReference{
+ {
+ Category: common.CategoryPackageManager,
+ RefType: common.TypePackageManagerPURL,
+ Locator: "pkg:npm/example-library@1.2.3",
+ ExternalRefComment: "NPM package reference",
+ },
+ {
+ Category: common.CategoryPackageManager,
+ RefType: common.TypePackageManagerPURL,
+ Locator: "pkg:npm/example-library-main@1.2.3",
+ },
+ {
+ Category: common.CategorySecurity,
+ RefType: common.TypeSecurityCPE23Type,
+ Locator: "cpe:2.3:a:example:library:1.2.3:*:*:*:*:*:*:*",
+ ExternalRefComment: "CPE reference for security scanning",
+ },
+ },
+ PackageAttributionTexts: []string{
+ "This package includes code from Project ABC",
+ "Special thanks to the open source community",
+ },
+ PrimaryPackagePurpose: "Library", // TODO constant?
+ ReleaseDate: "2023-01-10T00:00:00Z",
+ BuiltDate: "2023-01-15T08:00:00Z",
+ ValidUntilDate: "2025-01-10T00:00:00Z",
+ }
+}
+
+func v23package2() *v2_3.Package {
+ return &v2_3.Package{
+ PackageName: "utility-tools",
+ PackageSPDXIdentifier: "SPDXRef-Package-UtilityTools",
+ PackageVersion: "2.1.0",
+ PackageSupplier: &common.Supplier{
+ Supplier: "Bob Johnson (bob@tools.com)",
+ SupplierType: "Person",
+ },
+ PackageDownloadLocation: "https://tools.com/download/utility-tools-2.1.0.zip",
+ FilesAnalyzed: false,
+ IsFilesAnalyzedTagPresent: true,
+ PackageChecksums: []common.Checksum{
+ {Algorithm: common.SHA256, Value: "ffaabbcc11223344"},
+ },
+ PackageHomePage: "https://tools.com/utility",
+ PackageLicenseConcluded: "Apache-2.0",
+ PackageLicenseDeclared: "Apache-2.0",
+ PackageCopyrightText: "Copyright 2023 Tools Inc",
+ PackageSummary: "Collection of utility tools",
+ PackageDescription: "A comprehensive set of utility tools for developers.",
+ PrimaryPackagePurpose: "Application", // TODO constant?
+ }
+}
+func v23customLicense1() *v2_3.OtherLicense {
+ return &v2_3.OtherLicense{
+ LicenseIdentifier: "LicenseRef-CustomLicense1",
+ ExtractedText: "This is a custom license text for demonstration purposes.\n\nPermission is granted to use this software...",
+ LicenseName: "Custom Example License",
+ LicenseCrossReferences: []string{
+ "https://example.com/licenses/custom",
+ },
+ LicenseComment: "Custom license used for internal tools",
+ }
+}
+
+func v23customLicense2() *v2_3.OtherLicense {
+ return &v2_3.OtherLicense{
+ LicenseIdentifier: "LicenseRef-CustomLicense2",
+ ExtractedText: "Another custom license text with different terms.\n\nThis software may be used under the following conditions...",
+ LicenseName: "Another Custom License",
+ LicenseCrossReferences: []string{
+ "https://example.com/licenses/another-custom",
+ "https://internal.example.com/legal/licenses",
+ },
+ LicenseComment: "License for third-party components",
+ }
+}
+
+func v23file1() *v2_3.File {
+ return &v2_3.File{
+ FileName: "./src/other.c",
+ FileSPDXIdentifier: common.ElementID("SPDXRef-File-Other"),
+ FileTypes: []string{"FILE"},
+ Checksums: []common.Checksum{
+ {Algorithm: common.SHA1, Value: "da39a3ee5e6b4b0d3255bfef95601890afd80709"},
+ {Algorithm: common.MD5, Value: "d41d8cd98f00b204e9800998ecf8427e"},
+ },
+ LicenseConcluded: "MIT",
+ LicenseInfoInFiles: []string{"MIT"},
+ LicenseComments: "License applies to this file",
+ FileCopyrightText: "Copyright 2023 Example Corp",
+ ArtifactOfProjects: []*v2_3.ArtifactOfProject{},
+ FileComment: "Other application entry point",
+ FileNotice: "This file contains the other function",
+ FileContributors: []string{"Other John Doe (john@doe.com)", "Jane Smith "},
+ FileAttributionTexts: []string{
+ "Based on other example code from something",
+ },
+ //FileDependencies: nil, // skipped
+ Snippets: map[common.ElementID]*v2_3.Snippet{
+ "SPDXRef-Snippet1": v23snippet1(),
+ },
+ Annotations: []v2_3.Annotation{
+ *v23annotation1(),
+ },
+ FileDependencies: []string{"dep1", "dep2"},
+ }
+}
+
+func v23file2() *v2_3.File {
+ return &v2_3.File{
+ FileName: "./include/header.h",
+ FileSPDXIdentifier: common.ElementID("SPDXRef-File-Header"),
+ Checksums: []common.Checksum{
+ {Algorithm: common.SHA256, Value: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},
+ },
+ LicenseConcluded: "MIT",
+ LicenseInfoInFiles: []string{"MIT"},
+ FileCopyrightText: "Copyright 2023 Example Corp",
+ FileComment: "Header file with function declarations",
+ FileTypes: []string{"HEADER"},
+ }
+}
+
+func v23externalDocumentRef1() *v2_3.ExternalDocumentRef {
+ return &v2_3.ExternalDocumentRef{
+ DocumentRefID: "DocumentRef-External1",
+ URI: "https://external.com/spdx/external-doc-1.0.0",
+ Checksum: common.Checksum{
+ Algorithm: common.SHA1,
+ Value: "da39a3ee5e6b4b0d3255bfef95601890afd80709",
+ },
+ }
+}
+
+func v23externalDocumentRef2() *v2_3.ExternalDocumentRef {
+ return &v2_3.ExternalDocumentRef{
+ DocumentRefID: "DocumentRef-External2",
+ URI: "https://external2.com/spdx/external-doc-2.0.0",
+ Checksum: common.Checksum{
+ Algorithm: common.SHA256,
+ Value: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ },
+ }
+}
+
+func v23annotation1() *v2_3.Annotation {
+ return &v2_3.Annotation{
+ Annotator: common.Annotator{
+ Annotator: "Person: Security Team (security@example.com)",
+ AnnotatorType: "Person",
+ },
+ AnnotationType: "REVIEW",
+ AnnotationSPDXIdentifier: common.DocElementID{ElementRefID: "SPDXRef-Package-ExampleLib"},
+ AnnotationDate: "2023-01-20T14:30:00Z",
+ AnnotationComment: "Security review completed - no vulnerabilities found",
+ }
+}
+
+func v23annotation2() *v2_3.Annotation {
+ return &v2_3.Annotation{
+ Annotator: common.Annotator{
+ Annotator: "Tool: vulnerability-scanner-v1.5",
+ AnnotatorType: "Tool",
+ },
+ AnnotationType: "OTHER",
+ AnnotationSPDXIdentifier: common.DocElementID{ElementRefID: "SPDXRef-Package-UtilityTools"},
+ AnnotationDate: "2023-01-21T09:15:00Z",
+ AnnotationComment: "Automated scan completed - clean",
+ }
+}
+
+func v23snippet1() *v2_3.Snippet {
+ return &v2_3.Snippet{
+ SnippetSPDXIdentifier: common.ElementID("SPDXRef-Snippet1"),
+ SnippetFromFileSPDXIdentifier: common.ElementID("SPDXRef-File-Main"),
+ Ranges: []common.SnippetRange{
+ {
+ StartPointer: common.SnippetRangePointer{
+ Offset: 100,
+ LineNumber: 10,
+ },
+ EndPointer: common.SnippetRangePointer{
+ Offset: 200,
+ LineNumber: 15,
+ },
+ },
+ },
+ SnippetLicenseConcluded: "MIT",
+ LicenseInfoInSnippet: []string{"MIT"},
+ SnippetLicenseComments: "License applies to this code snippet",
+ SnippetCopyrightText: "Copyright 2023 Example Corp",
+ SnippetComment: "Key algorithm implementation",
+ SnippetName: "Core Algorithm",
+ SnippetAttributionTexts: []string{"Algorithm based on research paper XYZ"},
+ }
+}
+
+func v23snippet2() *v2_3.Snippet {
+ return &v2_3.Snippet{
+ SnippetSPDXIdentifier: common.ElementID("SPDXRef-Snippet2"),
+ SnippetFromFileSPDXIdentifier: common.ElementID("SPDXRef-File-Header"),
+ Ranges: []common.SnippetRange{
+ {
+ StartPointer: common.SnippetRangePointer{Offset: 50},
+ EndPointer: common.SnippetRangePointer{Offset: 150},
+ },
+ {
+ StartPointer: common.SnippetRangePointer{LineNumber: 5},
+ EndPointer: common.SnippetRangePointer{LineNumber: 8},
+ },
+ },
+ SnippetLicenseConcluded: "MIT",
+ LicenseInfoInSnippet: []string{"MIT"},
+ SnippetCopyrightText: "Copyright 2023 Example Corp",
+ SnippetComment: "Function declarations",
+ SnippetName: "API Declarations",
+ }
+}
diff --git a/spdx/v3/v3_0/convert_v301_test.go b/spdx/v3/v3_0/convert_v301_test.go
new file mode 100644
index 00000000..14faa178
--- /dev/null
+++ b/spdx/v3/v3_0/convert_v301_test.go
@@ -0,0 +1,506 @@
+package v3_0
+
+import (
+ "time"
+
+ "github.com/spdx/tools-golang/spdx/v2/v2_3"
+ "github.com/spdx/tools-golang/spdx/v3/internal/ld"
+)
+
+func v301doc() *Document {
+ ci := v301creationInfo()
+
+ d := NewDocument(
+ ProfileIdentifierType_Software,
+ "Example Software Package",
+ ci.CreatedBy[0],
+ ci.CreatedUsing[0],
+ )
+ d.DataLicense = &ListedLicense{
+ Name: v2_3.DataLicense,
+ }
+ d.SpdxDocument.ID = "SPDXRef-DOCUMENT"
+ d.CreationInfo.(*CreationInfo).Created = parseTime("2023-01-15T10:30:00Z")
+ d.SpdxDocument.Comment = "This is a sample SPDX document for testing purposes."
+ d.NamespaceMaps = NamespaceMapList{
+ &NamespaceMap{
+ Namespace: "https://example.com/spdx/example-software-1.0.0",
+ },
+ }
+
+ sbom := &SBOM{}
+ d.RootElements = ElementList{sbom}
+
+ // Add external document references
+ d.Imports = ExternalMapList{
+ v301externalMap1(),
+ v301externalMap2(),
+ }
+
+ sbom.Elements = append(sbom.Elements,
+ v301customLicense1(),
+ v301customLicense2(),
+ )
+
+ pkg1, extraElems := v301package1()
+ sbom.Elements = append(sbom.Elements, extraElems...)
+ sbom.Elements = append(sbom.Elements, pkg1)
+
+ // pkg1 is the only thing referenced directly as a document root element
+ sbom.RootElements = append(sbom.RootElements, pkg1)
+
+ pkg2, extraElems := v301package2()
+ sbom.Elements = append(sbom.Elements, extraElems...)
+ sbom.Elements = append(sbom.Elements, pkg2)
+
+ file1, extraElems := v301file1()
+ sbom.Elements = append(sbom.Elements, file1)
+ sbom.Elements = append(sbom.Elements, extraElems...)
+
+ file2, extraElems := v301file2()
+ sbom.Elements = append(sbom.Elements, file2)
+ sbom.Elements = append(sbom.Elements, extraElems...)
+
+ sbom.Elements = append(sbom.Elements,
+ v301annotation1(pkg1),
+ v301annotation2(pkg2),
+ )
+
+ snippet1, extraElems := v301snippet1(file1)
+ sbom.Elements = append(sbom.Elements, snippet1)
+ sbom.Elements = append(sbom.Elements, extraElems...)
+
+ snippet2, extraElems := v301snippet2(file2)
+ sbom.Elements = append(sbom.Elements, snippet2)
+ sbom.Elements = append(sbom.Elements, extraElems...)
+
+ sbom.Elements = append(sbom.Elements,
+ // SpdxRef-DOCUMENT relationships are handled by object structure
+ &Relationship{
+ From: pkg1,
+ To: ElementList{pkg2},
+ Type: RelationshipType_DependsOn,
+ Comment: "Main package depends on utility tools",
+ },
+ &Relationship{
+ From: pkg1,
+ To: ElementList{file1},
+ Type: RelationshipType_Contains,
+ Comment: "Package contains main source file",
+ },
+ )
+
+ return d
+}
+
+func v301creationInfo() *CreationInfo {
+ return &CreationInfo{
+ SpecVersion: Version,
+ Created: parseTime("2023-01-15T10:30:00Z"),
+ CreatedBy: AgentList{
+ &Person{
+ Name: "John Doe",
+ ExternalIdentifiers: externalIdentifierListEmail("john@example.com"),
+ },
+ },
+ CreatedUsing: ToolList{
+ &Tool{
+ Name: "tools-golang-v1.1.0",
+ },
+ },
+
+ //LicenseListVersion: "3.19",
+ Comment: "Created during automated build process",
+ }
+}
+
+func v301package1() (*Package, ElementList) {
+ p := &Package{
+ ID: "SPDXRef-Package-ExampleLib",
+ Name: "example-library",
+ Description: "This is a detailed description of the example library package.",
+ Summary: "A sample library for demonstration",
+ Comment: "Package built with standard configuration" + ";License determined from LICENSE file",
+
+ VerifiedUsing: IntegrityMethodList{
+ &PackageVerificationCode{
+ Algorithm: HashAlgorithm_Sha1,
+ HashValue: "d6a770ba38583ed4bb4525bd96e50461655d2758",
+ ExcludedFiles: []string{"./exclude1.txt", "./exclude2.txt"},
+ },
+ &Hash{
+ Algorithm: HashAlgorithm_Sha1,
+ Value: "aabbccdd",
+ },
+ &Hash{
+ Algorithm: HashAlgorithm_Sha256,
+ Value: "11223344",
+ },
+ },
+ ExternalIdentifiers: ExternalIdentifierList{
+ &ExternalIdentifier{
+ Type: ExternalIdentifierType_PackageURL,
+ Identifier: "pkg:npm/example-library@1.2.3",
+ Comment: "NPM package reference",
+ },
+ &ExternalIdentifier{
+ Type: ExternalIdentifierType_Cpe23,
+ Identifier: "cpe:2.3:a:example:library:1.2.3:*:*:*:*:*:*:*",
+ Comment: "CPE reference for security scanning",
+ },
+ },
+ SuppliedBy: &Organization{
+ Name: "Example Corp",
+ ExternalIdentifiers: externalIdentifierListEmail("support@example.com"),
+ },
+
+ OriginatedBy: AgentList{
+ &Person{
+ Name: "Jane Smith",
+ ExternalIdentifiers: externalIdentifierListEmail("jane@example.com"),
+ },
+ },
+
+ ReleaseTime: parseTime("2023-01-10T00:00:00Z"),
+ BuiltTime: parseTime("2023-01-15T08:00:00Z"),
+ ValidUntilTime: parseTime("2025-01-10T00:00:00Z"),
+ CopyrightText: "Copyright 2023 Example Corp",
+ AttributionTexts: []string{
+ "This package includes code from Project ABC",
+ "Special thanks to the open source community",
+ },
+ //FilesAnalyzed: true,
+ PrimaryPurpose: SoftwarePurpose_Library,
+ Version: "1.2.3",
+ HomePage: "https://example.com/library",
+ SourceInfo: "Built from git tag v1.2.3",
+ DownloadLocation: "https://github.com/example/library/archive/v1.2.3.tar.gz",
+ PackageURL: "pkg:npm/example-library-main@1.2.3",
+ }
+
+ // comment was appended to pkg comment: "License determined from LICENSE file"
+
+ l := &ListedLicense{}
+ l.Name = "MIT"
+
+ l2 := &ListedLicense{}
+ l2.Name = "Apache-2.0"
+
+ r1 := &Relationship{
+ Type: RelationshipType_HasConcludedLicense,
+ To: ElementList{l},
+ From: p,
+ }
+
+ r2 := &Relationship{
+ Type: RelationshipType_HasDeclaredLicense,
+ To: ElementList{l},
+ From: p,
+ }
+
+ r3 := &Relationship{
+ Type: RelationshipType_HasConcludedLicense,
+ To: ElementList{l2},
+ From: p,
+ }
+
+ return p, ElementList{l, r1, r2, l2, r3}
+}
+
+func v301package2() (*Package, ElementList) {
+ p := &Package{
+ ID: "SPDXRef-Package-UtilityTools",
+ Name: "utility-tools",
+ Description: "A comprehensive set of utility tools for developers.",
+ Summary: "Collection of utility tools",
+
+ VerifiedUsing: IntegrityMethodList{
+ &Hash{
+ Algorithm: HashAlgorithm_Sha256,
+ Value: "ffaabbcc11223344",
+ },
+ },
+ SuppliedBy: &Person{
+ Name: "Bob Johnson",
+ ExternalIdentifiers: externalIdentifierListEmail("bob@tools.com"),
+ },
+ CopyrightText: "Copyright 2023 Tools Inc",
+ PrimaryPurpose: SoftwarePurpose_Application,
+ Version: "2.1.0",
+ HomePage: ld.URI("https://tools.com/utility"),
+ DownloadLocation: ld.URI("https://tools.com/download/utility-tools-2.1.0.zip"),
+ }
+
+ l := &ListedLicense{}
+ l.Name = "Apache-2.0"
+
+ r1 := &Relationship{
+ Type: RelationshipType_HasConcludedLicense,
+ To: ElementList{l},
+ From: p,
+ }
+
+ r2 := &Relationship{
+ Type: RelationshipType_HasDeclaredLicense,
+ To: ElementList{l},
+ From: p,
+ }
+
+ return p, ElementList{l, r1, r2}
+}
+
+func v301customLicense1() AnyLicense {
+ return &CustomLicense{
+ ID: "LicenseRef-CustomLicense1",
+ Name: "Custom Example License",
+ Comment: "Custom license used for internal tools",
+ SeeAlsos: []ld.URI{
+ "https://example.com/licenses/custom",
+ },
+ Text: "This is a custom license text for demonstration purposes.\n\nPermission is granted to use this software...",
+ }
+}
+
+func v301customLicense2() AnyLicense {
+ return &CustomLicense{
+ ID: "LicenseRef-CustomLicense2",
+ Name: "Another Custom License",
+ Comment: "License for third-party components",
+ SeeAlsos: []ld.URI{
+ "https://example.com/licenses/another-custom",
+ "https://internal.example.com/legal/licenses",
+ },
+ Text: "Another custom license text with different terms.\n\nThis software may be used under the following conditions...",
+ }
+}
+
+func v301file1() (AnyFile, ElementList) {
+ f := &File{
+ ID: "SPDXRef-File-Other",
+ Name: "./src/other.c",
+ VerifiedUsing: IntegrityMethodList{
+ &Hash{
+ Value: "da39a3ee5e6b4b0d3255bfef95601890afd80709",
+ Algorithm: HashAlgorithm_Sha1,
+ },
+ &Hash{
+ Value: "d41d8cd98f00b204e9800998ecf8427e",
+ Algorithm: HashAlgorithm_Md5,
+ },
+ },
+ Comment: "Other application entry point",
+ Description: "This file contains the other function",
+ OriginatedBy: AgentList{
+ &Person{
+ Name: "Other John Doe",
+ ExternalIdentifiers: externalIdentifierListEmail("john@doe.com"),
+ },
+ &Person{
+ Name: "Jane Smith",
+ ExternalIdentifiers: externalIdentifierListEmail("jane.smith@example.org"),
+ },
+ },
+
+ CopyrightText: "Copyright 2023 Example Corp",
+ AttributionTexts: []string{
+ "Based on other example code from something",
+ },
+ //FileTypes: []FileType{
+ // FileType_Source,
+ //},
+ //PrimaryPurpose: SoftwarePurpose_Source,
+ Kind: FileKindType_File,
+ }
+
+ l := &ListedLicense{}
+ l.Name = "MIT"
+
+ r1 := &Relationship{
+ Type: RelationshipType_HasConcludedLicense,
+ To: ElementList{l},
+ From: f,
+ }
+
+ r2 := &Relationship{
+ Type: RelationshipType_HasDeclaredLicense,
+ To: ElementList{l},
+ From: f,
+ }
+
+ return f, ElementList{l, r1, r2}
+}
+
+func v301file2() (*File, ElementList) {
+ f := &File{
+ ID: "SPDXRef-File-Header",
+
+ Name: "./include/header.h",
+ VerifiedUsing: IntegrityMethodList{
+ &Hash{
+ Value: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ Algorithm: HashAlgorithm_Sha256,
+ },
+ },
+ Comment: "Header file with function declarations",
+ CopyrightText: "Copyright 2023 Example Corp",
+ //FileTypes: []FileType{
+ // FileType_Header,
+ //},
+ }
+
+ l := &ListedLicense{}
+ l.Name = "MIT"
+
+ r1 := &Relationship{
+ Type: RelationshipType_HasConcludedLicense,
+ To: ElementList{l},
+ From: f,
+ }
+
+ r2 := &Relationship{
+ Type: RelationshipType_HasDeclaredLicense,
+ To: ElementList{l},
+ From: f,
+ }
+
+ return f, ElementList{l, r1, r2}
+}
+
+func v301externalMap1() *ExternalMap {
+ return &ExternalMap{
+ ExternalSpdxID: "DocumentRef-External1",
+ LocationHint: "https://external.com/spdx/external-doc-1.0.0",
+ VerifiedUsing: IntegrityMethodList{
+ &Hash{
+ Algorithm: HashAlgorithm_Sha1,
+ Value: "da39a3ee5e6b4b0d3255bfef95601890afd80709",
+ },
+ },
+ }
+}
+
+func v301externalMap2() *ExternalMap {
+ return &ExternalMap{
+ ExternalSpdxID: "DocumentRef-External2",
+ LocationHint: "https://external2.com/spdx/external-doc-2.0.0",
+ VerifiedUsing: IntegrityMethodList{
+ &Hash{
+ Algorithm: HashAlgorithm_Sha256,
+ Value: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ },
+ },
+ }
+}
+
+func v301annotation1(subject AnyElement) *Annotation {
+ return &Annotation{
+ Type: AnnotationType_Review,
+ ID: "SPDXRef-Annotation-1",
+ CreationInfo: &CreationInfo{
+ Created: parseTime("2023-01-20T14:30:00Z"),
+ CreatedBy: AgentList{
+ &Person{
+ Name: "Security Team",
+ ExternalIdentifiers: externalIdentifierListEmail("security@example.com"),
+ },
+ },
+ },
+ Subject: subject,
+ Statement: "Security review completed - no vulnerabilities found",
+ }
+}
+
+func v301annotation2(subject AnyElement) *Annotation {
+ return &Annotation{
+ Type: AnnotationType_Other,
+ ID: "SPDXRef-Annotation-2",
+ CreationInfo: &CreationInfo{
+ Created: parseTime("2023-01-21T09:15:00Z"),
+ CreatedBy: AgentList{
+ &Person{
+ Name: "vulnerability-scanner-v1.5",
+ },
+ },
+ },
+ Comment: "Automated scan completed - clean",
+ Subject: subject,
+ }
+}
+
+func v301snippet1(fileRef AnyFile) (AnyElement, ElementList) {
+ s := &Snippet{
+ ID: "SPDXRef-Snippet1",
+ Name: "Core Algorithm",
+ Comment: "Key algorithm implementation",
+ CopyrightText: "Copyright 2023 Example Corp",
+ AttributionTexts: []string{"Algorithm based on research paper XYZ"},
+ FromFile: fileRef,
+ ByteRange: &PositiveIntegerRange{
+ BeginIntegerRange: 100,
+ EndIntegerRange: 200,
+ },
+ LineRange: &PositiveIntegerRange{
+ BeginIntegerRange: 10,
+ EndIntegerRange: 15,
+ },
+
+ //LicenseComments: "License applies to this code snippet",
+ }
+
+ l := &ListedLicense{}
+ l.Name = "MIT"
+
+ r1 := &Relationship{
+ Type: RelationshipType_HasConcludedLicense,
+ To: ElementList{l},
+ From: s,
+ }
+
+ r2 := &Relationship{
+ Type: RelationshipType_HasDeclaredLicense,
+ To: ElementList{l},
+ From: s,
+ }
+
+ return s, ElementList{l, r1, r2}
+}
+
+func v301snippet2(fileRef AnyFile) (AnySnippet, ElementList) {
+ s := &Snippet{
+ ID: "SPDXRef-Snippet2",
+ Name: "API Declarations",
+ Comment: "Function declarations",
+ CopyrightText: "Copyright 2023 Example Corp",
+ FromFile: fileRef,
+ ByteRange: &PositiveIntegerRange{
+ EndIntegerRange: 50,
+ BeginIntegerRange: 150,
+ },
+ LineRange: &PositiveIntegerRange{
+ EndIntegerRange: 5,
+ BeginIntegerRange: 8,
+ },
+ }
+
+ l := &ListedLicense{}
+ l.Name = "MIT"
+
+ r1 := &Relationship{
+ Type: RelationshipType_HasConcludedLicense,
+ To: ElementList{l},
+ From: s,
+ }
+
+ r2 := &Relationship{
+ Type: RelationshipType_HasDeclaredLicense,
+ To: ElementList{l},
+ From: s,
+ }
+
+ return s, ElementList{l, r1, r2}
+}
+
+func parseTime(s string) time.Time {
+ t, _ := time.Parse(time.RFC3339, s)
+ return t
+}
diff --git a/spdx/v3/v3_0/model.go b/spdx/v3/v3_0/model.go
new file mode 100755
index 00000000..56a24b4d
--- /dev/null
+++ b/spdx/v3/v3_0/model.go
@@ -0,0 +1,12757 @@
+// Generated by github.com/spdx/tools-golang/spdx/v3/internal/ld
+//
+// SPDX-License-Identifier: MIT
+
+package v3_0
+
+import (
+ "time"
+
+ "github.com/spdx/tools-golang/spdx/v3/internal/ld"
+)
+
+type AnyAIPackage interface {
+ AnyPackage
+ asAIPackage()
+ GetDomains() []string
+ SetDomains([]string)
+ GetEnergyConsumption() AnyEnergyConsumption
+ SetEnergyConsumption(AnyEnergyConsumption)
+ GetModelDataPreprocessings() []string
+ SetModelDataPreprocessings([]string)
+ GetUseSensitivePersonalInformation() PresenceType
+ SetUseSensitivePersonalInformation(PresenceType)
+ GetAutonomyType() PresenceType
+ SetAutonomyType(PresenceType)
+ GetSafetyRiskAssessment() SafetyRiskAssessmentType
+ SetSafetyRiskAssessment(SafetyRiskAssessmentType)
+ GetHyperparameters() DictionaryEntryList
+ SetHyperparameters(DictionaryEntryList)
+ GetLimitation() string
+ SetLimitation(string)
+ GetModelExplainabilities() []string
+ SetModelExplainabilities([]string)
+ GetStandardCompliances() []string
+ SetStandardCompliances([]string)
+ GetMetricDecisionThresholds() DictionaryEntryList
+ SetMetricDecisionThresholds(DictionaryEntryList)
+ GetTypeOfModels() []string
+ SetTypeOfModels([]string)
+ GetInformationAboutApplication() string
+ SetInformationAboutApplication(string)
+ GetInformationAboutTraining() string
+ SetInformationAboutTraining(string)
+ GetMetrics() DictionaryEntryList
+ SetMetrics(DictionaryEntryList)
+}
+
+// AIPackage Specifies an AI package and its associated information.
+type AIPackage struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/AI/AIPackage" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // StandardNames The name of a relevant standard that may apply to an artifact.
+ StandardNames []string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/standardName" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // BuiltTime Specifies the time an artifact was built.
+ BuiltTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/builtTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ReleaseTime Specifies the time an artifact was released.
+ ReleaseTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/releaseTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // SupportLevels Specifies the level of support associated with an artifact.
+ SupportLevels []SupportType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/supportLevel" type:"https://spdx.org/rdf/3.0.1/terms/Core/SupportType"`
+ // SuppliedBy Identifies who or what supplied the artifact or VulnAssessmentRelationship referenced by the Element.
+ SuppliedBy AnyAgent `iri:"https://spdx.org/rdf/3.0.1/terms/Core/suppliedBy" type:"https://spdx.org/rdf/3.0.1/terms/Core/Agent"`
+ // OriginatedBy Identifies from where or whom the Element originally came.
+ OriginatedBy AgentList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/originatedBy" type:"https://spdx.org/rdf/3.0.1/terms/Core/Agent"`
+ // ValidUntilTime Specifies until when the artifact can be used before its usage needs to be reassessed.
+ ValidUntilTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/validUntilTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ContentIdentifiers A canonical, unique, immutable identifier of the artifact content, that may be used for verifying its identity and/or integrity.
+ ContentIdentifiers ContentIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Software/contentIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Software/ContentIdentifier"`
+ // AttributionTexts Provides a place for the SPDX data creator to record acknowledgement text for a software Package, File or Snippet.
+ AttributionTexts []string `iri:"https://spdx.org/rdf/3.0.1/terms/Software/attributionText" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // AdditionalPurposes Provides additional purpose information of the software artifact.
+ AdditionalPurposes []SoftwarePurpose `iri:"https://spdx.org/rdf/3.0.1/terms/Software/additionalPurpose" type:"https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose"`
+ // PrimaryPurpose Provides information about the primary purpose of the software artifact.
+ PrimaryPurpose SoftwarePurpose `iri:"https://spdx.org/rdf/3.0.1/terms/Software/primaryPurpose" type:"https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose"`
+ // CopyrightText Identifies the text of one or more copyright notices for a software Package, File or Snippet, if any.
+ CopyrightText string `iri:"https://spdx.org/rdf/3.0.1/terms/Software/copyrightText" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // SourceInfo Records any relevant background information or additional comments about the origin of the package.
+ SourceInfo string `iri:"https://spdx.org/rdf/3.0.1/terms/Software/sourceInfo" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // HomePage A place for the SPDX document creator to record a website that serves as the package's home page.
+ HomePage URI `iri:"https://spdx.org/rdf/3.0.1/terms/Software/homePage" type:"http://www.w3.org/2001/XMLSchema#anyURI"`
+ // Version Identify the version of a package.
+ Version string `iri:"https://spdx.org/rdf/3.0.1/terms/Software/packageVersion" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // PackageURL Provides a place for the SPDX data creator to record the package URL string (in accordance with the Package URL specification) for a software Package.
+ PackageURL URI `iri:"https://spdx.org/rdf/3.0.1/terms/Software/packageUrl" type:"http://www.w3.org/2001/XMLSchema#anyURI"`
+ // DownloadLocation Identifies the download Uniform Resource Identifier for the package at the time that the document was created.
+ DownloadLocation URI `iri:"https://spdx.org/rdf/3.0.1/terms/Software/downloadLocation" type:"http://www.w3.org/2001/XMLSchema#anyURI"`
+ // Domains Captures the domain in which the AI package can be used.
+ Domains []string `iri:"https://spdx.org/rdf/3.0.1/terms/AI/domain" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // EnergyConsumption Indicates the amount of energy consumption incurred by an AI model.
+ EnergyConsumption AnyEnergyConsumption `iri:"https://spdx.org/rdf/3.0.1/terms/AI/energyConsumption" type:"https://spdx.org/rdf/3.0.1/terms/AI/EnergyConsumption"`
+ // ModelDataPreprocessings Describes all the preprocessing steps applied to the training data before the model training.
+ ModelDataPreprocessings []string `iri:"https://spdx.org/rdf/3.0.1/terms/AI/modelDataPreprocessing" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // UseSensitivePersonalInformation Records if sensitive personal information is used during model training or could be used during the inference.
+ UseSensitivePersonalInformation PresenceType `iri:"https://spdx.org/rdf/3.0.1/terms/AI/useSensitivePersonalInformation" type:"https://spdx.org/rdf/3.0.1/terms/Core/PresenceType"`
+ // AutonomyType Indicates whether the system can perform a decision or action without human involvement or guidance.
+ AutonomyType PresenceType `iri:"https://spdx.org/rdf/3.0.1/terms/AI/autonomyType" type:"https://spdx.org/rdf/3.0.1/terms/Core/PresenceType"`
+ // SafetyRiskAssessment Records the results of general safety risk assessment of the AI system.
+ SafetyRiskAssessment SafetyRiskAssessmentType `iri:"https://spdx.org/rdf/3.0.1/terms/AI/safetyRiskAssessment" type:"https://spdx.org/rdf/3.0.1/terms/AI/SafetyRiskAssessmentType"`
+ // Hyperparameters Records a hyperparameter used to build the AI model contained in the AI package.
+ Hyperparameters DictionaryEntryList `iri:"https://spdx.org/rdf/3.0.1/terms/AI/hyperparameter" type:"https://spdx.org/rdf/3.0.1/terms/Core/DictionaryEntry"`
+ // Limitation Captures a limitation of the AI software.
+ Limitation string `iri:"https://spdx.org/rdf/3.0.1/terms/AI/limitation" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // ModelExplainabilities Describes methods that can be used to explain the results from the AI model.
+ ModelExplainabilities []string `iri:"https://spdx.org/rdf/3.0.1/terms/AI/modelExplainability" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // StandardCompliances Captures a standard that is being complied with.
+ StandardCompliances []string `iri:"https://spdx.org/rdf/3.0.1/terms/AI/standardCompliance" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // MetricDecisionThresholds Captures the threshold that was used for computation of a metric described in the metric field.
+ MetricDecisionThresholds DictionaryEntryList `iri:"https://spdx.org/rdf/3.0.1/terms/AI/metricDecisionThreshold" type:"https://spdx.org/rdf/3.0.1/terms/Core/DictionaryEntry"`
+ // TypeOfModels Records the type of the model used in the AI software.
+ TypeOfModels []string `iri:"https://spdx.org/rdf/3.0.1/terms/AI/typeOfModel" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // InformationAboutApplication Provides relevant information about the AI software, not including the model description.
+ InformationAboutApplication string `iri:"https://spdx.org/rdf/3.0.1/terms/AI/informationAboutApplication" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // InformationAboutTraining Describes relevant information about different steps of the training process.
+ InformationAboutTraining string `iri:"https://spdx.org/rdf/3.0.1/terms/AI/informationAboutTraining" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Metrics Records the measurement of prediction quality of the AI model.
+ Metrics DictionaryEntryList `iri:"https://spdx.org/rdf/3.0.1/terms/AI/metric" type:"https://spdx.org/rdf/3.0.1/terms/Core/DictionaryEntry"`
+}
+
+func (o *AIPackage) asAIPackage() {}
+func (o *AIPackage) asPackage() {}
+func (o *AIPackage) asSoftwareArtifact() {}
+func (o *AIPackage) asArtifact() {}
+func (o *AIPackage) asElement() {}
+func (o *AIPackage) GetID() string {
+ return o.ID
+}
+
+func (o *AIPackage) SetID(v string) {
+ o.ID = v
+}
+
+func (o *AIPackage) GetDescription() string {
+ return o.Description
+}
+
+func (o *AIPackage) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *AIPackage) GetComment() string {
+ return o.Comment
+}
+
+func (o *AIPackage) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *AIPackage) GetName() string {
+ return o.Name
+}
+
+func (o *AIPackage) SetName(v string) {
+ o.Name = v
+}
+
+func (o *AIPackage) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *AIPackage) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *AIPackage) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *AIPackage) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *AIPackage) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *AIPackage) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *AIPackage) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *AIPackage) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *AIPackage) GetSummary() string {
+ return o.Summary
+}
+
+func (o *AIPackage) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *AIPackage) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *AIPackage) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *AIPackage) GetStandardNames() []string {
+ return o.StandardNames
+}
+
+func (o *AIPackage) SetStandardNames(v []string) {
+ o.StandardNames = v
+}
+
+func (o *AIPackage) GetBuiltTime() time.Time {
+ return o.BuiltTime
+}
+
+func (o *AIPackage) SetBuiltTime(v time.Time) {
+ o.BuiltTime = v
+}
+
+func (o *AIPackage) GetReleaseTime() time.Time {
+ return o.ReleaseTime
+}
+
+func (o *AIPackage) SetReleaseTime(v time.Time) {
+ o.ReleaseTime = v
+}
+
+func (o *AIPackage) GetSupportLevels() []SupportType {
+ return o.SupportLevels
+}
+
+func (o *AIPackage) SetSupportLevels(v []SupportType) {
+ o.SupportLevels = v
+}
+
+func (o *AIPackage) GetSuppliedBy() AnyAgent {
+ return o.SuppliedBy
+}
+
+func (o *AIPackage) SetSuppliedBy(v AnyAgent) {
+ o.SuppliedBy = v
+}
+
+func (o *AIPackage) GetOriginatedBy() AgentList {
+ return o.OriginatedBy
+}
+
+func (o *AIPackage) SetOriginatedBy(v AgentList) {
+ o.OriginatedBy = v
+}
+
+func (o *AIPackage) GetValidUntilTime() time.Time {
+ return o.ValidUntilTime
+}
+
+func (o *AIPackage) SetValidUntilTime(v time.Time) {
+ o.ValidUntilTime = v
+}
+
+func (o *AIPackage) GetContentIdentifiers() ContentIdentifierList {
+ return o.ContentIdentifiers
+}
+
+func (o *AIPackage) SetContentIdentifiers(v ContentIdentifierList) {
+ o.ContentIdentifiers = v
+}
+
+func (o *AIPackage) GetAttributionTexts() []string {
+ return o.AttributionTexts
+}
+
+func (o *AIPackage) SetAttributionTexts(v []string) {
+ o.AttributionTexts = v
+}
+
+func (o *AIPackage) GetAdditionalPurposes() []SoftwarePurpose {
+ return o.AdditionalPurposes
+}
+
+func (o *AIPackage) SetAdditionalPurposes(v []SoftwarePurpose) {
+ o.AdditionalPurposes = v
+}
+
+func (o *AIPackage) GetPrimaryPurpose() SoftwarePurpose {
+ return o.PrimaryPurpose
+}
+
+func (o *AIPackage) SetPrimaryPurpose(v SoftwarePurpose) {
+ o.PrimaryPurpose = v
+}
+
+func (o *AIPackage) GetCopyrightText() string {
+ return o.CopyrightText
+}
+
+func (o *AIPackage) SetCopyrightText(v string) {
+ o.CopyrightText = v
+}
+
+func (o *AIPackage) GetSourceInfo() string {
+ return o.SourceInfo
+}
+
+func (o *AIPackage) SetSourceInfo(v string) {
+ o.SourceInfo = v
+}
+
+func (o *AIPackage) GetHomePage() URI {
+ return o.HomePage
+}
+
+func (o *AIPackage) SetHomePage(v URI) {
+ o.HomePage = v
+}
+
+func (o *AIPackage) GetVersion() string {
+ return o.Version
+}
+
+func (o *AIPackage) SetVersion(v string) {
+ o.Version = v
+}
+
+func (o *AIPackage) GetPackageURL() URI {
+ return o.PackageURL
+}
+
+func (o *AIPackage) SetPackageURL(v URI) {
+ o.PackageURL = v
+}
+
+func (o *AIPackage) GetDownloadLocation() URI {
+ return o.DownloadLocation
+}
+
+func (o *AIPackage) SetDownloadLocation(v URI) {
+ o.DownloadLocation = v
+}
+
+func (o *AIPackage) GetDomains() []string {
+ return o.Domains
+}
+
+func (o *AIPackage) SetDomains(v []string) {
+ o.Domains = v
+}
+
+func (o *AIPackage) GetEnergyConsumption() AnyEnergyConsumption {
+ return o.EnergyConsumption
+}
+
+func (o *AIPackage) SetEnergyConsumption(v AnyEnergyConsumption) {
+ o.EnergyConsumption = v
+}
+
+func (o *AIPackage) GetModelDataPreprocessings() []string {
+ return o.ModelDataPreprocessings
+}
+
+func (o *AIPackage) SetModelDataPreprocessings(v []string) {
+ o.ModelDataPreprocessings = v
+}
+
+func (o *AIPackage) GetUseSensitivePersonalInformation() PresenceType {
+ return o.UseSensitivePersonalInformation
+}
+
+func (o *AIPackage) SetUseSensitivePersonalInformation(v PresenceType) {
+ o.UseSensitivePersonalInformation = v
+}
+
+func (o *AIPackage) GetAutonomyType() PresenceType {
+ return o.AutonomyType
+}
+
+func (o *AIPackage) SetAutonomyType(v PresenceType) {
+ o.AutonomyType = v
+}
+
+func (o *AIPackage) GetSafetyRiskAssessment() SafetyRiskAssessmentType {
+ return o.SafetyRiskAssessment
+}
+
+func (o *AIPackage) SetSafetyRiskAssessment(v SafetyRiskAssessmentType) {
+ o.SafetyRiskAssessment = v
+}
+
+func (o *AIPackage) GetHyperparameters() DictionaryEntryList {
+ return o.Hyperparameters
+}
+
+func (o *AIPackage) SetHyperparameters(v DictionaryEntryList) {
+ o.Hyperparameters = v
+}
+
+func (o *AIPackage) GetLimitation() string {
+ return o.Limitation
+}
+
+func (o *AIPackage) SetLimitation(v string) {
+ o.Limitation = v
+}
+
+func (o *AIPackage) GetModelExplainabilities() []string {
+ return o.ModelExplainabilities
+}
+
+func (o *AIPackage) SetModelExplainabilities(v []string) {
+ o.ModelExplainabilities = v
+}
+
+func (o *AIPackage) GetStandardCompliances() []string {
+ return o.StandardCompliances
+}
+
+func (o *AIPackage) SetStandardCompliances(v []string) {
+ o.StandardCompliances = v
+}
+
+func (o *AIPackage) GetMetricDecisionThresholds() DictionaryEntryList {
+ return o.MetricDecisionThresholds
+}
+
+func (o *AIPackage) SetMetricDecisionThresholds(v DictionaryEntryList) {
+ o.MetricDecisionThresholds = v
+}
+
+func (o *AIPackage) GetTypeOfModels() []string {
+ return o.TypeOfModels
+}
+
+func (o *AIPackage) SetTypeOfModels(v []string) {
+ o.TypeOfModels = v
+}
+
+func (o *AIPackage) GetInformationAboutApplication() string {
+ return o.InformationAboutApplication
+}
+
+func (o *AIPackage) SetInformationAboutApplication(v string) {
+ o.InformationAboutApplication = v
+}
+
+func (o *AIPackage) GetInformationAboutTraining() string {
+ return o.InformationAboutTraining
+}
+
+func (o *AIPackage) SetInformationAboutTraining(v string) {
+ o.InformationAboutTraining = v
+}
+
+func (o *AIPackage) GetMetrics() DictionaryEntryList {
+ return o.Metrics
+}
+
+func (o *AIPackage) SetMetrics(v DictionaryEntryList) {
+ o.Metrics = v
+}
+
+type AIPackageList []AnyAIPackage
+
+func (v AIPackageList) AIPackages() []AnyAIPackage {
+ return ld.SliceOf[AnyAIPackage](v)
+}
+
+type AnyAgent interface {
+ AnyElement
+ asAgent()
+}
+
+// Agent represents anything with the potential to act on a system.
+type Agent struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/Agent" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+}
+
+func (o *Agent) asAgent() {}
+func (o *Agent) asElement() {}
+func (o *Agent) GetID() string {
+ return o.ID
+}
+
+func (o *Agent) SetID(v string) {
+ o.ID = v
+}
+
+func (o *Agent) GetDescription() string {
+ return o.Description
+}
+
+func (o *Agent) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *Agent) GetComment() string {
+ return o.Comment
+}
+
+func (o *Agent) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *Agent) GetName() string {
+ return o.Name
+}
+
+func (o *Agent) SetName(v string) {
+ o.Name = v
+}
+
+func (o *Agent) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *Agent) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *Agent) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *Agent) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *Agent) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *Agent) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *Agent) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *Agent) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *Agent) GetSummary() string {
+ return o.Summary
+}
+
+func (o *Agent) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *Agent) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *Agent) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+type AgentList []AnyAgent
+
+func (v AgentList) Agents() []AnyAgent {
+ return ld.SliceOf[AnyAgent](v)
+}
+
+func (v AgentList) Organizations() []AnyOrganization {
+ return ld.SliceOf[AnyOrganization](v)
+}
+
+func (v AgentList) People() []AnyPerson {
+ return ld.SliceOf[AnyPerson](v)
+}
+
+func (v AgentList) SoftwareAgents() []AnySoftwareAgent {
+ return ld.SliceOf[AnySoftwareAgent](v)
+}
+
+type AnyAnnotation interface {
+ AnyElement
+ asAnnotation()
+ GetSubject() AnyElement
+ SetSubject(AnyElement)
+ GetContentType() string
+ SetContentType(string)
+ GetStatement() string
+ SetStatement(string)
+ GetType() AnnotationType
+ SetType(AnnotationType)
+}
+
+// Annotation An assertion made in relation to one or more elements.
+type Annotation struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/Annotation" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // Subject An Element an annotator has made an assertion about.
+ Subject AnyElement `iri:"https://spdx.org/rdf/3.0.1/terms/Core/subject" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // ContentType Provides information about the content type of an Element or a Property.
+ ContentType string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/contentType" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Statement Commentary on an assertion that an annotator has made.
+ Statement string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/statement" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Type Describes the type of annotation.
+ Type AnnotationType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/annotationType" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/AnnotationType"`
+}
+
+func (o *Annotation) asAnnotation() {}
+func (o *Annotation) asElement() {}
+func (o *Annotation) GetID() string {
+ return o.ID
+}
+
+func (o *Annotation) SetID(v string) {
+ o.ID = v
+}
+
+func (o *Annotation) GetDescription() string {
+ return o.Description
+}
+
+func (o *Annotation) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *Annotation) GetComment() string {
+ return o.Comment
+}
+
+func (o *Annotation) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *Annotation) GetName() string {
+ return o.Name
+}
+
+func (o *Annotation) SetName(v string) {
+ o.Name = v
+}
+
+func (o *Annotation) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *Annotation) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *Annotation) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *Annotation) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *Annotation) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *Annotation) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *Annotation) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *Annotation) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *Annotation) GetSummary() string {
+ return o.Summary
+}
+
+func (o *Annotation) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *Annotation) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *Annotation) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *Annotation) GetSubject() AnyElement {
+ return o.Subject
+}
+
+func (o *Annotation) SetSubject(v AnyElement) {
+ o.Subject = v
+}
+
+func (o *Annotation) GetContentType() string {
+ return o.ContentType
+}
+
+func (o *Annotation) SetContentType(v string) {
+ o.ContentType = v
+}
+
+func (o *Annotation) GetStatement() string {
+ return o.Statement
+}
+
+func (o *Annotation) SetStatement(v string) {
+ o.Statement = v
+}
+
+func (o *Annotation) GetType() AnnotationType {
+ return o.Type
+}
+
+func (o *Annotation) SetType(v AnnotationType) {
+ o.Type = v
+}
+
+type AnnotationList []AnyAnnotation
+
+func (v AnnotationList) Annotations() []AnyAnnotation {
+ return ld.SliceOf[AnyAnnotation](v)
+}
+
+// AnnotationType Specifies the type of an annotation.
+type AnnotationType struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/AnnotationType" node-kind:""`
+ id string `iri:"@id"`
+}
+
+func (o *AnnotationType) GetID() string {
+ return o.id
+}
+
+// AnnotationType_Other Used to store extra information about an Element which is not part of a review (e.g. extra information provided during the creation of the Element).
+var AnnotationType_Other = AnnotationType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/AnnotationType/other",
+}
+
+// AnnotationType_Review Used when someone reviews the Element.
+var AnnotationType_Review = AnnotationType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/AnnotationType/review",
+}
+
+type AnyArtifact interface {
+ AnyElement
+ asArtifact()
+ GetStandardNames() []string
+ SetStandardNames([]string)
+ GetBuiltTime() time.Time
+ SetBuiltTime(time.Time)
+ GetReleaseTime() time.Time
+ SetReleaseTime(time.Time)
+ GetSupportLevels() []SupportType
+ SetSupportLevels([]SupportType)
+ GetSuppliedBy() AnyAgent
+ SetSuppliedBy(AnyAgent)
+ GetOriginatedBy() AgentList
+ SetOriginatedBy(AgentList)
+ GetValidUntilTime() time.Time
+ SetValidUntilTime(time.Time)
+}
+
+// Artifact A distinct article or unit within the digital domain.
+type ArtifactList []AnyArtifact
+
+func (v ArtifactList) AIPackages() []AnyAIPackage {
+ return ld.SliceOf[AnyAIPackage](v)
+}
+
+func (v ArtifactList) Artifacts() []AnyArtifact {
+ return ld.SliceOf[AnyArtifact](v)
+}
+
+func (v ArtifactList) DatasetPackages() []AnyDatasetPackage {
+ return ld.SliceOf[AnyDatasetPackage](v)
+}
+
+func (v ArtifactList) Files() []AnyFile {
+ return ld.SliceOf[AnyFile](v)
+}
+
+func (v ArtifactList) Packages() []AnyPackage {
+ return ld.SliceOf[AnyPackage](v)
+}
+
+func (v ArtifactList) Snippets() []AnySnippet {
+ return ld.SliceOf[AnySnippet](v)
+}
+
+func (v ArtifactList) SoftwareArtifacts() []AnySoftwareArtifact {
+ return ld.SliceOf[AnySoftwareArtifact](v)
+}
+
+func (v ArtifactList) Vulnerabilities() []AnyVulnerability {
+ return ld.SliceOf[AnyVulnerability](v)
+}
+
+type AnyBOM interface {
+ AnyBundle
+ asBOM()
+}
+
+// BOM A container for a grouping of SPDX-3.0 content characterizing details (provenence, composition, licensing, etc.) about a product.
+type BOM struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/Bom" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // Elements Refers to one or more Elements that are part of an ElementCollection.
+ Elements ElementList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/element" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // RootElements This property is used to denote the root Element(s) of a tree of elements contained in a BOM.
+ RootElements ElementList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/rootElement" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // ProfileConformances Describes one a profile which the creator of this ElementCollection intends to conform to.
+ ProfileConformances []ProfileIdentifierType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/profileConformance" type:"https://spdx.org/rdf/3.0.1/terms/Core/ProfileIdentifierType"`
+ // Context Gives information about the circumstances or unifying properties that Elements of the bundle have been assembled under.
+ Context string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/context" type:"http://www.w3.org/2001/XMLSchema#string"`
+}
+
+func (o *BOM) asBOM() {}
+func (o *BOM) asBundle() {}
+func (o *BOM) asElementCollection() {}
+func (o *BOM) asElement() {}
+func (o *BOM) GetID() string {
+ return o.ID
+}
+
+func (o *BOM) SetID(v string) {
+ o.ID = v
+}
+
+func (o *BOM) GetDescription() string {
+ return o.Description
+}
+
+func (o *BOM) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *BOM) GetComment() string {
+ return o.Comment
+}
+
+func (o *BOM) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *BOM) GetName() string {
+ return o.Name
+}
+
+func (o *BOM) SetName(v string) {
+ o.Name = v
+}
+
+func (o *BOM) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *BOM) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *BOM) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *BOM) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *BOM) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *BOM) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *BOM) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *BOM) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *BOM) GetSummary() string {
+ return o.Summary
+}
+
+func (o *BOM) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *BOM) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *BOM) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *BOM) GetElements() ElementList {
+ return o.Elements
+}
+
+func (o *BOM) SetElements(v ElementList) {
+ o.Elements = v
+}
+
+func (o *BOM) GetRootElements() ElementList {
+ return o.RootElements
+}
+
+func (o *BOM) SetRootElements(v ElementList) {
+ o.RootElements = v
+}
+
+func (o *BOM) GetProfileConformances() []ProfileIdentifierType {
+ return o.ProfileConformances
+}
+
+func (o *BOM) SetProfileConformances(v []ProfileIdentifierType) {
+ o.ProfileConformances = v
+}
+
+func (o *BOM) GetContext() string {
+ return o.Context
+}
+
+func (o *BOM) SetContext(v string) {
+ o.Context = v
+}
+
+type BOMList []AnyBOM
+
+func (v BOMList) BOMs() []AnyBOM {
+ return ld.SliceOf[AnyBOM](v)
+}
+
+func (v BOMList) SBOMs() []AnySBOM {
+ return ld.SliceOf[AnySBOM](v)
+}
+
+type AnyBuild interface {
+ AnyElement
+ asBuild()
+ GetBuildID() string
+ SetBuildID(string)
+ GetConfigSourceUris() []URI
+ SetConfigSourceUris([]URI)
+ GetStartTime() time.Time
+ SetStartTime(time.Time)
+ GetConfigSourceDigests() HashList
+ SetConfigSourceDigests(HashList)
+ GetParameters() DictionaryEntryList
+ SetParameters(DictionaryEntryList)
+ GetType() URI
+ SetType(URI)
+ GetConfigSourceEntrypoints() []string
+ SetConfigSourceEntrypoints([]string)
+ GetEndTime() time.Time
+ SetEndTime(time.Time)
+ GetEnvironments() DictionaryEntryList
+ SetEnvironments(DictionaryEntryList)
+}
+
+// Build Class that describes a build instance of software/artifacts.
+type Build struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Build/Build" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // BuildID A buildId is a locally unique identifier used by a builder to identify a unique instance of a build produced by it.
+ BuildID string `iri:"https://spdx.org/rdf/3.0.1/terms/Build/buildId" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // ConfigSourceUris Property that describes the URI of the build configuration source file.
+ ConfigSourceUris []URI `iri:"https://spdx.org/rdf/3.0.1/terms/Build/configSourceUri" type:"http://www.w3.org/2001/XMLSchema#anyURI"`
+ // StartTime Property describing the start time of a build.
+ StartTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Build/buildStartTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ConfigSourceDigests Property that describes the digest of the build configuration file used to invoke a build.
+ ConfigSourceDigests HashList `iri:"https://spdx.org/rdf/3.0.1/terms/Build/configSourceDigest" type:"https://spdx.org/rdf/3.0.1/terms/Core/Hash"`
+ // Parameters Property describing a parameter used in an instance of a build.
+ Parameters DictionaryEntryList `iri:"https://spdx.org/rdf/3.0.1/terms/Build/parameter" type:"https://spdx.org/rdf/3.0.1/terms/Core/DictionaryEntry"`
+ // Type A buildType is a hint that is used to indicate the toolchain, platform, or infrastructure that the build was invoked on.
+ Type URI `iri:"https://spdx.org/rdf/3.0.1/terms/Build/buildType" required:"true" type:"http://www.w3.org/2001/XMLSchema#anyURI"`
+ // ConfigSourceEntrypoints Property describes the invocation entrypoint of a build.
+ ConfigSourceEntrypoints []string `iri:"https://spdx.org/rdf/3.0.1/terms/Build/configSourceEntrypoint" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // EndTime Property that describes the time at which a build stops.
+ EndTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Build/buildEndTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // Environments Property describing the session in which a build is invoked.
+ Environments DictionaryEntryList `iri:"https://spdx.org/rdf/3.0.1/terms/Build/environment" type:"https://spdx.org/rdf/3.0.1/terms/Core/DictionaryEntry"`
+}
+
+func (o *Build) asBuild() {}
+func (o *Build) asElement() {}
+func (o *Build) GetID() string {
+ return o.ID
+}
+
+func (o *Build) SetID(v string) {
+ o.ID = v
+}
+
+func (o *Build) GetDescription() string {
+ return o.Description
+}
+
+func (o *Build) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *Build) GetComment() string {
+ return o.Comment
+}
+
+func (o *Build) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *Build) GetName() string {
+ return o.Name
+}
+
+func (o *Build) SetName(v string) {
+ o.Name = v
+}
+
+func (o *Build) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *Build) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *Build) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *Build) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *Build) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *Build) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *Build) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *Build) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *Build) GetSummary() string {
+ return o.Summary
+}
+
+func (o *Build) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *Build) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *Build) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *Build) GetBuildID() string {
+ return o.BuildID
+}
+
+func (o *Build) SetBuildID(v string) {
+ o.BuildID = v
+}
+
+func (o *Build) GetConfigSourceUris() []URI {
+ return o.ConfigSourceUris
+}
+
+func (o *Build) SetConfigSourceUris(v []URI) {
+ o.ConfigSourceUris = v
+}
+
+func (o *Build) GetStartTime() time.Time {
+ return o.StartTime
+}
+
+func (o *Build) SetStartTime(v time.Time) {
+ o.StartTime = v
+}
+
+func (o *Build) GetConfigSourceDigests() HashList {
+ return o.ConfigSourceDigests
+}
+
+func (o *Build) SetConfigSourceDigests(v HashList) {
+ o.ConfigSourceDigests = v
+}
+
+func (o *Build) GetParameters() DictionaryEntryList {
+ return o.Parameters
+}
+
+func (o *Build) SetParameters(v DictionaryEntryList) {
+ o.Parameters = v
+}
+
+func (o *Build) GetType() URI {
+ return o.Type
+}
+
+func (o *Build) SetType(v URI) {
+ o.Type = v
+}
+
+func (o *Build) GetConfigSourceEntrypoints() []string {
+ return o.ConfigSourceEntrypoints
+}
+
+func (o *Build) SetConfigSourceEntrypoints(v []string) {
+ o.ConfigSourceEntrypoints = v
+}
+
+func (o *Build) GetEndTime() time.Time {
+ return o.EndTime
+}
+
+func (o *Build) SetEndTime(v time.Time) {
+ o.EndTime = v
+}
+
+func (o *Build) GetEnvironments() DictionaryEntryList {
+ return o.Environments
+}
+
+func (o *Build) SetEnvironments(v DictionaryEntryList) {
+ o.Environments = v
+}
+
+type BuildList []AnyBuild
+
+func (v BuildList) Builds() []AnyBuild {
+ return ld.SliceOf[AnyBuild](v)
+}
+
+type AnyBundle interface {
+ AnyElementCollection
+ asBundle()
+ GetContext() string
+ SetContext(string)
+}
+
+// Bundle A collection of Elements that have a shared context.
+type Bundle struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/Bundle" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // Elements Refers to one or more Elements that are part of an ElementCollection.
+ Elements ElementList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/element" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // RootElements This property is used to denote the root Element(s) of a tree of elements contained in a BOM.
+ RootElements ElementList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/rootElement" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // ProfileConformances Describes one a profile which the creator of this ElementCollection intends to conform to.
+ ProfileConformances []ProfileIdentifierType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/profileConformance" type:"https://spdx.org/rdf/3.0.1/terms/Core/ProfileIdentifierType"`
+ // Context Gives information about the circumstances or unifying properties that Elements of the bundle have been assembled under.
+ Context string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/context" type:"http://www.w3.org/2001/XMLSchema#string"`
+}
+
+func (o *Bundle) asBundle() {}
+func (o *Bundle) asElementCollection() {}
+func (o *Bundle) asElement() {}
+func (o *Bundle) GetID() string {
+ return o.ID
+}
+
+func (o *Bundle) SetID(v string) {
+ o.ID = v
+}
+
+func (o *Bundle) GetDescription() string {
+ return o.Description
+}
+
+func (o *Bundle) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *Bundle) GetComment() string {
+ return o.Comment
+}
+
+func (o *Bundle) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *Bundle) GetName() string {
+ return o.Name
+}
+
+func (o *Bundle) SetName(v string) {
+ o.Name = v
+}
+
+func (o *Bundle) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *Bundle) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *Bundle) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *Bundle) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *Bundle) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *Bundle) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *Bundle) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *Bundle) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *Bundle) GetSummary() string {
+ return o.Summary
+}
+
+func (o *Bundle) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *Bundle) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *Bundle) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *Bundle) GetElements() ElementList {
+ return o.Elements
+}
+
+func (o *Bundle) SetElements(v ElementList) {
+ o.Elements = v
+}
+
+func (o *Bundle) GetRootElements() ElementList {
+ return o.RootElements
+}
+
+func (o *Bundle) SetRootElements(v ElementList) {
+ o.RootElements = v
+}
+
+func (o *Bundle) GetProfileConformances() []ProfileIdentifierType {
+ return o.ProfileConformances
+}
+
+func (o *Bundle) SetProfileConformances(v []ProfileIdentifierType) {
+ o.ProfileConformances = v
+}
+
+func (o *Bundle) GetContext() string {
+ return o.Context
+}
+
+func (o *Bundle) SetContext(v string) {
+ o.Context = v
+}
+
+type BundleList []AnyBundle
+
+func (v BundleList) BOMs() []AnyBOM {
+ return ld.SliceOf[AnyBOM](v)
+}
+
+func (v BundleList) Bundles() []AnyBundle {
+ return ld.SliceOf[AnyBundle](v)
+}
+
+func (v BundleList) SBOMs() []AnySBOM {
+ return ld.SliceOf[AnySBOM](v)
+}
+
+type AnyCdxPropertiesExtension interface {
+ AnyExtension
+ asCdxPropertiesExtension()
+ GetCdxProperties() CdxPropertyEntryList
+ SetCdxProperties(CdxPropertyEntryList)
+}
+
+// CdxPropertiesExtension A type of extension consisting of a list of name value pairs.
+type CdxPropertiesExtension struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Extension/CdxPropertiesExtension" node-kind:"http://www.w3.org/ns/shacl#BlankNodeOrIRI"`
+ ID string `iri:"@id"`
+ // CdxProperties Provides a map of a property names to a values.
+ CdxProperties CdxPropertyEntryList `iri:"https://spdx.org/rdf/3.0.1/terms/Extension/cdxProperty" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Extension/CdxPropertyEntry"`
+}
+
+func (o *CdxPropertiesExtension) asCdxPropertiesExtension() {}
+func (o *CdxPropertiesExtension) asExtension() {}
+func (o *CdxPropertiesExtension) GetID() string {
+ return o.ID
+}
+
+func (o *CdxPropertiesExtension) SetID(v string) {
+ o.ID = v
+}
+
+func (o *CdxPropertiesExtension) GetCdxProperties() CdxPropertyEntryList {
+ return o.CdxProperties
+}
+
+func (o *CdxPropertiesExtension) SetCdxProperties(v CdxPropertyEntryList) {
+ o.CdxProperties = v
+}
+
+type CdxPropertiesExtensionList []AnyCdxPropertiesExtension
+
+func (v CdxPropertiesExtensionList) CdxPropertiesExtensions() []AnyCdxPropertiesExtension {
+ return ld.SliceOf[AnyCdxPropertiesExtension](v)
+}
+
+type AnyCdxPropertyEntry interface {
+ GetID() string
+ SetID(string)
+ asCdxPropertyEntry()
+ GetCdxPropValue() string
+ SetCdxPropValue(string)
+ GetCdxPropName() string
+ SetCdxPropName(string)
+}
+
+// CdxPropertyEntry A property name with an associated value.
+type CdxPropertyEntry struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Extension/CdxPropertyEntry" node-kind:"http://www.w3.org/ns/shacl#BlankNodeOrIRI"`
+ ID string `iri:"@id"`
+ // CdxPropValue A value used in a CdxPropertyEntry name-value pair.
+ CdxPropValue string `iri:"https://spdx.org/rdf/3.0.1/terms/Extension/cdxPropValue" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // CdxPropName A name used in a CdxPropertyEntry name-value pair.
+ CdxPropName string `iri:"https://spdx.org/rdf/3.0.1/terms/Extension/cdxPropName" required:"true" type:"http://www.w3.org/2001/XMLSchema#string"`
+}
+
+func (o *CdxPropertyEntry) asCdxPropertyEntry() {}
+func (o *CdxPropertyEntry) GetID() string {
+ return o.ID
+}
+
+func (o *CdxPropertyEntry) SetID(v string) {
+ o.ID = v
+}
+
+func (o *CdxPropertyEntry) GetCdxPropValue() string {
+ return o.CdxPropValue
+}
+
+func (o *CdxPropertyEntry) SetCdxPropValue(v string) {
+ o.CdxPropValue = v
+}
+
+func (o *CdxPropertyEntry) GetCdxPropName() string {
+ return o.CdxPropName
+}
+
+func (o *CdxPropertyEntry) SetCdxPropName(v string) {
+ o.CdxPropName = v
+}
+
+type CdxPropertyEntryList []AnyCdxPropertyEntry
+
+func (v CdxPropertyEntryList) CdxPropertyEntries() []AnyCdxPropertyEntry {
+ return ld.SliceOf[AnyCdxPropertyEntry](v)
+}
+
+// ConfidentialityLevelType Categories of confidentiality level.
+type ConfidentialityLevelType struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Dataset/ConfidentialityLevelType" node-kind:""`
+ id string `iri:"@id"`
+}
+
+func (o *ConfidentialityLevelType) GetID() string {
+ return o.id
+}
+
+// ConfidentialityLevelType_Amber Data points in the dataset can be shared only with specific organizations and their clients on a need to know basis.
+var ConfidentialityLevelType_Amber = ConfidentialityLevelType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Dataset/ConfidentialityLevelType/amber",
+}
+
+// ConfidentialityLevelType_Clear Dataset may be distributed freely, without restriction.
+var ConfidentialityLevelType_Clear = ConfidentialityLevelType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Dataset/ConfidentialityLevelType/clear",
+}
+
+// ConfidentialityLevelType_Green Dataset can be shared within a community of peers and partners.
+var ConfidentialityLevelType_Green = ConfidentialityLevelType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Dataset/ConfidentialityLevelType/green",
+}
+
+// ConfidentialityLevelType_Red Data points in the dataset are highly confidential and can only be shared with named recipients.
+var ConfidentialityLevelType_Red = ConfidentialityLevelType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Dataset/ConfidentialityLevelType/red",
+}
+
+type AnyConjunctiveLicenseSet interface {
+ AnyLicenseInfo
+ asConjunctiveLicenseSet()
+ GetMembers() LicenseInfoList
+ SetMembers(LicenseInfoList)
+}
+
+// ConjunctiveLicenseSet Portion of an AnyLicenseInfo representing a set of licensing information where all elements apply.
+type ConjunctiveLicenseSet struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/ConjunctiveLicenseSet" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // Members A license expression participating in a license set.
+ Members LicenseInfoList `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/member" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/SimpleLicensing/AnyLicenseInfo"`
+}
+
+func (o *ConjunctiveLicenseSet) asConjunctiveLicenseSet() {}
+func (o *ConjunctiveLicenseSet) asLicenseInfo() {}
+func (o *ConjunctiveLicenseSet) asElement() {}
+func (o *ConjunctiveLicenseSet) GetID() string {
+ return o.ID
+}
+
+func (o *ConjunctiveLicenseSet) SetID(v string) {
+ o.ID = v
+}
+
+func (o *ConjunctiveLicenseSet) GetDescription() string {
+ return o.Description
+}
+
+func (o *ConjunctiveLicenseSet) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *ConjunctiveLicenseSet) GetComment() string {
+ return o.Comment
+}
+
+func (o *ConjunctiveLicenseSet) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *ConjunctiveLicenseSet) GetName() string {
+ return o.Name
+}
+
+func (o *ConjunctiveLicenseSet) SetName(v string) {
+ o.Name = v
+}
+
+func (o *ConjunctiveLicenseSet) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *ConjunctiveLicenseSet) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *ConjunctiveLicenseSet) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *ConjunctiveLicenseSet) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *ConjunctiveLicenseSet) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *ConjunctiveLicenseSet) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *ConjunctiveLicenseSet) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *ConjunctiveLicenseSet) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *ConjunctiveLicenseSet) GetSummary() string {
+ return o.Summary
+}
+
+func (o *ConjunctiveLicenseSet) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *ConjunctiveLicenseSet) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *ConjunctiveLicenseSet) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *ConjunctiveLicenseSet) GetMembers() LicenseInfoList {
+ return o.Members
+}
+
+func (o *ConjunctiveLicenseSet) SetMembers(v LicenseInfoList) {
+ o.Members = v
+}
+
+type ConjunctiveLicenseSetList []AnyConjunctiveLicenseSet
+
+func (v ConjunctiveLicenseSetList) ConjunctiveLicenseSets() []AnyConjunctiveLicenseSet {
+ return ld.SliceOf[AnyConjunctiveLicenseSet](v)
+}
+
+type AnyContentIdentifier interface {
+ AnyIntegrityMethod
+ asContentIdentifier()
+ GetType() ContentIdentifierType
+ SetType(ContentIdentifierType)
+ GetValue() URI
+ SetValue(URI)
+}
+
+// ContentIdentifier A canonical, unique, immutable identifier
+type ContentIdentifier struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Software/ContentIdentifier" node-kind:"http://www.w3.org/ns/shacl#BlankNodeOrIRI"`
+ ID string `iri:"@id"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Type Specifies the type of the content identifier.
+ Type ContentIdentifierType `iri:"https://spdx.org/rdf/3.0.1/terms/Software/contentIdentifierType" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Software/ContentIdentifierType"`
+ // Value Specifies the value of the content identifier.
+ Value URI `iri:"https://spdx.org/rdf/3.0.1/terms/Software/contentIdentifierValue" required:"true" type:"http://www.w3.org/2001/XMLSchema#anyURI"`
+}
+
+func (o *ContentIdentifier) asContentIdentifier() {}
+func (o *ContentIdentifier) asIntegrityMethod() {}
+func (o *ContentIdentifier) GetID() string {
+ return o.ID
+}
+
+func (o *ContentIdentifier) SetID(v string) {
+ o.ID = v
+}
+
+func (o *ContentIdentifier) GetComment() string {
+ return o.Comment
+}
+
+func (o *ContentIdentifier) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *ContentIdentifier) GetType() ContentIdentifierType {
+ return o.Type
+}
+
+func (o *ContentIdentifier) SetType(v ContentIdentifierType) {
+ o.Type = v
+}
+
+func (o *ContentIdentifier) GetValue() URI {
+ return o.Value
+}
+
+func (o *ContentIdentifier) SetValue(v URI) {
+ o.Value = v
+}
+
+type ContentIdentifierList []AnyContentIdentifier
+
+func (v ContentIdentifierList) ContentIdentifiers() []AnyContentIdentifier {
+ return ld.SliceOf[AnyContentIdentifier](v)
+}
+
+// ContentIdentifierType Specifies the type of a content identifier.
+type ContentIdentifierType struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Software/ContentIdentifierType" node-kind:""`
+ id string `iri:"@id"`
+}
+
+func (o *ContentIdentifierType) GetID() string {
+ return o.id
+}
+
+// ContentIdentifierType_Gitoid [Gitoid](https://www.iana.org/assignments/uri-schemes/prov/gitoid), stands for [Git Object ID](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects). A gitoid of type blob is a unique hash of a binary artifact. A gitoid may represent either an [Artifact Identifier](https://github.com/omnibor/spec/blob/eb1ee5c961c16215eb8709b2975d193a2007a35d/spec/SPEC.md#artifact-identifier-types) for the software artifact or an [Input Manifest Identifier](https://github.com/omnibor/spec/blob/eb1ee5c961c16215eb8709b2975d193a2007a35d/spec/SPEC.md#input-manifest-identifier) for the software artifact's associated [Artifact Input Manifest](https://github.com/omnibor/spec/blob/eb1ee5c961c16215eb8709b2975d193a2007a35d/spec/SPEC.md#artifact-input-manifest); this ambiguity exists because the Artifact Input Manifest is itself an artifact, and the gitoid of that artifact is its valid identifier. Gitoids calculated on software artifacts (Snippet, File, or Package Elements) should be recorded in the SPDX 3.0 SoftwareArtifact's contentIdentifier property. Gitoids calculated on the Artifact Input Manifest (Input Manifest Identifier) should be recorded in the SPDX 3.0 Element's externalIdentifier property. See [OmniBOR Specification](https://github.com/omnibor/spec/), a minimalistic specification for describing software [Artifact Dependency Graphs](https://github.com/omnibor/spec/blob/eb1ee5c961c16215eb8709b2975d193a2007a35d/spec/SPEC.md#artifact-dependency-graph-adg).
+var ContentIdentifierType_Gitoid = ContentIdentifierType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/ContentIdentifierType/gitoid",
+}
+
+// ContentIdentifierType_Swhid SoftWare Hash IDentifier, a persistent intrinsic identifier for digital artifacts, such as files, trees (also known as directories or folders), commits, and other objects typically found in version control systems. The format of the identifiers is defined in the [SWHID specification](https://www.swhid.org/specification/v1.1/4.Syntax) (ISO/IEC DIS 18670). They typically look like `swh:1:cnt:94a9ed024d3859793618152ea559a168bbcbb5e2`.
+var ContentIdentifierType_Swhid = ContentIdentifierType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/ContentIdentifierType/swhid",
+}
+
+type AnyCreationInfo interface {
+ GetID() string
+ SetID(string)
+ asCreationInfo()
+ GetSpecVersion() string
+ SetSpecVersion(string)
+ GetCreated() time.Time
+ SetCreated(time.Time)
+ GetCreatedUsing() ToolList
+ SetCreatedUsing(ToolList)
+ GetComment() string
+ SetComment(string)
+ GetCreatedBy() AgentList
+ SetCreatedBy(AgentList)
+}
+
+// CreationInfo Provides information about the creation of the Element.
+type CreationInfo struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo" node-kind:"http://www.w3.org/ns/shacl#BlankNodeOrIRI"`
+ ID string `iri:"@id"`
+ // SpecVersion Provides a reference number that can be used to understand how to parse and interpret an Element.
+ SpecVersion string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/specVersion" required:"true" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Created Identifies when the Element was originally created.
+ Created time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/created" required:"true" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // CreatedUsing Identifies the tooling that was used during the creation of the Element.
+ CreatedUsing ToolList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/createdUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/Tool"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // CreatedBy Identifies who or what created the Element.
+ CreatedBy AgentList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/createdBy" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Agent"`
+}
+
+func (o *CreationInfo) asCreationInfo() {}
+func (o *CreationInfo) GetID() string {
+ return o.ID
+}
+
+func (o *CreationInfo) SetID(v string) {
+ o.ID = v
+}
+
+func (o *CreationInfo) GetSpecVersion() string {
+ return o.SpecVersion
+}
+
+func (o *CreationInfo) SetSpecVersion(v string) {
+ o.SpecVersion = v
+}
+
+func (o *CreationInfo) GetCreated() time.Time {
+ return o.Created
+}
+
+func (o *CreationInfo) SetCreated(v time.Time) {
+ o.Created = v
+}
+
+func (o *CreationInfo) GetCreatedUsing() ToolList {
+ return o.CreatedUsing
+}
+
+func (o *CreationInfo) SetCreatedUsing(v ToolList) {
+ o.CreatedUsing = v
+}
+
+func (o *CreationInfo) GetComment() string {
+ return o.Comment
+}
+
+func (o *CreationInfo) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *CreationInfo) GetCreatedBy() AgentList {
+ return o.CreatedBy
+}
+
+func (o *CreationInfo) SetCreatedBy(v AgentList) {
+ o.CreatedBy = v
+}
+
+type CreationInfoList []AnyCreationInfo
+
+func (v CreationInfoList) CreationInfos() []AnyCreationInfo {
+ return ld.SliceOf[AnyCreationInfo](v)
+}
+
+type AnyCustomLicense interface {
+ AnyLicense
+ asCustomLicense()
+}
+
+// CustomLicense A license that is not listed on the SPDX License List.
+type CustomLicense struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/CustomLicense" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // SeeAlsos Contains a URL where the License or LicenseAddition can be found in use.
+ SeeAlsos []URI `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/seeAlso" type:"http://www.w3.org/2001/XMLSchema#anyURI"`
+ // IsDeprecatedLicenseID Specifies whether a license or additional text identifier has been marked as deprecated.
+ IsDeprecatedLicenseID bool `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/isDeprecatedLicenseId" type:"http://www.w3.org/2001/XMLSchema#boolean"`
+ // ObsoletedBy Specifies the licenseId that is preferred to be used in place of a deprecated License or LicenseAddition.
+ ObsoletedBy string `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/obsoletedBy" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // StandardLicenseHeader Provides a License author's preferred text to indicate that a file is covered by the License.
+ StandardLicenseHeader string `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/standardLicenseHeader" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Text Identifies the full text of a License or Addition.
+ Text string `iri:"https://spdx.org/rdf/3.0.1/terms/SimpleLicensing/licenseText" required:"true" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // IsOsiApproved Specifies whether the License is listed as approved by the Open Source Initiative (OSI).
+ IsOsiApproved bool `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/isOsiApproved" type:"http://www.w3.org/2001/XMLSchema#boolean"`
+ // Xml Identifies all the text and metadata associated with a license in the license XML format.
+ Xml string `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/licenseXml" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // IsFsfLibre Specifies whether the License is listed as free by the Free Software Foundation (FSF).
+ IsFsfLibre bool `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/isFsfLibre" type:"http://www.w3.org/2001/XMLSchema#boolean"`
+ // StandardLicenseTemplate Identifies the full text of a License, in SPDX templating format.
+ StandardLicenseTemplate string `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/standardLicenseTemplate" type:"http://www.w3.org/2001/XMLSchema#string"`
+}
+
+func (o *CustomLicense) asCustomLicense() {}
+func (o *CustomLicense) asLicense() {}
+func (o *CustomLicense) asExtendableLicense() {}
+func (o *CustomLicense) asLicenseInfo() {}
+func (o *CustomLicense) asElement() {}
+func (o *CustomLicense) GetID() string {
+ return o.ID
+}
+
+func (o *CustomLicense) SetID(v string) {
+ o.ID = v
+}
+
+func (o *CustomLicense) GetDescription() string {
+ return o.Description
+}
+
+func (o *CustomLicense) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *CustomLicense) GetComment() string {
+ return o.Comment
+}
+
+func (o *CustomLicense) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *CustomLicense) GetName() string {
+ return o.Name
+}
+
+func (o *CustomLicense) SetName(v string) {
+ o.Name = v
+}
+
+func (o *CustomLicense) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *CustomLicense) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *CustomLicense) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *CustomLicense) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *CustomLicense) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *CustomLicense) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *CustomLicense) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *CustomLicense) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *CustomLicense) GetSummary() string {
+ return o.Summary
+}
+
+func (o *CustomLicense) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *CustomLicense) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *CustomLicense) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *CustomLicense) GetSeeAlsos() []URI {
+ return o.SeeAlsos
+}
+
+func (o *CustomLicense) SetSeeAlsos(v []URI) {
+ o.SeeAlsos = v
+}
+
+func (o *CustomLicense) GetIsDeprecatedLicenseID() bool {
+ return o.IsDeprecatedLicenseID
+}
+
+func (o *CustomLicense) SetIsDeprecatedLicenseID(v bool) {
+ o.IsDeprecatedLicenseID = v
+}
+
+func (o *CustomLicense) GetObsoletedBy() string {
+ return o.ObsoletedBy
+}
+
+func (o *CustomLicense) SetObsoletedBy(v string) {
+ o.ObsoletedBy = v
+}
+
+func (o *CustomLicense) GetStandardLicenseHeader() string {
+ return o.StandardLicenseHeader
+}
+
+func (o *CustomLicense) SetStandardLicenseHeader(v string) {
+ o.StandardLicenseHeader = v
+}
+
+func (o *CustomLicense) GetText() string {
+ return o.Text
+}
+
+func (o *CustomLicense) SetText(v string) {
+ o.Text = v
+}
+
+func (o *CustomLicense) GetIsOsiApproved() bool {
+ return o.IsOsiApproved
+}
+
+func (o *CustomLicense) SetIsOsiApproved(v bool) {
+ o.IsOsiApproved = v
+}
+
+func (o *CustomLicense) GetXml() string {
+ return o.Xml
+}
+
+func (o *CustomLicense) SetXml(v string) {
+ o.Xml = v
+}
+
+func (o *CustomLicense) GetIsFsfLibre() bool {
+ return o.IsFsfLibre
+}
+
+func (o *CustomLicense) SetIsFsfLibre(v bool) {
+ o.IsFsfLibre = v
+}
+
+func (o *CustomLicense) GetStandardLicenseTemplate() string {
+ return o.StandardLicenseTemplate
+}
+
+func (o *CustomLicense) SetStandardLicenseTemplate(v string) {
+ o.StandardLicenseTemplate = v
+}
+
+type CustomLicenseList []AnyCustomLicense
+
+func (v CustomLicenseList) CustomLicenses() []AnyCustomLicense {
+ return ld.SliceOf[AnyCustomLicense](v)
+}
+
+type AnyCustomLicenseAddition interface {
+ AnyLicenseAddition
+ asCustomLicenseAddition()
+}
+
+// CustomLicenseAddition A license addition that is not listed on the SPDX Exceptions List.
+type CustomLicenseAddition struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/CustomLicenseAddition" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // AdditionText Identifies the full text of a LicenseAddition.
+ AdditionText string `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/additionText" required:"true" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // ObsoletedBy Specifies the licenseId that is preferred to be used in place of a deprecated License or LicenseAddition.
+ ObsoletedBy string `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/obsoletedBy" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // LicenseXml Identifies all the text and metadata associated with a license in the license XML format.
+ LicenseXml string `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/licenseXml" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // StandardAdditionTemplate Identifies the full text of a LicenseAddition, in SPDX templating format.
+ StandardAdditionTemplate string `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/standardAdditionTemplate" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // SeeAlsos Contains a URL where the License or LicenseAddition can be found in use.
+ SeeAlsos []URI `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/seeAlso" type:"http://www.w3.org/2001/XMLSchema#anyURI"`
+ // IsDeprecatedAdditionID Specifies whether an additional text identifier has been marked as deprecated.
+ IsDeprecatedAdditionID bool `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/isDeprecatedAdditionId" type:"http://www.w3.org/2001/XMLSchema#boolean"`
+}
+
+func (o *CustomLicenseAddition) asCustomLicenseAddition() {}
+func (o *CustomLicenseAddition) asLicenseAddition() {}
+func (o *CustomLicenseAddition) asElement() {}
+func (o *CustomLicenseAddition) GetID() string {
+ return o.ID
+}
+
+func (o *CustomLicenseAddition) SetID(v string) {
+ o.ID = v
+}
+
+func (o *CustomLicenseAddition) GetDescription() string {
+ return o.Description
+}
+
+func (o *CustomLicenseAddition) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *CustomLicenseAddition) GetComment() string {
+ return o.Comment
+}
+
+func (o *CustomLicenseAddition) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *CustomLicenseAddition) GetName() string {
+ return o.Name
+}
+
+func (o *CustomLicenseAddition) SetName(v string) {
+ o.Name = v
+}
+
+func (o *CustomLicenseAddition) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *CustomLicenseAddition) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *CustomLicenseAddition) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *CustomLicenseAddition) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *CustomLicenseAddition) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *CustomLicenseAddition) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *CustomLicenseAddition) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *CustomLicenseAddition) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *CustomLicenseAddition) GetSummary() string {
+ return o.Summary
+}
+
+func (o *CustomLicenseAddition) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *CustomLicenseAddition) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *CustomLicenseAddition) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *CustomLicenseAddition) GetAdditionText() string {
+ return o.AdditionText
+}
+
+func (o *CustomLicenseAddition) SetAdditionText(v string) {
+ o.AdditionText = v
+}
+
+func (o *CustomLicenseAddition) GetObsoletedBy() string {
+ return o.ObsoletedBy
+}
+
+func (o *CustomLicenseAddition) SetObsoletedBy(v string) {
+ o.ObsoletedBy = v
+}
+
+func (o *CustomLicenseAddition) GetLicenseXml() string {
+ return o.LicenseXml
+}
+
+func (o *CustomLicenseAddition) SetLicenseXml(v string) {
+ o.LicenseXml = v
+}
+
+func (o *CustomLicenseAddition) GetStandardAdditionTemplate() string {
+ return o.StandardAdditionTemplate
+}
+
+func (o *CustomLicenseAddition) SetStandardAdditionTemplate(v string) {
+ o.StandardAdditionTemplate = v
+}
+
+func (o *CustomLicenseAddition) GetSeeAlsos() []URI {
+ return o.SeeAlsos
+}
+
+func (o *CustomLicenseAddition) SetSeeAlsos(v []URI) {
+ o.SeeAlsos = v
+}
+
+func (o *CustomLicenseAddition) GetIsDeprecatedAdditionID() bool {
+ return o.IsDeprecatedAdditionID
+}
+
+func (o *CustomLicenseAddition) SetIsDeprecatedAdditionID(v bool) {
+ o.IsDeprecatedAdditionID = v
+}
+
+type CustomLicenseAdditionList []AnyCustomLicenseAddition
+
+func (v CustomLicenseAdditionList) CustomLicenseAdditions() []AnyCustomLicenseAddition {
+ return ld.SliceOf[AnyCustomLicenseAddition](v)
+}
+
+// CvssSeverityType Specifies the CVSS base, temporal, threat, or environmental severity type.
+type CvssSeverityType struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Security/CvssSeverityType" node-kind:""`
+ id string `iri:"@id"`
+}
+
+func (o *CvssSeverityType) GetID() string {
+ return o.id
+}
+
+// CvssSeverityType_Critical When a CVSS score is between 9.0 - 10.0
+var CvssSeverityType_Critical = CvssSeverityType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Security/CvssSeverityType/critical",
+}
+
+// CvssSeverityType_High When a CVSS score is between 7.0 - 8.9
+var CvssSeverityType_High = CvssSeverityType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Security/CvssSeverityType/high",
+}
+
+// CvssSeverityType_Low When a CVSS score is between 0.1 - 3.9
+var CvssSeverityType_Low = CvssSeverityType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Security/CvssSeverityType/low",
+}
+
+// CvssSeverityType_Medium When a CVSS score is between 4.0 - 6.9
+var CvssSeverityType_Medium = CvssSeverityType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Security/CvssSeverityType/medium",
+}
+
+// CvssSeverityType_None When a CVSS score is 0.0
+var CvssSeverityType_None = CvssSeverityType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Security/CvssSeverityType/none",
+}
+
+type AnyCvssV2VulnAssessmentRelationship interface {
+ AnyVulnAssessmentRelationship
+ asCvssV2VulnAssessmentRelationship()
+ GetVectorString() string
+ SetVectorString(string)
+ GetScore() float64
+ SetScore(float64)
+}
+
+// CvssV2VulnAssessmentRelationship Provides a CVSS version 2.0 assessment for a vulnerability.
+type CvssV2VulnAssessmentRelationship struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Security/CvssV2VulnAssessmentRelationship" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // Completeness Provides information about the completeness of relationships.
+ Completeness RelationshipCompleteness `iri:"https://spdx.org/rdf/3.0.1/terms/Core/completeness" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipCompleteness"`
+ // EndTime Specifies the time from which an element is no longer applicable / valid.
+ EndTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/endTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // To References an Element on the right-hand side of a relationship.
+ To ElementList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/to" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // From References the Element on the left-hand side of a relationship.
+ From AnyElement `iri:"https://spdx.org/rdf/3.0.1/terms/Core/from" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // Type Information about the relationship between two Elements.
+ Type RelationshipType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/relationshipType" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType"`
+ // StartTime Specifies the time from which an element is applicable / valid.
+ StartTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/startTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // SuppliedBy Identifies who or what supplied the artifact or VulnAssessmentRelationship referenced by the Element.
+ SuppliedBy AnyAgent `iri:"https://spdx.org/rdf/3.0.1/terms/Core/suppliedBy" type:"https://spdx.org/rdf/3.0.1/terms/Core/Agent"`
+ // WithdrawnTime Specified the time and date when a vulnerability was withdrawn.
+ WithdrawnTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/withdrawnTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // AssessedElement Specifies an Element contained in a piece of software where a vulnerability was found.
+ AssessedElement AnySoftwareArtifact `iri:"https://spdx.org/rdf/3.0.1/terms/Security/assessedElement" type:"https://spdx.org/rdf/3.0.1/terms/Software/SoftwareArtifact"`
+ // PublishedTime Specifies the time when a vulnerability was published.
+ PublishedTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/publishedTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ModifiedTime Specifies a time when a vulnerability assessment was modified
+ ModifiedTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/modifiedTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // VectorString Specifies the CVSS vector string for a vulnerability.
+ VectorString string `iri:"https://spdx.org/rdf/3.0.1/terms/Security/vectorString" required:"true" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Score Provides a numerical (0-10) representation of the severity of a vulnerability.
+ Score float64 `iri:"https://spdx.org/rdf/3.0.1/terms/Security/score" required:"true" type:"http://www.w3.org/2001/XMLSchema#decimal"`
+}
+
+func (o *CvssV2VulnAssessmentRelationship) asCvssV2VulnAssessmentRelationship() {}
+func (o *CvssV2VulnAssessmentRelationship) asVulnAssessmentRelationship() {}
+func (o *CvssV2VulnAssessmentRelationship) asRelationship() {}
+func (o *CvssV2VulnAssessmentRelationship) asElement() {}
+func (o *CvssV2VulnAssessmentRelationship) GetID() string {
+ return o.ID
+}
+
+func (o *CvssV2VulnAssessmentRelationship) SetID(v string) {
+ o.ID = v
+}
+
+func (o *CvssV2VulnAssessmentRelationship) GetDescription() string {
+ return o.Description
+}
+
+func (o *CvssV2VulnAssessmentRelationship) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *CvssV2VulnAssessmentRelationship) GetComment() string {
+ return o.Comment
+}
+
+func (o *CvssV2VulnAssessmentRelationship) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *CvssV2VulnAssessmentRelationship) GetName() string {
+ return o.Name
+}
+
+func (o *CvssV2VulnAssessmentRelationship) SetName(v string) {
+ o.Name = v
+}
+
+func (o *CvssV2VulnAssessmentRelationship) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *CvssV2VulnAssessmentRelationship) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *CvssV2VulnAssessmentRelationship) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *CvssV2VulnAssessmentRelationship) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *CvssV2VulnAssessmentRelationship) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *CvssV2VulnAssessmentRelationship) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *CvssV2VulnAssessmentRelationship) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *CvssV2VulnAssessmentRelationship) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *CvssV2VulnAssessmentRelationship) GetSummary() string {
+ return o.Summary
+}
+
+func (o *CvssV2VulnAssessmentRelationship) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *CvssV2VulnAssessmentRelationship) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *CvssV2VulnAssessmentRelationship) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *CvssV2VulnAssessmentRelationship) GetCompleteness() RelationshipCompleteness {
+ return o.Completeness
+}
+
+func (o *CvssV2VulnAssessmentRelationship) SetCompleteness(v RelationshipCompleteness) {
+ o.Completeness = v
+}
+
+func (o *CvssV2VulnAssessmentRelationship) GetEndTime() time.Time {
+ return o.EndTime
+}
+
+func (o *CvssV2VulnAssessmentRelationship) SetEndTime(v time.Time) {
+ o.EndTime = v
+}
+
+func (o *CvssV2VulnAssessmentRelationship) GetTo() ElementList {
+ return o.To
+}
+
+func (o *CvssV2VulnAssessmentRelationship) SetTo(v ElementList) {
+ o.To = v
+}
+
+func (o *CvssV2VulnAssessmentRelationship) GetFrom() AnyElement {
+ return o.From
+}
+
+func (o *CvssV2VulnAssessmentRelationship) SetFrom(v AnyElement) {
+ o.From = v
+}
+
+func (o *CvssV2VulnAssessmentRelationship) GetType() RelationshipType {
+ return o.Type
+}
+
+func (o *CvssV2VulnAssessmentRelationship) SetType(v RelationshipType) {
+ o.Type = v
+}
+
+func (o *CvssV2VulnAssessmentRelationship) GetStartTime() time.Time {
+ return o.StartTime
+}
+
+func (o *CvssV2VulnAssessmentRelationship) SetStartTime(v time.Time) {
+ o.StartTime = v
+}
+
+func (o *CvssV2VulnAssessmentRelationship) GetSuppliedBy() AnyAgent {
+ return o.SuppliedBy
+}
+
+func (o *CvssV2VulnAssessmentRelationship) SetSuppliedBy(v AnyAgent) {
+ o.SuppliedBy = v
+}
+
+func (o *CvssV2VulnAssessmentRelationship) GetWithdrawnTime() time.Time {
+ return o.WithdrawnTime
+}
+
+func (o *CvssV2VulnAssessmentRelationship) SetWithdrawnTime(v time.Time) {
+ o.WithdrawnTime = v
+}
+
+func (o *CvssV2VulnAssessmentRelationship) GetAssessedElement() AnySoftwareArtifact {
+ return o.AssessedElement
+}
+
+func (o *CvssV2VulnAssessmentRelationship) SetAssessedElement(v AnySoftwareArtifact) {
+ o.AssessedElement = v
+}
+
+func (o *CvssV2VulnAssessmentRelationship) GetPublishedTime() time.Time {
+ return o.PublishedTime
+}
+
+func (o *CvssV2VulnAssessmentRelationship) SetPublishedTime(v time.Time) {
+ o.PublishedTime = v
+}
+
+func (o *CvssV2VulnAssessmentRelationship) GetModifiedTime() time.Time {
+ return o.ModifiedTime
+}
+
+func (o *CvssV2VulnAssessmentRelationship) SetModifiedTime(v time.Time) {
+ o.ModifiedTime = v
+}
+
+func (o *CvssV2VulnAssessmentRelationship) GetVectorString() string {
+ return o.VectorString
+}
+
+func (o *CvssV2VulnAssessmentRelationship) SetVectorString(v string) {
+ o.VectorString = v
+}
+
+func (o *CvssV2VulnAssessmentRelationship) GetScore() float64 {
+ return o.Score
+}
+
+func (o *CvssV2VulnAssessmentRelationship) SetScore(v float64) {
+ o.Score = v
+}
+
+type CvssV2VulnAssessmentRelationshipList []AnyCvssV2VulnAssessmentRelationship
+
+func (v CvssV2VulnAssessmentRelationshipList) CvssV2VulnAssessmentRelationships() []AnyCvssV2VulnAssessmentRelationship {
+ return ld.SliceOf[AnyCvssV2VulnAssessmentRelationship](v)
+}
+
+type AnyCvssV3VulnAssessmentRelationship interface {
+ AnyVulnAssessmentRelationship
+ asCvssV3VulnAssessmentRelationship()
+ GetScore() float64
+ SetScore(float64)
+ GetSeverity() CvssSeverityType
+ SetSeverity(CvssSeverityType)
+ GetVectorString() string
+ SetVectorString(string)
+}
+
+// CvssV3VulnAssessmentRelationship Provides a CVSS version 3 assessment for a vulnerability.
+type CvssV3VulnAssessmentRelationship struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Security/CvssV3VulnAssessmentRelationship" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // Completeness Provides information about the completeness of relationships.
+ Completeness RelationshipCompleteness `iri:"https://spdx.org/rdf/3.0.1/terms/Core/completeness" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipCompleteness"`
+ // EndTime Specifies the time from which an element is no longer applicable / valid.
+ EndTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/endTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // To References an Element on the right-hand side of a relationship.
+ To ElementList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/to" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // From References the Element on the left-hand side of a relationship.
+ From AnyElement `iri:"https://spdx.org/rdf/3.0.1/terms/Core/from" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // Type Information about the relationship between two Elements.
+ Type RelationshipType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/relationshipType" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType"`
+ // StartTime Specifies the time from which an element is applicable / valid.
+ StartTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/startTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // SuppliedBy Identifies who or what supplied the artifact or VulnAssessmentRelationship referenced by the Element.
+ SuppliedBy AnyAgent `iri:"https://spdx.org/rdf/3.0.1/terms/Core/suppliedBy" type:"https://spdx.org/rdf/3.0.1/terms/Core/Agent"`
+ // WithdrawnTime Specified the time and date when a vulnerability was withdrawn.
+ WithdrawnTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/withdrawnTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // AssessedElement Specifies an Element contained in a piece of software where a vulnerability was found.
+ AssessedElement AnySoftwareArtifact `iri:"https://spdx.org/rdf/3.0.1/terms/Security/assessedElement" type:"https://spdx.org/rdf/3.0.1/terms/Software/SoftwareArtifact"`
+ // PublishedTime Specifies the time when a vulnerability was published.
+ PublishedTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/publishedTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ModifiedTime Specifies a time when a vulnerability assessment was modified
+ ModifiedTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/modifiedTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // Score Provides a numerical (0-10) representation of the severity of a vulnerability.
+ Score float64 `iri:"https://spdx.org/rdf/3.0.1/terms/Security/score" required:"true" type:"http://www.w3.org/2001/XMLSchema#decimal"`
+ // Severity Specifies the CVSS qualitative severity rating of a vulnerability in relation to a piece of software.
+ Severity CvssSeverityType `iri:"https://spdx.org/rdf/3.0.1/terms/Security/severity" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Security/CvssSeverityType"`
+ // VectorString Specifies the CVSS vector string for a vulnerability.
+ VectorString string `iri:"https://spdx.org/rdf/3.0.1/terms/Security/vectorString" required:"true" type:"http://www.w3.org/2001/XMLSchema#string"`
+}
+
+func (o *CvssV3VulnAssessmentRelationship) asCvssV3VulnAssessmentRelationship() {}
+func (o *CvssV3VulnAssessmentRelationship) asVulnAssessmentRelationship() {}
+func (o *CvssV3VulnAssessmentRelationship) asRelationship() {}
+func (o *CvssV3VulnAssessmentRelationship) asElement() {}
+func (o *CvssV3VulnAssessmentRelationship) GetID() string {
+ return o.ID
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetID(v string) {
+ o.ID = v
+}
+
+func (o *CvssV3VulnAssessmentRelationship) GetDescription() string {
+ return o.Description
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *CvssV3VulnAssessmentRelationship) GetComment() string {
+ return o.Comment
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *CvssV3VulnAssessmentRelationship) GetName() string {
+ return o.Name
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetName(v string) {
+ o.Name = v
+}
+
+func (o *CvssV3VulnAssessmentRelationship) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *CvssV3VulnAssessmentRelationship) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *CvssV3VulnAssessmentRelationship) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *CvssV3VulnAssessmentRelationship) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *CvssV3VulnAssessmentRelationship) GetSummary() string {
+ return o.Summary
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *CvssV3VulnAssessmentRelationship) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *CvssV3VulnAssessmentRelationship) GetCompleteness() RelationshipCompleteness {
+ return o.Completeness
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetCompleteness(v RelationshipCompleteness) {
+ o.Completeness = v
+}
+
+func (o *CvssV3VulnAssessmentRelationship) GetEndTime() time.Time {
+ return o.EndTime
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetEndTime(v time.Time) {
+ o.EndTime = v
+}
+
+func (o *CvssV3VulnAssessmentRelationship) GetTo() ElementList {
+ return o.To
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetTo(v ElementList) {
+ o.To = v
+}
+
+func (o *CvssV3VulnAssessmentRelationship) GetFrom() AnyElement {
+ return o.From
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetFrom(v AnyElement) {
+ o.From = v
+}
+
+func (o *CvssV3VulnAssessmentRelationship) GetType() RelationshipType {
+ return o.Type
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetType(v RelationshipType) {
+ o.Type = v
+}
+
+func (o *CvssV3VulnAssessmentRelationship) GetStartTime() time.Time {
+ return o.StartTime
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetStartTime(v time.Time) {
+ o.StartTime = v
+}
+
+func (o *CvssV3VulnAssessmentRelationship) GetSuppliedBy() AnyAgent {
+ return o.SuppliedBy
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetSuppliedBy(v AnyAgent) {
+ o.SuppliedBy = v
+}
+
+func (o *CvssV3VulnAssessmentRelationship) GetWithdrawnTime() time.Time {
+ return o.WithdrawnTime
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetWithdrawnTime(v time.Time) {
+ o.WithdrawnTime = v
+}
+
+func (o *CvssV3VulnAssessmentRelationship) GetAssessedElement() AnySoftwareArtifact {
+ return o.AssessedElement
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetAssessedElement(v AnySoftwareArtifact) {
+ o.AssessedElement = v
+}
+
+func (o *CvssV3VulnAssessmentRelationship) GetPublishedTime() time.Time {
+ return o.PublishedTime
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetPublishedTime(v time.Time) {
+ o.PublishedTime = v
+}
+
+func (o *CvssV3VulnAssessmentRelationship) GetModifiedTime() time.Time {
+ return o.ModifiedTime
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetModifiedTime(v time.Time) {
+ o.ModifiedTime = v
+}
+
+func (o *CvssV3VulnAssessmentRelationship) GetScore() float64 {
+ return o.Score
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetScore(v float64) {
+ o.Score = v
+}
+
+func (o *CvssV3VulnAssessmentRelationship) GetSeverity() CvssSeverityType {
+ return o.Severity
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetSeverity(v CvssSeverityType) {
+ o.Severity = v
+}
+
+func (o *CvssV3VulnAssessmentRelationship) GetVectorString() string {
+ return o.VectorString
+}
+
+func (o *CvssV3VulnAssessmentRelationship) SetVectorString(v string) {
+ o.VectorString = v
+}
+
+type CvssV3VulnAssessmentRelationshipList []AnyCvssV3VulnAssessmentRelationship
+
+func (v CvssV3VulnAssessmentRelationshipList) CvssV3VulnAssessmentRelationships() []AnyCvssV3VulnAssessmentRelationship {
+ return ld.SliceOf[AnyCvssV3VulnAssessmentRelationship](v)
+}
+
+type AnyCvssV4VulnAssessmentRelationship interface {
+ AnyVulnAssessmentRelationship
+ asCvssV4VulnAssessmentRelationship()
+ GetSeverity() CvssSeverityType
+ SetSeverity(CvssSeverityType)
+ GetVectorString() string
+ SetVectorString(string)
+ GetScore() float64
+ SetScore(float64)
+}
+
+// CvssV4VulnAssessmentRelationship Provides a CVSS version 4 assessment for a vulnerability.
+type CvssV4VulnAssessmentRelationship struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Security/CvssV4VulnAssessmentRelationship" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // Completeness Provides information about the completeness of relationships.
+ Completeness RelationshipCompleteness `iri:"https://spdx.org/rdf/3.0.1/terms/Core/completeness" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipCompleteness"`
+ // EndTime Specifies the time from which an element is no longer applicable / valid.
+ EndTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/endTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // To References an Element on the right-hand side of a relationship.
+ To ElementList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/to" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // From References the Element on the left-hand side of a relationship.
+ From AnyElement `iri:"https://spdx.org/rdf/3.0.1/terms/Core/from" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // Type Information about the relationship between two Elements.
+ Type RelationshipType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/relationshipType" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType"`
+ // StartTime Specifies the time from which an element is applicable / valid.
+ StartTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/startTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // SuppliedBy Identifies who or what supplied the artifact or VulnAssessmentRelationship referenced by the Element.
+ SuppliedBy AnyAgent `iri:"https://spdx.org/rdf/3.0.1/terms/Core/suppliedBy" type:"https://spdx.org/rdf/3.0.1/terms/Core/Agent"`
+ // WithdrawnTime Specified the time and date when a vulnerability was withdrawn.
+ WithdrawnTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/withdrawnTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // AssessedElement Specifies an Element contained in a piece of software where a vulnerability was found.
+ AssessedElement AnySoftwareArtifact `iri:"https://spdx.org/rdf/3.0.1/terms/Security/assessedElement" type:"https://spdx.org/rdf/3.0.1/terms/Software/SoftwareArtifact"`
+ // PublishedTime Specifies the time when a vulnerability was published.
+ PublishedTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/publishedTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ModifiedTime Specifies a time when a vulnerability assessment was modified
+ ModifiedTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/modifiedTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // Severity Specifies the CVSS qualitative severity rating of a vulnerability in relation to a piece of software.
+ Severity CvssSeverityType `iri:"https://spdx.org/rdf/3.0.1/terms/Security/severity" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Security/CvssSeverityType"`
+ // VectorString Specifies the CVSS vector string for a vulnerability.
+ VectorString string `iri:"https://spdx.org/rdf/3.0.1/terms/Security/vectorString" required:"true" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Score Provides a numerical (0-10) representation of the severity of a vulnerability.
+ Score float64 `iri:"https://spdx.org/rdf/3.0.1/terms/Security/score" required:"true" type:"http://www.w3.org/2001/XMLSchema#decimal"`
+}
+
+func (o *CvssV4VulnAssessmentRelationship) asCvssV4VulnAssessmentRelationship() {}
+func (o *CvssV4VulnAssessmentRelationship) asVulnAssessmentRelationship() {}
+func (o *CvssV4VulnAssessmentRelationship) asRelationship() {}
+func (o *CvssV4VulnAssessmentRelationship) asElement() {}
+func (o *CvssV4VulnAssessmentRelationship) GetID() string {
+ return o.ID
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetID(v string) {
+ o.ID = v
+}
+
+func (o *CvssV4VulnAssessmentRelationship) GetDescription() string {
+ return o.Description
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *CvssV4VulnAssessmentRelationship) GetComment() string {
+ return o.Comment
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *CvssV4VulnAssessmentRelationship) GetName() string {
+ return o.Name
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetName(v string) {
+ o.Name = v
+}
+
+func (o *CvssV4VulnAssessmentRelationship) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *CvssV4VulnAssessmentRelationship) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *CvssV4VulnAssessmentRelationship) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *CvssV4VulnAssessmentRelationship) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *CvssV4VulnAssessmentRelationship) GetSummary() string {
+ return o.Summary
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *CvssV4VulnAssessmentRelationship) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *CvssV4VulnAssessmentRelationship) GetCompleteness() RelationshipCompleteness {
+ return o.Completeness
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetCompleteness(v RelationshipCompleteness) {
+ o.Completeness = v
+}
+
+func (o *CvssV4VulnAssessmentRelationship) GetEndTime() time.Time {
+ return o.EndTime
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetEndTime(v time.Time) {
+ o.EndTime = v
+}
+
+func (o *CvssV4VulnAssessmentRelationship) GetTo() ElementList {
+ return o.To
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetTo(v ElementList) {
+ o.To = v
+}
+
+func (o *CvssV4VulnAssessmentRelationship) GetFrom() AnyElement {
+ return o.From
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetFrom(v AnyElement) {
+ o.From = v
+}
+
+func (o *CvssV4VulnAssessmentRelationship) GetType() RelationshipType {
+ return o.Type
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetType(v RelationshipType) {
+ o.Type = v
+}
+
+func (o *CvssV4VulnAssessmentRelationship) GetStartTime() time.Time {
+ return o.StartTime
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetStartTime(v time.Time) {
+ o.StartTime = v
+}
+
+func (o *CvssV4VulnAssessmentRelationship) GetSuppliedBy() AnyAgent {
+ return o.SuppliedBy
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetSuppliedBy(v AnyAgent) {
+ o.SuppliedBy = v
+}
+
+func (o *CvssV4VulnAssessmentRelationship) GetWithdrawnTime() time.Time {
+ return o.WithdrawnTime
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetWithdrawnTime(v time.Time) {
+ o.WithdrawnTime = v
+}
+
+func (o *CvssV4VulnAssessmentRelationship) GetAssessedElement() AnySoftwareArtifact {
+ return o.AssessedElement
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetAssessedElement(v AnySoftwareArtifact) {
+ o.AssessedElement = v
+}
+
+func (o *CvssV4VulnAssessmentRelationship) GetPublishedTime() time.Time {
+ return o.PublishedTime
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetPublishedTime(v time.Time) {
+ o.PublishedTime = v
+}
+
+func (o *CvssV4VulnAssessmentRelationship) GetModifiedTime() time.Time {
+ return o.ModifiedTime
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetModifiedTime(v time.Time) {
+ o.ModifiedTime = v
+}
+
+func (o *CvssV4VulnAssessmentRelationship) GetSeverity() CvssSeverityType {
+ return o.Severity
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetSeverity(v CvssSeverityType) {
+ o.Severity = v
+}
+
+func (o *CvssV4VulnAssessmentRelationship) GetVectorString() string {
+ return o.VectorString
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetVectorString(v string) {
+ o.VectorString = v
+}
+
+func (o *CvssV4VulnAssessmentRelationship) GetScore() float64 {
+ return o.Score
+}
+
+func (o *CvssV4VulnAssessmentRelationship) SetScore(v float64) {
+ o.Score = v
+}
+
+type CvssV4VulnAssessmentRelationshipList []AnyCvssV4VulnAssessmentRelationship
+
+func (v CvssV4VulnAssessmentRelationshipList) CvssV4VulnAssessmentRelationships() []AnyCvssV4VulnAssessmentRelationship {
+ return ld.SliceOf[AnyCvssV4VulnAssessmentRelationship](v)
+}
+
+// DatasetAvailabilityType Availability of dataset.
+type DatasetAvailabilityType struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetAvailabilityType" node-kind:""`
+ id string `iri:"@id"`
+}
+
+func (o *DatasetAvailabilityType) GetID() string {
+ return o.id
+}
+
+// DatasetAvailabilityType_Clickthrough the dataset is not publicly available and can only be accessed after affirmatively accepting terms on a clickthrough webpage.
+var DatasetAvailabilityType_Clickthrough = DatasetAvailabilityType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetAvailabilityType/clickthrough",
+}
+
+// DatasetAvailabilityType_DirectDownload the dataset is publicly available and can be downloaded directly.
+var DatasetAvailabilityType_DirectDownload = DatasetAvailabilityType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetAvailabilityType/directDownload",
+}
+
+// DatasetAvailabilityType_Query the dataset is publicly available, but not all at once, and can only be accessed through queries which return parts of the dataset.
+var DatasetAvailabilityType_Query = DatasetAvailabilityType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetAvailabilityType/query",
+}
+
+// DatasetAvailabilityType_Registration the dataset is not publicly available and an email registration is required before accessing the dataset, although without an affirmative acceptance of terms.
+var DatasetAvailabilityType_Registration = DatasetAvailabilityType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetAvailabilityType/registration",
+}
+
+// DatasetAvailabilityType_ScrapingScript the dataset provider is not making available the underlying data and the dataset must be reassembled, typically using the provided script for scraping the data.
+var DatasetAvailabilityType_ScrapingScript = DatasetAvailabilityType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetAvailabilityType/scrapingScript",
+}
+
+type AnyDatasetPackage interface {
+ AnyPackage
+ asDatasetPackage()
+ GetConfidentialityLevel() ConfidentialityLevelType
+ SetConfidentialityLevel(ConfidentialityLevelType)
+ GetAnonymizationMethodUseds() []string
+ SetAnonymizationMethodUseds([]string)
+ GetDatasetUpdateMechanism() string
+ SetDatasetUpdateMechanism(string)
+ GetDatasetNoise() string
+ SetDatasetNoise(string)
+ GetDatasetSize() NonNegativeInt
+ SetDatasetSize(NonNegativeInt)
+ GetSensors() DictionaryEntryList
+ SetSensors(DictionaryEntryList)
+ GetIntendedUse() string
+ SetIntendedUse(string)
+ GetDataPreprocessings() []string
+ SetDataPreprocessings([]string)
+ GetKnownBias() []string
+ SetKnownBias([]string)
+ GetDatasetAvailability() DatasetAvailabilityType
+ SetDatasetAvailability(DatasetAvailabilityType)
+ GetHasSensitivePersonalInformation() PresenceType
+ SetHasSensitivePersonalInformation(PresenceType)
+ GetDataCollectionProcess() string
+ SetDataCollectionProcess(string)
+ GetDatasetTypes() []DatasetType
+ SetDatasetTypes([]DatasetType)
+}
+
+// DatasetPackage Specifies a data package and its associated information.
+type DatasetPackage struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetPackage" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // StandardNames The name of a relevant standard that may apply to an artifact.
+ StandardNames []string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/standardName" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // BuiltTime Specifies the time an artifact was built.
+ BuiltTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/builtTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ReleaseTime Specifies the time an artifact was released.
+ ReleaseTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/releaseTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // SupportLevels Specifies the level of support associated with an artifact.
+ SupportLevels []SupportType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/supportLevel" type:"https://spdx.org/rdf/3.0.1/terms/Core/SupportType"`
+ // SuppliedBy Identifies who or what supplied the artifact or VulnAssessmentRelationship referenced by the Element.
+ SuppliedBy AnyAgent `iri:"https://spdx.org/rdf/3.0.1/terms/Core/suppliedBy" type:"https://spdx.org/rdf/3.0.1/terms/Core/Agent"`
+ // OriginatedBy Identifies from where or whom the Element originally came.
+ OriginatedBy AgentList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/originatedBy" type:"https://spdx.org/rdf/3.0.1/terms/Core/Agent"`
+ // ValidUntilTime Specifies until when the artifact can be used before its usage needs to be reassessed.
+ ValidUntilTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/validUntilTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ContentIdentifiers A canonical, unique, immutable identifier of the artifact content, that may be used for verifying its identity and/or integrity.
+ ContentIdentifiers ContentIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Software/contentIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Software/ContentIdentifier"`
+ // AttributionTexts Provides a place for the SPDX data creator to record acknowledgement text for a software Package, File or Snippet.
+ AttributionTexts []string `iri:"https://spdx.org/rdf/3.0.1/terms/Software/attributionText" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // AdditionalPurposes Provides additional purpose information of the software artifact.
+ AdditionalPurposes []SoftwarePurpose `iri:"https://spdx.org/rdf/3.0.1/terms/Software/additionalPurpose" type:"https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose"`
+ // PrimaryPurpose Provides information about the primary purpose of the software artifact.
+ PrimaryPurpose SoftwarePurpose `iri:"https://spdx.org/rdf/3.0.1/terms/Software/primaryPurpose" type:"https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose"`
+ // CopyrightText Identifies the text of one or more copyright notices for a software Package, File or Snippet, if any.
+ CopyrightText string `iri:"https://spdx.org/rdf/3.0.1/terms/Software/copyrightText" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // SourceInfo Records any relevant background information or additional comments about the origin of the package.
+ SourceInfo string `iri:"https://spdx.org/rdf/3.0.1/terms/Software/sourceInfo" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // HomePage A place for the SPDX document creator to record a website that serves as the package's home page.
+ HomePage URI `iri:"https://spdx.org/rdf/3.0.1/terms/Software/homePage" type:"http://www.w3.org/2001/XMLSchema#anyURI"`
+ // Version Identify the version of a package.
+ Version string `iri:"https://spdx.org/rdf/3.0.1/terms/Software/packageVersion" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // PackageURL Provides a place for the SPDX data creator to record the package URL string (in accordance with the Package URL specification) for a software Package.
+ PackageURL URI `iri:"https://spdx.org/rdf/3.0.1/terms/Software/packageUrl" type:"http://www.w3.org/2001/XMLSchema#anyURI"`
+ // DownloadLocation Identifies the download Uniform Resource Identifier for the package at the time that the document was created.
+ DownloadLocation URI `iri:"https://spdx.org/rdf/3.0.1/terms/Software/downloadLocation" type:"http://www.w3.org/2001/XMLSchema#anyURI"`
+ // ConfidentialityLevel Describes the confidentiality level of the data points contained in the dataset.
+ ConfidentialityLevel ConfidentialityLevelType `iri:"https://spdx.org/rdf/3.0.1/terms/Dataset/confidentialityLevel" type:"https://spdx.org/rdf/3.0.1/terms/Dataset/ConfidentialityLevelType"`
+ // AnonymizationMethodUseds Describes the anonymization methods used.
+ AnonymizationMethodUseds []string `iri:"https://spdx.org/rdf/3.0.1/terms/Dataset/anonymizationMethodUsed" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // DatasetUpdateMechanism Describes a mechanism to update the dataset.
+ DatasetUpdateMechanism string `iri:"https://spdx.org/rdf/3.0.1/terms/Dataset/datasetUpdateMechanism" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // DatasetNoise Describes potentially noisy elements of the dataset.
+ DatasetNoise string `iri:"https://spdx.org/rdf/3.0.1/terms/Dataset/datasetNoise" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // DatasetSize Captures the size of the dataset.
+ DatasetSize NonNegativeInt `iri:"https://spdx.org/rdf/3.0.1/terms/Dataset/datasetSize" type:"http://www.w3.org/2001/XMLSchema#nonNegativeInteger"`
+ // Sensors Describes a sensor used for collecting the data.
+ Sensors DictionaryEntryList `iri:"https://spdx.org/rdf/3.0.1/terms/Dataset/sensor" type:"https://spdx.org/rdf/3.0.1/terms/Core/DictionaryEntry"`
+ // IntendedUse Describes what the given dataset should be used for.
+ IntendedUse string `iri:"https://spdx.org/rdf/3.0.1/terms/Dataset/intendedUse" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // DataPreprocessings Describes the preprocessing steps that were applied to the raw data to create the given dataset.
+ DataPreprocessings []string `iri:"https://spdx.org/rdf/3.0.1/terms/Dataset/dataPreprocessing" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // KnownBias Records the biases that the dataset is known to encompass.
+ KnownBias []string `iri:"https://spdx.org/rdf/3.0.1/terms/Dataset/knownBias" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // DatasetAvailability The field describes the availability of a dataset.
+ DatasetAvailability DatasetAvailabilityType `iri:"https://spdx.org/rdf/3.0.1/terms/Dataset/datasetAvailability" type:"https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetAvailabilityType"`
+ // HasSensitivePersonalInformation Describes if any sensitive personal information is present in the dataset.
+ HasSensitivePersonalInformation PresenceType `iri:"https://spdx.org/rdf/3.0.1/terms/Dataset/hasSensitivePersonalInformation" type:"https://spdx.org/rdf/3.0.1/terms/Core/PresenceType"`
+ // DataCollectionProcess Describes how the dataset was collected.
+ DataCollectionProcess string `iri:"https://spdx.org/rdf/3.0.1/terms/Dataset/dataCollectionProcess" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // DatasetTypes Describes the type of the given dataset.
+ DatasetTypes []DatasetType `iri:"https://spdx.org/rdf/3.0.1/terms/Dataset/datasetType" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetType"`
+}
+
+func (o *DatasetPackage) asDatasetPackage() {}
+func (o *DatasetPackage) asPackage() {}
+func (o *DatasetPackage) asSoftwareArtifact() {}
+func (o *DatasetPackage) asArtifact() {}
+func (o *DatasetPackage) asElement() {}
+func (o *DatasetPackage) GetID() string {
+ return o.ID
+}
+
+func (o *DatasetPackage) SetID(v string) {
+ o.ID = v
+}
+
+func (o *DatasetPackage) GetDescription() string {
+ return o.Description
+}
+
+func (o *DatasetPackage) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *DatasetPackage) GetComment() string {
+ return o.Comment
+}
+
+func (o *DatasetPackage) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *DatasetPackage) GetName() string {
+ return o.Name
+}
+
+func (o *DatasetPackage) SetName(v string) {
+ o.Name = v
+}
+
+func (o *DatasetPackage) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *DatasetPackage) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *DatasetPackage) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *DatasetPackage) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *DatasetPackage) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *DatasetPackage) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *DatasetPackage) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *DatasetPackage) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *DatasetPackage) GetSummary() string {
+ return o.Summary
+}
+
+func (o *DatasetPackage) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *DatasetPackage) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *DatasetPackage) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *DatasetPackage) GetStandardNames() []string {
+ return o.StandardNames
+}
+
+func (o *DatasetPackage) SetStandardNames(v []string) {
+ o.StandardNames = v
+}
+
+func (o *DatasetPackage) GetBuiltTime() time.Time {
+ return o.BuiltTime
+}
+
+func (o *DatasetPackage) SetBuiltTime(v time.Time) {
+ o.BuiltTime = v
+}
+
+func (o *DatasetPackage) GetReleaseTime() time.Time {
+ return o.ReleaseTime
+}
+
+func (o *DatasetPackage) SetReleaseTime(v time.Time) {
+ o.ReleaseTime = v
+}
+
+func (o *DatasetPackage) GetSupportLevels() []SupportType {
+ return o.SupportLevels
+}
+
+func (o *DatasetPackage) SetSupportLevels(v []SupportType) {
+ o.SupportLevels = v
+}
+
+func (o *DatasetPackage) GetSuppliedBy() AnyAgent {
+ return o.SuppliedBy
+}
+
+func (o *DatasetPackage) SetSuppliedBy(v AnyAgent) {
+ o.SuppliedBy = v
+}
+
+func (o *DatasetPackage) GetOriginatedBy() AgentList {
+ return o.OriginatedBy
+}
+
+func (o *DatasetPackage) SetOriginatedBy(v AgentList) {
+ o.OriginatedBy = v
+}
+
+func (o *DatasetPackage) GetValidUntilTime() time.Time {
+ return o.ValidUntilTime
+}
+
+func (o *DatasetPackage) SetValidUntilTime(v time.Time) {
+ o.ValidUntilTime = v
+}
+
+func (o *DatasetPackage) GetContentIdentifiers() ContentIdentifierList {
+ return o.ContentIdentifiers
+}
+
+func (o *DatasetPackage) SetContentIdentifiers(v ContentIdentifierList) {
+ o.ContentIdentifiers = v
+}
+
+func (o *DatasetPackage) GetAttributionTexts() []string {
+ return o.AttributionTexts
+}
+
+func (o *DatasetPackage) SetAttributionTexts(v []string) {
+ o.AttributionTexts = v
+}
+
+func (o *DatasetPackage) GetAdditionalPurposes() []SoftwarePurpose {
+ return o.AdditionalPurposes
+}
+
+func (o *DatasetPackage) SetAdditionalPurposes(v []SoftwarePurpose) {
+ o.AdditionalPurposes = v
+}
+
+func (o *DatasetPackage) GetPrimaryPurpose() SoftwarePurpose {
+ return o.PrimaryPurpose
+}
+
+func (o *DatasetPackage) SetPrimaryPurpose(v SoftwarePurpose) {
+ o.PrimaryPurpose = v
+}
+
+func (o *DatasetPackage) GetCopyrightText() string {
+ return o.CopyrightText
+}
+
+func (o *DatasetPackage) SetCopyrightText(v string) {
+ o.CopyrightText = v
+}
+
+func (o *DatasetPackage) GetSourceInfo() string {
+ return o.SourceInfo
+}
+
+func (o *DatasetPackage) SetSourceInfo(v string) {
+ o.SourceInfo = v
+}
+
+func (o *DatasetPackage) GetHomePage() URI {
+ return o.HomePage
+}
+
+func (o *DatasetPackage) SetHomePage(v URI) {
+ o.HomePage = v
+}
+
+func (o *DatasetPackage) GetVersion() string {
+ return o.Version
+}
+
+func (o *DatasetPackage) SetVersion(v string) {
+ o.Version = v
+}
+
+func (o *DatasetPackage) GetPackageURL() URI {
+ return o.PackageURL
+}
+
+func (o *DatasetPackage) SetPackageURL(v URI) {
+ o.PackageURL = v
+}
+
+func (o *DatasetPackage) GetDownloadLocation() URI {
+ return o.DownloadLocation
+}
+
+func (o *DatasetPackage) SetDownloadLocation(v URI) {
+ o.DownloadLocation = v
+}
+
+func (o *DatasetPackage) GetConfidentialityLevel() ConfidentialityLevelType {
+ return o.ConfidentialityLevel
+}
+
+func (o *DatasetPackage) SetConfidentialityLevel(v ConfidentialityLevelType) {
+ o.ConfidentialityLevel = v
+}
+
+func (o *DatasetPackage) GetAnonymizationMethodUseds() []string {
+ return o.AnonymizationMethodUseds
+}
+
+func (o *DatasetPackage) SetAnonymizationMethodUseds(v []string) {
+ o.AnonymizationMethodUseds = v
+}
+
+func (o *DatasetPackage) GetDatasetUpdateMechanism() string {
+ return o.DatasetUpdateMechanism
+}
+
+func (o *DatasetPackage) SetDatasetUpdateMechanism(v string) {
+ o.DatasetUpdateMechanism = v
+}
+
+func (o *DatasetPackage) GetDatasetNoise() string {
+ return o.DatasetNoise
+}
+
+func (o *DatasetPackage) SetDatasetNoise(v string) {
+ o.DatasetNoise = v
+}
+
+func (o *DatasetPackage) GetDatasetSize() NonNegativeInt {
+ return o.DatasetSize
+}
+
+func (o *DatasetPackage) SetDatasetSize(v NonNegativeInt) {
+ o.DatasetSize = v
+}
+
+func (o *DatasetPackage) GetSensors() DictionaryEntryList {
+ return o.Sensors
+}
+
+func (o *DatasetPackage) SetSensors(v DictionaryEntryList) {
+ o.Sensors = v
+}
+
+func (o *DatasetPackage) GetIntendedUse() string {
+ return o.IntendedUse
+}
+
+func (o *DatasetPackage) SetIntendedUse(v string) {
+ o.IntendedUse = v
+}
+
+func (o *DatasetPackage) GetDataPreprocessings() []string {
+ return o.DataPreprocessings
+}
+
+func (o *DatasetPackage) SetDataPreprocessings(v []string) {
+ o.DataPreprocessings = v
+}
+
+func (o *DatasetPackage) GetKnownBias() []string {
+ return o.KnownBias
+}
+
+func (o *DatasetPackage) SetKnownBias(v []string) {
+ o.KnownBias = v
+}
+
+func (o *DatasetPackage) GetDatasetAvailability() DatasetAvailabilityType {
+ return o.DatasetAvailability
+}
+
+func (o *DatasetPackage) SetDatasetAvailability(v DatasetAvailabilityType) {
+ o.DatasetAvailability = v
+}
+
+func (o *DatasetPackage) GetHasSensitivePersonalInformation() PresenceType {
+ return o.HasSensitivePersonalInformation
+}
+
+func (o *DatasetPackage) SetHasSensitivePersonalInformation(v PresenceType) {
+ o.HasSensitivePersonalInformation = v
+}
+
+func (o *DatasetPackage) GetDataCollectionProcess() string {
+ return o.DataCollectionProcess
+}
+
+func (o *DatasetPackage) SetDataCollectionProcess(v string) {
+ o.DataCollectionProcess = v
+}
+
+func (o *DatasetPackage) GetDatasetTypes() []DatasetType {
+ return o.DatasetTypes
+}
+
+func (o *DatasetPackage) SetDatasetTypes(v []DatasetType) {
+ o.DatasetTypes = v
+}
+
+type DatasetPackageList []AnyDatasetPackage
+
+func (v DatasetPackageList) DatasetPackages() []AnyDatasetPackage {
+ return ld.SliceOf[AnyDatasetPackage](v)
+}
+
+// DatasetType Enumeration of dataset types.
+type DatasetType struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetType" node-kind:""`
+ id string `iri:"@id"`
+}
+
+func (o *DatasetType) GetID() string {
+ return o.id
+}
+
+// DatasetType_Audio data is audio based, such as a collection of music from the 80s.
+var DatasetType_Audio = DatasetType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetType/audio",
+}
+
+// DatasetType_Categorical data that is classified into a discrete number of categories, such as the eye color of a population of people.
+var DatasetType_Categorical = DatasetType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetType/categorical",
+}
+
+// DatasetType_Graph data is in the form of a graph where entries are somehow related to each other through edges, such a social network of friends.
+var DatasetType_Graph = DatasetType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetType/graph",
+}
+
+// DatasetType_Image data is a collection of images such as pictures of animals.
+var DatasetType_Image = DatasetType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetType/image",
+}
+
+// DatasetType_NoAssertion data type is not known.
+var DatasetType_NoAssertion = DatasetType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetType/noAssertion",
+}
+
+// DatasetType_Numeric data consists only of numeric entries.
+var DatasetType_Numeric = DatasetType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetType/numeric",
+}
+
+// DatasetType_Other data is of a type not included in this list.
+var DatasetType_Other = DatasetType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetType/other",
+}
+
+// DatasetType_Sensor data is recorded from a physical sensor, such as a thermometer reading or biometric device.
+var DatasetType_Sensor = DatasetType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetType/sensor",
+}
+
+// DatasetType_Structured data is stored in tabular format or retrieved from a relational database.
+var DatasetType_Structured = DatasetType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetType/structured",
+}
+
+// DatasetType_Syntactic data describes the syntax or semantics of a language or text, such as a parse tree used for natural language processing.
+var DatasetType_Syntactic = DatasetType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetType/syntactic",
+}
+
+// DatasetType_Text data consists of unstructured text, such as a book, Wikipedia article (without images), or transcript.
+var DatasetType_Text = DatasetType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetType/text",
+}
+
+// DatasetType_Timeseries data is recorded in an ordered sequence of timestamped entries, such as the price of a stock over the course of a day.
+var DatasetType_Timeseries = DatasetType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetType/timeseries",
+}
+
+// DatasetType_Timestamp data is recorded with a timestamp for each entry, but not necessarily ordered or at specific intervals, such as when a taxi ride starts and ends.
+var DatasetType_Timestamp = DatasetType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetType/timestamp",
+}
+
+// DatasetType_Video data is video based, such as a collection of movie clips featuring Tom Hanks.
+var DatasetType_Video = DatasetType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetType/video",
+}
+
+type AnyDictionaryEntry interface {
+ GetID() string
+ SetID(string)
+ asDictionaryEntry()
+ GetValue() string
+ SetValue(string)
+ GetKey() string
+ SetKey(string)
+}
+
+// DictionaryEntry A key with an associated value.
+type DictionaryEntry struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/DictionaryEntry" node-kind:"http://www.w3.org/ns/shacl#BlankNodeOrIRI"`
+ ID string `iri:"@id"`
+ // Value A value used in a generic key-value pair.
+ Value string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/value" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Key A key used in a generic key-value pair.
+ Key string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/key" required:"true" type:"http://www.w3.org/2001/XMLSchema#string"`
+}
+
+func (o *DictionaryEntry) asDictionaryEntry() {}
+func (o *DictionaryEntry) GetID() string {
+ return o.ID
+}
+
+func (o *DictionaryEntry) SetID(v string) {
+ o.ID = v
+}
+
+func (o *DictionaryEntry) GetValue() string {
+ return o.Value
+}
+
+func (o *DictionaryEntry) SetValue(v string) {
+ o.Value = v
+}
+
+func (o *DictionaryEntry) GetKey() string {
+ return o.Key
+}
+
+func (o *DictionaryEntry) SetKey(v string) {
+ o.Key = v
+}
+
+type DictionaryEntryList []AnyDictionaryEntry
+
+func (v DictionaryEntryList) DictionaryEntries() []AnyDictionaryEntry {
+ return ld.SliceOf[AnyDictionaryEntry](v)
+}
+
+type AnyDisjunctiveLicenseSet interface {
+ AnyLicenseInfo
+ asDisjunctiveLicenseSet()
+ GetMembers() LicenseInfoList
+ SetMembers(LicenseInfoList)
+}
+
+// DisjunctiveLicenseSet Portion of an AnyLicenseInfo representing a set of licensing information where only one of the elements applies.
+type DisjunctiveLicenseSet struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/DisjunctiveLicenseSet" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // Members A license expression participating in a license set.
+ Members LicenseInfoList `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/member" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/SimpleLicensing/AnyLicenseInfo"`
+}
+
+func (o *DisjunctiveLicenseSet) asDisjunctiveLicenseSet() {}
+func (o *DisjunctiveLicenseSet) asLicenseInfo() {}
+func (o *DisjunctiveLicenseSet) asElement() {}
+func (o *DisjunctiveLicenseSet) GetID() string {
+ return o.ID
+}
+
+func (o *DisjunctiveLicenseSet) SetID(v string) {
+ o.ID = v
+}
+
+func (o *DisjunctiveLicenseSet) GetDescription() string {
+ return o.Description
+}
+
+func (o *DisjunctiveLicenseSet) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *DisjunctiveLicenseSet) GetComment() string {
+ return o.Comment
+}
+
+func (o *DisjunctiveLicenseSet) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *DisjunctiveLicenseSet) GetName() string {
+ return o.Name
+}
+
+func (o *DisjunctiveLicenseSet) SetName(v string) {
+ o.Name = v
+}
+
+func (o *DisjunctiveLicenseSet) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *DisjunctiveLicenseSet) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *DisjunctiveLicenseSet) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *DisjunctiveLicenseSet) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *DisjunctiveLicenseSet) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *DisjunctiveLicenseSet) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *DisjunctiveLicenseSet) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *DisjunctiveLicenseSet) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *DisjunctiveLicenseSet) GetSummary() string {
+ return o.Summary
+}
+
+func (o *DisjunctiveLicenseSet) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *DisjunctiveLicenseSet) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *DisjunctiveLicenseSet) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *DisjunctiveLicenseSet) GetMembers() LicenseInfoList {
+ return o.Members
+}
+
+func (o *DisjunctiveLicenseSet) SetMembers(v LicenseInfoList) {
+ o.Members = v
+}
+
+type DisjunctiveLicenseSetList []AnyDisjunctiveLicenseSet
+
+func (v DisjunctiveLicenseSetList) DisjunctiveLicenseSets() []AnyDisjunctiveLicenseSet {
+ return ld.SliceOf[AnyDisjunctiveLicenseSet](v)
+}
+
+type AnyElement interface {
+ GetID() string
+ SetID(string)
+ asElement()
+ GetDescription() string
+ SetDescription(string)
+ GetComment() string
+ SetComment(string)
+ GetName() string
+ SetName(string)
+ GetExtensions() ExtensionList
+ SetExtensions(ExtensionList)
+ GetCreationInfo() AnyCreationInfo
+ SetCreationInfo(AnyCreationInfo)
+ GetExternalIdentifiers() ExternalIdentifierList
+ SetExternalIdentifiers(ExternalIdentifierList)
+ GetExternalRefs() ExternalRefList
+ SetExternalRefs(ExternalRefList)
+ GetSummary() string
+ SetSummary(string)
+ GetVerifiedUsing() IntegrityMethodList
+ SetVerifiedUsing(IntegrityMethodList)
+}
+
+// Element Base domain class from which all other SPDX-3.0 domain classes derive.
+type ElementList []AnyElement
+
+func (v ElementList) AIPackages() []AnyAIPackage {
+ return ld.SliceOf[AnyAIPackage](v)
+}
+
+func (v ElementList) Agents() []AnyAgent {
+ return ld.SliceOf[AnyAgent](v)
+}
+
+func (v ElementList) Annotations() []AnyAnnotation {
+ return ld.SliceOf[AnyAnnotation](v)
+}
+
+func (v ElementList) Artifacts() []AnyArtifact {
+ return ld.SliceOf[AnyArtifact](v)
+}
+
+func (v ElementList) BOMs() []AnyBOM {
+ return ld.SliceOf[AnyBOM](v)
+}
+
+func (v ElementList) Builds() []AnyBuild {
+ return ld.SliceOf[AnyBuild](v)
+}
+
+func (v ElementList) Bundles() []AnyBundle {
+ return ld.SliceOf[AnyBundle](v)
+}
+
+func (v ElementList) ConjunctiveLicenseSets() []AnyConjunctiveLicenseSet {
+ return ld.SliceOf[AnyConjunctiveLicenseSet](v)
+}
+
+func (v ElementList) CustomLicenses() []AnyCustomLicense {
+ return ld.SliceOf[AnyCustomLicense](v)
+}
+
+func (v ElementList) CustomLicenseAdditions() []AnyCustomLicenseAddition {
+ return ld.SliceOf[AnyCustomLicenseAddition](v)
+}
+
+func (v ElementList) CvssV2VulnAssessmentRelationships() []AnyCvssV2VulnAssessmentRelationship {
+ return ld.SliceOf[AnyCvssV2VulnAssessmentRelationship](v)
+}
+
+func (v ElementList) CvssV3VulnAssessmentRelationships() []AnyCvssV3VulnAssessmentRelationship {
+ return ld.SliceOf[AnyCvssV3VulnAssessmentRelationship](v)
+}
+
+func (v ElementList) CvssV4VulnAssessmentRelationships() []AnyCvssV4VulnAssessmentRelationship {
+ return ld.SliceOf[AnyCvssV4VulnAssessmentRelationship](v)
+}
+
+func (v ElementList) DatasetPackages() []AnyDatasetPackage {
+ return ld.SliceOf[AnyDatasetPackage](v)
+}
+
+func (v ElementList) DisjunctiveLicenseSets() []AnyDisjunctiveLicenseSet {
+ return ld.SliceOf[AnyDisjunctiveLicenseSet](v)
+}
+
+func (v ElementList) Elements() []AnyElement {
+ return ld.SliceOf[AnyElement](v)
+}
+
+func (v ElementList) ElementCollections() []AnyElementCollection {
+ return ld.SliceOf[AnyElementCollection](v)
+}
+
+func (v ElementList) EpssVulnAssessmentRelationships() []AnyEpssVulnAssessmentRelationship {
+ return ld.SliceOf[AnyEpssVulnAssessmentRelationship](v)
+}
+
+func (v ElementList) ExploitCatalogVulnAssessmentRelationships() []AnyExploitCatalogVulnAssessmentRelationship {
+ return ld.SliceOf[AnyExploitCatalogVulnAssessmentRelationship](v)
+}
+
+func (v ElementList) ExtendableLicenses() []AnyExtendableLicense {
+ return ld.SliceOf[AnyExtendableLicense](v)
+}
+
+func (v ElementList) Files() []AnyFile {
+ return ld.SliceOf[AnyFile](v)
+}
+
+func (v ElementList) IndividualElements() []AnyIndividualElement {
+ return ld.SliceOf[AnyIndividualElement](v)
+}
+
+func (v ElementList) IndividualLicensingInfos() []AnyIndividualLicensingInfo {
+ return ld.SliceOf[AnyIndividualLicensingInfo](v)
+}
+
+func (v ElementList) Licenses() []AnyLicense {
+ return ld.SliceOf[AnyLicense](v)
+}
+
+func (v ElementList) LicenseAdditions() []AnyLicenseAddition {
+ return ld.SliceOf[AnyLicenseAddition](v)
+}
+
+func (v ElementList) LicenseExpressions() []AnyLicenseExpression {
+ return ld.SliceOf[AnyLicenseExpression](v)
+}
+
+func (v ElementList) LicenseInfos() []AnyLicenseInfo {
+ return ld.SliceOf[AnyLicenseInfo](v)
+}
+
+func (v ElementList) LifecycleScopedRelationships() []AnyLifecycleScopedRelationship {
+ return ld.SliceOf[AnyLifecycleScopedRelationship](v)
+}
+
+func (v ElementList) ListedLicenses() []AnyListedLicense {
+ return ld.SliceOf[AnyListedLicense](v)
+}
+
+func (v ElementList) ListedLicenseExceptions() []AnyListedLicenseException {
+ return ld.SliceOf[AnyListedLicenseException](v)
+}
+
+func (v ElementList) OrLaterOperators() []AnyOrLaterOperator {
+ return ld.SliceOf[AnyOrLaterOperator](v)
+}
+
+func (v ElementList) Organizations() []AnyOrganization {
+ return ld.SliceOf[AnyOrganization](v)
+}
+
+func (v ElementList) Packages() []AnyPackage {
+ return ld.SliceOf[AnyPackage](v)
+}
+
+func (v ElementList) People() []AnyPerson {
+ return ld.SliceOf[AnyPerson](v)
+}
+
+func (v ElementList) Relationships() []AnyRelationship {
+ return ld.SliceOf[AnyRelationship](v)
+}
+
+func (v ElementList) SBOMs() []AnySBOM {
+ return ld.SliceOf[AnySBOM](v)
+}
+
+func (v ElementList) SimpleLicensingTexts() []AnySimpleLicensingText {
+ return ld.SliceOf[AnySimpleLicensingText](v)
+}
+
+func (v ElementList) Snippets() []AnySnippet {
+ return ld.SliceOf[AnySnippet](v)
+}
+
+func (v ElementList) SoftwareAgents() []AnySoftwareAgent {
+ return ld.SliceOf[AnySoftwareAgent](v)
+}
+
+func (v ElementList) SoftwareArtifacts() []AnySoftwareArtifact {
+ return ld.SliceOf[AnySoftwareArtifact](v)
+}
+
+func (v ElementList) SpdxDocuments() []AnySpdxDocument {
+ return ld.SliceOf[AnySpdxDocument](v)
+}
+
+func (v ElementList) SsvcVulnAssessmentRelationships() []AnySsvcVulnAssessmentRelationship {
+ return ld.SliceOf[AnySsvcVulnAssessmentRelationship](v)
+}
+
+func (v ElementList) Tools() []AnyTool {
+ return ld.SliceOf[AnyTool](v)
+}
+
+func (v ElementList) VexAffectedVulnAssessmentRelationships() []AnyVexAffectedVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexAffectedVulnAssessmentRelationship](v)
+}
+
+func (v ElementList) VexFixedVulnAssessmentRelationships() []AnyVexFixedVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexFixedVulnAssessmentRelationship](v)
+}
+
+func (v ElementList) VexNotAffectedVulnAssessmentRelationships() []AnyVexNotAffectedVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexNotAffectedVulnAssessmentRelationship](v)
+}
+
+func (v ElementList) VexUnderInvestigationVulnAssessmentRelationships() []AnyVexUnderInvestigationVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexUnderInvestigationVulnAssessmentRelationship](v)
+}
+
+func (v ElementList) VexVulnAssessmentRelationships() []AnyVexVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexVulnAssessmentRelationship](v)
+}
+
+func (v ElementList) VulnAssessmentRelationships() []AnyVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVulnAssessmentRelationship](v)
+}
+
+func (v ElementList) Vulnerabilities() []AnyVulnerability {
+ return ld.SliceOf[AnyVulnerability](v)
+}
+
+func (v ElementList) WithAdditionOperators() []AnyWithAdditionOperator {
+ return ld.SliceOf[AnyWithAdditionOperator](v)
+}
+
+type AnyElementCollection interface {
+ AnyElement
+ asElementCollection()
+ GetElements() ElementList
+ SetElements(ElementList)
+ GetRootElements() ElementList
+ SetRootElements(ElementList)
+ GetProfileConformances() []ProfileIdentifierType
+ SetProfileConformances([]ProfileIdentifierType)
+}
+
+// ElementCollection A collection of Elements, not necessarily with unifying context.
+type ElementCollectionList []AnyElementCollection
+
+func (v ElementCollectionList) BOMs() []AnyBOM {
+ return ld.SliceOf[AnyBOM](v)
+}
+
+func (v ElementCollectionList) Bundles() []AnyBundle {
+ return ld.SliceOf[AnyBundle](v)
+}
+
+func (v ElementCollectionList) ElementCollections() []AnyElementCollection {
+ return ld.SliceOf[AnyElementCollection](v)
+}
+
+func (v ElementCollectionList) SBOMs() []AnySBOM {
+ return ld.SliceOf[AnySBOM](v)
+}
+
+func (v ElementCollectionList) SpdxDocuments() []AnySpdxDocument {
+ return ld.SliceOf[AnySpdxDocument](v)
+}
+
+type AnyEnergyConsumption interface {
+ GetID() string
+ SetID(string)
+ asEnergyConsumption()
+ GetInferenceEnergyConsumptions() EnergyConsumptionDescriptionList
+ SetInferenceEnergyConsumptions(EnergyConsumptionDescriptionList)
+ GetTrainingEnergyConsumptions() EnergyConsumptionDescriptionList
+ SetTrainingEnergyConsumptions(EnergyConsumptionDescriptionList)
+ GetFinetuningEnergyConsumptions() EnergyConsumptionDescriptionList
+ SetFinetuningEnergyConsumptions(EnergyConsumptionDescriptionList)
+}
+
+// EnergyConsumption A class for describing the energy consumption incurred by an AI model in different stages of its lifecycle.
+type EnergyConsumption struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/AI/EnergyConsumption" node-kind:"http://www.w3.org/ns/shacl#BlankNodeOrIRI"`
+ ID string `iri:"@id"`
+ // InferenceEnergyConsumptions Specifies the amount of energy consumed during inference time by an AI model that is being used in the AI system.
+ InferenceEnergyConsumptions EnergyConsumptionDescriptionList `iri:"https://spdx.org/rdf/3.0.1/terms/AI/inferenceEnergyConsumption" type:"https://spdx.org/rdf/3.0.1/terms/AI/EnergyConsumptionDescription"`
+ // TrainingEnergyConsumptions Specifies the amount of energy consumed when training the AI model that is being used in the AI system.
+ TrainingEnergyConsumptions EnergyConsumptionDescriptionList `iri:"https://spdx.org/rdf/3.0.1/terms/AI/trainingEnergyConsumption" type:"https://spdx.org/rdf/3.0.1/terms/AI/EnergyConsumptionDescription"`
+ // FinetuningEnergyConsumptions Specifies the amount of energy consumed when finetuning the AI model that is being used in the AI system.
+ FinetuningEnergyConsumptions EnergyConsumptionDescriptionList `iri:"https://spdx.org/rdf/3.0.1/terms/AI/finetuningEnergyConsumption" type:"https://spdx.org/rdf/3.0.1/terms/AI/EnergyConsumptionDescription"`
+}
+
+func (o *EnergyConsumption) asEnergyConsumption() {}
+func (o *EnergyConsumption) GetID() string {
+ return o.ID
+}
+
+func (o *EnergyConsumption) SetID(v string) {
+ o.ID = v
+}
+
+func (o *EnergyConsumption) GetInferenceEnergyConsumptions() EnergyConsumptionDescriptionList {
+ return o.InferenceEnergyConsumptions
+}
+
+func (o *EnergyConsumption) SetInferenceEnergyConsumptions(v EnergyConsumptionDescriptionList) {
+ o.InferenceEnergyConsumptions = v
+}
+
+func (o *EnergyConsumption) GetTrainingEnergyConsumptions() EnergyConsumptionDescriptionList {
+ return o.TrainingEnergyConsumptions
+}
+
+func (o *EnergyConsumption) SetTrainingEnergyConsumptions(v EnergyConsumptionDescriptionList) {
+ o.TrainingEnergyConsumptions = v
+}
+
+func (o *EnergyConsumption) GetFinetuningEnergyConsumptions() EnergyConsumptionDescriptionList {
+ return o.FinetuningEnergyConsumptions
+}
+
+func (o *EnergyConsumption) SetFinetuningEnergyConsumptions(v EnergyConsumptionDescriptionList) {
+ o.FinetuningEnergyConsumptions = v
+}
+
+type EnergyConsumptionList []AnyEnergyConsumption
+
+func (v EnergyConsumptionList) EnergyConsumptions() []AnyEnergyConsumption {
+ return ld.SliceOf[AnyEnergyConsumption](v)
+}
+
+type AnyEnergyConsumptionDescription interface {
+ GetID() string
+ SetID(string)
+ asEnergyConsumptionDescription()
+ GetEnergyQuantity() float64
+ SetEnergyQuantity(float64)
+ GetEnergyUnit() EnergyUnitType
+ SetEnergyUnit(EnergyUnitType)
+}
+
+// EnergyConsumptionDescription The class that helps note down the quantity of energy consumption and the unit used for measurement.
+type EnergyConsumptionDescription struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/AI/EnergyConsumptionDescription" node-kind:"http://www.w3.org/ns/shacl#BlankNodeOrIRI"`
+ ID string `iri:"@id"`
+ // EnergyQuantity Represents the energy quantity.
+ EnergyQuantity float64 `iri:"https://spdx.org/rdf/3.0.1/terms/AI/energyQuantity" required:"true" type:"http://www.w3.org/2001/XMLSchema#decimal"`
+ // EnergyUnit Specifies the unit in which energy is measured.
+ EnergyUnit EnergyUnitType `iri:"https://spdx.org/rdf/3.0.1/terms/AI/energyUnit" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/AI/EnergyUnitType"`
+}
+
+func (o *EnergyConsumptionDescription) asEnergyConsumptionDescription() {}
+func (o *EnergyConsumptionDescription) GetID() string {
+ return o.ID
+}
+
+func (o *EnergyConsumptionDescription) SetID(v string) {
+ o.ID = v
+}
+
+func (o *EnergyConsumptionDescription) GetEnergyQuantity() float64 {
+ return o.EnergyQuantity
+}
+
+func (o *EnergyConsumptionDescription) SetEnergyQuantity(v float64) {
+ o.EnergyQuantity = v
+}
+
+func (o *EnergyConsumptionDescription) GetEnergyUnit() EnergyUnitType {
+ return o.EnergyUnit
+}
+
+func (o *EnergyConsumptionDescription) SetEnergyUnit(v EnergyUnitType) {
+ o.EnergyUnit = v
+}
+
+type EnergyConsumptionDescriptionList []AnyEnergyConsumptionDescription
+
+func (v EnergyConsumptionDescriptionList) EnergyConsumptionDescriptions() []AnyEnergyConsumptionDescription {
+ return ld.SliceOf[AnyEnergyConsumptionDescription](v)
+}
+
+// EnergyUnitType Specifies the unit of energy consumption.
+type EnergyUnitType struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/AI/EnergyUnitType" node-kind:""`
+ id string `iri:"@id"`
+}
+
+func (o *EnergyUnitType) GetID() string {
+ return o.id
+}
+
+// EnergyUnitType_KilowattHour Kilowatt-hour.
+var EnergyUnitType_KilowattHour = EnergyUnitType{
+ id: "https://spdx.org/rdf/3.0.1/terms/AI/EnergyUnitType/kilowattHour",
+}
+
+// EnergyUnitType_Megajoule Megajoule.
+var EnergyUnitType_Megajoule = EnergyUnitType{
+ id: "https://spdx.org/rdf/3.0.1/terms/AI/EnergyUnitType/megajoule",
+}
+
+// EnergyUnitType_Other Any other units of energy measurement.
+var EnergyUnitType_Other = EnergyUnitType{
+ id: "https://spdx.org/rdf/3.0.1/terms/AI/EnergyUnitType/other",
+}
+
+type AnyEpssVulnAssessmentRelationship interface {
+ AnyVulnAssessmentRelationship
+ asEpssVulnAssessmentRelationship()
+ GetProbability() float64
+ SetProbability(float64)
+ GetPercentile() float64
+ SetPercentile(float64)
+}
+
+// EpssVulnAssessmentRelationship Provides an EPSS assessment for a vulnerability.
+type EpssVulnAssessmentRelationship struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Security/EpssVulnAssessmentRelationship" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // Completeness Provides information about the completeness of relationships.
+ Completeness RelationshipCompleteness `iri:"https://spdx.org/rdf/3.0.1/terms/Core/completeness" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipCompleteness"`
+ // EndTime Specifies the time from which an element is no longer applicable / valid.
+ EndTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/endTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // To References an Element on the right-hand side of a relationship.
+ To ElementList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/to" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // From References the Element on the left-hand side of a relationship.
+ From AnyElement `iri:"https://spdx.org/rdf/3.0.1/terms/Core/from" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // Type Information about the relationship between two Elements.
+ Type RelationshipType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/relationshipType" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType"`
+ // StartTime Specifies the time from which an element is applicable / valid.
+ StartTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/startTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // SuppliedBy Identifies who or what supplied the artifact or VulnAssessmentRelationship referenced by the Element.
+ SuppliedBy AnyAgent `iri:"https://spdx.org/rdf/3.0.1/terms/Core/suppliedBy" type:"https://spdx.org/rdf/3.0.1/terms/Core/Agent"`
+ // WithdrawnTime Specified the time and date when a vulnerability was withdrawn.
+ WithdrawnTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/withdrawnTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // AssessedElement Specifies an Element contained in a piece of software where a vulnerability was found.
+ AssessedElement AnySoftwareArtifact `iri:"https://spdx.org/rdf/3.0.1/terms/Security/assessedElement" type:"https://spdx.org/rdf/3.0.1/terms/Software/SoftwareArtifact"`
+ // PublishedTime Specifies the time when a vulnerability was published.
+ PublishedTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/publishedTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ModifiedTime Specifies a time when a vulnerability assessment was modified
+ ModifiedTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/modifiedTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // Probability A probability score between 0 and 1 of a vulnerability being exploited.
+ Probability float64 `iri:"https://spdx.org/rdf/3.0.1/terms/Security/probability" required:"true" type:"http://www.w3.org/2001/XMLSchema#decimal"`
+ // Percentile The percentile of the current probability score.
+ Percentile float64 `iri:"https://spdx.org/rdf/3.0.1/terms/Security/percentile" required:"true" type:"http://www.w3.org/2001/XMLSchema#decimal"`
+}
+
+func (o *EpssVulnAssessmentRelationship) asEpssVulnAssessmentRelationship() {}
+func (o *EpssVulnAssessmentRelationship) asVulnAssessmentRelationship() {}
+func (o *EpssVulnAssessmentRelationship) asRelationship() {}
+func (o *EpssVulnAssessmentRelationship) asElement() {}
+func (o *EpssVulnAssessmentRelationship) GetID() string {
+ return o.ID
+}
+
+func (o *EpssVulnAssessmentRelationship) SetID(v string) {
+ o.ID = v
+}
+
+func (o *EpssVulnAssessmentRelationship) GetDescription() string {
+ return o.Description
+}
+
+func (o *EpssVulnAssessmentRelationship) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *EpssVulnAssessmentRelationship) GetComment() string {
+ return o.Comment
+}
+
+func (o *EpssVulnAssessmentRelationship) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *EpssVulnAssessmentRelationship) GetName() string {
+ return o.Name
+}
+
+func (o *EpssVulnAssessmentRelationship) SetName(v string) {
+ o.Name = v
+}
+
+func (o *EpssVulnAssessmentRelationship) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *EpssVulnAssessmentRelationship) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *EpssVulnAssessmentRelationship) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *EpssVulnAssessmentRelationship) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *EpssVulnAssessmentRelationship) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *EpssVulnAssessmentRelationship) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *EpssVulnAssessmentRelationship) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *EpssVulnAssessmentRelationship) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *EpssVulnAssessmentRelationship) GetSummary() string {
+ return o.Summary
+}
+
+func (o *EpssVulnAssessmentRelationship) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *EpssVulnAssessmentRelationship) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *EpssVulnAssessmentRelationship) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *EpssVulnAssessmentRelationship) GetCompleteness() RelationshipCompleteness {
+ return o.Completeness
+}
+
+func (o *EpssVulnAssessmentRelationship) SetCompleteness(v RelationshipCompleteness) {
+ o.Completeness = v
+}
+
+func (o *EpssVulnAssessmentRelationship) GetEndTime() time.Time {
+ return o.EndTime
+}
+
+func (o *EpssVulnAssessmentRelationship) SetEndTime(v time.Time) {
+ o.EndTime = v
+}
+
+func (o *EpssVulnAssessmentRelationship) GetTo() ElementList {
+ return o.To
+}
+
+func (o *EpssVulnAssessmentRelationship) SetTo(v ElementList) {
+ o.To = v
+}
+
+func (o *EpssVulnAssessmentRelationship) GetFrom() AnyElement {
+ return o.From
+}
+
+func (o *EpssVulnAssessmentRelationship) SetFrom(v AnyElement) {
+ o.From = v
+}
+
+func (o *EpssVulnAssessmentRelationship) GetType() RelationshipType {
+ return o.Type
+}
+
+func (o *EpssVulnAssessmentRelationship) SetType(v RelationshipType) {
+ o.Type = v
+}
+
+func (o *EpssVulnAssessmentRelationship) GetStartTime() time.Time {
+ return o.StartTime
+}
+
+func (o *EpssVulnAssessmentRelationship) SetStartTime(v time.Time) {
+ o.StartTime = v
+}
+
+func (o *EpssVulnAssessmentRelationship) GetSuppliedBy() AnyAgent {
+ return o.SuppliedBy
+}
+
+func (o *EpssVulnAssessmentRelationship) SetSuppliedBy(v AnyAgent) {
+ o.SuppliedBy = v
+}
+
+func (o *EpssVulnAssessmentRelationship) GetWithdrawnTime() time.Time {
+ return o.WithdrawnTime
+}
+
+func (o *EpssVulnAssessmentRelationship) SetWithdrawnTime(v time.Time) {
+ o.WithdrawnTime = v
+}
+
+func (o *EpssVulnAssessmentRelationship) GetAssessedElement() AnySoftwareArtifact {
+ return o.AssessedElement
+}
+
+func (o *EpssVulnAssessmentRelationship) SetAssessedElement(v AnySoftwareArtifact) {
+ o.AssessedElement = v
+}
+
+func (o *EpssVulnAssessmentRelationship) GetPublishedTime() time.Time {
+ return o.PublishedTime
+}
+
+func (o *EpssVulnAssessmentRelationship) SetPublishedTime(v time.Time) {
+ o.PublishedTime = v
+}
+
+func (o *EpssVulnAssessmentRelationship) GetModifiedTime() time.Time {
+ return o.ModifiedTime
+}
+
+func (o *EpssVulnAssessmentRelationship) SetModifiedTime(v time.Time) {
+ o.ModifiedTime = v
+}
+
+func (o *EpssVulnAssessmentRelationship) GetProbability() float64 {
+ return o.Probability
+}
+
+func (o *EpssVulnAssessmentRelationship) SetProbability(v float64) {
+ o.Probability = v
+}
+
+func (o *EpssVulnAssessmentRelationship) GetPercentile() float64 {
+ return o.Percentile
+}
+
+func (o *EpssVulnAssessmentRelationship) SetPercentile(v float64) {
+ o.Percentile = v
+}
+
+type EpssVulnAssessmentRelationshipList []AnyEpssVulnAssessmentRelationship
+
+func (v EpssVulnAssessmentRelationshipList) EpssVulnAssessmentRelationships() []AnyEpssVulnAssessmentRelationship {
+ return ld.SliceOf[AnyEpssVulnAssessmentRelationship](v)
+}
+
+// ExploitCatalogType Specifies the exploit catalog type.
+type ExploitCatalogType struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Security/ExploitCatalogType" node-kind:""`
+ id string `iri:"@id"`
+}
+
+func (o *ExploitCatalogType) GetID() string {
+ return o.id
+}
+
+// ExploitCatalogType_Kev CISA's Known Exploited Vulnerability (KEV) Catalog
+var ExploitCatalogType_Kev = ExploitCatalogType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Security/ExploitCatalogType/kev",
+}
+
+// ExploitCatalogType_Other Other exploit catalogs
+var ExploitCatalogType_Other = ExploitCatalogType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Security/ExploitCatalogType/other",
+}
+
+type AnyExploitCatalogVulnAssessmentRelationship interface {
+ AnyVulnAssessmentRelationship
+ asExploitCatalogVulnAssessmentRelationship()
+ GetLocator() URI
+ SetLocator(URI)
+ GetExploited() bool
+ SetExploited(bool)
+ GetCatalogType() ExploitCatalogType
+ SetCatalogType(ExploitCatalogType)
+}
+
+// ExploitCatalogVulnAssessmentRelationship Provides an exploit assessment of a vulnerability.
+type ExploitCatalogVulnAssessmentRelationship struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Security/ExploitCatalogVulnAssessmentRelationship" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // Completeness Provides information about the completeness of relationships.
+ Completeness RelationshipCompleteness `iri:"https://spdx.org/rdf/3.0.1/terms/Core/completeness" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipCompleteness"`
+ // EndTime Specifies the time from which an element is no longer applicable / valid.
+ EndTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/endTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // To References an Element on the right-hand side of a relationship.
+ To ElementList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/to" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // From References the Element on the left-hand side of a relationship.
+ From AnyElement `iri:"https://spdx.org/rdf/3.0.1/terms/Core/from" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // Type Information about the relationship between two Elements.
+ Type RelationshipType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/relationshipType" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType"`
+ // StartTime Specifies the time from which an element is applicable / valid.
+ StartTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/startTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // SuppliedBy Identifies who or what supplied the artifact or VulnAssessmentRelationship referenced by the Element.
+ SuppliedBy AnyAgent `iri:"https://spdx.org/rdf/3.0.1/terms/Core/suppliedBy" type:"https://spdx.org/rdf/3.0.1/terms/Core/Agent"`
+ // WithdrawnTime Specified the time and date when a vulnerability was withdrawn.
+ WithdrawnTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/withdrawnTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // AssessedElement Specifies an Element contained in a piece of software where a vulnerability was found.
+ AssessedElement AnySoftwareArtifact `iri:"https://spdx.org/rdf/3.0.1/terms/Security/assessedElement" type:"https://spdx.org/rdf/3.0.1/terms/Software/SoftwareArtifact"`
+ // PublishedTime Specifies the time when a vulnerability was published.
+ PublishedTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/publishedTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ModifiedTime Specifies a time when a vulnerability assessment was modified
+ ModifiedTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/modifiedTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // Locator Provides the location of an exploit catalog.
+ Locator URI `iri:"https://spdx.org/rdf/3.0.1/terms/Security/locator" required:"true" type:"http://www.w3.org/2001/XMLSchema#anyURI"`
+ // Exploited Describe that a CVE is known to have an exploit because it's been listed in an exploit catalog.
+ Exploited bool `iri:"https://spdx.org/rdf/3.0.1/terms/Security/exploited" required:"true" type:"http://www.w3.org/2001/XMLSchema#boolean"`
+ // CatalogType Specifies the exploit catalog type.
+ CatalogType ExploitCatalogType `iri:"https://spdx.org/rdf/3.0.1/terms/Security/catalogType" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Security/ExploitCatalogType"`
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) asExploitCatalogVulnAssessmentRelationship() {}
+func (o *ExploitCatalogVulnAssessmentRelationship) asVulnAssessmentRelationship() {}
+func (o *ExploitCatalogVulnAssessmentRelationship) asRelationship() {}
+func (o *ExploitCatalogVulnAssessmentRelationship) asElement() {}
+func (o *ExploitCatalogVulnAssessmentRelationship) GetID() string {
+ return o.ID
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetID(v string) {
+ o.ID = v
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) GetDescription() string {
+ return o.Description
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) GetComment() string {
+ return o.Comment
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) GetName() string {
+ return o.Name
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetName(v string) {
+ o.Name = v
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) GetSummary() string {
+ return o.Summary
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) GetCompleteness() RelationshipCompleteness {
+ return o.Completeness
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetCompleteness(v RelationshipCompleteness) {
+ o.Completeness = v
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) GetEndTime() time.Time {
+ return o.EndTime
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetEndTime(v time.Time) {
+ o.EndTime = v
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) GetTo() ElementList {
+ return o.To
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetTo(v ElementList) {
+ o.To = v
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) GetFrom() AnyElement {
+ return o.From
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetFrom(v AnyElement) {
+ o.From = v
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) GetType() RelationshipType {
+ return o.Type
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetType(v RelationshipType) {
+ o.Type = v
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) GetStartTime() time.Time {
+ return o.StartTime
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetStartTime(v time.Time) {
+ o.StartTime = v
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) GetSuppliedBy() AnyAgent {
+ return o.SuppliedBy
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetSuppliedBy(v AnyAgent) {
+ o.SuppliedBy = v
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) GetWithdrawnTime() time.Time {
+ return o.WithdrawnTime
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetWithdrawnTime(v time.Time) {
+ o.WithdrawnTime = v
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) GetAssessedElement() AnySoftwareArtifact {
+ return o.AssessedElement
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetAssessedElement(v AnySoftwareArtifact) {
+ o.AssessedElement = v
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) GetPublishedTime() time.Time {
+ return o.PublishedTime
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetPublishedTime(v time.Time) {
+ o.PublishedTime = v
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) GetModifiedTime() time.Time {
+ return o.ModifiedTime
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetModifiedTime(v time.Time) {
+ o.ModifiedTime = v
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) GetLocator() URI {
+ return o.Locator
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetLocator(v URI) {
+ o.Locator = v
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) GetExploited() bool {
+ return o.Exploited
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetExploited(v bool) {
+ o.Exploited = v
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) GetCatalogType() ExploitCatalogType {
+ return o.CatalogType
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) SetCatalogType(v ExploitCatalogType) {
+ o.CatalogType = v
+}
+
+type ExploitCatalogVulnAssessmentRelationshipList []AnyExploitCatalogVulnAssessmentRelationship
+
+func (v ExploitCatalogVulnAssessmentRelationshipList) ExploitCatalogVulnAssessmentRelationships() []AnyExploitCatalogVulnAssessmentRelationship {
+ return ld.SliceOf[AnyExploitCatalogVulnAssessmentRelationship](v)
+}
+
+type AnyExtendableLicense interface {
+ AnyLicenseInfo
+ asExtendableLicense()
+}
+
+// ExtendableLicense Abstract class representing a License or an OrLaterOperator.
+type ExtendableLicenseList []AnyExtendableLicense
+
+func (v ExtendableLicenseList) CustomLicenses() []AnyCustomLicense {
+ return ld.SliceOf[AnyCustomLicense](v)
+}
+
+func (v ExtendableLicenseList) ExtendableLicenses() []AnyExtendableLicense {
+ return ld.SliceOf[AnyExtendableLicense](v)
+}
+
+func (v ExtendableLicenseList) Licenses() []AnyLicense {
+ return ld.SliceOf[AnyLicense](v)
+}
+
+func (v ExtendableLicenseList) ListedLicenses() []AnyListedLicense {
+ return ld.SliceOf[AnyListedLicense](v)
+}
+
+func (v ExtendableLicenseList) OrLaterOperators() []AnyOrLaterOperator {
+ return ld.SliceOf[AnyOrLaterOperator](v)
+}
+
+type AnyExtension interface {
+ GetID() string
+ SetID(string)
+ asExtension()
+}
+
+// Extension A characterization of some aspect of an Element that is associated with the Element in a generalized fashion.
+type ExtensionList []AnyExtension
+
+func (v ExtensionList) CdxPropertiesExtensions() []AnyCdxPropertiesExtension {
+ return ld.SliceOf[AnyCdxPropertiesExtension](v)
+}
+
+func (v ExtensionList) Extensions() []AnyExtension {
+ return ld.SliceOf[AnyExtension](v)
+}
+
+type AnyExternalIdentifier interface {
+ GetID() string
+ SetID(string)
+ asExternalIdentifier()
+ GetIdentifier() string
+ SetIdentifier(string)
+ GetIssuingAuthority() string
+ SetIssuingAuthority(string)
+ GetComment() string
+ SetComment(string)
+ GetIdentifierLocators() []URI
+ SetIdentifierLocators([]URI)
+ GetType() ExternalIdentifierType
+ SetType(ExternalIdentifierType)
+}
+
+// ExternalIdentifier A reference to a resource identifier defined outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+type ExternalIdentifier struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier" node-kind:"http://www.w3.org/ns/shacl#BlankNodeOrIRI"`
+ ID string `iri:"@id"`
+ // Identifier Uniquely identifies an external element.
+ Identifier string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/identifier" required:"true" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // IssuingAuthority An entity that is authorized to issue identification credentials.
+ IssuingAuthority string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/issuingAuthority" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // IdentifierLocators Provides the location for more information regarding an external identifier.
+ IdentifierLocators []URI `iri:"https://spdx.org/rdf/3.0.1/terms/Core/identifierLocator" type:"http://www.w3.org/2001/XMLSchema#anyURI"`
+ // Type Specifies the type of the external identifier.
+ Type ExternalIdentifierType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifierType" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifierType"`
+}
+
+func (o *ExternalIdentifier) asExternalIdentifier() {}
+func (o *ExternalIdentifier) GetID() string {
+ return o.ID
+}
+
+func (o *ExternalIdentifier) SetID(v string) {
+ o.ID = v
+}
+
+func (o *ExternalIdentifier) GetIdentifier() string {
+ return o.Identifier
+}
+
+func (o *ExternalIdentifier) SetIdentifier(v string) {
+ o.Identifier = v
+}
+
+func (o *ExternalIdentifier) GetIssuingAuthority() string {
+ return o.IssuingAuthority
+}
+
+func (o *ExternalIdentifier) SetIssuingAuthority(v string) {
+ o.IssuingAuthority = v
+}
+
+func (o *ExternalIdentifier) GetComment() string {
+ return o.Comment
+}
+
+func (o *ExternalIdentifier) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *ExternalIdentifier) GetIdentifierLocators() []URI {
+ return o.IdentifierLocators
+}
+
+func (o *ExternalIdentifier) SetIdentifierLocators(v []URI) {
+ o.IdentifierLocators = v
+}
+
+func (o *ExternalIdentifier) GetType() ExternalIdentifierType {
+ return o.Type
+}
+
+func (o *ExternalIdentifier) SetType(v ExternalIdentifierType) {
+ o.Type = v
+}
+
+type ExternalIdentifierList []AnyExternalIdentifier
+
+func (v ExternalIdentifierList) ExternalIdentifiers() []AnyExternalIdentifier {
+ return ld.SliceOf[AnyExternalIdentifier](v)
+}
+
+// ExternalIdentifierType Specifies the type of an external identifier.
+type ExternalIdentifierType struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifierType" node-kind:""`
+ id string `iri:"@id"`
+}
+
+func (o *ExternalIdentifierType) GetID() string {
+ return o.id
+}
+
+// ExternalIdentifierType_Cpe22 [Common Platform Enumeration Specification 2.2](https://cpe.mitre.org/files/cpe-specification_2.2.pdf)
+var ExternalIdentifierType_Cpe22 = ExternalIdentifierType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifierType/cpe22",
+}
+
+// ExternalIdentifierType_Cpe23 [Common Platform Enumeration: Naming Specification Version 2.3](https://csrc.nist.gov/publications/detail/nistir/7695/final)
+var ExternalIdentifierType_Cpe23 = ExternalIdentifierType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifierType/cpe23",
+}
+
+// ExternalIdentifierType_Cve Common Vulnerabilities and Exposures identifiers, an identifier for a specific software flaw defined within the official CVE Dictionary and that conforms to the [CVE specification](https://csrc.nist.gov/glossary/term/cve_id).
+var ExternalIdentifierType_Cve = ExternalIdentifierType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifierType/cve",
+}
+
+// ExternalIdentifierType_Email Email address, as defined in [RFC 3696](https://datatracker.ietf.org/doc/rfc3986/) Section 3.
+var ExternalIdentifierType_Email = ExternalIdentifierType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifierType/email",
+}
+
+// ExternalIdentifierType_Gitoid [Gitoid](https://www.iana.org/assignments/uri-schemes/prov/gitoid), stands for [Git Object ID](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects). A gitoid of type blob is a unique hash of a binary artifact. A gitoid may represent either an [Artifact Identifier](https://github.com/omnibor/spec/blob/eb1ee5c961c16215eb8709b2975d193a2007a35d/spec/SPEC.md#artifact-identifier-types) for the software artifact or an [Input Manifest Identifier](https://github.com/omnibor/spec/blob/eb1ee5c961c16215eb8709b2975d193a2007a35d/spec/SPEC.md#input-manifest-identifier) for the software artifact's associated [Artifact Input Manifest](https://github.com/omnibor/spec/blob/eb1ee5c961c16215eb8709b2975d193a2007a35d/spec/SPEC.md#artifact-input-manifest); this ambiguity exists because the Artifact Input Manifest is itself an artifact, and the gitoid of that artifact is its valid identifier. Gitoids calculated on software artifacts (Snippet, File, or Package Elements) should be recorded in the SPDX 3.0 SoftwareArtifact's contentIdentifier property. Gitoids calculated on the Artifact Input Manifest (Input Manifest Identifier) should be recorded in the SPDX 3.0 Element's externalIdentifier property. See [OmniBOR Specification](https://github.com/omnibor/spec/), a minimalistic specification for describing software [Artifact Dependency Graphs](https://github.com/omnibor/spec/blob/eb1ee5c961c16215eb8709b2975d193a2007a35d/spec/SPEC.md#artifact-dependency-graph-adg).
+var ExternalIdentifierType_Gitoid = ExternalIdentifierType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifierType/gitoid",
+}
+
+// ExternalIdentifierType_Other Used when the type does not match any of the other options.
+var ExternalIdentifierType_Other = ExternalIdentifierType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifierType/other",
+}
+
+// ExternalIdentifierType_PackageURL Package URL, as defined in the corresponding [Annex](../../../annexes/pkg-url-specification.md) of this specification.
+var ExternalIdentifierType_PackageURL = ExternalIdentifierType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifierType/packageUrl",
+}
+
+// ExternalIdentifierType_SecurityOther Used when there is a security related identifier of unspecified type.
+var ExternalIdentifierType_SecurityOther = ExternalIdentifierType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifierType/securityOther",
+}
+
+// ExternalIdentifierType_Swhid SoftWare Hash IDentifier, a persistent intrinsic identifier for digital artifacts, such as files, trees (also known as directories or folders), commits, and other objects typically found in version control systems. The format of the identifiers is defined in the [SWHID specification](https://www.swhid.org/specification/v1.1/4.Syntax) (ISO/IEC DIS 18670). They typically look like `swh:1:cnt:94a9ed024d3859793618152ea559a168bbcbb5e2`.
+var ExternalIdentifierType_Swhid = ExternalIdentifierType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifierType/swhid",
+}
+
+// ExternalIdentifierType_Swid Concise Software Identification (CoSWID) tag, as defined in [RFC 9393](https://datatracker.ietf.org/doc/rfc9393/) Section 2.3.
+var ExternalIdentifierType_Swid = ExternalIdentifierType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifierType/swid",
+}
+
+// ExternalIdentifierType_UrlScheme [Uniform Resource Identifier (URI) Schemes](https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml). The scheme used in order to locate a resource.
+var ExternalIdentifierType_UrlScheme = ExternalIdentifierType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifierType/urlScheme",
+}
+
+type AnyExternalMap interface {
+ GetID() string
+ SetID(string)
+ asExternalMap()
+ GetExternalSpdxID() URI
+ SetExternalSpdxID(URI)
+ GetLocationHint() URI
+ SetLocationHint(URI)
+ GetVerifiedUsing() IntegrityMethodList
+ SetVerifiedUsing(IntegrityMethodList)
+ GetDefiningArtifact() AnyArtifact
+ SetDefiningArtifact(AnyArtifact)
+}
+
+// ExternalMap A map of Element identifiers that are used within an SpdxDocument but defined external to that SpdxDocument.
+type ExternalMap struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalMap" node-kind:"http://www.w3.org/ns/shacl#BlankNodeOrIRI"`
+ ID string `iri:"@id"`
+ // ExternalSpdxID Identifies an external Element used within an SpdxDocument but defined external to that SpdxDocument.
+ ExternalSpdxID URI `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalSpdxId" required:"true" type:"http://www.w3.org/2001/XMLSchema#anyURI"`
+ // LocationHint Provides an indication of where to retrieve an external Element.
+ LocationHint URI `iri:"https://spdx.org/rdf/3.0.1/terms/Core/locationHint" type:"http://www.w3.org/2001/XMLSchema#anyURI"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // DefiningArtifact Artifact representing a serialization instance of SPDX data containing the definition of a particular Element.
+ DefiningArtifact AnyArtifact `iri:"https://spdx.org/rdf/3.0.1/terms/Core/definingArtifact" type:"https://spdx.org/rdf/3.0.1/terms/Core/Artifact"`
+}
+
+func (o *ExternalMap) asExternalMap() {}
+func (o *ExternalMap) GetID() string {
+ return o.ID
+}
+
+func (o *ExternalMap) SetID(v string) {
+ o.ID = v
+}
+
+func (o *ExternalMap) GetExternalSpdxID() URI {
+ return o.ExternalSpdxID
+}
+
+func (o *ExternalMap) SetExternalSpdxID(v URI) {
+ o.ExternalSpdxID = v
+}
+
+func (o *ExternalMap) GetLocationHint() URI {
+ return o.LocationHint
+}
+
+func (o *ExternalMap) SetLocationHint(v URI) {
+ o.LocationHint = v
+}
+
+func (o *ExternalMap) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *ExternalMap) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *ExternalMap) GetDefiningArtifact() AnyArtifact {
+ return o.DefiningArtifact
+}
+
+func (o *ExternalMap) SetDefiningArtifact(v AnyArtifact) {
+ o.DefiningArtifact = v
+}
+
+type ExternalMapList []AnyExternalMap
+
+func (v ExternalMapList) ExternalMaps() []AnyExternalMap {
+ return ld.SliceOf[AnyExternalMap](v)
+}
+
+type AnyExternalRef interface {
+ GetID() string
+ SetID(string)
+ asExternalRef()
+ GetLocators() []string
+ SetLocators([]string)
+ GetContentType() string
+ SetContentType(string)
+ GetType() ExternalRefType
+ SetType(ExternalRefType)
+ GetComment() string
+ SetComment(string)
+}
+
+// ExternalRef A reference to a resource outside the scope of SPDX-3.0 content related to an Element.
+type ExternalRef struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef" node-kind:"http://www.w3.org/ns/shacl#BlankNodeOrIRI"`
+ ID string `iri:"@id"`
+ // Locators Provides the location of an external reference.
+ Locators []string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/locator" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // ContentType Provides information about the content type of an Element or a Property.
+ ContentType string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/contentType" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Type Specifies the type of the external reference.
+ Type ExternalRefType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRefType" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+}
+
+func (o *ExternalRef) asExternalRef() {}
+func (o *ExternalRef) GetID() string {
+ return o.ID
+}
+
+func (o *ExternalRef) SetID(v string) {
+ o.ID = v
+}
+
+func (o *ExternalRef) GetLocators() []string {
+ return o.Locators
+}
+
+func (o *ExternalRef) SetLocators(v []string) {
+ o.Locators = v
+}
+
+func (o *ExternalRef) GetContentType() string {
+ return o.ContentType
+}
+
+func (o *ExternalRef) SetContentType(v string) {
+ o.ContentType = v
+}
+
+func (o *ExternalRef) GetType() ExternalRefType {
+ return o.Type
+}
+
+func (o *ExternalRef) SetType(v ExternalRefType) {
+ o.Type = v
+}
+
+func (o *ExternalRef) GetComment() string {
+ return o.Comment
+}
+
+func (o *ExternalRef) SetComment(v string) {
+ o.Comment = v
+}
+
+type ExternalRefList []AnyExternalRef
+
+func (v ExternalRefList) ExternalRefs() []AnyExternalRef {
+ return ld.SliceOf[AnyExternalRef](v)
+}
+
+// ExternalRefType Specifies the type of an external reference.
+type ExternalRefType struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType" node-kind:""`
+ id string `iri:"@id"`
+}
+
+func (o *ExternalRefType) GetID() string {
+ return o.id
+}
+
+// ExternalRefType_AltDownloadLocation A reference to an alternative download location.
+var ExternalRefType_AltDownloadLocation = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/altDownloadLocation",
+}
+
+// ExternalRefType_AltWebPage A reference to an alternative web page.
+var ExternalRefType_AltWebPage = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/altWebPage",
+}
+
+// ExternalRefType_BinaryArtifact A reference to binary artifacts related to a package.
+var ExternalRefType_BinaryArtifact = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/binaryArtifact",
+}
+
+// ExternalRefType_Bower A reference to a Bower package. The package locator format, looks like `package#version`, is defined in the \"install\" section of [Bower API documentation](https://bower.io/docs/api/#install).
+var ExternalRefType_Bower = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/bower",
+}
+
+// ExternalRefType_BuildMeta A reference build metadata related to a published package.
+var ExternalRefType_BuildMeta = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/buildMeta",
+}
+
+// ExternalRefType_BuildSystem A reference build system used to create or publish the package.
+var ExternalRefType_BuildSystem = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/buildSystem",
+}
+
+// ExternalRefType_CertificationReport A reference to a certification report for a package from an accredited/independent body.
+var ExternalRefType_CertificationReport = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/certificationReport",
+}
+
+// ExternalRefType_Chat A reference to the instant messaging system used by the maintainer for a package.
+var ExternalRefType_Chat = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/chat",
+}
+
+// ExternalRefType_ComponentAnalysisReport A reference to a Software Composition Analysis (SCA) report.
+var ExternalRefType_ComponentAnalysisReport = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/componentAnalysisReport",
+}
+
+// ExternalRefType_Cwe [Common Weakness Enumeration](https://csrc.nist.gov/glossary/term/common_weakness_enumeration). A reference to a source of software flaw defined within the official [CWE List](https://cwe.mitre.org/data/) that conforms to the [CWE specification](https://cwe.mitre.org/).
+var ExternalRefType_Cwe = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/cwe",
+}
+
+// ExternalRefType_Documentation A reference to the documentation for a package.
+var ExternalRefType_Documentation = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/documentation",
+}
+
+// ExternalRefType_DynamicAnalysisReport A reference to a dynamic analysis report for a package.
+var ExternalRefType_DynamicAnalysisReport = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/dynamicAnalysisReport",
+}
+
+// ExternalRefType_EolNotice A reference to the End Of Sale (EOS) and/or End Of Life (EOL) information related to a package.
+var ExternalRefType_EolNotice = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/eolNotice",
+}
+
+// ExternalRefType_ExportControlAssessment A reference to a export control assessment for a package.
+var ExternalRefType_ExportControlAssessment = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/exportControlAssessment",
+}
+
+// ExternalRefType_Funding A reference to funding information related to a package.
+var ExternalRefType_Funding = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/funding",
+}
+
+// ExternalRefType_IssueTracker A reference to the issue tracker for a package.
+var ExternalRefType_IssueTracker = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/issueTracker",
+}
+
+// ExternalRefType_License A reference to additional license information related to an artifact.
+var ExternalRefType_License = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/license",
+}
+
+// ExternalRefType_MailingList A reference to the mailing list used by the maintainer for a package.
+var ExternalRefType_MailingList = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/mailingList",
+}
+
+// ExternalRefType_MavenCentral A reference to a Maven repository artifact. The artifact locator format is defined in the [Maven documentation](https://maven.apache.org/guides/mini/guide-naming-conventions.html) and looks like `groupId:artifactId[:version]`.
+var ExternalRefType_MavenCentral = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/mavenCentral",
+}
+
+// ExternalRefType_Metrics A reference to metrics related to package such as OpenSSF scorecards.
+var ExternalRefType_Metrics = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/metrics",
+}
+
+// ExternalRefType_Npm A reference to an npm package. The package locator format is defined in the [npm documentation](https://docs.npmjs.com/cli/v10/configuring-npm/package-json) and looks like `package@version`.
+var ExternalRefType_Npm = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/npm",
+}
+
+// ExternalRefType_Nuget A reference to a NuGet package. The package locator format is defined in the [NuGet documentation](https://docs.nuget.org) and looks like `package/version`.
+var ExternalRefType_Nuget = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/nuget",
+}
+
+// ExternalRefType_Other Used when the type does not match any of the other options.
+var ExternalRefType_Other = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/other",
+}
+
+// ExternalRefType_PrivacyAssessment A reference to a privacy assessment for a package.
+var ExternalRefType_PrivacyAssessment = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/privacyAssessment",
+}
+
+// ExternalRefType_ProductMetadata A reference to additional product metadata such as reference within organization's product catalog.
+var ExternalRefType_ProductMetadata = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/productMetadata",
+}
+
+// ExternalRefType_PurchaseOrder A reference to a purchase order for a package.
+var ExternalRefType_PurchaseOrder = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/purchaseOrder",
+}
+
+// ExternalRefType_QualityAssessmentReport A reference to a quality assessment for a package.
+var ExternalRefType_QualityAssessmentReport = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/qualityAssessmentReport",
+}
+
+// ExternalRefType_ReleaseHistory A reference to a published list of releases for a package.
+var ExternalRefType_ReleaseHistory = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/releaseHistory",
+}
+
+// ExternalRefType_ReleaseNotes A reference to the release notes for a package.
+var ExternalRefType_ReleaseNotes = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/releaseNotes",
+}
+
+// ExternalRefType_RiskAssessment A reference to a risk assessment for a package.
+var ExternalRefType_RiskAssessment = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/riskAssessment",
+}
+
+// ExternalRefType_RuntimeAnalysisReport A reference to a runtime analysis report for a package.
+var ExternalRefType_RuntimeAnalysisReport = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/runtimeAnalysisReport",
+}
+
+// ExternalRefType_SecureSoftwareAttestation A reference to information assuring that the software is developed using security practices as defined by [NIST SP 800-218 Secure Software Development Framework (SSDF) Version 1.1](https://csrc.nist.gov/pubs/sp/800/218/final) or [CISA Secure Software Development Attestation Form](https://www.cisa.gov/resources-tools/resources/secure-software-development-attestation-form).
+var ExternalRefType_SecureSoftwareAttestation = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/secureSoftwareAttestation",
+}
+
+// ExternalRefType_SecurityAdversaryModel A reference to the security adversary model for a package.
+var ExternalRefType_SecurityAdversaryModel = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/securityAdversaryModel",
+}
+
+// ExternalRefType_SecurityAdvisory A reference to a published security advisory (where advisory as defined per [ISO 29147:2018](https://www.iso.org/standard/72311.html)) that may affect one or more elements, e.g., vendor advisories or specific NVD entries.
+var ExternalRefType_SecurityAdvisory = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/securityAdvisory",
+}
+
+// ExternalRefType_SecurityFix A reference to the patch or source code that fixes a vulnerability.
+var ExternalRefType_SecurityFix = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/securityFix",
+}
+
+// ExternalRefType_SecurityOther A reference to related security information of unspecified type.
+var ExternalRefType_SecurityOther = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/securityOther",
+}
+
+// ExternalRefType_SecurityPenTestReport A reference to a [penetration test](https://en.wikipedia.org/wiki/Penetration_test) report for a package.
+var ExternalRefType_SecurityPenTestReport = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/securityPenTestReport",
+}
+
+// ExternalRefType_SecurityPolicy A reference to instructions for reporting newly discovered security vulnerabilities for a package.
+var ExternalRefType_SecurityPolicy = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/securityPolicy",
+}
+
+// ExternalRefType_SecurityThreatModel A reference the [security threat model](https://en.wikipedia.org/wiki/Threat_model) for a package.
+var ExternalRefType_SecurityThreatModel = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/securityThreatModel",
+}
+
+// ExternalRefType_SocialMedia A reference to a social media channel for a package.
+var ExternalRefType_SocialMedia = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/socialMedia",
+}
+
+// ExternalRefType_SourceArtifact A reference to an artifact containing the sources for a package.
+var ExternalRefType_SourceArtifact = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/sourceArtifact",
+}
+
+// ExternalRefType_StaticAnalysisReport A reference to a static analysis report for a package.
+var ExternalRefType_StaticAnalysisReport = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/staticAnalysisReport",
+}
+
+// ExternalRefType_Support A reference to the software support channel or other support information for a package.
+var ExternalRefType_Support = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/support",
+}
+
+// ExternalRefType_Vcs A reference to a version control system related to a software artifact.
+var ExternalRefType_Vcs = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/vcs",
+}
+
+// ExternalRefType_VulnerabilityDisclosureReport A reference to a Vulnerability Disclosure Report (VDR) which provides the software supplier's analysis and findings describing the impact (or lack of impact) that reported vulnerabilities have on packages or products in the supplier's SBOM as defined in [NIST SP 800-161 Cybersecurity Supply Chain Risk Management Practices for Systems and Organizations](https://csrc.nist.gov/pubs/sp/800/161/r1/final).
+var ExternalRefType_VulnerabilityDisclosureReport = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/vulnerabilityDisclosureReport",
+}
+
+// ExternalRefType_VulnerabilityExploitabilityAssessment A reference to a Vulnerability Exploitability eXchange (VEX) statement which provides information on whether a product is impacted by a specific vulnerability in an included package and, if affected, whether there are actions recommended to remediate. See also [NTIA VEX one-page summary](https://ntia.gov/files/ntia/publications/vex_one-page_summary.pdf).
+var ExternalRefType_VulnerabilityExploitabilityAssessment = ExternalRefType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/vulnerabilityExploitabilityAssessment",
+}
+
+type AnyFile interface {
+ AnySoftwareArtifact
+ asFile()
+ GetContentType() string
+ SetContentType(string)
+ GetKind() FileKindType
+ SetKind(FileKindType)
+}
+
+// File Refers to any object that stores content on a computer.
+type File struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Software/File" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // StandardNames The name of a relevant standard that may apply to an artifact.
+ StandardNames []string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/standardName" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // BuiltTime Specifies the time an artifact was built.
+ BuiltTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/builtTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ReleaseTime Specifies the time an artifact was released.
+ ReleaseTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/releaseTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // SupportLevels Specifies the level of support associated with an artifact.
+ SupportLevels []SupportType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/supportLevel" type:"https://spdx.org/rdf/3.0.1/terms/Core/SupportType"`
+ // SuppliedBy Identifies who or what supplied the artifact or VulnAssessmentRelationship referenced by the Element.
+ SuppliedBy AnyAgent `iri:"https://spdx.org/rdf/3.0.1/terms/Core/suppliedBy" type:"https://spdx.org/rdf/3.0.1/terms/Core/Agent"`
+ // OriginatedBy Identifies from where or whom the Element originally came.
+ OriginatedBy AgentList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/originatedBy" type:"https://spdx.org/rdf/3.0.1/terms/Core/Agent"`
+ // ValidUntilTime Specifies until when the artifact can be used before its usage needs to be reassessed.
+ ValidUntilTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/validUntilTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ContentIdentifiers A canonical, unique, immutable identifier of the artifact content, that may be used for verifying its identity and/or integrity.
+ ContentIdentifiers ContentIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Software/contentIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Software/ContentIdentifier"`
+ // AttributionTexts Provides a place for the SPDX data creator to record acknowledgement text for a software Package, File or Snippet.
+ AttributionTexts []string `iri:"https://spdx.org/rdf/3.0.1/terms/Software/attributionText" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // AdditionalPurposes Provides additional purpose information of the software artifact.
+ AdditionalPurposes []SoftwarePurpose `iri:"https://spdx.org/rdf/3.0.1/terms/Software/additionalPurpose" type:"https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose"`
+ // PrimaryPurpose Provides information about the primary purpose of the software artifact.
+ PrimaryPurpose SoftwarePurpose `iri:"https://spdx.org/rdf/3.0.1/terms/Software/primaryPurpose" type:"https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose"`
+ // CopyrightText Identifies the text of one or more copyright notices for a software Package, File or Snippet, if any.
+ CopyrightText string `iri:"https://spdx.org/rdf/3.0.1/terms/Software/copyrightText" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // ContentType Provides information about the content type of an Element or a Property.
+ ContentType string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/contentType" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Kind Describes if a given file is a directory or non-directory kind of file.
+ Kind FileKindType `iri:"https://spdx.org/rdf/3.0.1/terms/Software/fileKind" type:"https://spdx.org/rdf/3.0.1/terms/Software/FileKindType"`
+}
+
+func (o *File) asFile() {}
+func (o *File) asSoftwareArtifact() {}
+func (o *File) asArtifact() {}
+func (o *File) asElement() {}
+func (o *File) GetID() string {
+ return o.ID
+}
+
+func (o *File) SetID(v string) {
+ o.ID = v
+}
+
+func (o *File) GetDescription() string {
+ return o.Description
+}
+
+func (o *File) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *File) GetComment() string {
+ return o.Comment
+}
+
+func (o *File) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *File) GetName() string {
+ return o.Name
+}
+
+func (o *File) SetName(v string) {
+ o.Name = v
+}
+
+func (o *File) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *File) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *File) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *File) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *File) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *File) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *File) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *File) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *File) GetSummary() string {
+ return o.Summary
+}
+
+func (o *File) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *File) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *File) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *File) GetStandardNames() []string {
+ return o.StandardNames
+}
+
+func (o *File) SetStandardNames(v []string) {
+ o.StandardNames = v
+}
+
+func (o *File) GetBuiltTime() time.Time {
+ return o.BuiltTime
+}
+
+func (o *File) SetBuiltTime(v time.Time) {
+ o.BuiltTime = v
+}
+
+func (o *File) GetReleaseTime() time.Time {
+ return o.ReleaseTime
+}
+
+func (o *File) SetReleaseTime(v time.Time) {
+ o.ReleaseTime = v
+}
+
+func (o *File) GetSupportLevels() []SupportType {
+ return o.SupportLevels
+}
+
+func (o *File) SetSupportLevels(v []SupportType) {
+ o.SupportLevels = v
+}
+
+func (o *File) GetSuppliedBy() AnyAgent {
+ return o.SuppliedBy
+}
+
+func (o *File) SetSuppliedBy(v AnyAgent) {
+ o.SuppliedBy = v
+}
+
+func (o *File) GetOriginatedBy() AgentList {
+ return o.OriginatedBy
+}
+
+func (o *File) SetOriginatedBy(v AgentList) {
+ o.OriginatedBy = v
+}
+
+func (o *File) GetValidUntilTime() time.Time {
+ return o.ValidUntilTime
+}
+
+func (o *File) SetValidUntilTime(v time.Time) {
+ o.ValidUntilTime = v
+}
+
+func (o *File) GetContentIdentifiers() ContentIdentifierList {
+ return o.ContentIdentifiers
+}
+
+func (o *File) SetContentIdentifiers(v ContentIdentifierList) {
+ o.ContentIdentifiers = v
+}
+
+func (o *File) GetAttributionTexts() []string {
+ return o.AttributionTexts
+}
+
+func (o *File) SetAttributionTexts(v []string) {
+ o.AttributionTexts = v
+}
+
+func (o *File) GetAdditionalPurposes() []SoftwarePurpose {
+ return o.AdditionalPurposes
+}
+
+func (o *File) SetAdditionalPurposes(v []SoftwarePurpose) {
+ o.AdditionalPurposes = v
+}
+
+func (o *File) GetPrimaryPurpose() SoftwarePurpose {
+ return o.PrimaryPurpose
+}
+
+func (o *File) SetPrimaryPurpose(v SoftwarePurpose) {
+ o.PrimaryPurpose = v
+}
+
+func (o *File) GetCopyrightText() string {
+ return o.CopyrightText
+}
+
+func (o *File) SetCopyrightText(v string) {
+ o.CopyrightText = v
+}
+
+func (o *File) GetContentType() string {
+ return o.ContentType
+}
+
+func (o *File) SetContentType(v string) {
+ o.ContentType = v
+}
+
+func (o *File) GetKind() FileKindType {
+ return o.Kind
+}
+
+func (o *File) SetKind(v FileKindType) {
+ o.Kind = v
+}
+
+type FileList []AnyFile
+
+func (v FileList) Files() []AnyFile {
+ return ld.SliceOf[AnyFile](v)
+}
+
+// FileKindType Enumeration of the different kinds of SPDX file.
+type FileKindType struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Software/FileKindType" node-kind:""`
+ id string `iri:"@id"`
+}
+
+func (o *FileKindType) GetID() string {
+ return o.id
+}
+
+// FileKindType_Directory The file represents a directory and all content stored in that directory.
+var FileKindType_Directory = FileKindType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/FileKindType/directory",
+}
+
+// FileKindType_File The file represents a single file (default).
+var FileKindType_File = FileKindType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/FileKindType/file",
+}
+
+type AnyHash interface {
+ AnyIntegrityMethod
+ asHash()
+ GetValue() string
+ SetValue(string)
+ GetAlgorithm() HashAlgorithm
+ SetAlgorithm(HashAlgorithm)
+}
+
+// Hash A mathematically calculated representation of a grouping of data.
+type Hash struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/Hash" node-kind:"http://www.w3.org/ns/shacl#BlankNodeOrIRI"`
+ ID string `iri:"@id"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Value The result of applying a hash algorithm to an Element.
+ Value string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/hashValue" required:"true" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Algorithm Specifies the algorithm used for calculating the hash value.
+ Algorithm HashAlgorithm `iri:"https://spdx.org/rdf/3.0.1/terms/Core/algorithm" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm"`
+}
+
+func (o *Hash) asHash() {}
+func (o *Hash) asIntegrityMethod() {}
+func (o *Hash) GetID() string {
+ return o.ID
+}
+
+func (o *Hash) SetID(v string) {
+ o.ID = v
+}
+
+func (o *Hash) GetComment() string {
+ return o.Comment
+}
+
+func (o *Hash) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *Hash) GetValue() string {
+ return o.Value
+}
+
+func (o *Hash) SetValue(v string) {
+ o.Value = v
+}
+
+func (o *Hash) GetAlgorithm() HashAlgorithm {
+ return o.Algorithm
+}
+
+func (o *Hash) SetAlgorithm(v HashAlgorithm) {
+ o.Algorithm = v
+}
+
+type HashList []AnyHash
+
+func (v HashList) Hashes() []AnyHash {
+ return ld.SliceOf[AnyHash](v)
+}
+
+// HashAlgorithm A mathematical algorithm that maps data of arbitrary size to a bit string.
+type HashAlgorithm struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm" node-kind:""`
+ id string `iri:"@id"`
+}
+
+func (o *HashAlgorithm) GetID() string {
+ return o.id
+}
+
+// HashAlgorithm_Adler32 Adler-32 checksum is part of the widely used zlib compression library as defined in [RFC 1950](https://datatracker.ietf.org/doc/rfc1950/) Section 2.3.
+var HashAlgorithm_Adler32 = HashAlgorithm{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/adler32",
+}
+
+// HashAlgorithm_Blake2b256 BLAKE2b algorithm with a digest size of 256, as defined in [RFC 7693](https://datatracker.ietf.org/doc/rfc7693/) Section 4.
+var HashAlgorithm_Blake2b256 = HashAlgorithm{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/blake2b256",
+}
+
+// HashAlgorithm_Blake2b384 BLAKE2b algorithm with a digest size of 384, as defined in [RFC 7693](https://datatracker.ietf.org/doc/rfc7693/) Section 4.
+var HashAlgorithm_Blake2b384 = HashAlgorithm{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/blake2b384",
+}
+
+// HashAlgorithm_Blake2b512 BLAKE2b algorithm with a digest size of 512, as defined in [RFC 7693](https://datatracker.ietf.org/doc/rfc7693/) Section 4.
+var HashAlgorithm_Blake2b512 = HashAlgorithm{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/blake2b512",
+}
+
+// HashAlgorithm_Blake3 [BLAKE3](https://github.com/BLAKE3-team/BLAKE3-specs/blob/master/blake3.pdf)
+var HashAlgorithm_Blake3 = HashAlgorithm{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/blake3",
+}
+
+// HashAlgorithm_CrystalsDilithium [Dilithium](https://pq-crystals.org/dilithium/)
+var HashAlgorithm_CrystalsDilithium = HashAlgorithm{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/crystalsDilithium",
+}
+
+// HashAlgorithm_CrystalsKyber [Kyber](https://pq-crystals.org/kyber/)
+var HashAlgorithm_CrystalsKyber = HashAlgorithm{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/crystalsKyber",
+}
+
+// HashAlgorithm_Falcon [FALCON](https://falcon-sign.info/falcon.pdf)
+var HashAlgorithm_Falcon = HashAlgorithm{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/falcon",
+}
+
+// HashAlgorithm_Md2 MD2 message-digest algorithm, as defined in [RFC 1319](https://datatracker.ietf.org/doc/rfc1319/).
+var HashAlgorithm_Md2 = HashAlgorithm{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/md2",
+}
+
+// HashAlgorithm_Md4 MD4 message-digest algorithm, as defined in [RFC 1186](https://datatracker.ietf.org/doc/rfc1186/).
+var HashAlgorithm_Md4 = HashAlgorithm{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/md4",
+}
+
+// HashAlgorithm_Md5 MD5 message-digest algorithm, as defined in [RFC 1321](https://datatracker.ietf.org/doc/rfc1321/).
+var HashAlgorithm_Md5 = HashAlgorithm{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/md5",
+}
+
+// HashAlgorithm_Md6 [MD6 hash function](https://people.csail.mit.edu/rivest/pubs/RABCx08.pdf)
+var HashAlgorithm_Md6 = HashAlgorithm{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/md6",
+}
+
+// HashAlgorithm_Other any hashing algorithm that does not exist in this list of entries
+var HashAlgorithm_Other = HashAlgorithm{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/other",
+}
+
+// HashAlgorithm_Sha1 SHA-1, a secure hashing algorithm, as defined in [RFC 3174](https://datatracker.ietf.org/doc/rfc3174/).
+var HashAlgorithm_Sha1 = HashAlgorithm{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/sha1",
+}
+
+// HashAlgorithm_Sha224 SHA-2 with a digest length of 224, as defined in [RFC 3874](https://datatracker.ietf.org/doc/rfc3874/).
+var HashAlgorithm_Sha224 = HashAlgorithm{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/sha224",
+}
+
+// HashAlgorithm_Sha256 SHA-2 with a digest length of 256, as defined in [RFC 6234](https://datatracker.ietf.org/doc/rfc6234/).
+var HashAlgorithm_Sha256 = HashAlgorithm{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/sha256",
+}
+
+// HashAlgorithm_Sha384 SHA-2 with a digest length of 384, as defined in [RFC 6234](https://datatracker.ietf.org/doc/rfc6234/).
+var HashAlgorithm_Sha384 = HashAlgorithm{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/sha384",
+}
+
+// HashAlgorithm_Sha3_224 SHA-3 with a digest length of 224, as defined in [FIPS 202](https://csrc.nist.gov/pubs/fips/202/final).
+var HashAlgorithm_Sha3_224 = HashAlgorithm{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/sha3_224",
+}
+
+// HashAlgorithm_Sha3_256 SHA-3 with a digest length of 256, as defined in [FIPS 202](https://csrc.nist.gov/pubs/fips/202/final).
+var HashAlgorithm_Sha3_256 = HashAlgorithm{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/sha3_256",
+}
+
+// HashAlgorithm_Sha3_384 SHA-3 with a digest length of 384, as defined in [FIPS 202](https://csrc.nist.gov/pubs/fips/202/final).
+var HashAlgorithm_Sha3_384 = HashAlgorithm{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/sha3_384",
+}
+
+// HashAlgorithm_Sha3_512 SHA-3 with a digest length of 512, as defined in [FIPS 202](https://csrc.nist.gov/pubs/fips/202/final).
+var HashAlgorithm_Sha3_512 = HashAlgorithm{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/sha3_512",
+}
+
+// HashAlgorithm_Sha512 SHA-2 with a digest length of 512, as defined in [RFC 6234](https://datatracker.ietf.org/doc/rfc6234/).
+var HashAlgorithm_Sha512 = HashAlgorithm{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/sha512",
+}
+
+type AnyIndividualElement interface {
+ AnyElement
+ asIndividualElement()
+}
+
+// IndividualElement A concrete subclass of Element used by Individuals in the Core profile.
+type IndividualElement struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/IndividualElement" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+}
+
+func (o *IndividualElement) asIndividualElement() {}
+func (o *IndividualElement) asElement() {}
+func (o *IndividualElement) GetID() string {
+ return o.ID
+}
+
+func (o *IndividualElement) SetID(v string) {
+ o.ID = v
+}
+
+func (o *IndividualElement) GetDescription() string {
+ return o.Description
+}
+
+func (o *IndividualElement) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *IndividualElement) GetComment() string {
+ return o.Comment
+}
+
+func (o *IndividualElement) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *IndividualElement) GetName() string {
+ return o.Name
+}
+
+func (o *IndividualElement) SetName(v string) {
+ o.Name = v
+}
+
+func (o *IndividualElement) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *IndividualElement) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *IndividualElement) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *IndividualElement) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *IndividualElement) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *IndividualElement) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *IndividualElement) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *IndividualElement) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *IndividualElement) GetSummary() string {
+ return o.Summary
+}
+
+func (o *IndividualElement) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *IndividualElement) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *IndividualElement) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+// IndividualElement_NoAssertionElement An Individual Value for Element representing a set of Elements of unknown\nidentify or cardinality (number).
+var IndividualElement_NoAssertionElement AnyIndividualElement = &IndividualElement{
+ ID: "https://spdx.org/rdf/3.0.1/terms/Core/NoAssertionElement",
+}
+
+// IndividualElement_NoneElement An Individual Value for Element representing a set of Elements with\ncardinality (number/count) of zero.
+var IndividualElement_NoneElement AnyIndividualElement = &IndividualElement{
+ ID: "https://spdx.org/rdf/3.0.1/terms/Core/NoneElement",
+}
+
+type IndividualElementList []AnyIndividualElement
+
+func (v IndividualElementList) IndividualElements() []AnyIndividualElement {
+ return ld.SliceOf[AnyIndividualElement](v)
+}
+
+type AnyIndividualLicensingInfo interface {
+ AnyLicenseInfo
+ asIndividualLicensingInfo()
+}
+
+// IndividualLicensingInfo A concrete subclass of AnyLicenseInfo used by Individuals in the ExpandedLicensing profile.
+type IndividualLicensingInfo struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/IndividualLicensingInfo" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+}
+
+func (o *IndividualLicensingInfo) asIndividualLicensingInfo() {}
+func (o *IndividualLicensingInfo) asLicenseInfo() {}
+func (o *IndividualLicensingInfo) asElement() {}
+func (o *IndividualLicensingInfo) GetID() string {
+ return o.ID
+}
+
+func (o *IndividualLicensingInfo) SetID(v string) {
+ o.ID = v
+}
+
+func (o *IndividualLicensingInfo) GetDescription() string {
+ return o.Description
+}
+
+func (o *IndividualLicensingInfo) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *IndividualLicensingInfo) GetComment() string {
+ return o.Comment
+}
+
+func (o *IndividualLicensingInfo) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *IndividualLicensingInfo) GetName() string {
+ return o.Name
+}
+
+func (o *IndividualLicensingInfo) SetName(v string) {
+ o.Name = v
+}
+
+func (o *IndividualLicensingInfo) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *IndividualLicensingInfo) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *IndividualLicensingInfo) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *IndividualLicensingInfo) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *IndividualLicensingInfo) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *IndividualLicensingInfo) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *IndividualLicensingInfo) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *IndividualLicensingInfo) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *IndividualLicensingInfo) GetSummary() string {
+ return o.Summary
+}
+
+func (o *IndividualLicensingInfo) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *IndividualLicensingInfo) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *IndividualLicensingInfo) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+// IndividualLicensingInfo_NoAssertionLicense An Individual Value for License when no assertion can be made about its actual\nvalue.
+var IndividualLicensingInfo_NoAssertionLicense AnyIndividualLicensingInfo = &IndividualLicensingInfo{
+ ID: "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/NoAssertionLicense",
+}
+
+// IndividualLicensingInfo_NoneLicense An Individual Value for License where the SPDX data creator determines that no\nlicense is present.
+var IndividualLicensingInfo_NoneLicense AnyIndividualLicensingInfo = &IndividualLicensingInfo{
+ ID: "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/NoneLicense",
+}
+
+type IndividualLicensingInfoList []AnyIndividualLicensingInfo
+
+func (v IndividualLicensingInfoList) IndividualLicensingInfos() []AnyIndividualLicensingInfo {
+ return ld.SliceOf[AnyIndividualLicensingInfo](v)
+}
+
+type AnyIntegrityMethod interface {
+ GetID() string
+ SetID(string)
+ asIntegrityMethod()
+ GetComment() string
+ SetComment(string)
+}
+
+// IntegrityMethod Provides an independently reproducible mechanism that permits verification of a specific Element.
+type IntegrityMethodList []AnyIntegrityMethod
+
+func (v IntegrityMethodList) ContentIdentifiers() []AnyContentIdentifier {
+ return ld.SliceOf[AnyContentIdentifier](v)
+}
+
+func (v IntegrityMethodList) Hashes() []AnyHash {
+ return ld.SliceOf[AnyHash](v)
+}
+
+func (v IntegrityMethodList) IntegrityMethods() []AnyIntegrityMethod {
+ return ld.SliceOf[AnyIntegrityMethod](v)
+}
+
+func (v IntegrityMethodList) PackageVerificationCodes() []AnyPackageVerificationCode {
+ return ld.SliceOf[AnyPackageVerificationCode](v)
+}
+
+type AnyLicense interface {
+ AnyExtendableLicense
+ asLicense()
+ GetSeeAlsos() []URI
+ SetSeeAlsos([]URI)
+ GetIsDeprecatedLicenseID() bool
+ SetIsDeprecatedLicenseID(bool)
+ GetObsoletedBy() string
+ SetObsoletedBy(string)
+ GetStandardLicenseHeader() string
+ SetStandardLicenseHeader(string)
+ GetText() string
+ SetText(string)
+ GetIsOsiApproved() bool
+ SetIsOsiApproved(bool)
+ GetXml() string
+ SetXml(string)
+ GetIsFsfLibre() bool
+ SetIsFsfLibre(bool)
+ GetStandardLicenseTemplate() string
+ SetStandardLicenseTemplate(string)
+}
+
+// License Abstract class for the portion of an AnyLicenseInfo representing a license.
+type LicenseList []AnyLicense
+
+func (v LicenseList) CustomLicenses() []AnyCustomLicense {
+ return ld.SliceOf[AnyCustomLicense](v)
+}
+
+func (v LicenseList) Licenses() []AnyLicense {
+ return ld.SliceOf[AnyLicense](v)
+}
+
+func (v LicenseList) ListedLicenses() []AnyListedLicense {
+ return ld.SliceOf[AnyListedLicense](v)
+}
+
+type AnyLicenseAddition interface {
+ AnyElement
+ asLicenseAddition()
+ GetAdditionText() string
+ SetAdditionText(string)
+ GetObsoletedBy() string
+ SetObsoletedBy(string)
+ GetLicenseXml() string
+ SetLicenseXml(string)
+ GetStandardAdditionTemplate() string
+ SetStandardAdditionTemplate(string)
+ GetSeeAlsos() []URI
+ SetSeeAlsos([]URI)
+ GetIsDeprecatedAdditionID() bool
+ SetIsDeprecatedAdditionID(bool)
+}
+
+// LicenseAddition Abstract class for additional text intended to be added to a License, but which is not itself a standalone License.
+type LicenseAdditionList []AnyLicenseAddition
+
+func (v LicenseAdditionList) CustomLicenseAdditions() []AnyCustomLicenseAddition {
+ return ld.SliceOf[AnyCustomLicenseAddition](v)
+}
+
+func (v LicenseAdditionList) LicenseAdditions() []AnyLicenseAddition {
+ return ld.SliceOf[AnyLicenseAddition](v)
+}
+
+func (v LicenseAdditionList) ListedLicenseExceptions() []AnyListedLicenseException {
+ return ld.SliceOf[AnyListedLicenseException](v)
+}
+
+type AnyLicenseExpression interface {
+ AnyLicenseInfo
+ asLicenseExpression()
+ GetLicenseExpression() string
+ SetLicenseExpression(string)
+ GetCustomIdToUris() DictionaryEntryList
+ SetCustomIdToUris(DictionaryEntryList)
+ GetLicenseListVersion() string
+ SetLicenseListVersion(string)
+}
+
+// LicenseExpression An SPDX Element containing an SPDX license expression string.
+type LicenseExpression struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/SimpleLicensing/LicenseExpression" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // LicenseExpression A string in the license expression format.
+ LicenseExpression string `iri:"https://spdx.org/rdf/3.0.1/terms/SimpleLicensing/licenseExpression" required:"true" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // CustomIdToUris Maps a LicenseRef or AdditionRef string for a Custom License or a Custom License Addition to its URI ID.
+ CustomIdToUris DictionaryEntryList `iri:"https://spdx.org/rdf/3.0.1/terms/SimpleLicensing/customIdToUri" type:"https://spdx.org/rdf/3.0.1/terms/Core/DictionaryEntry"`
+ // LicenseListVersion The version of the SPDX License List used in the license expression.
+ LicenseListVersion string `iri:"https://spdx.org/rdf/3.0.1/terms/SimpleLicensing/licenseListVersion" type:"http://www.w3.org/2001/XMLSchema#string"`
+}
+
+func (o *LicenseExpression) asLicenseExpression() {}
+func (o *LicenseExpression) asLicenseInfo() {}
+func (o *LicenseExpression) asElement() {}
+func (o *LicenseExpression) GetID() string {
+ return o.ID
+}
+
+func (o *LicenseExpression) SetID(v string) {
+ o.ID = v
+}
+
+func (o *LicenseExpression) GetDescription() string {
+ return o.Description
+}
+
+func (o *LicenseExpression) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *LicenseExpression) GetComment() string {
+ return o.Comment
+}
+
+func (o *LicenseExpression) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *LicenseExpression) GetName() string {
+ return o.Name
+}
+
+func (o *LicenseExpression) SetName(v string) {
+ o.Name = v
+}
+
+func (o *LicenseExpression) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *LicenseExpression) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *LicenseExpression) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *LicenseExpression) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *LicenseExpression) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *LicenseExpression) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *LicenseExpression) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *LicenseExpression) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *LicenseExpression) GetSummary() string {
+ return o.Summary
+}
+
+func (o *LicenseExpression) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *LicenseExpression) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *LicenseExpression) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *LicenseExpression) GetLicenseExpression() string {
+ return o.LicenseExpression
+}
+
+func (o *LicenseExpression) SetLicenseExpression(v string) {
+ o.LicenseExpression = v
+}
+
+func (o *LicenseExpression) GetCustomIdToUris() DictionaryEntryList {
+ return o.CustomIdToUris
+}
+
+func (o *LicenseExpression) SetCustomIdToUris(v DictionaryEntryList) {
+ o.CustomIdToUris = v
+}
+
+func (o *LicenseExpression) GetLicenseListVersion() string {
+ return o.LicenseListVersion
+}
+
+func (o *LicenseExpression) SetLicenseListVersion(v string) {
+ o.LicenseListVersion = v
+}
+
+type LicenseExpressionList []AnyLicenseExpression
+
+func (v LicenseExpressionList) LicenseExpressions() []AnyLicenseExpression {
+ return ld.SliceOf[AnyLicenseExpression](v)
+}
+
+type AnyLicenseInfo interface {
+ AnyElement
+ asLicenseInfo()
+}
+
+// LicenseInfo Abstract class representing a license combination consisting of one or more licenses.
+type LicenseInfoList []AnyLicenseInfo
+
+func (v LicenseInfoList) ConjunctiveLicenseSets() []AnyConjunctiveLicenseSet {
+ return ld.SliceOf[AnyConjunctiveLicenseSet](v)
+}
+
+func (v LicenseInfoList) CustomLicenses() []AnyCustomLicense {
+ return ld.SliceOf[AnyCustomLicense](v)
+}
+
+func (v LicenseInfoList) DisjunctiveLicenseSets() []AnyDisjunctiveLicenseSet {
+ return ld.SliceOf[AnyDisjunctiveLicenseSet](v)
+}
+
+func (v LicenseInfoList) ExtendableLicenses() []AnyExtendableLicense {
+ return ld.SliceOf[AnyExtendableLicense](v)
+}
+
+func (v LicenseInfoList) IndividualLicensingInfos() []AnyIndividualLicensingInfo {
+ return ld.SliceOf[AnyIndividualLicensingInfo](v)
+}
+
+func (v LicenseInfoList) Licenses() []AnyLicense {
+ return ld.SliceOf[AnyLicense](v)
+}
+
+func (v LicenseInfoList) LicenseExpressions() []AnyLicenseExpression {
+ return ld.SliceOf[AnyLicenseExpression](v)
+}
+
+func (v LicenseInfoList) LicenseInfos() []AnyLicenseInfo {
+ return ld.SliceOf[AnyLicenseInfo](v)
+}
+
+func (v LicenseInfoList) ListedLicenses() []AnyListedLicense {
+ return ld.SliceOf[AnyListedLicense](v)
+}
+
+func (v LicenseInfoList) OrLaterOperators() []AnyOrLaterOperator {
+ return ld.SliceOf[AnyOrLaterOperator](v)
+}
+
+func (v LicenseInfoList) WithAdditionOperators() []AnyWithAdditionOperator {
+ return ld.SliceOf[AnyWithAdditionOperator](v)
+}
+
+// LifecycleScopeType Provide an enumerated set of lifecycle phases that can provide context to relationships.
+type LifecycleScopeType struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/LifecycleScopeType" node-kind:""`
+ id string `iri:"@id"`
+}
+
+func (o *LifecycleScopeType) GetID() string {
+ return o.id
+}
+
+// LifecycleScopeType_Build A relationship has specific context implications during an element's build phase, during development.
+var LifecycleScopeType_Build = LifecycleScopeType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/LifecycleScopeType/build",
+}
+
+// LifecycleScopeType_Design A relationship has specific context implications during an element's design.
+var LifecycleScopeType_Design = LifecycleScopeType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/LifecycleScopeType/design",
+}
+
+// LifecycleScopeType_Development A relationship has specific context implications during development phase of an element.
+var LifecycleScopeType_Development = LifecycleScopeType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/LifecycleScopeType/development",
+}
+
+// LifecycleScopeType_Other A relationship has other specific context information necessary to capture that the above set of enumerations does not handle.
+var LifecycleScopeType_Other = LifecycleScopeType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/LifecycleScopeType/other",
+}
+
+// LifecycleScopeType_Runtime A relationship has specific context implications during the execution phase of an element.
+var LifecycleScopeType_Runtime = LifecycleScopeType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/LifecycleScopeType/runtime",
+}
+
+// LifecycleScopeType_Test A relationship has specific context implications during an element's testing phase, during development.
+var LifecycleScopeType_Test = LifecycleScopeType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/LifecycleScopeType/test",
+}
+
+type AnyLifecycleScopedRelationship interface {
+ AnyRelationship
+ asLifecycleScopedRelationship()
+ GetScope() LifecycleScopeType
+ SetScope(LifecycleScopeType)
+}
+
+// LifecycleScopedRelationship Provide context for a relationship that occurs in the lifecycle.
+type LifecycleScopedRelationship struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/LifecycleScopedRelationship" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // Completeness Provides information about the completeness of relationships.
+ Completeness RelationshipCompleteness `iri:"https://spdx.org/rdf/3.0.1/terms/Core/completeness" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipCompleteness"`
+ // EndTime Specifies the time from which an element is no longer applicable / valid.
+ EndTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/endTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // To References an Element on the right-hand side of a relationship.
+ To ElementList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/to" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // From References the Element on the left-hand side of a relationship.
+ From AnyElement `iri:"https://spdx.org/rdf/3.0.1/terms/Core/from" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // Type Information about the relationship between two Elements.
+ Type RelationshipType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/relationshipType" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType"`
+ // StartTime Specifies the time from which an element is applicable / valid.
+ StartTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/startTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // Scope Capture the scope of information about a specific relationship between elements.
+ Scope LifecycleScopeType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/scope" type:"https://spdx.org/rdf/3.0.1/terms/Core/LifecycleScopeType"`
+}
+
+func (o *LifecycleScopedRelationship) asLifecycleScopedRelationship() {}
+func (o *LifecycleScopedRelationship) asRelationship() {}
+func (o *LifecycleScopedRelationship) asElement() {}
+func (o *LifecycleScopedRelationship) GetID() string {
+ return o.ID
+}
+
+func (o *LifecycleScopedRelationship) SetID(v string) {
+ o.ID = v
+}
+
+func (o *LifecycleScopedRelationship) GetDescription() string {
+ return o.Description
+}
+
+func (o *LifecycleScopedRelationship) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *LifecycleScopedRelationship) GetComment() string {
+ return o.Comment
+}
+
+func (o *LifecycleScopedRelationship) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *LifecycleScopedRelationship) GetName() string {
+ return o.Name
+}
+
+func (o *LifecycleScopedRelationship) SetName(v string) {
+ o.Name = v
+}
+
+func (o *LifecycleScopedRelationship) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *LifecycleScopedRelationship) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *LifecycleScopedRelationship) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *LifecycleScopedRelationship) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *LifecycleScopedRelationship) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *LifecycleScopedRelationship) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *LifecycleScopedRelationship) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *LifecycleScopedRelationship) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *LifecycleScopedRelationship) GetSummary() string {
+ return o.Summary
+}
+
+func (o *LifecycleScopedRelationship) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *LifecycleScopedRelationship) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *LifecycleScopedRelationship) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *LifecycleScopedRelationship) GetCompleteness() RelationshipCompleteness {
+ return o.Completeness
+}
+
+func (o *LifecycleScopedRelationship) SetCompleteness(v RelationshipCompleteness) {
+ o.Completeness = v
+}
+
+func (o *LifecycleScopedRelationship) GetEndTime() time.Time {
+ return o.EndTime
+}
+
+func (o *LifecycleScopedRelationship) SetEndTime(v time.Time) {
+ o.EndTime = v
+}
+
+func (o *LifecycleScopedRelationship) GetTo() ElementList {
+ return o.To
+}
+
+func (o *LifecycleScopedRelationship) SetTo(v ElementList) {
+ o.To = v
+}
+
+func (o *LifecycleScopedRelationship) GetFrom() AnyElement {
+ return o.From
+}
+
+func (o *LifecycleScopedRelationship) SetFrom(v AnyElement) {
+ o.From = v
+}
+
+func (o *LifecycleScopedRelationship) GetType() RelationshipType {
+ return o.Type
+}
+
+func (o *LifecycleScopedRelationship) SetType(v RelationshipType) {
+ o.Type = v
+}
+
+func (o *LifecycleScopedRelationship) GetStartTime() time.Time {
+ return o.StartTime
+}
+
+func (o *LifecycleScopedRelationship) SetStartTime(v time.Time) {
+ o.StartTime = v
+}
+
+func (o *LifecycleScopedRelationship) GetScope() LifecycleScopeType {
+ return o.Scope
+}
+
+func (o *LifecycleScopedRelationship) SetScope(v LifecycleScopeType) {
+ o.Scope = v
+}
+
+type LifecycleScopedRelationshipList []AnyLifecycleScopedRelationship
+
+func (v LifecycleScopedRelationshipList) LifecycleScopedRelationships() []AnyLifecycleScopedRelationship {
+ return ld.SliceOf[AnyLifecycleScopedRelationship](v)
+}
+
+type AnyListedLicense interface {
+ AnyLicense
+ asListedLicense()
+ GetListVersionAdded() string
+ SetListVersionAdded(string)
+ GetDeprecatedVersion() string
+ SetDeprecatedVersion(string)
+}
+
+// ListedLicense A license that is listed on the SPDX License List.
+type ListedLicense struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/ListedLicense" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // SeeAlsos Contains a URL where the License or LicenseAddition can be found in use.
+ SeeAlsos []URI `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/seeAlso" type:"http://www.w3.org/2001/XMLSchema#anyURI"`
+ // IsDeprecatedLicenseID Specifies whether a license or additional text identifier has been marked as deprecated.
+ IsDeprecatedLicenseID bool `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/isDeprecatedLicenseId" type:"http://www.w3.org/2001/XMLSchema#boolean"`
+ // ObsoletedBy Specifies the licenseId that is preferred to be used in place of a deprecated License or LicenseAddition.
+ ObsoletedBy string `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/obsoletedBy" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // StandardLicenseHeader Provides a License author's preferred text to indicate that a file is covered by the License.
+ StandardLicenseHeader string `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/standardLicenseHeader" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Text Identifies the full text of a License or Addition.
+ Text string `iri:"https://spdx.org/rdf/3.0.1/terms/SimpleLicensing/licenseText" required:"true" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // IsOsiApproved Specifies whether the License is listed as approved by the Open Source Initiative (OSI).
+ IsOsiApproved bool `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/isOsiApproved" type:"http://www.w3.org/2001/XMLSchema#boolean"`
+ // Xml Identifies all the text and metadata associated with a license in the license XML format.
+ Xml string `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/licenseXml" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // IsFsfLibre Specifies whether the License is listed as free by the Free Software Foundation (FSF).
+ IsFsfLibre bool `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/isFsfLibre" type:"http://www.w3.org/2001/XMLSchema#boolean"`
+ // StandardLicenseTemplate Identifies the full text of a License, in SPDX templating format.
+ StandardLicenseTemplate string `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/standardLicenseTemplate" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // ListVersionAdded Specifies the SPDX License List version in which this ListedLicense or ListedLicenseException identifier was first added.
+ ListVersionAdded string `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/listVersionAdded" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // DeprecatedVersion Specifies the SPDX License List version in which this license or exception identifier was deprecated.
+ DeprecatedVersion string `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/deprecatedVersion" type:"http://www.w3.org/2001/XMLSchema#string"`
+}
+
+func (o *ListedLicense) asListedLicense() {}
+func (o *ListedLicense) asLicense() {}
+func (o *ListedLicense) asExtendableLicense() {}
+func (o *ListedLicense) asLicenseInfo() {}
+func (o *ListedLicense) asElement() {}
+func (o *ListedLicense) GetID() string {
+ return o.ID
+}
+
+func (o *ListedLicense) SetID(v string) {
+ o.ID = v
+}
+
+func (o *ListedLicense) GetDescription() string {
+ return o.Description
+}
+
+func (o *ListedLicense) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *ListedLicense) GetComment() string {
+ return o.Comment
+}
+
+func (o *ListedLicense) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *ListedLicense) GetName() string {
+ return o.Name
+}
+
+func (o *ListedLicense) SetName(v string) {
+ o.Name = v
+}
+
+func (o *ListedLicense) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *ListedLicense) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *ListedLicense) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *ListedLicense) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *ListedLicense) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *ListedLicense) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *ListedLicense) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *ListedLicense) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *ListedLicense) GetSummary() string {
+ return o.Summary
+}
+
+func (o *ListedLicense) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *ListedLicense) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *ListedLicense) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *ListedLicense) GetSeeAlsos() []URI {
+ return o.SeeAlsos
+}
+
+func (o *ListedLicense) SetSeeAlsos(v []URI) {
+ o.SeeAlsos = v
+}
+
+func (o *ListedLicense) GetIsDeprecatedLicenseID() bool {
+ return o.IsDeprecatedLicenseID
+}
+
+func (o *ListedLicense) SetIsDeprecatedLicenseID(v bool) {
+ o.IsDeprecatedLicenseID = v
+}
+
+func (o *ListedLicense) GetObsoletedBy() string {
+ return o.ObsoletedBy
+}
+
+func (o *ListedLicense) SetObsoletedBy(v string) {
+ o.ObsoletedBy = v
+}
+
+func (o *ListedLicense) GetStandardLicenseHeader() string {
+ return o.StandardLicenseHeader
+}
+
+func (o *ListedLicense) SetStandardLicenseHeader(v string) {
+ o.StandardLicenseHeader = v
+}
+
+func (o *ListedLicense) GetText() string {
+ return o.Text
+}
+
+func (o *ListedLicense) SetText(v string) {
+ o.Text = v
+}
+
+func (o *ListedLicense) GetIsOsiApproved() bool {
+ return o.IsOsiApproved
+}
+
+func (o *ListedLicense) SetIsOsiApproved(v bool) {
+ o.IsOsiApproved = v
+}
+
+func (o *ListedLicense) GetXml() string {
+ return o.Xml
+}
+
+func (o *ListedLicense) SetXml(v string) {
+ o.Xml = v
+}
+
+func (o *ListedLicense) GetIsFsfLibre() bool {
+ return o.IsFsfLibre
+}
+
+func (o *ListedLicense) SetIsFsfLibre(v bool) {
+ o.IsFsfLibre = v
+}
+
+func (o *ListedLicense) GetStandardLicenseTemplate() string {
+ return o.StandardLicenseTemplate
+}
+
+func (o *ListedLicense) SetStandardLicenseTemplate(v string) {
+ o.StandardLicenseTemplate = v
+}
+
+func (o *ListedLicense) GetListVersionAdded() string {
+ return o.ListVersionAdded
+}
+
+func (o *ListedLicense) SetListVersionAdded(v string) {
+ o.ListVersionAdded = v
+}
+
+func (o *ListedLicense) GetDeprecatedVersion() string {
+ return o.DeprecatedVersion
+}
+
+func (o *ListedLicense) SetDeprecatedVersion(v string) {
+ o.DeprecatedVersion = v
+}
+
+type ListedLicenseList []AnyListedLicense
+
+func (v ListedLicenseList) ListedLicenses() []AnyListedLicense {
+ return ld.SliceOf[AnyListedLicense](v)
+}
+
+type AnyListedLicenseException interface {
+ AnyLicenseAddition
+ asListedLicenseException()
+ GetDeprecatedVersion() string
+ SetDeprecatedVersion(string)
+ GetListVersionAdded() string
+ SetListVersionAdded(string)
+}
+
+// ListedLicenseException A license exception that is listed on the SPDX Exceptions list.
+type ListedLicenseException struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/ListedLicenseException" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // AdditionText Identifies the full text of a LicenseAddition.
+ AdditionText string `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/additionText" required:"true" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // ObsoletedBy Specifies the licenseId that is preferred to be used in place of a deprecated License or LicenseAddition.
+ ObsoletedBy string `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/obsoletedBy" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // LicenseXml Identifies all the text and metadata associated with a license in the license XML format.
+ LicenseXml string `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/licenseXml" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // StandardAdditionTemplate Identifies the full text of a LicenseAddition, in SPDX templating format.
+ StandardAdditionTemplate string `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/standardAdditionTemplate" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // SeeAlsos Contains a URL where the License or LicenseAddition can be found in use.
+ SeeAlsos []URI `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/seeAlso" type:"http://www.w3.org/2001/XMLSchema#anyURI"`
+ // IsDeprecatedAdditionID Specifies whether an additional text identifier has been marked as deprecated.
+ IsDeprecatedAdditionID bool `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/isDeprecatedAdditionId" type:"http://www.w3.org/2001/XMLSchema#boolean"`
+ // DeprecatedVersion Specifies the SPDX License List version in which this license or exception identifier was deprecated.
+ DeprecatedVersion string `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/deprecatedVersion" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // ListVersionAdded Specifies the SPDX License List version in which this ListedLicense or ListedLicenseException identifier was first added.
+ ListVersionAdded string `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/listVersionAdded" type:"http://www.w3.org/2001/XMLSchema#string"`
+}
+
+func (o *ListedLicenseException) asListedLicenseException() {}
+func (o *ListedLicenseException) asLicenseAddition() {}
+func (o *ListedLicenseException) asElement() {}
+func (o *ListedLicenseException) GetID() string {
+ return o.ID
+}
+
+func (o *ListedLicenseException) SetID(v string) {
+ o.ID = v
+}
+
+func (o *ListedLicenseException) GetDescription() string {
+ return o.Description
+}
+
+func (o *ListedLicenseException) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *ListedLicenseException) GetComment() string {
+ return o.Comment
+}
+
+func (o *ListedLicenseException) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *ListedLicenseException) GetName() string {
+ return o.Name
+}
+
+func (o *ListedLicenseException) SetName(v string) {
+ o.Name = v
+}
+
+func (o *ListedLicenseException) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *ListedLicenseException) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *ListedLicenseException) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *ListedLicenseException) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *ListedLicenseException) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *ListedLicenseException) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *ListedLicenseException) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *ListedLicenseException) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *ListedLicenseException) GetSummary() string {
+ return o.Summary
+}
+
+func (o *ListedLicenseException) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *ListedLicenseException) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *ListedLicenseException) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *ListedLicenseException) GetAdditionText() string {
+ return o.AdditionText
+}
+
+func (o *ListedLicenseException) SetAdditionText(v string) {
+ o.AdditionText = v
+}
+
+func (o *ListedLicenseException) GetObsoletedBy() string {
+ return o.ObsoletedBy
+}
+
+func (o *ListedLicenseException) SetObsoletedBy(v string) {
+ o.ObsoletedBy = v
+}
+
+func (o *ListedLicenseException) GetLicenseXml() string {
+ return o.LicenseXml
+}
+
+func (o *ListedLicenseException) SetLicenseXml(v string) {
+ o.LicenseXml = v
+}
+
+func (o *ListedLicenseException) GetStandardAdditionTemplate() string {
+ return o.StandardAdditionTemplate
+}
+
+func (o *ListedLicenseException) SetStandardAdditionTemplate(v string) {
+ o.StandardAdditionTemplate = v
+}
+
+func (o *ListedLicenseException) GetSeeAlsos() []URI {
+ return o.SeeAlsos
+}
+
+func (o *ListedLicenseException) SetSeeAlsos(v []URI) {
+ o.SeeAlsos = v
+}
+
+func (o *ListedLicenseException) GetIsDeprecatedAdditionID() bool {
+ return o.IsDeprecatedAdditionID
+}
+
+func (o *ListedLicenseException) SetIsDeprecatedAdditionID(v bool) {
+ o.IsDeprecatedAdditionID = v
+}
+
+func (o *ListedLicenseException) GetDeprecatedVersion() string {
+ return o.DeprecatedVersion
+}
+
+func (o *ListedLicenseException) SetDeprecatedVersion(v string) {
+ o.DeprecatedVersion = v
+}
+
+func (o *ListedLicenseException) GetListVersionAdded() string {
+ return o.ListVersionAdded
+}
+
+func (o *ListedLicenseException) SetListVersionAdded(v string) {
+ o.ListVersionAdded = v
+}
+
+type ListedLicenseExceptionList []AnyListedLicenseException
+
+func (v ListedLicenseExceptionList) ListedLicenseExceptions() []AnyListedLicenseException {
+ return ld.SliceOf[AnyListedLicenseException](v)
+}
+
+type AnyNamespaceMap interface {
+ GetID() string
+ SetID(string)
+ asNamespaceMap()
+ GetNamespace() URI
+ SetNamespace(URI)
+ GetPrefix() string
+ SetPrefix(string)
+}
+
+// NamespaceMap A mapping between prefixes and namespace partial URIs.
+type NamespaceMap struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/NamespaceMap" node-kind:"http://www.w3.org/ns/shacl#BlankNodeOrIRI"`
+ ID string `iri:"@id"`
+ // Namespace Provides an unambiguous mechanism for conveying a URI fragment portion of an Element ID.
+ Namespace URI `iri:"https://spdx.org/rdf/3.0.1/terms/Core/namespace" required:"true" type:"http://www.w3.org/2001/XMLSchema#anyURI"`
+ // Prefix A substitute for a URI.
+ Prefix string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/prefix" required:"true" type:"http://www.w3.org/2001/XMLSchema#string"`
+}
+
+func (o *NamespaceMap) asNamespaceMap() {}
+func (o *NamespaceMap) GetID() string {
+ return o.ID
+}
+
+func (o *NamespaceMap) SetID(v string) {
+ o.ID = v
+}
+
+func (o *NamespaceMap) GetNamespace() URI {
+ return o.Namespace
+}
+
+func (o *NamespaceMap) SetNamespace(v URI) {
+ o.Namespace = v
+}
+
+func (o *NamespaceMap) GetPrefix() string {
+ return o.Prefix
+}
+
+func (o *NamespaceMap) SetPrefix(v string) {
+ o.Prefix = v
+}
+
+type NamespaceMapList []AnyNamespaceMap
+
+func (v NamespaceMapList) NamespaceMaps() []AnyNamespaceMap {
+ return ld.SliceOf[AnyNamespaceMap](v)
+}
+
+type AnyOrLaterOperator interface {
+ AnyExtendableLicense
+ asOrLaterOperator()
+ GetSubjectLicense() AnyLicense
+ SetSubjectLicense(AnyLicense)
+}
+
+// OrLaterOperator Portion of an AnyLicenseInfo representing this version, or any later version, of the indicated License.
+type OrLaterOperator struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/OrLaterOperator" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // SubjectLicense A License participating in an 'or later' model.
+ SubjectLicense AnyLicense `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/subjectLicense" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/License"`
+}
+
+func (o *OrLaterOperator) asOrLaterOperator() {}
+func (o *OrLaterOperator) asExtendableLicense() {}
+func (o *OrLaterOperator) asLicenseInfo() {}
+func (o *OrLaterOperator) asElement() {}
+func (o *OrLaterOperator) GetID() string {
+ return o.ID
+}
+
+func (o *OrLaterOperator) SetID(v string) {
+ o.ID = v
+}
+
+func (o *OrLaterOperator) GetDescription() string {
+ return o.Description
+}
+
+func (o *OrLaterOperator) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *OrLaterOperator) GetComment() string {
+ return o.Comment
+}
+
+func (o *OrLaterOperator) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *OrLaterOperator) GetName() string {
+ return o.Name
+}
+
+func (o *OrLaterOperator) SetName(v string) {
+ o.Name = v
+}
+
+func (o *OrLaterOperator) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *OrLaterOperator) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *OrLaterOperator) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *OrLaterOperator) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *OrLaterOperator) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *OrLaterOperator) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *OrLaterOperator) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *OrLaterOperator) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *OrLaterOperator) GetSummary() string {
+ return o.Summary
+}
+
+func (o *OrLaterOperator) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *OrLaterOperator) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *OrLaterOperator) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *OrLaterOperator) GetSubjectLicense() AnyLicense {
+ return o.SubjectLicense
+}
+
+func (o *OrLaterOperator) SetSubjectLicense(v AnyLicense) {
+ o.SubjectLicense = v
+}
+
+type OrLaterOperatorList []AnyOrLaterOperator
+
+func (v OrLaterOperatorList) OrLaterOperators() []AnyOrLaterOperator {
+ return ld.SliceOf[AnyOrLaterOperator](v)
+}
+
+type AnyOrganization interface {
+ AnyAgent
+ asOrganization()
+}
+
+// Organization A group of people who work together in an organized way for a shared purpose.
+type Organization struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/Organization" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+}
+
+func (o *Organization) asOrganization() {}
+func (o *Organization) asAgent() {}
+func (o *Organization) asElement() {}
+func (o *Organization) GetID() string {
+ return o.ID
+}
+
+func (o *Organization) SetID(v string) {
+ o.ID = v
+}
+
+func (o *Organization) GetDescription() string {
+ return o.Description
+}
+
+func (o *Organization) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *Organization) GetComment() string {
+ return o.Comment
+}
+
+func (o *Organization) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *Organization) GetName() string {
+ return o.Name
+}
+
+func (o *Organization) SetName(v string) {
+ o.Name = v
+}
+
+func (o *Organization) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *Organization) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *Organization) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *Organization) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *Organization) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *Organization) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *Organization) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *Organization) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *Organization) GetSummary() string {
+ return o.Summary
+}
+
+func (o *Organization) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *Organization) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *Organization) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+// Organization_SpdxOrganization An Organization representing the SPDX Project.
+var Organization_SpdxOrganization AnyOrganization = &Organization{
+ ID: "https://spdx.org/rdf/3.0.1/terms/Core/SpdxOrganization",
+}
+
+type OrganizationList []AnyOrganization
+
+func (v OrganizationList) Organizations() []AnyOrganization {
+ return ld.SliceOf[AnyOrganization](v)
+}
+
+type AnyPackage interface {
+ AnySoftwareArtifact
+ asPackage()
+ GetSourceInfo() string
+ SetSourceInfo(string)
+ GetHomePage() URI
+ SetHomePage(URI)
+ GetVersion() string
+ SetVersion(string)
+ GetPackageURL() URI
+ SetPackageURL(URI)
+ GetDownloadLocation() URI
+ SetDownloadLocation(URI)
+}
+
+// Package Refers to any unit of content that can be associated with a distribution of software.
+type Package struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Software/Package" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // StandardNames The name of a relevant standard that may apply to an artifact.
+ StandardNames []string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/standardName" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // BuiltTime Specifies the time an artifact was built.
+ BuiltTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/builtTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ReleaseTime Specifies the time an artifact was released.
+ ReleaseTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/releaseTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // SupportLevels Specifies the level of support associated with an artifact.
+ SupportLevels []SupportType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/supportLevel" type:"https://spdx.org/rdf/3.0.1/terms/Core/SupportType"`
+ // SuppliedBy Identifies who or what supplied the artifact or VulnAssessmentRelationship referenced by the Element.
+ SuppliedBy AnyAgent `iri:"https://spdx.org/rdf/3.0.1/terms/Core/suppliedBy" type:"https://spdx.org/rdf/3.0.1/terms/Core/Agent"`
+ // OriginatedBy Identifies from where or whom the Element originally came.
+ OriginatedBy AgentList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/originatedBy" type:"https://spdx.org/rdf/3.0.1/terms/Core/Agent"`
+ // ValidUntilTime Specifies until when the artifact can be used before its usage needs to be reassessed.
+ ValidUntilTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/validUntilTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ContentIdentifiers A canonical, unique, immutable identifier of the artifact content, that may be used for verifying its identity and/or integrity.
+ ContentIdentifiers ContentIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Software/contentIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Software/ContentIdentifier"`
+ // AttributionTexts Provides a place for the SPDX data creator to record acknowledgement text for a software Package, File or Snippet.
+ AttributionTexts []string `iri:"https://spdx.org/rdf/3.0.1/terms/Software/attributionText" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // AdditionalPurposes Provides additional purpose information of the software artifact.
+ AdditionalPurposes []SoftwarePurpose `iri:"https://spdx.org/rdf/3.0.1/terms/Software/additionalPurpose" type:"https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose"`
+ // PrimaryPurpose Provides information about the primary purpose of the software artifact.
+ PrimaryPurpose SoftwarePurpose `iri:"https://spdx.org/rdf/3.0.1/terms/Software/primaryPurpose" type:"https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose"`
+ // CopyrightText Identifies the text of one or more copyright notices for a software Package, File or Snippet, if any.
+ CopyrightText string `iri:"https://spdx.org/rdf/3.0.1/terms/Software/copyrightText" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // SourceInfo Records any relevant background information or additional comments about the origin of the package.
+ SourceInfo string `iri:"https://spdx.org/rdf/3.0.1/terms/Software/sourceInfo" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // HomePage A place for the SPDX document creator to record a website that serves as the package's home page.
+ HomePage URI `iri:"https://spdx.org/rdf/3.0.1/terms/Software/homePage" type:"http://www.w3.org/2001/XMLSchema#anyURI"`
+ // Version Identify the version of a package.
+ Version string `iri:"https://spdx.org/rdf/3.0.1/terms/Software/packageVersion" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // PackageURL Provides a place for the SPDX data creator to record the package URL string (in accordance with the Package URL specification) for a software Package.
+ PackageURL URI `iri:"https://spdx.org/rdf/3.0.1/terms/Software/packageUrl" type:"http://www.w3.org/2001/XMLSchema#anyURI"`
+ // DownloadLocation Identifies the download Uniform Resource Identifier for the package at the time that the document was created.
+ DownloadLocation URI `iri:"https://spdx.org/rdf/3.0.1/terms/Software/downloadLocation" type:"http://www.w3.org/2001/XMLSchema#anyURI"`
+}
+
+func (o *Package) asPackage() {}
+func (o *Package) asSoftwareArtifact() {}
+func (o *Package) asArtifact() {}
+func (o *Package) asElement() {}
+func (o *Package) GetID() string {
+ return o.ID
+}
+
+func (o *Package) SetID(v string) {
+ o.ID = v
+}
+
+func (o *Package) GetDescription() string {
+ return o.Description
+}
+
+func (o *Package) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *Package) GetComment() string {
+ return o.Comment
+}
+
+func (o *Package) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *Package) GetName() string {
+ return o.Name
+}
+
+func (o *Package) SetName(v string) {
+ o.Name = v
+}
+
+func (o *Package) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *Package) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *Package) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *Package) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *Package) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *Package) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *Package) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *Package) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *Package) GetSummary() string {
+ return o.Summary
+}
+
+func (o *Package) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *Package) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *Package) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *Package) GetStandardNames() []string {
+ return o.StandardNames
+}
+
+func (o *Package) SetStandardNames(v []string) {
+ o.StandardNames = v
+}
+
+func (o *Package) GetBuiltTime() time.Time {
+ return o.BuiltTime
+}
+
+func (o *Package) SetBuiltTime(v time.Time) {
+ o.BuiltTime = v
+}
+
+func (o *Package) GetReleaseTime() time.Time {
+ return o.ReleaseTime
+}
+
+func (o *Package) SetReleaseTime(v time.Time) {
+ o.ReleaseTime = v
+}
+
+func (o *Package) GetSupportLevels() []SupportType {
+ return o.SupportLevels
+}
+
+func (o *Package) SetSupportLevels(v []SupportType) {
+ o.SupportLevels = v
+}
+
+func (o *Package) GetSuppliedBy() AnyAgent {
+ return o.SuppliedBy
+}
+
+func (o *Package) SetSuppliedBy(v AnyAgent) {
+ o.SuppliedBy = v
+}
+
+func (o *Package) GetOriginatedBy() AgentList {
+ return o.OriginatedBy
+}
+
+func (o *Package) SetOriginatedBy(v AgentList) {
+ o.OriginatedBy = v
+}
+
+func (o *Package) GetValidUntilTime() time.Time {
+ return o.ValidUntilTime
+}
+
+func (o *Package) SetValidUntilTime(v time.Time) {
+ o.ValidUntilTime = v
+}
+
+func (o *Package) GetContentIdentifiers() ContentIdentifierList {
+ return o.ContentIdentifiers
+}
+
+func (o *Package) SetContentIdentifiers(v ContentIdentifierList) {
+ o.ContentIdentifiers = v
+}
+
+func (o *Package) GetAttributionTexts() []string {
+ return o.AttributionTexts
+}
+
+func (o *Package) SetAttributionTexts(v []string) {
+ o.AttributionTexts = v
+}
+
+func (o *Package) GetAdditionalPurposes() []SoftwarePurpose {
+ return o.AdditionalPurposes
+}
+
+func (o *Package) SetAdditionalPurposes(v []SoftwarePurpose) {
+ o.AdditionalPurposes = v
+}
+
+func (o *Package) GetPrimaryPurpose() SoftwarePurpose {
+ return o.PrimaryPurpose
+}
+
+func (o *Package) SetPrimaryPurpose(v SoftwarePurpose) {
+ o.PrimaryPurpose = v
+}
+
+func (o *Package) GetCopyrightText() string {
+ return o.CopyrightText
+}
+
+func (o *Package) SetCopyrightText(v string) {
+ o.CopyrightText = v
+}
+
+func (o *Package) GetSourceInfo() string {
+ return o.SourceInfo
+}
+
+func (o *Package) SetSourceInfo(v string) {
+ o.SourceInfo = v
+}
+
+func (o *Package) GetHomePage() URI {
+ return o.HomePage
+}
+
+func (o *Package) SetHomePage(v URI) {
+ o.HomePage = v
+}
+
+func (o *Package) GetVersion() string {
+ return o.Version
+}
+
+func (o *Package) SetVersion(v string) {
+ o.Version = v
+}
+
+func (o *Package) GetPackageURL() URI {
+ return o.PackageURL
+}
+
+func (o *Package) SetPackageURL(v URI) {
+ o.PackageURL = v
+}
+
+func (o *Package) GetDownloadLocation() URI {
+ return o.DownloadLocation
+}
+
+func (o *Package) SetDownloadLocation(v URI) {
+ o.DownloadLocation = v
+}
+
+type PackageList []AnyPackage
+
+func (v PackageList) AIPackages() []AnyAIPackage {
+ return ld.SliceOf[AnyAIPackage](v)
+}
+
+func (v PackageList) DatasetPackages() []AnyDatasetPackage {
+ return ld.SliceOf[AnyDatasetPackage](v)
+}
+
+func (v PackageList) Packages() []AnyPackage {
+ return ld.SliceOf[AnyPackage](v)
+}
+
+type AnyPackageVerificationCode interface {
+ AnyIntegrityMethod
+ asPackageVerificationCode()
+ GetAlgorithm() HashAlgorithm
+ SetAlgorithm(HashAlgorithm)
+ GetHashValue() string
+ SetHashValue(string)
+ GetExcludedFiles() []string
+ SetExcludedFiles([]string)
+}
+
+// PackageVerificationCode An SPDX version 2.X compatible verification method for software packages.
+type PackageVerificationCode struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/PackageVerificationCode" node-kind:"http://www.w3.org/ns/shacl#BlankNodeOrIRI"`
+ ID string `iri:"@id"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Algorithm Specifies the algorithm used for calculating the hash value.
+ Algorithm HashAlgorithm `iri:"https://spdx.org/rdf/3.0.1/terms/Core/algorithm" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm"`
+ // HashValue The result of applying a hash algorithm to an Element.
+ HashValue string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/hashValue" required:"true" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // ExcludedFiles The relative file name of a file to be excluded from the `PackageVerificationCode`.
+ ExcludedFiles []string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/packageVerificationCodeExcludedFile" type:"http://www.w3.org/2001/XMLSchema#string"`
+}
+
+func (o *PackageVerificationCode) asPackageVerificationCode() {}
+func (o *PackageVerificationCode) asIntegrityMethod() {}
+func (o *PackageVerificationCode) GetID() string {
+ return o.ID
+}
+
+func (o *PackageVerificationCode) SetID(v string) {
+ o.ID = v
+}
+
+func (o *PackageVerificationCode) GetComment() string {
+ return o.Comment
+}
+
+func (o *PackageVerificationCode) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *PackageVerificationCode) GetAlgorithm() HashAlgorithm {
+ return o.Algorithm
+}
+
+func (o *PackageVerificationCode) SetAlgorithm(v HashAlgorithm) {
+ o.Algorithm = v
+}
+
+func (o *PackageVerificationCode) GetHashValue() string {
+ return o.HashValue
+}
+
+func (o *PackageVerificationCode) SetHashValue(v string) {
+ o.HashValue = v
+}
+
+func (o *PackageVerificationCode) GetExcludedFiles() []string {
+ return o.ExcludedFiles
+}
+
+func (o *PackageVerificationCode) SetExcludedFiles(v []string) {
+ o.ExcludedFiles = v
+}
+
+type PackageVerificationCodeList []AnyPackageVerificationCode
+
+func (v PackageVerificationCodeList) PackageVerificationCodes() []AnyPackageVerificationCode {
+ return ld.SliceOf[AnyPackageVerificationCode](v)
+}
+
+type AnyPerson interface {
+ AnyAgent
+ asPerson()
+}
+
+// Person An individual human being.
+type Person struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/Person" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+}
+
+func (o *Person) asPerson() {}
+func (o *Person) asAgent() {}
+func (o *Person) asElement() {}
+func (o *Person) GetID() string {
+ return o.ID
+}
+
+func (o *Person) SetID(v string) {
+ o.ID = v
+}
+
+func (o *Person) GetDescription() string {
+ return o.Description
+}
+
+func (o *Person) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *Person) GetComment() string {
+ return o.Comment
+}
+
+func (o *Person) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *Person) GetName() string {
+ return o.Name
+}
+
+func (o *Person) SetName(v string) {
+ o.Name = v
+}
+
+func (o *Person) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *Person) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *Person) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *Person) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *Person) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *Person) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *Person) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *Person) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *Person) GetSummary() string {
+ return o.Summary
+}
+
+func (o *Person) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *Person) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *Person) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+type PersonList []AnyPerson
+
+func (v PersonList) People() []AnyPerson {
+ return ld.SliceOf[AnyPerson](v)
+}
+
+type AnyPositiveIntegerRange interface {
+ GetID() string
+ SetID(string)
+ asPositiveIntegerRange()
+ GetEndIntegerRange() PositiveInt
+ SetEndIntegerRange(PositiveInt)
+ GetBeginIntegerRange() PositiveInt
+ SetBeginIntegerRange(PositiveInt)
+}
+
+// PositiveIntegerRange A tuple of two positive integers that define a range.
+type PositiveIntegerRange struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/PositiveIntegerRange" node-kind:"http://www.w3.org/ns/shacl#BlankNodeOrIRI"`
+ ID string `iri:"@id"`
+ // EndIntegerRange Defines the end of a range.
+ EndIntegerRange PositiveInt `iri:"https://spdx.org/rdf/3.0.1/terms/Core/endIntegerRange" required:"true" type:"http://www.w3.org/2001/XMLSchema#positiveInteger"`
+ // BeginIntegerRange Defines the beginning of a range.
+ BeginIntegerRange PositiveInt `iri:"https://spdx.org/rdf/3.0.1/terms/Core/beginIntegerRange" required:"true" type:"http://www.w3.org/2001/XMLSchema#positiveInteger"`
+}
+
+func (o *PositiveIntegerRange) asPositiveIntegerRange() {}
+func (o *PositiveIntegerRange) GetID() string {
+ return o.ID
+}
+
+func (o *PositiveIntegerRange) SetID(v string) {
+ o.ID = v
+}
+
+func (o *PositiveIntegerRange) GetEndIntegerRange() PositiveInt {
+ return o.EndIntegerRange
+}
+
+func (o *PositiveIntegerRange) SetEndIntegerRange(v PositiveInt) {
+ o.EndIntegerRange = v
+}
+
+func (o *PositiveIntegerRange) GetBeginIntegerRange() PositiveInt {
+ return o.BeginIntegerRange
+}
+
+func (o *PositiveIntegerRange) SetBeginIntegerRange(v PositiveInt) {
+ o.BeginIntegerRange = v
+}
+
+type PositiveIntegerRangeList []AnyPositiveIntegerRange
+
+func (v PositiveIntegerRangeList) PositiveIntegerRanges() []AnyPositiveIntegerRange {
+ return ld.SliceOf[AnyPositiveIntegerRange](v)
+}
+
+// PresenceType Categories of presence or absence.
+type PresenceType struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/PresenceType" node-kind:""`
+ id string `iri:"@id"`
+}
+
+func (o *PresenceType) GetID() string {
+ return o.id
+}
+
+// PresenceType_No Indicates absence of the field.
+var PresenceType_No = PresenceType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/PresenceType/no",
+}
+
+// PresenceType_NoAssertion Makes no assertion about the field.
+var PresenceType_NoAssertion = PresenceType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/PresenceType/noAssertion",
+}
+
+// PresenceType_Yes Indicates presence of the field.
+var PresenceType_Yes = PresenceType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/PresenceType/yes",
+}
+
+// ProfileIdentifierType Enumeration of the valid profiles.
+type ProfileIdentifierType struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/ProfileIdentifierType" node-kind:""`
+ id string `iri:"@id"`
+}
+
+func (o *ProfileIdentifierType) GetID() string {
+ return o.id
+}
+
+// ProfileIdentifierType_Ai the element follows the AI profile specification
+var ProfileIdentifierType_Ai = ProfileIdentifierType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ProfileIdentifierType/ai",
+}
+
+// ProfileIdentifierType_Build the element follows the Build profile specification
+var ProfileIdentifierType_Build = ProfileIdentifierType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ProfileIdentifierType/build",
+}
+
+// ProfileIdentifierType_Core the element follows the Core profile specification
+var ProfileIdentifierType_Core = ProfileIdentifierType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ProfileIdentifierType/core",
+}
+
+// ProfileIdentifierType_Dataset the element follows the Dataset profile specification
+var ProfileIdentifierType_Dataset = ProfileIdentifierType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ProfileIdentifierType/dataset",
+}
+
+// ProfileIdentifierType_ExpandedLicensing the element follows the ExpandedLicensing profile specification
+var ProfileIdentifierType_ExpandedLicensing = ProfileIdentifierType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ProfileIdentifierType/expandedLicensing",
+}
+
+// ProfileIdentifierType_Extension the element follows the Extension profile specification
+var ProfileIdentifierType_Extension = ProfileIdentifierType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ProfileIdentifierType/extension",
+}
+
+// ProfileIdentifierType_Lite the element follows the Lite profile specification
+var ProfileIdentifierType_Lite = ProfileIdentifierType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ProfileIdentifierType/lite",
+}
+
+// ProfileIdentifierType_Security the element follows the Security profile specification
+var ProfileIdentifierType_Security = ProfileIdentifierType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ProfileIdentifierType/security",
+}
+
+// ProfileIdentifierType_SimpleLicensing the element follows the SimpleLicensing profile specification
+var ProfileIdentifierType_SimpleLicensing = ProfileIdentifierType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ProfileIdentifierType/simpleLicensing",
+}
+
+// ProfileIdentifierType_Software the element follows the Software profile specification
+var ProfileIdentifierType_Software = ProfileIdentifierType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/ProfileIdentifierType/software",
+}
+
+type AnyRelationship interface {
+ AnyElement
+ asRelationship()
+ GetCompleteness() RelationshipCompleteness
+ SetCompleteness(RelationshipCompleteness)
+ GetEndTime() time.Time
+ SetEndTime(time.Time)
+ GetTo() ElementList
+ SetTo(ElementList)
+ GetFrom() AnyElement
+ SetFrom(AnyElement)
+ GetType() RelationshipType
+ SetType(RelationshipType)
+ GetStartTime() time.Time
+ SetStartTime(time.Time)
+}
+
+// Relationship Describes a relationship between one or more elements.
+type Relationship struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/Relationship" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // Completeness Provides information about the completeness of relationships.
+ Completeness RelationshipCompleteness `iri:"https://spdx.org/rdf/3.0.1/terms/Core/completeness" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipCompleteness"`
+ // EndTime Specifies the time from which an element is no longer applicable / valid.
+ EndTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/endTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // To References an Element on the right-hand side of a relationship.
+ To ElementList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/to" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // From References the Element on the left-hand side of a relationship.
+ From AnyElement `iri:"https://spdx.org/rdf/3.0.1/terms/Core/from" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // Type Information about the relationship between two Elements.
+ Type RelationshipType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/relationshipType" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType"`
+ // StartTime Specifies the time from which an element is applicable / valid.
+ StartTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/startTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+}
+
+func (o *Relationship) asRelationship() {}
+func (o *Relationship) asElement() {}
+func (o *Relationship) GetID() string {
+ return o.ID
+}
+
+func (o *Relationship) SetID(v string) {
+ o.ID = v
+}
+
+func (o *Relationship) GetDescription() string {
+ return o.Description
+}
+
+func (o *Relationship) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *Relationship) GetComment() string {
+ return o.Comment
+}
+
+func (o *Relationship) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *Relationship) GetName() string {
+ return o.Name
+}
+
+func (o *Relationship) SetName(v string) {
+ o.Name = v
+}
+
+func (o *Relationship) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *Relationship) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *Relationship) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *Relationship) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *Relationship) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *Relationship) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *Relationship) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *Relationship) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *Relationship) GetSummary() string {
+ return o.Summary
+}
+
+func (o *Relationship) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *Relationship) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *Relationship) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *Relationship) GetCompleteness() RelationshipCompleteness {
+ return o.Completeness
+}
+
+func (o *Relationship) SetCompleteness(v RelationshipCompleteness) {
+ o.Completeness = v
+}
+
+func (o *Relationship) GetEndTime() time.Time {
+ return o.EndTime
+}
+
+func (o *Relationship) SetEndTime(v time.Time) {
+ o.EndTime = v
+}
+
+func (o *Relationship) GetTo() ElementList {
+ return o.To
+}
+
+func (o *Relationship) SetTo(v ElementList) {
+ o.To = v
+}
+
+func (o *Relationship) GetFrom() AnyElement {
+ return o.From
+}
+
+func (o *Relationship) SetFrom(v AnyElement) {
+ o.From = v
+}
+
+func (o *Relationship) GetType() RelationshipType {
+ return o.Type
+}
+
+func (o *Relationship) SetType(v RelationshipType) {
+ o.Type = v
+}
+
+func (o *Relationship) GetStartTime() time.Time {
+ return o.StartTime
+}
+
+func (o *Relationship) SetStartTime(v time.Time) {
+ o.StartTime = v
+}
+
+type RelationshipList []AnyRelationship
+
+func (v RelationshipList) CvssV2VulnAssessmentRelationships() []AnyCvssV2VulnAssessmentRelationship {
+ return ld.SliceOf[AnyCvssV2VulnAssessmentRelationship](v)
+}
+
+func (v RelationshipList) CvssV3VulnAssessmentRelationships() []AnyCvssV3VulnAssessmentRelationship {
+ return ld.SliceOf[AnyCvssV3VulnAssessmentRelationship](v)
+}
+
+func (v RelationshipList) CvssV4VulnAssessmentRelationships() []AnyCvssV4VulnAssessmentRelationship {
+ return ld.SliceOf[AnyCvssV4VulnAssessmentRelationship](v)
+}
+
+func (v RelationshipList) EpssVulnAssessmentRelationships() []AnyEpssVulnAssessmentRelationship {
+ return ld.SliceOf[AnyEpssVulnAssessmentRelationship](v)
+}
+
+func (v RelationshipList) ExploitCatalogVulnAssessmentRelationships() []AnyExploitCatalogVulnAssessmentRelationship {
+ return ld.SliceOf[AnyExploitCatalogVulnAssessmentRelationship](v)
+}
+
+func (v RelationshipList) LifecycleScopedRelationships() []AnyLifecycleScopedRelationship {
+ return ld.SliceOf[AnyLifecycleScopedRelationship](v)
+}
+
+func (v RelationshipList) Relationships() []AnyRelationship {
+ return ld.SliceOf[AnyRelationship](v)
+}
+
+func (v RelationshipList) SsvcVulnAssessmentRelationships() []AnySsvcVulnAssessmentRelationship {
+ return ld.SliceOf[AnySsvcVulnAssessmentRelationship](v)
+}
+
+func (v RelationshipList) VexAffectedVulnAssessmentRelationships() []AnyVexAffectedVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexAffectedVulnAssessmentRelationship](v)
+}
+
+func (v RelationshipList) VexFixedVulnAssessmentRelationships() []AnyVexFixedVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexFixedVulnAssessmentRelationship](v)
+}
+
+func (v RelationshipList) VexNotAffectedVulnAssessmentRelationships() []AnyVexNotAffectedVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexNotAffectedVulnAssessmentRelationship](v)
+}
+
+func (v RelationshipList) VexUnderInvestigationVulnAssessmentRelationships() []AnyVexUnderInvestigationVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexUnderInvestigationVulnAssessmentRelationship](v)
+}
+
+func (v RelationshipList) VexVulnAssessmentRelationships() []AnyVexVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexVulnAssessmentRelationship](v)
+}
+
+func (v RelationshipList) VulnAssessmentRelationships() []AnyVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVulnAssessmentRelationship](v)
+}
+
+// RelationshipCompleteness Indicates whether a relationship is known to be complete, incomplete, or if no assertion is made with respect to relationship completeness.
+type RelationshipCompleteness struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipCompleteness" node-kind:""`
+ id string `iri:"@id"`
+}
+
+func (o *RelationshipCompleteness) GetID() string {
+ return o.id
+}
+
+// RelationshipCompleteness_Complete The relationship is known to be exhaustive.
+var RelationshipCompleteness_Complete = RelationshipCompleteness{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipCompleteness/complete",
+}
+
+// RelationshipCompleteness_Incomplete The relationship is known not to be exhaustive.
+var RelationshipCompleteness_Incomplete = RelationshipCompleteness{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipCompleteness/incomplete",
+}
+
+// RelationshipCompleteness_NoAssertion No assertion can be made about the completeness of the relationship.
+var RelationshipCompleteness_NoAssertion = RelationshipCompleteness{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipCompleteness/noAssertion",
+}
+
+// RelationshipType Information about the relationship between two Elements.
+type RelationshipType struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType" node-kind:""`
+ id string `iri:"@id"`
+}
+
+func (o *RelationshipType) GetID() string {
+ return o.id
+}
+
+// RelationshipType_Affects The `from` Vulnerability affects each `to` Element. The use of the `affects` type is constrained to `VexAffectedVulnAssessmentRelationship` classed relationships.
+var RelationshipType_Affects = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/affects",
+}
+
+// RelationshipType_AmendedBy The `from` Element is amended by each `to` Element.
+var RelationshipType_AmendedBy = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/amendedBy",
+}
+
+// RelationshipType_AncestorOf The `from` Element is an ancestor of each `to` Element.
+var RelationshipType_AncestorOf = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/ancestorOf",
+}
+
+// RelationshipType_AvailableFrom The `from` Element is available from the additional supplier described by each `to` Element.
+var RelationshipType_AvailableFrom = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/availableFrom",
+}
+
+// RelationshipType_Configures The `from` Element is a configuration applied to each `to` Element, during a LifecycleScopeType period.
+var RelationshipType_Configures = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/configures",
+}
+
+// RelationshipType_Contains The `from` Element contains each `to` Element.
+var RelationshipType_Contains = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/contains",
+}
+
+// RelationshipType_CoordinatedBy The `from` Vulnerability is coordinatedBy the `to` Agent(s) (vendor, researcher, or consumer agent).
+var RelationshipType_CoordinatedBy = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/coordinatedBy",
+}
+
+// RelationshipType_CopiedTo The `from` Element has been copied to each `to` Element.
+var RelationshipType_CopiedTo = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/copiedTo",
+}
+
+// RelationshipType_DelegatedTo The `from` Agent is delegating an action to the Agent of the `to` Relationship (which must be of type invokedBy), during a LifecycleScopeType (e.g. the `to` invokedBy Relationship is being done on behalf of `from`).
+var RelationshipType_DelegatedTo = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/delegatedTo",
+}
+
+// RelationshipType_DependsOn The `from` Element depends on each `to` Element, during a LifecycleScopeType period.
+var RelationshipType_DependsOn = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/dependsOn",
+}
+
+// RelationshipType_DescendantOf The `from` Element is a descendant of each `to` Element.
+var RelationshipType_DescendantOf = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/descendantOf",
+}
+
+// RelationshipType_Describes The `from` Element describes each `to` Element. To denote the root(s) of a tree of elements in a collection, the rootElement property should be used.
+var RelationshipType_Describes = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/describes",
+}
+
+// RelationshipType_DoesNotAffect The `from` Vulnerability has no impact on each `to` Element. The use of the `doesNotAffect` is constrained to `VexNotAffectedVulnAssessmentRelationship` classed relationships.
+var RelationshipType_DoesNotAffect = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/doesNotAffect",
+}
+
+// RelationshipType_ExpandsTo The `from` archive expands out as an artifact described by each `to` Element.
+var RelationshipType_ExpandsTo = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/expandsTo",
+}
+
+// RelationshipType_ExploitCreatedBy The `from` Vulnerability has had an exploit created against it by each `to` Agent.
+var RelationshipType_ExploitCreatedBy = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/exploitCreatedBy",
+}
+
+// RelationshipType_FixedBy Designates a `from` Vulnerability has been fixed by the `to` Agent(s).
+var RelationshipType_FixedBy = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/fixedBy",
+}
+
+// RelationshipType_FixedIn A `from` Vulnerability has been fixed in each `to` Element. The use of the `fixedIn` type is constrained to `VexFixedVulnAssessmentRelationship` classed relationships.
+var RelationshipType_FixedIn = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/fixedIn",
+}
+
+// RelationshipType_FoundBy Designates a `from` Vulnerability was originally discovered by the `to` Agent(s).
+var RelationshipType_FoundBy = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/foundBy",
+}
+
+// RelationshipType_Generates The `from` Element generates each `to` Element.
+var RelationshipType_Generates = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/generates",
+}
+
+// RelationshipType_HasAddedFile Every `to` Element is a file added to the `from` Element (`from` hasAddedFile `to`).
+var RelationshipType_HasAddedFile = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasAddedFile",
+}
+
+// RelationshipType_HasAssessmentFor Relates a `from` Vulnerability and each `to` Element with a security assessment. To be used with `VulnAssessmentRelationship` types.
+var RelationshipType_HasAssessmentFor = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasAssessmentFor",
+}
+
+// RelationshipType_HasAssociatedVulnerability Used to associate a `from` Artifact with each `to` Vulnerability.
+var RelationshipType_HasAssociatedVulnerability = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasAssociatedVulnerability",
+}
+
+// RelationshipType_HasConcludedLicense The `from` SoftwareArtifact is concluded by the SPDX data creator to be governed by each `to` license.
+var RelationshipType_HasConcludedLicense = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasConcludedLicense",
+}
+
+// RelationshipType_HasDataFile The `from` Element treats each `to` Element as a data file. A data file is an artifact that stores data required or optional for the `from` Element's functionality. A data file can be a database file, an index file, a log file, an AI model file, a calibration data file, a temporary file, a backup file, and more. For AI training dataset, test dataset, test artifact, configuration data, build input data, and build output data, please consider using the more specific relationship types: `trainedOn`, `testedOn`, `hasTest`, `configures`, `hasInput`, and `hasOutput`, respectively. This relationship does not imply dependency.
+var RelationshipType_HasDataFile = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasDataFile",
+}
+
+// RelationshipType_HasDeclaredLicense The `from` SoftwareArtifact was discovered to actually contain each `to` license, for example as detected by use of automated tooling.
+var RelationshipType_HasDeclaredLicense = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasDeclaredLicense",
+}
+
+// RelationshipType_HasDeletedFile Every `to` Element is a file deleted from the `from` Element (`from` hasDeletedFile `to`).
+var RelationshipType_HasDeletedFile = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasDeletedFile",
+}
+
+// RelationshipType_HasDependencyManifest The `from` Element has manifest files that contain dependency information in each `to` Element.
+var RelationshipType_HasDependencyManifest = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasDependencyManifest",
+}
+
+// RelationshipType_HasDistributionArtifact The `from` Element is distributed as an artifact in each `to` Element (e.g. an RPM or archive file).
+var RelationshipType_HasDistributionArtifact = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasDistributionArtifact",
+}
+
+// RelationshipType_HasDocumentation The `from` Element is documented by each `to` Element.
+var RelationshipType_HasDocumentation = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasDocumentation",
+}
+
+// RelationshipType_HasDynamicLink The `from` Element dynamically links in each `to` Element, during a LifecycleScopeType period.
+var RelationshipType_HasDynamicLink = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasDynamicLink",
+}
+
+// RelationshipType_HasEvidence Every `to` Element is considered as evidence for the `from` Element (`from` hasEvidence `to`).
+var RelationshipType_HasEvidence = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasEvidence",
+}
+
+// RelationshipType_HasExample Every `to` Element is an example for the `from` Element (`from` hasExample `to`).
+var RelationshipType_HasExample = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasExample",
+}
+
+// RelationshipType_HasHost The `from` Build was run on the `to` Element during a LifecycleScopeType period (e.g. the host that the build runs on).
+var RelationshipType_HasHost = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasHost",
+}
+
+// RelationshipType_HasInput The `from` Build has each `to` Element as an input, during a LifecycleScopeType period.
+var RelationshipType_HasInput = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasInput",
+}
+
+// RelationshipType_HasMetadata Every `to` Element is metadata about the `from` Element (`from` hasMetadata `to`).
+var RelationshipType_HasMetadata = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasMetadata",
+}
+
+// RelationshipType_HasOptionalComponent Every `to` Element is an optional component of the `from` Element (`from` hasOptionalComponent `to`).
+var RelationshipType_HasOptionalComponent = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasOptionalComponent",
+}
+
+// RelationshipType_HasOptionalDependency The `from` Element optionally depends on each `to` Element, during a LifecycleScopeType period.
+var RelationshipType_HasOptionalDependency = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasOptionalDependency",
+}
+
+// RelationshipType_HasOutput The `from` Build element generates each `to` Element as an output, during a LifecycleScopeType period.
+var RelationshipType_HasOutput = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasOutput",
+}
+
+// RelationshipType_HasPrerequisite The `from` Element has a prerequisite on each `to` Element, during a LifecycleScopeType period.
+var RelationshipType_HasPrerequisite = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasPrerequisite",
+}
+
+// RelationshipType_HasProvidedDependency The `from` Element has a dependency on each `to` Element, dependency is not in the distributed artifact, but assumed to be provided, during a LifecycleScopeType period.
+var RelationshipType_HasProvidedDependency = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasProvidedDependency",
+}
+
+// RelationshipType_HasRequirement The `from` Element has a requirement on each `to` Element, during a LifecycleScopeType period.
+var RelationshipType_HasRequirement = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasRequirement",
+}
+
+// RelationshipType_HasSpecification Every `to` Element is a specification for the `from` Element (`from` hasSpecification `to`), during a LifecycleScopeType period.
+var RelationshipType_HasSpecification = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasSpecification",
+}
+
+// RelationshipType_HasStaticLink The `from` Element statically links in each `to` Element, during a LifecycleScopeType period.
+var RelationshipType_HasStaticLink = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasStaticLink",
+}
+
+// RelationshipType_HasTest Every `to` Element is a test artifact for the `from` Element (`from` hasTest `to`), during a LifecycleScopeType period.
+var RelationshipType_HasTest = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasTest",
+}
+
+// RelationshipType_HasTestCase Every `to` Element is a test case for the `from` Element (`from` hasTestCase `to`).
+var RelationshipType_HasTestCase = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasTestCase",
+}
+
+// RelationshipType_HasVariant Every `to` Element is a variant the `from` Element (`from` hasVariant `to`).
+var RelationshipType_HasVariant = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/hasVariant",
+}
+
+// RelationshipType_InvokedBy The `from` Element was invoked by the `to` Agent, during a LifecycleScopeType period (for example, a Build element that describes a build step).
+var RelationshipType_InvokedBy = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/invokedBy",
+}
+
+// RelationshipType_ModifiedBy The `from` Element is modified by each `to` Element.
+var RelationshipType_ModifiedBy = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/modifiedBy",
+}
+
+// RelationshipType_Other Every `to` Element is related to the `from` Element where the relationship type is not described by any of the SPDX relationship types (this relationship is directionless).
+var RelationshipType_Other = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/other",
+}
+
+// RelationshipType_PackagedBy Every `to` Element is a packaged instance of the `from` Element (`from` packagedBy `to`).
+var RelationshipType_PackagedBy = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/packagedBy",
+}
+
+// RelationshipType_PatchedBy Every `to` Element is a patch for the `from` Element (`from` patchedBy `to`).
+var RelationshipType_PatchedBy = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/patchedBy",
+}
+
+// RelationshipType_PublishedBy Designates a `from` Vulnerability was made available for public use or reference by each `to` Agent.
+var RelationshipType_PublishedBy = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/publishedBy",
+}
+
+// RelationshipType_ReportedBy Designates a `from` Vulnerability was first reported to a project, vendor, or tracking database for formal identification by each `to` Agent.
+var RelationshipType_ReportedBy = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/reportedBy",
+}
+
+// RelationshipType_RepublishedBy Designates a `from` Vulnerability's details were tracked, aggregated, and/or enriched to improve context (i.e. NVD) by each `to` Agent.
+var RelationshipType_RepublishedBy = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/republishedBy",
+}
+
+// RelationshipType_SerializedInArtifact The `from` SpdxDocument can be found in a serialized form in each `to` Artifact.
+var RelationshipType_SerializedInArtifact = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/serializedInArtifact",
+}
+
+// RelationshipType_TestedOn The `from` Element has been tested on the `to` Element(s).
+var RelationshipType_TestedOn = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/testedOn",
+}
+
+// RelationshipType_TrainedOn The `from` Element has been trained on the `to` Element(s).
+var RelationshipType_TrainedOn = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/trainedOn",
+}
+
+// RelationshipType_UnderInvestigationFor The `from` Vulnerability impact is being investigated for each `to` Element. The use of the `underInvestigationFor` type is constrained to `VexUnderInvestigationVulnAssessmentRelationship` classed relationships.
+var RelationshipType_UnderInvestigationFor = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/underInvestigationFor",
+}
+
+// RelationshipType_UsesTool The `from` Element uses each `to` Element as a tool, during a LifecycleScopeType period.
+var RelationshipType_UsesTool = RelationshipType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/usesTool",
+}
+
+type AnySBOM interface {
+ AnyBOM
+ asSBOM()
+ GetSbomTypes() []SbomType
+ SetSbomTypes([]SbomType)
+}
+
+// SBOM A collection of SPDX Elements describing a single package.
+type SBOM struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Software/Sbom" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // Elements Refers to one or more Elements that are part of an ElementCollection.
+ Elements ElementList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/element" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // RootElements This property is used to denote the root Element(s) of a tree of elements contained in a BOM.
+ RootElements ElementList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/rootElement" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // ProfileConformances Describes one a profile which the creator of this ElementCollection intends to conform to.
+ ProfileConformances []ProfileIdentifierType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/profileConformance" type:"https://spdx.org/rdf/3.0.1/terms/Core/ProfileIdentifierType"`
+ // Context Gives information about the circumstances or unifying properties that Elements of the bundle have been assembled under.
+ Context string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/context" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // SbomTypes Provides information about the type of an SBOM.
+ SbomTypes []SbomType `iri:"https://spdx.org/rdf/3.0.1/terms/Software/sbomType" type:"https://spdx.org/rdf/3.0.1/terms/Software/SbomType"`
+}
+
+func (o *SBOM) asSBOM() {}
+func (o *SBOM) asBOM() {}
+func (o *SBOM) asBundle() {}
+func (o *SBOM) asElementCollection() {}
+func (o *SBOM) asElement() {}
+func (o *SBOM) GetID() string {
+ return o.ID
+}
+
+func (o *SBOM) SetID(v string) {
+ o.ID = v
+}
+
+func (o *SBOM) GetDescription() string {
+ return o.Description
+}
+
+func (o *SBOM) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *SBOM) GetComment() string {
+ return o.Comment
+}
+
+func (o *SBOM) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *SBOM) GetName() string {
+ return o.Name
+}
+
+func (o *SBOM) SetName(v string) {
+ o.Name = v
+}
+
+func (o *SBOM) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *SBOM) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *SBOM) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *SBOM) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *SBOM) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *SBOM) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *SBOM) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *SBOM) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *SBOM) GetSummary() string {
+ return o.Summary
+}
+
+func (o *SBOM) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *SBOM) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *SBOM) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *SBOM) GetElements() ElementList {
+ return o.Elements
+}
+
+func (o *SBOM) SetElements(v ElementList) {
+ o.Elements = v
+}
+
+func (o *SBOM) GetRootElements() ElementList {
+ return o.RootElements
+}
+
+func (o *SBOM) SetRootElements(v ElementList) {
+ o.RootElements = v
+}
+
+func (o *SBOM) GetProfileConformances() []ProfileIdentifierType {
+ return o.ProfileConformances
+}
+
+func (o *SBOM) SetProfileConformances(v []ProfileIdentifierType) {
+ o.ProfileConformances = v
+}
+
+func (o *SBOM) GetContext() string {
+ return o.Context
+}
+
+func (o *SBOM) SetContext(v string) {
+ o.Context = v
+}
+
+func (o *SBOM) GetSbomTypes() []SbomType {
+ return o.SbomTypes
+}
+
+func (o *SBOM) SetSbomTypes(v []SbomType) {
+ o.SbomTypes = v
+}
+
+type SBOMList []AnySBOM
+
+func (v SBOMList) SBOMs() []AnySBOM {
+ return ld.SliceOf[AnySBOM](v)
+}
+
+// SafetyRiskAssessmentType Specifies the safety risk level.
+type SafetyRiskAssessmentType struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/AI/SafetyRiskAssessmentType" node-kind:""`
+ id string `iri:"@id"`
+}
+
+func (o *SafetyRiskAssessmentType) GetID() string {
+ return o.id
+}
+
+// SafetyRiskAssessmentType_High The second-highest level of risk posed by an AI system.
+var SafetyRiskAssessmentType_High = SafetyRiskAssessmentType{
+ id: "https://spdx.org/rdf/3.0.1/terms/AI/SafetyRiskAssessmentType/high",
+}
+
+// SafetyRiskAssessmentType_Low Low/no risk is posed by an AI system.
+var SafetyRiskAssessmentType_Low = SafetyRiskAssessmentType{
+ id: "https://spdx.org/rdf/3.0.1/terms/AI/SafetyRiskAssessmentType/low",
+}
+
+// SafetyRiskAssessmentType_Medium The third-highest level of risk posed by an AI system.
+var SafetyRiskAssessmentType_Medium = SafetyRiskAssessmentType{
+ id: "https://spdx.org/rdf/3.0.1/terms/AI/SafetyRiskAssessmentType/medium",
+}
+
+// SafetyRiskAssessmentType_Serious The highest level of risk posed by an AI system.
+var SafetyRiskAssessmentType_Serious = SafetyRiskAssessmentType{
+ id: "https://spdx.org/rdf/3.0.1/terms/AI/SafetyRiskAssessmentType/serious",
+}
+
+// SbomType Provides a set of values to be used to describe the common types of SBOMs that tools may create.
+type SbomType struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Software/SbomType" node-kind:""`
+ id string `iri:"@id"`
+}
+
+func (o *SbomType) GetID() string {
+ return o.id
+}
+
+// SbomType_Analyzed SBOM generated through analysis of artifacts (e.g., executables, packages, containers, and virtual machine images) after its build. Such analysis generally requires a variety of heuristics. In some contexts, this may also be referred to as a \"3rd party\" SBOM.
+var SbomType_Analyzed = SbomType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SbomType/analyzed",
+}
+
+// SbomType_Build SBOM generated as part of the process of building the software to create a releasable artifact (e.g., executable or package) from data such as source files, dependencies, built components, build process ephemeral data, and other SBOMs.
+var SbomType_Build = SbomType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SbomType/build",
+}
+
+// SbomType_Deployed SBOM provides an inventory of software that is present on a system. This may be an assembly of other SBOMs that combines analysis of configuration options, and examination of execution behavior in a (potentially simulated) deployment environment.
+var SbomType_Deployed = SbomType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SbomType/deployed",
+}
+
+// SbomType_Design SBOM of intended, planned software project or product with included components (some of which may not yet exist) for a new software artifact.
+var SbomType_Design = SbomType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SbomType/design",
+}
+
+// SbomType_Runtime SBOM generated through instrumenting the system running the software, to capture only components present in the system, as well as external call-outs or dynamically loaded components. In some contexts, this may also be referred to as an \"Instrumented\" or \"Dynamic\" SBOM.
+var SbomType_Runtime = SbomType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SbomType/runtime",
+}
+
+// SbomType_Source SBOM created directly from the development environment, source files, and included dependencies used to build an product artifact.
+var SbomType_Source = SbomType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SbomType/source",
+}
+
+type AnySimpleLicensingText interface {
+ AnyElement
+ asSimpleLicensingText()
+ GetLicenseText() string
+ SetLicenseText(string)
+}
+
+// SimpleLicensingText A license or addition that is not listed on the SPDX License List.
+type SimpleLicensingText struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/SimpleLicensing/SimpleLicensingText" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // LicenseText Identifies the full text of a License or Addition.
+ LicenseText string `iri:"https://spdx.org/rdf/3.0.1/terms/SimpleLicensing/licenseText" required:"true" type:"http://www.w3.org/2001/XMLSchema#string"`
+}
+
+func (o *SimpleLicensingText) asSimpleLicensingText() {}
+func (o *SimpleLicensingText) asElement() {}
+func (o *SimpleLicensingText) GetID() string {
+ return o.ID
+}
+
+func (o *SimpleLicensingText) SetID(v string) {
+ o.ID = v
+}
+
+func (o *SimpleLicensingText) GetDescription() string {
+ return o.Description
+}
+
+func (o *SimpleLicensingText) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *SimpleLicensingText) GetComment() string {
+ return o.Comment
+}
+
+func (o *SimpleLicensingText) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *SimpleLicensingText) GetName() string {
+ return o.Name
+}
+
+func (o *SimpleLicensingText) SetName(v string) {
+ o.Name = v
+}
+
+func (o *SimpleLicensingText) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *SimpleLicensingText) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *SimpleLicensingText) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *SimpleLicensingText) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *SimpleLicensingText) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *SimpleLicensingText) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *SimpleLicensingText) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *SimpleLicensingText) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *SimpleLicensingText) GetSummary() string {
+ return o.Summary
+}
+
+func (o *SimpleLicensingText) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *SimpleLicensingText) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *SimpleLicensingText) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *SimpleLicensingText) GetLicenseText() string {
+ return o.LicenseText
+}
+
+func (o *SimpleLicensingText) SetLicenseText(v string) {
+ o.LicenseText = v
+}
+
+type SimpleLicensingTextList []AnySimpleLicensingText
+
+func (v SimpleLicensingTextList) SimpleLicensingTexts() []AnySimpleLicensingText {
+ return ld.SliceOf[AnySimpleLicensingText](v)
+}
+
+type AnySnippet interface {
+ AnySoftwareArtifact
+ asSnippet()
+ GetFromFile() AnyFile
+ SetFromFile(AnyFile)
+ GetLineRange() AnyPositiveIntegerRange
+ SetLineRange(AnyPositiveIntegerRange)
+ GetByteRange() AnyPositiveIntegerRange
+ SetByteRange(AnyPositiveIntegerRange)
+}
+
+// Snippet Describes a certain part of a file.
+type Snippet struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Software/Snippet" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // StandardNames The name of a relevant standard that may apply to an artifact.
+ StandardNames []string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/standardName" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // BuiltTime Specifies the time an artifact was built.
+ BuiltTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/builtTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ReleaseTime Specifies the time an artifact was released.
+ ReleaseTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/releaseTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // SupportLevels Specifies the level of support associated with an artifact.
+ SupportLevels []SupportType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/supportLevel" type:"https://spdx.org/rdf/3.0.1/terms/Core/SupportType"`
+ // SuppliedBy Identifies who or what supplied the artifact or VulnAssessmentRelationship referenced by the Element.
+ SuppliedBy AnyAgent `iri:"https://spdx.org/rdf/3.0.1/terms/Core/suppliedBy" type:"https://spdx.org/rdf/3.0.1/terms/Core/Agent"`
+ // OriginatedBy Identifies from where or whom the Element originally came.
+ OriginatedBy AgentList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/originatedBy" type:"https://spdx.org/rdf/3.0.1/terms/Core/Agent"`
+ // ValidUntilTime Specifies until when the artifact can be used before its usage needs to be reassessed.
+ ValidUntilTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/validUntilTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ContentIdentifiers A canonical, unique, immutable identifier of the artifact content, that may be used for verifying its identity and/or integrity.
+ ContentIdentifiers ContentIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Software/contentIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Software/ContentIdentifier"`
+ // AttributionTexts Provides a place for the SPDX data creator to record acknowledgement text for a software Package, File or Snippet.
+ AttributionTexts []string `iri:"https://spdx.org/rdf/3.0.1/terms/Software/attributionText" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // AdditionalPurposes Provides additional purpose information of the software artifact.
+ AdditionalPurposes []SoftwarePurpose `iri:"https://spdx.org/rdf/3.0.1/terms/Software/additionalPurpose" type:"https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose"`
+ // PrimaryPurpose Provides information about the primary purpose of the software artifact.
+ PrimaryPurpose SoftwarePurpose `iri:"https://spdx.org/rdf/3.0.1/terms/Software/primaryPurpose" type:"https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose"`
+ // CopyrightText Identifies the text of one or more copyright notices for a software Package, File or Snippet, if any.
+ CopyrightText string `iri:"https://spdx.org/rdf/3.0.1/terms/Software/copyrightText" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // FromFile Defines the original host file that the snippet information applies to.
+ FromFile AnyFile `iri:"https://spdx.org/rdf/3.0.1/terms/Software/snippetFromFile" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Software/File"`
+ // LineRange Defines the line range in the original host file that the snippet information applies to.
+ LineRange AnyPositiveIntegerRange `iri:"https://spdx.org/rdf/3.0.1/terms/Software/lineRange" type:"https://spdx.org/rdf/3.0.1/terms/Core/PositiveIntegerRange"`
+ // ByteRange Defines the byte range in the original host file that the snippet information applies to.
+ ByteRange AnyPositiveIntegerRange `iri:"https://spdx.org/rdf/3.0.1/terms/Software/byteRange" type:"https://spdx.org/rdf/3.0.1/terms/Core/PositiveIntegerRange"`
+}
+
+func (o *Snippet) asSnippet() {}
+func (o *Snippet) asSoftwareArtifact() {}
+func (o *Snippet) asArtifact() {}
+func (o *Snippet) asElement() {}
+func (o *Snippet) GetID() string {
+ return o.ID
+}
+
+func (o *Snippet) SetID(v string) {
+ o.ID = v
+}
+
+func (o *Snippet) GetDescription() string {
+ return o.Description
+}
+
+func (o *Snippet) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *Snippet) GetComment() string {
+ return o.Comment
+}
+
+func (o *Snippet) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *Snippet) GetName() string {
+ return o.Name
+}
+
+func (o *Snippet) SetName(v string) {
+ o.Name = v
+}
+
+func (o *Snippet) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *Snippet) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *Snippet) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *Snippet) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *Snippet) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *Snippet) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *Snippet) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *Snippet) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *Snippet) GetSummary() string {
+ return o.Summary
+}
+
+func (o *Snippet) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *Snippet) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *Snippet) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *Snippet) GetStandardNames() []string {
+ return o.StandardNames
+}
+
+func (o *Snippet) SetStandardNames(v []string) {
+ o.StandardNames = v
+}
+
+func (o *Snippet) GetBuiltTime() time.Time {
+ return o.BuiltTime
+}
+
+func (o *Snippet) SetBuiltTime(v time.Time) {
+ o.BuiltTime = v
+}
+
+func (o *Snippet) GetReleaseTime() time.Time {
+ return o.ReleaseTime
+}
+
+func (o *Snippet) SetReleaseTime(v time.Time) {
+ o.ReleaseTime = v
+}
+
+func (o *Snippet) GetSupportLevels() []SupportType {
+ return o.SupportLevels
+}
+
+func (o *Snippet) SetSupportLevels(v []SupportType) {
+ o.SupportLevels = v
+}
+
+func (o *Snippet) GetSuppliedBy() AnyAgent {
+ return o.SuppliedBy
+}
+
+func (o *Snippet) SetSuppliedBy(v AnyAgent) {
+ o.SuppliedBy = v
+}
+
+func (o *Snippet) GetOriginatedBy() AgentList {
+ return o.OriginatedBy
+}
+
+func (o *Snippet) SetOriginatedBy(v AgentList) {
+ o.OriginatedBy = v
+}
+
+func (o *Snippet) GetValidUntilTime() time.Time {
+ return o.ValidUntilTime
+}
+
+func (o *Snippet) SetValidUntilTime(v time.Time) {
+ o.ValidUntilTime = v
+}
+
+func (o *Snippet) GetContentIdentifiers() ContentIdentifierList {
+ return o.ContentIdentifiers
+}
+
+func (o *Snippet) SetContentIdentifiers(v ContentIdentifierList) {
+ o.ContentIdentifiers = v
+}
+
+func (o *Snippet) GetAttributionTexts() []string {
+ return o.AttributionTexts
+}
+
+func (o *Snippet) SetAttributionTexts(v []string) {
+ o.AttributionTexts = v
+}
+
+func (o *Snippet) GetAdditionalPurposes() []SoftwarePurpose {
+ return o.AdditionalPurposes
+}
+
+func (o *Snippet) SetAdditionalPurposes(v []SoftwarePurpose) {
+ o.AdditionalPurposes = v
+}
+
+func (o *Snippet) GetPrimaryPurpose() SoftwarePurpose {
+ return o.PrimaryPurpose
+}
+
+func (o *Snippet) SetPrimaryPurpose(v SoftwarePurpose) {
+ o.PrimaryPurpose = v
+}
+
+func (o *Snippet) GetCopyrightText() string {
+ return o.CopyrightText
+}
+
+func (o *Snippet) SetCopyrightText(v string) {
+ o.CopyrightText = v
+}
+
+func (o *Snippet) GetFromFile() AnyFile {
+ return o.FromFile
+}
+
+func (o *Snippet) SetFromFile(v AnyFile) {
+ o.FromFile = v
+}
+
+func (o *Snippet) GetLineRange() AnyPositiveIntegerRange {
+ return o.LineRange
+}
+
+func (o *Snippet) SetLineRange(v AnyPositiveIntegerRange) {
+ o.LineRange = v
+}
+
+func (o *Snippet) GetByteRange() AnyPositiveIntegerRange {
+ return o.ByteRange
+}
+
+func (o *Snippet) SetByteRange(v AnyPositiveIntegerRange) {
+ o.ByteRange = v
+}
+
+type SnippetList []AnySnippet
+
+func (v SnippetList) Snippets() []AnySnippet {
+ return ld.SliceOf[AnySnippet](v)
+}
+
+type AnySoftwareAgent interface {
+ AnyAgent
+ asSoftwareAgent()
+}
+
+// SoftwareAgent A software agent.
+type SoftwareAgent struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/SoftwareAgent" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+}
+
+func (o *SoftwareAgent) asSoftwareAgent() {}
+func (o *SoftwareAgent) asAgent() {}
+func (o *SoftwareAgent) asElement() {}
+func (o *SoftwareAgent) GetID() string {
+ return o.ID
+}
+
+func (o *SoftwareAgent) SetID(v string) {
+ o.ID = v
+}
+
+func (o *SoftwareAgent) GetDescription() string {
+ return o.Description
+}
+
+func (o *SoftwareAgent) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *SoftwareAgent) GetComment() string {
+ return o.Comment
+}
+
+func (o *SoftwareAgent) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *SoftwareAgent) GetName() string {
+ return o.Name
+}
+
+func (o *SoftwareAgent) SetName(v string) {
+ o.Name = v
+}
+
+func (o *SoftwareAgent) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *SoftwareAgent) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *SoftwareAgent) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *SoftwareAgent) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *SoftwareAgent) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *SoftwareAgent) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *SoftwareAgent) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *SoftwareAgent) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *SoftwareAgent) GetSummary() string {
+ return o.Summary
+}
+
+func (o *SoftwareAgent) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *SoftwareAgent) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *SoftwareAgent) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+type SoftwareAgentList []AnySoftwareAgent
+
+func (v SoftwareAgentList) SoftwareAgents() []AnySoftwareAgent {
+ return ld.SliceOf[AnySoftwareAgent](v)
+}
+
+type AnySoftwareArtifact interface {
+ AnyArtifact
+ asSoftwareArtifact()
+ GetContentIdentifiers() ContentIdentifierList
+ SetContentIdentifiers(ContentIdentifierList)
+ GetAttributionTexts() []string
+ SetAttributionTexts([]string)
+ GetAdditionalPurposes() []SoftwarePurpose
+ SetAdditionalPurposes([]SoftwarePurpose)
+ GetPrimaryPurpose() SoftwarePurpose
+ SetPrimaryPurpose(SoftwarePurpose)
+ GetCopyrightText() string
+ SetCopyrightText(string)
+}
+
+// SoftwareArtifact A distinct article or unit related to Software.
+type SoftwareArtifactList []AnySoftwareArtifact
+
+func (v SoftwareArtifactList) AIPackages() []AnyAIPackage {
+ return ld.SliceOf[AnyAIPackage](v)
+}
+
+func (v SoftwareArtifactList) DatasetPackages() []AnyDatasetPackage {
+ return ld.SliceOf[AnyDatasetPackage](v)
+}
+
+func (v SoftwareArtifactList) Files() []AnyFile {
+ return ld.SliceOf[AnyFile](v)
+}
+
+func (v SoftwareArtifactList) Packages() []AnyPackage {
+ return ld.SliceOf[AnyPackage](v)
+}
+
+func (v SoftwareArtifactList) Snippets() []AnySnippet {
+ return ld.SliceOf[AnySnippet](v)
+}
+
+func (v SoftwareArtifactList) SoftwareArtifacts() []AnySoftwareArtifact {
+ return ld.SliceOf[AnySoftwareArtifact](v)
+}
+
+// SoftwarePurpose Provides information about the primary purpose of an Element.
+type SoftwarePurpose struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose" node-kind:""`
+ id string `iri:"@id"`
+}
+
+func (o *SoftwarePurpose) GetID() string {
+ return o.id
+}
+
+// SoftwarePurpose_Application The Element is a software application.
+var SoftwarePurpose_Application = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/application",
+}
+
+// SoftwarePurpose_Archive The Element is an archived collection of one or more files (.tar, .zip, etc.).
+var SoftwarePurpose_Archive = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/archive",
+}
+
+// SoftwarePurpose_Bom The Element is a bill of materials.
+var SoftwarePurpose_Bom = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/bom",
+}
+
+// SoftwarePurpose_Configuration The Element is configuration data.
+var SoftwarePurpose_Configuration = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/configuration",
+}
+
+// SoftwarePurpose_Container The Element is a container image which can be used by a container runtime application.
+var SoftwarePurpose_Container = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/container",
+}
+
+// SoftwarePurpose_Data The Element is data.
+var SoftwarePurpose_Data = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/data",
+}
+
+// SoftwarePurpose_Device The Element refers to a chipset, processor, or electronic board.
+var SoftwarePurpose_Device = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/device",
+}
+
+// SoftwarePurpose_DeviceDriver The Element represents software that controls hardware devices.
+var SoftwarePurpose_DeviceDriver = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/deviceDriver",
+}
+
+// SoftwarePurpose_DiskImage The Element refers to a disk image that can be written to a disk, booted in a VM, etc. A disk image typically contains most or all of the components necessary to boot, such as bootloaders, kernels, firmware, userspace, etc.
+var SoftwarePurpose_DiskImage = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/diskImage",
+}
+
+// SoftwarePurpose_Documentation The Element is documentation.
+var SoftwarePurpose_Documentation = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/documentation",
+}
+
+// SoftwarePurpose_Evidence The Element is the evidence that a specification or requirement has been fulfilled.
+var SoftwarePurpose_Evidence = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/evidence",
+}
+
+// SoftwarePurpose_Executable The Element is an Artifact that can be run on a computer.
+var SoftwarePurpose_Executable = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/executable",
+}
+
+// SoftwarePurpose_File The Element is a single file which can be independently distributed (configuration file, statically linked binary, Kubernetes deployment, etc.).
+var SoftwarePurpose_File = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/file",
+}
+
+// SoftwarePurpose_FilesystemImage The Element is a file system image that can be written to a disk (or virtual) partition.
+var SoftwarePurpose_FilesystemImage = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/filesystemImage",
+}
+
+// SoftwarePurpose_Firmware The Element provides low level control over a device's hardware.
+var SoftwarePurpose_Firmware = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/firmware",
+}
+
+// SoftwarePurpose_Framework The Element is a software framework.
+var SoftwarePurpose_Framework = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/framework",
+}
+
+// SoftwarePurpose_Install The Element is used to install software on disk.
+var SoftwarePurpose_Install = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/install",
+}
+
+// SoftwarePurpose_Library The Element is a software library.
+var SoftwarePurpose_Library = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/library",
+}
+
+// SoftwarePurpose_Manifest The Element is a software manifest.
+var SoftwarePurpose_Manifest = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/manifest",
+}
+
+// SoftwarePurpose_Model The Element is a machine learning or artificial intelligence model.
+var SoftwarePurpose_Model = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/model",
+}
+
+// SoftwarePurpose_Module The Element is a module of a piece of software.
+var SoftwarePurpose_Module = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/module",
+}
+
+// SoftwarePurpose_OperatingSystem The Element is an operating system.
+var SoftwarePurpose_OperatingSystem = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/operatingSystem",
+}
+
+// SoftwarePurpose_Other The Element doesn't fit into any of the other categories.
+var SoftwarePurpose_Other = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/other",
+}
+
+// SoftwarePurpose_Patch The Element contains a set of changes to update, fix, or improve another Element.
+var SoftwarePurpose_Patch = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/patch",
+}
+
+// SoftwarePurpose_Platform The Element represents a runtime environment.
+var SoftwarePurpose_Platform = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/platform",
+}
+
+// SoftwarePurpose_Requirement The Element provides a requirement needed as input for another Element.
+var SoftwarePurpose_Requirement = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/requirement",
+}
+
+// SoftwarePurpose_Source The Element is a single or a collection of source files.
+var SoftwarePurpose_Source = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/source",
+}
+
+// SoftwarePurpose_Specification The Element is a plan, guideline or strategy how to create, perform or analyze an application.
+var SoftwarePurpose_Specification = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/specification",
+}
+
+// SoftwarePurpose_Test The Element is a test used to verify functionality on an software element.
+var SoftwarePurpose_Test = SoftwarePurpose{
+ id: "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/test",
+}
+
+type AnySpdxDocument interface {
+ AnyElementCollection
+ asSpdxDocument()
+ GetDataLicense() AnyLicenseInfo
+ SetDataLicense(AnyLicenseInfo)
+ GetNamespaceMaps() NamespaceMapList
+ SetNamespaceMaps(NamespaceMapList)
+ GetImports() ExternalMapList
+ SetImports(ExternalMapList)
+}
+
+// SpdxDocument A collection of SPDX Elements that could potentially be serialized.
+type SpdxDocument struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/SpdxDocument" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // Elements Refers to one or more Elements that are part of an ElementCollection.
+ Elements ElementList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/element" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // RootElements This property is used to denote the root Element(s) of a tree of elements contained in a BOM.
+ RootElements ElementList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/rootElement" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // ProfileConformances Describes one a profile which the creator of this ElementCollection intends to conform to.
+ ProfileConformances []ProfileIdentifierType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/profileConformance" type:"https://spdx.org/rdf/3.0.1/terms/Core/ProfileIdentifierType"`
+ // DataLicense Provides the license under which the SPDX documentation of the Element can be used.
+ DataLicense AnyLicenseInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/dataLicense" type:"https://spdx.org/rdf/3.0.1/terms/SimpleLicensing/AnyLicenseInfo"`
+ // NamespaceMaps Provides a NamespaceMap of prefixes and associated namespace partial URIs applicable to an SpdxDocument and independent of any specific serialization format or instance.
+ NamespaceMaps NamespaceMapList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/namespaceMap" type:"https://spdx.org/rdf/3.0.1/terms/Core/NamespaceMap"`
+ // Imports Provides an ExternalMap of Element identifiers.
+ Imports ExternalMapList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/import" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalMap"`
+}
+
+func (o *SpdxDocument) asSpdxDocument() {}
+func (o *SpdxDocument) asElementCollection() {}
+func (o *SpdxDocument) asElement() {}
+func (o *SpdxDocument) GetID() string {
+ return o.ID
+}
+
+func (o *SpdxDocument) SetID(v string) {
+ o.ID = v
+}
+
+func (o *SpdxDocument) GetDescription() string {
+ return o.Description
+}
+
+func (o *SpdxDocument) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *SpdxDocument) GetComment() string {
+ return o.Comment
+}
+
+func (o *SpdxDocument) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *SpdxDocument) GetName() string {
+ return o.Name
+}
+
+func (o *SpdxDocument) SetName(v string) {
+ o.Name = v
+}
+
+func (o *SpdxDocument) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *SpdxDocument) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *SpdxDocument) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *SpdxDocument) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *SpdxDocument) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *SpdxDocument) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *SpdxDocument) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *SpdxDocument) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *SpdxDocument) GetSummary() string {
+ return o.Summary
+}
+
+func (o *SpdxDocument) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *SpdxDocument) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *SpdxDocument) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *SpdxDocument) GetElements() ElementList {
+ return o.Elements
+}
+
+func (o *SpdxDocument) SetElements(v ElementList) {
+ o.Elements = v
+}
+
+func (o *SpdxDocument) GetRootElements() ElementList {
+ return o.RootElements
+}
+
+func (o *SpdxDocument) SetRootElements(v ElementList) {
+ o.RootElements = v
+}
+
+func (o *SpdxDocument) GetProfileConformances() []ProfileIdentifierType {
+ return o.ProfileConformances
+}
+
+func (o *SpdxDocument) SetProfileConformances(v []ProfileIdentifierType) {
+ o.ProfileConformances = v
+}
+
+func (o *SpdxDocument) GetDataLicense() AnyLicenseInfo {
+ return o.DataLicense
+}
+
+func (o *SpdxDocument) SetDataLicense(v AnyLicenseInfo) {
+ o.DataLicense = v
+}
+
+func (o *SpdxDocument) GetNamespaceMaps() NamespaceMapList {
+ return o.NamespaceMaps
+}
+
+func (o *SpdxDocument) SetNamespaceMaps(v NamespaceMapList) {
+ o.NamespaceMaps = v
+}
+
+func (o *SpdxDocument) GetImports() ExternalMapList {
+ return o.Imports
+}
+
+func (o *SpdxDocument) SetImports(v ExternalMapList) {
+ o.Imports = v
+}
+
+type SpdxDocumentList []AnySpdxDocument
+
+func (v SpdxDocumentList) SpdxDocuments() []AnySpdxDocument {
+ return ld.SliceOf[AnySpdxDocument](v)
+}
+
+// SsvcDecisionType Specifies the SSVC decision type.
+type SsvcDecisionType struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Security/SsvcDecisionType" node-kind:""`
+ id string `iri:"@id"`
+}
+
+func (o *SsvcDecisionType) GetID() string {
+ return o.id
+}
+
+// SsvcDecisionType_Act The vulnerability requires attention from the organization's internal, supervisory-level and leadership-level individuals. Necessary actions include requesting assistance or information about the vulnerability, as well as publishing a notification either internally and/or externally. Typically, internal groups would meet to determine the overall response and then execute agreed upon actions. CISA recommends remediating Act vulnerabilities as soon as possible.
+var SsvcDecisionType_Act = SsvcDecisionType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Security/SsvcDecisionType/act",
+}
+
+// SsvcDecisionType_Attend The vulnerability requires attention from the organization's internal, supervisory-level individuals. Necessary actions include requesting assistance or information about the vulnerability, and may involve publishing a notification either internally and/or externally. CISA recommends remediating Attend vulnerabilities sooner than standard update timelines.
+var SsvcDecisionType_Attend = SsvcDecisionType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Security/SsvcDecisionType/attend",
+}
+
+// SsvcDecisionType_Track The vulnerability does not require action at this time. The organization would continue to track the vulnerability and reassess it if new information becomes available. CISA recommends remediating Track vulnerabilities within standard update timelines.
+var SsvcDecisionType_Track = SsvcDecisionType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Security/SsvcDecisionType/track",
+}
+
+// SsvcDecisionType_TrackStar (\"Track\\*\" in the SSVC spec) The vulnerability contains specific characteristics that may require closer monitoring for changes. CISA recommends remediating Track\\* vulnerabilities within standard update timelines.
+var SsvcDecisionType_TrackStar = SsvcDecisionType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Security/SsvcDecisionType/trackStar",
+}
+
+type AnySsvcVulnAssessmentRelationship interface {
+ AnyVulnAssessmentRelationship
+ asSsvcVulnAssessmentRelationship()
+ GetDecisionType() SsvcDecisionType
+ SetDecisionType(SsvcDecisionType)
+}
+
+// SsvcVulnAssessmentRelationship Provides an SSVC assessment for a vulnerability.
+type SsvcVulnAssessmentRelationship struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Security/SsvcVulnAssessmentRelationship" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // Completeness Provides information about the completeness of relationships.
+ Completeness RelationshipCompleteness `iri:"https://spdx.org/rdf/3.0.1/terms/Core/completeness" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipCompleteness"`
+ // EndTime Specifies the time from which an element is no longer applicable / valid.
+ EndTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/endTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // To References an Element on the right-hand side of a relationship.
+ To ElementList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/to" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // From References the Element on the left-hand side of a relationship.
+ From AnyElement `iri:"https://spdx.org/rdf/3.0.1/terms/Core/from" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // Type Information about the relationship between two Elements.
+ Type RelationshipType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/relationshipType" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType"`
+ // StartTime Specifies the time from which an element is applicable / valid.
+ StartTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/startTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // SuppliedBy Identifies who or what supplied the artifact or VulnAssessmentRelationship referenced by the Element.
+ SuppliedBy AnyAgent `iri:"https://spdx.org/rdf/3.0.1/terms/Core/suppliedBy" type:"https://spdx.org/rdf/3.0.1/terms/Core/Agent"`
+ // WithdrawnTime Specified the time and date when a vulnerability was withdrawn.
+ WithdrawnTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/withdrawnTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // AssessedElement Specifies an Element contained in a piece of software where a vulnerability was found.
+ AssessedElement AnySoftwareArtifact `iri:"https://spdx.org/rdf/3.0.1/terms/Security/assessedElement" type:"https://spdx.org/rdf/3.0.1/terms/Software/SoftwareArtifact"`
+ // PublishedTime Specifies the time when a vulnerability was published.
+ PublishedTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/publishedTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ModifiedTime Specifies a time when a vulnerability assessment was modified
+ ModifiedTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/modifiedTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // DecisionType Provide the enumeration of possible decisions in the [Stakeholder-Specific Vulnerability Categorization (SSVC) decision tree](https://www.cisa.gov/stakeholder-specific-vulnerability-categorization-ssvc).
+ DecisionType SsvcDecisionType `iri:"https://spdx.org/rdf/3.0.1/terms/Security/decisionType" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Security/SsvcDecisionType"`
+}
+
+func (o *SsvcVulnAssessmentRelationship) asSsvcVulnAssessmentRelationship() {}
+func (o *SsvcVulnAssessmentRelationship) asVulnAssessmentRelationship() {}
+func (o *SsvcVulnAssessmentRelationship) asRelationship() {}
+func (o *SsvcVulnAssessmentRelationship) asElement() {}
+func (o *SsvcVulnAssessmentRelationship) GetID() string {
+ return o.ID
+}
+
+func (o *SsvcVulnAssessmentRelationship) SetID(v string) {
+ o.ID = v
+}
+
+func (o *SsvcVulnAssessmentRelationship) GetDescription() string {
+ return o.Description
+}
+
+func (o *SsvcVulnAssessmentRelationship) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *SsvcVulnAssessmentRelationship) GetComment() string {
+ return o.Comment
+}
+
+func (o *SsvcVulnAssessmentRelationship) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *SsvcVulnAssessmentRelationship) GetName() string {
+ return o.Name
+}
+
+func (o *SsvcVulnAssessmentRelationship) SetName(v string) {
+ o.Name = v
+}
+
+func (o *SsvcVulnAssessmentRelationship) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *SsvcVulnAssessmentRelationship) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *SsvcVulnAssessmentRelationship) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *SsvcVulnAssessmentRelationship) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *SsvcVulnAssessmentRelationship) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *SsvcVulnAssessmentRelationship) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *SsvcVulnAssessmentRelationship) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *SsvcVulnAssessmentRelationship) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *SsvcVulnAssessmentRelationship) GetSummary() string {
+ return o.Summary
+}
+
+func (o *SsvcVulnAssessmentRelationship) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *SsvcVulnAssessmentRelationship) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *SsvcVulnAssessmentRelationship) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *SsvcVulnAssessmentRelationship) GetCompleteness() RelationshipCompleteness {
+ return o.Completeness
+}
+
+func (o *SsvcVulnAssessmentRelationship) SetCompleteness(v RelationshipCompleteness) {
+ o.Completeness = v
+}
+
+func (o *SsvcVulnAssessmentRelationship) GetEndTime() time.Time {
+ return o.EndTime
+}
+
+func (o *SsvcVulnAssessmentRelationship) SetEndTime(v time.Time) {
+ o.EndTime = v
+}
+
+func (o *SsvcVulnAssessmentRelationship) GetTo() ElementList {
+ return o.To
+}
+
+func (o *SsvcVulnAssessmentRelationship) SetTo(v ElementList) {
+ o.To = v
+}
+
+func (o *SsvcVulnAssessmentRelationship) GetFrom() AnyElement {
+ return o.From
+}
+
+func (o *SsvcVulnAssessmentRelationship) SetFrom(v AnyElement) {
+ o.From = v
+}
+
+func (o *SsvcVulnAssessmentRelationship) GetType() RelationshipType {
+ return o.Type
+}
+
+func (o *SsvcVulnAssessmentRelationship) SetType(v RelationshipType) {
+ o.Type = v
+}
+
+func (o *SsvcVulnAssessmentRelationship) GetStartTime() time.Time {
+ return o.StartTime
+}
+
+func (o *SsvcVulnAssessmentRelationship) SetStartTime(v time.Time) {
+ o.StartTime = v
+}
+
+func (o *SsvcVulnAssessmentRelationship) GetSuppliedBy() AnyAgent {
+ return o.SuppliedBy
+}
+
+func (o *SsvcVulnAssessmentRelationship) SetSuppliedBy(v AnyAgent) {
+ o.SuppliedBy = v
+}
+
+func (o *SsvcVulnAssessmentRelationship) GetWithdrawnTime() time.Time {
+ return o.WithdrawnTime
+}
+
+func (o *SsvcVulnAssessmentRelationship) SetWithdrawnTime(v time.Time) {
+ o.WithdrawnTime = v
+}
+
+func (o *SsvcVulnAssessmentRelationship) GetAssessedElement() AnySoftwareArtifact {
+ return o.AssessedElement
+}
+
+func (o *SsvcVulnAssessmentRelationship) SetAssessedElement(v AnySoftwareArtifact) {
+ o.AssessedElement = v
+}
+
+func (o *SsvcVulnAssessmentRelationship) GetPublishedTime() time.Time {
+ return o.PublishedTime
+}
+
+func (o *SsvcVulnAssessmentRelationship) SetPublishedTime(v time.Time) {
+ o.PublishedTime = v
+}
+
+func (o *SsvcVulnAssessmentRelationship) GetModifiedTime() time.Time {
+ return o.ModifiedTime
+}
+
+func (o *SsvcVulnAssessmentRelationship) SetModifiedTime(v time.Time) {
+ o.ModifiedTime = v
+}
+
+func (o *SsvcVulnAssessmentRelationship) GetDecisionType() SsvcDecisionType {
+ return o.DecisionType
+}
+
+func (o *SsvcVulnAssessmentRelationship) SetDecisionType(v SsvcDecisionType) {
+ o.DecisionType = v
+}
+
+type SsvcVulnAssessmentRelationshipList []AnySsvcVulnAssessmentRelationship
+
+func (v SsvcVulnAssessmentRelationshipList) SsvcVulnAssessmentRelationships() []AnySsvcVulnAssessmentRelationship {
+ return ld.SliceOf[AnySsvcVulnAssessmentRelationship](v)
+}
+
+// SupportType Indicates the type of support that is associated with an artifact.
+type SupportType struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/SupportType" node-kind:""`
+ id string `iri:"@id"`
+}
+
+func (o *SupportType) GetID() string {
+ return o.id
+}
+
+// SupportType_Deployed in addition to being supported by the supplier, the software is known to have been deployed and is in use. For a software as a service provider, this implies the software is now available as a service.
+var SupportType_Deployed = SupportType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/SupportType/deployed",
+}
+
+// SupportType_Development the artifact is in active development and is not considered ready for formal support from the supplier.
+var SupportType_Development = SupportType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/SupportType/development",
+}
+
+// SupportType_EndOfSupport there is a defined end of support for the artifact from the supplier. This may also be referred to as end of life. There is a validUntilDate that can be used to signal when support ends for the artifact.
+var SupportType_EndOfSupport = SupportType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/SupportType/endOfSupport",
+}
+
+// SupportType_LimitedSupport the artifact has been released, and there is limited support available from the supplier. There is a validUntilDate that can provide additional information about the duration of support.
+var SupportType_LimitedSupport = SupportType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/SupportType/limitedSupport",
+}
+
+// SupportType_NoAssertion no assertion about the type of support is made. This is considered the default if no other support type is used.
+var SupportType_NoAssertion = SupportType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/SupportType/noAssertion",
+}
+
+// SupportType_NoSupport there is no support for the artifact from the supplier, consumer assumes any support obligations.
+var SupportType_NoSupport = SupportType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/SupportType/noSupport",
+}
+
+// SupportType_Support the artifact has been released, and is supported from the supplier. There is a validUntilDate that can provide additional information about the duration of support.
+var SupportType_Support = SupportType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Core/SupportType/support",
+}
+
+type AnyTool interface {
+ AnyElement
+ asTool()
+}
+
+// Tool An element of hardware and/or software utilized to carry out a particular function.
+type Tool struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Core/Tool" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+}
+
+func (o *Tool) asTool() {}
+func (o *Tool) asElement() {}
+func (o *Tool) GetID() string {
+ return o.ID
+}
+
+func (o *Tool) SetID(v string) {
+ o.ID = v
+}
+
+func (o *Tool) GetDescription() string {
+ return o.Description
+}
+
+func (o *Tool) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *Tool) GetComment() string {
+ return o.Comment
+}
+
+func (o *Tool) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *Tool) GetName() string {
+ return o.Name
+}
+
+func (o *Tool) SetName(v string) {
+ o.Name = v
+}
+
+func (o *Tool) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *Tool) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *Tool) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *Tool) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *Tool) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *Tool) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *Tool) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *Tool) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *Tool) GetSummary() string {
+ return o.Summary
+}
+
+func (o *Tool) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *Tool) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *Tool) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+type ToolList []AnyTool
+
+func (v ToolList) Tools() []AnyTool {
+ return ld.SliceOf[AnyTool](v)
+}
+
+type AnyVexAffectedVulnAssessmentRelationship interface {
+ AnyVexVulnAssessmentRelationship
+ asVexAffectedVulnAssessmentRelationship()
+ GetActionStatement() string
+ SetActionStatement(string)
+ GetActionStatementTime() time.Time
+ SetActionStatementTime(time.Time)
+}
+
+// VexAffectedVulnAssessmentRelationship Connects a vulnerability and an element designating the element as a product affected by the vulnerability.
+type VexAffectedVulnAssessmentRelationship struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Security/VexAffectedVulnAssessmentRelationship" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // Completeness Provides information about the completeness of relationships.
+ Completeness RelationshipCompleteness `iri:"https://spdx.org/rdf/3.0.1/terms/Core/completeness" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipCompleteness"`
+ // EndTime Specifies the time from which an element is no longer applicable / valid.
+ EndTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/endTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // To References an Element on the right-hand side of a relationship.
+ To ElementList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/to" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // From References the Element on the left-hand side of a relationship.
+ From AnyElement `iri:"https://spdx.org/rdf/3.0.1/terms/Core/from" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // Type Information about the relationship between two Elements.
+ Type RelationshipType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/relationshipType" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType"`
+ // StartTime Specifies the time from which an element is applicable / valid.
+ StartTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/startTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // SuppliedBy Identifies who or what supplied the artifact or VulnAssessmentRelationship referenced by the Element.
+ SuppliedBy AnyAgent `iri:"https://spdx.org/rdf/3.0.1/terms/Core/suppliedBy" type:"https://spdx.org/rdf/3.0.1/terms/Core/Agent"`
+ // WithdrawnTime Specified the time and date when a vulnerability was withdrawn.
+ WithdrawnTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/withdrawnTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // AssessedElement Specifies an Element contained in a piece of software where a vulnerability was found.
+ AssessedElement AnySoftwareArtifact `iri:"https://spdx.org/rdf/3.0.1/terms/Security/assessedElement" type:"https://spdx.org/rdf/3.0.1/terms/Software/SoftwareArtifact"`
+ // PublishedTime Specifies the time when a vulnerability was published.
+ PublishedTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/publishedTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ModifiedTime Specifies a time when a vulnerability assessment was modified
+ ModifiedTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/modifiedTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // StatusNotes Conveys information about how VEX status was determined.
+ StatusNotes string `iri:"https://spdx.org/rdf/3.0.1/terms/Security/statusNotes" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VexVersion Specifies the version of a VEX statement.
+ VexVersion string `iri:"https://spdx.org/rdf/3.0.1/terms/Security/vexVersion" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // ActionStatement Provides advise on how to mitigate or remediate a vulnerability when a VEX product is affected by it.
+ ActionStatement string `iri:"https://spdx.org/rdf/3.0.1/terms/Security/actionStatement" required:"true" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // ActionStatementTime Records the time when a recommended action was communicated in a VEX statement to mitigate a vulnerability.
+ ActionStatementTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/actionStatementTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) asVexAffectedVulnAssessmentRelationship() {}
+func (o *VexAffectedVulnAssessmentRelationship) asVexVulnAssessmentRelationship() {}
+func (o *VexAffectedVulnAssessmentRelationship) asVulnAssessmentRelationship() {}
+func (o *VexAffectedVulnAssessmentRelationship) asRelationship() {}
+func (o *VexAffectedVulnAssessmentRelationship) asElement() {}
+func (o *VexAffectedVulnAssessmentRelationship) GetID() string {
+ return o.ID
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetID(v string) {
+ o.ID = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetDescription() string {
+ return o.Description
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetComment() string {
+ return o.Comment
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetName() string {
+ return o.Name
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetName(v string) {
+ o.Name = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetSummary() string {
+ return o.Summary
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetCompleteness() RelationshipCompleteness {
+ return o.Completeness
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetCompleteness(v RelationshipCompleteness) {
+ o.Completeness = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetEndTime() time.Time {
+ return o.EndTime
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetEndTime(v time.Time) {
+ o.EndTime = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetTo() ElementList {
+ return o.To
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetTo(v ElementList) {
+ o.To = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetFrom() AnyElement {
+ return o.From
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetFrom(v AnyElement) {
+ o.From = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetType() RelationshipType {
+ return o.Type
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetType(v RelationshipType) {
+ o.Type = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetStartTime() time.Time {
+ return o.StartTime
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetStartTime(v time.Time) {
+ o.StartTime = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetSuppliedBy() AnyAgent {
+ return o.SuppliedBy
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetSuppliedBy(v AnyAgent) {
+ o.SuppliedBy = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetWithdrawnTime() time.Time {
+ return o.WithdrawnTime
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetWithdrawnTime(v time.Time) {
+ o.WithdrawnTime = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetAssessedElement() AnySoftwareArtifact {
+ return o.AssessedElement
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetAssessedElement(v AnySoftwareArtifact) {
+ o.AssessedElement = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetPublishedTime() time.Time {
+ return o.PublishedTime
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetPublishedTime(v time.Time) {
+ o.PublishedTime = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetModifiedTime() time.Time {
+ return o.ModifiedTime
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetModifiedTime(v time.Time) {
+ o.ModifiedTime = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetStatusNotes() string {
+ return o.StatusNotes
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetStatusNotes(v string) {
+ o.StatusNotes = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetVexVersion() string {
+ return o.VexVersion
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetVexVersion(v string) {
+ o.VexVersion = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetActionStatement() string {
+ return o.ActionStatement
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetActionStatement(v string) {
+ o.ActionStatement = v
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) GetActionStatementTime() time.Time {
+ return o.ActionStatementTime
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) SetActionStatementTime(v time.Time) {
+ o.ActionStatementTime = v
+}
+
+type VexAffectedVulnAssessmentRelationshipList []AnyVexAffectedVulnAssessmentRelationship
+
+func (v VexAffectedVulnAssessmentRelationshipList) VexAffectedVulnAssessmentRelationships() []AnyVexAffectedVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexAffectedVulnAssessmentRelationship](v)
+}
+
+type AnyVexFixedVulnAssessmentRelationship interface {
+ AnyVexVulnAssessmentRelationship
+ asVexFixedVulnAssessmentRelationship()
+}
+
+// VexFixedVulnAssessmentRelationship Links a vulnerability and elements representing products (in the VEX sense) where a fix has been applied and are no longer affected.
+type VexFixedVulnAssessmentRelationship struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Security/VexFixedVulnAssessmentRelationship" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // Completeness Provides information about the completeness of relationships.
+ Completeness RelationshipCompleteness `iri:"https://spdx.org/rdf/3.0.1/terms/Core/completeness" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipCompleteness"`
+ // EndTime Specifies the time from which an element is no longer applicable / valid.
+ EndTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/endTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // To References an Element on the right-hand side of a relationship.
+ To ElementList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/to" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // From References the Element on the left-hand side of a relationship.
+ From AnyElement `iri:"https://spdx.org/rdf/3.0.1/terms/Core/from" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // Type Information about the relationship between two Elements.
+ Type RelationshipType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/relationshipType" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType"`
+ // StartTime Specifies the time from which an element is applicable / valid.
+ StartTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/startTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // SuppliedBy Identifies who or what supplied the artifact or VulnAssessmentRelationship referenced by the Element.
+ SuppliedBy AnyAgent `iri:"https://spdx.org/rdf/3.0.1/terms/Core/suppliedBy" type:"https://spdx.org/rdf/3.0.1/terms/Core/Agent"`
+ // WithdrawnTime Specified the time and date when a vulnerability was withdrawn.
+ WithdrawnTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/withdrawnTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // AssessedElement Specifies an Element contained in a piece of software where a vulnerability was found.
+ AssessedElement AnySoftwareArtifact `iri:"https://spdx.org/rdf/3.0.1/terms/Security/assessedElement" type:"https://spdx.org/rdf/3.0.1/terms/Software/SoftwareArtifact"`
+ // PublishedTime Specifies the time when a vulnerability was published.
+ PublishedTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/publishedTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ModifiedTime Specifies a time when a vulnerability assessment was modified
+ ModifiedTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/modifiedTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // StatusNotes Conveys information about how VEX status was determined.
+ StatusNotes string `iri:"https://spdx.org/rdf/3.0.1/terms/Security/statusNotes" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VexVersion Specifies the version of a VEX statement.
+ VexVersion string `iri:"https://spdx.org/rdf/3.0.1/terms/Security/vexVersion" type:"http://www.w3.org/2001/XMLSchema#string"`
+}
+
+func (o *VexFixedVulnAssessmentRelationship) asVexFixedVulnAssessmentRelationship() {}
+func (o *VexFixedVulnAssessmentRelationship) asVexVulnAssessmentRelationship() {}
+func (o *VexFixedVulnAssessmentRelationship) asVulnAssessmentRelationship() {}
+func (o *VexFixedVulnAssessmentRelationship) asRelationship() {}
+func (o *VexFixedVulnAssessmentRelationship) asElement() {}
+func (o *VexFixedVulnAssessmentRelationship) GetID() string {
+ return o.ID
+}
+
+func (o *VexFixedVulnAssessmentRelationship) SetID(v string) {
+ o.ID = v
+}
+
+func (o *VexFixedVulnAssessmentRelationship) GetDescription() string {
+ return o.Description
+}
+
+func (o *VexFixedVulnAssessmentRelationship) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *VexFixedVulnAssessmentRelationship) GetComment() string {
+ return o.Comment
+}
+
+func (o *VexFixedVulnAssessmentRelationship) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *VexFixedVulnAssessmentRelationship) GetName() string {
+ return o.Name
+}
+
+func (o *VexFixedVulnAssessmentRelationship) SetName(v string) {
+ o.Name = v
+}
+
+func (o *VexFixedVulnAssessmentRelationship) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *VexFixedVulnAssessmentRelationship) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *VexFixedVulnAssessmentRelationship) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *VexFixedVulnAssessmentRelationship) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *VexFixedVulnAssessmentRelationship) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *VexFixedVulnAssessmentRelationship) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *VexFixedVulnAssessmentRelationship) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *VexFixedVulnAssessmentRelationship) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *VexFixedVulnAssessmentRelationship) GetSummary() string {
+ return o.Summary
+}
+
+func (o *VexFixedVulnAssessmentRelationship) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *VexFixedVulnAssessmentRelationship) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *VexFixedVulnAssessmentRelationship) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *VexFixedVulnAssessmentRelationship) GetCompleteness() RelationshipCompleteness {
+ return o.Completeness
+}
+
+func (o *VexFixedVulnAssessmentRelationship) SetCompleteness(v RelationshipCompleteness) {
+ o.Completeness = v
+}
+
+func (o *VexFixedVulnAssessmentRelationship) GetEndTime() time.Time {
+ return o.EndTime
+}
+
+func (o *VexFixedVulnAssessmentRelationship) SetEndTime(v time.Time) {
+ o.EndTime = v
+}
+
+func (o *VexFixedVulnAssessmentRelationship) GetTo() ElementList {
+ return o.To
+}
+
+func (o *VexFixedVulnAssessmentRelationship) SetTo(v ElementList) {
+ o.To = v
+}
+
+func (o *VexFixedVulnAssessmentRelationship) GetFrom() AnyElement {
+ return o.From
+}
+
+func (o *VexFixedVulnAssessmentRelationship) SetFrom(v AnyElement) {
+ o.From = v
+}
+
+func (o *VexFixedVulnAssessmentRelationship) GetType() RelationshipType {
+ return o.Type
+}
+
+func (o *VexFixedVulnAssessmentRelationship) SetType(v RelationshipType) {
+ o.Type = v
+}
+
+func (o *VexFixedVulnAssessmentRelationship) GetStartTime() time.Time {
+ return o.StartTime
+}
+
+func (o *VexFixedVulnAssessmentRelationship) SetStartTime(v time.Time) {
+ o.StartTime = v
+}
+
+func (o *VexFixedVulnAssessmentRelationship) GetSuppliedBy() AnyAgent {
+ return o.SuppliedBy
+}
+
+func (o *VexFixedVulnAssessmentRelationship) SetSuppliedBy(v AnyAgent) {
+ o.SuppliedBy = v
+}
+
+func (o *VexFixedVulnAssessmentRelationship) GetWithdrawnTime() time.Time {
+ return o.WithdrawnTime
+}
+
+func (o *VexFixedVulnAssessmentRelationship) SetWithdrawnTime(v time.Time) {
+ o.WithdrawnTime = v
+}
+
+func (o *VexFixedVulnAssessmentRelationship) GetAssessedElement() AnySoftwareArtifact {
+ return o.AssessedElement
+}
+
+func (o *VexFixedVulnAssessmentRelationship) SetAssessedElement(v AnySoftwareArtifact) {
+ o.AssessedElement = v
+}
+
+func (o *VexFixedVulnAssessmentRelationship) GetPublishedTime() time.Time {
+ return o.PublishedTime
+}
+
+func (o *VexFixedVulnAssessmentRelationship) SetPublishedTime(v time.Time) {
+ o.PublishedTime = v
+}
+
+func (o *VexFixedVulnAssessmentRelationship) GetModifiedTime() time.Time {
+ return o.ModifiedTime
+}
+
+func (o *VexFixedVulnAssessmentRelationship) SetModifiedTime(v time.Time) {
+ o.ModifiedTime = v
+}
+
+func (o *VexFixedVulnAssessmentRelationship) GetStatusNotes() string {
+ return o.StatusNotes
+}
+
+func (o *VexFixedVulnAssessmentRelationship) SetStatusNotes(v string) {
+ o.StatusNotes = v
+}
+
+func (o *VexFixedVulnAssessmentRelationship) GetVexVersion() string {
+ return o.VexVersion
+}
+
+func (o *VexFixedVulnAssessmentRelationship) SetVexVersion(v string) {
+ o.VexVersion = v
+}
+
+type VexFixedVulnAssessmentRelationshipList []AnyVexFixedVulnAssessmentRelationship
+
+func (v VexFixedVulnAssessmentRelationshipList) VexFixedVulnAssessmentRelationships() []AnyVexFixedVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexFixedVulnAssessmentRelationship](v)
+}
+
+// VexJustificationType Specifies the VEX justification type.
+type VexJustificationType struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Security/VexJustificationType" node-kind:""`
+ id string `iri:"@id"`
+}
+
+func (o *VexJustificationType) GetID() string {
+ return o.id
+}
+
+// VexJustificationType_ComponentNotPresent The software is not affected because the vulnerable component is not in the product.
+var VexJustificationType_ComponentNotPresent = VexJustificationType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Security/VexJustificationType/componentNotPresent",
+}
+
+// VexJustificationType_InlineMitigationsAlreadyExist Built-in inline controls or mitigations prevent an adversary from leveraging the vulnerability.
+var VexJustificationType_InlineMitigationsAlreadyExist = VexJustificationType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Security/VexJustificationType/inlineMitigationsAlreadyExist",
+}
+
+// VexJustificationType_VulnerableCodeCannotBeControlledByAdversary The vulnerable component is present, and the component contains the vulnerable code. However, vulnerable code is used in such a way that an attacker cannot mount any anticipated attack.
+var VexJustificationType_VulnerableCodeCannotBeControlledByAdversary = VexJustificationType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Security/VexJustificationType/vulnerableCodeCannotBeControlledByAdversary",
+}
+
+// VexJustificationType_VulnerableCodeNotInExecutePath The affected code is not reachable through the execution of the code, including non-anticipated states of the product.
+var VexJustificationType_VulnerableCodeNotInExecutePath = VexJustificationType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Security/VexJustificationType/vulnerableCodeNotInExecutePath",
+}
+
+// VexJustificationType_VulnerableCodeNotPresent The product is not affected because the code underlying the vulnerability is not present in the product.
+var VexJustificationType_VulnerableCodeNotPresent = VexJustificationType{
+ id: "https://spdx.org/rdf/3.0.1/terms/Security/VexJustificationType/vulnerableCodeNotPresent",
+}
+
+type AnyVexNotAffectedVulnAssessmentRelationship interface {
+ AnyVexVulnAssessmentRelationship
+ asVexNotAffectedVulnAssessmentRelationship()
+ GetImpactStatementTime() time.Time
+ SetImpactStatementTime(time.Time)
+ GetImpactStatement() string
+ SetImpactStatement(string)
+ GetJustificationType() VexJustificationType
+ SetJustificationType(VexJustificationType)
+}
+
+// VexNotAffectedVulnAssessmentRelationship Links a vulnerability and one or more elements designating the latter as products not affected by the vulnerability.
+type VexNotAffectedVulnAssessmentRelationship struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Security/VexNotAffectedVulnAssessmentRelationship" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // Completeness Provides information about the completeness of relationships.
+ Completeness RelationshipCompleteness `iri:"https://spdx.org/rdf/3.0.1/terms/Core/completeness" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipCompleteness"`
+ // EndTime Specifies the time from which an element is no longer applicable / valid.
+ EndTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/endTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // To References an Element on the right-hand side of a relationship.
+ To ElementList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/to" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // From References the Element on the left-hand side of a relationship.
+ From AnyElement `iri:"https://spdx.org/rdf/3.0.1/terms/Core/from" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // Type Information about the relationship between two Elements.
+ Type RelationshipType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/relationshipType" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType"`
+ // StartTime Specifies the time from which an element is applicable / valid.
+ StartTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/startTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // SuppliedBy Identifies who or what supplied the artifact or VulnAssessmentRelationship referenced by the Element.
+ SuppliedBy AnyAgent `iri:"https://spdx.org/rdf/3.0.1/terms/Core/suppliedBy" type:"https://spdx.org/rdf/3.0.1/terms/Core/Agent"`
+ // WithdrawnTime Specified the time and date when a vulnerability was withdrawn.
+ WithdrawnTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/withdrawnTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // AssessedElement Specifies an Element contained in a piece of software where a vulnerability was found.
+ AssessedElement AnySoftwareArtifact `iri:"https://spdx.org/rdf/3.0.1/terms/Security/assessedElement" type:"https://spdx.org/rdf/3.0.1/terms/Software/SoftwareArtifact"`
+ // PublishedTime Specifies the time when a vulnerability was published.
+ PublishedTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/publishedTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ModifiedTime Specifies a time when a vulnerability assessment was modified
+ ModifiedTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/modifiedTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // StatusNotes Conveys information about how VEX status was determined.
+ StatusNotes string `iri:"https://spdx.org/rdf/3.0.1/terms/Security/statusNotes" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VexVersion Specifies the version of a VEX statement.
+ VexVersion string `iri:"https://spdx.org/rdf/3.0.1/terms/Security/vexVersion" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // ImpactStatementTime Timestamp of impact statement.
+ ImpactStatementTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/impactStatementTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ImpactStatement Explains why a VEX product is not affected by a vulnerability. It is an alternative in VexNotAffectedVulnAssessmentRelationship to the machine-readable justification label.
+ ImpactStatement string `iri:"https://spdx.org/rdf/3.0.1/terms/Security/impactStatement" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // JustificationType Impact justification label to be used when linking a vulnerability to an element representing a VEX product with a VexNotAffectedVulnAssessmentRelationship relationship.
+ JustificationType VexJustificationType `iri:"https://spdx.org/rdf/3.0.1/terms/Security/justificationType" type:"https://spdx.org/rdf/3.0.1/terms/Security/VexJustificationType"`
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) asVexNotAffectedVulnAssessmentRelationship() {}
+func (o *VexNotAffectedVulnAssessmentRelationship) asVexVulnAssessmentRelationship() {}
+func (o *VexNotAffectedVulnAssessmentRelationship) asVulnAssessmentRelationship() {}
+func (o *VexNotAffectedVulnAssessmentRelationship) asRelationship() {}
+func (o *VexNotAffectedVulnAssessmentRelationship) asElement() {}
+func (o *VexNotAffectedVulnAssessmentRelationship) GetID() string {
+ return o.ID
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetID(v string) {
+ o.ID = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetDescription() string {
+ return o.Description
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetComment() string {
+ return o.Comment
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetName() string {
+ return o.Name
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetName(v string) {
+ o.Name = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetSummary() string {
+ return o.Summary
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetCompleteness() RelationshipCompleteness {
+ return o.Completeness
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetCompleteness(v RelationshipCompleteness) {
+ o.Completeness = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetEndTime() time.Time {
+ return o.EndTime
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetEndTime(v time.Time) {
+ o.EndTime = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetTo() ElementList {
+ return o.To
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetTo(v ElementList) {
+ o.To = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetFrom() AnyElement {
+ return o.From
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetFrom(v AnyElement) {
+ o.From = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetType() RelationshipType {
+ return o.Type
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetType(v RelationshipType) {
+ o.Type = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetStartTime() time.Time {
+ return o.StartTime
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetStartTime(v time.Time) {
+ o.StartTime = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetSuppliedBy() AnyAgent {
+ return o.SuppliedBy
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetSuppliedBy(v AnyAgent) {
+ o.SuppliedBy = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetWithdrawnTime() time.Time {
+ return o.WithdrawnTime
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetWithdrawnTime(v time.Time) {
+ o.WithdrawnTime = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetAssessedElement() AnySoftwareArtifact {
+ return o.AssessedElement
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetAssessedElement(v AnySoftwareArtifact) {
+ o.AssessedElement = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetPublishedTime() time.Time {
+ return o.PublishedTime
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetPublishedTime(v time.Time) {
+ o.PublishedTime = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetModifiedTime() time.Time {
+ return o.ModifiedTime
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetModifiedTime(v time.Time) {
+ o.ModifiedTime = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetStatusNotes() string {
+ return o.StatusNotes
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetStatusNotes(v string) {
+ o.StatusNotes = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetVexVersion() string {
+ return o.VexVersion
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetVexVersion(v string) {
+ o.VexVersion = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetImpactStatementTime() time.Time {
+ return o.ImpactStatementTime
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetImpactStatementTime(v time.Time) {
+ o.ImpactStatementTime = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetImpactStatement() string {
+ return o.ImpactStatement
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetImpactStatement(v string) {
+ o.ImpactStatement = v
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) GetJustificationType() VexJustificationType {
+ return o.JustificationType
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) SetJustificationType(v VexJustificationType) {
+ o.JustificationType = v
+}
+
+type VexNotAffectedVulnAssessmentRelationshipList []AnyVexNotAffectedVulnAssessmentRelationship
+
+func (v VexNotAffectedVulnAssessmentRelationshipList) VexNotAffectedVulnAssessmentRelationships() []AnyVexNotAffectedVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexNotAffectedVulnAssessmentRelationship](v)
+}
+
+type AnyVexUnderInvestigationVulnAssessmentRelationship interface {
+ AnyVexVulnAssessmentRelationship
+ asVexUnderInvestigationVulnAssessmentRelationship()
+}
+
+// VexUnderInvestigationVulnAssessmentRelationship Designates elements as products where the impact of a vulnerability is being investigated.
+type VexUnderInvestigationVulnAssessmentRelationship struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Security/VexUnderInvestigationVulnAssessmentRelationship" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // Completeness Provides information about the completeness of relationships.
+ Completeness RelationshipCompleteness `iri:"https://spdx.org/rdf/3.0.1/terms/Core/completeness" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipCompleteness"`
+ // EndTime Specifies the time from which an element is no longer applicable / valid.
+ EndTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/endTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // To References an Element on the right-hand side of a relationship.
+ To ElementList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/to" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // From References the Element on the left-hand side of a relationship.
+ From AnyElement `iri:"https://spdx.org/rdf/3.0.1/terms/Core/from" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/Element"`
+ // Type Information about the relationship between two Elements.
+ Type RelationshipType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/relationshipType" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType"`
+ // StartTime Specifies the time from which an element is applicable / valid.
+ StartTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/startTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // SuppliedBy Identifies who or what supplied the artifact or VulnAssessmentRelationship referenced by the Element.
+ SuppliedBy AnyAgent `iri:"https://spdx.org/rdf/3.0.1/terms/Core/suppliedBy" type:"https://spdx.org/rdf/3.0.1/terms/Core/Agent"`
+ // WithdrawnTime Specified the time and date when a vulnerability was withdrawn.
+ WithdrawnTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/withdrawnTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // AssessedElement Specifies an Element contained in a piece of software where a vulnerability was found.
+ AssessedElement AnySoftwareArtifact `iri:"https://spdx.org/rdf/3.0.1/terms/Security/assessedElement" type:"https://spdx.org/rdf/3.0.1/terms/Software/SoftwareArtifact"`
+ // PublishedTime Specifies the time when a vulnerability was published.
+ PublishedTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/publishedTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ModifiedTime Specifies a time when a vulnerability assessment was modified
+ ModifiedTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/modifiedTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // StatusNotes Conveys information about how VEX status was determined.
+ StatusNotes string `iri:"https://spdx.org/rdf/3.0.1/terms/Security/statusNotes" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VexVersion Specifies the version of a VEX statement.
+ VexVersion string `iri:"https://spdx.org/rdf/3.0.1/terms/Security/vexVersion" type:"http://www.w3.org/2001/XMLSchema#string"`
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) asVexUnderInvestigationVulnAssessmentRelationship() {
+}
+func (o *VexUnderInvestigationVulnAssessmentRelationship) asVexVulnAssessmentRelationship() {}
+func (o *VexUnderInvestigationVulnAssessmentRelationship) asVulnAssessmentRelationship() {}
+func (o *VexUnderInvestigationVulnAssessmentRelationship) asRelationship() {}
+func (o *VexUnderInvestigationVulnAssessmentRelationship) asElement() {}
+func (o *VexUnderInvestigationVulnAssessmentRelationship) GetID() string {
+ return o.ID
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) SetID(v string) {
+ o.ID = v
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) GetDescription() string {
+ return o.Description
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) GetComment() string {
+ return o.Comment
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) GetName() string {
+ return o.Name
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) SetName(v string) {
+ o.Name = v
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) GetSummary() string {
+ return o.Summary
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) GetCompleteness() RelationshipCompleteness {
+ return o.Completeness
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) SetCompleteness(v RelationshipCompleteness) {
+ o.Completeness = v
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) GetEndTime() time.Time {
+ return o.EndTime
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) SetEndTime(v time.Time) {
+ o.EndTime = v
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) GetTo() ElementList {
+ return o.To
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) SetTo(v ElementList) {
+ o.To = v
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) GetFrom() AnyElement {
+ return o.From
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) SetFrom(v AnyElement) {
+ o.From = v
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) GetType() RelationshipType {
+ return o.Type
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) SetType(v RelationshipType) {
+ o.Type = v
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) GetStartTime() time.Time {
+ return o.StartTime
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) SetStartTime(v time.Time) {
+ o.StartTime = v
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) GetSuppliedBy() AnyAgent {
+ return o.SuppliedBy
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) SetSuppliedBy(v AnyAgent) {
+ o.SuppliedBy = v
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) GetWithdrawnTime() time.Time {
+ return o.WithdrawnTime
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) SetWithdrawnTime(v time.Time) {
+ o.WithdrawnTime = v
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) GetAssessedElement() AnySoftwareArtifact {
+ return o.AssessedElement
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) SetAssessedElement(v AnySoftwareArtifact) {
+ o.AssessedElement = v
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) GetPublishedTime() time.Time {
+ return o.PublishedTime
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) SetPublishedTime(v time.Time) {
+ o.PublishedTime = v
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) GetModifiedTime() time.Time {
+ return o.ModifiedTime
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) SetModifiedTime(v time.Time) {
+ o.ModifiedTime = v
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) GetStatusNotes() string {
+ return o.StatusNotes
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) SetStatusNotes(v string) {
+ o.StatusNotes = v
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) GetVexVersion() string {
+ return o.VexVersion
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) SetVexVersion(v string) {
+ o.VexVersion = v
+}
+
+type VexUnderInvestigationVulnAssessmentRelationshipList []AnyVexUnderInvestigationVulnAssessmentRelationship
+
+func (v VexUnderInvestigationVulnAssessmentRelationshipList) VexUnderInvestigationVulnAssessmentRelationships() []AnyVexUnderInvestigationVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexUnderInvestigationVulnAssessmentRelationship](v)
+}
+
+type AnyVexVulnAssessmentRelationship interface {
+ AnyVulnAssessmentRelationship
+ asVexVulnAssessmentRelationship()
+ GetStatusNotes() string
+ SetStatusNotes(string)
+ GetVexVersion() string
+ SetVexVersion(string)
+}
+
+// VexVulnAssessmentRelationship Abstract ancestor class for all VEX relationships
+type VexVulnAssessmentRelationshipList []AnyVexVulnAssessmentRelationship
+
+func (v VexVulnAssessmentRelationshipList) VexAffectedVulnAssessmentRelationships() []AnyVexAffectedVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexAffectedVulnAssessmentRelationship](v)
+}
+
+func (v VexVulnAssessmentRelationshipList) VexFixedVulnAssessmentRelationships() []AnyVexFixedVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexFixedVulnAssessmentRelationship](v)
+}
+
+func (v VexVulnAssessmentRelationshipList) VexNotAffectedVulnAssessmentRelationships() []AnyVexNotAffectedVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexNotAffectedVulnAssessmentRelationship](v)
+}
+
+func (v VexVulnAssessmentRelationshipList) VexUnderInvestigationVulnAssessmentRelationships() []AnyVexUnderInvestigationVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexUnderInvestigationVulnAssessmentRelationship](v)
+}
+
+func (v VexVulnAssessmentRelationshipList) VexVulnAssessmentRelationships() []AnyVexVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexVulnAssessmentRelationship](v)
+}
+
+type AnyVulnAssessmentRelationship interface {
+ AnyRelationship
+ asVulnAssessmentRelationship()
+ GetSuppliedBy() AnyAgent
+ SetSuppliedBy(AnyAgent)
+ GetWithdrawnTime() time.Time
+ SetWithdrawnTime(time.Time)
+ GetAssessedElement() AnySoftwareArtifact
+ SetAssessedElement(AnySoftwareArtifact)
+ GetPublishedTime() time.Time
+ SetPublishedTime(time.Time)
+ GetModifiedTime() time.Time
+ SetModifiedTime(time.Time)
+}
+
+// VulnAssessmentRelationship Abstract ancestor class for all vulnerability assessments
+type VulnAssessmentRelationshipList []AnyVulnAssessmentRelationship
+
+func (v VulnAssessmentRelationshipList) CvssV2VulnAssessmentRelationships() []AnyCvssV2VulnAssessmentRelationship {
+ return ld.SliceOf[AnyCvssV2VulnAssessmentRelationship](v)
+}
+
+func (v VulnAssessmentRelationshipList) CvssV3VulnAssessmentRelationships() []AnyCvssV3VulnAssessmentRelationship {
+ return ld.SliceOf[AnyCvssV3VulnAssessmentRelationship](v)
+}
+
+func (v VulnAssessmentRelationshipList) CvssV4VulnAssessmentRelationships() []AnyCvssV4VulnAssessmentRelationship {
+ return ld.SliceOf[AnyCvssV4VulnAssessmentRelationship](v)
+}
+
+func (v VulnAssessmentRelationshipList) EpssVulnAssessmentRelationships() []AnyEpssVulnAssessmentRelationship {
+ return ld.SliceOf[AnyEpssVulnAssessmentRelationship](v)
+}
+
+func (v VulnAssessmentRelationshipList) ExploitCatalogVulnAssessmentRelationships() []AnyExploitCatalogVulnAssessmentRelationship {
+ return ld.SliceOf[AnyExploitCatalogVulnAssessmentRelationship](v)
+}
+
+func (v VulnAssessmentRelationshipList) SsvcVulnAssessmentRelationships() []AnySsvcVulnAssessmentRelationship {
+ return ld.SliceOf[AnySsvcVulnAssessmentRelationship](v)
+}
+
+func (v VulnAssessmentRelationshipList) VexAffectedVulnAssessmentRelationships() []AnyVexAffectedVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexAffectedVulnAssessmentRelationship](v)
+}
+
+func (v VulnAssessmentRelationshipList) VexFixedVulnAssessmentRelationships() []AnyVexFixedVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexFixedVulnAssessmentRelationship](v)
+}
+
+func (v VulnAssessmentRelationshipList) VexNotAffectedVulnAssessmentRelationships() []AnyVexNotAffectedVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexNotAffectedVulnAssessmentRelationship](v)
+}
+
+func (v VulnAssessmentRelationshipList) VexUnderInvestigationVulnAssessmentRelationships() []AnyVexUnderInvestigationVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexUnderInvestigationVulnAssessmentRelationship](v)
+}
+
+func (v VulnAssessmentRelationshipList) VexVulnAssessmentRelationships() []AnyVexVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVexVulnAssessmentRelationship](v)
+}
+
+func (v VulnAssessmentRelationshipList) VulnAssessmentRelationships() []AnyVulnAssessmentRelationship {
+ return ld.SliceOf[AnyVulnAssessmentRelationship](v)
+}
+
+type AnyVulnerability interface {
+ AnyArtifact
+ asVulnerability()
+ GetWithdrawnTime() time.Time
+ SetWithdrawnTime(time.Time)
+ GetModifiedTime() time.Time
+ SetModifiedTime(time.Time)
+ GetPublishedTime() time.Time
+ SetPublishedTime(time.Time)
+}
+
+// Vulnerability Specifies a vulnerability and its associated information.
+type Vulnerability struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/Security/Vulnerability" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // StandardNames The name of a relevant standard that may apply to an artifact.
+ StandardNames []string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/standardName" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // BuiltTime Specifies the time an artifact was built.
+ BuiltTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/builtTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ReleaseTime Specifies the time an artifact was released.
+ ReleaseTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/releaseTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // SupportLevels Specifies the level of support associated with an artifact.
+ SupportLevels []SupportType `iri:"https://spdx.org/rdf/3.0.1/terms/Core/supportLevel" type:"https://spdx.org/rdf/3.0.1/terms/Core/SupportType"`
+ // SuppliedBy Identifies who or what supplied the artifact or VulnAssessmentRelationship referenced by the Element.
+ SuppliedBy AnyAgent `iri:"https://spdx.org/rdf/3.0.1/terms/Core/suppliedBy" type:"https://spdx.org/rdf/3.0.1/terms/Core/Agent"`
+ // OriginatedBy Identifies from where or whom the Element originally came.
+ OriginatedBy AgentList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/originatedBy" type:"https://spdx.org/rdf/3.0.1/terms/Core/Agent"`
+ // ValidUntilTime Specifies until when the artifact can be used before its usage needs to be reassessed.
+ ValidUntilTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Core/validUntilTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // WithdrawnTime Specified the time and date when a vulnerability was withdrawn.
+ WithdrawnTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/withdrawnTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // ModifiedTime Specifies a time when a vulnerability assessment was modified
+ ModifiedTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/modifiedTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+ // PublishedTime Specifies the time when a vulnerability was published.
+ PublishedTime time.Time `iri:"https://spdx.org/rdf/3.0.1/terms/Security/publishedTime" type:"http://www.w3.org/2001/XMLSchema#dateTimeStamp"`
+}
+
+func (o *Vulnerability) asVulnerability() {}
+func (o *Vulnerability) asArtifact() {}
+func (o *Vulnerability) asElement() {}
+func (o *Vulnerability) GetID() string {
+ return o.ID
+}
+
+func (o *Vulnerability) SetID(v string) {
+ o.ID = v
+}
+
+func (o *Vulnerability) GetDescription() string {
+ return o.Description
+}
+
+func (o *Vulnerability) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *Vulnerability) GetComment() string {
+ return o.Comment
+}
+
+func (o *Vulnerability) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *Vulnerability) GetName() string {
+ return o.Name
+}
+
+func (o *Vulnerability) SetName(v string) {
+ o.Name = v
+}
+
+func (o *Vulnerability) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *Vulnerability) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *Vulnerability) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *Vulnerability) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *Vulnerability) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *Vulnerability) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *Vulnerability) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *Vulnerability) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *Vulnerability) GetSummary() string {
+ return o.Summary
+}
+
+func (o *Vulnerability) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *Vulnerability) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *Vulnerability) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *Vulnerability) GetStandardNames() []string {
+ return o.StandardNames
+}
+
+func (o *Vulnerability) SetStandardNames(v []string) {
+ o.StandardNames = v
+}
+
+func (o *Vulnerability) GetBuiltTime() time.Time {
+ return o.BuiltTime
+}
+
+func (o *Vulnerability) SetBuiltTime(v time.Time) {
+ o.BuiltTime = v
+}
+
+func (o *Vulnerability) GetReleaseTime() time.Time {
+ return o.ReleaseTime
+}
+
+func (o *Vulnerability) SetReleaseTime(v time.Time) {
+ o.ReleaseTime = v
+}
+
+func (o *Vulnerability) GetSupportLevels() []SupportType {
+ return o.SupportLevels
+}
+
+func (o *Vulnerability) SetSupportLevels(v []SupportType) {
+ o.SupportLevels = v
+}
+
+func (o *Vulnerability) GetSuppliedBy() AnyAgent {
+ return o.SuppliedBy
+}
+
+func (o *Vulnerability) SetSuppliedBy(v AnyAgent) {
+ o.SuppliedBy = v
+}
+
+func (o *Vulnerability) GetOriginatedBy() AgentList {
+ return o.OriginatedBy
+}
+
+func (o *Vulnerability) SetOriginatedBy(v AgentList) {
+ o.OriginatedBy = v
+}
+
+func (o *Vulnerability) GetValidUntilTime() time.Time {
+ return o.ValidUntilTime
+}
+
+func (o *Vulnerability) SetValidUntilTime(v time.Time) {
+ o.ValidUntilTime = v
+}
+
+func (o *Vulnerability) GetWithdrawnTime() time.Time {
+ return o.WithdrawnTime
+}
+
+func (o *Vulnerability) SetWithdrawnTime(v time.Time) {
+ o.WithdrawnTime = v
+}
+
+func (o *Vulnerability) GetModifiedTime() time.Time {
+ return o.ModifiedTime
+}
+
+func (o *Vulnerability) SetModifiedTime(v time.Time) {
+ o.ModifiedTime = v
+}
+
+func (o *Vulnerability) GetPublishedTime() time.Time {
+ return o.PublishedTime
+}
+
+func (o *Vulnerability) SetPublishedTime(v time.Time) {
+ o.PublishedTime = v
+}
+
+type VulnerabilityList []AnyVulnerability
+
+func (v VulnerabilityList) Vulnerabilities() []AnyVulnerability {
+ return ld.SliceOf[AnyVulnerability](v)
+}
+
+type AnyWithAdditionOperator interface {
+ AnyLicenseInfo
+ asWithAdditionOperator()
+ GetSubjectExtendableLicense() AnyExtendableLicense
+ SetSubjectExtendableLicense(AnyExtendableLicense)
+ GetSubjectAddition() AnyLicenseAddition
+ SetSubjectAddition(AnyLicenseAddition)
+}
+
+// WithAdditionOperator Portion of an AnyLicenseInfo representing a License which has additional text applied to it.
+type WithAdditionOperator struct {
+ _ ld.Type `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/WithAdditionOperator" node-kind:"http://www.w3.org/ns/shacl#IRI"`
+ ID string `iri:"@id"`
+ // Description Provides a detailed description of the Element.
+ Description string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/description" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Comment Provide consumers with comments by the creator of the Element about the Element.
+ Comment string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/comment" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Name Identifies the name of an Element as designated by the creator.
+ Name string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/name" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // Extensions Specifies an Extension characterization of some aspect of an Element.
+ Extensions ExtensionList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/extension" type:"https://spdx.org/rdf/3.0.1/terms/Extension/Extension"`
+ // CreationInfo Provides information about the creation of the Element.
+ CreationInfo AnyCreationInfo `iri:"https://spdx.org/rdf/3.0.1/terms/Core/creationInfo" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"`
+ // ExternalIdentifiers Provides a reference to a resource outside the scope of SPDX-3.0 content that uniquely identifies an Element.
+ ExternalIdentifiers ExternalIdentifierList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"`
+ // ExternalRefs Points to a resource outside the scope of the SPDX-3.0 content that provides additional characteristics of an Element.
+ ExternalRefs ExternalRefList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/externalRef" type:"https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef"`
+ // Summary A short description of an Element.
+ Summary string `iri:"https://spdx.org/rdf/3.0.1/terms/Core/summary" type:"http://www.w3.org/2001/XMLSchema#string"`
+ // VerifiedUsing Provides an IntegrityMethod with which the integrity of an Element can be asserted.
+ VerifiedUsing IntegrityMethodList `iri:"https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing" type:"https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod"`
+ // SubjectExtendableLicense A License participating in a 'with addition' model.
+ SubjectExtendableLicense AnyExtendableLicense `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/subjectExtendableLicense" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/ExtendableLicense"`
+ // SubjectAddition A LicenseAddition participating in a 'with addition' model.
+ SubjectAddition AnyLicenseAddition `iri:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/subjectAddition" required:"true" type:"https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/LicenseAddition"`
+}
+
+func (o *WithAdditionOperator) asWithAdditionOperator() {}
+func (o *WithAdditionOperator) asLicenseInfo() {}
+func (o *WithAdditionOperator) asElement() {}
+func (o *WithAdditionOperator) GetID() string {
+ return o.ID
+}
+
+func (o *WithAdditionOperator) SetID(v string) {
+ o.ID = v
+}
+
+func (o *WithAdditionOperator) GetDescription() string {
+ return o.Description
+}
+
+func (o *WithAdditionOperator) SetDescription(v string) {
+ o.Description = v
+}
+
+func (o *WithAdditionOperator) GetComment() string {
+ return o.Comment
+}
+
+func (o *WithAdditionOperator) SetComment(v string) {
+ o.Comment = v
+}
+
+func (o *WithAdditionOperator) GetName() string {
+ return o.Name
+}
+
+func (o *WithAdditionOperator) SetName(v string) {
+ o.Name = v
+}
+
+func (o *WithAdditionOperator) GetExtensions() ExtensionList {
+ return o.Extensions
+}
+
+func (o *WithAdditionOperator) SetExtensions(v ExtensionList) {
+ o.Extensions = v
+}
+
+func (o *WithAdditionOperator) GetCreationInfo() AnyCreationInfo {
+ return o.CreationInfo
+}
+
+func (o *WithAdditionOperator) SetCreationInfo(v AnyCreationInfo) {
+ o.CreationInfo = v
+}
+
+func (o *WithAdditionOperator) GetExternalIdentifiers() ExternalIdentifierList {
+ return o.ExternalIdentifiers
+}
+
+func (o *WithAdditionOperator) SetExternalIdentifiers(v ExternalIdentifierList) {
+ o.ExternalIdentifiers = v
+}
+
+func (o *WithAdditionOperator) GetExternalRefs() ExternalRefList {
+ return o.ExternalRefs
+}
+
+func (o *WithAdditionOperator) SetExternalRefs(v ExternalRefList) {
+ o.ExternalRefs = v
+}
+
+func (o *WithAdditionOperator) GetSummary() string {
+ return o.Summary
+}
+
+func (o *WithAdditionOperator) SetSummary(v string) {
+ o.Summary = v
+}
+
+func (o *WithAdditionOperator) GetVerifiedUsing() IntegrityMethodList {
+ return o.VerifiedUsing
+}
+
+func (o *WithAdditionOperator) SetVerifiedUsing(v IntegrityMethodList) {
+ o.VerifiedUsing = v
+}
+
+func (o *WithAdditionOperator) GetSubjectExtendableLicense() AnyExtendableLicense {
+ return o.SubjectExtendableLicense
+}
+
+func (o *WithAdditionOperator) SetSubjectExtendableLicense(v AnyExtendableLicense) {
+ o.SubjectExtendableLicense = v
+}
+
+func (o *WithAdditionOperator) GetSubjectAddition() AnyLicenseAddition {
+ return o.SubjectAddition
+}
+
+func (o *WithAdditionOperator) SetSubjectAddition(v AnyLicenseAddition) {
+ o.SubjectAddition = v
+}
+
+type WithAdditionOperatorList []AnyWithAdditionOperator
+
+func (v WithAdditionOperatorList) WithAdditionOperators() []AnyWithAdditionOperator {
+ return ld.SliceOf[AnyWithAdditionOperator](v)
+}
+
+type ExternalIRI struct {
+ id string `iri:"@id"`
+ value any
+}
+
+func NewExternalIRI(id string) *ExternalIRI {
+ return &ExternalIRI{
+ id: id,
+ }
+}
+
+type (
+ NonNegativeInt = ld.NonNegativeInt
+ PositiveInt = ld.PositiveInt
+ URI = ld.URI
+)
+
+func context() ld.Context {
+ return ld.NewContext().Register("https://spdx.org/rdf/3.0.1/spdx-context.jsonld", map[string]any{"@context": map[string]any{
+ "Agent": "https://spdx.org/rdf/3.0.1/terms/Core/Agent",
+ "Annotation": "https://spdx.org/rdf/3.0.1/terms/Core/Annotation",
+ "AnnotationType": "https://spdx.org/rdf/3.0.1/terms/Core/AnnotationType",
+ "Artifact": "https://spdx.org/rdf/3.0.1/terms/Core/Artifact",
+ "Bom": "https://spdx.org/rdf/3.0.1/terms/Core/Bom",
+ "Bundle": "https://spdx.org/rdf/3.0.1/terms/Core/Bundle",
+ "CreationInfo": "https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo",
+ "DictionaryEntry": "https://spdx.org/rdf/3.0.1/terms/Core/DictionaryEntry",
+ "Element": "https://spdx.org/rdf/3.0.1/terms/Core/Element",
+ "ElementCollection": "https://spdx.org/rdf/3.0.1/terms/Core/ElementCollection",
+ "ExternalIdentifier": "https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier",
+ "ExternalIdentifierType": "https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifierType",
+ "ExternalMap": "https://spdx.org/rdf/3.0.1/terms/Core/ExternalMap",
+ "ExternalRef": "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRef",
+ "ExternalRefType": "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType",
+ "Hash": "https://spdx.org/rdf/3.0.1/terms/Core/Hash",
+ "HashAlgorithm": "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm",
+ "IndividualElement": "https://spdx.org/rdf/3.0.1/terms/Core/IndividualElement",
+ "IntegrityMethod": "https://spdx.org/rdf/3.0.1/terms/Core/IntegrityMethod",
+ "LifecycleScopeType": "https://spdx.org/rdf/3.0.1/terms/Core/LifecycleScopeType",
+ "LifecycleScopedRelationship": "https://spdx.org/rdf/3.0.1/terms/Core/LifecycleScopedRelationship",
+ "NamespaceMap": "https://spdx.org/rdf/3.0.1/terms/Core/NamespaceMap",
+ "NoAssertionElement": "https://spdx.org/rdf/3.0.1/terms/Core/NoAssertionElement",
+ "NoneElement": "https://spdx.org/rdf/3.0.1/terms/Core/NoneElement",
+ "Organization": "https://spdx.org/rdf/3.0.1/terms/Core/Organization",
+ "PackageVerificationCode": "https://spdx.org/rdf/3.0.1/terms/Core/PackageVerificationCode",
+ "Person": "https://spdx.org/rdf/3.0.1/terms/Core/Person",
+ "PositiveIntegerRange": "https://spdx.org/rdf/3.0.1/terms/Core/PositiveIntegerRange",
+ "PresenceType": "https://spdx.org/rdf/3.0.1/terms/Core/PresenceType",
+ "ProfileIdentifierType": "https://spdx.org/rdf/3.0.1/terms/Core/ProfileIdentifierType",
+ "Relationship": "https://spdx.org/rdf/3.0.1/terms/Core/Relationship",
+ "RelationshipCompleteness": "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipCompleteness",
+ "RelationshipType": "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType",
+ "SoftwareAgent": "https://spdx.org/rdf/3.0.1/terms/Core/SoftwareAgent",
+ "SpdxDocument": "https://spdx.org/rdf/3.0.1/terms/Core/SpdxDocument",
+ "SpdxOrganization": "https://spdx.org/rdf/3.0.1/terms/Core/SpdxOrganization",
+ "SupportType": "https://spdx.org/rdf/3.0.1/terms/Core/SupportType",
+ "Tool": "https://spdx.org/rdf/3.0.1/terms/Core/Tool",
+ "ai_AIPackage": "https://spdx.org/rdf/3.0.1/terms/AI/AIPackage",
+ "ai_EnergyConsumption": "https://spdx.org/rdf/3.0.1/terms/AI/EnergyConsumption",
+ "ai_EnergyConsumptionDescription": "https://spdx.org/rdf/3.0.1/terms/AI/EnergyConsumptionDescription",
+ "ai_EnergyUnitType": "https://spdx.org/rdf/3.0.1/terms/AI/EnergyUnitType",
+ "ai_SafetyRiskAssessmentType": "https://spdx.org/rdf/3.0.1/terms/AI/SafetyRiskAssessmentType",
+ "ai_autonomyType": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Core/PresenceType/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/AI/autonomyType",
+ "@type": "@vocab",
+ },
+ "ai_domain": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/AI/domain",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "ai_energyConsumption": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/AI/energyConsumption",
+ "@type": "@vocab",
+ },
+ "ai_energyQuantity": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/AI/energyQuantity",
+ "@type": "http://www.w3.org/2001/XMLSchema#decimal",
+ },
+ "ai_energyUnit": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/AI/EnergyUnitType/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/AI/energyUnit",
+ "@type": "@vocab",
+ },
+ "ai_finetuningEnergyConsumption": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/AI/finetuningEnergyConsumption",
+ "@type": "@vocab",
+ },
+ "ai_hyperparameter": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/AI/hyperparameter",
+ "@type": "@vocab",
+ },
+ "ai_inferenceEnergyConsumption": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/AI/inferenceEnergyConsumption",
+ "@type": "@vocab",
+ },
+ "ai_informationAboutApplication": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/AI/informationAboutApplication",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "ai_informationAboutTraining": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/AI/informationAboutTraining",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "ai_limitation": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/AI/limitation",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "ai_metric": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/AI/metric",
+ "@type": "@vocab",
+ },
+ "ai_metricDecisionThreshold": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/AI/metricDecisionThreshold",
+ "@type": "@vocab",
+ },
+ "ai_modelDataPreprocessing": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/AI/modelDataPreprocessing",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "ai_modelExplainability": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/AI/modelExplainability",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "ai_safetyRiskAssessment": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/AI/SafetyRiskAssessmentType/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/AI/safetyRiskAssessment",
+ "@type": "@vocab",
+ },
+ "ai_standardCompliance": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/AI/standardCompliance",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "ai_trainingEnergyConsumption": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/AI/trainingEnergyConsumption",
+ "@type": "@vocab",
+ },
+ "ai_typeOfModel": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/AI/typeOfModel",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "ai_useSensitivePersonalInformation": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Core/PresenceType/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/AI/useSensitivePersonalInformation",
+ "@type": "@vocab",
+ },
+ "algorithm": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/algorithm",
+ "@type": "@vocab",
+ },
+ "annotationType": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Core/AnnotationType/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/annotationType",
+ "@type": "@vocab",
+ },
+ "beginIntegerRange": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/beginIntegerRange",
+ "@type": "http://www.w3.org/2001/XMLSchema#positiveInteger",
+ },
+ "build_Build": "https://spdx.org/rdf/3.0.1/terms/Build/Build",
+ "build_buildEndTime": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Build/buildEndTime",
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
+ },
+ "build_buildId": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Build/buildId",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "build_buildStartTime": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Build/buildStartTime",
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
+ },
+ "build_buildType": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Build/buildType",
+ "@type": "http://www.w3.org/2001/XMLSchema#anyURI",
+ },
+ "build_configSourceDigest": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Build/configSourceDigest",
+ "@type": "@vocab",
+ },
+ "build_configSourceEntrypoint": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Build/configSourceEntrypoint",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "build_configSourceUri": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Build/configSourceUri",
+ "@type": "http://www.w3.org/2001/XMLSchema#anyURI",
+ },
+ "build_environment": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Build/environment",
+ "@type": "@vocab",
+ },
+ "build_parameter": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Build/parameter",
+ "@type": "@vocab",
+ },
+ "builtTime": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/builtTime",
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
+ },
+ "comment": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/comment",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "completeness": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipCompleteness/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/completeness",
+ "@type": "@vocab",
+ },
+ "contentType": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/contentType",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "context": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/context",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "created": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/created",
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
+ },
+ "createdBy": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/createdBy",
+ "@type": "@vocab",
+ },
+ "createdUsing": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/createdUsing",
+ "@type": "@vocab",
+ },
+ "creationInfo": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/creationInfo",
+ "@type": "@vocab",
+ },
+ "dataLicense": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/dataLicense",
+ "@type": "@vocab",
+ },
+ "dataset_ConfidentialityLevelType": "https://spdx.org/rdf/3.0.1/terms/Dataset/ConfidentialityLevelType",
+ "dataset_DatasetAvailabilityType": "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetAvailabilityType",
+ "dataset_DatasetPackage": "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetPackage",
+ "dataset_DatasetType": "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetType",
+ "dataset_anonymizationMethodUsed": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Dataset/anonymizationMethodUsed",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "dataset_confidentialityLevel": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Dataset/ConfidentialityLevelType/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Dataset/confidentialityLevel",
+ "@type": "@vocab",
+ },
+ "dataset_dataCollectionProcess": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Dataset/dataCollectionProcess",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "dataset_dataPreprocessing": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Dataset/dataPreprocessing",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "dataset_datasetAvailability": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetAvailabilityType/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Dataset/datasetAvailability",
+ "@type": "@vocab",
+ },
+ "dataset_datasetNoise": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Dataset/datasetNoise",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "dataset_datasetSize": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Dataset/datasetSize",
+ "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger",
+ },
+ "dataset_datasetType": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Dataset/DatasetType/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Dataset/datasetType",
+ "@type": "@vocab",
+ },
+ "dataset_datasetUpdateMechanism": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Dataset/datasetUpdateMechanism",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "dataset_hasSensitivePersonalInformation": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Core/PresenceType/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Dataset/hasSensitivePersonalInformation",
+ "@type": "@vocab",
+ },
+ "dataset_intendedUse": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Dataset/intendedUse",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "dataset_knownBias": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Dataset/knownBias",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "dataset_sensor": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Dataset/sensor",
+ "@type": "@vocab",
+ },
+ "definingArtifact": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/definingArtifact",
+ "@type": "@vocab",
+ },
+ "description": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/description",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "element": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/element",
+ "@type": "@vocab",
+ },
+ "endIntegerRange": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/endIntegerRange",
+ "@type": "http://www.w3.org/2001/XMLSchema#positiveInteger",
+ },
+ "endTime": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/endTime",
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
+ },
+ "expandedlicensing_ConjunctiveLicenseSet": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/ConjunctiveLicenseSet",
+ "expandedlicensing_CustomLicense": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/CustomLicense",
+ "expandedlicensing_CustomLicenseAddition": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/CustomLicenseAddition",
+ "expandedlicensing_DisjunctiveLicenseSet": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/DisjunctiveLicenseSet",
+ "expandedlicensing_ExtendableLicense": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/ExtendableLicense",
+ "expandedlicensing_IndividualLicensingInfo": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/IndividualLicensingInfo",
+ "expandedlicensing_License": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/License",
+ "expandedlicensing_LicenseAddition": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/LicenseAddition",
+ "expandedlicensing_ListedLicense": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/ListedLicense",
+ "expandedlicensing_ListedLicenseException": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/ListedLicenseException",
+ "expandedlicensing_NoAssertionLicense": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/NoAssertionLicense",
+ "expandedlicensing_NoneLicense": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/NoneLicense",
+ "expandedlicensing_OrLaterOperator": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/OrLaterOperator",
+ "expandedlicensing_WithAdditionOperator": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/WithAdditionOperator",
+ "expandedlicensing_additionText": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/additionText",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "expandedlicensing_deprecatedVersion": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/deprecatedVersion",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "expandedlicensing_isDeprecatedAdditionId": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/isDeprecatedAdditionId",
+ "@type": "http://www.w3.org/2001/XMLSchema#boolean",
+ },
+ "expandedlicensing_isDeprecatedLicenseId": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/isDeprecatedLicenseId",
+ "@type": "http://www.w3.org/2001/XMLSchema#boolean",
+ },
+ "expandedlicensing_isFsfLibre": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/isFsfLibre",
+ "@type": "http://www.w3.org/2001/XMLSchema#boolean",
+ },
+ "expandedlicensing_isOsiApproved": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/isOsiApproved",
+ "@type": "http://www.w3.org/2001/XMLSchema#boolean",
+ },
+ "expandedlicensing_licenseXml": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/licenseXml",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "expandedlicensing_listVersionAdded": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/listVersionAdded",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "expandedlicensing_member": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/member",
+ "@type": "@vocab",
+ },
+ "expandedlicensing_obsoletedBy": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/obsoletedBy",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "expandedlicensing_seeAlso": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/seeAlso",
+ "@type": "http://www.w3.org/2001/XMLSchema#anyURI",
+ },
+ "expandedlicensing_standardAdditionTemplate": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/standardAdditionTemplate",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "expandedlicensing_standardLicenseHeader": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/standardLicenseHeader",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "expandedlicensing_standardLicenseTemplate": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/standardLicenseTemplate",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "expandedlicensing_subjectAddition": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/subjectAddition",
+ "@type": "@vocab",
+ },
+ "expandedlicensing_subjectExtendableLicense": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/subjectExtendableLicense",
+ "@type": "@vocab",
+ },
+ "expandedlicensing_subjectLicense": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/ExpandedLicensing/subjectLicense",
+ "@type": "@vocab",
+ },
+ "extension": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/extension",
+ "@type": "@vocab",
+ },
+ "extension_CdxPropertiesExtension": "https://spdx.org/rdf/3.0.1/terms/Extension/CdxPropertiesExtension",
+ "extension_CdxPropertyEntry": "https://spdx.org/rdf/3.0.1/terms/Extension/CdxPropertyEntry",
+ "extension_Extension": "https://spdx.org/rdf/3.0.1/terms/Extension/Extension",
+ "extension_cdxPropName": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Extension/cdxPropName",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "extension_cdxPropValue": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Extension/cdxPropValue",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "extension_cdxProperty": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Extension/cdxProperty",
+ "@type": "@vocab",
+ },
+ "externalIdentifier": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier",
+ "@type": "@vocab",
+ },
+ "externalIdentifierType": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifierType/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifierType",
+ "@type": "@vocab",
+ },
+ "externalRef": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/externalRef",
+ "@type": "@vocab",
+ },
+ "externalRefType": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Core/ExternalRefType/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/externalRefType",
+ "@type": "@vocab",
+ },
+ "externalSpdxId": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/externalSpdxId",
+ "@type": "http://www.w3.org/2001/XMLSchema#anyURI",
+ },
+ "from": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/from",
+ "@type": "@vocab",
+ },
+ "hashValue": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/hashValue",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "identifier": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/identifier",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "identifierLocator": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/identifierLocator",
+ "@type": "http://www.w3.org/2001/XMLSchema#anyURI",
+ },
+ "import": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/import",
+ "@type": "@vocab",
+ },
+ "issuingAuthority": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/issuingAuthority",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "key": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/key",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "locationHint": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/locationHint",
+ "@type": "http://www.w3.org/2001/XMLSchema#anyURI",
+ },
+ "locator": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/locator",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "name": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/name",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "namespace": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/namespace",
+ "@type": "http://www.w3.org/2001/XMLSchema#anyURI",
+ },
+ "namespaceMap": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/namespaceMap",
+ "@type": "@vocab",
+ },
+ "originatedBy": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/originatedBy",
+ "@type": "@vocab",
+ },
+ "packageVerificationCodeExcludedFile": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/packageVerificationCodeExcludedFile",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "prefix": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/prefix",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "profileConformance": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Core/ProfileIdentifierType/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/profileConformance",
+ "@type": "@vocab",
+ },
+ "relationshipType": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/relationshipType",
+ "@type": "@vocab",
+ },
+ "releaseTime": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/releaseTime",
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
+ },
+ "rootElement": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/rootElement",
+ "@type": "@vocab",
+ },
+ "scope": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Core/LifecycleScopeType/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/scope",
+ "@type": "@vocab",
+ },
+ "security_CvssSeverityType": "https://spdx.org/rdf/3.0.1/terms/Security/CvssSeverityType",
+ "security_CvssV2VulnAssessmentRelationship": "https://spdx.org/rdf/3.0.1/terms/Security/CvssV2VulnAssessmentRelationship",
+ "security_CvssV3VulnAssessmentRelationship": "https://spdx.org/rdf/3.0.1/terms/Security/CvssV3VulnAssessmentRelationship",
+ "security_CvssV4VulnAssessmentRelationship": "https://spdx.org/rdf/3.0.1/terms/Security/CvssV4VulnAssessmentRelationship",
+ "security_EpssVulnAssessmentRelationship": "https://spdx.org/rdf/3.0.1/terms/Security/EpssVulnAssessmentRelationship",
+ "security_ExploitCatalogType": "https://spdx.org/rdf/3.0.1/terms/Security/ExploitCatalogType",
+ "security_ExploitCatalogVulnAssessmentRelationship": "https://spdx.org/rdf/3.0.1/terms/Security/ExploitCatalogVulnAssessmentRelationship",
+ "security_SsvcDecisionType": "https://spdx.org/rdf/3.0.1/terms/Security/SsvcDecisionType",
+ "security_SsvcVulnAssessmentRelationship": "https://spdx.org/rdf/3.0.1/terms/Security/SsvcVulnAssessmentRelationship",
+ "security_VexAffectedVulnAssessmentRelationship": "https://spdx.org/rdf/3.0.1/terms/Security/VexAffectedVulnAssessmentRelationship",
+ "security_VexFixedVulnAssessmentRelationship": "https://spdx.org/rdf/3.0.1/terms/Security/VexFixedVulnAssessmentRelationship",
+ "security_VexJustificationType": "https://spdx.org/rdf/3.0.1/terms/Security/VexJustificationType",
+ "security_VexNotAffectedVulnAssessmentRelationship": "https://spdx.org/rdf/3.0.1/terms/Security/VexNotAffectedVulnAssessmentRelationship",
+ "security_VexUnderInvestigationVulnAssessmentRelationship": "https://spdx.org/rdf/3.0.1/terms/Security/VexUnderInvestigationVulnAssessmentRelationship",
+ "security_VexVulnAssessmentRelationship": "https://spdx.org/rdf/3.0.1/terms/Security/VexVulnAssessmentRelationship",
+ "security_VulnAssessmentRelationship": "https://spdx.org/rdf/3.0.1/terms/Security/VulnAssessmentRelationship",
+ "security_Vulnerability": "https://spdx.org/rdf/3.0.1/terms/Security/Vulnerability",
+ "security_actionStatement": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Security/actionStatement",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "security_actionStatementTime": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Security/actionStatementTime",
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
+ },
+ "security_assessedElement": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Security/assessedElement",
+ "@type": "@vocab",
+ },
+ "security_catalogType": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Security/ExploitCatalogType/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Security/catalogType",
+ "@type": "@vocab",
+ },
+ "security_decisionType": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Security/SsvcDecisionType/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Security/decisionType",
+ "@type": "@vocab",
+ },
+ "security_exploited": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Security/exploited",
+ "@type": "http://www.w3.org/2001/XMLSchema#boolean",
+ },
+ "security_impactStatement": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Security/impactStatement",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "security_impactStatementTime": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Security/impactStatementTime",
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
+ },
+ "security_justificationType": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Security/VexJustificationType/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Security/justificationType",
+ "@type": "@vocab",
+ },
+ "security_locator": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Security/locator",
+ "@type": "http://www.w3.org/2001/XMLSchema#anyURI",
+ },
+ "security_modifiedTime": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Security/modifiedTime",
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
+ },
+ "security_percentile": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Security/percentile",
+ "@type": "http://www.w3.org/2001/XMLSchema#decimal",
+ },
+ "security_probability": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Security/probability",
+ "@type": "http://www.w3.org/2001/XMLSchema#decimal",
+ },
+ "security_publishedTime": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Security/publishedTime",
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
+ },
+ "security_score": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Security/score",
+ "@type": "http://www.w3.org/2001/XMLSchema#decimal",
+ },
+ "security_severity": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Security/CvssSeverityType/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Security/severity",
+ "@type": "@vocab",
+ },
+ "security_statusNotes": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Security/statusNotes",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "security_vectorString": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Security/vectorString",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "security_vexVersion": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Security/vexVersion",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "security_withdrawnTime": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Security/withdrawnTime",
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
+ },
+ "simplelicensing_AnyLicenseInfo": "https://spdx.org/rdf/3.0.1/terms/SimpleLicensing/AnyLicenseInfo",
+ "simplelicensing_LicenseExpression": "https://spdx.org/rdf/3.0.1/terms/SimpleLicensing/LicenseExpression",
+ "simplelicensing_SimpleLicensingText": "https://spdx.org/rdf/3.0.1/terms/SimpleLicensing/SimpleLicensingText",
+ "simplelicensing_customIdToUri": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/SimpleLicensing/customIdToUri",
+ "@type": "@vocab",
+ },
+ "simplelicensing_licenseExpression": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/SimpleLicensing/licenseExpression",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "simplelicensing_licenseListVersion": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/SimpleLicensing/licenseListVersion",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "simplelicensing_licenseText": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/SimpleLicensing/licenseText",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "software_ContentIdentifier": "https://spdx.org/rdf/3.0.1/terms/Software/ContentIdentifier",
+ "software_ContentIdentifierType": "https://spdx.org/rdf/3.0.1/terms/Software/ContentIdentifierType",
+ "software_File": "https://spdx.org/rdf/3.0.1/terms/Software/File",
+ "software_FileKindType": "https://spdx.org/rdf/3.0.1/terms/Software/FileKindType",
+ "software_Package": "https://spdx.org/rdf/3.0.1/terms/Software/Package",
+ "software_Sbom": "https://spdx.org/rdf/3.0.1/terms/Software/Sbom",
+ "software_SbomType": "https://spdx.org/rdf/3.0.1/terms/Software/SbomType",
+ "software_Snippet": "https://spdx.org/rdf/3.0.1/terms/Software/Snippet",
+ "software_SoftwareArtifact": "https://spdx.org/rdf/3.0.1/terms/Software/SoftwareArtifact",
+ "software_SoftwarePurpose": "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose",
+ "software_additionalPurpose": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Software/additionalPurpose",
+ "@type": "@vocab",
+ },
+ "software_attributionText": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Software/attributionText",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "software_byteRange": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Software/byteRange",
+ "@type": "https://spdx.org/rdf/3.0.1/terms/Core/PositiveIntegerRange",
+ },
+ "software_contentIdentifier": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Software/contentIdentifier",
+ "@type": "https://spdx.org/rdf/3.0.1/terms/Software/ContentIdentifier",
+ },
+ "software_contentIdentifierType": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Software/ContentIdentifierType/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Software/contentIdentifierType",
+ "@type": "@vocab",
+ },
+ "software_contentIdentifierValue": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Software/contentIdentifierValue",
+ "@type": "http://www.w3.org/2001/XMLSchema#anyURI",
+ },
+ "software_copyrightText": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Software/copyrightText",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "software_downloadLocation": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Software/downloadLocation",
+ "@type": "http://www.w3.org/2001/XMLSchema#anyURI",
+ },
+ "software_fileKind": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Software/FileKindType/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Software/fileKind",
+ "@type": "@vocab",
+ },
+ "software_homePage": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Software/homePage",
+ "@type": "http://www.w3.org/2001/XMLSchema#anyURI",
+ },
+ "software_lineRange": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Software/lineRange",
+ "@type": "https://spdx.org/rdf/3.0.1/terms/Core/PositiveIntegerRange",
+ },
+ "software_packageUrl": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Software/packageUrl",
+ "@type": "http://www.w3.org/2001/XMLSchema#anyURI",
+ },
+ "software_packageVersion": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Software/packageVersion",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "software_primaryPurpose": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Software/primaryPurpose",
+ "@type": "@vocab",
+ },
+ "software_sbomType": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Software/SbomType/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Software/sbomType",
+ "@type": "@vocab",
+ },
+ "software_snippetFromFile": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Software/snippetFromFile",
+ "@type": "@vocab",
+ },
+ "software_sourceInfo": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Software/sourceInfo",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "spdx": "https://spdx.org/rdf/3.0.1/terms/",
+ "spdxId": "@id",
+ "specVersion": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/specVersion",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "standardName": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/standardName",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "startTime": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/startTime",
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
+ },
+ "statement": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/statement",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "subject": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/subject",
+ "@type": "@vocab",
+ },
+ "summary": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/summary",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "suppliedBy": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/suppliedBy",
+ "@type": "@vocab",
+ },
+ "supportLevel": map[string]any{
+ "@context": map[string]any{"@vocab": "https://spdx.org/rdf/3.0.1/terms/Core/SupportType/"},
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/supportLevel",
+ "@type": "@vocab",
+ },
+ "to": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/to",
+ "@type": "@vocab",
+ },
+ "type": "@type",
+ "validUntilTime": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/validUntilTime",
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
+ },
+ "value": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/value",
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ },
+ "verifiedUsing": map[string]any{
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/verifiedUsing",
+ "@type": "@vocab",
+ },
+ }},
+ NewExternalIRI,
+ AIPackage{},
+ Agent{},
+ Annotation{},
+ AnnotationType{},
+ AnnotationType_Other,
+ AnnotationType_Review,
+ BOM{},
+ Build{},
+ Bundle{},
+ CdxPropertiesExtension{},
+ CdxPropertyEntry{},
+ ConfidentialityLevelType{},
+ ConfidentialityLevelType_Amber,
+ ConfidentialityLevelType_Clear,
+ ConfidentialityLevelType_Green,
+ ConfidentialityLevelType_Red,
+ ConjunctiveLicenseSet{},
+ ContentIdentifier{},
+ ContentIdentifierType{},
+ ContentIdentifierType_Gitoid,
+ ContentIdentifierType_Swhid,
+ CreationInfo{},
+ CustomLicense{},
+ CustomLicenseAddition{},
+ CvssSeverityType{},
+ CvssSeverityType_Critical,
+ CvssSeverityType_High,
+ CvssSeverityType_Low,
+ CvssSeverityType_Medium,
+ CvssSeverityType_None,
+ CvssV2VulnAssessmentRelationship{},
+ CvssV3VulnAssessmentRelationship{},
+ CvssV4VulnAssessmentRelationship{},
+ DatasetAvailabilityType{},
+ DatasetAvailabilityType_Clickthrough,
+ DatasetAvailabilityType_DirectDownload,
+ DatasetAvailabilityType_Query,
+ DatasetAvailabilityType_Registration,
+ DatasetAvailabilityType_ScrapingScript,
+ DatasetPackage{},
+ DatasetType{},
+ DatasetType_Audio,
+ DatasetType_Categorical,
+ DatasetType_Graph,
+ DatasetType_Image,
+ DatasetType_NoAssertion,
+ DatasetType_Numeric,
+ DatasetType_Other,
+ DatasetType_Sensor,
+ DatasetType_Structured,
+ DatasetType_Syntactic,
+ DatasetType_Text,
+ DatasetType_Timeseries,
+ DatasetType_Timestamp,
+ DatasetType_Video,
+ DictionaryEntry{},
+ DisjunctiveLicenseSet{},
+ EnergyConsumption{},
+ EnergyConsumptionDescription{},
+ EnergyUnitType{},
+ EnergyUnitType_KilowattHour,
+ EnergyUnitType_Megajoule,
+ EnergyUnitType_Other,
+ EpssVulnAssessmentRelationship{},
+ ExploitCatalogType{},
+ ExploitCatalogType_Kev,
+ ExploitCatalogType_Other,
+ ExploitCatalogVulnAssessmentRelationship{},
+ ExternalIdentifier{},
+ ExternalIdentifierType{},
+ ExternalIdentifierType_Cpe22,
+ ExternalIdentifierType_Cpe23,
+ ExternalIdentifierType_Cve,
+ ExternalIdentifierType_Email,
+ ExternalIdentifierType_Gitoid,
+ ExternalIdentifierType_Other,
+ ExternalIdentifierType_PackageURL,
+ ExternalIdentifierType_SecurityOther,
+ ExternalIdentifierType_Swhid,
+ ExternalIdentifierType_Swid,
+ ExternalIdentifierType_UrlScheme,
+ ExternalMap{},
+ ExternalRef{},
+ ExternalRefType{},
+ ExternalRefType_AltDownloadLocation,
+ ExternalRefType_AltWebPage,
+ ExternalRefType_BinaryArtifact,
+ ExternalRefType_Bower,
+ ExternalRefType_BuildMeta,
+ ExternalRefType_BuildSystem,
+ ExternalRefType_CertificationReport,
+ ExternalRefType_Chat,
+ ExternalRefType_ComponentAnalysisReport,
+ ExternalRefType_Cwe,
+ ExternalRefType_Documentation,
+ ExternalRefType_DynamicAnalysisReport,
+ ExternalRefType_EolNotice,
+ ExternalRefType_ExportControlAssessment,
+ ExternalRefType_Funding,
+ ExternalRefType_IssueTracker,
+ ExternalRefType_License,
+ ExternalRefType_MailingList,
+ ExternalRefType_MavenCentral,
+ ExternalRefType_Metrics,
+ ExternalRefType_Npm,
+ ExternalRefType_Nuget,
+ ExternalRefType_Other,
+ ExternalRefType_PrivacyAssessment,
+ ExternalRefType_ProductMetadata,
+ ExternalRefType_PurchaseOrder,
+ ExternalRefType_QualityAssessmentReport,
+ ExternalRefType_ReleaseHistory,
+ ExternalRefType_ReleaseNotes,
+ ExternalRefType_RiskAssessment,
+ ExternalRefType_RuntimeAnalysisReport,
+ ExternalRefType_SecureSoftwareAttestation,
+ ExternalRefType_SecurityAdversaryModel,
+ ExternalRefType_SecurityAdvisory,
+ ExternalRefType_SecurityFix,
+ ExternalRefType_SecurityOther,
+ ExternalRefType_SecurityPenTestReport,
+ ExternalRefType_SecurityPolicy,
+ ExternalRefType_SecurityThreatModel,
+ ExternalRefType_SocialMedia,
+ ExternalRefType_SourceArtifact,
+ ExternalRefType_StaticAnalysisReport,
+ ExternalRefType_Support,
+ ExternalRefType_Vcs,
+ ExternalRefType_VulnerabilityDisclosureReport,
+ ExternalRefType_VulnerabilityExploitabilityAssessment,
+ File{},
+ FileKindType{},
+ FileKindType_Directory,
+ FileKindType_File,
+ Hash{},
+ HashAlgorithm{},
+ HashAlgorithm_Adler32,
+ HashAlgorithm_Blake2b256,
+ HashAlgorithm_Blake2b384,
+ HashAlgorithm_Blake2b512,
+ HashAlgorithm_Blake3,
+ HashAlgorithm_CrystalsDilithium,
+ HashAlgorithm_CrystalsKyber,
+ HashAlgorithm_Falcon,
+ HashAlgorithm_Md2,
+ HashAlgorithm_Md4,
+ HashAlgorithm_Md5,
+ HashAlgorithm_Md6,
+ HashAlgorithm_Other,
+ HashAlgorithm_Sha1,
+ HashAlgorithm_Sha224,
+ HashAlgorithm_Sha256,
+ HashAlgorithm_Sha384,
+ HashAlgorithm_Sha3_224,
+ HashAlgorithm_Sha3_256,
+ HashAlgorithm_Sha3_384,
+ HashAlgorithm_Sha3_512,
+ HashAlgorithm_Sha512,
+ IndividualElement{},
+ IndividualElement_NoAssertionElement,
+ IndividualElement_NoneElement,
+ IndividualLicensingInfo{},
+ IndividualLicensingInfo_NoAssertionLicense,
+ IndividualLicensingInfo_NoneLicense,
+ LicenseExpression{},
+ LifecycleScopeType{},
+ LifecycleScopeType_Build,
+ LifecycleScopeType_Design,
+ LifecycleScopeType_Development,
+ LifecycleScopeType_Other,
+ LifecycleScopeType_Runtime,
+ LifecycleScopeType_Test,
+ LifecycleScopedRelationship{},
+ ListedLicense{},
+ ListedLicenseException{},
+ NamespaceMap{},
+ OrLaterOperator{},
+ Organization{},
+ Organization_SpdxOrganization,
+ Package{},
+ PackageVerificationCode{},
+ Person{},
+ PositiveIntegerRange{},
+ PresenceType{},
+ PresenceType_No,
+ PresenceType_NoAssertion,
+ PresenceType_Yes,
+ ProfileIdentifierType{},
+ ProfileIdentifierType_Ai,
+ ProfileIdentifierType_Build,
+ ProfileIdentifierType_Core,
+ ProfileIdentifierType_Dataset,
+ ProfileIdentifierType_ExpandedLicensing,
+ ProfileIdentifierType_Extension,
+ ProfileIdentifierType_Lite,
+ ProfileIdentifierType_Security,
+ ProfileIdentifierType_SimpleLicensing,
+ ProfileIdentifierType_Software,
+ Relationship{},
+ RelationshipCompleteness{},
+ RelationshipCompleteness_Complete,
+ RelationshipCompleteness_Incomplete,
+ RelationshipCompleteness_NoAssertion,
+ RelationshipType{},
+ RelationshipType_Affects,
+ RelationshipType_AmendedBy,
+ RelationshipType_AncestorOf,
+ RelationshipType_AvailableFrom,
+ RelationshipType_Configures,
+ RelationshipType_Contains,
+ RelationshipType_CoordinatedBy,
+ RelationshipType_CopiedTo,
+ RelationshipType_DelegatedTo,
+ RelationshipType_DependsOn,
+ RelationshipType_DescendantOf,
+ RelationshipType_Describes,
+ RelationshipType_DoesNotAffect,
+ RelationshipType_ExpandsTo,
+ RelationshipType_ExploitCreatedBy,
+ RelationshipType_FixedBy,
+ RelationshipType_FixedIn,
+ RelationshipType_FoundBy,
+ RelationshipType_Generates,
+ RelationshipType_HasAddedFile,
+ RelationshipType_HasAssessmentFor,
+ RelationshipType_HasAssociatedVulnerability,
+ RelationshipType_HasConcludedLicense,
+ RelationshipType_HasDataFile,
+ RelationshipType_HasDeclaredLicense,
+ RelationshipType_HasDeletedFile,
+ RelationshipType_HasDependencyManifest,
+ RelationshipType_HasDistributionArtifact,
+ RelationshipType_HasDocumentation,
+ RelationshipType_HasDynamicLink,
+ RelationshipType_HasEvidence,
+ RelationshipType_HasExample,
+ RelationshipType_HasHost,
+ RelationshipType_HasInput,
+ RelationshipType_HasMetadata,
+ RelationshipType_HasOptionalComponent,
+ RelationshipType_HasOptionalDependency,
+ RelationshipType_HasOutput,
+ RelationshipType_HasPrerequisite,
+ RelationshipType_HasProvidedDependency,
+ RelationshipType_HasRequirement,
+ RelationshipType_HasSpecification,
+ RelationshipType_HasStaticLink,
+ RelationshipType_HasTest,
+ RelationshipType_HasTestCase,
+ RelationshipType_HasVariant,
+ RelationshipType_InvokedBy,
+ RelationshipType_ModifiedBy,
+ RelationshipType_Other,
+ RelationshipType_PackagedBy,
+ RelationshipType_PatchedBy,
+ RelationshipType_PublishedBy,
+ RelationshipType_ReportedBy,
+ RelationshipType_RepublishedBy,
+ RelationshipType_SerializedInArtifact,
+ RelationshipType_TestedOn,
+ RelationshipType_TrainedOn,
+ RelationshipType_UnderInvestigationFor,
+ RelationshipType_UsesTool,
+ SBOM{},
+ SafetyRiskAssessmentType{},
+ SafetyRiskAssessmentType_High,
+ SafetyRiskAssessmentType_Low,
+ SafetyRiskAssessmentType_Medium,
+ SafetyRiskAssessmentType_Serious,
+ SbomType{},
+ SbomType_Analyzed,
+ SbomType_Build,
+ SbomType_Deployed,
+ SbomType_Design,
+ SbomType_Runtime,
+ SbomType_Source,
+ SimpleLicensingText{},
+ Snippet{},
+ SoftwareAgent{},
+ SoftwarePurpose{},
+ SoftwarePurpose_Application,
+ SoftwarePurpose_Archive,
+ SoftwarePurpose_Bom,
+ SoftwarePurpose_Configuration,
+ SoftwarePurpose_Container,
+ SoftwarePurpose_Data,
+ SoftwarePurpose_Device,
+ SoftwarePurpose_DeviceDriver,
+ SoftwarePurpose_DiskImage,
+ SoftwarePurpose_Documentation,
+ SoftwarePurpose_Evidence,
+ SoftwarePurpose_Executable,
+ SoftwarePurpose_File,
+ SoftwarePurpose_FilesystemImage,
+ SoftwarePurpose_Firmware,
+ SoftwarePurpose_Framework,
+ SoftwarePurpose_Install,
+ SoftwarePurpose_Library,
+ SoftwarePurpose_Manifest,
+ SoftwarePurpose_Model,
+ SoftwarePurpose_Module,
+ SoftwarePurpose_OperatingSystem,
+ SoftwarePurpose_Other,
+ SoftwarePurpose_Patch,
+ SoftwarePurpose_Platform,
+ SoftwarePurpose_Requirement,
+ SoftwarePurpose_Source,
+ SoftwarePurpose_Specification,
+ SoftwarePurpose_Test,
+ SpdxDocument{},
+ SsvcDecisionType{},
+ SsvcDecisionType_Act,
+ SsvcDecisionType_Attend,
+ SsvcDecisionType_Track,
+ SsvcDecisionType_TrackStar,
+ SsvcVulnAssessmentRelationship{},
+ SupportType{},
+ SupportType_Deployed,
+ SupportType_Development,
+ SupportType_EndOfSupport,
+ SupportType_LimitedSupport,
+ SupportType_NoAssertion,
+ SupportType_NoSupport,
+ SupportType_Support,
+ Tool{},
+ VexAffectedVulnAssessmentRelationship{},
+ VexFixedVulnAssessmentRelationship{},
+ VexJustificationType{},
+ VexJustificationType_ComponentNotPresent,
+ VexJustificationType_InlineMitigationsAlreadyExist,
+ VexJustificationType_VulnerableCodeCannotBeControlledByAdversary,
+ VexJustificationType_VulnerableCodeNotInExecutePath,
+ VexJustificationType_VulnerableCodeNotPresent,
+ VexNotAffectedVulnAssessmentRelationship{},
+ VexUnderInvestigationVulnAssessmentRelationship{},
+ Vulnerability{},
+ WithAdditionOperator{},
+ )
+}
diff --git a/spdx/v3/v3_0/model_validations.go b/spdx/v3/v3_0/model_validations.go
new file mode 100755
index 00000000..ed86ffd9
--- /dev/null
+++ b/spdx/v3/v3_0/model_validations.go
@@ -0,0 +1,1944 @@
+// Generated by github.com/spdx/tools-golang/spdx/v3/internal/ld
+//
+// SPDX-License-Identifier: MIT
+
+package v3_0
+
+import "github.com/spdx/tools-golang/spdx/v3/internal/ld"
+
+func (o *AIPackage) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.SupportLevels,
+ ld.ValidateAll(ld.ValidateIRI(
+ SupportType_Development,
+ SupportType_Support,
+ SupportType_Deployed,
+ SupportType_LimitedSupport,
+ SupportType_EndOfSupport,
+ SupportType_NoSupport,
+ SupportType_NoAssertion,
+ ))),
+ ld.ValidateProperty(o, &o.AdditionalPurposes,
+ ld.ValidateAll(ld.ValidateIRI(
+ SoftwarePurpose_Application,
+ SoftwarePurpose_Archive,
+ SoftwarePurpose_Bom,
+ SoftwarePurpose_Configuration,
+ SoftwarePurpose_Container,
+ SoftwarePurpose_Data,
+ SoftwarePurpose_Device,
+ SoftwarePurpose_DiskImage,
+ SoftwarePurpose_DeviceDriver,
+ SoftwarePurpose_Documentation,
+ SoftwarePurpose_Evidence,
+ SoftwarePurpose_Executable,
+ SoftwarePurpose_File,
+ SoftwarePurpose_FilesystemImage,
+ SoftwarePurpose_Firmware,
+ SoftwarePurpose_Framework,
+ SoftwarePurpose_Install,
+ SoftwarePurpose_Library,
+ SoftwarePurpose_Manifest,
+ SoftwarePurpose_Model,
+ SoftwarePurpose_Module,
+ SoftwarePurpose_OperatingSystem,
+ SoftwarePurpose_Other,
+ SoftwarePurpose_Patch,
+ SoftwarePurpose_Platform,
+ SoftwarePurpose_Requirement,
+ SoftwarePurpose_Source,
+ SoftwarePurpose_Specification,
+ SoftwarePurpose_Test,
+ ))),
+ ld.ValidateProperty(o, &o.PrimaryPurpose,
+ ld.ValidateIRI(
+ SoftwarePurpose_Application,
+ SoftwarePurpose_Archive,
+ SoftwarePurpose_Bom,
+ SoftwarePurpose_Configuration,
+ SoftwarePurpose_Container,
+ SoftwarePurpose_Data,
+ SoftwarePurpose_Device,
+ SoftwarePurpose_DiskImage,
+ SoftwarePurpose_DeviceDriver,
+ SoftwarePurpose_Documentation,
+ SoftwarePurpose_Evidence,
+ SoftwarePurpose_Executable,
+ SoftwarePurpose_File,
+ SoftwarePurpose_FilesystemImage,
+ SoftwarePurpose_Firmware,
+ SoftwarePurpose_Framework,
+ SoftwarePurpose_Install,
+ SoftwarePurpose_Library,
+ SoftwarePurpose_Manifest,
+ SoftwarePurpose_Model,
+ SoftwarePurpose_Module,
+ SoftwarePurpose_OperatingSystem,
+ SoftwarePurpose_Other,
+ SoftwarePurpose_Patch,
+ SoftwarePurpose_Platform,
+ SoftwarePurpose_Requirement,
+ SoftwarePurpose_Source,
+ SoftwarePurpose_Specification,
+ SoftwarePurpose_Test,
+ )),
+ ld.ValidateProperty(o, &o.UseSensitivePersonalInformation,
+ ld.ValidateIRI(
+ PresenceType_Yes,
+ PresenceType_No,
+ PresenceType_NoAssertion,
+ )),
+ ld.ValidateProperty(o, &o.AutonomyType,
+ ld.ValidateIRI(
+ PresenceType_Yes,
+ PresenceType_No,
+ PresenceType_NoAssertion,
+ )),
+ ld.ValidateProperty(o, &o.SafetyRiskAssessment,
+ ld.ValidateIRI(
+ SafetyRiskAssessmentType_Serious,
+ SafetyRiskAssessmentType_High,
+ SafetyRiskAssessmentType_Medium,
+ SafetyRiskAssessmentType_Low,
+ )))
+}
+
+func (o *Agent) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo))
+}
+
+func (o *Annotation) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.Subject),
+ ld.ValidateProperty(o, &o.ContentType,
+ ld.ValidateExpression("^[^\\/]+\\/[^\\/]+$")),
+ ld.ValidateProperty(o, &o.Type,
+ ld.ValidateIRI(
+ AnnotationType_Other,
+ AnnotationType_Review,
+ )))
+}
+
+func (o *AnnotationType) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *BOM) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.ProfileConformances,
+ ld.ValidateAll(ld.ValidateIRI(
+ ProfileIdentifierType_Core,
+ ProfileIdentifierType_Software,
+ ProfileIdentifierType_SimpleLicensing,
+ ProfileIdentifierType_ExpandedLicensing,
+ ProfileIdentifierType_Security,
+ ProfileIdentifierType_Build,
+ ProfileIdentifierType_Ai,
+ ProfileIdentifierType_Dataset,
+ ProfileIdentifierType_Extension,
+ ProfileIdentifierType_Lite,
+ ))))
+}
+
+func (o *Build) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.Type))
+}
+
+func (o *Bundle) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.ProfileConformances,
+ ld.ValidateAll(ld.ValidateIRI(
+ ProfileIdentifierType_Core,
+ ProfileIdentifierType_Software,
+ ProfileIdentifierType_SimpleLicensing,
+ ProfileIdentifierType_ExpandedLicensing,
+ ProfileIdentifierType_Security,
+ ProfileIdentifierType_Build,
+ ProfileIdentifierType_Ai,
+ ProfileIdentifierType_Dataset,
+ ProfileIdentifierType_Extension,
+ ProfileIdentifierType_Lite,
+ ))))
+}
+
+func (o *CdxPropertiesExtension) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CdxProperties,
+ ld.ValidateMinCount[CdxPropertyEntryList](1)))
+}
+
+func (o *CdxPropertyEntry) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CdxPropName))
+}
+
+func (o *ConfidentialityLevelType) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *ConjunctiveLicenseSet) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.Members,
+ ld.ValidateMinCount[LicenseInfoList](2)))
+}
+
+func (o *ContentIdentifier) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.Type,
+ ld.ValidateIRI(
+ ContentIdentifierType_Gitoid,
+ ContentIdentifierType_Swhid,
+ )),
+ ld.ValidateProperty(o, &o.Value))
+}
+
+func (o *ContentIdentifierType) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *CreationInfo) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.SpecVersion,
+ ld.ValidateExpression("^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$")),
+ ld.ValidateProperty(o, &o.Created),
+ ld.ValidateProperty(o, &o.CreatedBy,
+ ld.ValidateMinCount[AgentList](1)))
+}
+
+func (o *CustomLicense) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.Text))
+}
+
+func (o *CustomLicenseAddition) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.AdditionText))
+}
+
+func (o *CvssSeverityType) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *CvssV2VulnAssessmentRelationship) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.Completeness,
+ ld.ValidateIRI(
+ RelationshipCompleteness_Incomplete,
+ RelationshipCompleteness_Complete,
+ RelationshipCompleteness_NoAssertion,
+ )),
+ ld.ValidateProperty(o, &o.To,
+ ld.ValidateMinCount[ElementList](1)),
+ ld.ValidateProperty(o, &o.From),
+ ld.ValidateProperty(o, &o.Type,
+ ld.ValidateIRI(
+ RelationshipType_Affects,
+ RelationshipType_AmendedBy,
+ RelationshipType_AncestorOf,
+ RelationshipType_AvailableFrom,
+ RelationshipType_Configures,
+ RelationshipType_Contains,
+ RelationshipType_CoordinatedBy,
+ RelationshipType_CopiedTo,
+ RelationshipType_DelegatedTo,
+ RelationshipType_DependsOn,
+ RelationshipType_DescendantOf,
+ RelationshipType_Describes,
+ RelationshipType_DoesNotAffect,
+ RelationshipType_ExpandsTo,
+ RelationshipType_ExploitCreatedBy,
+ RelationshipType_FixedBy,
+ RelationshipType_FixedIn,
+ RelationshipType_FoundBy,
+ RelationshipType_Generates,
+ RelationshipType_HasAddedFile,
+ RelationshipType_HasAssessmentFor,
+ RelationshipType_HasAssociatedVulnerability,
+ RelationshipType_HasConcludedLicense,
+ RelationshipType_HasDataFile,
+ RelationshipType_HasDeclaredLicense,
+ RelationshipType_HasDeletedFile,
+ RelationshipType_HasDependencyManifest,
+ RelationshipType_HasDistributionArtifact,
+ RelationshipType_HasDocumentation,
+ RelationshipType_HasDynamicLink,
+ RelationshipType_HasEvidence,
+ RelationshipType_HasExample,
+ RelationshipType_HasHost,
+ RelationshipType_HasInput,
+ RelationshipType_HasMetadata,
+ RelationshipType_HasOptionalComponent,
+ RelationshipType_HasOptionalDependency,
+ RelationshipType_HasOutput,
+ RelationshipType_HasPrerequisite,
+ RelationshipType_HasProvidedDependency,
+ RelationshipType_HasRequirement,
+ RelationshipType_HasSpecification,
+ RelationshipType_HasStaticLink,
+ RelationshipType_HasTest,
+ RelationshipType_HasTestCase,
+ RelationshipType_HasVariant,
+ RelationshipType_InvokedBy,
+ RelationshipType_ModifiedBy,
+ RelationshipType_Other,
+ RelationshipType_PackagedBy,
+ RelationshipType_PatchedBy,
+ RelationshipType_PublishedBy,
+ RelationshipType_ReportedBy,
+ RelationshipType_RepublishedBy,
+ RelationshipType_SerializedInArtifact,
+ RelationshipType_TestedOn,
+ RelationshipType_TrainedOn,
+ RelationshipType_UnderInvestigationFor,
+ RelationshipType_UsesTool,
+ )),
+ ld.ValidateProperty(o, &o.VectorString),
+ ld.ValidateProperty(o, &o.Score))
+}
+
+func (o *CvssV3VulnAssessmentRelationship) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.Completeness,
+ ld.ValidateIRI(
+ RelationshipCompleteness_Incomplete,
+ RelationshipCompleteness_Complete,
+ RelationshipCompleteness_NoAssertion,
+ )),
+ ld.ValidateProperty(o, &o.To,
+ ld.ValidateMinCount[ElementList](1)),
+ ld.ValidateProperty(o, &o.From),
+ ld.ValidateProperty(o, &o.Type,
+ ld.ValidateIRI(
+ RelationshipType_Affects,
+ RelationshipType_AmendedBy,
+ RelationshipType_AncestorOf,
+ RelationshipType_AvailableFrom,
+ RelationshipType_Configures,
+ RelationshipType_Contains,
+ RelationshipType_CoordinatedBy,
+ RelationshipType_CopiedTo,
+ RelationshipType_DelegatedTo,
+ RelationshipType_DependsOn,
+ RelationshipType_DescendantOf,
+ RelationshipType_Describes,
+ RelationshipType_DoesNotAffect,
+ RelationshipType_ExpandsTo,
+ RelationshipType_ExploitCreatedBy,
+ RelationshipType_FixedBy,
+ RelationshipType_FixedIn,
+ RelationshipType_FoundBy,
+ RelationshipType_Generates,
+ RelationshipType_HasAddedFile,
+ RelationshipType_HasAssessmentFor,
+ RelationshipType_HasAssociatedVulnerability,
+ RelationshipType_HasConcludedLicense,
+ RelationshipType_HasDataFile,
+ RelationshipType_HasDeclaredLicense,
+ RelationshipType_HasDeletedFile,
+ RelationshipType_HasDependencyManifest,
+ RelationshipType_HasDistributionArtifact,
+ RelationshipType_HasDocumentation,
+ RelationshipType_HasDynamicLink,
+ RelationshipType_HasEvidence,
+ RelationshipType_HasExample,
+ RelationshipType_HasHost,
+ RelationshipType_HasInput,
+ RelationshipType_HasMetadata,
+ RelationshipType_HasOptionalComponent,
+ RelationshipType_HasOptionalDependency,
+ RelationshipType_HasOutput,
+ RelationshipType_HasPrerequisite,
+ RelationshipType_HasProvidedDependency,
+ RelationshipType_HasRequirement,
+ RelationshipType_HasSpecification,
+ RelationshipType_HasStaticLink,
+ RelationshipType_HasTest,
+ RelationshipType_HasTestCase,
+ RelationshipType_HasVariant,
+ RelationshipType_InvokedBy,
+ RelationshipType_ModifiedBy,
+ RelationshipType_Other,
+ RelationshipType_PackagedBy,
+ RelationshipType_PatchedBy,
+ RelationshipType_PublishedBy,
+ RelationshipType_ReportedBy,
+ RelationshipType_RepublishedBy,
+ RelationshipType_SerializedInArtifact,
+ RelationshipType_TestedOn,
+ RelationshipType_TrainedOn,
+ RelationshipType_UnderInvestigationFor,
+ RelationshipType_UsesTool,
+ )),
+ ld.ValidateProperty(o, &o.Score),
+ ld.ValidateProperty(o, &o.Severity,
+ ld.ValidateIRI(
+ CvssSeverityType_Critical,
+ CvssSeverityType_High,
+ CvssSeverityType_Medium,
+ CvssSeverityType_Low,
+ CvssSeverityType_None,
+ )),
+ ld.ValidateProperty(o, &o.VectorString))
+}
+
+func (o *CvssV4VulnAssessmentRelationship) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.Completeness,
+ ld.ValidateIRI(
+ RelationshipCompleteness_Incomplete,
+ RelationshipCompleteness_Complete,
+ RelationshipCompleteness_NoAssertion,
+ )),
+ ld.ValidateProperty(o, &o.To,
+ ld.ValidateMinCount[ElementList](1)),
+ ld.ValidateProperty(o, &o.From),
+ ld.ValidateProperty(o, &o.Type,
+ ld.ValidateIRI(
+ RelationshipType_Affects,
+ RelationshipType_AmendedBy,
+ RelationshipType_AncestorOf,
+ RelationshipType_AvailableFrom,
+ RelationshipType_Configures,
+ RelationshipType_Contains,
+ RelationshipType_CoordinatedBy,
+ RelationshipType_CopiedTo,
+ RelationshipType_DelegatedTo,
+ RelationshipType_DependsOn,
+ RelationshipType_DescendantOf,
+ RelationshipType_Describes,
+ RelationshipType_DoesNotAffect,
+ RelationshipType_ExpandsTo,
+ RelationshipType_ExploitCreatedBy,
+ RelationshipType_FixedBy,
+ RelationshipType_FixedIn,
+ RelationshipType_FoundBy,
+ RelationshipType_Generates,
+ RelationshipType_HasAddedFile,
+ RelationshipType_HasAssessmentFor,
+ RelationshipType_HasAssociatedVulnerability,
+ RelationshipType_HasConcludedLicense,
+ RelationshipType_HasDataFile,
+ RelationshipType_HasDeclaredLicense,
+ RelationshipType_HasDeletedFile,
+ RelationshipType_HasDependencyManifest,
+ RelationshipType_HasDistributionArtifact,
+ RelationshipType_HasDocumentation,
+ RelationshipType_HasDynamicLink,
+ RelationshipType_HasEvidence,
+ RelationshipType_HasExample,
+ RelationshipType_HasHost,
+ RelationshipType_HasInput,
+ RelationshipType_HasMetadata,
+ RelationshipType_HasOptionalComponent,
+ RelationshipType_HasOptionalDependency,
+ RelationshipType_HasOutput,
+ RelationshipType_HasPrerequisite,
+ RelationshipType_HasProvidedDependency,
+ RelationshipType_HasRequirement,
+ RelationshipType_HasSpecification,
+ RelationshipType_HasStaticLink,
+ RelationshipType_HasTest,
+ RelationshipType_HasTestCase,
+ RelationshipType_HasVariant,
+ RelationshipType_InvokedBy,
+ RelationshipType_ModifiedBy,
+ RelationshipType_Other,
+ RelationshipType_PackagedBy,
+ RelationshipType_PatchedBy,
+ RelationshipType_PublishedBy,
+ RelationshipType_ReportedBy,
+ RelationshipType_RepublishedBy,
+ RelationshipType_SerializedInArtifact,
+ RelationshipType_TestedOn,
+ RelationshipType_TrainedOn,
+ RelationshipType_UnderInvestigationFor,
+ RelationshipType_UsesTool,
+ )),
+ ld.ValidateProperty(o, &o.Severity,
+ ld.ValidateIRI(
+ CvssSeverityType_Critical,
+ CvssSeverityType_High,
+ CvssSeverityType_Medium,
+ CvssSeverityType_Low,
+ CvssSeverityType_None,
+ )),
+ ld.ValidateProperty(o, &o.VectorString),
+ ld.ValidateProperty(o, &o.Score))
+}
+
+func (o *DatasetAvailabilityType) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *DatasetPackage) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.SupportLevels,
+ ld.ValidateAll(ld.ValidateIRI(
+ SupportType_Development,
+ SupportType_Support,
+ SupportType_Deployed,
+ SupportType_LimitedSupport,
+ SupportType_EndOfSupport,
+ SupportType_NoSupport,
+ SupportType_NoAssertion,
+ ))),
+ ld.ValidateProperty(o, &o.AdditionalPurposes,
+ ld.ValidateAll(ld.ValidateIRI(
+ SoftwarePurpose_Application,
+ SoftwarePurpose_Archive,
+ SoftwarePurpose_Bom,
+ SoftwarePurpose_Configuration,
+ SoftwarePurpose_Container,
+ SoftwarePurpose_Data,
+ SoftwarePurpose_Device,
+ SoftwarePurpose_DiskImage,
+ SoftwarePurpose_DeviceDriver,
+ SoftwarePurpose_Documentation,
+ SoftwarePurpose_Evidence,
+ SoftwarePurpose_Executable,
+ SoftwarePurpose_File,
+ SoftwarePurpose_FilesystemImage,
+ SoftwarePurpose_Firmware,
+ SoftwarePurpose_Framework,
+ SoftwarePurpose_Install,
+ SoftwarePurpose_Library,
+ SoftwarePurpose_Manifest,
+ SoftwarePurpose_Model,
+ SoftwarePurpose_Module,
+ SoftwarePurpose_OperatingSystem,
+ SoftwarePurpose_Other,
+ SoftwarePurpose_Patch,
+ SoftwarePurpose_Platform,
+ SoftwarePurpose_Requirement,
+ SoftwarePurpose_Source,
+ SoftwarePurpose_Specification,
+ SoftwarePurpose_Test,
+ ))),
+ ld.ValidateProperty(o, &o.PrimaryPurpose,
+ ld.ValidateIRI(
+ SoftwarePurpose_Application,
+ SoftwarePurpose_Archive,
+ SoftwarePurpose_Bom,
+ SoftwarePurpose_Configuration,
+ SoftwarePurpose_Container,
+ SoftwarePurpose_Data,
+ SoftwarePurpose_Device,
+ SoftwarePurpose_DiskImage,
+ SoftwarePurpose_DeviceDriver,
+ SoftwarePurpose_Documentation,
+ SoftwarePurpose_Evidence,
+ SoftwarePurpose_Executable,
+ SoftwarePurpose_File,
+ SoftwarePurpose_FilesystemImage,
+ SoftwarePurpose_Firmware,
+ SoftwarePurpose_Framework,
+ SoftwarePurpose_Install,
+ SoftwarePurpose_Library,
+ SoftwarePurpose_Manifest,
+ SoftwarePurpose_Model,
+ SoftwarePurpose_Module,
+ SoftwarePurpose_OperatingSystem,
+ SoftwarePurpose_Other,
+ SoftwarePurpose_Patch,
+ SoftwarePurpose_Platform,
+ SoftwarePurpose_Requirement,
+ SoftwarePurpose_Source,
+ SoftwarePurpose_Specification,
+ SoftwarePurpose_Test,
+ )),
+ ld.ValidateProperty(o, &o.ConfidentialityLevel,
+ ld.ValidateIRI(
+ ConfidentialityLevelType_Red,
+ ConfidentialityLevelType_Amber,
+ ConfidentialityLevelType_Green,
+ ConfidentialityLevelType_Clear,
+ )),
+ ld.ValidateProperty(o, &o.DatasetAvailability,
+ ld.ValidateIRI(
+ DatasetAvailabilityType_Clickthrough,
+ DatasetAvailabilityType_DirectDownload,
+ DatasetAvailabilityType_Query,
+ DatasetAvailabilityType_Registration,
+ DatasetAvailabilityType_ScrapingScript,
+ )),
+ ld.ValidateProperty(o, &o.HasSensitivePersonalInformation,
+ ld.ValidateIRI(
+ PresenceType_Yes,
+ PresenceType_No,
+ PresenceType_NoAssertion,
+ )),
+ ld.ValidateProperty(o, &o.DatasetTypes,
+ ld.ValidateMinCount[[]DatasetType](1),
+ ld.ValidateAll(ld.ValidateIRI(
+ DatasetType_Audio,
+ DatasetType_Categorical,
+ DatasetType_Graph,
+ DatasetType_Image,
+ DatasetType_NoAssertion,
+ DatasetType_Numeric,
+ DatasetType_Other,
+ DatasetType_Sensor,
+ DatasetType_Structured,
+ DatasetType_Syntactic,
+ DatasetType_Text,
+ DatasetType_Timeseries,
+ DatasetType_Timestamp,
+ DatasetType_Video,
+ ))))
+}
+
+func (o *DatasetType) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *DictionaryEntry) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.Key))
+}
+
+func (o *DisjunctiveLicenseSet) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.Members,
+ ld.ValidateMinCount[LicenseInfoList](2)))
+}
+
+func (o *EnergyConsumption) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *EnergyConsumptionDescription) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.EnergyQuantity),
+ ld.ValidateProperty(o, &o.EnergyUnit,
+ ld.ValidateIRI(
+ EnergyUnitType_KilowattHour,
+ EnergyUnitType_Megajoule,
+ EnergyUnitType_Other,
+ )))
+}
+
+func (o *EnergyUnitType) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *EpssVulnAssessmentRelationship) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.Completeness,
+ ld.ValidateIRI(
+ RelationshipCompleteness_Incomplete,
+ RelationshipCompleteness_Complete,
+ RelationshipCompleteness_NoAssertion,
+ )),
+ ld.ValidateProperty(o, &o.To,
+ ld.ValidateMinCount[ElementList](1)),
+ ld.ValidateProperty(o, &o.From),
+ ld.ValidateProperty(o, &o.Type,
+ ld.ValidateIRI(
+ RelationshipType_Affects,
+ RelationshipType_AmendedBy,
+ RelationshipType_AncestorOf,
+ RelationshipType_AvailableFrom,
+ RelationshipType_Configures,
+ RelationshipType_Contains,
+ RelationshipType_CoordinatedBy,
+ RelationshipType_CopiedTo,
+ RelationshipType_DelegatedTo,
+ RelationshipType_DependsOn,
+ RelationshipType_DescendantOf,
+ RelationshipType_Describes,
+ RelationshipType_DoesNotAffect,
+ RelationshipType_ExpandsTo,
+ RelationshipType_ExploitCreatedBy,
+ RelationshipType_FixedBy,
+ RelationshipType_FixedIn,
+ RelationshipType_FoundBy,
+ RelationshipType_Generates,
+ RelationshipType_HasAddedFile,
+ RelationshipType_HasAssessmentFor,
+ RelationshipType_HasAssociatedVulnerability,
+ RelationshipType_HasConcludedLicense,
+ RelationshipType_HasDataFile,
+ RelationshipType_HasDeclaredLicense,
+ RelationshipType_HasDeletedFile,
+ RelationshipType_HasDependencyManifest,
+ RelationshipType_HasDistributionArtifact,
+ RelationshipType_HasDocumentation,
+ RelationshipType_HasDynamicLink,
+ RelationshipType_HasEvidence,
+ RelationshipType_HasExample,
+ RelationshipType_HasHost,
+ RelationshipType_HasInput,
+ RelationshipType_HasMetadata,
+ RelationshipType_HasOptionalComponent,
+ RelationshipType_HasOptionalDependency,
+ RelationshipType_HasOutput,
+ RelationshipType_HasPrerequisite,
+ RelationshipType_HasProvidedDependency,
+ RelationshipType_HasRequirement,
+ RelationshipType_HasSpecification,
+ RelationshipType_HasStaticLink,
+ RelationshipType_HasTest,
+ RelationshipType_HasTestCase,
+ RelationshipType_HasVariant,
+ RelationshipType_InvokedBy,
+ RelationshipType_ModifiedBy,
+ RelationshipType_Other,
+ RelationshipType_PackagedBy,
+ RelationshipType_PatchedBy,
+ RelationshipType_PublishedBy,
+ RelationshipType_ReportedBy,
+ RelationshipType_RepublishedBy,
+ RelationshipType_SerializedInArtifact,
+ RelationshipType_TestedOn,
+ RelationshipType_TrainedOn,
+ RelationshipType_UnderInvestigationFor,
+ RelationshipType_UsesTool,
+ )),
+ ld.ValidateProperty(o, &o.Probability),
+ ld.ValidateProperty(o, &o.Percentile))
+}
+
+func (o *ExploitCatalogType) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *ExploitCatalogVulnAssessmentRelationship) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.Completeness,
+ ld.ValidateIRI(
+ RelationshipCompleteness_Incomplete,
+ RelationshipCompleteness_Complete,
+ RelationshipCompleteness_NoAssertion,
+ )),
+ ld.ValidateProperty(o, &o.To,
+ ld.ValidateMinCount[ElementList](1)),
+ ld.ValidateProperty(o, &o.From),
+ ld.ValidateProperty(o, &o.Type,
+ ld.ValidateIRI(
+ RelationshipType_Affects,
+ RelationshipType_AmendedBy,
+ RelationshipType_AncestorOf,
+ RelationshipType_AvailableFrom,
+ RelationshipType_Configures,
+ RelationshipType_Contains,
+ RelationshipType_CoordinatedBy,
+ RelationshipType_CopiedTo,
+ RelationshipType_DelegatedTo,
+ RelationshipType_DependsOn,
+ RelationshipType_DescendantOf,
+ RelationshipType_Describes,
+ RelationshipType_DoesNotAffect,
+ RelationshipType_ExpandsTo,
+ RelationshipType_ExploitCreatedBy,
+ RelationshipType_FixedBy,
+ RelationshipType_FixedIn,
+ RelationshipType_FoundBy,
+ RelationshipType_Generates,
+ RelationshipType_HasAddedFile,
+ RelationshipType_HasAssessmentFor,
+ RelationshipType_HasAssociatedVulnerability,
+ RelationshipType_HasConcludedLicense,
+ RelationshipType_HasDataFile,
+ RelationshipType_HasDeclaredLicense,
+ RelationshipType_HasDeletedFile,
+ RelationshipType_HasDependencyManifest,
+ RelationshipType_HasDistributionArtifact,
+ RelationshipType_HasDocumentation,
+ RelationshipType_HasDynamicLink,
+ RelationshipType_HasEvidence,
+ RelationshipType_HasExample,
+ RelationshipType_HasHost,
+ RelationshipType_HasInput,
+ RelationshipType_HasMetadata,
+ RelationshipType_HasOptionalComponent,
+ RelationshipType_HasOptionalDependency,
+ RelationshipType_HasOutput,
+ RelationshipType_HasPrerequisite,
+ RelationshipType_HasProvidedDependency,
+ RelationshipType_HasRequirement,
+ RelationshipType_HasSpecification,
+ RelationshipType_HasStaticLink,
+ RelationshipType_HasTest,
+ RelationshipType_HasTestCase,
+ RelationshipType_HasVariant,
+ RelationshipType_InvokedBy,
+ RelationshipType_ModifiedBy,
+ RelationshipType_Other,
+ RelationshipType_PackagedBy,
+ RelationshipType_PatchedBy,
+ RelationshipType_PublishedBy,
+ RelationshipType_ReportedBy,
+ RelationshipType_RepublishedBy,
+ RelationshipType_SerializedInArtifact,
+ RelationshipType_TestedOn,
+ RelationshipType_TrainedOn,
+ RelationshipType_UnderInvestigationFor,
+ RelationshipType_UsesTool,
+ )),
+ ld.ValidateProperty(o, &o.Locator),
+ ld.ValidateProperty(o, &o.Exploited),
+ ld.ValidateProperty(o, &o.CatalogType,
+ ld.ValidateIRI(
+ ExploitCatalogType_Kev,
+ ExploitCatalogType_Other,
+ )))
+}
+
+func (o *ExternalIdentifier) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.Identifier),
+ ld.ValidateProperty(o, &o.Type,
+ ld.ValidateIRI(
+ ExternalIdentifierType_Cpe22,
+ ExternalIdentifierType_Cpe23,
+ ExternalIdentifierType_Cve,
+ ExternalIdentifierType_Email,
+ ExternalIdentifierType_Gitoid,
+ ExternalIdentifierType_Other,
+ ExternalIdentifierType_PackageURL,
+ ExternalIdentifierType_SecurityOther,
+ ExternalIdentifierType_Swhid,
+ ExternalIdentifierType_Swid,
+ ExternalIdentifierType_UrlScheme,
+ )))
+}
+
+func (o *ExternalIdentifierType) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *ExternalMap) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.ExternalSpdxID))
+}
+
+func (o *ExternalRef) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.ContentType,
+ ld.ValidateExpression("^[^\\/]+\\/[^\\/]+$")),
+ ld.ValidateProperty(o, &o.Type,
+ ld.ValidateIRI(
+ ExternalRefType_AltDownloadLocation,
+ ExternalRefType_AltWebPage,
+ ExternalRefType_BinaryArtifact,
+ ExternalRefType_Bower,
+ ExternalRefType_BuildMeta,
+ ExternalRefType_BuildSystem,
+ ExternalRefType_Chat,
+ ExternalRefType_CertificationReport,
+ ExternalRefType_ComponentAnalysisReport,
+ ExternalRefType_Cwe,
+ ExternalRefType_Documentation,
+ ExternalRefType_DynamicAnalysisReport,
+ ExternalRefType_EolNotice,
+ ExternalRefType_ExportControlAssessment,
+ ExternalRefType_Funding,
+ ExternalRefType_IssueTracker,
+ ExternalRefType_MailingList,
+ ExternalRefType_MavenCentral,
+ ExternalRefType_Metrics,
+ ExternalRefType_Npm,
+ ExternalRefType_Nuget,
+ ExternalRefType_License,
+ ExternalRefType_Other,
+ ExternalRefType_PrivacyAssessment,
+ ExternalRefType_ProductMetadata,
+ ExternalRefType_PurchaseOrder,
+ ExternalRefType_QualityAssessmentReport,
+ ExternalRefType_ReleaseNotes,
+ ExternalRefType_ReleaseHistory,
+ ExternalRefType_RiskAssessment,
+ ExternalRefType_RuntimeAnalysisReport,
+ ExternalRefType_SecureSoftwareAttestation,
+ ExternalRefType_SecurityAdvisory,
+ ExternalRefType_SecurityAdversaryModel,
+ ExternalRefType_SecurityFix,
+ ExternalRefType_SecurityOther,
+ ExternalRefType_SecurityPenTestReport,
+ ExternalRefType_SecurityPolicy,
+ ExternalRefType_SecurityThreatModel,
+ ExternalRefType_SocialMedia,
+ ExternalRefType_SourceArtifact,
+ ExternalRefType_StaticAnalysisReport,
+ ExternalRefType_Support,
+ ExternalRefType_Vcs,
+ ExternalRefType_VulnerabilityDisclosureReport,
+ ExternalRefType_VulnerabilityExploitabilityAssessment,
+ )))
+}
+
+func (o *ExternalRefType) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *File) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.SupportLevels,
+ ld.ValidateAll(ld.ValidateIRI(
+ SupportType_Development,
+ SupportType_Support,
+ SupportType_Deployed,
+ SupportType_LimitedSupport,
+ SupportType_EndOfSupport,
+ SupportType_NoSupport,
+ SupportType_NoAssertion,
+ ))),
+ ld.ValidateProperty(o, &o.AdditionalPurposes,
+ ld.ValidateAll(ld.ValidateIRI(
+ SoftwarePurpose_Application,
+ SoftwarePurpose_Archive,
+ SoftwarePurpose_Bom,
+ SoftwarePurpose_Configuration,
+ SoftwarePurpose_Container,
+ SoftwarePurpose_Data,
+ SoftwarePurpose_Device,
+ SoftwarePurpose_DiskImage,
+ SoftwarePurpose_DeviceDriver,
+ SoftwarePurpose_Documentation,
+ SoftwarePurpose_Evidence,
+ SoftwarePurpose_Executable,
+ SoftwarePurpose_File,
+ SoftwarePurpose_FilesystemImage,
+ SoftwarePurpose_Firmware,
+ SoftwarePurpose_Framework,
+ SoftwarePurpose_Install,
+ SoftwarePurpose_Library,
+ SoftwarePurpose_Manifest,
+ SoftwarePurpose_Model,
+ SoftwarePurpose_Module,
+ SoftwarePurpose_OperatingSystem,
+ SoftwarePurpose_Other,
+ SoftwarePurpose_Patch,
+ SoftwarePurpose_Platform,
+ SoftwarePurpose_Requirement,
+ SoftwarePurpose_Source,
+ SoftwarePurpose_Specification,
+ SoftwarePurpose_Test,
+ ))),
+ ld.ValidateProperty(o, &o.PrimaryPurpose,
+ ld.ValidateIRI(
+ SoftwarePurpose_Application,
+ SoftwarePurpose_Archive,
+ SoftwarePurpose_Bom,
+ SoftwarePurpose_Configuration,
+ SoftwarePurpose_Container,
+ SoftwarePurpose_Data,
+ SoftwarePurpose_Device,
+ SoftwarePurpose_DiskImage,
+ SoftwarePurpose_DeviceDriver,
+ SoftwarePurpose_Documentation,
+ SoftwarePurpose_Evidence,
+ SoftwarePurpose_Executable,
+ SoftwarePurpose_File,
+ SoftwarePurpose_FilesystemImage,
+ SoftwarePurpose_Firmware,
+ SoftwarePurpose_Framework,
+ SoftwarePurpose_Install,
+ SoftwarePurpose_Library,
+ SoftwarePurpose_Manifest,
+ SoftwarePurpose_Model,
+ SoftwarePurpose_Module,
+ SoftwarePurpose_OperatingSystem,
+ SoftwarePurpose_Other,
+ SoftwarePurpose_Patch,
+ SoftwarePurpose_Platform,
+ SoftwarePurpose_Requirement,
+ SoftwarePurpose_Source,
+ SoftwarePurpose_Specification,
+ SoftwarePurpose_Test,
+ )),
+ ld.ValidateProperty(o, &o.ContentType,
+ ld.ValidateExpression("^[^\\/]+\\/[^\\/]+$")),
+ ld.ValidateProperty(o, &o.Kind,
+ ld.ValidateIRI(
+ FileKindType_File,
+ FileKindType_Directory,
+ )))
+}
+
+func (o *FileKindType) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *Hash) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.Value),
+ ld.ValidateProperty(o, &o.Algorithm,
+ ld.ValidateIRI(
+ HashAlgorithm_Adler32,
+ HashAlgorithm_Blake2b256,
+ HashAlgorithm_Blake2b384,
+ HashAlgorithm_Blake2b512,
+ HashAlgorithm_Blake3,
+ HashAlgorithm_CrystalsDilithium,
+ HashAlgorithm_CrystalsKyber,
+ HashAlgorithm_Falcon,
+ HashAlgorithm_Md2,
+ HashAlgorithm_Md4,
+ HashAlgorithm_Md5,
+ HashAlgorithm_Md6,
+ HashAlgorithm_Other,
+ HashAlgorithm_Sha1,
+ HashAlgorithm_Sha224,
+ HashAlgorithm_Sha256,
+ HashAlgorithm_Sha384,
+ HashAlgorithm_Sha512,
+ HashAlgorithm_Sha3_224,
+ HashAlgorithm_Sha3_256,
+ HashAlgorithm_Sha3_384,
+ HashAlgorithm_Sha3_512,
+ )))
+}
+
+func (o *HashAlgorithm) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *IndividualElement) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo))
+}
+
+func (o *IndividualLicensingInfo) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo))
+}
+
+func (o *LicenseExpression) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.LicenseExpression),
+ ld.ValidateProperty(o, &o.LicenseListVersion,
+ ld.ValidateExpression("^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$")))
+}
+
+func (o *LifecycleScopeType) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *LifecycleScopedRelationship) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.Completeness,
+ ld.ValidateIRI(
+ RelationshipCompleteness_Incomplete,
+ RelationshipCompleteness_Complete,
+ RelationshipCompleteness_NoAssertion,
+ )),
+ ld.ValidateProperty(o, &o.To,
+ ld.ValidateMinCount[ElementList](1)),
+ ld.ValidateProperty(o, &o.From),
+ ld.ValidateProperty(o, &o.Type,
+ ld.ValidateIRI(
+ RelationshipType_Affects,
+ RelationshipType_AmendedBy,
+ RelationshipType_AncestorOf,
+ RelationshipType_AvailableFrom,
+ RelationshipType_Configures,
+ RelationshipType_Contains,
+ RelationshipType_CoordinatedBy,
+ RelationshipType_CopiedTo,
+ RelationshipType_DelegatedTo,
+ RelationshipType_DependsOn,
+ RelationshipType_DescendantOf,
+ RelationshipType_Describes,
+ RelationshipType_DoesNotAffect,
+ RelationshipType_ExpandsTo,
+ RelationshipType_ExploitCreatedBy,
+ RelationshipType_FixedBy,
+ RelationshipType_FixedIn,
+ RelationshipType_FoundBy,
+ RelationshipType_Generates,
+ RelationshipType_HasAddedFile,
+ RelationshipType_HasAssessmentFor,
+ RelationshipType_HasAssociatedVulnerability,
+ RelationshipType_HasConcludedLicense,
+ RelationshipType_HasDataFile,
+ RelationshipType_HasDeclaredLicense,
+ RelationshipType_HasDeletedFile,
+ RelationshipType_HasDependencyManifest,
+ RelationshipType_HasDistributionArtifact,
+ RelationshipType_HasDocumentation,
+ RelationshipType_HasDynamicLink,
+ RelationshipType_HasEvidence,
+ RelationshipType_HasExample,
+ RelationshipType_HasHost,
+ RelationshipType_HasInput,
+ RelationshipType_HasMetadata,
+ RelationshipType_HasOptionalComponent,
+ RelationshipType_HasOptionalDependency,
+ RelationshipType_HasOutput,
+ RelationshipType_HasPrerequisite,
+ RelationshipType_HasProvidedDependency,
+ RelationshipType_HasRequirement,
+ RelationshipType_HasSpecification,
+ RelationshipType_HasStaticLink,
+ RelationshipType_HasTest,
+ RelationshipType_HasTestCase,
+ RelationshipType_HasVariant,
+ RelationshipType_InvokedBy,
+ RelationshipType_ModifiedBy,
+ RelationshipType_Other,
+ RelationshipType_PackagedBy,
+ RelationshipType_PatchedBy,
+ RelationshipType_PublishedBy,
+ RelationshipType_ReportedBy,
+ RelationshipType_RepublishedBy,
+ RelationshipType_SerializedInArtifact,
+ RelationshipType_TestedOn,
+ RelationshipType_TrainedOn,
+ RelationshipType_UnderInvestigationFor,
+ RelationshipType_UsesTool,
+ )),
+ ld.ValidateProperty(o, &o.Scope,
+ ld.ValidateIRI(
+ LifecycleScopeType_Design,
+ LifecycleScopeType_Development,
+ LifecycleScopeType_Build,
+ LifecycleScopeType_Test,
+ LifecycleScopeType_Runtime,
+ LifecycleScopeType_Other,
+ )))
+}
+
+func (o *ListedLicense) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.Text))
+}
+
+func (o *ListedLicenseException) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.AdditionText))
+}
+
+func (o *NamespaceMap) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.Namespace),
+ ld.ValidateProperty(o, &o.Prefix))
+}
+
+func (o *OrLaterOperator) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.SubjectLicense))
+}
+
+func (o *Organization) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo))
+}
+
+func (o *Package) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.SupportLevels,
+ ld.ValidateAll(ld.ValidateIRI(
+ SupportType_Development,
+ SupportType_Support,
+ SupportType_Deployed,
+ SupportType_LimitedSupport,
+ SupportType_EndOfSupport,
+ SupportType_NoSupport,
+ SupportType_NoAssertion,
+ ))),
+ ld.ValidateProperty(o, &o.AdditionalPurposes,
+ ld.ValidateAll(ld.ValidateIRI(
+ SoftwarePurpose_Application,
+ SoftwarePurpose_Archive,
+ SoftwarePurpose_Bom,
+ SoftwarePurpose_Configuration,
+ SoftwarePurpose_Container,
+ SoftwarePurpose_Data,
+ SoftwarePurpose_Device,
+ SoftwarePurpose_DiskImage,
+ SoftwarePurpose_DeviceDriver,
+ SoftwarePurpose_Documentation,
+ SoftwarePurpose_Evidence,
+ SoftwarePurpose_Executable,
+ SoftwarePurpose_File,
+ SoftwarePurpose_FilesystemImage,
+ SoftwarePurpose_Firmware,
+ SoftwarePurpose_Framework,
+ SoftwarePurpose_Install,
+ SoftwarePurpose_Library,
+ SoftwarePurpose_Manifest,
+ SoftwarePurpose_Model,
+ SoftwarePurpose_Module,
+ SoftwarePurpose_OperatingSystem,
+ SoftwarePurpose_Other,
+ SoftwarePurpose_Patch,
+ SoftwarePurpose_Platform,
+ SoftwarePurpose_Requirement,
+ SoftwarePurpose_Source,
+ SoftwarePurpose_Specification,
+ SoftwarePurpose_Test,
+ ))),
+ ld.ValidateProperty(o, &o.PrimaryPurpose,
+ ld.ValidateIRI(
+ SoftwarePurpose_Application,
+ SoftwarePurpose_Archive,
+ SoftwarePurpose_Bom,
+ SoftwarePurpose_Configuration,
+ SoftwarePurpose_Container,
+ SoftwarePurpose_Data,
+ SoftwarePurpose_Device,
+ SoftwarePurpose_DiskImage,
+ SoftwarePurpose_DeviceDriver,
+ SoftwarePurpose_Documentation,
+ SoftwarePurpose_Evidence,
+ SoftwarePurpose_Executable,
+ SoftwarePurpose_File,
+ SoftwarePurpose_FilesystemImage,
+ SoftwarePurpose_Firmware,
+ SoftwarePurpose_Framework,
+ SoftwarePurpose_Install,
+ SoftwarePurpose_Library,
+ SoftwarePurpose_Manifest,
+ SoftwarePurpose_Model,
+ SoftwarePurpose_Module,
+ SoftwarePurpose_OperatingSystem,
+ SoftwarePurpose_Other,
+ SoftwarePurpose_Patch,
+ SoftwarePurpose_Platform,
+ SoftwarePurpose_Requirement,
+ SoftwarePurpose_Source,
+ SoftwarePurpose_Specification,
+ SoftwarePurpose_Test,
+ )))
+}
+
+func (o *PackageVerificationCode) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.Algorithm,
+ ld.ValidateIRI(
+ HashAlgorithm_Adler32,
+ HashAlgorithm_Blake2b256,
+ HashAlgorithm_Blake2b384,
+ HashAlgorithm_Blake2b512,
+ HashAlgorithm_Blake3,
+ HashAlgorithm_CrystalsDilithium,
+ HashAlgorithm_CrystalsKyber,
+ HashAlgorithm_Falcon,
+ HashAlgorithm_Md2,
+ HashAlgorithm_Md4,
+ HashAlgorithm_Md5,
+ HashAlgorithm_Md6,
+ HashAlgorithm_Other,
+ HashAlgorithm_Sha1,
+ HashAlgorithm_Sha224,
+ HashAlgorithm_Sha256,
+ HashAlgorithm_Sha384,
+ HashAlgorithm_Sha512,
+ HashAlgorithm_Sha3_224,
+ HashAlgorithm_Sha3_256,
+ HashAlgorithm_Sha3_384,
+ HashAlgorithm_Sha3_512,
+ )),
+ ld.ValidateProperty(o, &o.HashValue))
+}
+
+func (o *Person) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo))
+}
+
+func (o *PositiveIntegerRange) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.EndIntegerRange),
+ ld.ValidateProperty(o, &o.BeginIntegerRange))
+}
+
+func (o *PresenceType) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *ProfileIdentifierType) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *Relationship) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.Completeness,
+ ld.ValidateIRI(
+ RelationshipCompleteness_Incomplete,
+ RelationshipCompleteness_Complete,
+ RelationshipCompleteness_NoAssertion,
+ )),
+ ld.ValidateProperty(o, &o.To,
+ ld.ValidateMinCount[ElementList](1)),
+ ld.ValidateProperty(o, &o.From),
+ ld.ValidateProperty(o, &o.Type,
+ ld.ValidateIRI(
+ RelationshipType_Affects,
+ RelationshipType_AmendedBy,
+ RelationshipType_AncestorOf,
+ RelationshipType_AvailableFrom,
+ RelationshipType_Configures,
+ RelationshipType_Contains,
+ RelationshipType_CoordinatedBy,
+ RelationshipType_CopiedTo,
+ RelationshipType_DelegatedTo,
+ RelationshipType_DependsOn,
+ RelationshipType_DescendantOf,
+ RelationshipType_Describes,
+ RelationshipType_DoesNotAffect,
+ RelationshipType_ExpandsTo,
+ RelationshipType_ExploitCreatedBy,
+ RelationshipType_FixedBy,
+ RelationshipType_FixedIn,
+ RelationshipType_FoundBy,
+ RelationshipType_Generates,
+ RelationshipType_HasAddedFile,
+ RelationshipType_HasAssessmentFor,
+ RelationshipType_HasAssociatedVulnerability,
+ RelationshipType_HasConcludedLicense,
+ RelationshipType_HasDataFile,
+ RelationshipType_HasDeclaredLicense,
+ RelationshipType_HasDeletedFile,
+ RelationshipType_HasDependencyManifest,
+ RelationshipType_HasDistributionArtifact,
+ RelationshipType_HasDocumentation,
+ RelationshipType_HasDynamicLink,
+ RelationshipType_HasEvidence,
+ RelationshipType_HasExample,
+ RelationshipType_HasHost,
+ RelationshipType_HasInput,
+ RelationshipType_HasMetadata,
+ RelationshipType_HasOptionalComponent,
+ RelationshipType_HasOptionalDependency,
+ RelationshipType_HasOutput,
+ RelationshipType_HasPrerequisite,
+ RelationshipType_HasProvidedDependency,
+ RelationshipType_HasRequirement,
+ RelationshipType_HasSpecification,
+ RelationshipType_HasStaticLink,
+ RelationshipType_HasTest,
+ RelationshipType_HasTestCase,
+ RelationshipType_HasVariant,
+ RelationshipType_InvokedBy,
+ RelationshipType_ModifiedBy,
+ RelationshipType_Other,
+ RelationshipType_PackagedBy,
+ RelationshipType_PatchedBy,
+ RelationshipType_PublishedBy,
+ RelationshipType_ReportedBy,
+ RelationshipType_RepublishedBy,
+ RelationshipType_SerializedInArtifact,
+ RelationshipType_TestedOn,
+ RelationshipType_TrainedOn,
+ RelationshipType_UnderInvestigationFor,
+ RelationshipType_UsesTool,
+ )))
+}
+
+func (o *RelationshipCompleteness) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *RelationshipType) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *SBOM) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.ProfileConformances,
+ ld.ValidateAll(ld.ValidateIRI(
+ ProfileIdentifierType_Core,
+ ProfileIdentifierType_Software,
+ ProfileIdentifierType_SimpleLicensing,
+ ProfileIdentifierType_ExpandedLicensing,
+ ProfileIdentifierType_Security,
+ ProfileIdentifierType_Build,
+ ProfileIdentifierType_Ai,
+ ProfileIdentifierType_Dataset,
+ ProfileIdentifierType_Extension,
+ ProfileIdentifierType_Lite,
+ ))),
+ ld.ValidateProperty(o, &o.SbomTypes,
+ ld.ValidateAll(ld.ValidateIRI(
+ SbomType_Design,
+ SbomType_Source,
+ SbomType_Build,
+ SbomType_Deployed,
+ SbomType_Runtime,
+ SbomType_Analyzed,
+ ))))
+}
+
+func (o *SafetyRiskAssessmentType) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *SbomType) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *SimpleLicensingText) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.LicenseText))
+}
+
+func (o *Snippet) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.SupportLevels,
+ ld.ValidateAll(ld.ValidateIRI(
+ SupportType_Development,
+ SupportType_Support,
+ SupportType_Deployed,
+ SupportType_LimitedSupport,
+ SupportType_EndOfSupport,
+ SupportType_NoSupport,
+ SupportType_NoAssertion,
+ ))),
+ ld.ValidateProperty(o, &o.AdditionalPurposes,
+ ld.ValidateAll(ld.ValidateIRI(
+ SoftwarePurpose_Application,
+ SoftwarePurpose_Archive,
+ SoftwarePurpose_Bom,
+ SoftwarePurpose_Configuration,
+ SoftwarePurpose_Container,
+ SoftwarePurpose_Data,
+ SoftwarePurpose_Device,
+ SoftwarePurpose_DiskImage,
+ SoftwarePurpose_DeviceDriver,
+ SoftwarePurpose_Documentation,
+ SoftwarePurpose_Evidence,
+ SoftwarePurpose_Executable,
+ SoftwarePurpose_File,
+ SoftwarePurpose_FilesystemImage,
+ SoftwarePurpose_Firmware,
+ SoftwarePurpose_Framework,
+ SoftwarePurpose_Install,
+ SoftwarePurpose_Library,
+ SoftwarePurpose_Manifest,
+ SoftwarePurpose_Model,
+ SoftwarePurpose_Module,
+ SoftwarePurpose_OperatingSystem,
+ SoftwarePurpose_Other,
+ SoftwarePurpose_Patch,
+ SoftwarePurpose_Platform,
+ SoftwarePurpose_Requirement,
+ SoftwarePurpose_Source,
+ SoftwarePurpose_Specification,
+ SoftwarePurpose_Test,
+ ))),
+ ld.ValidateProperty(o, &o.PrimaryPurpose,
+ ld.ValidateIRI(
+ SoftwarePurpose_Application,
+ SoftwarePurpose_Archive,
+ SoftwarePurpose_Bom,
+ SoftwarePurpose_Configuration,
+ SoftwarePurpose_Container,
+ SoftwarePurpose_Data,
+ SoftwarePurpose_Device,
+ SoftwarePurpose_DiskImage,
+ SoftwarePurpose_DeviceDriver,
+ SoftwarePurpose_Documentation,
+ SoftwarePurpose_Evidence,
+ SoftwarePurpose_Executable,
+ SoftwarePurpose_File,
+ SoftwarePurpose_FilesystemImage,
+ SoftwarePurpose_Firmware,
+ SoftwarePurpose_Framework,
+ SoftwarePurpose_Install,
+ SoftwarePurpose_Library,
+ SoftwarePurpose_Manifest,
+ SoftwarePurpose_Model,
+ SoftwarePurpose_Module,
+ SoftwarePurpose_OperatingSystem,
+ SoftwarePurpose_Other,
+ SoftwarePurpose_Patch,
+ SoftwarePurpose_Platform,
+ SoftwarePurpose_Requirement,
+ SoftwarePurpose_Source,
+ SoftwarePurpose_Specification,
+ SoftwarePurpose_Test,
+ )),
+ ld.ValidateProperty(o, &o.FromFile))
+}
+
+func (o *SoftwareAgent) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo))
+}
+
+func (o *SoftwarePurpose) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *SpdxDocument) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.ProfileConformances,
+ ld.ValidateAll(ld.ValidateIRI(
+ ProfileIdentifierType_Core,
+ ProfileIdentifierType_Software,
+ ProfileIdentifierType_SimpleLicensing,
+ ProfileIdentifierType_ExpandedLicensing,
+ ProfileIdentifierType_Security,
+ ProfileIdentifierType_Build,
+ ProfileIdentifierType_Ai,
+ ProfileIdentifierType_Dataset,
+ ProfileIdentifierType_Extension,
+ ProfileIdentifierType_Lite,
+ ))))
+}
+
+func (o *SsvcDecisionType) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *SsvcVulnAssessmentRelationship) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.Completeness,
+ ld.ValidateIRI(
+ RelationshipCompleteness_Incomplete,
+ RelationshipCompleteness_Complete,
+ RelationshipCompleteness_NoAssertion,
+ )),
+ ld.ValidateProperty(o, &o.To,
+ ld.ValidateMinCount[ElementList](1)),
+ ld.ValidateProperty(o, &o.From),
+ ld.ValidateProperty(o, &o.Type,
+ ld.ValidateIRI(
+ RelationshipType_Affects,
+ RelationshipType_AmendedBy,
+ RelationshipType_AncestorOf,
+ RelationshipType_AvailableFrom,
+ RelationshipType_Configures,
+ RelationshipType_Contains,
+ RelationshipType_CoordinatedBy,
+ RelationshipType_CopiedTo,
+ RelationshipType_DelegatedTo,
+ RelationshipType_DependsOn,
+ RelationshipType_DescendantOf,
+ RelationshipType_Describes,
+ RelationshipType_DoesNotAffect,
+ RelationshipType_ExpandsTo,
+ RelationshipType_ExploitCreatedBy,
+ RelationshipType_FixedBy,
+ RelationshipType_FixedIn,
+ RelationshipType_FoundBy,
+ RelationshipType_Generates,
+ RelationshipType_HasAddedFile,
+ RelationshipType_HasAssessmentFor,
+ RelationshipType_HasAssociatedVulnerability,
+ RelationshipType_HasConcludedLicense,
+ RelationshipType_HasDataFile,
+ RelationshipType_HasDeclaredLicense,
+ RelationshipType_HasDeletedFile,
+ RelationshipType_HasDependencyManifest,
+ RelationshipType_HasDistributionArtifact,
+ RelationshipType_HasDocumentation,
+ RelationshipType_HasDynamicLink,
+ RelationshipType_HasEvidence,
+ RelationshipType_HasExample,
+ RelationshipType_HasHost,
+ RelationshipType_HasInput,
+ RelationshipType_HasMetadata,
+ RelationshipType_HasOptionalComponent,
+ RelationshipType_HasOptionalDependency,
+ RelationshipType_HasOutput,
+ RelationshipType_HasPrerequisite,
+ RelationshipType_HasProvidedDependency,
+ RelationshipType_HasRequirement,
+ RelationshipType_HasSpecification,
+ RelationshipType_HasStaticLink,
+ RelationshipType_HasTest,
+ RelationshipType_HasTestCase,
+ RelationshipType_HasVariant,
+ RelationshipType_InvokedBy,
+ RelationshipType_ModifiedBy,
+ RelationshipType_Other,
+ RelationshipType_PackagedBy,
+ RelationshipType_PatchedBy,
+ RelationshipType_PublishedBy,
+ RelationshipType_ReportedBy,
+ RelationshipType_RepublishedBy,
+ RelationshipType_SerializedInArtifact,
+ RelationshipType_TestedOn,
+ RelationshipType_TrainedOn,
+ RelationshipType_UnderInvestigationFor,
+ RelationshipType_UsesTool,
+ )),
+ ld.ValidateProperty(o, &o.DecisionType,
+ ld.ValidateIRI(
+ SsvcDecisionType_Act,
+ SsvcDecisionType_Attend,
+ SsvcDecisionType_Track,
+ SsvcDecisionType_TrackStar,
+ )))
+}
+
+func (o *SupportType) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *Tool) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo))
+}
+
+func (o *VexAffectedVulnAssessmentRelationship) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.Completeness,
+ ld.ValidateIRI(
+ RelationshipCompleteness_Incomplete,
+ RelationshipCompleteness_Complete,
+ RelationshipCompleteness_NoAssertion,
+ )),
+ ld.ValidateProperty(o, &o.To,
+ ld.ValidateMinCount[ElementList](1)),
+ ld.ValidateProperty(o, &o.From),
+ ld.ValidateProperty(o, &o.Type,
+ ld.ValidateIRI(
+ RelationshipType_Affects,
+ RelationshipType_AmendedBy,
+ RelationshipType_AncestorOf,
+ RelationshipType_AvailableFrom,
+ RelationshipType_Configures,
+ RelationshipType_Contains,
+ RelationshipType_CoordinatedBy,
+ RelationshipType_CopiedTo,
+ RelationshipType_DelegatedTo,
+ RelationshipType_DependsOn,
+ RelationshipType_DescendantOf,
+ RelationshipType_Describes,
+ RelationshipType_DoesNotAffect,
+ RelationshipType_ExpandsTo,
+ RelationshipType_ExploitCreatedBy,
+ RelationshipType_FixedBy,
+ RelationshipType_FixedIn,
+ RelationshipType_FoundBy,
+ RelationshipType_Generates,
+ RelationshipType_HasAddedFile,
+ RelationshipType_HasAssessmentFor,
+ RelationshipType_HasAssociatedVulnerability,
+ RelationshipType_HasConcludedLicense,
+ RelationshipType_HasDataFile,
+ RelationshipType_HasDeclaredLicense,
+ RelationshipType_HasDeletedFile,
+ RelationshipType_HasDependencyManifest,
+ RelationshipType_HasDistributionArtifact,
+ RelationshipType_HasDocumentation,
+ RelationshipType_HasDynamicLink,
+ RelationshipType_HasEvidence,
+ RelationshipType_HasExample,
+ RelationshipType_HasHost,
+ RelationshipType_HasInput,
+ RelationshipType_HasMetadata,
+ RelationshipType_HasOptionalComponent,
+ RelationshipType_HasOptionalDependency,
+ RelationshipType_HasOutput,
+ RelationshipType_HasPrerequisite,
+ RelationshipType_HasProvidedDependency,
+ RelationshipType_HasRequirement,
+ RelationshipType_HasSpecification,
+ RelationshipType_HasStaticLink,
+ RelationshipType_HasTest,
+ RelationshipType_HasTestCase,
+ RelationshipType_HasVariant,
+ RelationshipType_InvokedBy,
+ RelationshipType_ModifiedBy,
+ RelationshipType_Other,
+ RelationshipType_PackagedBy,
+ RelationshipType_PatchedBy,
+ RelationshipType_PublishedBy,
+ RelationshipType_ReportedBy,
+ RelationshipType_RepublishedBy,
+ RelationshipType_SerializedInArtifact,
+ RelationshipType_TestedOn,
+ RelationshipType_TrainedOn,
+ RelationshipType_UnderInvestigationFor,
+ RelationshipType_UsesTool,
+ )),
+ ld.ValidateProperty(o, &o.ActionStatement))
+}
+
+func (o *VexFixedVulnAssessmentRelationship) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.Completeness,
+ ld.ValidateIRI(
+ RelationshipCompleteness_Incomplete,
+ RelationshipCompleteness_Complete,
+ RelationshipCompleteness_NoAssertion,
+ )),
+ ld.ValidateProperty(o, &o.To,
+ ld.ValidateMinCount[ElementList](1)),
+ ld.ValidateProperty(o, &o.From),
+ ld.ValidateProperty(o, &o.Type,
+ ld.ValidateIRI(
+ RelationshipType_Affects,
+ RelationshipType_AmendedBy,
+ RelationshipType_AncestorOf,
+ RelationshipType_AvailableFrom,
+ RelationshipType_Configures,
+ RelationshipType_Contains,
+ RelationshipType_CoordinatedBy,
+ RelationshipType_CopiedTo,
+ RelationshipType_DelegatedTo,
+ RelationshipType_DependsOn,
+ RelationshipType_DescendantOf,
+ RelationshipType_Describes,
+ RelationshipType_DoesNotAffect,
+ RelationshipType_ExpandsTo,
+ RelationshipType_ExploitCreatedBy,
+ RelationshipType_FixedBy,
+ RelationshipType_FixedIn,
+ RelationshipType_FoundBy,
+ RelationshipType_Generates,
+ RelationshipType_HasAddedFile,
+ RelationshipType_HasAssessmentFor,
+ RelationshipType_HasAssociatedVulnerability,
+ RelationshipType_HasConcludedLicense,
+ RelationshipType_HasDataFile,
+ RelationshipType_HasDeclaredLicense,
+ RelationshipType_HasDeletedFile,
+ RelationshipType_HasDependencyManifest,
+ RelationshipType_HasDistributionArtifact,
+ RelationshipType_HasDocumentation,
+ RelationshipType_HasDynamicLink,
+ RelationshipType_HasEvidence,
+ RelationshipType_HasExample,
+ RelationshipType_HasHost,
+ RelationshipType_HasInput,
+ RelationshipType_HasMetadata,
+ RelationshipType_HasOptionalComponent,
+ RelationshipType_HasOptionalDependency,
+ RelationshipType_HasOutput,
+ RelationshipType_HasPrerequisite,
+ RelationshipType_HasProvidedDependency,
+ RelationshipType_HasRequirement,
+ RelationshipType_HasSpecification,
+ RelationshipType_HasStaticLink,
+ RelationshipType_HasTest,
+ RelationshipType_HasTestCase,
+ RelationshipType_HasVariant,
+ RelationshipType_InvokedBy,
+ RelationshipType_ModifiedBy,
+ RelationshipType_Other,
+ RelationshipType_PackagedBy,
+ RelationshipType_PatchedBy,
+ RelationshipType_PublishedBy,
+ RelationshipType_ReportedBy,
+ RelationshipType_RepublishedBy,
+ RelationshipType_SerializedInArtifact,
+ RelationshipType_TestedOn,
+ RelationshipType_TrainedOn,
+ RelationshipType_UnderInvestigationFor,
+ RelationshipType_UsesTool,
+ )))
+}
+
+func (o *VexJustificationType) Validate() error {
+ return ld.JoinErrors()
+}
+
+func (o *VexNotAffectedVulnAssessmentRelationship) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.Completeness,
+ ld.ValidateIRI(
+ RelationshipCompleteness_Incomplete,
+ RelationshipCompleteness_Complete,
+ RelationshipCompleteness_NoAssertion,
+ )),
+ ld.ValidateProperty(o, &o.To,
+ ld.ValidateMinCount[ElementList](1)),
+ ld.ValidateProperty(o, &o.From),
+ ld.ValidateProperty(o, &o.Type,
+ ld.ValidateIRI(
+ RelationshipType_Affects,
+ RelationshipType_AmendedBy,
+ RelationshipType_AncestorOf,
+ RelationshipType_AvailableFrom,
+ RelationshipType_Configures,
+ RelationshipType_Contains,
+ RelationshipType_CoordinatedBy,
+ RelationshipType_CopiedTo,
+ RelationshipType_DelegatedTo,
+ RelationshipType_DependsOn,
+ RelationshipType_DescendantOf,
+ RelationshipType_Describes,
+ RelationshipType_DoesNotAffect,
+ RelationshipType_ExpandsTo,
+ RelationshipType_ExploitCreatedBy,
+ RelationshipType_FixedBy,
+ RelationshipType_FixedIn,
+ RelationshipType_FoundBy,
+ RelationshipType_Generates,
+ RelationshipType_HasAddedFile,
+ RelationshipType_HasAssessmentFor,
+ RelationshipType_HasAssociatedVulnerability,
+ RelationshipType_HasConcludedLicense,
+ RelationshipType_HasDataFile,
+ RelationshipType_HasDeclaredLicense,
+ RelationshipType_HasDeletedFile,
+ RelationshipType_HasDependencyManifest,
+ RelationshipType_HasDistributionArtifact,
+ RelationshipType_HasDocumentation,
+ RelationshipType_HasDynamicLink,
+ RelationshipType_HasEvidence,
+ RelationshipType_HasExample,
+ RelationshipType_HasHost,
+ RelationshipType_HasInput,
+ RelationshipType_HasMetadata,
+ RelationshipType_HasOptionalComponent,
+ RelationshipType_HasOptionalDependency,
+ RelationshipType_HasOutput,
+ RelationshipType_HasPrerequisite,
+ RelationshipType_HasProvidedDependency,
+ RelationshipType_HasRequirement,
+ RelationshipType_HasSpecification,
+ RelationshipType_HasStaticLink,
+ RelationshipType_HasTest,
+ RelationshipType_HasTestCase,
+ RelationshipType_HasVariant,
+ RelationshipType_InvokedBy,
+ RelationshipType_ModifiedBy,
+ RelationshipType_Other,
+ RelationshipType_PackagedBy,
+ RelationshipType_PatchedBy,
+ RelationshipType_PublishedBy,
+ RelationshipType_ReportedBy,
+ RelationshipType_RepublishedBy,
+ RelationshipType_SerializedInArtifact,
+ RelationshipType_TestedOn,
+ RelationshipType_TrainedOn,
+ RelationshipType_UnderInvestigationFor,
+ RelationshipType_UsesTool,
+ )),
+ ld.ValidateProperty(o, &o.JustificationType,
+ ld.ValidateIRI(
+ VexJustificationType_ComponentNotPresent,
+ VexJustificationType_VulnerableCodeNotPresent,
+ VexJustificationType_VulnerableCodeCannotBeControlledByAdversary,
+ VexJustificationType_VulnerableCodeNotInExecutePath,
+ VexJustificationType_InlineMitigationsAlreadyExist,
+ )))
+}
+
+func (o *VexUnderInvestigationVulnAssessmentRelationship) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.Completeness,
+ ld.ValidateIRI(
+ RelationshipCompleteness_Incomplete,
+ RelationshipCompleteness_Complete,
+ RelationshipCompleteness_NoAssertion,
+ )),
+ ld.ValidateProperty(o, &o.To,
+ ld.ValidateMinCount[ElementList](1)),
+ ld.ValidateProperty(o, &o.From),
+ ld.ValidateProperty(o, &o.Type,
+ ld.ValidateIRI(
+ RelationshipType_Affects,
+ RelationshipType_AmendedBy,
+ RelationshipType_AncestorOf,
+ RelationshipType_AvailableFrom,
+ RelationshipType_Configures,
+ RelationshipType_Contains,
+ RelationshipType_CoordinatedBy,
+ RelationshipType_CopiedTo,
+ RelationshipType_DelegatedTo,
+ RelationshipType_DependsOn,
+ RelationshipType_DescendantOf,
+ RelationshipType_Describes,
+ RelationshipType_DoesNotAffect,
+ RelationshipType_ExpandsTo,
+ RelationshipType_ExploitCreatedBy,
+ RelationshipType_FixedBy,
+ RelationshipType_FixedIn,
+ RelationshipType_FoundBy,
+ RelationshipType_Generates,
+ RelationshipType_HasAddedFile,
+ RelationshipType_HasAssessmentFor,
+ RelationshipType_HasAssociatedVulnerability,
+ RelationshipType_HasConcludedLicense,
+ RelationshipType_HasDataFile,
+ RelationshipType_HasDeclaredLicense,
+ RelationshipType_HasDeletedFile,
+ RelationshipType_HasDependencyManifest,
+ RelationshipType_HasDistributionArtifact,
+ RelationshipType_HasDocumentation,
+ RelationshipType_HasDynamicLink,
+ RelationshipType_HasEvidence,
+ RelationshipType_HasExample,
+ RelationshipType_HasHost,
+ RelationshipType_HasInput,
+ RelationshipType_HasMetadata,
+ RelationshipType_HasOptionalComponent,
+ RelationshipType_HasOptionalDependency,
+ RelationshipType_HasOutput,
+ RelationshipType_HasPrerequisite,
+ RelationshipType_HasProvidedDependency,
+ RelationshipType_HasRequirement,
+ RelationshipType_HasSpecification,
+ RelationshipType_HasStaticLink,
+ RelationshipType_HasTest,
+ RelationshipType_HasTestCase,
+ RelationshipType_HasVariant,
+ RelationshipType_InvokedBy,
+ RelationshipType_ModifiedBy,
+ RelationshipType_Other,
+ RelationshipType_PackagedBy,
+ RelationshipType_PatchedBy,
+ RelationshipType_PublishedBy,
+ RelationshipType_ReportedBy,
+ RelationshipType_RepublishedBy,
+ RelationshipType_SerializedInArtifact,
+ RelationshipType_TestedOn,
+ RelationshipType_TrainedOn,
+ RelationshipType_UnderInvestigationFor,
+ RelationshipType_UsesTool,
+ )))
+}
+
+func (o *Vulnerability) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.SupportLevels,
+ ld.ValidateAll(ld.ValidateIRI(
+ SupportType_Development,
+ SupportType_Support,
+ SupportType_Deployed,
+ SupportType_LimitedSupport,
+ SupportType_EndOfSupport,
+ SupportType_NoSupport,
+ SupportType_NoAssertion,
+ ))))
+}
+
+func (o *WithAdditionOperator) Validate() error {
+ return ld.JoinErrors(
+ ld.ValidateProperty(o, &o.CreationInfo),
+ ld.ValidateProperty(o, &o.SubjectExtendableLicense),
+ ld.ValidateProperty(o, &o.SubjectAddition))
+}
diff --git a/spdx/v3/v3_0/spdx.go b/spdx/v3/v3_0/spdx.go
new file mode 100644
index 00000000..7de22042
--- /dev/null
+++ b/spdx/v3/v3_0/spdx.go
@@ -0,0 +1,196 @@
+package v3_0
+
+import (
+ "bytes"
+ "encoding/json"
+ "fmt"
+ "io"
+ "reflect"
+ "time"
+
+ "github.com/spdx/tools-golang/spdx/v3/internal"
+ "github.com/spdx/tools-golang/spdx/v3/internal/ld"
+)
+
+/*
+SPDX 3 models and serialization code is generated from internal/generate/main.go
+To regenerate all models, run: make generate
+*/
+
+const Version = "3.0.1" // TODO is there a way to ascertain this version from generated code programmatically?
+
+type Document struct {
+ SpdxDocument
+ LDContext ld.Context
+}
+
+func (d *Document) UnmarshalJSON(data []byte) error {
+ if d.LDContext == nil {
+ d.LDContext = context()
+ }
+ err := d.FromJSON(bytes.NewReader(data))
+ if err != nil {
+ return err
+ }
+ return nil
+}
+
+func (d *Document) MarshalJSON() ([]byte, error) {
+ if d.LDContext == nil {
+ d.LDContext = context()
+ }
+ buf := bytes.Buffer{}
+ err := d.Write(&buf)
+ return buf.Bytes(), err
+}
+
+func (d *Document) Write(w io.Writer) error {
+ return d.ToJSON(w)
+}
+
+func NewDocument(conformance ProfileIdentifierType, name string, createdBy AnyAgent, createdUsing AnyTool) *Document {
+ if createdBy == nil {
+ createdBy = &SoftwareAgent{
+ ID: "",
+ Description: "",
+ Comment: "",
+ Name: "tools-golang",
+ Extensions: nil,
+ CreationInfo: nil,
+ ExternalIdentifiers: nil,
+ ExternalRefs: nil,
+ Summary: "",
+ VerifiedUsing: nil,
+ }
+ }
+ ci := &CreationInfo{
+ SpecVersion: Version,
+ Created: time.Now(),
+ CreatedBy: notNil(AgentList{createdBy}),
+ CreatedUsing: notNil(ToolList{createdUsing}),
+ }
+ return &Document{
+ SpdxDocument: SpdxDocument{
+ Name: name,
+ CreationInfo: ci,
+ ProfileConformances: conformanceFrom(conformance),
+ },
+ LDContext: context(),
+ }
+}
+
+func conformanceFrom(conformance ProfileIdentifierType) []ProfileIdentifierType {
+ out := []ProfileIdentifierType{ProfileIdentifierType_Core}
+ switch conformance {
+ case ProfileIdentifierType_Core:
+ case ProfileIdentifierType_Software:
+ out = append(out, conformance)
+ case ProfileIdentifierType_Ai:
+ out = append(out, ProfileIdentifierType_Software, conformance)
+ case ProfileIdentifierType_Dataset:
+ out = append(out, ProfileIdentifierType_Software, ProfileIdentifierType_Ai, conformance)
+ }
+ return out
+}
+
+func (d *Document) Validate(setCreationInfo bool) error {
+ if setCreationInfo {
+ // all Elements need to have creationInfo set...
+ d.setCreationInfo(d.SpdxDocument.CreationInfo, &d.SpdxDocument)
+ }
+ return ld.ValidateGraph(d.SpdxDocument)
+}
+
+//func (d *Document) Append(e ...AnyElement) {
+// d.SpdxDocument.Elements = append(d.SpdxDocument.Elements, e...)
+// d.SpdxDocument.RootElements = append(d.SpdxDocument.RootElements, e...)
+//}
+
+// ToJSON first processes the document by:
+// - setting each Element's CreationInfo property to the SpdxDocument's CreationInfo if nil
+// - collecting all element references to the top-level Elements slice
+//
+// ... and after this initial processing, outputs the document as compact JSON LD,
+// including accounting for empty IDs by outputting blank node spdxId values
+func (d *Document) ToJSON(writer io.Writer) error {
+ // all Elements need to have creationInfo set...
+ d.setCreationInfo(d.SpdxDocument.CreationInfo, &d.SpdxDocument)
+
+ // ensure the Elements
+ d.ensureAllDocumentElements()
+
+ if d.LDContext == nil {
+ d.LDContext = context()
+ }
+
+ return internal.ToJSON("https://spdx.org/rdf/3.0.1/spdx-context.jsonld", d.LDContext, &d.SpdxDocument, writer)
+}
+
+func (d *Document) setCreationInfo(creationInfo AnyCreationInfo, doc *SpdxDocument) {
+ if creationInfo == nil {
+ return
+ }
+ creationInfoInterfaceType := reflect.TypeOf((*AnyCreationInfo)(nil)).Elem()
+ ci := reflect.ValueOf(creationInfo)
+ _ = ld.VisitObjectGraph(doc, func(path []any, value reflect.Value) error {
+ t := value.Type()
+ if t == creationInfoInterfaceType && value.IsNil() {
+ value.Set(ci)
+ }
+ return nil
+ })
+}
+
+func (d *Document) FromJSON(reader io.Reader) error {
+ graph, err := d.LDContext.FromJSON(reader)
+ if err != nil {
+ return err
+ }
+ for _, e := range graph {
+ if doc, ok := e.(*SpdxDocument); ok {
+ d.SpdxDocument = *doc
+ return nil
+ }
+ }
+ return fmt.Errorf("no SPDX document found")
+}
+
+func (d *Document) ensureAllDocumentElements() {
+ all := map[reflect.Value]struct{}{}
+ for _, e := range d.Elements {
+ v := reflect.ValueOf(e)
+ if v.Kind() != reflect.Pointer {
+ panic(fmt.Sprintf("non-pointer type in elements: %#v", v))
+ }
+ all[v] = struct{}{}
+ }
+ all[reflect.ValueOf(d.SpdxDocument)] = struct{}{}
+ _ = ld.VisitObjectGraph(d.SpdxDocument, func(path []any, value reflect.Value) error {
+ if value.Kind() == reflect.Pointer {
+ if _, ok := all[value]; ok {
+ return nil
+ }
+ if e, ok := value.Interface().(AnyElement); ok {
+ all[value] = struct{}{}
+ d.Elements = append(d.Elements, e)
+ }
+ }
+ return nil
+ })
+}
+
+var _ interface {
+ json.Marshaler
+ json.Unmarshaler
+} = (*Document)(nil)
+
+func notNil[T any, ListType ~[]T](values ListType) ListType {
+ var out ListType
+ for _, v := range values {
+ if isNil(v) {
+ continue
+ }
+ out = append(out, v)
+ }
+ return out
+}
diff --git a/spdx/v3/v3_0/spdx_serialization_test.go b/spdx/v3/v3_0/spdx_serialization_test.go
new file mode 100644
index 00000000..ee9e4411
--- /dev/null
+++ b/spdx/v3/v3_0/spdx_serialization_test.go
@@ -0,0 +1,180 @@
+package v3_0
+
+import (
+ "bytes"
+ "strings"
+ "testing"
+ "time"
+
+ "github.com/google/go-cmp/cmp"
+
+ "github.com/spdx/tools-golang/spdx/v3/internal"
+)
+
+func Test_spdxExportImportExport(t *testing.T) {
+ doc := SpdxDocument{
+ DataLicense: nil,
+ Imports: nil,
+ }
+
+ doc.ID = "new-id"
+
+ agent := &SoftwareAgent{
+ Name: "some-agent",
+ Summary: "summary",
+ }
+ c := &CreationInfo{
+ Comment: "some-comment",
+ Created: time.Now(),
+ CreatedBy: AgentList{
+ agent,
+ },
+ CreatedUsing: []AnyTool{
+ &Tool{
+ ExternalIdentifiers: ExternalIdentifierList{
+ &ExternalIdentifier{
+ Type: ExternalIdentifierType_Cpe23,
+ Identifier: "cpe:2.3:a:myvendor:my-product:*:*:*:*:*:*:*:*",
+ },
+ },
+ Name: "not-tools-golang",
+ },
+ },
+ SpecVersion: "",
+ }
+ agent.CreationInfo = c
+
+ // add a package
+
+ pkg1 := &Package{
+ Name: "some-package-1",
+ CreationInfo: c,
+ Version: "1.2.3",
+ }
+ pkg2 := &Package{
+ Name: "some-package-2",
+ CreationInfo: c,
+ Version: "2.4.5",
+ }
+ doc.RootElements = append(doc.RootElements, pkg2)
+
+ file1 := &File{
+ Name: "/bin/bash",
+ CreationInfo: c,
+ }
+ doc.RootElements = append(doc.RootElements, file1)
+
+ // add relationships
+
+ doc.RootElements = append(doc.RootElements,
+ &Relationship{
+ CreationInfo: c,
+ From: file1,
+ Type: RelationshipType_Contains,
+ To: ElementList{
+ pkg1,
+ pkg2,
+ },
+ },
+ )
+
+ doc.RootElements = append(doc.RootElements,
+ &Relationship{
+ CreationInfo: c,
+ From: pkg1,
+ Type: RelationshipType_DependsOn,
+ To: ElementList{
+ pkg2,
+ },
+ },
+ )
+
+ doc.RootElements = append(doc.RootElements,
+ &AIPackage{
+ CreationInfo: c,
+ TypeOfModels: []string{"a model"},
+ },
+ )
+
+ got := encodeDecode(t, &doc)
+
+ // some basic verification:
+
+ var pkgs PackageList
+ for _, rel := range got.RootElements.Relationships() {
+ if rel.GetType() != RelationshipType_Contains {
+ continue
+ }
+ if from, ok := rel.GetFrom().(AnyFile); ok {
+ if from.GetName() == "/bin/bash" {
+ for _, pkg := range rel.GetTo().Packages() {
+ pkgs = append(pkgs, pkg)
+ }
+ }
+ }
+ }
+ if len(pkgs) != 2 {
+ t.Error("wrong packages returned")
+ }
+}
+
+func Test_stringSlice(t *testing.T) {
+ p := &AIPackage{
+ TypeOfModels: []string{"a model"},
+ }
+ encodeDecode(t, p)
+}
+
+func Test_profileConformance(t *testing.T) {
+ doc := &SpdxDocument{
+ ProfileConformances: []ProfileIdentifierType{
+ ProfileIdentifierType_Software,
+ },
+ }
+ encodeDecode(t, doc)
+}
+
+func Test_externalID(t *testing.T) {
+ doc := &SpdxDocument{
+ Elements: ElementList{
+ // FIXME update the ExtenralIRI for flat struct generation
+ //NewExternalIRI("http://someplace.org/ac7b643f0b2d"),
+ },
+ }
+ encodeDecode(t, doc)
+}
+
+// encodeDecode encodes to JSON, decodes from the JSON and compares the decoded struct against the input
+func encodeDecode[T comparable](t *testing.T, obj T) T {
+ // serialization:
+ buf := bytes.Buffer{}
+ err := internal.ToJSON("https://spdx.org/rdf/3.0.1/spdx-context.jsonld", context(), obj, &buf)
+ //err := context().ToJSON(&buf, obj)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ json1 := buf.String()
+
+ // deserialization:
+ graph, err := context().FromJSON(strings.NewReader(json1))
+ var got T
+ for _, entry := range graph {
+ if e, ok := entry.(T); ok {
+ got = e
+ break
+ }
+ }
+
+ var empty T
+ if got == empty {
+ t.Fatalf("did not find object in graph, json: %s", json1)
+ }
+
+ diff := cmp.Diff(obj, got, diffOpts()...)
+ if diff != "" {
+ t.Fatal(diff)
+ }
+
+ return got
+}
diff --git a/spdx/v3/v3_0/spdx_test.go b/spdx/v3/v3_0/spdx_test.go
new file mode 100644
index 00000000..068184ce
--- /dev/null
+++ b/spdx/v3/v3_0/spdx_test.go
@@ -0,0 +1,520 @@
+package v3_0_test
+
+import (
+ "bytes"
+ "encoding/json"
+ "os"
+ "strings"
+ "testing"
+ "time"
+
+ "github.com/google/go-cmp/cmp"
+ "github.com/google/go-cmp/cmp/cmpopts"
+ "github.com/pmezard/go-difflib/difflib"
+ "github.com/stretchr/testify/require"
+
+ "github.com/spdx/tools-golang/spdx/v3/internal/ld"
+ spdx "github.com/spdx/tools-golang/spdx/v3/v3_0"
+)
+
+func Test_customSerialization(t *testing.T) {
+ d := spdx.NewDocument(spdx.ProfileIdentifierType_Software, "adoc", &spdx.Person{
+ Name: "Keith",
+ ExternalIdentifiers: spdx.ExternalIdentifierList{
+ &spdx.ExternalIdentifier{
+ Type: spdx.ExternalIdentifierType_Email,
+ Identifier: "keith@example.com",
+ },
+ },
+ }, nil)
+
+ sbom := &spdx.SBOM{}
+ d.RootElements = spdx.ElementList{sbom} // only 1 element appended to document RootElement list
+
+ p := &spdx.Package{}
+ p.Name = "a pkg"
+ sbom.RootElements = append(sbom.RootElements, p)
+
+ p.ContentIdentifiers = append(p.ContentIdentifiers, &spdx.ContentIdentifier{
+ Type: spdx.ContentIdentifierType_Gitoid,
+ Value: "http://example.org",
+ })
+
+ a := &spdx.Person{
+ Name: "Alice",
+ }
+ sbom.RootElements = append(sbom.RootElements, a)
+
+ validationErr := d.Validate(false)
+ require.Error(t, validationErr) // we did not set creationInfo, should be invalid document
+ contents := bytes.Buffer{}
+ err := d.ToJSON(&contents)
+ require.NoError(t, err)
+
+ structure := map[string]any{}
+ err = json.Unmarshal(contents.Bytes(), &structure)
+ require.NoError(t, err)
+
+ graph := structure["@graph"].([]any)
+
+ var spdxDoc map[string]any
+ for _, e := range graph {
+ if e, ok := e.(map[string]any); ok {
+ if e["type"] == "SpdxDocument" {
+ spdxDoc = e
+ break
+ }
+ }
+ }
+ require.NotNil(t, spdxDoc)
+
+ rootElements, _ := spdxDoc["rootElement"].([]any)
+ require.NotNil(t, rootElements)
+
+ serializedSBOMId := ""
+ for _, e := range rootElements {
+ if e, ok := e.(string); ok {
+ serializedSBOMId = e
+ }
+ }
+ require.NotEmpty(t, serializedSBOMId)
+
+ // sbom is serialized to the graph root, find it by id:
+ var serializedSBOM map[string]any
+ for _, e := range graph {
+ if e, ok := e.(map[string]any); ok {
+ if e["type"] == "software_Sbom" && e["spdxId"] == serializedSBOMId {
+ serializedSBOM = e
+ }
+ }
+ }
+ require.NotNil(t, serializedSBOM)
+
+ rootElements, _ = serializedSBOM["rootElement"].([]any)
+ require.NotNil(t, rootElements)
+ require.Len(t, rootElements, 2) // we specifically added 2 elements to the SBOM
+}
+
+func Test_validateMinList(t *testing.T) {
+ a := &spdx.Person{}
+ a.Name = "me"
+ e := &spdx.CreationInfo{
+ SpecVersion: "3.0.1",
+ Created: time.Now(),
+ CreatedUsing: nil,
+ Comment: "",
+ CreatedBy: spdx.AgentList{},
+ }
+ err := e.Validate()
+ require.Error(t, err)
+ require.Contains(t, err.Error(), "must have")
+}
+
+func Test_writer(t *testing.T) {
+ d := newTestDocument()
+ pkg1 := &spdx.Package{
+ Name: "the pkg 2",
+ }
+ file1 := &spdx.File{
+ Name: "a file",
+ ContentType: "text", // validation error
+ Kind: spdx.FileKindType{},
+ }
+ d.RootElements = spdx.ElementList{
+ &spdx.SBOM{
+ Name: "My Bom",
+ Elements: spdx.ElementList{},
+ },
+ file1,
+ pkg1,
+ &spdx.Package{
+ ID: "some ID!",
+ Name: "some name",
+ Description: "descr",
+ ExternalIdentifiers: spdx.ExternalIdentifierList{
+ &spdx.ExternalIdentifier{
+ IdentifierLocators: []ld.URI{
+ "locator1",
+ "locator2",
+ },
+ Identifier: "CVE-2024-1234",
+ Type: spdx.ExternalIdentifierType_Cve,
+ },
+ },
+ ExternalRefs: nil,
+ Summary: "",
+ VerifiedUsing: nil,
+ StandardNames: []string{
+ "standard-name1",
+ "standard-name2",
+ },
+ ReleaseTime: time.Now(),
+ AdditionalPurposes: []spdx.SoftwarePurpose{
+ spdx.SoftwarePurpose_Container,
+ spdx.SoftwarePurpose_Library,
+ },
+ PrimaryPurpose: spdx.SoftwarePurpose_Application,
+ CopyrightText: "",
+ },
+ }
+
+ // many validation issues
+ err := d.Validate(false)
+ require.Error(t, err)
+ require.Contains(t, err.Error(), "CreationInfo")
+
+ err = d.Validate(true)
+ require.Error(t, err)
+ require.NotContains(t, err.Error(), "CreationInfo")
+
+ // fix validation issue
+ file1.ContentType = "text/plain"
+ err = d.Validate(false) // already use creationInfo
+ require.NoError(t, err)
+
+ buf := bytes.Buffer{}
+ err = d.ToJSON(&buf)
+ require.NoError(t, err)
+ d2 := newTestDocument()
+ err = d2.FromJSON(&buf)
+ require.NoError(t, err)
+ // these would (correctly) cause a failure, to validate unexported and time fields are being properly checked:
+ //d2.RootElements.Packages().Views()[1].PrimaryPurpose = spdx.SoftwarePurpose_Archive
+ //_ = spdx.As(d2.CreationInfo, func(info *spdx.CreationInfo) error {
+ // info.Created = info.Created.Add(time.Hour)
+ // return nil
+ //})
+ diff := cmp.Diff(d.SpdxDocument, d2.SpdxDocument, diffOpts()...)
+ if diff != "" {
+ t.Fatal(diff)
+ }
+}
+
+func diffOpts() []cmp.Option {
+ var out []cmp.Option
+ for _, t := range []any{
+ spdx.Package{},
+ spdx.AIPackage{},
+ spdx.Relationship{},
+ spdx.File{},
+ spdx.Snippet{},
+ spdx.Annotation{},
+ spdx.Tool{},
+ spdx.Person{},
+ spdx.Organization{},
+ spdx.CustomLicense{},
+ spdx.ListedLicense{},
+ spdx.SpdxDocument{},
+ spdx.SBOM{},
+ } {
+ out = append(out,
+ cmpopts.IgnoreUnexported(t),
+ cmpopts.IgnoreFields(t, "ID", "CreationInfo"),
+ )
+ }
+ for _, t := range []any{
+ spdx.SpdxDocument{},
+ spdx.SBOM{},
+ spdx.Bundle{},
+ } {
+ out = append(out,
+ cmpopts.IgnoreFields(t, "Elements"),
+ )
+ }
+ out = append(out,
+ cmp.Transformer("truncate_time.Time", func(t time.Time) time.Time {
+ return t.Truncate(time.Second)
+ }),
+ cmpopts.IgnoreFields(spdx.Document{}, "LDContext"),
+ cmpopts.IgnoreFields(spdx.CreationInfo{}, "CreatedUsing"),
+ cmpopts.EquateComparable(
+ spdx.ExternalIdentifierType{},
+ spdx.HashAlgorithm{},
+ spdx.FileKindType{},
+ spdx.SoftwarePurpose{},
+ spdx.PresenceType{},
+ spdx.SafetyRiskAssessmentType{},
+ spdx.RelationshipCompleteness{},
+ spdx.RelationshipType{},
+ spdx.AnnotationType{},
+ spdx.ProfileIdentifierType{},
+ spdx.ExternalIRI{},
+ ),
+ )
+ return out
+}
+
+func Test_reader(t *testing.T) {
+ f, err := os.Open("testdata/test.json")
+ require.NoError(t, err)
+ d := newTestDocument()
+ err = d.FromJSON(f)
+ require.NoError(t, err)
+ sboms := d.RootElements.SBOMs()
+ require.Len(t, sboms, 1)
+
+ packages := sboms[0].GetRootElements().Packages()
+ require.Len(t, packages, 1)
+
+ rels := d.Elements.Relationships()
+ require.Len(t, rels, 1)
+
+ // this is the only reference to the package I see:
+ p := rels[0].GetFrom().(*spdx.Package)
+ require.NotNil(t, p)
+ require.NotEqual(t, time.Time{}, p.BuiltTime)
+ require.Equal(t, "my-package", p.Name)
+}
+
+func Test_readerExpanded(t *testing.T) {
+ f, err := os.Open("testdata/test.expanded.json")
+ require.NoError(t, err)
+ d := newTestDocument()
+ err = d.FromJSON(f)
+ require.NoError(t, err)
+ for _, fi := range d.Elements.Files() {
+ //println("File ID: " + fi.ID)
+ println("File Name: " + fi.GetName())
+ }
+
+ sboms := d.RootElements.SBOMs()
+ require.Len(t, sboms, 1)
+
+ packages := sboms[0].GetRootElements().Packages()
+ require.Len(t, packages, 1)
+
+ rels := d.Elements.Relationships()
+ require.Len(t, rels, 1)
+
+ // this is the only reference to the package I see:
+ p := rels[0].GetFrom().(*spdx.Package)
+ require.NotNil(t, p)
+ require.NotEqual(t, time.Time{}, p.BuiltTime)
+ require.Equal(t, "my-package", p.Name)
+}
+
+func Test_reader2(t *testing.T) {
+ contents := `{
+ "@context": "https://spdx.org/rdf/3.0.1/spdx-context.jsonld",
+ "@graph": [
+ { "type": "SpdxDocument",
+ "element": [ "https://spdx.org/rdf/3.0.1/terms/Core/SpdxOrganization" ]
+ }
+ ]
+ }`
+
+ d := newTestDocument()
+ err := d.FromJSON(strings.NewReader(contents))
+ require.NoError(t, err)
+ require.Len(t, d.Elements, 1)
+ spdxOrgID, _ := ld.GetID(spdx.Organization_SpdxOrganization)
+ gotID, _ := ld.GetID(d.Elements[0])
+ require.Equal(t, spdxOrgID, gotID)
+}
+
+func Test_exportImportExport(t *testing.T) {
+ // create a document
+ doc := spdx.NewDocument(
+ spdx.ProfileIdentifierType_Software,
+ "My Document",
+ &spdx.SoftwareAgent{
+ Name: "tools-golang",
+ Summary: "a summary",
+ },
+ &spdx.Tool{
+ ExternalIdentifiers: spdx.ExternalIdentifierList{
+ &spdx.ExternalIdentifier{
+ Type: spdx.ExternalIdentifierType_Cpe23,
+ Identifier: "cpe:2.3:a:myvendor:my-product:*:*:*:*:*:*:*:*",
+ },
+ },
+ ExternalRefs: nil,
+ Name: "not-tools-golang",
+ })
+
+ sbom := &spdx.SBOM{}
+ doc.RootElements = append(doc.RootElements, sbom)
+
+ // create a package
+
+ pkg1 := &spdx.Package{
+ Name: "some-package-1",
+ Version: "1.2.3",
+ }
+
+ // create another package
+
+ pkg2 := &spdx.AIPackage{}
+ pkg2.Name = "some-package-2"
+ pkg2.Version = "2.4.5"
+
+ // add the packages to the sbom
+
+ sbom.RootElements = append(sbom.RootElements, pkg1, pkg2)
+
+ // add a file
+
+ file1 := &spdx.File{
+ Name: "/bin/bash",
+ }
+ sbom.RootElements = append(sbom.RootElements, file1)
+
+ // add relationships
+
+ sbom.RootElements = append(sbom.RootElements, &spdx.Relationship{
+ From: file1,
+ Type: spdx.RelationshipType_Contains,
+ To: spdx.ElementList{
+ pkg1,
+ pkg2,
+ },
+ })
+
+ sbom.RootElements = append(sbom.RootElements, &spdx.Relationship{
+ From: pkg1,
+ Type: spdx.RelationshipType_DependsOn,
+ To: spdx.ElementList{
+ pkg2,
+ },
+ })
+
+ // serialize
+
+ buf := bytes.Buffer{}
+ err := doc.ToJSON(&buf)
+ if err != nil {
+ t.Error(err)
+ }
+
+ json1 := buf.String()
+
+ // deserialize to a new document
+
+ newDoc := newTestDocument()
+ err = newDoc.FromJSON(strings.NewReader(json1))
+ if err != nil {
+ t.Error(err)
+ }
+
+ // re-serialize
+
+ buf.Reset()
+ err = newDoc.ToJSON(&buf)
+ if err != nil {
+ t.Error(err)
+ }
+ json2 := buf.String()
+
+ // compare original to parsed and re-encoded
+
+ diff := difflib.UnifiedDiff{
+ A: difflib.SplitLines(json1),
+ B: difflib.SplitLines(json2),
+ FromFile: "Original",
+ ToFile: "Current",
+ Context: 3,
+ }
+ text, _ := difflib.GetUnifiedDiffString(diff)
+ if text != "" {
+ t.Errorf(text)
+ }
+
+ // some basic usage:
+
+ var pkgs []spdx.AnyPackage
+ for _, sbom := range doc.RootElements.SBOMs() {
+ for _, rel := range sbom.GetRootElements().Relationships() {
+ if rel.GetType() != spdx.RelationshipType_Contains {
+ continue
+ }
+ f := rel.GetFrom().(*spdx.File)
+ if f.Name == "/bin/bash" {
+ for _, pkg := range rel.GetTo().Packages() {
+ pkgs = append(pkgs, pkg)
+ }
+ }
+ }
+ }
+ if len(pkgs) != 2 {
+ t.Error("wrong packages returned")
+ }
+}
+
+func Test_aiProfile(t *testing.T) {
+ doc := spdx.NewDocument(spdx.ProfileIdentifierType_Ai, "", &spdx.SoftwareAgent{
+ Name: "tools-golang",
+ Summary: "a summary",
+ }, nil)
+
+ aiPkg := &spdx.AIPackage{
+ Name: "some ai package",
+ EnergyConsumption: &spdx.EnergyConsumption{
+ FinetuningEnergyConsumptions: spdx.EnergyConsumptionDescriptionList{
+ &spdx.EnergyConsumptionDescription{
+ EnergyQuantity: 1.2,
+ EnergyUnit: spdx.EnergyUnitType_KilowattHour,
+ },
+ },
+ TrainingEnergyConsumptions: spdx.EnergyConsumptionDescriptionList{
+ &spdx.EnergyConsumptionDescription{
+ EnergyQuantity: 5032402,
+ EnergyUnit: spdx.EnergyUnitType_KilowattHour,
+ },
+ },
+ },
+ TypeOfModels: []string{
+ "Llama 3 8B",
+ },
+ }
+
+ doc.RootElements = append(doc.RootElements, aiPkg)
+
+ // serialize
+
+ buf := bytes.Buffer{}
+ err := doc.ToJSON(&buf)
+ if err != nil {
+ t.Error(err)
+ }
+
+ json1 := buf.String()
+
+ // deserialize to a new document
+
+ doc = newTestDocument()
+ //doc.RootElements.Append(&spdx.Agent{})
+ err = doc.FromJSON(strings.NewReader(json1))
+ if err != nil {
+ t.Error(err)
+ }
+
+ // re-serialize
+
+ buf.Reset()
+ err = doc.ToJSON(&buf)
+ if err != nil {
+ t.Error(err)
+ }
+ json2 := buf.String()
+
+ // compare original to parsed and re-encoded
+
+ diff := difflib.UnifiedDiff{
+ A: difflib.SplitLines(json1),
+ B: difflib.SplitLines(json2),
+ FromFile: "Original",
+ ToFile: "Current",
+ Context: 3,
+ }
+ text, _ := difflib.GetUnifiedDiffString(diff)
+ if text != "" {
+ t.Errorf(text)
+ }
+}
+
+func newTestDocument() *spdx.Document {
+ //return spdx.NewDocument(spdx.ProfileIdentifierType_Lite, "test document",
+ return spdx.NewDocument(spdx.ProfileIdentifierType_Software, "test document",
+ &spdx.SoftwareAgent{Name: "tools-golang-tests-agent", Summary: "a summary"},
+ &spdx.Tool{Name: "tools-golang-tests-tool"})
+}
diff --git a/spdx/v3/v3_0/testdata/test.expanded.json b/spdx/v3/v3_0/testdata/test.expanded.json
new file mode 100755
index 00000000..20a1ea72
--- /dev/null
+++ b/spdx/v3/v3_0/testdata/test.expanded.json
@@ -0,0 +1,242 @@
+[
+ {
+ "@id": "_:creationinfo",
+ "@type": [
+ "https://spdx.org/rdf/3.0.1/terms/Core/CreationInfo"
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/created": [
+ {
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
+ "@value": "2024-03-06T00:00:00Z"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/createdBy": [
+ {
+ "@id": "http://spdx.example.com/Agent/JoshuaWatt"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/specVersion": [
+ {
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ "@value": "3.0.1"
+ }
+ ]
+ },
+ {
+ "@id": "http://spdx.example.com/Agent/JoshuaWatt",
+ "@type": [
+ "https://spdx.org/rdf/3.0.1/terms/Core/Person"
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/creationInfo": [
+ {
+ "@id": "_:creationinfo"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifier": [
+ {
+ "@type": [
+ "https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifier"
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/externalIdentifierType": [
+ {
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/ExternalIdentifierType/email"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/identifier": [
+ {
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ "@value": "JPEWhacker@gmail.com"
+ }
+ ]
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/name": [
+ {
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ "@value": "Joshua Watt"
+ }
+ ]
+ },
+ {
+ "@id": "http://spdx.example.com/Document1",
+ "@type": [
+ "https://spdx.org/rdf/3.0.1/terms/Core/SpdxDocument"
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/creationInfo": [
+ {
+ "@id": "_:creationinfo"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/element": [
+ {
+ "@id": "http://spdx.example.com/BOM1"
+ },
+ {
+ "@id": "http://spdx.example.com/Agent/JoshuaWatt"
+ },
+ {
+ "@id": "http://spdx.example.com/Package1/myprogram"
+ },
+ {
+ "@id": "http://spdx.example.com/Relationship/1"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/profileConformance": [
+ {
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/ProfileIdentifierType/core"
+ },
+ {
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/ProfileIdentifierType/software"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/rootElement": [
+ {
+ "@id": "http://spdx.example.com/BOM1"
+ }
+ ]
+ },
+ {
+ "@id": "http://spdx.example.com/BOM1",
+ "@type": [
+ "https://spdx.org/rdf/3.0.1/terms/Software/Sbom"
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/creationInfo": [
+ {
+ "@id": "_:creationinfo"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/element": [
+ {
+ "@id": "http://spdx.example.com/Package1/myprogram"
+ },
+ {
+ "@id": "http://spdx.example.com/Package1"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/rootElement": [
+ {
+ "@id": "http://spdx.example.com/Package1"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Software/sbomType": [
+ {
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Software/SbomType/build"
+ }
+ ]
+ },
+ {
+ "@id": "http://spdx.example.com/Package1",
+ "@type": [
+ "https://spdx.org/rdf/3.0.1/terms/Software/Package"
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/builtTime": [
+ {
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
+ "@value": "2024-03-06T00:00:00Z"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/creationInfo": [
+ {
+ "@id": "_:creationinfo"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/name": [
+ {
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ "@value": "my-package"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/originatedBy": [
+ {
+ "@id": "http://spdx.example.com/Agent/JoshuaWatt"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Software/downloadLocation": [
+ {
+ "@type": "http://www.w3.org/2001/XMLSchema#anyURI",
+ "@value": "http://dl.example.com/my-package_1.0.0.tar"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Software/packageVersion": [
+ {
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ "@value": "1.0.0"
+ }
+ ]
+ },
+ {
+ "@id": "http://spdx.example.com/Package1/myprogram",
+ "@type": [
+ "https://spdx.org/rdf/3.0.1/terms/Software/File"
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/builtTime": [
+ {
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
+ "@value": "2024-03-06T00:00:00Z"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/creationInfo": [
+ {
+ "@id": "_:creationinfo"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/name": [
+ {
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ "@value": "myprogram"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/originatedBy": [
+ {
+ "@id": "http://spdx.example.com/Agent/JoshuaWatt"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Software/additionalPurpose": [
+ {
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/application"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Software/copyrightText": [
+ {
+ "@type": "http://www.w3.org/2001/XMLSchema#string",
+ "@value": "Copyright 2024, Joshua Watt"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Software/primaryPurpose": [
+ {
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Software/SoftwarePurpose/executable"
+ }
+ ]
+ },
+ {
+ "@id": "http://spdx.example.com/Relationship/1",
+ "@type": [
+ "https://spdx.org/rdf/3.0.1/terms/Core/Relationship"
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/completeness": [
+ {
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipCompleteness/complete"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/creationInfo": [
+ {
+ "@id": "_:creationinfo"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/from": [
+ {
+ "@id": "http://spdx.example.com/Package1"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/relationshipType": [
+ {
+ "@id": "https://spdx.org/rdf/3.0.1/terms/Core/RelationshipType/contains"
+ }
+ ],
+ "https://spdx.org/rdf/3.0.1/terms/Core/to": [
+ {
+ "@id": "http://spdx.example.com/Package1/myprogram"
+ }
+ ]
+ }
+]
diff --git a/spdx/v3/v3_0/testdata/test.json b/spdx/v3/v3_0/testdata/test.json
new file mode 100644
index 00000000..dfa6d959
--- /dev/null
+++ b/spdx/v3/v3_0/testdata/test.json
@@ -0,0 +1,98 @@
+{
+ "@context": "https://spdx.org/rdf/3.0.1/spdx-context.jsonld",
+ "@graph": [
+ {
+ "type": "CreationInfo",
+ "@id": "_:creationinfo",
+ "createdBy": [
+ "http://spdx.example.com/Agent/JoshuaWatt"
+ ],
+ "specVersion": "3.0.1",
+ "created": "2024-03-06T00:00:00Z"
+ },
+ {
+ "type": "Person",
+ "spdxId": "http://spdx.example.com/Agent/JoshuaWatt",
+ "name": "Joshua Watt",
+ "creationInfo": "_:creationinfo",
+ "externalIdentifier": [
+ {
+ "type": "ExternalIdentifier",
+ "externalIdentifierType": "email",
+ "identifier": "JPEWhacker@gmail.com"
+ }
+ ]
+ },
+ {
+ "type": "SpdxDocument",
+ "spdxId": "http://spdx.example.com/Document1",
+ "creationInfo": "_:creationinfo",
+ "rootElement": [
+ "http://spdx.example.com/BOM1"
+ ],
+ "element": [
+ "http://spdx.example.com/BOM1",
+ "http://spdx.example.com/Agent/JoshuaWatt",
+ "http://spdx.example.com/Package1/myprogram",
+ "http://spdx.example.com/Relationship/1"
+ ],
+ "profileConformance": [
+ "core",
+ "software"
+ ]
+ },
+ {
+ "type": "software_Sbom",
+ "spdxId": "http://spdx.example.com/BOM1",
+ "creationInfo": "_:creationinfo",
+ "rootElement": [
+ "http://spdx.example.com/Package1"
+ ],
+ "element": [
+ "http://spdx.example.com/Package1/myprogram",
+ "http://spdx.example.com/Package1"
+ ],
+ "software_sbomType": [
+ "build"
+ ]
+ },
+ {
+ "type": "software_Package",
+ "spdxId": "http://spdx.example.com/Package1",
+ "creationInfo": "_:creationinfo",
+ "name": "my-package",
+ "software_packageVersion": "1.0.0",
+ "software_downloadLocation": "http://dl.example.com/my-package_1.0.0.tar",
+ "builtTime": "2024-03-06T00:00:00Z",
+ "originatedBy": [
+ "http://spdx.example.com/Agent/JoshuaWatt"
+ ]
+ },
+ {
+ "type": "software_File",
+ "spdxId": "http://spdx.example.com/Package1/myprogram",
+ "creationInfo": "_:creationinfo",
+ "name": "myprogram",
+ "software_primaryPurpose": "executable",
+ "software_additionalPurpose": [
+ "application"
+ ],
+ "software_copyrightText": "Copyright 2024, Joshua Watt",
+ "builtTime": "2024-03-06T00:00:00Z",
+ "originatedBy": [
+ "http://spdx.example.com/Agent/JoshuaWatt"
+ ]
+ },
+ {
+ "type": "Relationship",
+ "spdxId": "http://spdx.example.com/Relationship/1",
+ "creationInfo": "_:creationinfo",
+ "from": "http://spdx.example.com/Package1",
+ "relationshipType": "contains",
+ "to": [
+ "http://spdx.example.com/Package1/myprogram"
+ ],
+ "completeness": "complete"
+ }
+ ]
+}
\ No newline at end of file