From 6afb3d99ddc3050af6991fc15f1fef1c5839fa5f Mon Sep 17 00:00:00 2001 From: daxid <david.rouquet@tetras-libre.fr> Date: Tue, 14 Jan 2025 17:08:25 +0100 Subject: [PATCH] fix comments --- tetras_extraction/script/src/extract_page.py | 2 ++ tetras_extraction/script/src/transform.py | 4 ++-- tetras_extraction/script/templates/activite.rq | 2 -- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tetras_extraction/script/src/extract_page.py b/tetras_extraction/script/src/extract_page.py index 23f85f1..67e2216 100644 --- a/tetras_extraction/script/src/extract_page.py +++ b/tetras_extraction/script/src/extract_page.py @@ -334,6 +334,8 @@ class ExerciceTAT(Exercice): graph.add((NS[self.id], NS["aSegment"], segment_uri)) graph.add((segment_uri, RDF.type, NS["Segment"])) graph.add((segment_uri, NS["index"], Literal(index))) + graph.add((segment_uri, RDFS.label, Literal(rdf_name))) + if isinstance(segment, str): graph.add((segment_uri, NS["html"], Literal(segment))) else: diff --git a/tetras_extraction/script/src/transform.py b/tetras_extraction/script/src/transform.py index 460a099..11cc963 100644 --- a/tetras_extraction/script/src/transform.py +++ b/tetras_extraction/script/src/transform.py @@ -85,11 +85,11 @@ def postEditMD(str): ################################################### # First for the words supporting the comments regexANCHOR = re.compile(r"@ANCHORSTART@(.)@(.*?)@ANCHOREND") - str = regexANCHOR.sub(r"<span commentaireInfoId='\1'>\2</span>", str) + str = regexANCHOR.sub(r"<span spanId='\1'>\2</span>", str) # For the comments themselves if '@COMMENTIDSTART' in str : - str = str.replace('@COMMENTIDSTART@','<div class="commentaireInfo" id="').replace('@COMMENTIDEND','">') + '</div>' + str = str.replace('@COMMENTIDSTART@','<div class="commentaireInfo" commentaireId="').replace('@COMMENTIDEND','">') + '</div>' ################################################### diff --git a/tetras_extraction/script/templates/activite.rq b/tetras_extraction/script/templates/activite.rq index f84a948..2d306b3 100644 --- a/tetras_extraction/script/templates/activite.rq +++ b/tetras_extraction/script/templates/activite.rq @@ -17,9 +17,7 @@ template mt:activite(?act) { '<div class="commentaireInfoGroup" hidden="True">' st:nl() group { - '<div class="commentaireInfo">' st:nl() ?info_comment - '</div>' st:nl() } '</div>' st:nl() -- GitLab