Previous Up Next

5  Importing and Exporting

Although it is possible to create objects from scratch as shown in Section 6, it is often useful that objects of the context reflect objects existing outside of Camelis contexts, i.e. files or parts of files residing in the file system or URLs (Section 5.1). Reciprocally it is also useful to make sets of objects be reflected by files, e.g. playlists for music or slide shows for pictures (Section 5.2). In addition to files, it is possible to import/export contexts (or parts of contexts) in order to share them with other users or applications (Section 5.3). Import and export commands are available from the menu File.

5.1  Importing Files and Directories

Directories, files, and URLs can be imported into a context by activating the menu command File > Import > Import file.... Directories and files can be specified as local path or as web locations. This command opens a dialog where a file or a directory must be selected, and that offers a few options: Once a file has been imported it becomes a registered source of the current context. The kind of files (and directories) that can be imported, and the way a set of objects is produced and logically described from these files, depend on the Camelis application, and more precisely on the chosen source modules. An example Camelis application is detailed in Section 9.

The effect of registering a new source can be seen as the top right little text entry contains the number of elementary updates that remain to be performed: the update count. When this count reaches 0, the navigation and extent windows are refreshed in order to reflect changes in the context. However it is possible to refresh these windows at any time by pushing the button Refresh.

The registered sources can be displayed as a dialog window by the menu command File > Import > List sources.... It contains the tree of source locations and a list of action buttons. A source is red-colored when its location does not exists anymore, and green-colored otherwise. The buttons have the following effect: Two shorthands for updating all sources are the menu command File > Import > Update all, and the button Update. The update count at the top right of the main window reflects the number of elementary updates to be performed.

5.2  Exporting Extents as Files

A set of objects can be exported as a file provided it is the extent of some query. Indeed it is more meaningful to specify an export by a query, i.e. a combination of features, than by an explicit set of objects. In this way each time an object appears or disappears from the extent of the query, the file is updated accordingly. For registering an export file, first set the current query to the desired one, then activate the menu command File > Export > Export file..., and select a path in the file system. This file is then registered as a well. The way a query extent is converted into a file depends on the Camelis application, and more precisely on the chosen well modules. An example Camelis application is detailed in Section 9.

The registered wells can be displayed as a dialog window by the menu command File > Export > List wells.... It contains the tree of wells (location and query) and a list of action buttons:

5.3  Importing and Exporting Contexts

As explained in Section 8 all elements of a context (objects, sources, wells, etc.) are saved in one large binary file. This makes it difficult to share data from one context to another. For instance if someone has spent time defining a taxonomy of terms with axioms (e.g. music genres), it may be useful to reuse it on different but similar data. This is solved by exporting and importing context data through textual files with extension .ctx.

These context files are simply lists of commands, one per line, and can convey any element of a context. These elements are separated in several categories: When importing or exporting in a context, any of these categories can be unselected in order to control what kind of data is shared. Another way to control the scope of exporting a context is the current query as only objects in the current extent are considered for the export of extrinsic data. These operations are available in the menu File.

In the case where the current query is all, and all categories are selected, the full context can be exported and regenerated by importing the context file in a new context. This is useful to transfer a context between 2 different Camelis applications or versions whose binary formats are incompatible.

There is also the command File > Export > Export context in Burmeister format that exports the context in a format that is readable by some FCA tools (e.g., ToscanaJ, ConExp). These tools can be used for instance to compute and draw concept lattices. The formal context that is exported is restricted to the objects in the current extent, and to the features that are selected in the navigation window.


Previous Up Next