diff --git a/tetras_extraction/macao_12/result/macao_content.ttl b/tetras_extraction/macao_12/result/macao_content.ttl index 6f736b15623faae540d15ac21439bd82abffb11d..27bc09373ba6466d9742b83a553786ae99256803 100644 --- a/tetras_extraction/macao_12/result/macao_content.ttl +++ b/tetras_extraction/macao_12/result/macao_content.ttl @@ -435,7 +435,7 @@ :pg288 a :Cours, :Page, owl:NamedIndividual ; - rdfs:label "Mémento : l'accentuation des syllabes (2)" ; + rdfs:label "Mémento : l'accentuation des syllabes (2)" ; :__protege_display_name "12 | pg288 | Mémento : l'accentuation des syllabes (2)" ; :commentaireInfo """<div id="divCmt1" onclick="SPE_clicDansBulle(event,'1')"><p align=""><b><br><br><br><br>La voyelle</b></p> <p align="">La voyelle se caractérise par la vibration des cordes vocales, alors que la consonne n'existe pas @@ -461,8 +461,7 @@ """ ; :id "pg288" ; :index 12 ; - :titre "Mémento : l'accentuation des syllabes (2)", - "Mémento : l'accentuation des syllabes (2)" ; + :titre "Mémento : l'accentuation des syllabes (2)" ; rdfs:subClassOf :MosEtp129 . :pg293q0 a :Reponse ; @@ -4884,7 +4883,7 @@ :pg112 a :ExerciceQC_QCM, :Page, owl:NamedIndividual ; - rdfs:label "Choisir l'accentuation adéquate (2)" ; + rdfs:label "Choisir l'accentuation adéquate (2)" ; :__protege_display_name "08 | pg112 | Choisir l'accentuation adéquate (2)" ; :aReponse :pg112q0, :pg112q1, @@ -4930,14 +4929,13 @@ """ ; :id "pg112" ; :index 8 ; - :titre "Choisir l'accentuation adéquate (2)", - "Choisir l'accentuation adéquate (2)" ; + :titre "Choisir l'accentuation adéquate (2)" ; rdfs:subClassOf :MosEtp746 . :pg228 a :ExerciceQC_QCM, :Page, owl:NamedIndividual ; - rdfs:label "Choisir l'accentuation adéquate (4)" ; + rdfs:label "Choisir l'accentuation adéquate (4)" ; :__protege_display_name "10 | pg228 | Choisir l'accentuation adéquate (4)" ; :aReponse :pg228q0, :pg228q1, @@ -4977,14 +4975,13 @@ """ ; :id "pg228" ; :index 10 ; - :titre "Choisir l'accentuation adéquate (4)", - "Choisir l'accentuation adéquate (4)" ; + :titre "Choisir l'accentuation adéquate (4)" ; rdfs:subClassOf :MosEtp746 . :pg293 a :ExerciceQC_QCM, :Page, owl:NamedIndividual ; - rdfs:label "Choisir l'accentuation adéquate (5)" ; + rdfs:label "Choisir l'accentuation adéquate (5)" ; :__protege_display_name "11 | pg293 | Choisir l'accentuation adéquate (5)" ; :aReponse :pg293q0, :pg293q1, @@ -5031,8 +5028,7 @@ """ ; :id "pg293" ; :index 11 ; - :titre "Choisir l'accentuation adéquate (5)", - "Choisir l'accentuation adéquate (5)" ; + :titre "Choisir l'accentuation adéquate (5)" ; rdfs:subClassOf :MosEtp746 . :pg6121 a :ExerciceQC_QCM, @@ -5149,7 +5145,7 @@ :pg71 a :ExerciceQC_QCM, :Page, owl:NamedIndividual ; - rdfs:label "Choisir l'accentuation adéquate (6)" ; + rdfs:label "Choisir l'accentuation adéquate (6)" ; :__protege_display_name "12 | pg71 | Choisir l'accentuation adéquate (6)" ; :aReponse :pg71q0, :pg71q1, @@ -5194,14 +5190,13 @@ """ ; :id "pg71" ; :index 12 ; - :titre "Choisir l'accentuation adéquate (6)", - "Choisir l'accentuation adéquate (6)" ; + :titre "Choisir l'accentuation adéquate (6)" ; rdfs:subClassOf :MosEtp746 . :pg740 a :ExerciceQC_QCM, :Page, owl:NamedIndividual ; - rdfs:label "Choisir l'accentuation adéquate (3)" ; + rdfs:label "Choisir l'accentuation adéquate (3)" ; :__protege_display_name "09 | pg740 | Choisir l'accentuation adéquate (3)" ; :aReponse :pg740q0, :pg740q1, @@ -5251,8 +5246,7 @@ """ ; :id "pg740" ; :index 9 ; - :titre "Choisir l'accentuation adéquate (3)", - "Choisir l'accentuation adéquate (3)" ; + :titre "Choisir l'accentuation adéquate (3)" ; rdfs:subClassOf :MosEtp746 . :MosEtp335 a :SousPartie, diff --git a/tetras_extraction/macao_12/script/common.py b/tetras_extraction/macao_12/script/common.py index fbdc7e32b9b4dc1a7aba23328af5d8f53cf466c5..83512e85181b9933c1f7660f4ede92804f320032 100644 --- a/tetras_extraction/macao_12/script/common.py +++ b/tetras_extraction/macao_12/script/common.py @@ -61,10 +61,10 @@ def insert_grow(l: list, index: int, value: Any, fill_value: Optional[Any] = Non l[index] = value -def add_title(g: Graph, subject: URIRef, title: str): +def set_title(g: Graph, subject: URIRef, title: str): """Add triples to define the `subject`'s title and label""" - g.add((subject, RDFS.label, Literal(title))) - g.add((subject, NS["titre"], Literal(title))) + g.set((subject, RDFS.label, Literal(title))) + g.set((subject, NS["titre"], Literal(title))) def add_index(g: Graph, subject: URIRef, index: int): diff --git a/tetras_extraction/macao_12/script/extract.py b/tetras_extraction/macao_12/script/extract.py index 0461cfe25b30323801e2f126aef65a6f29975965..34ff07826ab8e0c4e48b8e8833292e425713a5b9 100644 --- a/tetras_extraction/macao_12/script/extract.py +++ b/tetras_extraction/macao_12/script/extract.py @@ -96,7 +96,7 @@ def parse_manifest_rec( # Declare RDF resource and simple properties subject = NS[id] graph.add((subject, RDF.type, OWL.NamedIndividual)) - add_title(graph, subject, str(title)) + set_title(graph, subject, str(title)) if id.startswith("MosMod"): # It's a Module: graph.add((subject, RDF.type, NS["Module"])) diff --git a/tetras_extraction/macao_12/script/extract_mosetp.py b/tetras_extraction/macao_12/script/extract_mosetp.py index 2c9d0088799d6e8bfda23c388e8bd2680dd33021..a68e45f9cc245962fa47b68f05deaca6e54546b1 100644 --- a/tetras_extraction/macao_12/script/extract_mosetp.py +++ b/tetras_extraction/macao_12/script/extract_mosetp.py @@ -24,7 +24,7 @@ def generate_triples( graph.add((page, RDF.type, OWL.NamedIndividual)) graph.add((page, RDF.type, NS["Page"])) graph.add((page, NS["id"], Literal(page_id))) - add_title(graph, page, page_title) + set_title(graph, page, page_title) add_index( graph, page, diff --git a/tetras_extraction/macao_12/script/extract_page.py b/tetras_extraction/macao_12/script/extract_page.py index 6d525f33010dc496cfa0b17684271b0d9503ce0a..a586f6319df094d751218a5d45e00661b1c5709f 100644 --- a/tetras_extraction/macao_12/script/extract_page.py +++ b/tetras_extraction/macao_12/script/extract_page.py @@ -52,7 +52,7 @@ class Activity: # => Type graph.add((self.ref, RDF.type, NS[self.get_name()])) # => Title - graph.add((self.ref, NS["titre"], Literal(self.title))) + set_title(graph, self.ref, self.title) # => Description description = self.description or "" if self.comment_consigne is not None: