Skip to content

Commit

Permalink
Differenziertes Lizenzen-Modell von CKAN übernommen
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Marienfeld committed Nov 27, 2012
1 parent 179440b commit 4d31331
Show file tree
Hide file tree
Showing 3 changed files with 235 additions and 37 deletions.
36 changes: 17 additions & 19 deletions OGPD_JSON_Schema.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,21 @@
<p><table border=1 cellpadding=0 cellspacing=0
style='border-collapse:collapse;table-layout:fixed'>
<col>
<tr><th colspan='2'>Lizenzen</th></tr>
<tr><th>ID</th><th>Titel</th></tr>
<tr><td>apache</td><td>Apache Software License</td></tr>
<tr><td>app_commercial</td><td>Andere kommerzielle Lizenz (nur für Anwendungen)</td></tr>
<tr><td>app_freeware</td><td>Andere kostenfreie Lizenz (nur für Anwendungen)</td></tr>
<tr><td>app_opensource</td><td>Andere Open Source Lizenz (nur für Anwendungen)</td></tr>
<tr><td>bsd-license</td><td>New and Simplified BSD Licenses</td></tr>
<tr><td>cc-by</td><td>Creative Commons Namensnennung</td></tr>
<tr><td>cc-by-sa</td><td>Creative Commons Weitergabe unter gleichen Bedingungen</td></tr>
<tr><td>cc-nc</td><td>Creative Commons Nicht-Kommerziell (eingeschränkte Lizenz)</td></tr>
<tr><td>cc-zero</td><td>Creative Commons Zero</td></tr>
<tr><td>gfdl</td><td>GNU Free Documentation License</td></tr>
<tr><td>gpl-3.0</td><td>GNU General Public License version 3.0 (GPLv3)</td></tr>
<tr><td>mozilla</td><td>Mozilla Public License 1.0 (MPL)</td></tr>
<tr><td>odc-odbl</td><td>Open Data Commons Open Database License</td></tr>
<tr><td>other-closed</td><td>Andere eingeschränkte Lizenz</td></tr>
<tr><td>other-open</td><td>Andere freie Lizenz</td></tr>

<tr><th colspan='4'>Lizenzen</th></tr>
<tr><th>ID</th><th>Titel</th><th>Klassifizierung</th><th>Für Daten/Inhalte</th><th>Für Apps</th></tr>
<tr><td>apache</td><td>Apache Lizenz</td><td>offen</td><td></td><td>X</td></tr>
<tr><td>app_commercial</td><td>Andere kommerzielle Lizenz</td><td>eingeschränkt</td><td></td><td>X</td></tr>
<tr><td>app_freeware</td><td>Andere kostenfreie Lizenz</td><td>eingeschränkt</td><td></td><td>X</td></tr>
<tr><td>app_opensource</td><td>Andere Open Source Lizenz</td><td>offen</td><td></td><td>X</td></tr>
<tr><td>bsd-license</td><td>BSD Lizenz</td><td>offen</td><td></td><td>X</td></tr>
<tr><td>cc-by</td><td>Creative Commons Namensnennung (CC-BY)</td><td>offen</td><td>X</td><td></td></tr>
<tr><td>cc-by-sa</td><td>Creative Commons Attribution Weitergabe unter gleichen Bedingungen (CC-BY-SA)</td><td>offen</td><td>X</td><td></td></tr>
<tr><td>cc-nc</td><td>Creative Commons Nicht-Kommerziell (CC-NC)</td><td>eingeschränkt</td><td></td><td></td></tr>
<tr><td>cc-zero</td><td>Creative Commons Zero</td><td>offen</td><td>X</td><td></td></tr>
<tr><td>gfdl</td><td>GNU Free Documentation License</td><td>offen</td><td>X</td><td></td></tr>
<tr><td>gpl-3.0</td><td>GNU General Public License version 3.0 (GPLv3)</td><td>offen</td><td></td><td>X</td></tr>
<tr><td>mozilla</td><td>Mozilla Public License 1.0 (MPL)</td><td>offen</td><td></td><td>X</td></tr>
<tr><td>odc-odbl</td><td>Open Data Commons Open Database License (ODbL)</td><td>offen</td><td>X</td><td></td></tr>
<tr><td>other-open</td><td>Andere freie Lizenz</td><td>offen</td><td>X</td><td>X</td></tr>
<tr><td>other-closed</td><td>Andere eingeschränkte Lizenz</td><td>eingeschränkt</td><td>X</td><td>X</td></tr>
</table>

19 changes: 18 additions & 1 deletion gen-html.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/python
# -*- coding: utf8 -*-
import sys,json,collections,string
reload(sys)
sys.setdefaultencoding('utf-8')
Expand Down Expand Up @@ -122,6 +123,22 @@ def listBody(list):
out.append('<tr><td>{0}</td><td>{1}</td></tr>\n'.format(id,title))
return ''.join(out)

def listLicenseTable(list):
out = ["""
<p><table border=1 cellpadding=0 cellspacing=0
style='border-collapse:collapse;table-layout:fixed'>
<col>
<tr><th colspan='4'>Lizenzen</th></tr>
<tr><th>ID</th><th>Titel</th><th>Klassifizierung</th><th>Für Daten/Inhalte</th><th>Für Apps</th></tr>
"""]
for license in list:
is_open = 'offen' if license['is_osi_compliant'] or license['is_okd_compliant'] else 'eingeschränkt'
domain_data = 'X' if license['domain_content'] or license['domain_data'] else ''
domain_software = 'X' if license['domain_software'] else ''
out.append('<tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td><td>{4}</td></tr>\n'.format(license['id'],license['title'],is_open,domain_data,domain_software))
out.append('</table>')
return ''.join(out)

f=open('kategorien/deutschland.json', 'r')
kat=json.loads( f.read(), object_pairs_hook=collections.OrderedDict)
f.close()
Expand All @@ -130,5 +147,5 @@ def listBody(list):
f=open('lizenzen/deutschland.json', 'r')
licences=json.loads( f.read(), object_pairs_hook=collections.OrderedDict)
f.close()
listTable('Lizenzen', listBody(licences))
print listLicenseTable(licences)

