Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
aschet committed Apr 21, 2017
2 parents 7320220 + 98b0f6b commit 9dfb974
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The [SPDX specification](https://spdx.org/spdx-specification-21-web-version) was created to exchange licensing information along a software supply chain in a standard way. Part of this specification are license expressions which can be used to describe the licensing of a software in a formal way e.g. `(LGPL-3.0 OR MIT)`.

Within the [SPDX tools](https://github.com/spdx/tools), the official specification implementation of the SPDX working group, license expressions are represented as `AnyLicenseInfo` composite. Interacting with this composite can be quite complicated, therefore the spdx-license-expression-tools library was created to provide various operations that can performed on SPDX license expressions:
Within the [SPDX tools](https://github.com/spdx/tools), the official specification implementation of the SPDX working group, license expressions are represented as `AnyLicenseInfo` composite. Interacting with this composite can be quite complicated, therefore the spdx-license-expression-tools Java library was created to provide various operations that can performed on SPDX license expressions:
- simplification
- filtering
- merging
Expand All @@ -12,7 +12,7 @@ Within the [SPDX tools](https://github.com/spdx/tools), the official specificati

### Simplification

Remove redundant terms transform license expressions to the distributed normal form (DNF):
Removing of redundant terms and transforming license expressions to the distributed normal form (DNF):

```java
AnyLicenseInfo expression = LicenseInfoFactory.parseSPDXLicenseString("(((LGPL-3.0+ OR MIT) AND GPL-2.0) OR BSD-3-Clause)");
Expand All @@ -21,14 +21,14 @@ ExpressionSimplification.simplify(expression); // -> (BSD-3-Clause OR (LGPL-3.0+

### Filtering

Remove operators:
Removing of operators:

```java
AnyLicenseInfo expression = LicenseInfoFactory.parseSPDXLicenseString("LGPL-3.0+ WITH DigiRule-FOSS-exception AND MIT");
ExpressionFiltering.filterOperators(expression, OperatorFilter.FILTER_ALL); // -> (LGPL-3.0 AND MIT)
```

Remove licenses:
Removing of licenses:

```java
AnyLicenseInfo expression = LicenseInfoFactory.parseSPDXLicenseString("((LGPL-3.0+ AND MIT) AND BSD-3-Clause)");
Expand All @@ -39,15 +39,15 @@ ExpressionFiltering.filterLicenses(expression, matcher); // -> (MIT AND BSD-3-Cl

### Merging

Join with `AND`:
Joining with `AND`:

```java
AnyLicenseInfo expression1 = LicenseInfoFactory.parseSPDXLicenseString("LGPL-3.0+ AND MIT");
AnyLicenseInfo expression2 = LicenseInfoFactory.parseSPDXLicenseString("BSD-3-Clause");
ExpressionMerging.andJoin(expression1, expression2); // -> ((LGPL-3.0+ AND MIT) AND BSD-3-Clause)
```

Join with `OR`:
Joining with `OR`:

```java
AnyLicenseInfo expression1 = LicenseInfoFactory.parseSPDXLicenseString("LGPL-3.0+ AND MIT");
Expand All @@ -57,14 +57,14 @@ ExpressionMerging.orJoin(expression1, expression2); // -> ((LGPL-3.0+ AND MIT) O

### Splitting

Split to conjunctive sets (after simplification):
Splitting to conjunctive sets (after simplification):

```java
AnyLicenseInfo expression = LicenseInfoFactory.parseSPDXLicenseString("(((LGPL-3.0+ OR MIT) AND GPL-2.0) OR BSD-3-Clause)");
ExpressionSplitting.splitToConjunctiveSets(expression); // -> BSD-3-Clause, (LGPL-3.0+ AND GPL-2.0), (MIT AND GPL-2.0)
```

Split to licenses or list contained licenses:
Splitting to licenses (list of contents):

```java
AnyLicenseInfo expression = LicenseInfoFactory.parseSPDXLicenseString("(((LGPL-3.0+ OR MIT) AND GPL-2.0) OR BSD-3-Clause)");
Expand Down

0 comments on commit 9dfb974

Please sign in to comment.