Skip to content
AI-grafen
DAI developerData handling· about 45 min· fundamentals that rarely change· verified 2026-09-20· EN

Licences and open data

Be able to tell CC BY, CC BY-SA, NC and ND apart and decide what may be used commercially.

Prerequisites

Intuition

The Creative Commons building blocks:

CodeMeansConsequence
BYcredit the creatorpresent in every CC licence
SAshare-alikeyour result has to carry the same licence
NCnon-commercialmay not be used commercially
NDno derivativesmay not be changed or built upon
CC0no copyright leftfree use, attribution is polite

The combinations: CC BY (the freest with attribution) → CC BY-SA (infectious) → CC BY-NC (no commercial use) → CC BY-NC-ND (only share unchanged, non-commercially).

For code other licences apply: MIT and Apache-2.0 (permissive), GPL (copyleft — infectious like SA).

Formal

The traps, in order:

  1. NC is vague. «Non-commercial» is not defined in detail. A school is usually fine; a paid service is not. Is the platform partly paid for? Then NC material is a risk — which is why AI-grafen has a licence gate that filters out NC content when PLATFORM_COMMERCIAL is set.
  2. SA is infectious. If you build a work on CC BY-SA material, your work also has to be CC BY-SA. That can clash with the rest of the product.
  3. ND blocks adaptation. You may not cut, summarise or translate it.
  4. The licence can change for future versions — which is why you record which version you fetched and when (a fingerprint), and check whether the licence has changed.
  5. No licence = all rights reserved. Something being openly available on the net does not mean it may be used.

Attribution in practice: the title, the creator, the source (a link), the licence (a link) and whether you changed anything. Four lines, every time.

Code

COMMERCIALLY_ALLOWED = {"CC0", "CC BY 4.0", "CC BY-SA 4.0", "MIT", "Apache-2.0", "BSD-3-Clause", "PSF"}

def may_be_used(licence: str, commercial: bool) -> bool:
    if not licence:
        return False                       # an unknown licence = no
    if "ND" in licence.upper().split("-"):
        return False                       # no adaptation at all
    if commercial and "NC" in licence.upper():
        return False
    return licence in COMMERCIALLY_ALLOWED or not commercial

for lic in ["CC BY 4.0", "CC BY-NC 4.0", "CC BY-ND 4.0", "", "MIT"]:
    print(f"{lic or '(none)':16s} commercially: {may_be_used(lic, True)}")

This is exactly the logic behind license_gate() in the platform — and the test that fails if an NC passage ever leaks into the search results.

Mastery means

  • Tells CC BY, BY-SA, NC and ND apart
  • Decides whether material may be used commercially
  • Gives correct attribution

Sign in to do the exercises and build your mastery up.

Sources

All the sources and licences