Support for Libre is provided by NASA, NSF, and the Polar Information Commons.
In addition to supporting Web applications that allow users to interactively create a Polar Information Commons (PIC) badge, nsidc.org hosts a suite of Web services that allow programmers to generate and embed a PIC badge from within their own programs. This is useful, for example, if you need to badge a large number of data sets.
To help you create the badges, you can use any of the following three Application Programming Interfaces (APIs):
Table 1 and Table 2 contain the descriptions of the fields used in the pic_cc_zero waiver and the pic_cc_by licence. For additional information on these and other fields, please go to the Creative Commons API documentation Web site.
NOTE:This API accepts parameters passed by URL or POST, depending on the usage. This API does not actually accept XML input.
| Field | Description | Value |
|---|---|---|
| title | The title of the data you are badging | string |
| attribution_URL | The URL of your data | string This field is required. |
| territory | The country of the contributor | Must be a valid, uppercase ISO 3166-1-alpha-2 country code. A list of available country codes is available at the ISO Web site. This field is required. |
| creator |
The name of the creator of the data, that is, the name of a person or organization | string This field is required. |
| outputType | XML or HTML |
The HTML version can be placed on your Web page to display the badge for the data set. The XML version can be placed within the Use Constraints field of the metadata for your data set. This field is required. |
This API helps you find the names and IDs of the licences currently offered by the PIC.
To call this API, go to the following API URI:
http://nsidc.org/api/picbadge/licenses/
Once the Web page loads, right click and select View Source. The Web page displays the XML output.
As of July 2010, this API returns the following XML:
<license id="pic_cc_zero">PIC CC Zero Waiver</license>
<license id="pic_cc_by">PIC CC By License</license>
</licenses>
This API defines the specific fields for the badges currently offered by the PIC.
To call this API, use the following URI and replace <licenseID> with one of the following valid badge types: pic_cc_zero or pic_cc_by.
http://www.nsidc.org/api/picbadge/licenses/<licenseID>
This is an example of how to call the API for a pic_cc_zero badge:
http://nsidc.org/api/picbadge/licenses/pic_cc_zero/
This is an example of how to call the API for a pic_cc_by badge:
http://nsidc.org/api/picbadge/licenses/pic_cc_by/
Once the Web page loads, right click and select View Source. The Web page displays the XML output.
If you entered pic_cc_zero, the API returns code similar to the sample code below.
<licenseClass id="pic_cc_zero">
<field id="title">
<label>Title of work</label>
<description>The title of your data set</description>
</field>
<field id="attribution_url">
<label>Your URL</label>
<description>The URL of your data set</description>
</field>
<field id="territory">
<label> Territory </label>
<description>The country code</description>
</field> <field id="creator">
<label>Publisher</label>
<description>Your name (if you are the creator of your data set)</description>
</field> <field id="outputType">
<label>Waiver's output format</label>
<description>XML or HTML. The HTML version can be placed on your Web page to display the badge for the data set. The XML version can be placed within the Use Constraints field of the metadata for your data set.</description>
<type>enum</type>
<enum id="html">
<label>HTML</label>
</enum>
<enum id="xml">
<label>XML having HTML and RDF</label>
</enum>
</field>
</licenseClass>
If you entered the pic_cc_by string, the API returns code similar to the sample code below.
<licenseClass id="pic_cc_by">
<field id="title">
<label>Title of work</label>
<description>The title of your data set</description>
</field>
<field id="workurl">
<label>Attribute work to URL</label>
<description>The URL for your data set</description>
</field>
<field id="sourceurl">
<label>Source work URL</label>
<description>The URL of a precursor data set you used to create your data set</description>
</field>
<field id="type">
<label>Format of Work</label>
<description>The type of work</description>
</field> <field id="year">
<label>Year</label>
<description>The year you generated your data set</description>
</field>
<field id="description">
<label>Description</label>
<description>A brief paragraph describing your data set</description>
</field>
<field id="creator">
<label>Attribute work to name</label>
<description>Your name (if you are the creator of your data set)</description>
</field>
<field id="holder">
<label>Holder</label>
<description>The name of the person or organization currently responsible for the archival of your data set</description>
</field>
<field id="outputType">
<label>License's output format</label>
<description>XML or HTML. The HTML version can be placed on your Web page to display the badge for the data set. The XML version can be placed within the Use Constraints field of the metadata for your data set.</description>
<type>enum</type>
<enum id="html">
<label>HTML</label>
</enum> <enum id="xml">
<label>XML having HTML and RDF</label>
</enum>
</field>
</licenseClass>
This API generates and returns a badge in HTML or XML format, based on the information you provide.
To call this API, go to the following URI and replace <licenseID> with one of the following valid badge types: pic_cc_zero or pic_cc_by.
http://www.nsidc.org/api/picbadge/licenses/<licenseID>/issue
The outputType field is required and at least one input field is expected. Only the POST method is allowed.
The following sample code shows the fields that are used as input for a pic_cc_zero badge:
<answers>
<work-info>
<title>IceBridge Snow Radar L1B Geolocated Radar Echo Strength Profiles</title>
<attribution_url>http://nsidc.org/data/irsno1b.html</attribution_url>
<territory>US</territory>
<creator>Carl Leuschen</creator>
</work-info>
<outputType>HTML</outputType>
</answers>
The following sample code shows the fields that are used as input for a pic_cc_by badge:
<answers>
<work-info>
<title>MODIS/Aqua Snow Cover 8-Day L3 Global 500m Grid, Version 5</title>
<workurl>http://nsidc.org/data/myd10a2v5.html</workurl>
<sourceurl>http://nsidc.org/data/myd10a1v5.html</sourceurl>
<type>Data Set</type>
<description>The MODIS/Aqua Snow Cover 8-Day L3 Global 500m Grid (MYD10A2) data set contains data fields for maximum snow cover extent over an eight-day compositing period and a chronology of snow occurrence observations in compressed Hierarchical Data Format-Earth Observing System (HDF-EOS) format, along with corresponding metadata.</description>
<creator>G. Riggs, D. Hall, V. Salomonson</creator>
<holder>NSIDC</holder>
</work-info>
<outputType>HTML</outputType>
</answers>
If the licenseID is pic_cc_zero and the outputType is HTML, the API returns the following code:
<html>
<p xmlns:dct="http://purl.org/dc/terms/" xmlns:vcard="http://www.w3.org/2001/vcard-rdf/3.0#">
<a href="http://polarcommons.org/ethics-and-norms-of-data-sharing.php"><img src="http://polarcommons.org/images/PIC_print_small.png"/> </a>
<a rel="license" href="http://creativecommons.org/publicdomain/zero/1.0/"> <img src="http://i.creativecommons.org/l/zero/1.0/88x31.png" style="border-style: none;" alt="CC0"/> </a> <br/> To the extent possible under law, <a rel="dct:publisher" href="http://nsidc.org/data/myd10a2v5.htmlL"><span property="dct:title">Carl Leuschen</span></a> has waived all copyright and related or neighboring rights to<span property="dct:title">IceBridge Snow Radar L1B Geolocated Radar Echo Strength Profiles</span>.
</p>
</html>
If the licenseID is pic_cc_zero and the outputType is XML, the API returns the following code:
<result>
<license-uri>http://creativecommons.org/publicdomain/zero/1. 0/</license-uri>
<license-name>CC0 1.0 Universal</license-name>
<rdf>
<rdf:RDF xmlns="http://creativecommons.org/ns#" xmlns: rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<Work xmlns:dc="http://purl.org/dc/elements/1.1/" rdf: about="">
<dc:title>MODIS/Aqua Snow Cover 8-Day L3 Global 500m Grid, Version 5</dc:title>
<dc:creator>G. Riggs, D. Hall, V. Salomonson</dc:creator>
<license rdf:resource="http: //creativecommons.org/publicdomain/zero/1.0/"/>
</Work>
<License rdf:about="http://creativecommons. org/publicdomain/zero/1.0/">
<permits rdf:resource="http://creativecommons. org/ns#DerivativeWorks"/>
<permits rdf:resource="http://creativecommons. org/ns#Distribution"/>
<permits rdf:resource="http://creativecommons. org/ns#Reproduction"/>
</License>
</rdf:RDF>
</rdf>
<licenserdf>
<rdf:RDF xmlns="http://creativecommons.org/ns#" xmlns: rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<License rdf:about="http://creativecommons. org/publicdomain/zero/1.0/">
<permits rdf:resource="http://creativecommons. org/ns#DerivativeWorks"/>
<permits rdf:resource="http://creativecommons. org/ns#Distribution"/>
<permits rdf:resource="http://creativecommons. org/ns#Reproduction"/>
</License>
</rdf:RDF>
</licenserdf>
<html>
<p xmlns:dct="http://purl.org/dc/terms/">
<a href="http://polarcommons.org/ethics-and-norms-of-data- sharing.php"><img src="http://polarcommons. org/images/PIC_print_small.png"/></a><a rel="license" href="http://creativecommons.org/publicdomain/zero/1.0/"> <img src="http://i.creativecommons.org/l/zero/1.0/88x31.png" style="border-style: none;" alt="CC0"/> </a>
<br/>
To the extent possible under law, <a rel="dct:publisher" href="http://nsidc.org/data/myd10a2v5.html"> <span property="dct:title">G. Riggs, D. Hall, V. Salomonson</span></a> has waived all copyright and related or neighboring rights to <span property="dct:title">MODIS/Aqua Snow Cover 8-Day L3 Global 500m Grid, Version 5</span>.
</p>
</html>
</result>
If the licenseID is pic_cc_by and the outputType is HTML, the API returns code similar to the sample code below.
<html>
<a href="http://polarcommons.org/ethics-and-norms-of-data-sharing.php"><img src="http://polarcommons.org/images/PIC_print_small.png"/></a>
<a href="http://creativecommons.org/licenses/by/3.0/" rel="license"><img alt="Creative Commons License" src="http://i.creativecommons.org/l/by/3.0/88x31.png" style="border-width:0"/></a><br/>
This <span href="http://purl.org/dc/dcmitype/Text" rel="dc:type" xmlns:dc="http://purl.org/dc/elements/1.1/">work</span> by <a href="http://nsidc.org/data/myd10a2v5.html" property="cc:attributionName" rel="cc:attributionURL" xmlns:cc="http://creativecommons.org/ns#">G. Riggs, D. Hall, V. Salomonson</a> is licensed under a <a href="http://creativecommons.org/licenses/by/3.0/" rel="license">Creative Commons Attribution 3.0 Unported License</a>
</html>
If the licenseID is pic_cc_by and the outputType is XML , the API returns code similar to the sample code below.
<result>
<license-uri>http://creativecommons.org/licenses/by/3.0/< /license-uri>
<license-name>Attribution 3.0 Unported</license-name>
<rdf>
<rdf:RDF xmlns="http://creativecommons.org/ns#" xmlns: rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<Work xmlns:dc="http://purl.org/dc/elements/1.1/" rdf: about=" Attribution URL">
<dc:title>MODIS/Aqua Snow Cover 8-Day L3 Global 500m Grid, Version 5</dc:title>
<dc:type>http://purl.org/dc/dcmitype/Text</dc:type>
<dc:date>2010</dc:date>
<dc:description>The MODIS/Aqua Snow Cover 8-Day L3 Global 500m Grid (MYD10A2) data set contains data fields for maximum snow cover extent over an eight-day compositing period and a chronology of snow occurrence observations in compressed Hierarchical Data Format-Earth Observing System (HDF-EOS) format, along with corresponding metadata.</dc:description>
<dc:creator>G. Riggs, D. Hall, V. Salomonson</dc:creator>
<dc:rights>G. Riggs, D. Hall, V. Salomonson</dc:rights>
<dc:source>http://nsidc.org/data/myd10a2v5.html</dc:source>
<license rdf:resource="http://creativecommons. org/licenses/by/3.0/"/>
</Work>
<License rdf:about="http: //creativecommons.org/licenses/by/3.0/">
<permits rdf:resource="http://creativecommons. org/ns#DerivativeWorks"/>
<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"/>
</License>
</rdf:RDF>
</rdf>
<licenserdf>
<rdf:RDF xmlns="http://creativecommons.org/ns#" xmlns: rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<License rdf:about="http://creativecommons.org/licenses/by/3. 0/">
<permits rdf:resource="http://creativecommons. org/ns#DerivativeWorks"/>
<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"/>
</License>
</rdf:RDF>
</licenserdf>
<html>
<a href="http://polarcommons.org/ethics-and-norms-of- data-sharing.php"><img src="http://polarcommons. org/images/PIC_print_small.png"/></a>
<a rel="license" href="http://creativecommons.org/licenses/by/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by/3.0/88x31.png"/></a>< br/>This <span xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://purl.org/dc/dcmitype/Text" rel="dc:type">work< /span> by <a xmlns:cc="http://creativecommons.org/ns#" href="http://nsidc.org/data/myd10a2v5.html" property="cc:attributionName" rel="cc:attributionURL">G. Riggs, D. Hall, V. Salomonso</a> is licensed under a <a rel="license" href="http: //creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported License</a>.
<br/>
Based on a work at <a xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://nsidc.org/data/myd10a2v5.html" rel="dc:source">http://nsidc.org/data/myd10a2v5.html</a>.
</html>
</result>
Example Python code for creating a badge:
myPICLicense = urllib2.urlopen(APIURL, data="answers = %s" % MyXMLAnswers).read()
NOTE:The MyXMLAnswers parameter is the same as the input parameters mentioned in this API.
Page last updated: 11/14/12