CC Open Source Blog

System Integrated Licensing

author's gravatar

by tannewt on 2007-06-19

I've been asked, as a tech intern here at Creative Commons, to create a way of locally tracking file licenses on a system. A while back Jon wrote down his ideas about system-wide license tracking on the Creative Commons wiki. The purpose of this system would be to provide an interface for developers to access the available licenses on a system. Additionally, like the existing online license chooser, this library, called libLicense, will feature a way to choose a license through toggling certain flags available for a family of licenses. Naturally, the first family available will be the Creative Commons licenses. The larger goal for the summer is to utilize this library in a few initial systems. Currently, I'm looking at integration into Gnome and Sugar (from the One Laptop Per Child project). This further work will occur after libLicense is working.

Data

To run libLicense the data of all the licenses will need to be stored in some sort of fashion. My initial thought is this:

API
The library would potentially have these functions:

get_jurisdiction(uri) - returns the jurisdiction for the given license.
get_jurisdictions(short or bitcode) - returns the available jurisdiction for the given short name or bitcode.
get_locale(uri) - returns the locale for the given license.
get_locales(jurisdiction, short or bitcode) - returns the available locales for the given jurisdiction and short name or bitcode.
get_name(uri) - returns the name of the license.
get_version(uri) - returns the version of the license.
get_versions(short, jurisdiction) - returns the available versions for the given short name or bitcode and jurisdiction.
get_short(uri) - returns the short name for the given uri.
has_flag(attribute,uri) - returns if the flag is set for the given uri.
family_flags(family) - returns the flags available for a given family.
family(uri) - returns the family the given uri belongs to.
get_notification(uri[,url]) - returns the notification string for the given url with an option to provide a verification url.
verify_uri(uri) - returns whether or not the given uri is recognized by the system.
get_license(family,flags, jurisdiction,locale) - returns the uri which satisfies the given attributes.
get_all_licenses() - returns all general licenses available.
get_general_licenses(family) - returns all general licenses in a family.
get_families() - returns a list of available families.

Did I miss something? Does something not make sense? Please post a comment.