Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 50a64f1181
Fetching contributors…

Cannot retrieve contributors at this time

32 lines (29 sloc) 1.218 kb
import csv
def dump_types_csv(types, out):
csv_writer = csv.writer(out)
csv_writer.writerow(['id', 'label', 'comment', 'ancestors', 'supertypes', 'subtypes', 'properties'])
for id in types:
type = types[id]
if type['comment'] == None: type['comment'] = ''
row = []
row.append(id)
row.append(type['label'].encode('utf-8'))
row.append(type['comment'].encode('utf-8'))
row.append(' '.join(type['ancestors']))
row.append(' '.join(type['supertypes']))
row.append(' '.join(type['subtypes']))
row.append(' '.join(type['specific_properties']))
csv_writer.writerow(row)
def dump_properties_csv(properties, out):
csv_writer = csv.writer(out)
csv_writer.writerow(['id', 'label', 'comment', 'domains', 'ranges'])
for id in properties:
property = properties[id]
if property['comment'] == None: property['comment'] = ''
row = []
row.append(id)
row.append(property['label'].encode('utf-8'))
row.append(property['comment'].encode('utf-8'))
row.append(' '.join(property['domains']))
row.append(' '.join(property['ranges']))
csv_writer.writerow(row)
Jump to Line
Something went wrong with that request. Please try again.