Can connect to bootstrap with express.js but error on client.query() from POST request

Hey posting my devlog here now since I think it might be better than in the Docs subforum. So after reading the docs that were hidden by the Jekyl bug, and realizing that the console queries were also WOQL.js (I figured it out by looking at the dropdown, but I didn’t see anywhere in the docs that I was writing WOQL.js) I’ve tried to create an express route. I’ll include the code below but I’m getting an error and I don’t know what I’m doing wrong. I really think this could’ve been avoided by just providing a simple example in about how to send client.query() which is basically all you need.

My Express code:

const express = require("express");
const app = express();
const port = 3000;

const TerminusClient = require("@terminusdb/terminusdb-client");

//Create a new instance of terminusDB client
const client = new TerminusClient.WOQLClient("", {
  dbid: "banker",
  user: "admin",
  key: "root",

//use async/await.
async function getCapabilities() {
  try {
    const response = await client.connect();
    return response;
  } catch (err) {
}"/account", (req, res) => {
  const WOQL = TerminusClient.WOQL;
  const query = WOQL.and(
    WOQL.add_triple("doc:illuminati", "type", "scm:BankAccount"),
    WOQL.add_triple("doc:illuminati", "owner", "illuminati"),
    WOQL.add_triple("doc:illuminati", "balance", 223)
    .query(query, "commit yo")
    .then((response) => {
    .catch((err) => {
      console.log("error", err);
  res.send("express is good");

app.listen(port, () => {
  console.log(`Backend Server listening at http://localhost:${port}`);
    .then(function (response) {
      // handle success
    .catch(function (error) {
      // handle error

Starting express with $ npm start gives the following in the terminal:

Backend Server listening at http://localhost:3000
  '@context': {
    api: '',
    doc: 'terminusdb:///system/data/',
    layer: '',
    owl: '',
    rdf: '',
    rdfs: '',
    ref: '',
    repo: '',
    system: '',
    terminus: '',
    vio: '',
    woql: '',
    xdd: '',
    xsd: ''
  '@id': 'doc:admin',
  '@type': 'system:User',
  'rdfs:comment': {
    '@language': 'en',
    '@value': 'This is the server super user account'
  'rdfs:label': { '@language': 'en', '@value': 'Server Admin User' },
  'system:agent_name': { '@type': 'xsd:string', '@value': 'admin' },
  'system:role': {
    '@id': 'doc:admin_role',
    '@type': 'system:Role',
    'rdfs:comment': {
      '@language': 'en',
      '@value': 'Role providing admin capabilities'
    'rdfs:label': { '@language': 'en', '@value': 'Admin Role' },
    'system:capability': {
      '@id': 'doc:server_access',
      '@type': 'system:Capability',
      'rdfs:comment': [Object],
      'rdfs:label': [Object],
      'system:action': [Array],
      'system:capability_scope': [Array]
  'system:user_key_hash': ''

And my error when hitting POST /account:

error Error: API Error @type api:WoqlErrorResponse api:message The following descriptor could not be resolved to a resource: 'false/false/local/branch/main' api:status api:failure Code: 404 url:
    at /home/harman/Desktop/endgame/backend/node_modules/@terminusdb/terminusdb-client/lib/dispatchRequest.js:132:31
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  data: {
    '@type': 'api:WoqlErrorResponse',
    'api:error': {
      '@type': 'api:UnresolvableAbsoluteDescriptor',
      'api:absolute_descriptor': 'false/false/local/branch/main'
    'api:message': "The following descriptor could not be resolved to a resource: 'false/false/local/branch/main'",
    'api:status': 'api:failure'

I’m guessing I gotta do something like

await client.connect()
client.query(query, 'hello world commit'
client.connect().then((response_unused) => {
  client.query(query, 'hello world commit')

But I found no guidance or examples in the docs and thats unfortunate. I’ll try to fix my error with the above approaches. Or is it something else I’m missing?

1 Like