Interface VirtualGraphAdminConnection
- All Superinterfaces:
AdminConnection,AutoCloseable
Connection to manage data sources and virtual graphs
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.complexible.stardog.api.admin.AdminConnection
AdminConnection.StreamConsumer, AdminConnection.TxLogRange -
Field Summary
FieldsFields inherited from interface com.complexible.stardog.api.admin.AdminConnection
NO_TIMEOUT -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDataSource(String theName, Properties theOptions) Add a data source with the given propertiesvoidaddGraph(String theName, String theDataSource, String theDatabase, Properties theOptions, Iterable<Statement> theMappings) Registers a new virtual graph against a named data sourcedefault voidaddGraph(String theName, String theDataSource, String theDatabase, Properties theOptions, String theMappings) Registers a new virtual graph using a data source.voidaddGraph(String theName, String theDatabase, Properties theOptions, Iterable<Statement> theMappings) Registers a new virtual graph.voidaddGraph(String theName, String theDatabase, Properties theOptions, String theMappings) Deprecated.voidaddGraph(String theName, String theDataSourceName, Set<Statement> theMetadata, String theDatabase, Properties theOptions, String theMappings) Deprecated.For Stardog internal use onlydefault voidaddGraph(String theName, Properties theOptions, Iterable<Statement> theMappings) Registers a new virtual graph to be associated with all databases.default voidaddGraph(String theName, Properties theOptions, String theMappings) Registers a new virtual graph for access from all databasesgetDataSourceInfo(String theName) Retrieve the data source details for the named data sourcedefault DataSourceInfogetDataSourceInfoOrNull(String theName) Retrieve the data source details for the named data source or null if it doesn't existReturns information on all registered data sources.getDataSourceMetadata(String theName) Retrieve all the metadata that a DataSource has cached for its connection.getDataSourceOptions(String theName) Get the data source optionscom.google.gson.JsonArraygetDataSourceTables(String dsName) Retrieve all the tables that a DataSource has access to.Describes options for configuring data sources and virtual graphs.Deprecated.Use getVirtualGraphInfo or the other methodsdefault StringgetMappings(String vgName) Get mappings for the named virtual graph in R2RML formatgetMappingsString(String theName, String theSyntax) Get the serialized mappingsgetMatchingSuggestions(Set<Statement> theInput) Aligns data source and targets based on their lexical, data type, word sense similarity and returns those alignments as statementsgetOptions(String theName) Get the virtual graph optionscom.google.gson.JsonObjectgetTableMetadataJson(String dsName, String catalog, String schema, String tableName, String tableType) Retrieve the datasource metadata for only the table provided.getTableMetadataRdf(String dsName, String catalog, String schema, String tableName, String tableType) Retrieve the datasource metadata for only the table provided.getVirtualGraphInfo(String theName) Return aVirtualGraphInfofor the supplied graphgetVirtualGraphInfoOrNull(String theName) Return aVirtualGraphInfofor the supplied graph or null if it does not existReturns information on all registered virtual graphs.voidimportFile(String theMappings, Properties theOptions, String theDb, IRI theNg, File theFile, VirtualGraphAdminConnection.InputFileType theFormat) Import a file (CSV/JSON) in a single transaction.voidimportFile(String theMappings, Properties theOptions, String theDb, IRI theNg, InputStream theData, String thePathFileName, IRI theFileIri, VirtualGraphAdminConnection.InputFileType theFormat) Import a stream (CSV/JSON) in a single transactionvoidimportGraph(String theDatabase, String theDataSource, Properties theOptions, String theMappings, String theNamedGraph, boolean theRemoveAll) Import a DB by copy/add a temporary VG.default voidimportGraph(String theDatabase, Properties theOptions, String theMappings, String theNamedGraph, boolean theRemoveAll) Deprecated.useimportGraph(String, String, Properties, String, String, boolean)with a null DataSourcevoidmodifyDataSource(String theName, Properties theOptionUpdates) Update a data source with a set of modifications to its existing options.voidonlineDataSource(String theName) Brings online the registered data source with the given name, as well as its dependent virtual graphs.voidonlineGraph(String theName) Brings online the registered virtual graph with the given name.queryDataSource(String theName, String theQuery, String theTimeout, Properties theOptions) Query a DataSource with its native query language.voidrefreshCounts(String theDataSourceName, String theTableName) Update the cardinality (row count) estimates for the supplied data source and table.voidrefreshMetadata(String theDataSourceName, String theTableName) Refresh the metadata for the supplied data source and table.booleanremoveDataSource(String theName, boolean theForce) Remove a data source, and optionally all virtual graphs associated with it if you usetheForcebooleanremoveGraph(String theName) Removes the registered virtual graph with the given name.voidreplaceAllMetadata(String theDataSourceName, Set<Statement> theMetadata, Map<String, Boolean> theVgAvailability) Replace all metadata for a data source.voidreplaceDataSourceMetadata(String theName, Collection<Statement> theStatements) Replaces the metadata for a DataSource with the supplied RDF.voidreplaceTableMetadata(String theDataSourceName, String theCatalog, String theSchema, String theTableName, String theTableType, Set<Statement> theMetadata, Map<String, Boolean> theVgAvailability) Replace the metadata for a single table in a data source.voidshareDataSource(String theName) Share a private data source so it can be used by other virtual graphs and will endure after its dependent virtual graph is removed.voidtestDataSource(String theName) Test an existing data source connection.default voidtestNewConnection(Properties theOptions) Test the connection for a new data source.default voidupdateDataSource(String theName, Properties theOptions) Update a data source with the given options.default voidupdateDataSource(String theName, Properties theOptions, boolean theForce) Update a data source with the given options, refreshing dependent virtual graphsvoidupdateDataSource(String theName, Set<Statement> theMetadata, Properties theOptions, boolean theForce, boolean theShareable) Deprecated.For Stardog internal use onlydefault voidupdateGraph(String theName, String theDataSource, String theDatabase, Properties theOptions, String theMappings) Registers a new virtual graph using a data source and overwriting a previous version if it exists.voidupdateGraph(String theName, String theDatabase, Properties theOptions, Iterable<Statement> theMappings) Registers a new virtual graph overwriting a previous version if it exists.voidupdateGraph(String theName, String theDatabase, Properties theOptions, String theMappings) Deprecated.UseupdateGraph(String, String, String, Properties, String)with null dataSourcevoidupdateGraph(String theName, String theDataSourceName, Set<Statement> theMetadata, String theDatabase, Properties theOptions, String theMappings) Deprecated.For Stardog internal use onlydefault voidupdateGraph(String theName, Properties theOptions, Iterable<Statement> theMappings) Registers a new virtual graph to be associated with all databases, overwriting a previous version if it exists.default voidupdateGraph(String theName, Properties theOptions, String theMappings) Registers a new virtual graph for access from all databases, overwriting a previous version if it exists.Methods inherited from interface com.complexible.stardog.api.admin.AdminConnection
as, backup, backup, backup, backup, backupAll, builder, checkpoint, close, currentStatus, currentStatus, disk, drop, generateDiagnosticReport, get, get, getLogs, getPermissionManager, getProcessManager, getProperty, getQueryManager, getRoleManager, getStoredFunctions, getStoredQueries, getTokenManager, getUserManager, isOpen, list, newDatabase, offline, offline, online, optimize, optimize, renameDatabase, repair, replayTransactionLog, restore, restore, set, setProperty, shutdown, transactionLog, verify, whoami
-
Field Details
-
ALL_DBS
- See Also:
-
ALL_NAMED_GRAPHS
- See Also:
-
-
Method Details
-
getVirtualGraphInfos
Collection<VirtualGraphInfo> getVirtualGraphInfos()Returns information on all registered virtual graphs. -
getGraph
Deprecated.Use getVirtualGraphInfo or the other methodsReturns the registered virtual graph with the given name.- Throws:
StardogException- if the graph does not exist or there is an error getting the graph
-
getVirtualGraphInfo
Return aVirtualGraphInfofor the supplied graph- Parameters:
theName- the (local) name of the virtual graph (without the virtual:// prefix)
-
getVirtualGraphInfoOrNull
Return aVirtualGraphInfofor the supplied graph or null if it does not exist -
getOptions
Get the virtual graph options -
getMappings
Get mappings for the named virtual graph in R2RML format -
getMappingsString
Get the serialized mappings -
removeGraph
Removes the registered virtual graph with the given name. returntrueif the virtual graph exists and was removed,falseif the virtual graph does not exist- Throws:
StardogException- if there is an error removing the graph
-
onlineGraph
Brings online the registered virtual graph with the given name.- Throws:
StardogException- if there is an error reloading the graph
-
addGraph
Registers a new virtual graph to be associated with all databases.- Throws:
StardogException- if there is already a registered virtual graph with the given name or if there is an error adding the graph
-
addGraph
void addGraph(String theName, String theDatabase, Properties theOptions, Iterable<Statement> theMappings) Registers a new virtual graph.- Throws:
StardogException- if there is already a registered virtual graph with the given name or if there is an error adding the graph
-
addGraph
void addGraph(String theName, String theDataSource, String theDatabase, Properties theOptions, Iterable<Statement> theMappings) Registers a new virtual graph against a named data source -
addGraph
Registers a new virtual graph for access from all databases -
addGraph
@Deprecated void addGraph(String theName, String theDatabase, Properties theOptions, String theMappings) Deprecated.UseaddGraph(String, String, String, Properties, String)with null dataSourceRegisters a new virtual graph. TODO : another arg for mappings format? We can detect from CLI and require it here- Throws:
StardogException- if there is already a registered virtual graph with the given name or if there is an error adding the graph
-
addGraph
default void addGraph(String theName, String theDataSource, String theDatabase, Properties theOptions, String theMappings) Registers a new virtual graph using a data source.- Throws:
StardogException- if there is already a registered virtual graph with the given name or if there is an error adding the graph
-
addGraph
@Deprecated void addGraph(String theName, @Nullable String theDataSourceName, @Nullable Set<Statement> theMetadata, String theDatabase, Properties theOptions, String theMappings) Deprecated.For Stardog internal use onlyRegisters a new virtual graph using a data source and, if theMetadata is not null, initializing the metadata cache with the supplied statements.- Throws:
StardogException- if there is already a registered virtual graph with the given name or if there is an error adding the graph
-
updateGraph
Registers a new virtual graph to be associated with all databases, overwriting a previous version if it exists.- Throws:
StardogException- if there is an error updating the graph
-
updateGraph
void updateGraph(String theName, String theDatabase, Properties theOptions, Iterable<Statement> theMappings) Registers a new virtual graph overwriting a previous version if it exists.- Throws:
StardogException- if there is an error updating the graph
-
updateGraph
Registers a new virtual graph for access from all databases, overwriting a previous version if it exists. -
updateGraph
@Deprecated void updateGraph(String theName, String theDatabase, Properties theOptions, String theMappings) Deprecated.UseupdateGraph(String, String, String, Properties, String)with null dataSourceRegisters a new virtual graph overwriting a previous version if it exists. TODO : another arg for mappings format? We can detect from CLI and require it here- Throws:
StardogException- if there is an error updating the graph
-
updateGraph
default void updateGraph(String theName, String theDataSource, String theDatabase, Properties theOptions, String theMappings) Registers a new virtual graph using a data source and overwriting a previous version if it exists.- Throws:
StardogException- if there is an error updating the graph
-
updateGraph
@Deprecated void updateGraph(String theName, @Nullable String theDataSourceName, @Nullable Set<Statement> theMetadata, String theDatabase, Properties theOptions, String theMappings) Deprecated.For Stardog internal use onlyRegisters a new virtual graph using a data source, overwriting a previous version if it exists and, if theMetadata is not null, initializing the metadata cache with the supplied statements. -
importGraph
@Deprecated default void importGraph(String theDatabase, Properties theOptions, String theMappings, String theNamedGraph, boolean theRemoveAll) Deprecated.useimportGraph(String, String, Properties, String, String, boolean)with a null DataSourceImport a DB by copy/add a temporary VG. -
importGraph
void importGraph(String theDatabase, @Nullable String theDataSource, Properties theOptions, String theMappings, String theNamedGraph, boolean theRemoveAll) Import a DB by copy/add a temporary VG. -
importFile
void importFile(String theMappings, Properties theOptions, String theDb, IRI theNg, File theFile, VirtualGraphAdminConnection.InputFileType theFormat) Import a file (CSV/JSON) in a single transaction. Using a file has the advantage of being a repeatable source when negotiating a Kerberos connection. -
importFile
void importFile(String theMappings, Properties theOptions, String theDb, IRI theNg, InputStream theData, String thePathFileName, IRI theFileIri, VirtualGraphAdminConnection.InputFileType theFormat) Import a stream (CSV/JSON) in a single transaction- Parameters:
theMappings- optional mappingstheOptions- optional optionstheDb- the target databasetheNg- the (nullable) target named graphtheData- the InputStreamthePathFileName- the name to give to the stream for catalog metadata purposestheFileIri- optional IRI of the input stream for catalog metadata purposestheFormat- the format of the file (DELIMITED/JSON)
-
addDataSource
Add a data source with the given properties -
updateDataSource
Update a data source with the given options. -
updateDataSource
Update a data source with the given options, refreshing dependent virtual graphs -
updateDataSource
@Deprecated void updateDataSource(String theName, @Nullable Set<Statement> theMetadata, Properties theOptions, boolean theForce, boolean theShareable) Deprecated.For Stardog internal use onlyUpdate a data source with the given options, refreshing dependent virtual graphs. If theMetadata is not null, initializes the metadata cache with the supplied statements. -
modifyDataSource
Update a data source with a set of modifications to its existing options. Options the already exist in the data source but are not included in the updates will be retained. To remove an option, supply the property with an empty ("") value.- Parameters:
theName- The local name of the data sourcetheOptionUpdates- The options to add or remove from the existing configuration
-
removeDataSource
Remove a data source, and optionally all virtual graphs associated with it if you usetheForce -
getDataSourceInfos
Collection<DataSourceInfo> getDataSourceInfos()Returns information on all registered data sources. -
onlineDataSource
Brings online the registered data source with the given name, as well as its dependent virtual graphs.- Throws:
StardogException- if there is an error reloading the data source
-
testDataSource
Test an existing data source connection.- Throws:
StardogException- if there is an error testing the data source
-
testNewConnection
Test the connection for a new data source. -
getDataSourceInfo
Retrieve the data source details for the named data source- Throws:
IllegalArgumentException- if DataSource is not found
-
getDataSourceInfoOrNull
Retrieve the data source details for the named data source or null if it doesn't exist -
getDataSourceOptions
Get the data source options -
getDataSourceMetadata
Retrieve all the metadata that a DataSource has cached for its connection. NOTE: The schema of the metadata may change with new releases.- Returns:
- the metadata in RDF format
-
getDataSourceTables
Retrieve all the tables that a DataSource has access to.- Returns:
- Array of Objects containing catalog, schema, table name and table type
-
getTableMetadataRdf
@Beta Set<Statement> getTableMetadataRdf(String dsName, @Nullable String catalog, @Nullable String schema, String tableName, String tableType) Retrieve the datasource metadata for only the table provided.- Returns:
- the metadata in RDF format
-
getTableMetadataJson
@Beta com.google.gson.JsonObject getTableMetadataJson(String dsName, @Nullable String catalog, @Nullable String schema, String tableName, String tableType) Retrieve the datasource metadata for only the table provided.- Returns:
- the metadata in JSON format
-
refreshMetadata
Refresh the metadata for the supplied data source and table. IftheTableNameisnull, refresh metadata for all tables that have been loaded through the data source.Call this if the schema (column names or data types) has changed for tables accessed by the data source, or if tables were created or dropped since the data source was created or refreshed.
- Parameters:
theDataSourceName- local name of the data sourcetheTableName- name of the table (eg. myschema.mytable or mytable)- Throws:
IllegalArgumentException- if table was provided but not found
-
replaceTableMetadata
void replaceTableMetadata(String theDataSourceName, @Nullable String theCatalog, @Nullable String theSchema, String theTableName, String theTableType, Set<Statement> theMetadata, Map<String, Boolean> theVgAvailability) Replace the metadata for a single table in a data source. For use in cluster replication.If metadata is non-empty: adds or updates the table's metadata. If metadata is empty: removes the table from the cache.
After metadata is updated, dependent virtual graphs are rebuilt with the specified availability.
- Parameters:
theDataSourceName- local name of the data sourcetheCatalog- table catalog (nullable)theSchema- table schema (nullable)theTableName- table nametheTableType- table type (TABLE, VIEW, etc.)theMetadata- RDF statements for the table (empty to delete)theVgAvailability- the expected availability state for dependent VGs after reload
-
replaceAllMetadata
void replaceAllMetadata(String theDataSourceName, Set<Statement> theMetadata, Map<String, Boolean> theVgAvailability) Replace all metadata for a data source. For use in cluster replication.After metadata is replaced, dependent virtual graphs are rebuilt with the specified availability.
- Parameters:
theDataSourceName- local name of the data sourcetheMetadata- RDF statements for all tablestheVgAvailability- the expected availability state for dependent VGs after reload
-
refreshCounts
Update the cardinality (row count) estimates for the supplied data source and table. IftheTableNameisnull, refresh counts for all tables that have been loaded through the data source.- Parameters:
theDataSourceName- local name of the data sourcetheTableName- name of the table (eg. myschema.mytable or mytable)- Throws:
IllegalArgumentException- if table was provided but has not been loaded by a virtual graph
-
replaceDataSourceMetadata
Replaces the metadata for a DataSource with the supplied RDF. NOTE: The schema of the metadata may change with new releases. -
queryDataSource
DataSourceQueryResult queryDataSource(String theName, String theQuery, String theTimeout, Properties theOptions) Query a DataSource with its native query language. -
getDbTypeOptionsDescription
String getDbTypeOptionsDescription()Describes options for configuring data sources and virtual graphs. Includes DB-type families, available options, data types, defaults and whether required. For use with data-driven UIs such as Studio.- Returns:
- a JSON option detailing DB types and their options
-
getMatchingSuggestions
Aligns data source and targets based on their lexical, data type, word sense similarity and returns those alignments as statements- Parameters:
theInput- data source and target metadata, optionally with unpublished ontology in designer via a named graph- Returns:
- alignments
-
addGraph(String, String, String, Properties, String)with null dataSource