diff --git a/tetras_extraction/macao_12/script/templates/array.rq b/tetras_extraction/macao_12/script/templates/array.rq new file mode 100644 index 0000000000000000000000000000000000000000..9bc0ddd92cb0e45d9325357876ffa2d8cbd3a17b --- /dev/null +++ b/tetras_extraction/macao_12/script/templates/array.rq @@ -0,0 +1,11 @@ +PREFIX : <http://www.semanticweb.org/eliott/ontologies/2024/4/macao/> +PREFIX testtl: <http://www.semanticweb.org/eliott/test/> +PREFIX st: <http://ns.inria.fr/sparql-template/> + +template testtl:array(?qcu) { + format { '"%s"' ?html } +} +where { + ?qcu :aReponse ?choice . + ?choice :html ?html +} diff --git a/tetras_extraction/macao_12/script/templates/functions.rq b/tetras_extraction/macao_12/script/templates/functions.rq new file mode 100644 index 0000000000000000000000000000000000000000..65b0dffce170abc255d56e648b4298e3abf0a423 --- /dev/null +++ b/tetras_extraction/macao_12/script/templates/functions.rq @@ -0,0 +1,15 @@ +PREFIX : <http://www.semanticweb.org/eliott/ontologies/2024/4/macao/> +PREFIX testtl: <http://www.semanticweb.org/eliott/test/> +PREFIX st: <http://ns.inria.fr/sparql-template/> + +template st:profile {} +where {} + +function st:process(?x) { + # Format literals as text without quotes + if (isLiteral(?x), st:format("%s", ?x), st:turtle(?x)) +} + +function testtl:sep() { + st:format(",%s", st:nl()) +} \ No newline at end of file diff --git a/tetras_extraction/macao_12/script/templates/main.rq b/tetras_extraction/macao_12/script/templates/main.rq new file mode 100644 index 0000000000000000000000000000000000000000..c7ce4860dd7341da1b464460e02b2fedee3c17f3 --- /dev/null +++ b/tetras_extraction/macao_12/script/templates/main.rq @@ -0,0 +1,16 @@ +PREFIX : <http://www.semanticweb.org/eliott/ontologies/2024/4/macao/> +PREFIX testtl: <http://www.semanticweb.org/eliott/test/> +PREFIX st: <http://ns.inria.fr/sparql-template/> +PREFIX owl: <http://www.w3.org/2002/07/owl#> + +template { + ?id " -> " ?title +} +where { + ?subj a :ExerciceQC_QCU . + ?subj :id ?id + optional { + ?subj :titre ?title . + } +} + diff --git a/tetras_extraction/macao_12/script/templates/page.rq b/tetras_extraction/macao_12/script/templates/page.rq new file mode 100644 index 0000000000000000000000000000000000000000..109fc6c38a8688b65878e8723d1df29752048c45 --- /dev/null +++ b/tetras_extraction/macao_12/script/templates/page.rq @@ -0,0 +1,29 @@ +PREFIX : <http://www.semanticweb.org/eliott/ontologies/2024/4/macao/> +PREFIX testtl: <http://www.semanticweb.org/eliott/test/> +PREFIX st: <http://ns.inria.fr/sparql-template/> +PREFIX owl: <http://www.w3.org/2002/07/owl#> + +template { + "####### " + ?id + format { + """ ++++ +title = "%s" ++++ + +%s +""" + ?title + ?desc + } + "-------------------------------------------------------------------------" + st:call-template(testtl:quiz, ?subj) +} +where { + ?subj a :Page . + ?subj :id ?id . + ?subj :titre ?title . + ?subj :description ?desc +} + diff --git a/tetras_extraction/macao_12/script/templates/qcu.rq b/tetras_extraction/macao_12/script/templates/qcu.rq new file mode 100644 index 0000000000000000000000000000000000000000..5047c4a27c1c4c6bbff16d4e02b22b901fbe81c8 --- /dev/null +++ b/tetras_extraction/macao_12/script/templates/qcu.rq @@ -0,0 +1,30 @@ +PREFIX : <http://www.semanticweb.org/eliott/ontologies/2024/4/macao/> +PREFIX mt: <http://www.semanticweb.org/eliott/test/> +PREFIX st: <http://ns.inria.fr/sparql-template/> + +template mt:qcu(?qcu) { + '"name": "' ?id '"' mt:sep() + '"type": "radiogroup"' mt:sep() + '"choices": [' + # box { st:call-template(mt:qcu_choices, ?qcu) } + box { + group { + '"' ?html '"' + ; separator=mt:sep() + } + } + ']' mt:sep() + '"correctAnswer": "' ?correct_choice '"' +} +where { + # ?qcu a :ExerciceQC_QCU + ?qcu :id ?id . + optional { + ?qcu :aReponse ?cchoice . + ?cchoice :correct true + ?cchoice :text ?correct_choice . + + ?qcu :aReponse ?choice . + ?choice :text ?html + } +} diff --git a/tetras_extraction/macao_12/script/templates/qcu_choices.rq b/tetras_extraction/macao_12/script/templates/qcu_choices.rq new file mode 100644 index 0000000000000000000000000000000000000000..988ed9dd8227426aa6dc42997b1ffa9c9fbcbcfc --- /dev/null +++ b/tetras_extraction/macao_12/script/templates/qcu_choices.rq @@ -0,0 +1,14 @@ +PREFIX : <http://www.semanticweb.org/eliott/ontologies/2024/4/macao/> +PREFIX mt: <http://www.semanticweb.org/eliott/test/> +PREFIX st: <http://ns.inria.fr/sparql-template/> + +template mt:qcu_choices(?qcu) { + group { + '"' ?html '"' + ; separator=mt:sep() + } +} +where { + ?qcu :aReponse ?choice . + ?choice :text ?html +} diff --git a/tetras_extraction/macao_12/script/templates/quiz.rq b/tetras_extraction/macao_12/script/templates/quiz.rq new file mode 100644 index 0000000000000000000000000000000000000000..26dd97f119596bcab38fff83dc60f00e302e5459 --- /dev/null +++ b/tetras_extraction/macao_12/script/templates/quiz.rq @@ -0,0 +1,30 @@ +PREFIX : <http://www.semanticweb.org/eliott/ontologies/2024/4/macao/> +PREFIX testtl: <http://www.semanticweb.org/eliott/test/> +PREFIX st: <http://ns.inria.fr/sparql-template/> + +template testtl:quiz(?quiz) { + st:nl() + '{' + box { + '"elements": [' + box { + st:call-template(testtl:qcu, ?quiz) + } + ']' + } + '}' +# format { +# """ +# { +# "elements": [ +# %s +# ] +# } +# """ +# box { st:call-template(testtl:qcu, ?quiz) } +# } +} +where { + ?quiz :id ?id . +} +