Skip to content

stardog-union/stardog.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stardog.js

Universal Javascript fetch wrapper for communicating with the Stardog HTTP server.

npm

What is it?

This framework wraps all the functionality of a client for the Stardog DBMS, and provides access to a full set of functions such as executing SPARQL queries, administrative tasks on Stardog, and the use of the Reasoning API.

All the implementation uses the HTTP protocol, since most of Stardog functionality is available using this protocol. For more information, go to the Stardog's HTTP Programming documentation.

This is a universal library and as such can be used in both the browser and Node.js.

Installation

To install stardog.js run:

npm install stardog

Usage

Stardog.js conforms to the Universal Module Definition API. To use it in Node.js, simply require or import it as you would any other Node module. To use it in the browser, you can either:

  1. Do the same as you would with Node.js, in which case you'll have to use webpack, parcel, browserify, or some other module bundler,
  2. Use require.js or some other module loader, or
  3. Directly import the built stardog.js file in your HTML (e.g., <script src="./node_modules/stardog/dist/stardog.js"></script>) and then reference the global stardogjs object (e.g., stardogjs.query.execute(/* . . . */)).

Development

To get started, just clone the project. You'll need a local copy of Stardog to be able to run the tests. For more information on starting the Stardog DB service and how it works, go to Stardog's documentation, where you'll find everything you need to get up and running with Stardog.

Go to http://stardog.com, download and install the database and load the data provided in data/ using the script in the repository.

  1. Start the Stardog server
stardog-admin server start
  1. Install stardog.js dependencies:
npm install

Running Tests

In order to contribute changes, all test cases must pass. With the Stardog server running, execute the following command to run all test cases in test/spec:

npm test

To test the cluster commands you will need to first start a Stardog cluster then run the cluster suite. The easiest way to do this is to run docker-compose to start a cluster:

docker-compose -f .circleci/docker-compose.yml up

Then run the cluster test suite in test/cluster:

npm run test:cluster

Contributing

Fork, clone and develop, write or amend tests, and then open a PR. All PRs go against "master". This project uses prettier on file commit, so don't worry about style as it'll just get rewritten when you commit your changes.

Releasing

First, ensure that there is a milstone for the release version, and that all PRs that you want to appear in the CHANGELOG are tagged with that milestone. The milestone must be closed before publishing.

If you have publishing rights, BE SURE TO RUN npm version (major|minor|patch) IMMEDIATELY BEFORE PUBLISHING. This will ensure that the build is up-to-date and will also (1) bump the version number in package.json accordingly, (2) create a git tag matching the version number, and (3) automatically update the README and the CHANGELOG using our type declarations and data from the stardog.js GitHub repo. For this process to work correctly, you will need to have generated a GitHub OAuth token and assigned it to the MDCHANGELOG_TOKEN environment variable (the name of the token is a relic of the fact that this repo once used mdchangelog to generate changelogs; it now uses a custom script). You can then publish by running npm publish. In order to ensure that this process is followed, there will be a very annoying alert triggered whenever you publish; if you're all set, just ignore the alert.

After releasing, be sure to push to master, including the tags (so that the release is reflected on GitHub).

Version/Support Details

Each release of stardog.js is tested against the most recent version of Stardog available at the time of the release. The relationship between versions of stardog.js and versions of Stardog is detailed in the following table:

stardog.js Version Supported Stardog Version(s)
6.x.x 10.x.x
5.x.x 9.x.x
4.x.x 8.x.x
3.x.x 7.x.x
2.x.x* 6.x.x
1.x.x* 5.x.x
0.x.x* any version < 5

* = No longer supported

