Difference between revisions of "Liblicense"

From Creative Commons
Jump to: navigation, search
m (Reverted edits by CCID-jeremyhardin (talk) to last revision by Nathan Yergler)
 
(80 intermediate revisions by 13 users not shown)
Line 1: Line 1:
[[Category:Developer]]
+
{{Software Project
[[Category:Metadata]]
+
|Description=Low-level license metadata integration for applications.
[[Category:Desktop]]
+
|Bug tracker=http://code.creativecommons.org/issues/issue?status=-1,1,2,3,4,5,6,7&@sort=-activity&@search_text=&@dispname=liblicense&@filter=status,project&@group=priority&project=4&@columns=id,activity,title,creator,assignedto,status&@pagesize=50&@startwith=0
[[Category:Labs]]
+
|Code repository=http://code.creativecommons.org/viewgit/liblicense.git/
[[Category:Tools]]
+
|Mailing list=http://lists.ibiblio.org/mailman/listinfo/cc-devel
[[Category:Specification]]
+
}}
[[Category:Operating System]]
+
== What is liblicense? ==
[[Category:Technology]]
 
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
+
liblicense provides a straight-forward way for developers to build license-aware applications.  liblicense utilizes a pluggable module system for reading and writing metadata from specific file types, allowing extensibility for specific content types.
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.
+
* For a brief introduction video, check [http://blip.tv/file/1142312/ Asheesh Laroia talking about liblicense]
 +
* To see '''liblicense in action''' take a look at [[License tagger]], the cross platform file metadata editor.
  
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.
+
== Features ==
  
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
+
* Extract and write license information for files
current and correct licensing choices and license text.
+
* Supports enumeration of available licenses
 +
* Wraps internationalized license information for Creative Commons licenses
 +
* Bindings for dynamic languages (currently Python and Ruby)
 +
* Extensible support for file types using module system
 +
* No specific GUI library dependency allows applications to build the graphical chooser most appropriate for their platform.
  
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.
+
== Future Improvements ==
  
We will also integrate a module system so that libraries can be used to embed and extract metadata in/from common formats.
+
* Supports [[WebStatement|verification]] URLs for metadata verification
  
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.
+
== Architecture ==
 
 
== Get liblicense ==
 
 
 
* [https://sourceforge.net/project/showfiles.php?group_id=80503&package_id=238700 Latest Release from Sourceforge.net]
 
* Checkout liblicense module from [[SVN]]
 
 
 
== System Overview ==
 
 
 
=== Purpose ===
 
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]].
 
 
 
=== Architecture ===
 
 
[[Image:System_architecture.png]]
 
[[Image:System_architecture.png]]
  
[[Image:System_architecture.svg | svg version]]
+
[[:Image:System_architecture.svg|Liblicense Architecture - SVG]]
  
=== Implementation ===
+
== Bindings ==
This library will be implemented in C to provide maximum portability.
 
  
=== Interface ===
+
* [[Liblicense/Python|Python]]
* module_wrangler
+
* [[Liblicense/Ruby|Ruby]]
** 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 ===
+
== Media ==
* Data Types (informal)
 
** uri
 
** name
 
** notification
 
** deed
 
