Class: GraphDBServerClient

GraphDBServerClient(config)

Implementation of the graphDB server operations.

Used to automate the security user management API: add, edit, or remove users. Also used to add, edit, or remove a repository to/from any attached location. You can work with multiple remote locations from a single access point.

Constructor

new GraphDBServerClient(config)

Parameters:
Name Type Description
config ServerClientConfig

for the server client.

Author:
  • Teodossi Dossev
Source:

Methods

createRepository(repositoryConfig) → {Promise.<(HttpResponse|Error)>}

Create repository according to the provided configuration

Parameters:
Name Type Description
repositoryConfig RepositoryConfig
Source:
Returns:

a promise which resolves to response wrapper or rejects with error if thrown during execution.

Type
Promise.<(HttpResponse|Error)>

createUser(username, password, grantedAuthoritiesopt, appSettingsopt) → {Promise.<(HttpResponse|Error)>}

Create a user

Parameters:
Name Type Attributes Description
username string

User name

password string

User password

grantedAuthorities Array.<string> <optional>

Array of read and/or write access rights described in the following template: READ_REPO_{repository ID} to grant repository read rights WRITE_REPO_{repository ID} to grant repository write rights

appSettings AppSettings <optional>

configure the default behavior of the GraphDB Workbench

Source:
Returns:

a promise which resolves to response wrapper or rejects with error if thrown during execution.

Type
Promise.<(HttpResponse|Error)>

deleteRepository(id) → {Promise.<any>}

Delete repository with the provided id.

Parameters:
Name Type Description
id string

of the repository which should be deleted.

Source:
Returns:

promise which resolves with the delete result.

Type
Promise.<any>

deleteUser(username) → {Promise.<(HttpResponse|Error)>}

Deletes a user

Parameters:
Name Type Description
username string

User name

Source:
Returns:

a promise which resolves to response wrapper or rejects with error if thrown during execution.

Type
Promise.<(HttpResponse|Error)>

downloadRepositoryConfig(repositoryId, locationopt) → {Promise.<(string|any)>}

Download the repository configuration in turtle format

Parameters:
Name Type Attributes Description
repositoryId string

the repository id

location string <optional>

optional repository location

Source:
Returns:

a service request that will resolve to a readable stream to which the client can subscribe and consume the emitted strings as soon as they are available. Resolves to turtle format.

Type
Promise.<(string|any)>

getDefaultConfig(repositoryType) → {Promise.<(HttpResponse|Error)>}

Get the default repository configuration for the repository type

Parameters:
Name Type Description
repositoryType RepositoryType | String

the type for which a default configuration is required

Source:
Returns:

a promise which resolves to response wrapper or rejects with error if thrown during execution.

Type
Promise.<(HttpResponse|Error)>

getFreeAccess() → {Promise.<(HttpResponse|Error)>}

Check if free access is enabled

Source:
Returns:

a promise which resolves to response wrapper or rejects with error if thrown during execution.

Type
Promise.<(HttpResponse|Error)>

getRepositoryConfig(repositoryId, locationopt) → {Promise.<(HttpResponse|string|Error)>}

Get the repository configuration

Parameters:
Name Type Attributes Description
repositoryId string

the repository id

location string <optional>

optional repository location

Source:
Returns:

a promise which resolves to response wrapper or rejects with error if thrown during execution.

Type
Promise.<(HttpResponse|string|Error)>

getUser(username) → {Promise.<(HttpResponse|Error)>}

Get a user

Parameters:
Name Type Description
username string

User name

Source:
Returns:

a promise which resolves to response wrapper or rejects with error if thrown during execution.

Type
Promise.<(HttpResponse|Error)>

isSecurityEnabled() → {Promise.<(HttpResponse|Error)>}

Checks if GraphDB security is enabled.

Source:
Returns:

a promise which resolves to response wrapper or rejects with error if thrown during execution.

Type
Promise.<(HttpResponse|Error)>

toggleSecurity(enabled) → {Promise.<(HttpResponse|Error)>}

Enable or disable GraphDB security.

Parameters:
Name Type Description
enabled boolean

true if security is enabled and false otherwise.

Source:
Returns:

a promise which resolves to response wrapper or rejects with error if thrown during execution.

Type
Promise.<(HttpResponse|Error)>

updateFreeAccess(enabled, authorities, appSettings) → {Promise.<(HttpResponse|Error)>}

Enable or disable access to a predefined set of functionalities without having to log in. To use free access, you must have security enabled. Use with extreme caution, as the changes that are made to the application settings may possibly change the behavior of the GraphDB Workbench for the logged-in user or for all users if logged in as admin.

Parameters:
Name Type Description
enabled boolean

true if free access is enabled and false otherwise.

authorities Array.<string>

Array of read and/or write access rights described in the following template: READ_REPO_{repository ID} to grant repository read rights WRITE_REPO_{repository ID} to grant repository write rights

appSettings AppSettings

configure the default behavior of the GraphDB Workbench

Source:
Returns:

a promise which resolves to response wrapper or rejects with error if thrown during execution.

Type
Promise.<(HttpResponse|Error)>

updateUser(username, passwordopt, grantedAuthoritiesopt, appSettingsopt) → {Promise.<(HttpResponse|Error)>}

Edit user. Use with extreme caution, as the changes that are made to the application settings may possibly change the behavior of the GraphDB Workbench for the user.

Parameters:
Name Type Attributes Description
username string

User name

password string <optional>

User password

grantedAuthorities Array.<string> <optional>

Array of read and/or write access rights described in the following template: READ_REPO_{repository ID} to grant repository read rights WRITE_REPO_{repository ID} to grant repository write rights

appSettings AppSettings <optional>

configure the default behavior of the GraphDB Workbench

Source:
Returns:

a promise which resolves to response wrapper or rejects with error if thrown during execution.

Type
Promise.<(HttpResponse|Error)>

updateUserData(username, passwordopt, appSettingsopt) → {Promise.<(HttpResponse|Error)>}

Change setting for a logged user. Use with extreme caution, as the changes that are made to the application settings may possibly change the behavior of the GraphDB Workbench for the user.

Parameters:
Name Type Attributes Description
username string

User name

password string <optional>

User password

appSettings AppSettings <optional>

configure the default behavior of the GraphDB Workbench

Source:
Returns:

a promise which resolves to response wrapper or rejects with error if thrown during execution.

Type
Promise.<(HttpResponse|Error)>