Skip to content

Adding RSL to Media Files

RSL licenses can be embedded directly in the metadata headers of files that contain copyrighted content, such as images, videos, eBooks, and structured data.

By embedding an RSL license in a file, content owners can define licensing and usage terms for applications that want to license the digital asset. Note that if the embedded RSL license is managed by an RSL license server, the <content> element must point to a canonical URL that uniquely identifies the file.

Example Code: Adding an RSL License to an EPUB File

RSL licenses can be embedded directly in an EPUB file by declaring the RSL namespace in the <package> element of the OPF section and adding the RSL license inside the <metadata> block.

xml
<package version="3.0"
         xmlns="http://www.idpf.org/2007/opf"
         xmlns:dc="http://purl.org/dc/elements/1.1/"
         xmlns:rsl="https://rslstandard.org/rsl"
         unique-identifier="BookID">

  <metadata>
    <dc:title>Scaling People: Tactics for Management and Company Building</dc:title>
    <dc:creator>Claire Hughes Johnson</dc:creator>

    <rsl:rsl>
      <rsl:content url="https://press.stripe.com/scaling-people.aes" 
                   server="https://rslcollective.org/api">
        <rsl:license>
          <rsl:permits type="usage">train-ai</rsl:permits>
          <rsl:payment type="royalty">
            <rsl:standard>https://rslcollective.org/license</rsl:standard>
          </rsl:payment>
        </rsl:license>
      </rsl:content>
    </rsl:rsl>

  </metadata>
</package>

Example Code: Adding an RSL License to an Image File

RSL licenses can be embedded in the XMP metadata of most image files (e.g., JPEG, PNG, TIFF, WebP) by declaring the RSL namespace in the <rdf:RDF> element of the XMP header and adding the license in the <rdf:Description> block.

xml
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="RSL/1.0">
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
           xmlns:rsl="https://rslstandard.org/rsl">

    <rdf:Description rdf:about="">
      <rsl:rsl>
        <rsl:content url="https://rslstandard.org/logo.png" 
                     server="https://rslcollective.org/api">
          <rsl:license>
            <rsl:permits type="usage">train-ai</rsl:permits>
            <rsl:payment type="royalty">
              <rsl:standard>https://rslcollective.org/license</rsl:standard>
            </rsl:payment>
          </rsl:license>
        </rsl:content>
      </rsl:rsl>
    </rdf:Description>
  </rdf:RDF>
</x:xmpmeta>

RSL™, Really Simple Licensing™, and the RSL Logo are trademarks of RSL Foundry. Terms of Service. Privacy.