Browse Source

Carica file su 'Museo/CSV_to_RDF'

Alessia 2 years ago
parent
commit
137784c0c4

+ 346 - 0
Museo/CSV_to_RDF/CSV_to_RDF_mpp.py

@@ -0,0 +1,346 @@
+# Utilities to read/write csv files
+import csv
+# Utilities to handle character encodings
+import unicodedata
+# Ordered Dicts
+from collections import OrderedDict
+
+import json
+
+# OPZIONAL IMPORTS
+
+# For timestamping/simple speed tests
+from datetime import datetime
+# Random number generator
+from random import *
+# System & command line utilities
+import sys
+# Json for the dictionary
+import json
+
+import_dir = '/Users/alessiaspadi/Documents/RESTORE/temp_MPP/tabelle/Ospedale/mod/'
+export_dir = '/Users/alessiaspadi/Documents/RESTORE/temp_MPP/tabelle/Ospedale/mod/'
+
+
+# Custom class to store URIs + related infos for the ontologies/repositories
+
+class RDFcoords:
+    def __init__(self, uri, prefix, code=None):
+        self.uri = uri
+        self.prefix = prefix
+        self.code = code
+
+
+# Repositories
+museoCoords = RDFcoords('<http://palazzopretorio.comune.prato.it/it/le-opere/alcuni-capolavori/>', 'mpp:')
+
+cidocCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/>', 'crm:')
+aatCoords = RDFcoords('<http://vocab.getty.edu/aat/>', 'aat:')
+nsCoords = RDFcoords('<http://www.w3.org/1999/02/22-rdf-syntax-ns#>', 'rdf:')
+schemaCoords = RDFcoords('<http://www.w3.org/2000/01/rdf-schema#>', 'rdfs:')
+
+
+# Basic functions for triples / shortened triples in TTL format
+
+def triple(subject, predicate, object1):
+    line = subject + ' ' + predicate + ' ' + object1
+    return line
+
+
+def doublet(predicate, object1):
+    line = '    ' + predicate + ' ' + object1
+    return line
+
+
+def singlet(object1):
+    line = '        ' + object1
+    return line
+
+
+# Line endings in TTL format
+continueLine1 = ' ;\n'
+continueLine2 = ' ,\n'
+closeLine = ' .\n'
+
+
+def writeTTLHeader(output):
+    output.write('@prefix ' + museoCoords.prefix + ' ' + museoCoords.uri + closeLine)
+    output.write('@prefix ' + cidocCoords.prefix + ' ' + cidocCoords.uri + closeLine)
+    output.write('@prefix ' + aatCoords.prefix + ' ' + aatCoords.uri + closeLine)
+    output.write('@prefix ' + schemaCoords.prefix + ' ' + schemaCoords.uri + closeLine)
+    output.write('@prefix ' + nsCoords.prefix + ' ' + nsCoords.uri + closeLine)
+
+    output.write('\n')
+
+
+filePrefix = 'SR20OA_'
+fileType = 'Ospedale'
+max_entries = 1000000000
+
+with open(import_dir + filePrefix + fileType + '.csv', newline="") as csv_file, open(
+        export_dir + filePrefix + fileType + '.ttl', 'w') as output:
+    reader = csv.DictReader(csv_file)
+    writeTTLHeader(output)
+    first = True
+    ii = 0
+    for row in reader:
+        # The index ii is used to process a limited number of entries for testing purposes
+        ii = ii + 1
+
+        if row['RVEL'] == '' or row['RVEL'] == '0':
+
+            sb = ''
+            subj = ''
+            pp = row['OGTD'] + ' (' + row['ACC'] + ') '
+            if row['SGTI'] != '':
+                sb = pp + row['SGTI']
+            if row['LDCN'] != '':
+                subj = sb + ' in ' + row['LDCN']
+            else:
+                subj = sb
+
+            # Triplify the 'codice' -- should exist for every entry
+            codice = ''
+            if (row['NCTR'] != '' and row['NCTN'] != ''):
+                codice = row['NCTR'] + row['NCTN']
+            '''if (row['RVEL'] != ' '):
+                codice = codice + "-" + row['RVEL']'''
+
+            url = row['URL']
+
+            # placeHolders
+            datplaceHolder = museoCoords.prefix + url
+            e42placeHolder = museoCoords.prefix + url + '_E42'
+            e42CplaceHolder = museoCoords.prefix + url + '_E42_MPP'
+            e73placeHolder = museoCoords.prefix + url + '_E73'
+            e55placeHolder = museoCoords.prefix + url + '_E55'
+            e35placeHolder1 = museoCoords.prefix + url + '_E35'
+            e53placeHolder = museoCoords.prefix + url + '_E53'
+            e1placeHolder = museoCoords.prefix + url + '_E1'
+            e74placeHolder = museoCoords.prefix + url + '_E74'
+
+            if (codice != ''):
+                line = triple(datplaceHolder, cidocCoords.prefix + 'P1_is_identified_by', e42placeHolder) + closeLine
+                output.write(line)
+                line = triple(e42placeHolder, nsCoords.prefix + 'type',
+                              cidocCoords.prefix + 'E42_Identifier') + closeLine
+                output.write(line)
+                '''line = triple(e42placeHolder, cidocCoords.prefix + 'P2_has_type',
+                              aatCoords.prefix + '300404626') + closeLine
+                output.write(line)
+                line = triple(aatCoords.prefix + '300404626', schemaCoords.prefix + 'label',
+                              "identifier") + closeLine
+                output.write(line)'''
+                line = triple(e42placeHolder, schemaCoords.prefix + 'label',
+                              '\"Codice univoco del bene: ' + codice + '\"') + closeLine
+                output.write(line)
+
+                '''
+                # AS
+                e55placeHolder = "<http://www.museodipalazzopretorio.it/" + codice + '/' + identifierCoords.code + ">"
+                line = triple(e42placeHolder, hasTypePCoords.prefix, e55placeHolder) + closeLine
+                output.write(line)
+                line = triple(e55placeHolder, hasTypeCoords.prefix, typeCoords.prefix) + closeLine
+                output.write(line)
+                line = triple(e55placeHolder, labelCoords.prefix, '\"Codice univoco del bene\"') + closeLine
+                output.write(line)
+                # Fine AS
+                '''
+
+            # Write E22 Man Made Object & E73 Information Object -- should exist for every entry?
+            line = triple(datplaceHolder, nsCoords.prefix + 'type',
+                          cidocCoords.prefix + 'E22_Man-Made_Object') + closeLine
+            output.write(line)
+            # Added by AS
+            line = triple(datplaceHolder, schemaCoords.prefix + 'label', '\"' + subj + '\"') + closeLine
+            output.write(line)
+            # End AS
+            line = triple(datplaceHolder, cidocCoords.prefix + 'P128_carries', e73placeHolder) + closeLine
+            output.write(line)
+            line = triple(e73placeHolder, nsCoords.prefix + 'type',
+                          cidocCoords.prefix + 'E73_Information_Object') + closeLine
+            output.write(line)
+
+            # AS
+            ss = ''
+            if row['SGTI'] != '':
+                ss = row['SGTI']
+            else:
+                ss = 'senza titolo'
+
+            line = triple(e73placeHolder, schemaCoords.prefix + 'label',
+                          '\"Opera d\'arte raffigurante ' + ss + '\"') + closeLine
+            output.write(line)
+
+            # E73 - P2 - E55
+
+            tt = ''
+            typeLabel = ''
+
+            if row['OGTD'] == 'dipinto':
+                tt = aatCoords.prefix + "300033618"
+            elif row['OGTD'] == 'rilievo':
+                tt = aatCoords.prefix + "300047230"
+            elif row['OGTD'] == 'polittico':
+                tt = aatCoords.prefix + "300178235"
+            elif row['OGTD'] == 'predella':
+                tt = aatCoords.prefix + "300003745"
+            else:
+                tt = e55placeHolder
+
+            line = triple(e73placeHolder,
+                          cidocCoords.prefix + 'P2_has_type',
+                          tt) + closeLine
+            output.write(line)
+            line = triple(tt, schemaCoords.prefix + 'label',
+                          '\"' + row['OGTD'] + '\"') + closeLine
+            output.write(line)
+
+            # E73 - P1 - E35
+
+            if row['SGTT'] != '':
+                line = triple(e73placeHolder, cidocCoords.prefix + 'P1_is_identified_by', e35placeHolder1) + closeLine
+                output.write(line)
+                line = triple(e35placeHolder1, nsCoords.prefix + 'type', cidocCoords.prefix + 'E35_Title') + closeLine
+                output.write(line)
+                line = triple(e35placeHolder1, schemaCoords.prefix + 'label', '\"' + row['SGTT'] + '\"') + closeLine
+                output.write(line)
+
+                line = triple(e35placeHolder1, cidocCoords.prefix + 'P2_has_type',
+                              aatCoords.prefix + "300417193") + closeLine
+                output.write(line)
+                line = triple(aatCoords.prefix + "300417193", schemaCoords.prefix + 'label',
+                              '\"titolo\"') + closeLine
+                output.write(line)
+
+            # E22 - P62 - E1
+
+            if row['SGTI'] != '':
+                line = triple(datplaceHolder,
+                              cidocCoords.prefix + 'P62_depicts',
+                              e1placeHolder) + closeLine
+                output.write(line)
+                line = triple(e1placeHolder,
+                              nsCoords.prefix + 'type',
+                              cidocCoords.prefix + 'E1_CRM_Entity') + closeLine
+                output.write(line)
+                line = triple(e1placeHolder,
+                              schemaCoords.prefix + 'label', '\"' +
+                              row['SGTI'] + '\"') + closeLine
+                output.write(line)
+
+            # doppio titolo - se usato cancellare E73 -E35
+
+            '''if row['SGTI'] != 'None' and row['SGTI'] != ' ':
+
+                line = triple(e73placeHolder, identifiedByCoords.prefix, "<http://www.museodipalazzopretorio.it/" + codice + "/sgti>") + closeLine
+                output.write(line)
+                line = triple("<http://www.museodipalazzopretorio.it/" + codice + "/sgti>",
+                              hasTypePCoords.prefix,
+                              "<http://www.museodipalazzopretorio.it/" + codice + "/ico>") + closeLine
+                output.write(line)
+                line = triple("<http://www.museodipalazzopretorio.it/" + codice + "/sgti>",
+                              labelCoords.prefix,
+                              '\"' + row['SGTI'] + '\"') + closeLine
+                output.write(line)
+                line = triple("<http://www.museodipalazzopretorio.it/" + codice + "/ico>",
+                              labelCoords.prefix,
+                              '\"' + 'Identificazione Iconografica' + '\"') + closeLine
+                output.write(line)
+
+
+            if row['SGTT'] != ' ':
+
+                line = triple(e73placeHolder,
+                              identifiedByCoords.prefix,
+                              "<http://www.museodipalazzopretorio.it/" + codice + "/sgtt>") + closeLine
+                output.write(line)
+                line = triple("<http://www.museodipalazzopretorio.it/" + codice + "/sgtt>",
+                              hasTypePCoords.prefix,
+                              "<http://www.museodipalazzopretorio.it/" + codice + "/titolo>") + closeLine
+                output.write(line)
+                line = triple("<http://www.museodipalazzopretorio.it/" + codice + "/sgtt>",
+                              labelCoords.prefix,
+                              '\"' + row['SGTT'] + '\"') + closeLine
+                output.write(line)
+                line = triple("<http://www.museodipalazzopretorio.it/" + codice + "/titolo>",
+                              labelCoords.prefix,
+                              '\"' + 'Titolo' + '\"') + closeLine
+                output.write(line)'''
+
+            # Fine doppio titolo
+
+            # Attention: these triples are identified only for C100005 Museo di Palazzo Pretorio
+
+            if row['ESC'] == 'C100005':
+                line = triple(datplaceHolder,
+                              cidocCoords.prefix + 'P52_has_current_owner',
+                              e74placeHolder) + closeLine
+                output.write(line)
+                line = triple(e74placeHolder,
+                              nsCoords.prefix + 'type',
+                              cidocCoords.prefix + 'E74_Group') + closeLine
+                output.write(line)
+                line = triple(e74placeHolder,
+                              schemaCoords.prefix + 'label',
+                              '\"Museo di Palazzo Pretorio\"') + closeLine
+                output.write(line)
+
+                line = triple(e74placeHolder,
+                              cidocCoords.prefix + 'P1_is_identified_by',
+                              e42CplaceHolder) + closeLine
+                output.write(line)
+                line = triple(e42CplaceHolder,
+                              nsCoords.prefix + 'type',
+                              cidocCoords.prefix + 'E42_Identifier') + closeLine
+                output.write(line)
+                line = triple(e42CplaceHolder,
+                              schemaCoords.prefix + 'label',
+                              '\"' + row['ESC'] + '\"') + closeLine
+                output.write(line)
+
+                line = triple(e42CplaceHolder,
+                              cidocCoords.prefix + 'P2_has_type',
+                              aatCoords.prefix + '300404626') + closeLine
+                output.write(line)
+                line = triple(aatCoords.prefix + '300404626',
+                              schemaCoords.prefix + 'label',
+                              '\"identificatore numerico\"') + closeLine
+                output.write(line)
+
+
+            currentLocation = ''
+
+            # E22 - P54 - E53
+            if row['LDCN'] != '':
+                if row['LDCS'] != '':
+                    currentLocation = row['LDCS']
+                else:
+                    currentLocation = currentLocation
+                if row['LDCM'] != '':
+                    currentLocation = currentLocation + ', ' + row['LDCM']
+                else:
+                    currentLocation = currentLocation
+                if row['LDCN'] != '':
+                    currentLocation = currentLocation + ', ' + row['LDCN']
+                else:
+                    currentLocation = currentLocation
+
+                currentLocation = currentLocation + ', ' + row['PVCC'] + ' (' + row['PVCP'] + ')'
+
+                line = triple(datplaceHolder, cidocCoords.prefix + 'P54_has_current_permanent_location',
+                              e53placeHolder) + closeLine
+                output.write(line)
+                line = triple(e53placeHolder, nsCoords.prefix + 'type', cidocCoords.prefix + 'E53_Place') + closeLine
+                output.write(line)
+                line = triple(e53placeHolder, schemaCoords.prefix + 'label',
+                              '\"' + currentLocation + '\"') + closeLine
+                output.write(line)
+            # End AS
+
+            output.write('\n')
+        #
+        #
+        # Limit number of entries processed (if desired)
+        if (ii > max_entries):
+            break

+ 144 - 0
Museo/CSV_to_RDF/CSV_to_RDF_mpp_MaterialAndTechnique.py

@@ -0,0 +1,144 @@
+# Utilities to read/write csv files
+import csv
+# Utilities to handle character encodings
+import unicodedata
+# Ordered Dicts
+from collections import OrderedDict
+
+import json
+
+
+# OPZIONAL IMPORTS
+
+# For timestamping/simple speed tests
+from datetime import datetime
+# Random number generator
+from random import *
+# System & command line utilities
+import sys
+# Json for the dictionary
+import json
+
+import_dir = '/Users/alessiaspadi/Documents/RESTORE/temp_MPP/tabelle/Datini/mod/'
+export_dir = '/Users/alessiaspadi/Documents/RESTORE/temp_MPP/tabelle/Datini/mod/E57_'
+
+
+# Custom class to store URIs + related infos for the ontologies/repositories
+
+class RDFcoords:
+    def __init__(self, uri, prefix, code = None):
+        self.uri = uri
+        self.prefix = prefix
+        self.code = code
+
+
+# Repositories
+museoCoords = RDFcoords('<http://palazzopretorio.comune.prato.it/it/le-opere/alcuni-capolavori/>', 'mpp:')
+
+cidocCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/>', 'crm:')
+aatCoords = RDFcoords('<http://vocab.getty.edu/aat/>', 'aat:')
+nsCoords = RDFcoords('<http://www.w3.org/1999/02/22-rdf-syntax-ns#>', 'rdf:')
+schemaCoords = RDFcoords('<http://www.w3.org/2000/01/rdf-schema#>', 'rdfs:')
+
+
+# Basic functions for triples / shortened triples in TTL format
+
+def triple(subject, predicate, object1):
+    line = subject + ' ' + predicate + ' ' + object1
+    return line
+
+def doublet(predicate, object1):
+    line = '    ' + predicate + ' ' + object1
+    return line
+
+def singlet(object1):
+    line = '        ' + object1
+    return line
+
+# Line endings in TTL format
+continueLine1 = ' ;\n'
+continueLine2 = ' ,\n'
+closeLine = ' .\n'
+
+def writeTTLHeader(output):
+    output.write('@prefix ' + museoCoords.prefix + ' ' + museoCoords.uri + closeLine)
+    output.write('@prefix ' + cidocCoords.prefix + ' ' + cidocCoords.uri + closeLine)
+    output.write('@prefix ' + aatCoords.prefix + ' ' + aatCoords.uri + closeLine)
+    output.write('@prefix ' + schemaCoords.prefix + ' ' + schemaCoords.uri + closeLine)
+    output.write('@prefix ' + nsCoords.prefix + ' ' + nsCoords.uri + closeLine)
+
+    output.write('\n')
+
+
+filePrefix = 'SR20OA_'
+fileType = 'Datini'
+max_entries = 1000000000
+
+def get_elem(mtc):
+    mtc_file = open('/Users/alessiaspadi/Documents/RESTORE/temp_MPP/tabelle/AAT_MTC.csv', newline="")
+    reader = csv.DictReader(mtc_file)
+    for row in reader:
+        if row['MTC'] == mtc:
+            return [row['AAT'], row['Type']]
+
+with open(import_dir + filePrefix + fileType + '.csv', newline="") as csv_file, open(
+        export_dir + filePrefix + fileType + '.ttl', 'w') as output:
+    reader = csv.DictReader(csv_file)
+    writeTTLHeader(output)
+    first = True
+    ii = 0
+    for row in reader:
+        # The index ii is used to process a limited number of entries for testing purposes
+        ii = ii + 1
+
+        url = row['URL']
+
+        #placeHolders
+        datplaceHolder = museoCoords.prefix + url
+        e12placeHolder = museoCoords.prefix + url + '_E12'
+
+        if row['MTC'] != '':
+            mtcs = []
+            if '/' in row['MTC']:
+                mtcs = row['MTC'].split('/')
+            else:
+                mtcs.append(row['MTC'])
+
+            for tc in mtcs:
+                mtc = tc.lstrip()
+                el = get_elem(mtc)
+                if el[1] == 'MTC/M':
+
+                    line = triple(datplaceHolder,
+                                  cidocCoords.prefix + 'P45_consists_of',
+                                  aatCoords.prefix + el[0]) + closeLine
+                    output.write(line)
+                    line = triple(aatCoords.prefix + el[0],
+                                  nsCoords.prefix + 'type',
+                                  cidocCoords.prefix + 'E57_Material') + closeLine
+                    output.write(line)
+                    line = triple(aatCoords.prefix + el[0],
+                                  schemaCoords.prefix + 'label',
+                                  '\"' + mtc + '\"') + closeLine
+                    output.write(line)
+
+                else:   #E12 Production - P32 used technique - E55 Type
+                    line = triple(e12placeHolder,
+                                  cidocCoords.prefix + 'P32_used_general_technique',
+                                  aatCoords.prefix + el[0]) + closeLine
+                    output.write(line)
+                    line = triple(aatCoords.prefix + el[0],
+                                  nsCoords.prefix + 'type',
+                                  cidocCoords.prefix + 'E55_Type') + closeLine
+                    output.write(line)
+                    line = triple(aatCoords.prefix + el[0],
+                                  schemaCoords.prefix + 'label',
+                                  '\"' + mtc + '\"') + closeLine
+                    output.write(line)
+
+        output.write('\n')
+        #
+        #
+        # Limit number of entries processed (if desired)
+        if (ii > max_entries):
+            break

