Skip to content
Snippets Groups Projects
Commit d57054a0 authored by Eliott Sammier's avatar Eliott Sammier
Browse files

Activity title is now a functional property (only one value)

parent 08830290
Branches
No related tags found
No related merge requests found
......@@ -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 ;
......@@ -4930,8 +4929,7 @@
""" ;
: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,
......@@ -4977,8 +4975,7 @@
""" ;
: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,
......@@ -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,
......@@ -5194,8 +5190,7 @@
""" ;
: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,
......@@ -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,
......
......@@ -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):
......
......@@ -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"]))
......
......@@ -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,
......
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment