Skip to content
Snippets Groups Projects
Commit c2d73d30 authored by Philipp Schneider's avatar Philipp Schneider
Browse files

Rename variable to better align with names in ontology

parent 9d996f52
No related branches found
No related tags found
No related merge requests found
......@@ -106,23 +106,23 @@ if mapping_config['initial_instance_definitions'] != None:
# Iterate through CSV to build graph
for index, row in df_tblArmItems.iterrows():
# Create node for coat of arms reference
coa_reference_node = URIRef(dho_rep_n + 'MS' + str(row['ArmCode']) + '-' + str(int(row['ArmItemID'])))
g.add((coa_reference_node, RDF.type, dho_rep_n.CoatOfArmsRepresentation))
g.add((coa_reference_node, RDF.type, OWL.NamedIndividual))
# Create node for coat of arms representation
coa_representation_node = URIRef(dho_rep_n + 'MS' + str(row['ArmCode']) + '-' + str(int(row['ArmItemID'])))
g.add((coa_representation_node, RDF.type, dho_rep_n.CoatOfArmsRepresentation))
g.add((coa_representation_node, RDF.type, OWL.NamedIndividual))
g.add((coa_reference_node, dho_rep_n.hasOMAArmItem, Literal(str(int(row['ArmItemID'])), datatype=XSD.string)))
g.add((coa_representation_node, dho_rep_n.hasOMAArmItem, Literal(str(int(row['ArmItemID'])), datatype=XSD.string)))
if not pd.isnull(row['ItemNr']):
g.add((coa_reference_node, dho_rep_n.hasItemID, Literal(int(row['ItemNr']))))
g.add((coa_representation_node, dho_rep_n.hasItemID, Literal(int(row['ItemNr']))))
g.add((coa_reference_node, dho_rep_n.folioNumber, Literal(str(row['FolNr']))))
g.add((coa_representation_node, dho_rep_n.folioNumber, Literal(str(row['FolNr']))))
# Create description event
description_event_node = URIRef(dho_rep_n + str(uuid.uuid4()))
g.add((description_event_node, RDF.type, dho_rep_n.CoADescriptionAct))
g.add((description_event_node, RDF.type, OWL.NamedIndividual))
g.add((coa_reference_node, dho_rep_n.hasDescriptionAct, description_event_node))
g.add((coa_representation_node, dho_rep_n.hasDescriptionAct, description_event_node))
# Link coat of arms reference to coat of arms description
coa_id = str(row['BranchIDR'])
......@@ -131,8 +131,8 @@ for index, row in df_tblArmItems.iterrows():
if row['checked_for_publication'] == True and ( row['descriptor_id'] == int(2) or pd.isnull(row['descriptor_id']) ):
person_uri = URIRef(dho_data_n + 'Philipp-Schneider')
g.add((coa_reference_node, dho_rep_n.hasPrimaryDescriptionAct, description_event_node))
g.add((coa_reference_node, dho_rep_n.hasPrimaryBlazon, coa_node))
g.add((coa_representation_node, dho_rep_n.hasPrimaryDescriptionAct, description_event_node))
g.add((coa_representation_node, dho_rep_n.hasPrimaryBlazon, coa_node))
add_data_to_description_event(description_event_node, coa_node, row, person_uri)
elif row['descriptor_id'] == int(1) or pd.isnull(row['descriptor_id']):
......@@ -140,7 +140,7 @@ for index, row in df_tblArmItems.iterrows():
add_data_to_description_event(description_event_node, coa_node, row, person_uri)
if (coa_reference_node, dho_rep_n.hasPrimaryDescriptionAct, None) not in g:
if (coa_representation_node, dho_rep_n.hasPrimaryDescriptionAct, None) not in g:
if row['checked_for_publication'] == True:
primary_person_uri = URIRef(dho_data_n + 'Philipp-Schneider')
......@@ -149,13 +149,13 @@ for index, row in df_tblArmItems.iterrows():
g.add((primary_description_event_node, RDF.type, dho_rep_n.CoADescriptionAct))
g.add((primary_description_event_node, RDF.type, OWL.NamedIndividual))
g.add((coa_reference_node, dho_rep_n.hasPrimaryDescriptionAct, primary_description_event_node))
g.add((coa_reference_node, dho_rep_n.hasPrimaryBlazon, coa_node))
g.add((coa_representation_node, dho_rep_n.hasPrimaryDescriptionAct, primary_description_event_node))
g.add((coa_representation_node, dho_rep_n.hasPrimaryBlazon, coa_node))
add_data_to_description_event(primary_description_event_node, coa_node, row, primary_person_uri)
else:
g.add((coa_reference_node, dho_rep_n.hasPrimaryDescriptionAct, description_event_node))
g.add((coa_reference_node, dho_rep_n.hasPrimaryBlazon, coa_node))
g.add((coa_representation_node, dho_rep_n.hasPrimaryDescriptionAct, description_event_node))
g.add((coa_representation_node, dho_rep_n.hasPrimaryBlazon, coa_node))
# elif pd.isnull(row['descriptor_id']):
# person_uri = URIRef(dho_data_n + 'Philipp-Schneider')
......@@ -167,7 +167,7 @@ for index, row in df_tblArmItems.iterrows():
textual_transcription_node = URIRef(dho_rep_n + str(uuid.uuid4()))
g.add((textual_transcription_node, RDF.type, dho_rep_n.TextualTranskription))
g.add((textual_transcription_node, RDF.type, OWL.NamedIndividual))
g.add((coa_reference_node, dho_rep_n.textHasTranscription, textual_transcription_node))
g.add((coa_representation_node, dho_rep_n.textHasTranscription, textual_transcription_node))
g.add((textual_transcription_node, dho_rep_n.textHasPrimaryTranscription, Literal(str(row['ArmTxt']))))
###################################
......@@ -181,10 +181,10 @@ for index, row in df_tblArmItems.iterrows():
# identification_event_node = URIRef(dho_rep_n + str(uuid.uuid4()))
# g.add((identification_event_node, RDF.type, dho_ent_n.CoAIdentificationAct))
# g.add((identification_event_node, RDF.type, OWL.NamedIndividual))
# g.add((coa_reference_node, dho_ent_n.hasIdentificationAct, identification_event_node))
# g.add((coa_representation_node, dho_ent_n.hasIdentificationAct, identification_event_node))
#g.add((identification_event_node, dho_ent_n.attributesCoATo, identified_entity))
#g.add((coa_reference_node, dho_ent_n.hasPrimaryIdentification, identified_entity))
#g.add((coa_representation_node, dho_ent_n.hasPrimaryIdentification, identified_entity))
# Link identification to Steen Clemmensen (since data transformation only concerns his coa identifications)
# person_uri = URIRef(dho_data_n + 'Steen-Clemmensen')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment