Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
AntjeM committed Jun 7, 2016
1 parent 92f80a3 commit d4de6ab
Show file tree
Hide file tree
Showing 7 changed files with 759 additions and 2 deletions.
Binary file added OGD1_2-Klassendiagramm-Codelisten.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OGD1_2-Klassendiagramm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
151 changes: 151 additions & 0 deletions OGPD_JSON_Schema.html

Large diffs are not rendered by default.

361 changes: 361 additions & 0 deletions OGPD_JSON_Schema.json

Large diffs are not rendered by default.

77 changes: 77 additions & 0 deletions OGPD_JSON_Schema_changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
2014-09-22 Datenlizenz Deutschland 2.0 hinzugefügt
- dl-de-zero-2.0, Datenlizenz Deutschland – Zero – Version 2.0
- dl-de-by-2.0, Datenlizenz Deutschland Namensnennung 2.0

2014-02-11 Felder zur Beschreibung der räumlichen Abdeckung
- Feld extras.spatial_reference hinzugefügt
- räumliche Abdeckung nun zusätzlich bechreibbar durch AGS, NUTS und URI
- Feld extras.spatial-text verschoben nach extras.spatial_reference.text

2013-12-06 Änderungen aus der Datenbereitsteller-Telko und weiteres
- Feld Namensnennung zu extras.terms_of_use hinzugefügt
- neue Geolizenzen aufgenommen
- Lizenzversionierung für neue und bestehende (Creative Commons) Lizenzen mit in den Identifier aufnehmen
- OGD Metadata Schema Version 1.1

2013-12-04 GeoJSON Koordinatenformat angepasst
- das aktuelle GeoJSON Format für Polygon ist ein zweifach geschachteltes Array und nicht einfach
- siehe: http://www.geojson.org/geojson-spec.html#id4
- dementsprechend wurde extras.spatial.coordinates angepasst

2013-03-27
- Geodaten-Nutzungsverordnung hinzugefügt.

2013-02-28
- CC-BY-ND aufgenommen

2013-02-08
- Konsolidierung mit Österreich mit Hinblick auf das OD-Portal der Europäischen Kommission
- license_id wieder zu den Kernfeldern verschoben.
- Veröffentlichende Stelle und Ansprechpartner wieder in die Kernfelder verschoben.

2013-02-08
- Geolizenz Ia konservativ erst einmal als nicht-offen eingestuft.

2013-01-22
- Lizenz hinzugefügt: Datenlizenz DE NC

2013-01-22
- Lizenzen hinzugefügt: ODC-BY

2013-01-18
- Lizenzen hinzugefügt: Geolizenzen, PDDL, Daten-Lizenz DE, Amtliches Werk

2012-12-21
- images eingeführt v.a. im Hinblick auf App-Bilder

2012-11-28
- temporal_granularity_factor eingefuehrt.

2012-11-21
- Lizenzliste korrigiert: notspecified gestrichen, other-open und other-closed eingeführt für andere freie und eingeschränkte Bestimmungen.

2012-11-14
- Feld content_type umbenannt in type und nach oben in Hauptebene verschoben.

2012-10-10
- nicht-ckan-core-felder wieder in extras verschoben
- enum URL-freundliche Bezeichner, kleingeschrieben
- spatial und spatial-text statt geographical-coverage und regional-coverage

2012-10-07
- die Kategorien stimmten nicht mit dem letzten Stand ueberein --> aktualisiert
- notes waren sowohl object als auch string --> nur noch strings
- fuer Adress- und Datumsangaben habe ich enums eingefuehrt
- fuer URLs etc. habe ich uri als Format angegeben
- es haben required-Angaben fuer Datum und Kontakt gefehlt, daher sind nicht alle extras optional - habe die mandatories nach oben gezogen
- da die Extras bei CKAN eh anders sind, habe ich sie fuer die OGDD Definition rausgenommen - so wird auch die Struktur einfacher und die Abbildung auf CKAN muss eh gemacht werden.
- einige Erläuterungen waren noch auf Englisch --> uebersetzt
- ich habe nach den Diskussion in Wien noch ein optionales Feld fuer die Version der Metadaten-Struktur aufgenommen
- ein jedes Hauptfeld faengt nun mit required ja/nein und description an

2012-09-25 /prototyp/doc/metadaten/120925-post-harvesting-workshop.pdf eingearbeitet, insb.
- kontakte als liste mit rollenbezeichner
- nicht-ckan-core-felder in extras verschoben
- deutsche beschreibungen weitgehend aus folien übernommen
- geographical coverage - bzw. Amtlicher Gemeindeschlüsssel

21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
# OGD-1.1
Metadatenmodell Version OGD 1.1 Stand 2015
# ogd-metadata

