Lines Matching +full:spdx +full:- +full:license +full:- +full:ids
1 // SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
10 gordfParser "github.com/spdx/gordf/rdfloader/parser"
11 "github.com/spdx/gordf/rdfwriter"
12 urilib "github.com/spdx/gordf/uri"
13 "github.com/spdx/tools-golang/spdx/common"
21 return parts[len(parts)-1]
24 return parts[len(parts)-1]
69 // used to extract DocumentRef and SPDXRef values from an SPDX Identifier
76 if strings.HasPrefix(idStr, "DocumentRef-") {
77 // extract the part that comes between "DocumentRef-" and ":"
81 return common.DocElementID{}, fmt.Errorf("no colon found although DocumentRef- prefix present")
87 // trim the prefix and confirm non-empty
88 docRefID = strings.TrimPrefix(strs[0], "DocumentRef-")
96 // check prefix to confirm it's got the right prefix for element IDs
97 if !strings.HasPrefix(idStr, "SPDXRef-") {
98 return common.DocElementID{}, fmt.Errorf("missing SPDXRef- prefix for element identifier")
103 // we know this means there was no DocumentRef- prefix, because
108 // trim the prefix and confirm non-empty
109 eltRefID := strings.TrimPrefix(idStr, "SPDXRef-")
118 // used to extract SPDXRef values only from an SPDX Identifier which can point
119 // to this document only. Use extractDocElementID for parsing IDs that can
122 // check prefix to confirm it's got the right prefix for element IDs
123 if !strings.HasPrefix(value, "SPDXRef-") {
124 return common.ElementID(""), fmt.Errorf("missing SPDXRef- prefix for element identifier")
132 // trim the prefix and confirm non-empty
133 eltRefID := strings.TrimPrefix(value, "SPDXRef-")