{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Mocodo 4.2.6 loaded.\n" ] } ], "source": [ "%reload_ext mocodo\n", "from mocodo.magic import mocodo\n", "import mcd_mocodo as mcd" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "def generer_mcd(domaine:str, ga:bool=False,seed:float=1):\n", " \"\"\"\n", " Genère un graphe MCD à partir d'un domaine exprimé en MCD mocodo\n", "\n", " :param domaine: Le domaine exprimé en MCD mocodo\n", " :type domaine: str\n", " :param ga: Utiliser l'algorithme génétique pour arranger les entités, par défaut False\n", " :type ga: bool, optional\n", " :param seed: La graine pour le réarangement des entités, par défaut 1\n", " :type seed: float, optional\n", "\n", " \"\"\"\n", " return mocodo(f\"\"\"\n", " %mocodo --colors ocean -t arrange{\":algo=ga\" if ga else \"\"} --seed {seed} --detect_overlaps --select mcd\n", " {domaine}\n", " \"\"\")\n" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\tposseder\n", "\t\n", "\t0,1\n", "\t0,N\n", "\t0,N\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\tcreer\n", "\t\tdate_creation\n", "\t\n", "\t0,N\n", "\t0,N\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\tposer\n", "\t\n", "\t1,1\n", "\t0,N\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\tposer\n", "\t\n", "\t1,1\n", "\t0,N\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\tinviter\n", "\t\tdate_invitation\n", "\t\n", "\t0,N\n", "\t0,N\n", "\t0,N\n", "\t0,N\n", "\t0,N\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\tsignaler\n", "\t\n", "\t1,1\n", "\t0,N\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\tsignaler\n", "\t\n", "\t1,1\n", "\t0,N\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\tassigner\n", "\t\n", "\t1,1\n", "\t0,N\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\tutiliser\n", "\t\tdate_utilisation\n", "\t\n", "\t0,1\n", "\t0,N\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\trepondre\n", "\t\n", "\t0,1\n", "\t0,N\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\tacheter\n", "\t\tdate_d_achat\n", "\t\tdate_de_fin\n", "\t\n", "\t0,N\n", "\t0,N\n", "\t0,N\n", "\t0,N\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tlicence_medicale\n", "\tcle_medicale\n", "\t\n", "\tdate_utilisation\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tapprenant\n", "\tid_apprenant\n", "\t\n", "\tnom\n", "\tprenom\n", "\tdate_de_naissance\n", "\tclasse\n", "\test_actif\n", "\tpeut_faire_test\n", "\treponses_questionnaire\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tquestion_posee\n", "\tid_quest\n", "\t\n", "\tquestion\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tanonyme\n", "\tid\n", "\t\n", "\temail\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tdroit\n", "\tid_droit\n", "\t\n", "\tnb_profil_cree\n", "\tnb_user_invite\n", "\tpeut_modifier_profil\n", "\tpeut_supprimer_profil\n", "\tpeut_faire_activite\n", "\tpeut_faire_test\n", "\tpeut_consulter_hist_activite\n", "\tpeut_consulter_hist_test\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tcompte\n", "\tlogin\n", "\t\n", "\temail\n", "\tpassword\n", "\tetat\n", "\tdate_de_derniere_co\n", "\tnom\n", "\tprenom\n", "\tmobile\n", "\tdate_de_creation\n", "\tmoyen_paiement\n", "\test_connecte\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tprobleme_signale\n", "\tid_prob\n", "\t\n", "\tversion_de_l_application\n", "\tsupport\n", "\tdate du_signalement\n", "\tcommentaire\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tlicence\n", "\tcle\n", "\t\n", "\tdate_utilisation\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tquestionnaire\n", "\tid_questionnaire\n", "\t\n", "\tforme_rappel\n", "\tdisponibilite\n", "\treponses_questionnaire\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tabonnement\n", "\tnom_abonnement\n", "\t\n", "\tprix\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tpromotion\n", "\tcode\n", "\t\n", "\tdate_de_creation\n", "\tduree_reduction\n", "\treduction\n", "\tconditions\n", "\n", "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "generer_mcd(mcd.auth,seed=4)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\tdecrire\n", "\t\n", "\t0,N\n", "\t1,1\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\trealiser\n", "\t\tpoints_accordes\n", "\t\n", "\t0,N\n", "\t0,N\n", "\t1,1\n", "\t0,N\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\tdebloquer\n", "\t\tdate_debloquement\n", "\t\n", "\t0,N\n", "\t0,N\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\tposseder\n", "\t\n", "\t1,1\n", "\t0,N\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tfiche_pedagogique\n", "\tid_fiche\n", "\t\n", "\tcontenu\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tcompte\n", "\tlogin\n", "\t\n", "\temail\n", "\tpassword\n", "\tetat\n", "\tdate_de_derniere_co\n", "\tnom\n", "\tprenom\n", "\tmobile\n", "\tdate_de_creation\n", "\tmoyen_paiement\n", "\test_connecte\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tactivite\n", "\tid_activite\n", "\t\n", "\tconsigne\n", "\tdurée\n", "\tcaracteristiques ia\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\thistorique_activite\n", "\tid\n", "\t\n", "\tduree\n", "\tdate_de_realisation\n", "\tnote_difficulte\n", "\tnote_plaisir\n", "\tnote_concentration\n", "\tnote_duree\n", "\tactivite_proposee_par_algo\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tapprenant\n", "\tid_apprenant\n", "\t\n", "\tnom\n", "\tprenom\n", "\tdate_de_naissance\n", "\tclasse\n", "\test_actif\n", "\tpeut_faire_test\n", "\treponses_questionnaire\n", "\n", "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "generer_mcd(mcd.activites,seed=2)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\tetre\n", "\t\n", "\t0,N\n", "\t1,1\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\tetre\n", "\t\n", "\t0,N\n", "\t1,1\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\tcontenir\n", "\t\n", "\t0,N\n", "\t0,N\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\tetre\n", "\t\n", "\t0,N\n", "\t1,1\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tfiche_pedagogique\n", "\tid_fiche\n", "\t\n", "\tcontenu\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tRessource\n", "\tid_ress\n", "\t\n", "\ttitre\n", "\tdescription\n", "\tdate_de_publication\n", "\ttype\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tmot_cle\n", "\tmot\n", "\t\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tarticle\n", "\tid_article\n", "\t\n", "\tlien_vers_site_externe\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tvideo\n", "\tid_video\n", "\t\n", "\tlien_vers_site_externe\n", "\n", "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "generer_mcd(mcd.ressources,seed=2)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\tposseder\n", "\t\n", "\t1,1\n", "\t0,N\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\trealiser\n", "\t\n", "\t0,N\n", "\t0,N\n", "\t1,1\n", "\t0,N\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\tposseder\n", "\t\n", "\t1,1\n", "\t0,N\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\thistorique_test_pos\n", "\tid_entree\n", "\t\n", "\tduree\n", "\tscore\n", "\ttemps_de_reaction_moyen\n", "\tdate_de_realisation\n", "\tfont_utilisée\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tapprenant\n", "\tid_apprenant\n", "\t\n", "\tnom\n", "\tprenom\n", "\tdate_de_naissance\n", "\tclasse\n", "\test_actif\n", "\tpeut_faire_test\n", "\treponses_questionnaire\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tcompte\n", "\tlogin\n", "\t\n", "\temail\n", "\tpassword\n", "\tetat\n", "\tdate_de_derniere_co\n", "\tnom\n", "\tprenom\n", "\tmobile\n", "\tdate_de_creation\n", "\tmoyen_paiement\n", "\test_connecte\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\thistorique_test_medical\n", "\tid_entree_medical\n", "\t\n", "\tdate_realisation\n", "\tDeficit_phonologique\n", "\tDeficit_lexical\n", "\tDeficit_articulatoire\n", "\tDeficit_ortho_optique\n", "\tDeficit_visio_attentionnel\n", "\tDeficit_visio_spacial\n", "\tDeficit_visio motrice\n", "\tDeficit_attention/concentration\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\ttest_de_positionnement\n", "\tid_testpos\n", "\t\n", "\tconsigne\n", "\tcaracteristiques_ia\n", "\n", "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "generer_mcd(mcd.test,seed=3)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\trealiser\n", "\t\tpoints_accordes\n", "\t\n", "\t0,N\n", "\t0,N\n", "\t0,N\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\trealiser\n", "\t\n", "\t0,N\n", "\t0,N\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\tatteindre\n", "\t\n", "\t0,N\n", "\t0,N\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\tdebloquer\n", "\t\n", "\t0,N\n", "\t1,1\n", "\n", "\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\tdebloquer\n", "\t\n", "\t0,N\n", "\t1,1\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tactivite\n", "\tid_activite\n", "\t\n", "\tconsigne\n", "\tdurée\n", "\tcaracteristiques ia\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tcompte\n", "\tlogin\n", "\t\n", "\temail\n", "\tpassword\n", "\tetat\n", "\tdate_de_derniere_co\n", "\tnom\n", "\tprenom\n", "\tmobile\n", "\tdate_de_creation\n", "\tmoyen_paiement\n", "\test_connecte\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tapprenant\n", "\tid_apprenant\n", "\t\n", "\tnom\n", "\tprenom\n", "\tdate_de_naissance\n", "\tclasse\n", "\test_actif\n", "\tpeut_faire_test\n", "\treponses_questionnaire\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tdefi\n", "\tid_defi\n", "\t\n", "\tnom\n", "\tobjectif\n", "\tdate_limite\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tpalier\n", "\tid_palier\n", "\t\n", "\tnombre_de_points\n", "\n", "\n", "\n", "\n", "\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\t\n", "\t\n", "\tbadge\n", "\tid_badge\n", "\t\n", "\tnom\n", "\tdescription\n", "\timage\n", "\n", "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "generer_mcd(mcd.recompenses,seed=3)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "def generer_mmd(domaine:str):\n", " \"\"\"\n", " Genère un graphe Mermaid Crowfoot notation à partir d'un domaine exprimé en MCD mocodo.\n", " \n", " :param domaine: Le domaine exprimé en MCD mocodo\n", " :type domaine: str\n", " \"\"\"\n", "\n", " return mocodo(f\"\"\"\n", " %mocodo --colors ocean -t crow:mmd\n", " {domaine}\n", " \"\"\")\n", " " ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "\n", "
\n", "
\n", "\n", "\n", "mocodo_notebook/sandbox_erd_crow.mmd\n", "\n", "\n", "
\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "```mmd\n", "erDiagram\n", " licence {\n", " TEXT cle PK\n", " DATE date_utilisation\n", " }\n", " licence_medicale {\n", " TEXT cle_medicale PK\n", " DATE date_utilisation\n", " TYPE \n", " }\n", " promotion {\n", " TEXT code PK\n", " DATE date_de_creation\n", " NUMBER duree_reduction\n", " NUMBER reduction\n", " TEXT conditions\n", " }\n", " abonnement {\n", " TEXT nom_abonnement PK\n", " NUMBER prix\n", " TYPE \n", " }\n", " droit {\n", " TEXT id_droit PK\n", " NUMBER nb_profil_cree\n", " NUMBER nb_user_invite\n", " BOOL peut_modifier_profil\n", " BOOL peut_supprimer_profil\n", " BOOL peut_faire_activite\n", " BOOL peut_faire_test\n", " BOOL peut_consulter_hist_activite\n", " BOOL peut_consulter_hist_test\n", " }\n", " questionnaire {\n", " TEXT id_questionnaire PK\n", " TEXT forme_rappel\n", " TODO disponibilite\n", " TODO reponses_questionnaire\n", " }\n", " probleme_signale {\n", " TEXT id_prob PK\n", " TEXT version_de_l_application\n", " TEXT support\n", " DATE date_du_signalement\n", " TODO commentaire\n", " }\n", " question_posee {\n", " TEXT id_quest PK\n", " TEXT question\n", " }\n", " anonyme {\n", " TEXT id PK\n", " TEXT email\n", " }\n", " inviter {\n", " DATE date_invitation PK\n", " TYPE \n", " }\n", " creer {\n", " DATE date_creation PK\n", " }\n", " acheter {\n", " DATE date_d_achat PK\n", " DATE date_de_fin\n", " }\n", " historique_activite {\n", " TEXT id PK\n", " NUMBER duree\n", " DATE date_de_realisation\n", " NUMBER note_difficulte\n", " NUMBER note_plaisir\n", " NUMBER note_concentration\n", " NUMBER note_duree\n", " BOOL activite_proposee_par_algo\n", " NUMBER points_accordes\n", " }\n", " debloquer {\n", " DATE date_debloquement PK\n", " }\n", " palier {\n", " TEXT id_palier PK\n", " TEXT nombre_de_points\n", " }\n", " defi {\n", " TEXT id_defi PK\n", " TEXT nom\n", " TEXT objectif\n", " DATE date_limite\n", " }\n", " badge {\n", " NUMBER id_badge PK\n", " TEXT nom\n", " TEXT description\n", " BLOB image\n", " }\n", " mot_cle {\n", " TEXT mot PK\n", " }\n", " Ressource {\n", " TEXT id_ress PK\n", " TEXT titre\n", " TEXT description\n", " DATE date_de_publication\n", " TEXT type\n", " }\n", " video {\n", " TEXT id_video PK\n", " TEXT lien_vers_site_externe\n", " }\n", " article {\n", " TEXT id_article PK\n", " TEXT lien_vers_site_externe\n", " }\n", " test_de_positionnement {\n", " TEXT id_testpos PK\n", " TEXT consigne\n", " TEST caracteristiques_ia\n", " }\n", " historique_test_pos {\n", " TEST id_entree PK\n", " NUMBER duree\n", " NUMBER score\n", " NUMBER temps_de_reaction_moyen\n", " DATE date_de_realisation\n", " TEXT font_utilisee\n", " }\n", " historique_test_medical {\n", " TEXT id_entree_medical PK\n", " DATE date_realisation\n", " BOOL Deficit_phonologique\n", " BOOL Deficit_lexical\n", " BOOL Deficit_articulatoire\n", " BOOL Deficit_ortho_optique\n", " TEXT Deficit_visio_attentionnel\n", " BOOL Deficit_visio_spacial\n", " BOOL Deficit_visio_motrice\n", " BOOL Deficit_attention_concentration\n", " }\n", " apprenant {\n", " TEXT id_apprenant PK\n", " TEXT nom\n", " TEXT prenom\n", " DATE date_de_naissance\n", " TEXT classe\n", " BOOL est_actif\n", " BOOL peut_faire_test\n", " TODO reponses_questionnaire\n", " }\n", " compte {\n", " TEXT login PK\n", " TEXT email\n", " TEXT password\n", " TEXT etat\n", " DATE date_de_derniere_co\n", " TEXT nom\n", " TEXT prenom\n", " NUMBER mobile\n", " DATE date_de_creation\n", " TODO moyen_paiement\n", " BOOL est_connecte\n", " }\n", " fiche_pedagogique {\n", " TYPE id_fiche PK\n", " TYPE contenu\n", " }\n", " activite {\n", " TYPE id_activite PK\n", " TYPE consigne\n", " TYPE duree\n", " TYPE caracteristiques_ia\n", " }\n", " licence_medicale }o--o| apprenant: posseder2\n", " licence_medicale }o--o| droit: posseder2\n", " inviter }o..|| compte: DF\n", " inviter }o..|| compte: DF\n", " inviter }o..|| apprenant: DF\n", " inviter }o..|| droit: DF\n", " inviter }o..|| licence: DF\n", " compte }o--o| licence: utiliser\n", " compte }o--o| questionnaire: repondre\n", " creer }o..|| compte: DF\n", " creer }o..|| apprenant: DF\n", " acheter }o..|| compte: DF\n", " acheter }o..|| promotion: DF\n", " acheter }o..|| licence: DF\n", " acheter }o..|| abonnement: DF\n", " abonnement }o--|| droit: assigner\n", " question_posee }o--|| anonyme: poser\n", " question_posee }o--|| compte: poser\n", " probleme_signale }o--|| anonyme: signaler\n", " probleme_signale }o--|| compte: signaler\n", " historique_activite }o--|| compte: realiser\n", " historique_activite }o--|| activite: realiser\n", " historique_activite }o--|| apprenant: realiser\n", " debloquer }o..|| activite: DF\n", " debloquer }o..|| apprenant: DF\n", " historique_activite }o--|| apprenant: posseder\n", " fiche_pedagogique ||--o{ activite: decrire\n", " apprenant }o--o{ palier: atteindre\n", " apprenant }o--o{ defi: realiser\n", " defi ||--o{ badge: debloquer\n", " palier ||--o{ badge: debloquer\n", " mot_cle }o--o{ Ressource: contenir\n", " Ressource ||--o{ video: etre\n", " Ressource ||--o{ article: etre\n", " Ressource ||--o{ fiche_pedagogique: etre\n", " historique_test_pos }o--|| compte: realiser2\n", " historique_test_pos }o--|| test_de_positionnement: realiser2\n", " historique_test_pos }o--|| apprenant: realiser2\n", " historique_test_pos }o--|| apprenant: posseder\n", " historique_test_medical }o--|| apprenant: posseder\n", "\n", "```" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "generer_mmd(mcd.texte_complet)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def generer_types(domaine:str):\n", " \"\"\"\n", " Infère les types des attribut d'un domaine exprimé en MCD mocodo.\n", " \n", " :param domaine: Le domaine exprimé en MCD mocodo\n", " :type domaine: str\n", " \"\"\"\n", " return mocodo(f\"\"\"\n", " %mocodo -t create:types=TODO --select rw\n", " {domaine}\n", " \"\"\")\n", "\n", "def generer_mld(domaine:str):\n", " \"\"\"\n", " Genère un MLD textuel à partir d'un domaine exprimé en MCD mocodo.\n", " \n", " :param domaine: Le domaine exprimé en MCD mocodo\n", " :type domaine: str\n", " \"\"\"\n", " return mocodo(f\"\"\"\n", " %mocodo -t mld\n", " {domaine}\n", " \"\"\")" ] } ], "metadata": { "kernelspec": { "display_name": "venv", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.2" } }, "nbformat": 4, "nbformat_minor": 2 }