[![Build Status](https://travis-ci.org/fraunhoferfokus/ogd-metadata.png?branch=master)](https://travis-ci.org/fraunhoferfokus/ogd-metadata)

Metadata structure and documentation to be used by the German Open Government Platform and as input to the standardization of a common metadata structure for open government data in German speaking countries

Die Idee hinter der OGD Metadaten-Struktur ist [im Blog beschrieben][ogdm-blog].

Es existiert eine [lesbare HTML Ansicht][ogdm-html].

Relevante Links zur CKAN-Dokumentation:
* [Domain Model][ckan-dm]
* [CKAN Logic Code][ckan-lc]

[ogdm-html]: http://htmlpreview.github.io/?https://github.com/fraunhoferfokus/ogd-metadata/blob/master/OGPD_JSON_Schema.html
[ogdm-blog]: http://open-data.fokus.fraunhofer.de/?p=643
[ckan-dm]: http://docs.ckan.org/en/ckan-1.8/domain-model.html
[ckan-lc]: https://github.com/okfn/ckan/blob/master/ckan/logic/schema.py

151 changes: 151 additions & 0 deletions gen-html.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
#!/usr/bin/python
# -*- coding: utf8 -*-
import sys,json,collections,string
reload(sys)
sys.setdefaultencoding('utf-8')
schema=open('OGPD_JSON_Schema.json', 'r')
data=json.loads( schema.read(), object_pairs_hook=collections.OrderedDict)
schema.close()

def cell(content='', rowspan=1):
return '<td rowspan="{1}">{0}</td>'.format(content, rowspan)

def renderType(property):
literal = property['type']
if 'array' == literal:
return 'Liste von ' + string.capwords(property['items']['type'])
else:
return string.capwords(literal)

def required(property):
if 'required' in property.keys():
return property['required']
return False

def splitDescription(d):
if ": " in d:
return d.split(": ")
else:
return [d, d]

def getPattern(prop):
if 'array' == prop['type']:
prop = prop['items']
if 'pattern' in prop.keys():
return prop['pattern']
if 'format' in prop.keys():
if 'uri' == prop['format']:
return 'URI'
return prop['format']
if 'string' == prop['type'] and 'enum' in prop.keys():
return 'Enum aus: ' + ', '.join(prop['enum'])
return ''

# return the html string and the amount of table rows that were generated
def renderProperties(object, level):
out = []
rows = 0
for propKey, prop in object["properties"].iteritems():
subobjects = ''
subrows = 0
if 'object' == prop['type']:
[subobjects, subrows ] = renderProperties(prop, level+1)
if 'array' == prop['type'] and 'object' == prop['items']['type']:
[subobjects, subrows ] = renderProperties(prop['items'], level+1)
rows = rows + 1 + subrows
[fieldName, description] = splitDescription(prop["description"])
out.append("<tr>")
out.append(cell(fieldName))
out.append(cell(propKey,subrows+1))
for i in range (3-level):
out.append(cell(''))
out.append(cell('X' if required(prop) else ''))
out.append(cell(renderType(prop)))
out.append(cell(getPattern(prop)))
out.append(cell(description))
out.append('</tr>\n')
out.append(subobjects)
return [''.join(out), rows]


def tableStart():
print """
<html><head>
<meta http-equiv=Content-Type content="text/html; charset=UTF-8">
<style type="text/css">
<!--
td {vertical-align:top;}
-->
</style>
</head><body>
<table border=1 cellpadding=0 cellspacing=0 style="empty-cells:show;vertical-align:top">
<col > <col span=3><col ><col ><col ><col >
<tr>
<th rowspan=2 >Metadaten Eintrag</th>
<th colspan=3 >JSON Bezeichner</th>
<th rowspan=2 >Pflichtfeld</th>
<th rowspan=2 >Datentyp</th>
<th rowspan=2 >Format / Pattern</th>
<th rowspan=2 >Beschreibung</th>
</tr>
<tr>
<th >1.
Ebene (CKAN nativ)</th>
<th >2. Ebene</th>
<th >3. Ebene</th>
</tr>
"""

def tableEnd():
print "</table></body></html>"


tableStart()
[tableBody, rows] = renderProperties(data, 1)
print tableBody
tableEnd()


def listTable(name, content):
print """
<p><table border=1 cellpadding=0 cellspacing=0
style='border-collapse:collapse;table-layout:fixed'>
<col>
<tr><th colspan='2'>{0}</th></tr>
<tr><th>ID</th><th>Titel</th></tr>
{1}
</table>
""".format(name, content)

def listBody(list):
out = []
for id, title in list.iteritems():
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>URL</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><a href="{2}">{2}</a></td><td>{3}</td><td>{4}</td><td>{5}</td></tr>\n'.format(license['id'],license['title'],license['url'],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()
listTable('Kategorien', listBody(kat))

f=open('lizenzen/deutschland.json', 'r')
licences=json.loads( f.read(), object_pairs_hook=collections.OrderedDict)
f.close()
print listLicenseTable(licences)

0 comments on commit d4de6ab

Please sign in to comment.