Working with RDF Databases

In addition to the ability to load and save models to files, TopBraid Composer also comes with database persistence. The main benefit of this is that much larger models with millions of triples can be maintained, without being constrained by memory limitations. Whether a model is stored in a database or in memory does not make a big difference to the system, i.e. essentially the same functionality is available in both cases. However, users of the database persistence should be aware of the following trade-offs:

TopBraid Composer has several different database back-ends (*.sdb, *.tdb and *.xdb)

Note that the database persistence described here relies on triple stores, i.e. custom tailored databases for RDF. If you are interested in connecting a legacy relational database with Composer, please have a look at the D2RQ plugin.

Creating a new database

If you want to create a RDBMS database project, you need to use File > New... > RDF Database in RDBMS.... This will open a wizard in which you can fill in the connection metadata including passwords etc.

This will create a file ending with .sdb and connect to the given database. Also notice that there is a check box to overwrite an existing database with the same name. Leave this box unchecked if you want to connect to an existing database that for example has been created with some other program. In such cases you should be aware though that TopBraid Composer does not automatically get notified if other programs or users access the same database.

 

Working with database projects

After you have created a database, the database connection settings are stored in a metadata file (*.sdb, *.oracle, *.sesan etc). For Composer, these files serve as a placeholder of the database URI. This means that each database metadata file declares the base URI of its content, and this base URI is used to resolve imports. As a result you can treat the metadata files like plain OWL or RDF files, import them, open them etc.

Once you open or import a database model, the system will build some caches. While building these caches may take a few seconds and the caches consume additional memory, they significantly accelerate the browsing performance down the road. If you - for one reason or another - do not want to use these caches, you can configure them in TopBraid Composer's Preferences.

In other ontology editors, changes by the user are immediately written into the database. This leads to several problems such as slow performance and poor control of what gets committed. Therefore, Composer has a different approach. Like in file mode, changes in the editor are not directly written to the underlying database, but kept in an in-memory buffer until the user decides to commit them. Therefore you need to make sure to press the Save button (or File > Save in the menu) to persist the changes into the database. This will flush the buffer in a single database transaction. This also allows users to run local modeling experiments with the database without ruining it.

If you want to save an existing file-based project into a database, or need to convert an existing database into a file, you can use the Export Wizard.