
Note on thesaurus management
Description of the procedure to add a concept
Description of the procedure for modifying a concept
Description of the procedure for deleting a concept
Description of the procedure to add a relationship
Description of the procedure for deleting a relationship
The Administration section of MDweb allows the administrator to manage thesauri, i.e., to create and import a thesaurus, modify the application’s thesaurus and delete a thesaurus. To begin with, it is important to distinguish between the two types of thesauri that can be used: external thesauri imported into MDweb and the application’s thesaurus which is created within the cataloging service.
A thesaurus is a controlled vocabulary consisting of a set of terms that represent concepts in a particular domain. These concepts are structured between themselves by semantic relationships: hierarchical links (generalization and specialization), synonymy, linked to, definition, etc. Each concept has a descriptor term that allows it to be be given a convenient name (because it is normally identified by a URI which is usually not very informative).
Terms in a thesaurus can be used to index documents, and that is how they are used in MDweb. The search for documents thus becomes easier by the use of thesauri.
The Add thesaurus section allows a new application thesaurus to be created1 or an external thesaurus to be imported2.

1 – Creating a thesaurus
A new thesaurus is created when a name is entered for it in the relevant field2 and the Submit3 button then clicked. The thesaurus is added to the relevant database and a confirmation message displayed. However, to use the newly created thesaurus as the application’s thesaurus, i.e., to be able to enrich it using MDweb’s thesaurus management tools, it is first necessary to update the ‘config.inc.thesaurus.php’ file in the config folder of the MDweb installation: replace the value of the $thésaurus_appli variable by the name of the thesaurus you have just created.
2 – Importing a thesaurus
It is possible to import a thesaurus in SKOS/RDF format on condition that the Jena Java library has first been installed. This open source library can be downloaded from http://jena.sourceforge.net/.
The Jena libraries
To run the thesaurus importation, all these Jena libraries are mandatories. They are all including in Jena version 2.5.x:
- antlr-2.7.5.jar
- arq.jar
- concurrent.jar
- iri.jar
- icu4j_3_4.jar
- json.jar
- junit.jar
- jenatest.jar
- log4j-1.2.12.jar
- commons-logging-1.1.jar
- xercesImpl.jar
- xml-apis.jar
- wstx-asl-3.0.0.jar
- stax-api-1.0.jar
To connect Jena to your thesaurus database, you should install a jdbc library for postgresql : pg73jdbc3-2001-08-20.jar (ou equivalent)
All libraries of Jena 2.5 and jdbc can be also download from http://www.mdweb-project.org/16/components/jena/
To run this batch file, you should verify if the path to java or javaw runtime is in your environment variable PATH.
Also, the ‘import_thésaurus.bat’ file (Windows) or the ‘import_thésaurus.sh’ file (Linux) in the admin folder has to be correctly configured. The CP variable has to be updated with the correct paths to the Jena library. Then the --db parameter should be changed to indicate the address of the database server and the name of the thesaurus database (the name is the same as the $db_nom_thésaurus variable in the ‘config.inc.thésaurus.php’ file of the config folder). For example, the --db parameter will be:
--db jdbc:postgresql://localhost/thesaurus-fra
if localhost is the server address and the thesaurus database is thesaurus-fra.
Example of import_thesaurus.bat file
This example of import_thesaurus.bat allows to import a RDF_SKOS file in MDweb database called thesaurus-fra using the postgres user account postgres and password: postgres on localhost server:
@echo off
rem the librairies used come from Jena versions 2.5.x
set CP="C:/Jena/lib/pg73jdbc3-2001-08-20.jar";"C:/Jena/lib/antlr-2.7.5.jar";"C:/Jena/lib/arq.jar";"C:/Jena/lib/concurrent.jar";"C:/Jena/lib/iri.jar";"C:/Jena/lib/icu4j_3_4.jar";"C:/Jena/lib/jena.jar";"C:/Jena/lib/jenatest.jar";"C:/Jena/lib/json.jar";"C:/Jena/lib/junit.jar";"C:/Jena/lib/log4j-1.2.12.jar";"C:/Jena/lib/commons-logging-1.1.jar";"C:/Jena/lib/xercesImpl.jar";"C:/Jena/lib/xml-apis.jar";:/Jena/lib/wstx-asl-3.0.0.jar";:/Jena/lib/stax-api-1.0.jar"
java -classpath %CP% -Djdbc.drivers=org.postgresql.Driver jena.dbcreate --db jdbc:postgresql://localhost/thesaurus-fra --dbUser postgres --dbPassword postgres -dbType PostgreSQL
java -classpath %CP% -verbose -Djdbc.drivers=org.postgresql.Driver jena.dbload --db jdbc:postgresql://localhost/thesaurus-fra --dbUser postgres --dbPassword postgres -dbType PostgreSQL %1
In this example, the Jena librairies are stored on the folder C:/Jena/lib/
Once these conditions are met, the thesaurus is imported by choosing the SKOS/RDF file containing the thesaurus4, giving the thesaurus a name so that it can be created in the database5 and choosing the import language6, and then clicking Submit7. Depending on the size of the thesaurus, the operation may last a long time. A confirmation message is displayed once the thesaurus is successfully imported.
Managing the application’s thesaurus