+ 235 - 0
Museo/CSV_to_RDF/CSV_to_RDF_mpp_Measurement.py

@@ -0,0 +1,235 @@
+# Utilities to read/write csv files
+import csv
+# Utilities to handle character encodings
+import unicodedata
+# Ordered Dicts
+from collections import OrderedDict
+
+import json
+
+
+# OPZIONAL IMPORTS
+
+# For timestamping/simple speed tests
+from datetime import datetime
+# Random number generator
+from random import *
+# System & command line utilities
+import sys
+# Json for the dictionary
+import json
+
+import_dir = '/Users/alessiaspadi/Documents/RESTORE/temp_MPP/tabelle/Ospedale/mod/'
+export_dir = '/Users/alessiaspadi/Documents/RESTORE/temp_MPP/tabelle/Ospedale/mod/E54_'
+
+# Custom class to store URIs + related infos for the ontologies/repositories
+
+class RDFcoords:
+    def __init__(self, uri, prefix, code = None):
+        self.uri = uri
+        self.prefix = prefix
+        self.code = code
+
+
+# Repositories
+museoCoords = RDFcoords('<http://palazzopretorio.comune.prato.it/it/le-opere/alcuni-capolavori/>', 'mpp:')
+
+cidocCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/>', 'crm:')
+aatCoords = RDFcoords('<http://vocab.getty.edu/aat/>', 'aat:')
+nsCoords = RDFcoords('<http://www.w3.org/1999/02/22-rdf-syntax-ns#>', 'rdf:')
+schemaCoords = RDFcoords('<http://www.w3.org/2000/01/rdf-schema#>', 'rdfs:')
+
+
+# Basic functions for triples / shortened triples in TTL format
+
+def triple(subject, predicate, object1):
+    line = subject + ' ' + predicate + ' ' + object1
+    return line
+
+def doublet(predicate, object1):
+    line = '    ' + predicate + ' ' + object1
+    return line
+
+def singlet(object1):
+    line = '        ' + object1
+    return line
+
+# Line endings in TTL format
+continueLine1 = ' ;\n'
+continueLine2 = ' ,\n'
+closeLine = ' .\n'
+
+def writeTTLHeader(output):
+    output.write('@prefix ' + museoCoords.prefix + ' ' + museoCoords.uri + closeLine)
+    output.write('@prefix ' + cidocCoords.prefix + ' ' + cidocCoords.uri + closeLine)
+    output.write('@prefix ' + aatCoords.prefix + ' ' + aatCoords.uri + closeLine)
+    output.write('@prefix ' + schemaCoords.prefix + ' ' + schemaCoords.uri + closeLine)
+    output.write('@prefix ' + nsCoords.prefix + ' ' + nsCoords.uri + closeLine)
+
+    output.write('\n')
+
+
+filePrefix = 'SR20OA_'
+fileType = 'Ospedale'
+max_entries = 1000000000
+
+with open(import_dir + filePrefix + fileType + '.csv', newline="") as csv_file, open(
+        export_dir + filePrefix + fileType + '.ttl', 'w') as output:
+    reader = csv.DictReader(csv_file)
+    writeTTLHeader(output)
+    first = True
+    ii = 0
+    for row in reader:
+        # The index ii is used to process a limited number of entries for testing purposes
+        ii = ii + 1
+
+        # Triplify the 'codice' -- should exist for every entry
+        if row['RVEL'] == '' or row['RVEL'] == '0':
+
+            codice = ''
+            if (row['NCTR'] != '' and row['NCTN'] != ''):
+                codice = row['NCTR'] + row['NCTN']
+
+            unit = ''
+            if (row['MISU'] != ''):
+                unit = row['MISU']
+
+            valueA = ''
+            valueL = ''
+
+            if (row['MISA'] != ''):
+                value = row['MISA']
+                valueA = value.replace(',', 'v')
+
+            if (row['MISL'] != ''):
+                value = row['MISL']
+                valueL = value.replace(',', 'v')
+
+            url = row['URL']
+
+            #placeHolders
+            datplaceHolder = museoCoords.prefix + url
+            e55placeHolder = museoCoords.prefix + url + '_E55'
+            e58placeHolder = museoCoords.prefix + url + '_unit_' + unit
+            e60placeHolderA = museoCoords.prefix + url + '_value_' + valueA
+            e60placeHolderL = museoCoords.prefix + url + '_value_' + valueL
+
+            #Altezza
+            #E22 P43 E54
+            if (row['MISA'] != ''):
+                line = triple(datplaceHolder,
+                              cidocCoords.prefix + 'P43_has_dimension',
+                              museoCoords.prefix + url + '_Altezza') + closeLine
+                output.write(line)
+                line = triple(museoCoords.prefix + url + '_Altezza',
+                              nsCoords.prefix + 'type',
+                              cidocCoords.prefix + 'E54_Dimension') + closeLine
+                output.write(line)
+                line = triple(museoCoords.prefix + url + '_Altezza',
+                              schemaCoords.prefix + 'label',
+                              '\"Altezza: ' + row['MISA'] + row['MISU'] +'\"') + closeLine
+                output.write(line)
+
+                # E54 P90 E60
+                line = triple(museoCoords.prefix + url + '_Altezza',
+                              cidocCoords.prefix + 'P90_has_value',
+                              e60placeHolderA) + closeLine
+                output.write(line)
+                line = triple(e60placeHolderA,
+                              nsCoords.prefix + 'type',
+                              cidocCoords.prefix + 'E60') + closeLine
+                output.write(line)
+                line = triple(e60placeHolderA,
+                              schemaCoords.prefix + 'label',
+                              '\"' + row['MISA'] + '\"') + closeLine
+                output.write(line)
+
+                #E54 P2 E55
+
+                line = triple(museoCoords.prefix + url + '_Altezza',
+                              cidocCoords.prefix + 'P2_has_type',
+                              aatCoords.prefix + '300055644') + closeLine
+                output.write(line)
+                line = triple(aatCoords.prefix + '300055644',
+                              schemaCoords.prefix + 'label',
+                              '\"altezza\"') + closeLine
+                output.write(line)
+
+                # E54 P91 E58
+                if (row['MISU'] != ''):
+                    line = triple(museoCoords.prefix + url + '_Altezza',
+                                  cidocCoords.prefix + 'P91_has_unit',
+                                  e58placeHolder) + closeLine
+                    output.write(line)
+                    line = triple(e58placeHolder,
+                                  nsCoords.prefix + 'type',
+                                  cidocCoords.prefix + 'E58_Measurement_Unit') + closeLine
+                    output.write(line)
+                    line = triple(e58placeHolder,
+                                  schemaCoords.prefix + 'label',
+                                  '\"' + row['MISU'] + '\"') + closeLine
+                    output.write(line)
+
+            # Larghezza
+            # E22 P43 E54
+            if (row['MISL'] != ''):
+                line = triple(datplaceHolder,
+                              cidocCoords.prefix + 'P43_has_dimension',
+                              museoCoords.prefix + url + '_Larghezza') + closeLine
+                output.write(line)
+                line = triple(museoCoords.prefix + url + '_Larghezza',
+                              nsCoords.prefix + 'type',
+                              cidocCoords.prefix + 'E54_Dimension') + closeLine
+                output.write(line)
+                line = triple(museoCoords.prefix + url + '_Larghezza',
+                              schemaCoords.prefix + 'label',
+                              '\"Larghezza: ' + row['MISL'] + row['MISU'] + '\"') + closeLine
+                output.write(line)
+
+                # E54 P90 E60
+                line = triple(museoCoords.prefix + url + '_Larghezza',
+                              cidocCoords.prefix + 'P90_has_value',
+                              e60placeHolderL) + closeLine
+                output.write(line)
+                line = triple(e60placeHolderL,
+                              nsCoords.prefix + 'type',
+                              cidocCoords.prefix + 'E60') + closeLine
+                output.write(line)
+                line = triple(e60placeHolderL,
+                              schemaCoords.prefix + 'label',
+                              '\"' + row['MISL'] + '\"') + closeLine
+                output.write(line)
+
+                # E54 P2 E55
+
+                line = triple(museoCoords.prefix + url + '_Larghezza',
+                              cidocCoords.prefix + 'P2_has_type',
+                              aatCoords.prefix + '300055647') + closeLine
+                output.write(line)
+                line = triple(aatCoords.prefix + '300055647',
+                              schemaCoords.prefix + 'label',
+                              '\"larghezza\"') + closeLine
+                output.write(line)
+
+                # E54 P91 E58
+                if (row['MISU'] != ''):
+                    line = triple(museoCoords.prefix + url + '_Larghezza',
+                                  cidocCoords.prefix + 'P91_has_unit',
+                                  e58placeHolder) + closeLine
+                    output.write(line)
+                    line = triple(e58placeHolder,
+                                  nsCoords.prefix + 'type',
+                                  cidocCoords.prefix + 'E58_Measurement_Unit') + closeLine
+                    output.write(line)
+                    line = triple(e58placeHolder,
+                                  schemaCoords.prefix + 'label',
+                                  '\"' + row['MISU'] + '\"') + closeLine
+                    output.write(line)
+
+
+            output.write('\n')
+        #
+        #
+        # Limit number of entries processed (if desired)
+        if (ii > max_entries):
+            break

