From Creative Commons
Revision as of 18:31, 27 July 2007 by Scott Shawcroft (talk | contribs) (Architecture)
Jump to: navigation, search

A library for managing license metadata, in particular CC licensing information.

The idea of this library started out on the IRC channel, in a discussion on how to best help boost the community of software developers working with things related to CC - mostly the metadata format.

Basically, the idea is to write a portable C library that manages metadata for CC licenses, and a bunch of other licenses of interest to the community.

The library will produce licensing information based on the specifications of calling libraries and programs. In addition to generating text for specific licenses, it will also allow an application to enumerate which licenses are currently available and provide descriptive text for each license, and for license features. It should also provide an easy way to specify "verify at" URLs.

The benefit of this library is that applications linking to it can correctly offer licensing choices, and these choices can be transparently updated through package managers as license versions are updated. Human readable descriptions will also be internationalized, preferably using the same .po files used by the CC web site. Hence liblicense will take advantage of package updating and i18n systems to allow applications to always provide c current and correct licensing choices and license text.

Part of the project is also to provide wrappers for the library for other languages, and to help external developers add metadata support to their projects. A good start will probably be to wrap the library for Python, and use it for ccpublisher.

We will also integrate a module system so that libraries can be used to embed and extract metadata in/from common formats.

As liblicense itself deals only with text strings, we can also make GUI libraries to provide dialogs which present these strings to the user in desktop or web applications. This layering ensures that such dialogs present consistent licensing choices.

Get liblicense

System Overview


To provide a simple way for developers to make their applications license aware. Additionally, supplemental modules aim to provide a method for users to track licenses of files on their system. This project complements Companion File metadata specification and Tracker CC Indexing.


System architecture.png


