Introduction
GALILEI is a research and development platform in the field of information science.
Main classes
The main classes are:
A new application using the GALILEI platform should define a class inheriting from GGALILEIApp. This class will manage the plug-ins and their configurations. A global variable GALILEIApp is created.
To work on a given "world" (a given set of documents, users and profiles), the application should create a session through GALILEIApp.CreateSession. To delete the session, GALILEIApp.DeleteSession should be called.
The GSession is a complex class that inherits from several other classes that represent all the objects that are managed. These include :
- GKB represents the knowledge base. It is a root class (virtually) inherited by many of the parent classes of GSession (and all of the classes described below).
- GObjects<GDoc,hDocs> manages documents.
- GObjects<GTopic,hTopics> manages topics (clusters of documents).
- GObjects<GUser,hUsers> manages users.
- GObjects<GProfile,hProfiles> manages profiles (a user has multiple profiles).
- GObjects<GCommunity,hCommunities> manages communities (clusters of profiles).
- GClasses manages classes (hierarchy of documents).
- GSubjects manages subjects. A subject is an "ideal" group of documents and profiles. It is uses for validation purposes (to verify if the topics and communities computed are similar to groupings provided).
Pseudo-parameter
Several member methods, in particular in GSession (and parent classes), use a pseudo-parameter as first argument. This parameter, a constant pointer, is needed to differentiate different methods with the same name but working on different objects. Several constant variables are declared to be used as pseudo-parameter (pDoc, pProfile, etc.). The following code explains their usage:
Here, the method GObjects::GetNbObjs returns the number of objects of a given type (documents, users, profiles, etc.). The pseudo-parameter (pDoc, pUser, pProfile, etc.) specifies which type is concerned.
The choice to use a pseudo-paramter for several methods was motivated for programming constraints (since GSession inherits several types from the same template class, it is necessary to distinct the methods) and to ensure the coherence of the API.
Notifications
The GALILEI platform uses the notification mechanism provided by the R Core library through the inheritance of the R::RObject class.
The notifications are used by the GALILEI platform to communicate some events to modules (plug-ins, application, etc.). A typical example is to inform that the current description of a document is changed : a first notification will be emitted before its replacement to specify that the description will be deleted, and a second one will be emitted after the new description assignment to inform that a new description id added. Typically, a plug-in proposing a similarity measure will observe the second notification to know that all the measures concerning that particular document are outdated.
Several notifications are send by the objects at different moment. They are declared by a series of arrays:
- The tObjEvent enumeration that defines a list of possible events generated by the objects.
- Several arrays of notifications (hDocs, hProfiles, etc.) using tObjEvent as indexer.
GSession sends a notification GALILEI::hReInit each time it forces the computations on objects of a given type. An example is to force a new analysis of the documents. In this case, all their descriptions will be cleared and, rather than to send a notification for each document, the session send one notification.
GPlugInList sends also a notification GALILEI::hCurrentPlugIn each time a plug-in becomes its current one. This can be useful because plug-ins may have dependencies. For example, a measure plug-in computing a similarity between two documents may rely on a measure plug-in proposing a weighting schema for the document descriptions.
When programming modules, in particular plug-ins, developers should carefully choose the notifications to observe.
The following code defines a plug-in that will print information on the status of the descriptions of documents.
For safety raesons, the methods HandleAddDoc and HandleDelDoc verifies that the sender of the notification is a document.