Skip to main content

World Class

The World class represents a single knowledge base instance.

Constructor

new World(options: {
  baseUrl?: string;
  apiKey: string;
  worldId: string;
  fetch?: typeof fetch;
})

Methods

sparqlQuery

Executes a SPARQL query against the world.
sparqlQuery(query: string, options?: { accountId?: string }): Promise<unknown>

sparqlUpdate

Executes a SPARQL update against the world.
sparqlUpdate(update: string, options?: { accountId?: string }): Promise<void>
Performs a semantic search within the world.
search(query: string, options?: {
  limit?: number;
  offset?: number;
  accountId?: string;
}): Promise<SearchResult>

get

Retrieves the world’s metadata.
get(options?: { accountId?: string }): Promise<WorldRecord | null>

update

Updates the world’s metadata.
update(data: WorldRecord, options?: { accountId?: string }): Promise<void>

remove

Deletes the world.
remove(options?: { accountId?: string }): Promise<void>