From https://spdx.github.io/spdx-spec/v3.0.1/annexes/spdx-license-expressions/:
The license expression
is identical to
but it does not say what is canonical form of the expression.
LGPL-2.1-only OR MIT or MIT OR LGPL-2.1-only ?
Should we need to specify that?
The use cases are
- license matching by naive string matching, without license expression normalization (normalized by a smart producer, consumers can be relatively dumb)
- deterministic hash of an SBOM with a license information that contain composite license expressions
Or should we explicitly say that, don't reorder it since the order of licenses may indicate the author's preference (which the license expression is not captured), and leave the order as-is?
--
Follow up question if we think license expression canonicalization is useful:
How to order it?
- By straightforward alphabetical order (using codepoint values of
ALPHA, DIGIT, etc in the ABNF).
- By presence in the SPDX License List then by alphabetical order.
Given a license expression:
MIT AND LicenseRef-My-License AND Apache-2.0
(1) will give:
Apache-2.0 AND LicenseRef-My-License AND MIT
(L comes before M)
while (2) will give:
Apache-2.0 AND MIT AND LicenseRef-My-License
(any LicenseRef-* will come after the listed licenses)
Which ordering is preferred?
From https://spdx.github.io/spdx-spec/v3.0.1/annexes/spdx-license-expressions/:
The license expression
is identical to
but it does not say what is canonical form of the expression.
LGPL-2.1-only OR MITorMIT OR LGPL-2.1-only?Should we need to specify that?
The use cases are
Or should we explicitly say that, don't reorder it since the order of licenses may indicate the author's preference (which the license expression is not captured), and leave the order as-is?
--
Follow up question if we think license expression canonicalization is useful:
How to order it?
ALPHA,DIGIT, etc in the ABNF).Given a license expression:
(1) will give:
(
Lcomes beforeM)while (2) will give:
(any
LicenseRef-* will come after the listed licenses)Which ordering is preferred?