Databases (*.sdb, *.tdb and *.xdb)

The TopBraid API for Apache Jena API provides some built-in RDF databases:

RDF Database in RDBMS

In this mode, TopBraid uses JDBC to connect to an external database, such as MySQL. TopBraid has built-in support MySQL, Oracle and SQL Server. Each database has a connection URL and user name and password. In order to connect to a database, TopBraid Composer stores all these connection settings in a file, ending with a .sdb suffix. These files are created by the wizards to create and export databases.

Note: The checkbox to overwrite an existing database must be activated for any new database in order to set up the SDB database tables.

IMPORTANT WARNING:

When opening an RDBMS database connector in TopBraid Composer, if there is an issue with the back-end relational database structure, it will throw the following exception: "SDB store is not formatted " If this exception is thrown, it means that the database schema has become corrupted and needs to be recreated. Recreating it is a matter of creating a new RDBMS graph in TBC and checking the reformat box. This is not a recoverable error.

 

Apache Jena TDB

TDB uses memory-mapped files to store data, and these files will reside in a sub-folder of the workspace. TDB provides very good scalability and native SPARQL support.

In the "Individual TDB" mode, TopBraid will store the TDB database files in a sub-folder [file name].data in the same folder as the .tdb file inside the workspace. This default location can be redirected though, by explicitly pointing to a different folder in the connection wizard. This also makes it possible to link to an existing TDB database outside of the Eclipse workspace root: you simply need to create a new Eclipse folder and use the Advanced settings to connect to an existing directory anywhere on your system. If you want to point to data folders in different projects, note that the path name needs to start with a slash, e.g. /MyProject/myTDB.tdb.data would point to the TDB in the myTDB.sdt.data folder inside the /MyProject Eclipse project. In this mode you can also use named graphs, allowing you to store multiple databases in the same physical store (see Dynamic Named graphs).

In the "Shared TDB" mode, TopBraid stores all data in a (typically inaccessible) folder under the workspace root. Each .xdb file represents one named graph within this single shared TDB repository.

 

Dynamic Named Graphs

TopBraid's RDBMS and TDB support includes dynamic named graphs. To use this feature, you need to create a connection for a default graph such as http://example.org/mysdb and the system will automatically map any graph that has the same beginning plus / plus a local graph name to named graphs stored in the same RDBMS or TDB. For example you can write a SPARQL query such as

    INSERT {
        GRAPH <http://example.org/mysdb/mygraph> {
            my:Instance my:property my:value .
        }
    }
    WHERE {
    }
	

to add triples to the named graph "mygraph" in the same database instance. There is no need to declare .sdb or .tdb connector files for any of those, and you can use as many graphs as you like. Note that you cannot directly open such named graphs unless they do have a connector, but the main use case is via SPARQL, for example from SPARQLMotion scripts or SPARQL Web Pages.