We support and maintain a particular version of stardog.js only if the corresponding Stardog version(s) is (are) officially supported and maintained. For example, we no longer support v0.x.x of stardog.js, as the corresponding Stardog versions are no longer supported. (That said, later versions of stardog.js will often mostly work with earlier Stardog versions. We just don't test this or make any guarantees to that effect.)

Quick Example

const { Connection, query } = require('stardog');

const conn = new Connection({
  username: 'admin',
  password: 'admin',
  endpoint: 'http://localhost:5820',
});

query
  .execute(
    conn,
    'myDatabaseName',
    'select distinct ?s where { ?s ?p ?o }',
    'application/sparql-results+json',
    {
      limit: 10,
      reasoning: true,
      offset: 0,
    }
  )
  .then(({ body }) => {
    console.log(body.results.bindings);
  });

API

One of the following values:

'application/ld+json' | 'text/turtle' | 'application/rdf+xml' | 'application/n-triples' | 'application/n-quads' | 'application/trig'

One of the following values:

'application/sparql-results+json' | 'application/sparql-results+xml'

One of the following values:

RdfMimeType | SparqlMimeType | 'text/plain' | 'text/boolean' | 'application/json' | '*/*'

One of the following values:

'text/plain' | 'application/json'

Object with the following values:

  • status (number)
  • statusText (string)
  • result (object | string | boolean | null)
  • ok (boolean)
  • headers (Headers)
  • body (any)
  • url (string)

Object with the following values:

  • endpoint (string)
  • username (string)
  • password (string)
  • token (string)
  • meta (ConnectionMeta)

One of the following values:

{ new (input: string | Request, init?: RequestInit): Request; }

One of the following values:

({ uri, Request }: { uri: string; Request: Constructor }) => ReturnType

Object with the following values:

  • createRequest (RequestCreator<RequestConstructor, string | Request>)
  • createHeaders ((defaults: { headers: Headers; }) => Headers)

Connection (Class)

Constructed with:

Takes the following params:

Returns void

Returns Headers

Takes the following params:

  • resource (string[])

Returns string

Shuts down a Stardog server.

Expects the following parameters:

Returns Promise<HTTP.Body>

Retrieves general status information about a Stardog server. By default, also includes status information about all databases on that server. If params.databases is false, however, then the information about databases is omitted.

Expects the following parameters:

  • conn (Connection)

  • params ({ databases?: boolean; })

Returns Promise<HTTP.Body>

Retrieves server properties. By default, it will return all server properties, but you can specify names to return specific ones.

Expects the following parameters:

Returns Promise<HTTP.Body>

Creates a new database.

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • databaseOptions (object)

  • options ({ files: { filename: string}[] })

  • params (object)

Returns Promise<HTTP.Body>

Deletes a database.

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • params (object)

Returns Promise<HTTP.Body>

Gets an RDF representation of a database. See: https://www.w3.org/TR/sparql11-http-rdf-update/#http-get

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • params (object)

Returns Promise<HTTP.Body>

Sets a database offline.

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • params (object)

Returns Promise<HTTP.Body>

Sets a database online.

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • params (object)

Returns Promise<HTTP.Body>

Optimizes a database.

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • params (object)

Returns Promise<HTTP.Body>

Gets a list of all databases on a Stardog server.

Expects the following parameters:

Returns Promise<HTTP.Body>

Gets a list of databases info on a Stardog server.

Expects the following parameters:

Returns Promise<HTTP.Body>

Gets number of triples in a database.

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • params (object)

Returns Promise<HTTP.Body>

Gets the model for a database.

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • options (object)

  • params (object)

Returns Promise<HTTP.Body>

Clears the contents of a database.

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • transactionId (string)

  • params (object)

Returns Promise<HTTP.Body>

Adds data within a transaction.

Expects the following parameters:

Returns Promise<transaction.TransactionResponse>

Removes data within a transaction.

Expects the following parameters:

Returns Promise<transaction.TransactionResponse>

Exports the contents of a database.

Expects the following parameters:

Returns Promise<HTTP.Body>

Gets all available database options with their default values.

Expects the following parameters:

Returns Promise<HTTP.Body>

Gets set of options on a database.

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • params (object)

Returns Promise<HTTP.Body>

Gets all options on a database.

Expects the following parameters:

Returns Promise<HTTP.Body>

Sets options on a database.

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • databaseOptions (object)

  • params (object)

Returns Promise<HTTP.Body>

Retrieves the specified named graph

Expects the following parameters:

Returns Promise<HTTP.Body>

Stores the given RDF data in the specified named graph

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • graphData (string)

  • graphUri (string)

  • contentType (RdfMimeType)

  • params (object)

Returns Promise<HTTP.Body>

Deletes the specified named graph

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • graphUri (string)

  • params (object)

Returns Promise<HTTP.Body>

Merges the given RDF data into the specified named graph

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • graphUri (string)

  • options ({ contentType: RdfMimeType })

  • params (object)

Returns Promise<HTTP.Body>

One of the following values:

'gzip' | 'compress' | 'deflate' | 'identity' | 'br'

Object with the following values:

  • transactionId (string)

Object with the following values:

  • contentType (HTTP.RdfMimeType)
  • encoding (Encodings)

Begins a new transaction.

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • params (object)

Returns Promise<TransactionResponse>

Rolls back a transaction, removing the transaction and undoing all changes

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • transactionId (string)

  • params (object)

Returns Promise<TransactionResponse>

Commits a transaction to the database, removing the transaction and making its changes permanent.

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • transactionId (string)

  • params (object)

Returns Promise<TransactionResponse>

Gets the set of integrity constraints on a given database.

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • params (object)

Returns Promise<HTTP.Body>

Adds integrity constraints to a given database.

DEPRECATED: Support for storing ICV constraints in the system database is deprecated in Stardog 7.5.0 and removed in Stardog 8.0.0; instead, SHACL constraints can be managed using db.add.

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • icvAxioms (string)

  • options ({ contentType: RdfMimeType })

  • params (object)

Returns Promise<HTTP.Body>

Removes integrity constraints from a given database.

DEPRECATED: Support for storing ICV constraints in the system database is deprecated in Stardog 7.5.0 and removed in Stardog 8.0.0; instead, SHACL constraints can be managed using db.remove.

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • icvAxioms (string)

  • options ({ contentType: RdfMimeType })

  • params (object)

Returns Promise<HTTP.Body>

Removes all integrity constraints from a given database.

DEPRECATED: Support for storing ICV constraints in the system database is deprecated in Stardog 7.5.0 and removed in Stardog 8.0.0; instead, SHACL constraints can be managed using db.remove.

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • params (object)

Returns Promise<HTTP.Body>

Checks constraints to see if they are valid

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • constraints (string)

  • options ({ contentType: RdfMimeType })

  • params ({ graphUri: string })

Returns Promise<HTTP.Body>

Checks constraints to see if they are valid within a transaction

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • transactionId (string)

  • constraints (string)

  • options ({ contentType: RdfMimeType })

  • params ({ graphUri: string })

Returns Promise<HTTP.Body>

Accepts integrity constraints as RDF and returns the violation explanations, if any, as RDF.

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • constraints (string)

  • options ({ contentType: RdfMimeType })

  • params ({ graphUri: string })

Returns Promise<HTTP.Body>

Accepts integrity constraints as RDF and returns the violation explanations, if any, as RDF.

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • transactionId (string)

  • constraints (string)

  • options ({ contentType: RdfMimeType })

  • params ({ graphUri: string })

Returns Promise<HTTP.Body>

Accepts integrity constraints as RDF and returns a validation report.

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • constraints (string)

  • options ({ contentType?: HTTP.RdfMimeType, accept?: AcceptMimeType })

  • params ({ graphUri: string })

Returns Promise<HTTP.Body>

Accepts integrity constraints as RDF and returns a validation report.

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • transactionId (string)

  • constraints (string)

  • options ({ contentType?: HTTP.RdfMimeType, accept?: AcceptMimeType })

  • params ({ graphUri: string })

Returns Promise<HTTP.Body>

Returns if the database is consistent

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • options ({ namedGraph: string })

  • params (object)

Returns Promise<HTTP.Body>

Provides an explanation for an inference

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • inference (string)

  • config ({ contentType: string })

  • params (object)

Returns Promise<HTTP.Body>

Provides the reason why a database is inconsistent, as reported by db.reasoning.consistency

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • options ({ namedGraph: string })

  • params (object)

Returns Promise<HTTP.Body>

Provides an explanation for an inference within a transaction

Expects the following parameters:

Returns Promise<HTTP.Body>

Provides the reason why a database is inconsistent, as reported by db.reasoning.consistency

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • transactionId (string)

  • options ({ namedGraph: string })

  • params (object)

Returns Promise<HTTP.Body>

Gets the reasoning schema of the database

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • params (object)

Returns Promise<HTTP.Body>

Retrieves the size of the document store

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • params (object)

Returns Promise<HTTP.Body>

Clears the document store

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • params (object)

Returns Promise<HTTP.Body>

Adds a document to the document store

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • fileName (string)

  • fileContents (string)

  • params (object)

Returns Promise<HTTP.Body>

Removes a document from the document store

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • fileName (string)

  • params (object)

Returns Promise<HTTP.Body>

Retrieves a document from the document store

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • fileName (string)

  • params (object)

Returns Promise<HTTP.Body>

Gets a mapping of the namespaces used in a database.

Expects the following parameters:

Returns Promise<HTTP.Body>

Extracts namespaces from an RDF file or RDF string and adds new and updates existing namespaces in the database.

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • fileOrContents (object | string)

  • options ({ contentType?: RdfMimeType })

Returns Promise<HTTP.Body>

One of the following values:

'select' | 'ask' | 'construct' | 'describe' | 'validate' | 'update' | 'paths' | null

Object with the following values:

  • uri (string)
  • property (string)

Object with the following values:

  • onResponseStart ((res: Response) => boolean | void)

Gets the values for a specific property of a URI individual.

Expects the following parameters:

Returns Promise<HTTP.Body>

Gets the query plan generated by Stardog for a given SPARQL query.

Expects the following parameters:

Returns Promise<HTTP.Body>

Executes a query against a database.

Expects the following parameters:

Returns Promise<HTTP.Body>

Executes a query against a database within a transaction.

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • transactionId (string)

  • query (string)

  • options ({ accept: RdfMimeType })

  • params (object)

Returns Promise<HTTP.Body>

Gets a list of actively running queries.

Expects the following parameters:

Returns Promise<HTTP.Body>

Kills an actively running query.

Expects the following parameters:

Returns Promise<HTTP.Body>

Gets information about an actively running query.

Expects the following parameters:

Returns Promise<HTTP.Body>

Object with the following values:

  • name (string)
  • database (string)
  • query (string)
  • shared (boolean)
  • reasoning (boolean)
  • description (boolean)

Stores a query in Stardog, either on the system level or for a given database.

Expects the following parameters:

  • conn (Connection)

  • storedQuery ([StoredQueryOptions | object](#storedqueryoptions | object))

  • options ({ accept?: string, contentType?: string })

Returns Promise<HTTP.Body>

Lists all stored queries.

Expects the following parameters:

Returns Promise<HTTP.Body>

Updates a given stored query and creates it if the name does not refer to an existing stored query.

Expects the following parameters:

  • conn (Connection)

  • storedQuery ([StoredQueryOptions | object](#storedqueryoptions | object))

  • options ({ accept?: string, contentType?: string })

  • useUpdateMethod (boolean)

Returns Promise<HTTP.Body>

Removes a given stored query.

Expects the following parameters:

Returns Promise<HTTP.Body>

Renames a given stored query.

Expects the following parameters:

  • conn (Connection)

  • name (string)

  • newName (string)

Returns Promise<HTTP.Body>

Executes a GraphQL query

Expects the following parameters:

Returns Promise<HTTP.Body>

Retrieves a list of GraphQL schemas in the database

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • params (object)

Returns Promise<HTTP.Body>

Adds a GraphQL schema to the database

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • name (string)

  • schema (object)

  • params (object)

Returns Promise<HTTP.Body>

Updates (or adds if non-existent) a GraphQL schema to the database

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • name (string)

  • schema (object)

  • params (object)

Returns Promise<HTTP.Body>

Retrieves a GraphQL schema from the database

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • name (string)

  • params (object)

Returns Promise<HTTP.Body>

Removes a GraphQL schemafrom the database

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • name (string)

  • params (object)

Returns Promise<HTTP.Body>

Clears all GraphQL schemas in the database

Expects the following parameters:

  • conn (Connection)

  • database (string)

  • params (object)

Returns Promise<HTTP.Body>

Returns the QueryType (as a string or null) for the given query.

Expects the following parameters:

  • query (string)

Returns QueryType

Returns the default HTTP Accept MIME type for the given query.

Expects the following parameters:

  • query (string)

Returns HTTP.AcceptMimeType

Object with the following values:

  • username (string)
  • password (string)
  • superuser (boolean)

One of the following values:

'CREATE' | 'DELETE' | 'READ' | 'WRITE' | 'GRANT' | 'REVOKE' | 'EXECUTE'

One of the following values:

'db' | 'user' | 'role' | 'admin' | 'metadata' | 'named-graph' | 'icv-constraints'

Gets a list of users.

Expects the following parameters:

Returns Promise<HTTP.Body>

Retrieve a list of user info

Expects the following parameters:

Returns Promise<HTTP.Body>

Gets all information for a given user.

Expects the following parameters:

  • conn (Connection)

  • username (string)

  • params (object)

Returns Promise<HTTP.Body>

Creates a new user.

Expects the following parameters:

Returns Promise<HTTP.Body>

Changes a user's password.

Expects the following parameters:

  • conn (Connection)

  • username (string)

  • password (string)

  • params (object)

Returns Promise<HTTP.Body>

Verifies that a Connection's credentials are valid.

Expects the following parameters:

Returns Promise<HTTP.Body>

Verifies that a user is enabled.

Expects the following parameters:

  • conn (Connection)

  • username (string)

  • params (object)

Returns Promise<HTTP.Body>

Enables/disables a user.

Expects the following parameters:

  • conn (Connection)

  • username (string)

  • enabled (boolean)

  • params (object)

Returns Promise<HTTP.Body>

Sets roles for a user. (Overwrites any existing roles)

Expects the following parameters:

  • conn (Connection)

  • username (string)

  • roles (string[])

  • params (object)

Returns Promise<HTTP.Body>

Adds a role to a user.

Expects the following parameters:

  • conn (Connection)

  • username (string)

  • role (string)

  • params (object)

Returns Promise<HTTP.Body>

Gets a list of roles assigned to a user.

Expects the following parameters:

  • conn (Connection)

  • username (string)

  • params (object)

Returns Promise<HTTP.Body>

Creates a new permission for a user over a given resource.

Expects the following parameters:

Returns Promise<HTTP.Body>

Removes a permission for a user over a given resource.

Expects the following parameters:

Returns Promise<HTTP.Body>

Gets a list of permissions assigned to user.

Expects the following parameters:

  • conn (Connection)

  • username (string)

  • params (object)

Returns Promise<HTTP.Body>

Gets a list of a user's effective permissions.

Expects the following parameters:

  • conn (Connection)

  • username (string)

  • params (object)

Returns Promise<HTTP.Body>

Specifies whether a user is a superuser.

Expects the following parameters:

  • conn (Connection)

  • username (string)

  • params (object)

Returns Promise<HTTP.Body>

Deletes a user.

Expects the following parameters:

  • conn (Connection)

  • username (string)

  • params (object)

Returns Promise<HTTP.Body>

Returns a token for the user if the connection is valid.

Expects the following parameters:

Returns Promise<HTTP.Body>

Returns the username for the given connection.

Expects the following parameters:

Returns Promise<HTTP.Body>

Object with the following values:

  • action (Action)
  • resourceType (ResourceType)
  • resources (string[])

Creates a new role.

Expects the following parameters:

  • conn (Connection)

  • role ({ name: string })

  • params (object)

Returns Promise<HTTP.Body>

Lists all existing roles.

Expects the following parameters:

Returns Promise<HTTP.Body>

Retrieve a list of role info

Expects the following parameters:

Returns Promise<HTTP.Body>

Deletes an existing role from the system.

Expects the following parameters:

Returns Promise<HTTP.Body>

Lists all users that have been assigned a given role.

Expects the following parameters:

Returns Promise<HTTP.Body>

Adds a permission over a given resource to a given role.

Expects the following parameters:

Returns Promise<HTTP.Body>

Removes a permission over a given resource from a given role.

Expects the following parameters:

Returns Promise<HTTP.Body>

Lists all permissions assigned to a given role.

Expects the following parameters:

Returns Promise<HTTP.Body>

Object with the following values:

  • base (string)
  • mappings.syntax (string)
  • percent.encode (boolean)
  • optimize.import (boolean)
  • query.translation ('DEFAULT' | 'LEGACY')

Object with the following values:

  • jdbc.url (string)
  • jdbc.username (string)
  • jdbc.password (string)
  • jdbc.driver (string)
  • parser.sql.quoting ('NATIVE' | 'ANSI')
  • sql.functions (string)
  • sql.schemas (string)
  • default.mappings.include.tables (string)
  • default.mappings.exclude.tables (string)

Object with the following values:

  • mongodb.uri (string)

Object with the following values:

  • csv.separator (string)
  • csv.quote (string)
  • csv.escape (string)
  • csv.header (boolean)
  • csv.skip.empty (boolean)

One of the following values:

SharedOptions & RdbmsOptions & MongoOptions & CsvOptions

Object with the following values:

  • preferUntransformed (boolean)
  • syntax (string)

Object with the following values:

  • db (string)
  • dataSource (string)

Retrieve a list of virtual graphs

Expects the following parameters:

Returns Promise<HTTP.Body>

Retrieve a list of virtual graphs info

Expects the following parameters:

Returns Promise<HTTP.Body>

Add a virtual graph to the system

Expects the following parameters:

Returns Promise<HTTP.Body>

Update a virtual graph in the system

Expects the following parameters:

Returns Promise<HTTP.Body>

Remove a virtual graph from the system

Expects the following parameters:

Returns Promise<HTTP.Body>

Bring a virtual graph online

Expects the following parameters:

Returns Promise<HTTP.Body>

Determine if the named virtual graph is available

Expects the following parameters:

Returns Promise<HTTP.Body>

Retrieve a virtual graph's options

Expects the following parameters:

Returns Promise<HTTP.Body>

Retrieve a virtual graph's mappings

Expects the following parameters:

Returns Promise<HTTP.Body>

Import a JSON or CSV file into a database via virtual import.

Expects the following parameters:

  • conn (Connection)

  • file (object)

  • fileType (string)

  • database (string)

  • importOptions ({ mappings?: string, properties?: string, namedGraph?: string, })

Returns Promise<HTTP.Body>

Adds one or more stored functions to the server

Expects the following parameters:

  • conn (Connection)

  • functions (string)

  • params (object)

Returns Promise<HTTP.Body>

Retrieves the specified function definition

Expects the following parameters:

Returns Promise<HTTP.Body>

Removes a stored function from the server

Expects the following parameters:

Returns Promise<HTTP.Body>

Removes all stored functions from the server

Expects the following parameters:

Returns Promise<HTTP.Body>

Retrieves an export of all stored functions on the server

Expects the following parameters:

Returns Promise<HTTP.Body>

Retrieves basic information about a Stardog cluster.

Expects the following parameters:

Returns Promise<HTTP.Body>

Retrieves detailed status information about a Stardog cluster.

Expects the following parameters:

Returns Promise<HTTP.Body>

Lists the status of catalog providers

Expects the following parameters:

Returns Promise<HTTP.Body>

Starts a reload of information about a specific provider

Expects the following parameters:

Returns Promise<HTTP.Body>

One of the following values:

{ username: string, password: string } | { token: string } | { clientId: string, clientSecret: string }

Adds a provider credential

Expects the following parameters:

Returns Promise<HTTP.Body>

Lists stored provider credentials

Expects the following parameters:

Returns Promise<HTTP.Body>

Removes a stored provider credential

Expects the following parameters:

Returns Promise<HTTP.Body>

Manually starts a provider job

Expects the following parameters:

Returns Promise<HTTP.Body>

Tests a provider connection using existing/new credentials.

Expects the following parameters:

Returns Promise<HTTP.Body>

Retrieve a list of data sources

Expects the following parameters:

Returns Promise<HTTP.Body>

Retrieve a list of data sources info

Expects the following parameters:

Returns Promise<HTTP.Body>

Retrieve the named data source info

Expects the following parameters:

Returns Promise<HTTP.Body>

Add a data source to the system

Expects the following parameters:

Returns Promise<HTTP.Body>

Update the named data source in the system

Expects the following parameters:

  • conn (Connection)

  • name (string)

  • options (T)

  • requestOptions ({ delta_options?: boolean; force?: boolean })

Returns Promise<HTTP.Body>

Remove the named data source from the system

Expects the following parameters:

Returns Promise<HTTP.Body>

Change a private data source to a shared one

Expects the following parameters:

Returns Promise<HTTP.Body>

Bring the named data source online

Expects the following parameters:

Returns Promise<HTTP.Body>

Determine if the named data source is available

Expects the following parameters:

Returns Promise<HTTP.Body>

Retrieve the named data source options

Expects the following parameters:

Returns Promise<HTTP.Body>

Retrieve the named data source metadata

Expects the following parameters:

  • conn (Connection)

  • name (string)

  • options (object)

Returns Promise<HTTP.Body>

Update the named data source metadata

Expects the following parameters:

  • conn (Connection)

  • name (string)

  • metadata (T)

  • options (object)

Returns Promise<HTTP.Body>

Retrieve tables

Expects the following parameters:

  • conn (Connection)

  • name (string)

  • options (object)

Returns Promise<HTTP.Body>

Retrieve the named table metadata

Expects the following parameters:

  • conn (Connection)

  • name (string)

  • options (object)

Returns Promise<HTTP.Body>

One of the following values:

string | { query: string, options: object }

Query data source

Expects the following parameters:

Returns Promise<HTTP.Body>

Refresh table row-count estimates

Expects the following parameters:

  • conn (Connection)

  • name (string)

  • tableName (string)

Returns Promise<HTTP.Body>

Refresh metadata

Expects the following parameters:

  • conn (Connection)

  • name (string)

  • tableName (string)

Returns Promise<HTTP.Body>

Get suggestions for property matches on a model.

Expects the following parameters:

  • conn (Connection)

  • content (string)

  • options ({ accept?: string; contentType?: string })

Returns Promise<HTTP.Body>

Get information about the data source types supported by the stardog instance, and their options

Expects the following parameters:

Returns Promise<HTTP.Body>