** sampling
 
  
=== Config Modules ===
+
See [[Operating System Mockups]] for ideas on how '''liblicense''' could be integrated into various platforms.
* '''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 ===
+
== Download ==
The directory will include a file defining the available modules and the mime-types they handle.  If no mime-type is listed it is assumed to be mime-type agnostic and can handle all types through external means.
 
Example:
 
<pre>exempi.o image/jpeg image/png image/tiff application/pdf video/x-msvideo video/quicktime
 
nautilus.o</pre>
 
  
* '''init'''
+
* [http://mirrors.creativecommons.org/software/liblicense/liblicense-0.8.1.tar.gz Latest Release tar.gz]
* '''shutdown'''
+
* Debian and Ubuntu [http://mirrors.creativecommons.org/packages/ repositories].
* '''read'''(filename) - returns the license uri for the given file (embedded license takes precedence)
+
* Read the [[Liblicense tutorial| tutorial]].
* '''write'''(filename,uri) - writes the license uri for the given file
 
  
=== Bindings ===
+
=== Developers: Using git ===
*Python
 
  
== License Files (.rdf) ==
+
If you want to check out the source code and develop on it, use this command:
=== Attributes ===
 
  
* cc:license
+
git clone git://code.creativecommons.org/liblicense.git
** about
+
git submodule init
** permits
+
git submodule update
** 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 [http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html ISO3166])
 
* dc:relation
 
** hasVersion - version number
 
** isReplacedBy - indicates retired license ([http://www.ietf.org/rfc/rfc2396.txt URI])
 
** isBasedOn - indicates ported version ([http://www.ietf.org/rfc/rfc2396.txt URI])
 
* dc:type - always "License"
 
* dc:creator
 
* dc:publisher
 
* dc:identifier - URI of license ([http://www.ietf.org/rfc/rfc2396.txt URI])
 
  
=== Example ===
+
That should give you a working copy you can commit toIn case you wonder: the latter two commandsfill the directories
<pre><rdf:RDF
+
* icons/jurisdictions
  xmlns="http://creativecommons.org/ns#"
+
* license.rdf
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+
* licenses
  xmlns:dc="http://purl.org/dc/elements/1.1/"
+
with content from external repositories similar to ''svn:externals'' for Subversion.
  xmlns:dcq="http://purl.org/dc/terms/"
 
>
 
  <rdf:Description rdf:about="http://creativecommons.org/licenses/by-nd/2.0/za/">
 
    <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:coverage>
 
        <dcq:ISO3166>
 
            <rdf:value>za</rdf:value>
 
        </dcq:ISO3166>
 
    </dc:coverage>
 
    <dc:hasVersion>2.0</dc:hasVersion>
 
    <dc:isReplacedBy>
 
        <dcq:URI>
 
            <rdf:value>http://creativecommons.org/licenses/by-nd/2.5/za/</rdf:value>
 
        </dcq:URI>
 
    </dc:isReplacedBy>
 
    <dc:isBasedOn>
 
        <dcq:URI>
 
            <rdf:value>http://creativecommons.org/licenses/by-nd/2.5/</rdf:value>
 
        </dcq:URI>
 
    </dc:isBasedOn>
 
    <dc:type>License</dc:type>
 
    <dc:creator>iCommons</dc:creator>
 
    <dc:publisher>Creative Commons</dc:publisher>
 
    <dc:identifier>http://creativecommons.org/licenses/by-nd/2.0/za/</dc:identifier>
 
  
    <rdf:type rdf:resource="http://creativecommons.org/ns#License"/>
+
== More Information ==
    <permits rdf:resource="http://creativecommons.org/ns#Distribution"/>
 
    <permits rdf:resource="http://creativecommons.org/ns#Reproduction"/>
 
    <requires rdf:resource="http://creativecommons.org/ns#Attribution"/>
 
    <requires rdf:resource="http://creativecommons.org/ns#Notice"/>
 
  </rdf:Description>
 
</rdf:RDF></pre>
 
  
=== Example (i18n) ===
+
* [[Liblicense/Releases|Release History]] and [[Liblicense/Roadmap|Roadmap]]
<pre><rdf:RDF
+
* [[Liblicense/Desktop_Integration|Desktop Integration]]
  xmlns="http://creativecommons.org/ns#"
+
* [[Liblicense/Screenshots|Screenshots]]
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+
* [[License RDF|RDF Reference]]
  xmlns:dc="http://purl.org/dc/elements/1.1/"
+
* [[Liblicense/Metadata_Table|File Metadata Information]]
  xmlns:dcq="http://purl.org/dc/terms/"
+
* [http://code.creativecommons.org/doc/liblicense/ Library Documentation] (generated from source)
>
+
* [[Buildbot]] helps test out liblicense on various platforms.
  <rdf:Description rdf:about="http://creativecommons.org/licenses/by-nd/2.0/">
 
    <dc:title>
 
        <rdf:Alt>
 
            <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:Alt>
 
    </dc:title>
 
    <dc:description>
 
        <rdf:Alt>
 
            <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>
 
        </rdf:Alt>
 
    </dc:description>
 
    <dc:coverage>
 
        <dcq:ISO3166>
 
            <rdf:value>us</rdf:value>
 
        </dcq:ISO3166>
 
    </dc:coverage>
 
    <dc:hasVersion>2.0</dc:hasVersion>
 
    <dc:isReplacedBy>
 
        <dcq:URI>
 
            <rdf:value>http://creativecommons.org/licenses/by-nd/2.5/</rdf:value>
 
        </dcq:URI>
 
    </dc:isReplacedBy>
 
    <dc:type>License</dc:type>
 
    <dc:creator>Creative Commons</dc:creator>
 
    <dc:publisher>Creative Commons</dc:publisher>
 
    <dc:identifier>http://creativecommons.org/licenses/by-nd/2.0/</dc:identifier>
 
  
    <rdf:type rdf:resource="http://creativecommons.org/ns#License"/>
+
== See Also ==
    <permits rdf:resource="http://creativecommons.org/ns#Distribution"/>
 
    <permits rdf:resource="http://creativecommons.org/ns#Reproduction"/>
 
    <requires rdf:resource="http://creativecommons.org/ns#Attribution"/>
 
    <requires rdf:resource="http://creativecommons.org/ns#Notice"/>
 
  </rdf:Description>
 
</rdf:RDF></pre>
 
  
== Desktop Integration ==
+
* [[Companion File metadata specification]]
 +
* [[Tracker CC Indexing]] - also there is a great chart showing progress on reading/writing different filetypes (copied above).
  
See [[Desktop Integration]]
+
{{Challenge Enabled}}
  
=== Gnome Summit Discussion ===
+
[[Category:Developer]]
 
+
[[Category:Metadata]]
At the Gnome Summit we explored adding CC licensing to various Gnome applications.  Application developers appeared to have a few needs:
+
[[Category:Desktop]]
 
+
[[Category:Labs]]
* 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).
+
[[Category:Tools]]
* 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.
+
[[Category:Specification]]
 
+
[[Category:Operating 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.
+
[[Category:Technology]]
 
+
[[Category:Integration]]
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)".
 
 
 
=== Accessories ===
 
* 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
 
 
 
== Timeline ==
 
=== 6/18 ===
 
* Finalize liblicense API.
 
 
 
=== 6/25 ===
 
* Write liblicense.
 
* Stub config and IO modules.
 
 
 
=== 7/2 ===
 
 
 
=== 7/9 ===
 
* .license/default set default
 
* gnome settings UI
 
 
 
=== 7/16 ===
 
* Nautilus GUI frontend.
 
* Gnome control panel frontend.
 
 
 
=== 7/23 ===
 
* Sugar Journal backend.
 
* Sugar frontend.
 
 
 
=== 7/30 ===
 
* Bug hunting.
 
* Frontend polishing.
 
 
 
=== 8/6 ===
 
* shoot for milestone 3 for linuxworld pr
 
 
 
=== 8/13 ===
 
{{stub}}
 
 
 
=== 8/20 ===
 
{{stub}}
 
 
 
== Milestones ==
 
=== 0.1 ===
 
* Initial release.
 
* All CC licenses.
 
* CLI tools.
 
* Modules.
 
** Exempi embed.
 
** Exempi XMP sidecar.
 
* Make light blog post about release on techblog, explain early state
 
 
 
=== 0.2 ===
 
* Optimization - namely caching in some way.  Should not access file every attribute request.
 
* Gnome tools.
 
** Nautilus frontend.
 
** Gnome settings frontend.
 
** GTK License chooser. (See mockups)
 
* File embed preference over external storage. (Use external only as needed.)
 
* Store default jurisdiction.
 
* Modules.
 
** vorbiscomment
 
** ...
 
* Do big release on main CC blog and across various chat and mailing lists to pick-up people, lots of them...
 
  
=== 0.3 ===
+
__NOTOC__
* Further refinement.
+
{{lowercase}}
* Sugar tools.
 
** Journal integration.
 
* Another major announcement
 

Latest revision as of 20:53, 23 September 2015

Description of Software Low-level license metadata integration for applications.
Bug Tracker Link to Bug Tracker
Code Repository Link to Code repository
Mailing List Link to Mailing list

What is liblicense?

liblicense provides a straight-forward way for developers to build license-aware applications. liblicense utilizes a pluggable module system for reading and writing metadata from specific file types, allowing extensibility for specific content types.

Features

  • Extract and write license information for files
  • Supports enumeration of available licenses
  • Wraps internationalized license information for Creative Commons licenses
  • Bindings for dynamic languages (currently Python and Ruby)
  • Extensible support for file types using module system
  • No specific GUI library dependency allows applications to build the graphical chooser most appropriate for their platform.

Future Improvements

Architecture

System architecture.png

Liblicense Architecture - SVG

Bindings

Media

See Operating System Mockups for ideas on how liblicense could be integrated into various platforms.

Download

Developers: Using git

If you want to check out the source code and develop on it, use this command:

git clone git://code.creativecommons.org/liblicense.git
git submodule init
git submodule update

That should give you a working copy you can commit to. In case you wonder: the latter two commandsfill the directories

  • icons/jurisdictions
  • license.rdf
  • licenses

with content from external repositories similar to svn:externals for Subversion.

More Information

See Also


Liblicense
Have an idea about this page? Want to help build the CC ecosystem? Check out the challenges related to Liblicense, or add one of your own below.
Open Challenges
{{#ask: Is Complete::no

Related To::Liblicense|format=table}}

Completed Challenges
{{#ask: Is Complete::yes

Related To::Liblicense|format=table}}

{{#forminput:Challenge|35 Challenge[related_to]=Liblicense }}