From ea27b0de9beba17d9f53fac21839b253fd0899ac Mon Sep 17 00:00:00 2001
From: Philipp Schneider <schneider.philipp@uni-muenster.de>
Date: Wed, 5 Apr 2023 14:17:35 +0200
Subject: [PATCH] Add class TextualRepresentation

---
 ...gital-heraldry-ontology-representation.ttl | 23 +++++++++++++------
 .../initial_ontology_definitions.py           |  2 +-
 src/rdf-mappings/map-tblArmItems.py           |  6 ++++-
 3 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/data/ontologies/digital-heraldry-ontology-representation.ttl b/data/ontologies/digital-heraldry-ontology-representation.ttl
index 27f04b1..7d58964 100644
--- a/data/ontologies/digital-heraldry-ontology-representation.ttl
+++ b/data/ontologies/digital-heraldry-ontology-representation.ttl
@@ -24,6 +24,14 @@
 #    Annotation properties
 #################################################################
 
+###  http://digitalheraldry.org/digital-heraldry-ontology/representation#textHasPrimaryTranscription
+dhor:textHasPrimaryTranscription rdf:type owl:AnnotationProperty ;
+                                 rdfs:comment "Primary Transcription of the text associated with a coat of arms"@en ;
+                                 rdfs:label "textHasPrimaryTranscription"@en ;
+                                 rdfs:range rdfs:Literal ;
+                                 rdfs:domain dhor:TextualTranskription .
+
+
 ###  http://purl.org/dc/terms/creator
 dcterms:creator rdf:type owl:AnnotationProperty .
 
@@ -166,16 +174,11 @@ dhor:partOfObject rdf:type owl:ObjectProperty ;
                   rdfs:label "partOfObject"@en .
 
 
-###  http://digitalheraldry.org/digital-heraldry-ontology/representation#textHasPrimaryTranscription
-dhor:textHasPrimaryTranscription rdf:type owl:ObjectProperty ;
-                                 rdfs:subPropertyOf dhor:textHasTranscription ;
-                                 rdfs:comment "Primary Transcription of the text associated with a coat of arms"@en ;
-                                 rdfs:label "textHasPrimaryTranscription"@en .
-
-
 ###  http://digitalheraldry.org/digital-heraldry-ontology/representation#textHasTranscription
 dhor:textHasTranscription rdf:type owl:ObjectProperty ;
                           rdfs:subPropertyOf owl:topObjectProperty ;
+                          rdfs:domain dhor:CoatOfArmsRepresentation ;
+                          rdfs:range dhor:TextualTranskription ;
                           rdfs:comment "Transcription of the text associated with the representation of a coat of arms"@en ;
                           rdfs:label "textHasTranscription"@en .
 
@@ -257,4 +260,10 @@ dhor:Shield rdf:type owl:Class ;
             rdfs:label "Shield"@en .
 
 
+###  http://digitalheraldry.org/digital-heraldry-ontology/representation#TextualTranskription
+dhor:TextualTranskription rdf:type owl:Class ;
+                          rdfs:comment "Written Text that is interpreted as belonging to a specific instance of a dhor:CoatOfArmsRepresentation"@en ;
+                          rdfs:label "TextualTranskription"@en .
+
+
 ###  Generated by the OWL API (version 4.5.9.2019-02-01T07:24:44Z) https://github.com/owlcs/owlapi
diff --git a/src/rdf-mappings/initial_ontology_definitions.py b/src/rdf-mappings/initial_ontology_definitions.py
index 7bf136e..e93b304 100644
--- a/src/rdf-mappings/initial_ontology_definitions.py
+++ b/src/rdf-mappings/initial_ontology_definitions.py
@@ -141,7 +141,7 @@ def create_initial_classes_and_properties_arm_items(g, dho_n):
     g.add((dho_n.mantlingPresent, RDFS.subPropertyOf, dho_n.hasTimbreAttribute))
 
     g.add((dho_n.coatOfArmsPresentedAs, RDF.type, OWL.ObjectProperty))
-    g.add((dho_n.textHasTranscription, RDF.type, OWL.ObjectProperty))
+    #g.add((dho_n.textHasTranscription, RDF.type, OWL.ObjectProperty))
 
 def create_initial_instances_arm_items(g, dho_data_n):
     """
diff --git a/src/rdf-mappings/map-tblArmItems.py b/src/rdf-mappings/map-tblArmItems.py
index b8be4bd..b8b5ed0 100644
--- a/src/rdf-mappings/map-tblArmItems.py
+++ b/src/rdf-mappings/map-tblArmItems.py
@@ -158,7 +158,11 @@ for index, row in df_tblArmItems.iterrows():
         g.add((description_event_node, DCTERMS.date, Literal(str(row['description_time']), datatype=XSD.date)))
 
     # Add textual transcription from source
-    g.add((coa_reference_node, dho_rep_n.textHasPrimaryTranscription, Literal(str(row['ArmTxt']))))
+    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((textual_transcription_node, dho_rep_n.textHasPrimaryTranscription, Literal(str(row['ArmTxt']))))
 
     ###################################
     # CoA identification
-- 
GitLab