+ 322 - 0
Museo/CSV_to_RDF/CSV_to_RDF_mpp_Move.py

@@ -0,0 +1,322 @@
+# Utilities to read/write csv files
+import csv
+# Utilities to handle character encodings
+import unicodedata
+# Ordered Dicts
+from collections import OrderedDict
+
+import json
+
+# OPZIONAL IMPORTS
+
+# For timestamping/simple speed tests
+from datetime import datetime
+# Random number generator
+from random import *
+# System & command line utilities
+import sys
+# Json for the dictionary
+import json
+
+import_dir = '/Users/alessiaspadi/Documents/RESTORE/temp_MPP/tabelle/Ospedale/mod/'
+export_dir = '/Users/alessiaspadi/Documents/RESTORE/temp_MPP/tabelle/Ospedale/mod/E9_'
+
+
+# Custom class to store URIs + related infos for the ontologies/repositories
+
+class RDFcoords:
+    def __init__(self, uri, prefix, code=None):
+        self.uri = uri
+        self.prefix = prefix
+        self.code = code
+
+
+# Repositories
+museoCoords = RDFcoords('<http://palazzopretorio.comune.prato.it/it/le-opere/alcuni-capolavori/>', 'mpp:')
+
+cidocCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/>', 'crm:')
+aatCoords = RDFcoords('<http://vocab.getty.edu/aat/>', 'aat:')
+nsCoords = RDFcoords('<http://www.w3.org/1999/02/22-rdf-syntax-ns#>', 'rdf:')
+schemaCoords = RDFcoords('<http://www.w3.org/2000/01/rdf-schema#>', 'rdfs:')
+
+
+# Basic functions for triples / shortened triples in TTL format
+
+def triple(subject, predicate, object1):
+    line = subject + ' ' + predicate + ' ' + object1
+    return line
+
+
+def doublet(predicate, object1):
+    line = '    ' + predicate + ' ' + object1
+    return line
+
+
+def singlet(object1):
+    line = '        ' + object1
+    return line
+
+
+# Line endings in TTL format
+continueLine1 = ' ;\n'
+continueLine2 = ' ,\n'
+closeLine = ' .\n'
+
+
+def writeTTLHeader(output):
+    output.write('@prefix ' + museoCoords.prefix + ' ' + museoCoords.uri + closeLine)
+    output.write('@prefix ' + cidocCoords.prefix + ' ' + cidocCoords.uri + closeLine)
+    output.write('@prefix ' + aatCoords.prefix + ' ' + aatCoords.uri + closeLine)
+    output.write('@prefix ' + schemaCoords.prefix + ' ' + schemaCoords.uri + closeLine)
+    output.write('@prefix ' + nsCoords.prefix + ' ' + nsCoords.uri + closeLine)
+
+    output.write('\n')
+
+
+filePrefix = 'SR20OA_'
+fileType = 'Ospedale'
+max_entries = 1000000000
+
+with open(import_dir + filePrefix + fileType + '.csv', newline="") as csv_file, open(
+        export_dir + filePrefix + fileType + '.ttl', 'w') as output:
+    reader = csv.DictReader(csv_file)
+    writeTTLHeader(output)
+    first = True
+    ii = 0
+    for row in reader:
+        # The index ii is used to process a limited number of entries for testing purposes
+        ii = ii + 1
+
+        if row['RVEL'] == '' or row['RVEL'] == '0':
+
+            # Triplify the 'codice' -- should exist for every entry
+
+            codice = ''
+            if (row['NCTR'] != '' and row['NCTN'] != ''):
+                codice = row['NCTR'] + row['NCTN']
+
+            url = row['URL']
+
+            # placeHolders
+            datplaceHolder = museoCoords.prefix + url
+            e53placeHolder = museoCoords.prefix + url + '_E53'
+            e9placeHolder = museoCoords.prefix + url + '_E9'
+
+            columnName = list(row)
+            tcl = []
+            for name in columnName:
+                if 'TCL' in name:
+                    tcl.append(name)
+
+            j=0
+
+            for el in tcl:
+                if row[el] != '':
+                    j = j+1
+
+            last = str(j-1)
+
+            n = len(tcl) - 1
+
+            for i in range(n - 1):
+
+                k = str(i + 1)
+
+                if i + 1 == 1:
+                    w = ''
+                else:
+                    w = i
+
+                f = str(w)
+
+                if row['TCL' + k] != '':
+
+                    pastLocation = ''
+                    newLocation = ''
+                    pl = ''
+
+                    if row['PRCD' + k] != '':
+                        newLocation = ' a ' + row['PRCD' + k]
+
+                    if row['PRCD' + f] != '':
+                        pastLocation = ' da ' + row['PRCD' + f]
+                        pl = row['PRCD' + f].replace(' ', '')
+
+                    newe9placeHolder = museoCoords.prefix + url + "_E9_" + k
+
+                    line = triple(datplaceHolder,
+                                  cidocCoords.prefix + 'P25i_moved_by',
+                                  newe9placeHolder) + closeLine
+                    output.write(line)
+                    line = triple(newe9placeHolder,
+                                  nsCoords.prefix + 'type',
+                                  cidocCoords.prefix + 'E9_Move') + closeLine
+                    output.write(line)
+                    line = triple(newe9placeHolder,
+                                  schemaCoords.prefix + 'label',
+                                  '\"Trasferimento di ' + row['SGTI'] + pastLocation +
+                                  newLocation + '\"') + closeLine
+                    output.write(line)
+
+                    timespan = ''
+                    ts = ''
+
+                    if row['PRDI' + f] != '':
+                        timespan = row['PRDI' + f]
+
+                    if row['PRDU' + f] != '':
+                        timespan = timespan + ' - ' + row['PRDU' + f]
+
+                    tt = timespan.replace(' ', '')
+                    ts = tt.replace('/', '')
+
+                    timespanPlaceholder = museoCoords.prefix + url + '_' + ts
+                    pastLocationPlaceholder = museoCoords.prefix + url + '_' + pl
+                    newLoc = row['PRCD' + k].replace(' ', '')
+                    newLocationPlaceholder = museoCoords.prefix + url + '_' + newLoc
+
+                    # E9 P4 E52
+
+                    line = triple(newe9placeHolder,
+                                  cidocCoords.prefix + 'P4_has_time-span',
+                                  timespanPlaceholder) + closeLine
+                    output.write(line)
+                    line = triple(timespanPlaceholder,
+                                  nsCoords.prefix + 'type',
+                                  cidocCoords.prefix + 'E52_Time-Span') + closeLine
+                    output.write(line)
+                    line = triple(timespanPlaceholder,
+                                  schemaCoords.prefix + 'label',
+                                  '\"' + timespan + '\"') + closeLine
+                    output.write(line)
+
+                    # E9 P26 E53 (moved to)
+
+                    if newLocationPlaceholder != '':
+                        line = triple(newe9placeHolder,
+                                      cidocCoords.prefix + 'P26_moved_to',
+                                      newLocationPlaceholder) + closeLine
+                        output.write(line)
+
+                    # E9 P27 E53
+
+                    pastLocationLabel = row['PRCD' + f]
+
+                    if row['PRCU' + f] != '':
+                        pastLocationLabel = pastLocationLabel + ', ' + row['PRCU' + f]
+
+                    if row['PRVC' + f] != '':
+                        pastLocationLabel = pastLocationLabel + ', ' + row['PRVC' + f]
+
+                    if row['PRVP' + f] != '':
+                        pastLocationLabel = pastLocationLabel + ' (' + row['PRVP' + f] + ')'
+
+                    if row['PRVR' + f] != '':
+                        pastLocationLabel = pastLocationLabel + ', ' + row['PRVR' + f]
+
+                    if row['PRVS' + f] != '':
+                        pastLocationLabel = pastLocationLabel + ', ' + row['PRVS' + f]
+
+                    line = triple(newe9placeHolder,
+                                  cidocCoords.prefix + 'P27_moved_from',
+                                  pastLocationPlaceholder) + closeLine
+                    output.write(line)
+                    line = triple(pastLocationPlaceholder,
+                                  nsCoords.prefix + 'type',
+                                  cidocCoords.prefix + 'E74_Group') + closeLine
+                    output.write(line)
+                    line = triple(pastLocationPlaceholder,
+                                  schemaCoords.prefix + 'label',
+                                  '\"' + pastLocationLabel + '\"') + closeLine
+                    output.write(line)
+
+            pastLocation = ''
+            newLocation = ''
+            pl = ''
+
+            if row['LDCN'] != '':
+                newLocation = ' a ' + row['LDCN']
+
+            if row['PRCD' + last] != '':
+                pastLocation = ' da ' + row['PRCD' + last]
+                pl = row['PRCD' + last].replace(' ', '')
+
+            line = triple(datplaceHolder,
+                          cidocCoords.prefix + 'P25i_moved_by',
+                          e9placeHolder) + closeLine
+            output.write(line)
+            line = triple(e9placeHolder,
+                          nsCoords.prefix + 'type',
+                          cidocCoords.prefix + 'E9_Move') + closeLine
+            output.write(line)
+            line = triple(e9placeHolder,
+                          schemaCoords.prefix + 'label',
+                          '\"Trasferimento di ' + row['SGTI'] + pastLocation +
+                          newLocation + '\"') + closeLine
+            output.write(line)
+
+            timespan = ''
+            ts = ''
+
+            if row['PRDI' + last] != '':
+                timespan = row['PRDI' + last]
+
+            if row['PRDU' + last] != '':
+                timespan = timespan + ' - ' + row['PRDU' + last]
+
+            tt = timespan.replace(' ', '')
+            ts = tt.replace('/', '')
+
+            timespanPlaceholder = museoCoords.prefix + url + '_' + ts
+            pastLocationPlaceholder = museoCoords.prefix + url + '_' + pl
+            newLocationPlaceholder = e53placeHolder
+
+            # E9 P4 E52
+
+            line = triple(e9placeHolder,
+                          cidocCoords.prefix + 'P4_has_time-span',
+                          timespanPlaceholder) + closeLine
+            output.write(line)
+            line = triple(timespanPlaceholder,
+                          nsCoords.prefix + 'type',
+                          cidocCoords.prefix + 'E52_Time-Span') + closeLine
+            output.write(line)
+            line = triple(timespanPlaceholder,
+                          schemaCoords.prefix + 'label',
+                          '\"' + timespan + '\"') + closeLine
+            output.write(line)
+
+            # E9 P26 E53 (moved to)
+
+            if newLocationPlaceholder != '':
+                line = triple(e9placeHolder,
+                              cidocCoords.prefix + 'P26_moved_to',
+                              newLocationPlaceholder) + closeLine
+                output.write(line)
+
+            # E9 P27 E53
+
+            pastLocationLabel = row['PRCD' + last] + ', ' + row['PRCU' + last] + ', ' + row['PRVC' + last] \
+                                + ' (' + row['PRVP' + last] + '), ' + row['PRVR' + last] + \
+                                ', ' + row['PRVS' + last]
+
+            line = triple(e9placeHolder,
+                          cidocCoords.prefix + 'P27_moved_from',
+                          pastLocationPlaceholder) + closeLine
+            output.write(line)
+            line = triple(pastLocationPlaceholder,
+                          nsCoords.prefix + 'type',
+                          cidocCoords.prefix + 'E74_Group') + closeLine
+            output.write(line)
+            line = triple(pastLocationPlaceholder,
+                          schemaCoords.prefix + 'label',
+                          '\"' + pastLocationLabel + '\"') + closeLine
+            output.write(line)
+
+            output.write('\n')
+
+        #
+        #
+        # Limit number of entries processed (if desired)
+        if (ii > max_entries):
+            break