This library will be implemented in C to provide maximum portability.


  • module_wrangler
    • get_config_modules() - returns a null terminates list of available config modules.
    • get_io_modules() - returns a null terminates list of available io modules.
    • get_module_symbol(module,symbol) - returns the requested symbol.
    • module_init(module) - Loads the module and calls its init function.
    • module_shutdown(module) - Calls the shutdown method of the module and unloads it.
    • io_module_mime_types(module0 - returns a null-terminated list of the supported mime-types.
  • read_license
    • read(filename) - returns the uri of the license of the given file.
    • module_read(filename,module) - returns the uri of the license of the given file while using the given module.
  • write_license
    • write(filename,uri) - writes the given license to the given file using all applicable modules.
    • module_write(filename,module,uri) - writes the given license to the given file using the given module.
  • system_default
    • set_default(uri)
    • get_default()
  • system_licenses
    • get_jurisdiction(uri) - returns the jurisdiction for the given license.
    • get_name(uri) – returns the name of the license.
    • get_version(uri) – returns the version of the license.
    • get_prohibits(uri)
    • get_permits(uri)
    • get_requires(uri)
    • verify_uri(uri) - returns whether or not the given uri is recognized by the system.
    • get_all_licenses() - returns a null-terminated list of all general license uris available for new works.
    • get_licenses_in_juris(juris_t) - returns a null-terminated list of all general licenses in a family.

Data Structure

  • Data Types (informal)
    • uri
    • name
    • notification
    • deed
    • sampling

Config Modules

  • in_use() - returns whether or not the corresponding config system exists on the computer
  • get() - returns the current default license uri
  • set(uri) - sets the default license uri and returns 0 upon success (non-zero for errors)

I/O Modules

I/O modules are shared objects that call LL_MODULE_DEFINE(name,description,version,features,mime_types,init_func,read_func,write_func).

  • name
  • description
  • version
  • features - If the module embeds the license within the file, pass LL_FEATURES_EMBED
  • mime_types - A space-separated string of supported mime-types, or NULL if mime-type agnostic (i.e. XMP sidecar)
  • init_func - This function will be called once before the module is used
  • read_func - Function to be called when requested to read a license from a file. It takes a filename and returns the license URI, or NULL if no license is present. Should return an 'int' indicating success or failure.
  • write_func - Function to be called when requested to write a license to a file. The first parameter is the filename and the second is the license URI to write. Should return an 'int' indicating success or failure.


  • Python

License Files (.rdf)


  • cc:license
    • about
    • permits
    • requires
    • prohibits
  • dc:title - The human readable name of the license.
  • dc:description - Description of the license.
  • dc:coverage - The jurisdiction of the license. (country code from ISO3166)
  • dc:relation
    • hasVersion - version number
    • isReplacedBy - indicates retired license (URI)
    • isBasedOn - indicates ported version (URI)
  • dc:type - always "License"
  • dc:creator
  • dc:publisher
  • dc:identifier - URI of license (URI)


  <rdf:Description rdf:about="">
    <dc:title>Creative Commons Attribution No Derivatives</dc:title>
    <dc:description>This license allows for redistribution, commercial and non-commercial,
 as long as it is passed along unchanged and in whole, with credit to you.</dc:description>
    <dc:publisher>Creative Commons</dc:publisher>

    <rdf:type rdf:resource=""/>
    <permits rdf:resource=""/>
    <permits rdf:resource=""/>
    <requires rdf:resource=""/>
    <requires rdf:resource=""/>

Example (i18n)

  <rdf:Description rdf:about="">
            <rdf:li xml:lang="x-default">Creative Commons Attribution No Derivatives</rdf:li>
            <rdf:li xml:lang="es-cl">Creative Commons Atribución-SinDerivadas</rdf:li>
            <rdf:li xml:lang="x-default">This license allows for redistribution, commercial and non-commercial,
 as long as it is passed along unchanged and in whole, with credit to you.</rdf:li>
    <dc:creator>Creative Commons</dc:creator>
    <dc:publisher>Creative Commons</dc:publisher>

    <rdf:type rdf:resource=""/>
    <permits rdf:resource=""/>
    <permits rdf:resource=""/>
    <requires rdf:resource=""/>
    <requires rdf:resource=""/>

Desktop Integration

See Desktop Integration

Gnome Summit Discussion

At the Gnome Summit we explored adding CC licensing to various Gnome applications. Application developers appeared to have a few needs:

  • They want to display the appropriate icon (or other) for a particular license. For instance, AbiWord could display a small icon representing license status in the tool bar. Music players could display the icon in the controls area. A music streaming app might want to play a 5 second "Now entering the Creative Commons" chime (much like radio station identification, but for licenses).
  • They want to allow the user to easily select a license. This would probably be a wizard that asks the user questions and tries to select the most appropriate license from all that it knows about. Much like a file selection dialog, but navigating licenses instead of your file system.

A low-level liblicense could handle XML parsing required. It would allow the client to determine the questions that need to be asked to select a license, and to download any icons, blurbs, etc for all known license types.

The low-level library solves the first problem above, but not the second. It's still too difficult to ask the user to select a license. Layered on top of the low-level library would be any number of high level libraries that would convert the textual questions into GUI widgets and present them using the appropriate toolkit (GTK+ / KDE / Cocoa / Win32 / etc). This way, adding license awareness to an application should be as easy as "license=SFGetLicense(); saveDocument(license)".


  • CLI
    • license (bundled) - simple cli program to license files.
    • .license/default engine - a .license directory will contain the user's default setting, other config info and the user's licenses.
  • Gnome
    • Gnome Settings frontend. - set the default license through the gnome settings interface.
    • Nautilus Frontend Extension - set and read licenses through nautilus.
    • License chooser (app.) - license chooser for setting default and per file licenses. (GUI license)
    • GTK widget
    • Gconf config module.
  • Sugar
    • Journal Backend
    • Journal Frontend
  • KDE3 (???)
  • KDE4



  • Finalize liblicense API.


  • Write liblicense.
  • Stub config and IO modules.



  • .license/default set default
  • gnome settings UI


  • Nautilus GUI frontend.
  • Gnome control panel frontend.


  • Sugar Journal backend.
  • Sugar frontend.


  • Bug hunting.
  • Frontend polishing.


  • shoot for milestone 3 for linuxworld pr





  • Initial release. (done)
  • All CC licenses. (done)
  • CLI tools. (done)
  • Modules. (done)
    • Exempi embed. (done)
    • Exempi XMP sidecar. (done)
  • Make light blog post about release on techblog, explain early state (done)


  • Optimization - namely caching in some way. Should not access file every attribute request.
  • Gnome tools. (done)
    • Nautilus frontend. (done)
    • Gnome settings frontend. (done)
    • GTK License chooser. (See mockups) (done)
  • File embed preference over external storage. (Use external only as needed.) (done)
  • Store default jurisdiction. (done - default license is in default jurisdiction)
  • Modules.
    • vorbiscomment (done)
    • ...
  • Do big release on main CC blog and across various chat and mailing lists to pick-up people, lots of them...
  • Do liblicense 03 release todo


  • Further refinement.
  • Sugar tools.
    • Journal integration.
  • Another major announcement