|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DatabaseBuilder
Builder class for creating new Stardog databases. Provides the ability to configure the variety of options provided by memory or disk databases at creation time and to bulk load data into the database.
Please note that while memory indexes can be persisted to disk, this scheme is only recommended for small databases or prototypes. If you want a scalable, persistent database, you really ought to be using the disk database.
| Nested Class Summary | |
|---|---|
static interface |
DatabaseBuilder.DiskDatabaseBuilder
Disk database specific builder |
static interface |
DatabaseBuilder.MemDatabaseBuilder
In-Memory database specific builder |
| Method Summary | ||
|---|---|---|
ConnectionConfiguration |
create(File... theFiles)
Create the database using the parameters specified by this builder. |
|
ConnectionConfiguration |
create(Function<File,Resource> theContexts,
File... theFiles)
Create the database using the parameters specified by this builder. |
|
DatabaseBuilder |
durableTransactions(boolean theDurable)
Specify whether or not transactions for this database should be durable. |
|
DatabaseBuilder |
reporter(PrintStream theStream)
Sets the output used to print information messages about |
|
DatabaseBuilder |
searchable(boolean theSearchable)
Specify whether or not the database created by this builder should be searchable via Waldo. |
|
|
set(ConfigProperty<V> theOption,
V theValue)
Set the given option on this builder |
|
| Method Detail |
|---|
DatabaseBuilder reporter(PrintStream theStream)
output used to print information messages about
theStream - the output stream to use
DatabaseBuilder searchable(boolean theSearchable)
theSearchable - true to be searchable, false otherwise
DatabaseBuilder durableTransactions(boolean theDurable)
theDurable - true for durable transactions, false otherwise.
<V> DatabaseBuilder set(ConfigProperty<V> theOption,
V theValue)
V - the option typetheOption - the option to settheValue - the value
ConnectionConfiguration create(File... theFiles)
throws StardogException
Create the database using the parameters specified by this builder. Any files supplied to this function will be bulk loaded into the database as it is created. The data in the files will be loaded into the default graph unless the files are written in a format that supports named graphs such as Trig.
The connection context returned will contain the relevant information about database name and server URL to obtain a connection, but it will not contain any login credentials; they are not kept after login, so before connecting, you must add the proper credentials to the connection configuration before attempting to connect.
theFiles - optionally, the files to pre-load into the database
ConnectionConfiguration to connect to the new database
StardogException - if the database could not be created or if there was an error while performing the bulk load
ConnectionConfiguration create(Function<File,Resource> theContexts,
File... theFiles)
throws StardogException
Create the database using the parameters specified by this builder. Any files supplied to this function will be
bulk loaded into the database as it is created. The parameter theContexts can be used to specify a
context (named graph) for the triples loaded from a file. When the contents of a file is being loaded into the
database, if the file format supports named graphs (e.g. Trig) then the triples will be loaded into named graphs
as specified in the file. If the file format does not support named graphs (e.g. RDF/XML, Turtle, etc.) then the
theContexts mapping is used to find a target context for the triples loaded from that file. If the
mapping returns a null value then those triples will be loaded into the default graph without a
context.
The connection context returned will contain the relevant information about database name and server URL to obtain a connection, but it will not contain any login credentials; they are not kept after login, so before connecting, you must add the proper credentials to the connection configuration before attempting to connect.
theContexts - contains the mappings from a file to a context (named graph) that will be used as the target context
for the triples read from that filetheFiles - optionally, the files to pre-load into the database
ConnectionConfiguration to connect to the new database
StardogException - if the database could not be created or if there was an error while performing the bulk load
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||