+ 270 - 0
Museo/CSV_to_RDF/CSV_to_RDF_mpp_Person.py

@@ -0,0 +1,270 @@
+# Utilities to read/write csv files
+import csv
+# Utilities to handle character encodings
+import unicodedata
+# Ordered Dicts
+from collections import OrderedDict
+
+import json
+
+
+# OPZIONAL IMPORTS
+
+# For timestamping/simple speed tests
+from datetime import datetime
+# Random number generator
+from random import *
+# System & command line utilities
+import sys
+# Json for the dictionary
+import json
+
+import_dir = '/Users/alessiaspadi/Documents/RESTORE/temp_MPP/tabelle/Datini/mod/'
+export_dir = '/Users/alessiaspadi/Documents/RESTORE/temp_MPP/tabelle/Datini/mod/E21_'
+
+
+# Custom class to store URIs + related infos for the ontologies/repositories
+
+class RDFcoords:
+    def __init__(self, uri, prefix, code = None):
+        self.uri = uri
+        self.prefix = prefix
+        self.code = code
+
+
+# Repositories
+museoCoords = RDFcoords('<http://palazzopretorio.comune.prato.it/it/le-opere/alcuni-capolavori/>', 'mpp:')
+autCoords = RDFcoords('<http://palazzopretorio.comune.prato.it/it/opere/autori/>', 'aut:')
+
+cidocCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/>', 'crm:')
+aatCoords = RDFcoords('<http://vocab.getty.edu/aat/>', 'aat:')
+nsCoords = RDFcoords('<http://www.w3.org/1999/02/22-rdf-syntax-ns#>', 'rdf:')
+schemaCoords = RDFcoords('<http://www.w3.org/2000/01/rdf-schema#>', 'rdfs:')
+
+
+# Basic functions for triples / shortened triples in TTL format
+
+def triple(subject, predicate, object1):
+    line = subject + ' ' + predicate + ' ' + object1
+    return line
+
+def doublet(predicate, object1):
+    line = '    ' + predicate + ' ' + object1
+    return line
+
+def singlet(object1):
+    line = '        ' + object1
+    return line
+
+# Line endings in TTL format
+continueLine1 = ' ;\n'
+continueLine2 = ' ,\n'
+closeLine = ' .\n'
+
+def writeTTLHeader(output):
+    output.write('@prefix ' + museoCoords.prefix + ' ' + museoCoords.uri + closeLine)
+    output.write('@prefix ' + autCoords.prefix + ' ' + autCoords.uri + closeLine)
+    output.write('@prefix ' + cidocCoords.prefix + ' ' + cidocCoords.uri + closeLine)
+    output.write('@prefix ' + aatCoords.prefix + ' ' + aatCoords.uri + closeLine)
+    output.write('@prefix ' + schemaCoords.prefix + ' ' + schemaCoords.uri + closeLine)
+    output.write('@prefix ' + nsCoords.prefix + ' ' + nsCoords.uri + closeLine)
+
+    output.write('\n')
+
+
+filePrefix = 'AR20AUT_'
+fileType = 'Datini'
+max_entries = 1000000000
+
+with open(import_dir + filePrefix + fileType + '.csv', newline="") as csv_file, open(
+        export_dir + filePrefix + fileType + '.ttl', 'w') as output:
+    reader = csv.DictReader(csv_file)
+    writeTTLHeader(output)
+    first = True
+    ii = 0
+    for row in reader:
+        # The index ii is used to process a limited number of entries for testing purposes
+        ii = ii + 1
+
+        url = row['URL']
+
+        #placeHolders
+        e21placeHolder = autCoords.prefix + url
+        e62placeHolder = autCoords.prefix + url + '_E62'
+        e41placeHolder = autCoords.prefix + url + '_E41'
+        e42placeHolder = autCoords.prefix + url + '_E42'
+        e67placeHolder = autCoords.prefix + url + '_E67'
+        e69placeHolder = autCoords.prefix + url + '_E69'
+
+
+        line = triple(e21placeHolder, nsCoords.prefix + 'type',
+                      cidocCoords.prefix + 'E21_Person') + closeLine
+        output.write(line)
+        line = triple(e21placeHolder, schemaCoords.prefix + 'label',
+                      '\"' + row['AUTN'] + ', ' + row['AUTA'] + '\"') + closeLine
+        output.write(line)
+        line = triple(e21placeHolder, cidocCoords.prefix + 'P3_has_note',
+                      e62placeHolder) + closeLine
+        output.write(line)
+
+        line = triple(e62placeHolder, nsCoords.prefix + 'type',
+                      cidocCoords.prefix + 'E62') + closeLine
+        output.write(line)
+        line = triple(e62placeHolder, schemaCoords.prefix + 'label',
+                      '\"Fonte: Museo di Palazzo Pretorio - Collezione Datini\"') + closeLine
+        output.write(line)
+
+        #E21 - P1 - E42
+
+        line = triple(e21placeHolder, cidocCoords.prefix + 'P1_is_identified_by',
+                      e42placeHolder) + closeLine
+        output.write(line)
+        line = triple(e42placeHolder, nsCoords.prefix + 'type',
+                      cidocCoords.prefix + 'E42_Identifier') + closeLine
+        output.write(line)
+        line = triple(e42placeHolder, schemaCoords.prefix + 'label',
+                      '\"' + row['AUTH'] + '\"') + closeLine
+        output.write(line)
+
+        #E21 - P1 - E41
+
+        '''line = triple(e21placeHolder, cidocCoords.prefix + 'P1_is_identified_by',
+                      e41placeHolder) + closeLine
+        output.write(line)
+        line = triple(e41placeHolder, nsCoords.prefix + 'type',
+                      cidocCoords.prefix + 'E41_Appellation') + closeLine
+        output.write(line)
+        line = triple(e41placeHolder, schemaCoords.prefix + 'label',
+                      '\"' + row['AUTN'] + '\"') + closeLine
+        output.write(line)'''
+
+        # E21 - P107i - E74
+
+        if row['AUTU'] != '':
+            group = []
+            if '/' in row['AUTU']:
+                group = row['AUTU'].split('/')
+            else:
+                group.append(row['AUTU'])
+
+            for gr in group:
+                gg = gr.replace(' ', '')
+                e74placeHolder = museoCoords.prefix + gg
+                line = triple(e21placeHolder,
+                              cidocCoords.prefix + 'P107i_is_current_or_former_member_of',
+                              e74placeHolder) + closeLine
+                output.write(line)
+                line = triple(e74placeHolder,
+                              nsCoords.prefix + 'type',
+                              cidocCoords.prefix + 'E74_Group') + closeLine
+                output.write(line)
+                line = triple(e74placeHolder,
+                              schemaCoords.prefix + 'label',
+                              '\"' + row['AUTU'] + '\"') + closeLine
+                output.write(line)
+
+        #E21 - P98i - E67
+
+        line = triple(e21placeHolder,
+                      cidocCoords.prefix + 'P98i_was_born',
+                      e67placeHolder) + closeLine
+        output.write(line)
+        line = triple(e67placeHolder,
+                      nsCoords.prefix + 'type',
+                      cidocCoords.prefix + 'E67_Birth') + closeLine
+        output.write(line)
+        line = triple(e67placeHolder,
+                      schemaCoords.prefix + 'label',
+                      '\"Nascita di ' + row['AUTN'] + '\"') + closeLine
+        output.write(line)
+
+        line = triple(e21placeHolder,
+                      cidocCoords.prefix + 'P100i_died_in',
+                      e69placeHolder) + closeLine
+        output.write(line)
+        line = triple(e69placeHolder,
+                      nsCoords.prefix + 'type',
+                      cidocCoords.prefix + 'E69_Death') + closeLine
+        output.write(line)
+        line = triple(e69placeHolder,
+                      schemaCoords.prefix + 'label',
+                      '\"Morte di ' + row['AUTN'] + '\"') + closeLine
+        output.write(line)
+
+        #E67 - P7 - E53
+
+        if row['AUTL'] != '':
+            line = triple(e67placeHolder,
+                          cidocCoords.prefix + 'P7_took_place_at',
+                          museoCoords.prefix + row['AUTL']) + closeLine
+            output.write(line)
+            line = triple(museoCoords.prefix + row['AUTL'],
+                          nsCoords.prefix + 'type',
+                          cidocCoords.prefix + 'E53_Place') + closeLine
+            output.write(line)
+            line = triple(museoCoords.prefix + row['AUTL'],
+                          schemaCoords.prefix + 'label',
+                          '\"' + row['AUTL'] + '\"') + closeLine
+            output.write(line)
+
+        # E67 - P4 - E52
+
+        if row['AUTD'] != '':
+            tt = row['AUTD'].replace(' ', '')
+            tim = tt.replace('/', '')
+            time = tim.replace('.', '')
+            line = triple(e67placeHolder,
+                          cidocCoords.prefix + 'P4_has_time-span',
+                          museoCoords.prefix + time) + closeLine
+            output.write(line)
+            line = triple(museoCoords.prefix + time,
+                          nsCoords.prefix + 'type',
+                          cidocCoords.prefix + 'E52_Time_Span') + closeLine
+            output.write(line)
+            line = triple(museoCoords.prefix + time,
+                          schemaCoords.prefix + 'label',
+                          '\"' + row['AUTD'] + '\"') + closeLine
+            output.write(line)
+
+        # E69 - P7 - E53
+
+        if row['AUTX'] != '':
+            line = triple(e69placeHolder,
+                          cidocCoords.prefix + 'P7_took_place_at',
+                          museoCoords.prefix + row['AUTX']) + closeLine
+            output.write(line)
+            line = triple(museoCoords.prefix + row['AUTX'],
+                          nsCoords.prefix + 'type',
+                          cidocCoords.prefix + 'E53_Place') + closeLine
+            output.write(line)
+            line = triple(museoCoords.prefix + row['AUTX'],
+                          schemaCoords.prefix + 'label',
+                          '\"' + row['AUTX'] + '\"') + closeLine
+            output.write(line)
+
+        # E69 - P4 - E52
+
+        if row['AUTT'] != '':
+            tt = row['AUTT'].replace(' ', '')
+            tim = tt.replace('/', '')
+            time = tim.replace('.', '')
+            line = triple(e69placeHolder,
+                          cidocCoords.prefix + 'P4_has_time-span',
+                          museoCoords.prefix + time) + closeLine
+            output.write(line)
+            line = triple(museoCoords.prefix + time,
+                          nsCoords.prefix + 'type',
+                          cidocCoords.prefix + 'E52_Time_Span') + closeLine
+            output.write(line)
+            line = triple(museoCoords.prefix + time,
+                          schemaCoords.prefix + 'label',
+                          '\"' + row['AUTT'] + '\"') + closeLine
+            output.write(line)
+
+
+        output.write('\n')
+        #
+        #
+        # Limit number of entries processed (if desired)
+        if (ii > max_entries):
+            break