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, they are only recommended for small databases or prototypes. If you want a scalable, persistent database, you really ought to be using the disk database.
Modifier and Type | Method and Description |
---|---|
DatabaseBuilder |
copyServerSide()
Specify that any files which are to be bulk loaded should be first copied to the remote server.
|
ConnectionConfiguration |
create(Function<Path,Resource> theContexts,
Path... theFiles)
Create the database using the parameters specified by this builder.
|
ConnectionConfiguration |
create(Path... theFiles)
Create the database using the parameters specified by this builder.
|
DatabaseBuilder |
reporter(PrintStream theStream)
Sets the
output used to print information messages during the bulk load process |
<V> DatabaseBuilder |
set(ConfigProperty<V> theOption,
V theValue)
Set the given option on this builder
|
DatabaseBuilder |
setAll(Metadata theMeta)
set(ConfigProperty, Object) all of the options in this metadata on this builder |
DatabaseBuilder copyServerSide()
DatabaseBuilder reporter(PrintStream theStream)
output
used to print information messages during the bulk load processtheStream
- the output stream to use<V> DatabaseBuilder set(ConfigProperty<V> theOption, V theValue)
V
- the option typetheOption
- the option to settheValue
- the valueDatabaseBuilder setAll(Metadata theMeta)
set(ConfigProperty, Object)
all of the options in this metadata on this buildertheMeta
- the options to setConnectionConfiguration create(Path... 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 configuration 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 databaseConnectionConfiguration
to connect to the new databaseStardogException
- if the database could not be created or if there was an error while performing the bulk loadConnectionConfiguration create(Function<Path,Resource> theContexts, Path... 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 databaseConnectionConfiguration
to connect to the new databaseStardogException
- if the database could not be created or if there was an error while performing the bulk loadCopyright © 2010-2016 Stardog Union. All Rights Reserved.