217 changes: 200 additions & 17 deletions lizenzen/deutschland.json
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,17 +1,200 @@
{
"apache": "Apache Software License",
"app_commercial": "Andere kommerzielle Lizenz (nur für Anwendungen)",
"app_freeware": "Andere kostenfreie Lizenz (nur für Anwendungen)",
"app_opensource": "Andere Open Source Lizenz (nur für Anwendungen)",
"bsd-license": "New and Simplified BSD Licenses",
"cc-by": "Creative Commons Namensnennung",
"cc-by-sa": "Creative Commons Weitergabe unter gleichen Bedingungen",
"cc-nc": "Creative Commons Nicht-Kommerziell (eingeschränkte Lizenz)",
"cc-zero": "Creative Commons Zero",
"gfdl": "GNU Free Documentation License",
"gpl-3.0": "GNU General Public License version 3.0 (GPLv3)",
"mozilla": "Mozilla Public License 1.0 (MPL)",
"odc-odbl": "Open Data Commons Open Database License",
"other-closed": "Andere eingeschränkte Lizenz",
"other-open": "Andere freie Lizenz"
}
[
{
"domain_content": false,
"domain_data": false,
"domain_software": true,
"family": "",
"id": "apache",
"is_okd_compliant": false,
"is_osi_compliant": true,
"maintainer": "",
"status": "active",
"title": "Apache Lizenz",
"url": ""
},
{
"domain_content": false,
"domain_data": false,
"domain_software": true,
"family": "",
"id": "app_commercial",
"is_okd_compliant": false,
"is_osi_compliant": false,
"maintainer": "",
"status": "active",
"title": "Andere kommerzielle Lizenz",
"url": ""
},
{
"domain_content": false,
"domain_data": false,
"domain_software": true,
"family": "",
"id": "app_freeware",
"is_okd_compliant": false,
"is_osi_compliant": false,
"maintainer": "",
"status": "active",
"title": "Andere kostenfreie Lizenz",
"url": ""
},
{
"domain_content": false,
"domain_data": false,
"domain_software": true,
"family": "",
"id": "app_opensource",
"is_okd_compliant": false,
"is_osi_compliant": true,
"maintainer": "",
"status": "active",
"title": "Andere Open Source Lizenz",
"url": ""
},
{
"domain_content": false,
"domain_data": false,
"domain_software": true,
"family": "",
"id": "bsd-license",
"is_okd_compliant": false,
"is_osi_compliant": true,
"maintainer": "",
"status": "active",
"title": "BSD Lizenz",
"url": "https://www.opensource.org/licenses/bsd-license.php"
},
{
"domain_content": true,
"domain_data": false,
"domain_software": false,
"family": "",
"id": "cc-by",
"is_okd_compliant": true,
"is_osi_compliant": false,
"maintainer": "",
"status": "active",
"title": "Creative Commons Namensnennung (CC-BY)",
"url": "https://www.opendefinition.org/licenses/cc-by"
},
{
"domain_content": true,
"domain_data": false,
"domain_software": false,
"family": "",
"id": "cc-by-sa",
"is_okd_compliant": true,
"is_osi_compliant": false,
"maintainer": "",
"status": "active",
"title": "Creative Commons Attribution Weitergabe unter gleichen Bedingungen (CC-BY-SA)",
"url": "https://www.opendefinition.org/licenses/cc-by-sa"
},
{
"domain_content": false,
"domain_data": false,
"domain_software": false,
"family": "",
"id": "cc-nc",
"is_okd_compliant": false,
"is_osi_compliant": false,
"maintainer": "",
"status": "active",
"title": "Creative Commons Nicht-Kommerziell (CC-NC)",
"url": "https://creativecommons.org/licenses/by-nc/2.0/"
},
{
"domain_content": true,
"domain_data": true,
"domain_software": false,
"family": "",
"id": "cc-zero",
"is_okd_compliant": true,
"is_osi_compliant": false,
"maintainer": "",
"status": "active",
"title": "Creative Commons Zero",
"url": "https://www.opendefinition.org/licenses/cc-zero"
},
{
"domain_content": true,
"domain_data": false,
"domain_software": false,
"family": "",
"id": "gfdl",
"is_okd_compliant": true,
"is_osi_compliant": false,
"maintainer": "",
"status": "active",
"title": "GNU Free Documentation License",
"url": "https://www.opendefinition.org/licenses/gfdl"
},
{
"domain_content": false,
"domain_data": false,
"domain_software": true,
"family": "",
"id": "gpl-3.0",
"is_okd_compliant": false,
"is_osi_compliant": true,
"maintainer": "",
"status": "active",
"title": "GNU General Public License version 3.0 (GPLv3)",
"url": "https://www.opensource.org/licenses/gpl-3.0.html"
},
{
"domain_content": false,
"domain_data": false,
"domain_software": true,
"family": "",
"id": "mozilla",
"is_okd_compliant": false,
"is_osi_compliant": true,
"maintainer": "",
"status": "active",
"tags": [],
"title": "Mozilla Public License 1.0 (MPL)",
"url": ""
},
{
"domain_content": false,
"domain_data": true,
"domain_software": false,
"family": "",
"id": "odc-odbl",
"is_okd_compliant": true,
"is_osi_compliant": false,
"maintainer": "",
"status": "active",
"title": "Open Data Commons Open Database License (ODbL)",
"url": "https://www.opendefinition.org/licenses/odc-odbl"
},
{
"domain_content": true,
"domain_data": true,
"domain_software": true,
"family": "",
"id": "other-open",
"is_generic": true,
"is_okd_compliant": true,
"is_osi_compliant": true,
"maintainer": "",
"status": "active",
"title": "Andere freie Lizenz",
"url": ""
},
{
"domain_content": true,
"domain_data": true,
"domain_software": true,
"family": "",
"id": "other-closed",
"is_generic": true,
"is_okd_compliant": false,
"is_osi_compliant": false,
"maintainer": "",
"status": "active",
"title": "Andere eingeschränkte Lizenz",
"url": ""
}
]

0 comments on commit 4d31331

Please sign in to comment.