spdx.exceptions

Exception list functionality, primarily provided by org.spdx.library.ListedLicenses.

Notes:

  • The functions in this namespace support any case of identifier or AdditionRef, as per the SPDX case sensitivity rules in SPDX Specification Annex B

addition-ref

(addition-ref addition-ref-var-section)(addition-ref document-ref-var-section addition-ref-var-section)

Constructs an AdditionRef (as a String) from individual ‘variable section’ Strings. Returns nil if addition-ref-var-section is blank, or the resulting value is not a valid AdditionRef.

addition-ref-map->string

(addition-ref-map->string m)

Turns map m representing an AdditionRef into a String, returning nil if m is nil or the resulting value is not a valid AdditionRef.

Note:

addition-ref?

(addition-ref? s)

Is s (a String) a valid AdditionRef? See SPDX Specification Annex B for specifics.

canonicalise

(canonicalise s)

Canonicalises s (an SPDX exception identifier or AdditionRef), by returning it in its canonical case. Returns nil if s is nil or not a listed SPDX exception identifier or AdditionRef.

Notes:

  • This function does not canonicalise a deprecated id to its non-deprecated equivalent, since some of those conversions result in an SPDX expression rather than an individual id. spdx.expressions/parse can be used for that.

deprecated-id?

(deprecated-id? id)

Is id (a String) deprecated? Also returns false if id is not a listed SPDX exception identifier.

See this SPDX FAQ item for details on what this means.

equivalent?

(equivalent? s1 s2)

Are s1 and s2 (Strings) equivalent SPDX exception identifiers or AdditionRefs (i.e. taking the SPDX case sensitivity rules in SPDX Annex B into account)?

id->info

(id->info id)(id->info id {:keys [include-large-text-values?], :or {include-large-text-values? false}, :as opts})

Returns SPDX exception list information for id (a String) as a map, or nil if id is not a listed SPDX exception identifier.

opts are:

  • :include-large-text-values? (default false) - controls whether large text values are included in the result or not

ids

(ids)

The set of all exception ids.

init!

(init!)

Initialises this namespace upon first call (and does nothing on subsequent calls), returning nil. Consumers of this namespace are not required to call this fn, as initialisation will occur implicitly anyway; it is provided to allow explicit control of the cost of initialisation to callers who need it.

Note: this function may have a substantial performance cost.

listed-id?

(listed-id? s)

Is s (a String) one of the listed SPDX exception identifiers?

non-deprecated-ids

(non-deprecated-ids)(non-deprecated-ids ids)

Returns the set of SPDX exception identifiers that identify current (non-deprecated) exceptions, within the provided set of listed SPDX exception identifiers or all listed identifiers when ids not provided.

string->addition-ref-map

(string->addition-ref-map s)

Turns s (a String containing an AdditionRef) into a map representing that same AdditionRef. Returns nil if s is nil or not a valid AdditionRef.

Note:

version

(version)

The version of the exception list (a String in major.minor(.patchlevel) format).

Note: identical to spdx.identifiers/version.