Adding RSL to Media Files
RSL licenses can be embedded directly in the metadata headers of media and data files, such as images, videos, eBooks, and structured datasets.
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. If the embedded RSL license is managed by an RSL license server, the <content> element must reference a canonical URL that uniquely identifies the file.
Example Code: Embedding an RSL License in an EPUB File
RSL licenses can be embedded in an EPUB by declaring the RSL namespace in the OPF <package> and including the license in <metadata>.
<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.enc"
server="https://api.rslcollective.org">
<rsl:license>
<rsl:permits type="usage">ai-train</rsl:permits>
<rsl:payment type="inference">
<rsl:standard>https://rslcollective.org/license</rsl:standard>
</rsl:payment>
</rsl:license>
</rsl:content>
</rsl:rsl>
</metadata>
</package>Example Code: Embedding an RSL License in an Image File
RSL licenses can be embedded in the XMP metadata of most image formats (e.g., JPEG, PNG, TIFF, WebP) by declaring the RSL namespace in the <rdf:RDF> element of the XMP header and including the license in the <rdf:Description> block.
<x:xmpmeta xmlns:x="adobe:ns:meta/">
<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>
<rdf:Description>
<rdf:value rdf:parseType="Resource">
<rsl:content>
<rdf:Description>
<rdf:value rdf:parseType="Resource"
rsl:server="https://api.rslcollective.org"
rsl:url="https://rslstandard.org/logo.png">
<rsl:license>
<rdf:Description>
<rdf:value rdf:parseType="Resource" rsl:permits="ai-train">
<rsl:payment>
<rdf:Description>
<rdf:value rdf:parseType="Resource" rsl:type="inference"
rsl:standard="https://rslcollective.org/license"/>
<rdf:type rdf:resource="https://rslstandard.org/rsl#payment"/>
</rdf:Description>
</rsl:payment>
</rdf:value>
<rdf:type rdf:resource="https://rslstandard.org/rsl#license"/>
</rdf:Description>
</rsl:license>
</rdf:value>
<rdf:type rdf:resource="https://rslstandard.org/rsl#content"/>
</rdf:Description>
</rsl:content>
</rdf:value>
<rdf:type rdf:resource="https://rslstandard.org/rsl#rsl"/>
</rdf:Description>
</rsl:rsl>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>Thanks to Mike Bremford for the XMP example.