The Modify a thesaurus1 section allows the administrator to manage the application’s thesaurus and modify concepts and relationships contained in it. Remember, you should not confuse the thesaurus of the cataloging service with reference thesauri such as Agrovoc, Gemet, etc.; this sub-module operates only on the cataloging service’s own thesaurus.
a) Adding concepts
It is possible to add new concepts to the application’s thesaurus to enrich it. These concepts can originate from the included reference thesauri or created from scratch. The administrator uses a term to designate the concept that he wants to add. The auto-complete feature helps him by showing matching concepts in the reference thesauri. Once the concept is chosen, he can modify some of its properties. The view of the thesaurus’s tree structure is used to verify that the new concept was added correctly.
1 – Choose to ‘Add a concept’.

2 – Choose a term that you want to add

3 – From amongst those offered, choose the concept that you want to import into the thesaurus or choose to create a new concept.

4 – Select the type of concept to add (thematic, temporal or spatial). If the chosen type is ‘spatial’, the geographic layer associated with the concept will have to be specified. The thesaurus is displayed on the right in its current state.

5 – A message confirms that the concept was correctly added to the database and we can see the term, in red, in the thesaurus and its description on the right.
b) Modifying concepts
The facility for modifying concepts allows the administrator to modify a concept’s properties (concept type, status, name of the associated layer, etc.). In a manner similar to that for adding a concept, the administrator selects a concept using the auto-complete feature which, here, shows terms only from the application’s thesaurus.
1 – Choose to ‘update a concept’ and select the concept by its term.

2 – You can modify the properties of the selected concept: type, layer name (if the concept is spatial) and status. As for the addition of a concept, we can see the thesaurus’s tree structure and the compete description of the concept on the right.
²
3 – A message confirms the modification.
ICI
c) Deleting concepts
Finally, the administrator can delete concepts as long as they are not being used to reference any metadata record. In a manner similar to that of modifying a concept, he chooses the concept with the help of the auto-complete feature. The concept and all its relationships are deleted from the thesaurus. The thesaurus’s tree structure changes to reflect the deletion.
1 – Choose to ‘Delete a concept’ and designate the concept by its term.

2 –Select the concept you want to delete.

3 – You are asked for confirmation before deletion.

4 – A message confirms the deletion from the database (or indicates the failure of the deletion because the concept is indexing a metadata record).
Each concept has several different relationships that link it to other concepts or provide sundry information. To add, modify or delete a relationship, one must first select the concerned concept. We use the auto-complete feature, as described above in the ‘Managing concepts’ section, to do so.
a) Adding relationships
A relationship can be described by a <subject, predicate, objet> triplet. The subject is the concept that we have chosen, the predicate is the type of relationship and the object is the target concept, a literal, etc. To add a relationship to a concept, the administrator first has to select the type of relationship. A drop-down list shows him all available relationship types (based on the SKOS thesaurus description language) and allows him to choose one. Depending on the selected relationship type, a field appears in which he has to specify the object of the relationship.
1 – Choose to ‘Add a relationship’ and select the concerned concept by its term.

2 – Select the relationship type. On the right, we can see the thesaurus’s tree structure with the concerned concept in red with its current properties.

3 – For each different relationship type, a different Object field will be displayed. Fill it and click ‘Add’ to validate the new relationship. A confirmation message will appear.
b) Modifying relationships
A relationship can always be modified. The administrator has to select the concept and then the concerned relationship. The value of the object can then be modified. The procedure to modify a relationship is similar to that for adding one. If the modification concerns a hierarchy relationship, the thesaurus’s tree structure automatically reflects the change, which can be verified by its display.
c) Deleting relationships
And, finally, it is possible to delete a particular relationship of a concept, except the relationship relating to the concept’s descriptor term (a concept should always retain the term that designates it). In the same way as for modifying a relationship, the administrator chooses the concept and then the concerned relationship. After seeking confirmation, MDweb deletes the relationship. If it was a hierarchy relationship, the thesaurus’s tree structure is reconstructed.
1 – Choose to ‘Delete a relationship’ and select the concerned concept by its term.

2 – Choose the relationship to delete from those available 1. A message seeks confirmation for the deletion 2.

The Delete a thesaurus1 section can be used to delete a thesaurus from the database2. Select the thesaurus to delete from the list and confirm deletion3. Note: if the thesaurus being used as the application thesaurus is deleted, the ‘config.inc.thesaurus.php’ file in the config folder will have to be updated ($thesaurus_appli and $lang_thesaurus_appli variables).

Contacts

IRD / ESPACE unit (US 140)
500, rue Jean François Breton, 34093 Montpellier Cedex 05, France
TEL: +33 (0)4 67 54 87 02
J.C Desconnets jcd@teledetection.fr
MDweb project site: www.mdweb-project.org
Online demo: demo16.mdweb-project.org