Commit 1e02a0cc authored by bascouba's avatar bascouba

Merge branch 'master' of https://gitlab.utc.fr/crozatst/hdoc

parents 0d17ae4d 9491819a
......@@ -31,22 +31,40 @@ This project can be used alone if you want to import an HDOC file into basex.
- User can get examples whose titles contain a keyword
Step by step :
[Step 1 : File transformation]
[`Step 1 : File transformation`]
- Put the files .hdoc you want to deal with in the folder [input](https://gitlab.utc.fr/crozatst/hdoc/tree/master/hdoc_to_basex/input)
- Run the transformation progam (Win : double click run.bat, Linux : execute run.sh)
- This transformation includes :
* Title, authors, keywords
* First Level section : title, type
[Step 2 : Create data base in basex]
[`Step 2 : Create data base in basex`]
- Download and install [BaseX](http://basex.org/products/download/all-downloads/)
- Run BasexGui
- In the Text Editor of BaseX, open the command script "createbd.bxs" in folder [`basex/command`](https://gitlab.utc.fr/crozatst/hdoc/tree/master/hdoc_to_basex/basex/command).
Follow the instructions in the script, and then execute it.
- In the Text Editor of BaseX, open the command script "createbd.bxs" in folder [`command`](https://gitlab.utc.fr/crozatst/hdoc/tree/master/hdoc_to_basex/basex/command).
Follow the instructions in the script, and then execute it.
[Step 3 : Make XQuery request]
- In the Text Editor of BaseX, you can open and execute xquery script "main.xq" in folder [`basex/xquery`](https://gitlab.utc.fr/crozatst/hdoc/tree/master/hdoc_to_basex/basex/xquery).
[`Step 3 : Make XQuery request`]
- In the Text Editor of BaseX, you can open and execute xquery script "main.xq" in folder [`xquery`](https://gitlab.utc.fr/crozatst/hdoc/tree/master/hdoc_to_basex/basex/xquery).
It's in this main module that we call predefined functions and execute script
- .xqm files are library modules where we have defined functions, we can go to these files for more detailed using instructions
Available library modules :
* searchDocByAuthor.xqm
* searchDocByTitle.xqm
* searchDocByTitle.xqm
\ No newline at end of file
* searchSectionByTitle.xqm
## TODO List
------------------
- xlst Transformation :
* texts of sections
* sub sections
* exercices
* resources : images, ...
- XQuery requests :
* Search keywords in text
* Search sub sections by keywords in their titles
* Search exercices by keywords in their titles
\ No newline at end of file
......@@ -22,7 +22,7 @@ Dependance
----------
This project can be used alone if you only want to convert an HDOC into a Neo4j requests file.
This project can be used alone if you only want to convert an HDOC into a Neo4j requests file or directly insert data in neo4j local database.
User documentation
......@@ -34,11 +34,9 @@ You have to respect the following steps :
2 - Modifier le fichier config.json (dans le dossier node) avec la base de données locale et le mot de passe personnel (base publique à venir)
3 - En ligne de commande, executer "npm install" pour installer les packages nodes (en attendant une automatisation future de la tache)
3 - Lancer le fichier runWithNode (choisissez l'extension selon votre OS)
4 - Lancer le fichier runWithNode (choisissez l'extension selon votre OS)
5 - Admirez le graph créé avec neo4j dans votre navigateur (sur localhost:7474)
4 - Admirez le graph créé avec neo4j dans votre navigateur (sur localhost:7474)
Unsupported
......
......@@ -31,12 +31,12 @@
</xsl:template>
<!-- Traitement spécial pour les objectifs, ils ont parfois la même longueur -->
<xsl:template match="body/section/section/section[@data-hdoc-type='aims']">
<xsl:template match="body/section/section/section[@data-hdoc-type='aims' or @data-hdoc-type='synthesis']">
MERGE (i:<xsl:value-of select="./@data-hdoc-type"/> {title:"<xsl:value-of select="concat(./header/h1,' - ', parent::section/header/h1, ' (',string-length(.), ')')"/>"});
MATCH (l1 {title:"<xsl:value-of select="concat(./header/h1,' - ', parent::section/header/h1, ' (',string-length(.), ')')"/>"}), (l2 {title:"<xsl:value-of select="concat(parent::section/header/h1,' (',string-length(parent::section), ')')"/>"}) MERGE (l2)-[:LIEN]->(l1);
</xsl:template>
<xsl:template match="body/section/section/section[not(@data-hdoc-type='aims')]">
<xsl:template match="body/section/section/section[not(@data-hdoc-type='aims' or @data-hdoc-type='synthesis')]">
MERGE (i:<xsl:value-of select="./@data-hdoc-type"/> {title:"<xsl:value-of select="concat(./header/h1,' (',string-length(.), ')')"/>"});
MATCH (l1 {title:"<xsl:value-of select="concat(./header/h1,' (',string-length(.), ')')"/>"}), (l2 {title:"<xsl:value-of select="concat(parent::section/header/h1,' (',string-length(parent::section), ')')"/>"}) MERGE (l2)-[:LIEN]->(l1);
</xsl:template>
......
!tmp/.gitkeep
!input/.gitkeep
!output/.gitkeep
......@@ -67,6 +67,7 @@ You can use special rules in Freemind to personnalize your Scenari Module :
* **#question** : a MCQ
* **#singlechoicequestion** : a QCU
* **#choice-qcu** : an answer within a QCU
* **#list** : a list inside a paragraph, first node being the title and children being the content.
* **#solution** : a solution associated to a single choice within a QCU (matches an integer)
* **#choice-correct** : a correct answer within a MCQ
* **#choice-incorrect** : an incorrect answer within a MCQ
......
Converter hdoc_to_neo4j
-----------------------
The purpose of this converter is to obtain a file of Neo4j requests from .scar format.
License GPL3.0
--------------
http://www.gnu.org/licenses/gpl-3.0.txt
Credits
-------
* Alié Félix
* Routier Clément
Dependance
----------
This project can be used alone if you only want to convert a .scar into a Neo4j requests file or directly insert data in neo4j local database.
User documentation
------------------
You have to respect the following steps :
1 - Placer un ou plusieurs archives (format scar) dans le dossier input
2 - Modifier le fichier config.json (dans le dossier ../hdoc_to_neo4j/node) avec la base de données locale et le mot de passe personnel (base publique à venir)
3 - Lancer le fichier runWithNode (choisissez l'extension selon votre OS)
4 - Admirez le graph créé avec neo4j dans votre navigateur (sur localhost:7474)
Unsupported
-----------
Known bugs
----------
Todo
----
Technical notes
---------------
Capitalisation
--------------
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment