|
@@ -2,7 +2,7 @@
|
|
"cells": [
|
|
"cells": [
|
|
{
|
|
{
|
|
"cell_type": "code",
|
|
"cell_type": "code",
|
|
- "execution_count": 121,
|
|
|
|
|
|
+ "execution_count": 1,
|
|
"metadata": {},
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"outputs": [],
|
|
"source": [
|
|
"source": [
|
|
@@ -30,17 +30,17 @@
|
|
},
|
|
},
|
|
{
|
|
{
|
|
"cell_type": "code",
|
|
"cell_type": "code",
|
|
- "execution_count": 122,
|
|
|
|
|
|
+ "execution_count": 2,
|
|
"metadata": {},
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"outputs": [],
|
|
"source": [
|
|
"source": [
|
|
- "import_dir = '/Users/federicaspinelli/Google Drive/OVI:CNR/CSV/ASPO/gettatelli/'\n",
|
|
|
|
- "export_dir = '/Users/federicaspinelli/Google Drive/OVI:CNR/RDF/ASPO/gettatelli/'"
|
|
|
|
|
|
+ "import_dir = '/Users/federicaspinelli/Google Drive/OVI-CNR/CSV/ASPO/gettatelli/'\n",
|
|
|
|
+ "export_dir = '/Users/federicaspinelli/Google Drive/OVI-CNR/RDF/ASPO/gettatelli/'"
|
|
]
|
|
]
|
|
},
|
|
},
|
|
{
|
|
{
|
|
"cell_type": "code",
|
|
"cell_type": "code",
|
|
- "execution_count": 123,
|
|
|
|
|
|
+ "execution_count": 3,
|
|
"metadata": {},
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"outputs": [],
|
|
"source": [
|
|
"source": [
|
|
@@ -52,19 +52,26 @@
|
|
" self.prefix = prefix\n",
|
|
" self.prefix = prefix\n",
|
|
" self.code = code\n",
|
|
" self.code = code\n",
|
|
"\n",
|
|
"\n",
|
|
- "\n",
|
|
|
|
"# Repositories\n",
|
|
"# Repositories\n",
|
|
"datiniCoords = RDFcoords('<http://www.archiviodistato.prato.it/accedi-e-consulta/aspoGT001/scheda/IT-ASPO-GT001->', 'dt:')\n",
|
|
"datiniCoords = RDFcoords('<http://www.archiviodistato.prato.it/accedi-e-consulta/aspoGT001/scheda/IT-ASPO-GT001->', 'dt:')\n",
|
|
- "# Added by FS\n",
|
|
|
|
"personAuthCoords = RDFcoords('<http://www.archiviodistato.prato.it/accedi-e-consulta/aspoMV001/scheda/IT-ASPO-GT001->', 'pa:')\n",
|
|
"personAuthCoords = RDFcoords('<http://www.archiviodistato.prato.it/accedi-e-consulta/aspoMV001/scheda/IT-ASPO-GT001->', 'pa:')\n",
|
|
"# W3/CIDOC Predicates\n",
|
|
"# W3/CIDOC Predicates\n",
|
|
"hasTypeCoords = RDFcoords('<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>', 'tp:')\n",
|
|
"hasTypeCoords = RDFcoords('<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>', 'tp:')\n",
|
|
|
|
+ "hasNoteCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/P3_has_note>', 'no:')\n",
|
|
|
|
+ "hasTypePCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/P2_has_type>', 'te:')\n",
|
|
"carriesCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/P128_carries>', 'ca:')\n",
|
|
"carriesCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/P128_carries>', 'ca:')\n",
|
|
"identifiedByCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/P1_is_identified_by>', 'ib:')\n",
|
|
"identifiedByCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/P1_is_identified_by>', 'ib:')\n",
|
|
"labelCoords = RDFcoords('<http://www.w3.org/2000/01/rdf-schema#label>', 'lb:')\n",
|
|
"labelCoords = RDFcoords('<http://www.w3.org/2000/01/rdf-schema#label>', 'lb:')\n",
|
|
- "# Added by FS CIDOC properties for person\n",
|
|
|
|
"wasBroughtCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/P92i_was_brought_into_existence_by>', 'wb:')\n",
|
|
"wasBroughtCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/P92i_was_brought_into_existence_by>', 'wb:')\n",
|
|
|
|
+ "wasBornCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/P98i_was_born>', 'wbc:')\n",
|
|
|
|
+ "diedCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/P100i_died_in>', 'di:')\n",
|
|
"carriedByCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/P14_carried_out_by>', 'cb:')\n",
|
|
"carriedByCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/P14_carried_out_by>', 'cb:')\n",
|
|
|
|
+ "noteCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/P3_has_note>', 'nt:')\n",
|
|
|
|
+ "hasTimeSpanCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/P4_has_time-span>', 'hs:')\n",
|
|
|
|
+ "consistCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/P45_consist_of>', 'cf:')\n",
|
|
|
|
+ "hasConditionCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/P44_has_condition>', 'hc:')\n",
|
|
|
|
+ "hasCurrentPermanentLocationCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/P54_has_current_permanent_location>', 'ap:')\n",
|
|
|
|
+ "placeCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/E53_Place>', 'pl:', 'E53')\n",
|
|
"\n",
|
|
"\n",
|
|
"# CIDOC Objects\n",
|
|
"# CIDOC Objects\n",
|
|
"manMadeObjectCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/E22_Man-Made_Object>', 'mo:', 'E22')\n",
|
|
"manMadeObjectCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/E22_Man-Made_Object>', 'mo:', 'E22')\n",
|
|
@@ -72,14 +79,25 @@
|
|
"titleCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/E35_Title>', 'ti:' ,'E35')\n",
|
|
"titleCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/E35_Title>', 'ti:' ,'E35')\n",
|
|
"placeAppellationCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/E44_Place_appellation>', 'pa:', 'E44')\n",
|
|
"placeAppellationCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/E44_Place_appellation>', 'pa:', 'E44')\n",
|
|
"identifierCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/E42_Identifier>', 'id:', 'E42')\n",
|
|
"identifierCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/E42_Identifier>', 'id:', 'E42')\n",
|
|
- "# Added by FS CIDOC entity\n",
|
|
|
|
|
|
+ "typeCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/E55_Type>', 'ty:', 'E55')\n",
|
|
"creationCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/E65_Creation>', 'cr:', 'E65')\n",
|
|
"creationCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/E65_Creation>', 'cr:', 'E65')\n",
|
|
- "personCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/E21_Person>', 'ps:', 'E21')"
|
|
|
|
|
|
+ "personCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/E21_Person>', 'ps:', 'E21')\n",
|
|
|
|
+ "stringCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/E62_String>', 'st:', 'E62')\n",
|
|
|
|
+ "birthCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/E67_Birth>', 'th:', 'E67')\n",
|
|
|
|
+ "deathCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/E69_Death>', 'dh:', 'E69')\n",
|
|
|
|
+ "timeSpanCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/E52_Time-Span>', 'ts:', 'E52')\n",
|
|
|
|
+ "materialCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/E57_Material>', 'mt:', 'E57')\n",
|
|
|
|
+ "conditionCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/E3_Condition_State>', 'cs:', 'E3')\n",
|
|
|
|
+ "entityCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/E1_Entity>', 'ey:', 'E1')\n",
|
|
|
|
+ "refersCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/P67_refers_to>', 'rt:')\n",
|
|
|
|
+ "refersHasTypeCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/P67.1_type>', 'rh:')\n",
|
|
|
|
+ "hasCurrentPermanentLocationCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/P54_has_current_permanent_location>', 'ap:')\n",
|
|
|
|
+ "placeCoords = RDFcoords('<http://www.cidoc-crm.org/cidoc-crm/E53_Place>', 'pl:', 'E53')\n"
|
|
]
|
|
]
|
|
},
|
|
},
|
|
{
|
|
{
|
|
"cell_type": "code",
|
|
"cell_type": "code",
|
|
- "execution_count": 124,
|
|
|
|
|
|
+ "execution_count": 4,
|
|
"metadata": {},
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"outputs": [],
|
|
"source": [
|
|
"source": [
|
|
@@ -105,15 +123,15 @@
|
|
},
|
|
},
|
|
{
|
|
{
|
|
"cell_type": "code",
|
|
"cell_type": "code",
|
|
- "execution_count": 125,
|
|
|
|
|
|
+ "execution_count": 5,
|
|
"metadata": {},
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"outputs": [],
|
|
"source": [
|
|
"source": [
|
|
"def writeTTLHeader(output):\n",
|
|
"def writeTTLHeader(output):\n",
|
|
" output.write('@prefix ' + datiniCoords.prefix + ' ' + datiniCoords.uri + closeLine)\n",
|
|
" output.write('@prefix ' + datiniCoords.prefix + ' ' + datiniCoords.uri + closeLine)\n",
|
|
- " # Added by FS\n",
|
|
|
|
" output.write('@prefix ' + personAuthCoords.prefix + ' ' + personAuthCoords.uri + closeLine)\n",
|
|
" output.write('@prefix ' + personAuthCoords.prefix + ' ' + personAuthCoords.uri + closeLine)\n",
|
|
" output.write('@prefix ' + hasTypeCoords.prefix + ' ' + hasTypeCoords.uri + closeLine)\n",
|
|
" output.write('@prefix ' + hasTypeCoords.prefix + ' ' + hasTypeCoords.uri + closeLine)\n",
|
|
|
|
+ " output.write('@prefix ' + hasTypePCoords.prefix + ' ' + hasTypePCoords.uri + closeLine)\n",
|
|
" output.write('@prefix ' + manMadeObjectCoords.prefix + ' ' + manMadeObjectCoords.uri + closeLine)\n",
|
|
" output.write('@prefix ' + manMadeObjectCoords.prefix + ' ' + manMadeObjectCoords.uri + closeLine)\n",
|
|
" output.write('@prefix ' + carriesCoords.prefix + ' ' + carriesCoords.uri + closeLine)\n",
|
|
" output.write('@prefix ' + carriesCoords.prefix + ' ' + carriesCoords.uri + closeLine)\n",
|
|
" output.write('@prefix ' + informationObjectCoords.prefix + ' ' + informationObjectCoords.uri + closeLine)\n",
|
|
" output.write('@prefix ' + informationObjectCoords.prefix + ' ' + informationObjectCoords.uri + closeLine)\n",
|
|
@@ -121,17 +139,37 @@
|
|
" output.write('@prefix ' + titleCoords.prefix + ' ' + titleCoords.uri + closeLine)\n",
|
|
" output.write('@prefix ' + titleCoords.prefix + ' ' + titleCoords.uri + closeLine)\n",
|
|
" output.write('@prefix ' + labelCoords.prefix + ' ' + labelCoords.uri + closeLine)\n",
|
|
" output.write('@prefix ' + labelCoords.prefix + ' ' + labelCoords.uri + closeLine)\n",
|
|
" output.write('@prefix ' + identifierCoords.prefix + ' ' + identifierCoords.uri + closeLine)\n",
|
|
" output.write('@prefix ' + identifierCoords.prefix + ' ' + identifierCoords.uri + closeLine)\n",
|
|
- " # Added by FS\n",
|
|
|
|
" output.write('@prefix ' + wasBroughtCoords.prefix + ' ' + wasBroughtCoords.uri + closeLine)\n",
|
|
" output.write('@prefix ' + wasBroughtCoords.prefix + ' ' + wasBroughtCoords.uri + closeLine)\n",
|
|
|
|
+ " output.write('@prefix ' + typeCoords.prefix + ' ' + typeCoords.uri + closeLine)\n",
|
|
" output.write('@prefix ' + carriedByCoords.prefix + ' ' + carriedByCoords.uri + closeLine)\n",
|
|
" output.write('@prefix ' + carriedByCoords.prefix + ' ' + carriedByCoords.uri + closeLine)\n",
|
|
- " # Added by FS\n",
|
|
|
|
" output.write('@prefix ' + personCoords.prefix + ' ' + personCoords.uri + closeLine)\n",
|
|
" output.write('@prefix ' + personCoords.prefix + ' ' + personCoords.uri + closeLine)\n",
|
|
|
|
+ " output.write('@prefix ' + stringCoords.prefix + ' ' + stringCoords.uri + closeLine)\n",
|
|
|
|
+ " output.write('@prefix ' + noteCoords.prefix + ' ' + noteCoords.uri + closeLine)\n",
|
|
|
|
+ " output.write('@prefix ' + wasBornCoords.prefix + ' ' + wasBornCoords.uri + closeLine)\n",
|
|
|
|
+ " output.write('@prefix ' + diedCoords.prefix + ' ' + diedCoords.uri + closeLine)\n",
|
|
|
|
+ " output.write('@prefix ' + birthCoords.prefix + ' ' + birthCoords.uri + closeLine)\n",
|
|
|
|
+ " output.write('@prefix ' + deathCoords.prefix + ' ' + deathCoords.uri + closeLine)\n",
|
|
|
|
+ " output.write('@prefix ' + hasTimeSpanCoords.prefix + ' ' + hasTimeSpanCoords.uri + closeLine)\n",
|
|
|
|
+ " output.write('@prefix ' + timeSpanCoords.prefix + ' ' + timeSpanCoords.uri + closeLine)\n",
|
|
|
|
+ " output.write('@prefix ' + materialCoords.prefix + ' ' + materialCoords.uri + closeLine)\n",
|
|
|
|
+ " output.write('@prefix ' + consistCoords.prefix + ' ' + consistCoords.uri + closeLine)\n",
|
|
|
|
+ " output.write('@prefix ' + conditionCoords.prefix + ' ' + conditionCoords.uri + closeLine)\n",
|
|
|
|
+ " output.write('@prefix ' + hasConditionCoords.prefix + ' ' + hasConditionCoords.uri + closeLine)\n",
|
|
|
|
+ " output.write('@prefix ' + refersCoords.prefix + ' ' + refersCoords.uri + closeLine) \n",
|
|
|
|
+ " output.write('@prefix ' + entityCoords.prefix + ' ' + entityCoords.uri + closeLine)\n",
|
|
|
|
+ " output.write('@prefix ' + refersHasTypeCoords.prefix + ' ' + refersHasTypeCoords.uri + closeLine)\n",
|
|
|
|
+ " output.write('@prefix ' + hasNoteCoords.prefix + ' ' + hasNoteCoords.uri + closeLine)\n",
|
|
|
|
+ " output.write('@prefix ' + creationCoords.prefix + ' ' + creationCoords.uri + closeLine)\n",
|
|
|
|
+ " output.write('@prefix ' + hasCurrentPermanentLocationCoords.prefix + ' ' + hasCurrentPermanentLocationCoords.uri + closeLine)\n",
|
|
|
|
+ " output.write('@prefix ' + placeCoords.prefix + ' ' + placeCoords.uri + closeLine)\n",
|
|
|
|
+ " output.write('@prefix ' + hasCurrentPermanentLocationCoords.prefix + ' ' + hasCurrentPermanentLocationCoords.uri + closeLine)\n",
|
|
|
|
+ " output.write('@prefix ' + placeCoords.prefix + ' ' + placeCoords.uri + closeLine)\n",
|
|
" output.write('\\n')\n"
|
|
" output.write('\\n')\n"
|
|
]
|
|
]
|
|
},
|
|
},
|
|
{
|
|
{
|
|
"cell_type": "code",
|
|
"cell_type": "code",
|
|
- "execution_count": 126,
|
|
|
|
|
|
+ "execution_count": 6,
|
|
"metadata": {},
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"outputs": [],
|
|
"source": [
|
|
"source": [
|
|
@@ -144,44 +182,151 @@
|
|
" writeTTLHeader(output)\n",
|
|
" writeTTLHeader(output)\n",
|
|
" first = True\n",
|
|
" first = True\n",
|
|
" ii = 0\n",
|
|
" ii = 0\n",
|
|
|
|
+ " E53placeHolder = \"<http://www.archiviodistato.prato.it>\"\n",
|
|
|
|
+ " line = triple(E53placeHolder, hasTypeCoords.prefix, placeCoords.prefix ) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " line = triple(E53placeHolder, labelCoords.prefix, \"\\\"Archivio di Stato di Prato\\\"\") + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
" for row in reader:\n",
|
|
" for row in reader:\n",
|
|
" # The index ii is used to process a limited number of entries for testing purposes\n",
|
|
" # The index ii is used to process a limited number of entries for testing purposes\n",
|
|
" ii = ii+1\n",
|
|
" ii = ii+1\n",
|
|
" # Skip the first line as it carries info we don't want to triplify\n",
|
|
" # Skip the first line as it carries info we don't want to triplify\n",
|
|
" if(first):\n",
|
|
" if(first):\n",
|
|
" first = False\n",
|
|
" first = False\n",
|
|
- " continue\n",
|
|
|
|
- " # Write E22 Man Made Object & E73 Information Object -- should exist for every entry?\n",
|
|
|
|
- " line = triple(datiniCoords.prefix + row['id'].replace('IT-ASPO-GT001-', ''), hasTypeCoords.prefix, manMadeObjectCoords.prefix) + continueLine1\n",
|
|
|
|
- " output.write(line)\n",
|
|
|
|
- " e37placeHolder = '_:' + informationObjectCoords.code + '_' + row['id'].replace('IT-ASPO-GT001-', '')\n",
|
|
|
|
- " line = doublet(carriesCoords.prefix, e37placeHolder) + closeLine\n",
|
|
|
|
- " output.write(line)\n",
|
|
|
|
- " line = triple(e37placeHolder, hasTypeCoords.prefix, informationObjectCoords.prefix) + closeLine\n",
|
|
|
|
|
|
+ " continue \n",
|
|
|
|
+ " #E22 Man Made Object\n",
|
|
|
|
+ " line = triple(datiniCoords.prefix + row['id'].replace('IT-ASPO-GT001-', ''), hasTypeCoords.prefix, manMadeObjectCoords.prefix) + closeLine\n",
|
|
" output.write(line)\n",
|
|
" output.write(line)\n",
|
|
- " # \n",
|
|
|
|
- " # Add by FS Person\n",
|
|
|
|
- " # If the 'persname' property is not empty for the given entry, write down triples\n",
|
|
|
|
" bambino = ''\n",
|
|
" bambino = ''\n",
|
|
" if(row['cognome_bambino'] != ''):\n",
|
|
" if(row['cognome_bambino'] != ''):\n",
|
|
" bambino = bambino + row['cognome_bambino'] + ' '\n",
|
|
" bambino = bambino + row['cognome_bambino'] + ' '\n",
|
|
" if(row['nome_bambino'] != ''):\n",
|
|
" if(row['nome_bambino'] != ''):\n",
|
|
" bambino = bambino + row['nome_bambino']\n",
|
|
" bambino = bambino + row['nome_bambino']\n",
|
|
" if(bambino != ''):\n",
|
|
" if(bambino != ''):\n",
|
|
- " url = '<http://www.archiviodistato.prato.it/accedi-e-consulta/aspoMV001/scheda/IT-ASPO-GT001-' + row['id'].replace('IT-ASPO-GT001-', '') + '/' + bambino.replace(' ', '_') + '>'\n",
|
|
|
|
- " line = triple(url, hasTypeCoords.prefix, personCoords.prefix) + closeLine\n",
|
|
|
|
|
|
+ " line = triple(datiniCoords.prefix + row['id'].replace('IT-ASPO-GT001-', ''), labelCoords.prefix, '\\\"Documento fisico: ' + row['tipologia'] + ' di ' + bambino + '\\\"') + closeLine\n",
|
|
" output.write(line)\n",
|
|
" output.write(line)\n",
|
|
- " line = triple(url, labelCoords.prefix, '\\\"' + bambino + '\\\"') + closeLine\n",
|
|
|
|
|
|
+ " else:\n",
|
|
|
|
+ " line = triple(datiniCoords.prefix + row['id'].replace('IT-ASPO-GT001-', ''), labelCoords.prefix, '\\\"Documento fisico: ' + row['tipologia'] + '\\\"') + closeLine\n",
|
|
" output.write(line)\n",
|
|
" output.write(line)\n",
|
|
- "\n",
|
|
|
|
- " # Add by FS Matricola Bambino\n",
|
|
|
|
- " if(row['matricola'] != ''):\n",
|
|
|
|
- " url = '<http://www.archiviodistato.prato.it/accedi-e-consulta/aspoMV001/scheda/IT-ASPO-GT001-' + row['id'].replace('IT-ASPO-GT001-', '') + '/' + row['matricola'].replace('/', '') + '>'\n",
|
|
|
|
- " line = triple(url, hasTypeCoords.prefix, identifierCoords.prefix) + closeLine\n",
|
|
|
|
|
|
+ " # E73 Information Object\n",
|
|
|
|
+ " e73placeHolder = \"<http://www.archiviodistato.prato.it/accedi-e-consulta/aspoGT001/scheda/\" + row['id'] + \"/\" + informationObjectCoords.code + \">\"\n",
|
|
|
|
+ " line = triple(datiniCoords.prefix + row['id'].replace('IT-ASPO-GT001-', ''), carriesCoords.prefix, e73placeHolder) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " line = triple(e73placeHolder, hasTypeCoords.prefix, informationObjectCoords.prefix) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " line = triple(e73placeHolder, labelCoords.prefix, '\\\"Contenuto informativo: ' + row['tipologia'] + ' di ' + bambino + '\\\"') + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " # E53 Place\n",
|
|
|
|
+ " line = triple(datiniCoords.prefix + row['id'].replace('IT-ASPO-GT001-', ''), hasCurrentPermanentLocationCoords.prefix, E53placeHolder) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " # E55 Type\n",
|
|
|
|
+ " if(row['tipologia'] != ''):\n",
|
|
|
|
+ " tipologie = []\n",
|
|
|
|
+ " pipe = \"|\" \n",
|
|
|
|
+ " if pipe in row['tipologia']:\n",
|
|
|
|
+ " tipologie = row['tipologia'].split('|')\n",
|
|
|
|
+ " e55placeHolder = \"<http://archiviodistato.prato.it/\" + typeCoords.code + \"/\" + tipologie.replace(\" \", \"\") + \">\"\n",
|
|
|
|
+ " line = triple(e73placeHolder, hasTypePCoords.prefix, e55placeHolder) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " else:\n",
|
|
|
|
+ " e55placeHolder = \"<http://archiviodistato.prato.it/\" + typeCoords.code + \"/\" + row['tipologia'].replace(\" \", \"\") + \">\"\n",
|
|
|
|
+ " line = triple(e73placeHolder, hasTypePCoords.prefix, e55placeHolder) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " elif(row['genere'] != ''):\n",
|
|
|
|
+ " tipologie = []\n",
|
|
|
|
+ " pipe = \"|\" \n",
|
|
|
|
+ " if pipe in row['genere']:\n",
|
|
|
|
+ " tipologie = row['genere'].split('|')\n",
|
|
|
|
+ " e55placeHolder = \"<http://archiviodistato.prato.it/\" + typeCoords.code + \"/\" + tipologie.replace(\" \", \"\") + \">\"\n",
|
|
|
|
+ " line = triple(e73placeHolder, hasTypePCoords.prefix, e55placeHolder) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " else:\n",
|
|
|
|
+ " e55placeHolder = \"<http://archiviodistato.prato.it/\" + typeCoords.code + \"/\" + row['genere'].replace(\" \", \"\") + \">\"\n",
|
|
|
|
+ " line = triple(e73placeHolder, hasTypePCoords.prefix, e55placeHolder) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " # E42 Identifier\n",
|
|
|
|
+ " e42placeHolderID = \"<http://www.archiviodistato.prato.it/accedi-e-consulta/aspoGT001/scheda/\" + row['id'] + \"/\" + identifierCoords.code + \"ID>\"\n",
|
|
|
|
+ " line = triple(datiniCoords.prefix + row['id'].replace('IT-ASPO-GT001-', ''), identifiedByCoords.prefix, e42placeHolderID) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " line = triple(e42placeHolderID, hasTypeCoords.prefix, identifierCoords.prefix) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " line = triple(e42placeHolderID, labelCoords.prefix, '\\\"' + row['id'].replace(\" \", \"\") + '\\\"') + closeLine \n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " # E65 Creation\n",
|
|
|
|
+ " e22placeHolder = \"<http://www.archiviodistato.prato.it/accedi-e-consulta/aspoGT001/scheda/\" + row['id'] + \">\"\n",
|
|
|
|
+ " e65placeHolder = \"<http://www.archiviodistato.prato.it/accedi-e-consulta/aspoGT001/scheda/\" + row['id'] + \"/\" + creationCoords.code + \">\"\n",
|
|
|
|
+ " line = triple(e22placeHolder, wasBroughtCoords.prefix, e65placeHolder) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " line = triple(e65placeHolder, hasTypeCoords.prefix, creationCoords.prefix) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " line = triple(e65placeHolder, labelCoords.prefix, '\\\"Creazione di ' + row['tipologia'] + ' di ' + bambino + '\\\"') + closeLine\n",
|
|
|
|
+ " output.write(line) \n",
|
|
|
|
+ " # E42 Identifier\n",
|
|
|
|
+ " if(row['riferimento_registro'] != ''):\n",
|
|
|
|
+ " e42placeHolder = \"<http://www.archiviodistato.prato.it/accedi-e-consulta/aspoGT001/scheda/\" + row['id'] + \"/\" + identifierCoords.code + \">\"\n",
|
|
|
|
+ " line = triple(e22placeHolder, identifiedByCoords.prefix, e42placeHolder) + closeLine\n",
|
|
" output.write(line)\n",
|
|
" output.write(line)\n",
|
|
- " line = triple(url, labelCoords.prefix, '\\\"' + row['matricola'] + '\\\"') + closeLine\n",
|
|
|
|
|
|
+ " line = triple(e42placeHolder, hasTypeCoords.prefix, identifierCoords.prefix) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " line = triple(e42placeHolder, labelCoords.prefix, '\\\"Riferimento registro: ' + row['riferimento_registro']+ '\\\"') + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " # E57 Material\n",
|
|
|
|
+ " if(row['descrizione_contrassegno'] != ''):\n",
|
|
|
|
+ " e57placeHolder = \"<http://www.archiviodistato.prato.it/accedi-e-consulta/aspoGT001/scheda/\" + row['id'] + \"/\" + materialCoords.code + \">\"\n",
|
|
|
|
+ " line = triple(datiniCoords.prefix + row['id'].replace('IT-ASPO-GT001-', ''), consistCoords.prefix, e57placeHolder) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " line = triple(e57placeHolder, labelCoords.prefix, '\\\"' + row['descrizione_contrassegno'].replace('\"','')+ '\\\"') + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " line = triple(e57placeHolder, hasTypeCoords.prefix, materialCoords.prefix) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " e55placeHolder = \"<http://www.archiviodistato.prato.it/accedi-e-consulta/aspoGT001/scheda\" + row['id'] + \"/\" + materialCoords.code + \"_\" + typeCoords.code + \">\" \n",
|
|
|
|
+ " line = triple(e57placeHolder, hasTypePCoords.prefix, e55placeHolder) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " line = triple(e55placeHolder, hasTypeCoords.prefix, typeCoords.prefix) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " line = triple(e55placeHolder, labelCoords.prefix, '\\\"Descrizione contrassegno\\\"') + closeLine\n",
|
|
|
|
+ " output.write(line) \n",
|
|
|
|
+ " # E3 Condition\n",
|
|
|
|
+ " if(row['conservazione'] != ''):\n",
|
|
|
|
+ " e3placeHolder = \"<http://www.archiviodistato.prato.it/accedi-e-consulta/aspoGT001/scheda/\" + row['id'] + \"/\" + conditionCoords.code + \">\"\n",
|
|
|
|
+ " line = triple( \"<http://www.archiviodistato.prato.it/accedi-e-consulta/aspoGT001/scheda/\" + row['id'] + \">\", hasConditionCoords.prefix, e3placeHolder) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " line = triple(e3placeHolder, hasTypeCoords.prefix, conditionCoords.prefix) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " line = triple(e3placeHolder, labelCoords.prefix, '\\\"'+ row['conservazione'].replace('\"','')+ '\\\"') + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " e55placeHolder = \"<http://www.archiviodistato.prato.it/accedi-e-consulta/aspoGT001/scheda\" + row['id'] + \"/\" + conditionCoords.code + \"_\" + typeCoords.code + \">\" \n",
|
|
|
|
+ " line = triple(e3placeHolder, hasTypePCoords.prefix, e55placeHolder) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " line = triple(e55placeHolder, hasTypeCoords.prefix, typeCoords.prefix) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " line = triple(e55placeHolder, labelCoords.prefix, '\\\"Stato di conservazione\\\"') + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " # E1 Entity - Scope and Content\n",
|
|
|
|
+ " if(row['scope-content_body'] != ''):\n",
|
|
|
|
+ " e1placeHolder = \"<http://www.archiviodistato.prato.it/accedi-e-consulta/aspoGT001/scheda\" + row['id'] + \"/E73_\" + entityCoords.code + \">\"\n",
|
|
|
|
+ " line = triple(e73placeHolder, refersCoords.prefix, e1placeHolder) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " line = triple(e1placeHolder, hasTypeCoords.prefix, entityCoords.prefix) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " line = triple(e1placeHolder, labelCoords.prefix, '\\\"' + row['scope-content_body'].replace('\"','') + '\\\"') + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " e55placeHolder = \"<http://www.archiviodistato.prato.it/accedi-e-consulta/aspoGT001/scheda\" + row['id'] + \"/\" + entityCoords.code + \"_\" + typeCoords.code + \">\"\n",
|
|
|
|
+ " line = triple(e1placeHolder, refersHasTypeCoords.prefix, e55placeHolder) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " line = triple(e55placeHolder, hasTypeCoords.prefix, typeCoords.prefix) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " line = triple(e55placeHolder, labelCoords.prefix, '\\\"Descrizione biglietto\\\"') + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " #E62 String - Physdesc\n",
|
|
|
|
+ " if(row['nota'] != ''):\n",
|
|
|
|
+ " e62placeHolder = \"<http://www.archiviodistato.prato.it/accedi-e-consulta/aspoGT001/scheda/\" + row['id'] + \"/E73_\" + stringCoords.code + \">\"\n",
|
|
|
|
+ " line = triple(e73placeHolder, hasNoteCoords.prefix, e62placeHolder) + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " line = triple(e62placeHolder, labelCoords.prefix, '\\\"' + row['nota'].replace('\"','')+ '\\\"') + closeLine\n",
|
|
|
|
+ " output.write(line)\n",
|
|
|
|
+ " line = triple(e62placeHolder, hasTypeCoords.prefix, stringCoords.prefix) + closeLine\n",
|
|
" output.write(line)\n",
|
|
" output.write(line)\n",
|
|
- "\n",
|
|
|
|
" output.write('\\n')\n",
|
|
" output.write('\\n')\n",
|
|
" #\n",
|
|
" #\n",
|
|
" #\n",
|
|
" #\n",
|
|
@@ -200,9 +345,12 @@
|
|
}
|
|
}
|
|
],
|
|
],
|
|
"metadata": {
|
|
"metadata": {
|
|
|
|
+ "interpreter": {
|
|
|
|
+ "hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
|
|
|
|
+ },
|
|
"kernelspec": {
|
|
"kernelspec": {
|
|
- "name": "python373jvsc74a57bd031f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6",
|
|
|
|
- "display_name": "Python 3.7.3 64-bit"
|
|
|
|
|
|
+ "display_name": "Python 3.7.3 64-bit",
|
|
|
|
+ "name": "python3"
|
|
},
|
|
},
|
|
"language_info": {
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"codemirror_mode": {
|
|
@@ -214,7 +362,7 @@
|
|
"name": "python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"pygments_lexer": "ipython3",
|
|
- "version": "3.7.3"
|
|
|
|
|
|
+ "version": "3.9.0"
|
|
},
|
|
},
|
|
"metadata": {
|
|
"metadata": {
|
|
"interpreter": {
|
|
"interpreter": {
|
|
@@ -224,4 +372,4 @@
|
|
},
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat": 4,
|
|
"nbformat_minor": 2
|
|
"nbformat_minor": 2
|
|
-}
|
|
|
|
|
|
+}
|