Skip to content

chatbot/triplestore-service

This page is auto-generated from TSDoc output. Edit the source file, not this Markdown.

  • Package: @leipzigtreechat/chatbot
  • Source file: packages/chatbot/src/triplestore-service.ts

Wraps SPARQL query failures so triplestore access can be modeled in Effect.

class SPARQLError extends Data.TaggedError("SPARQLError")<{ reason: any }>

Wraps SPARQL query failures so triplestore access can be modeled in Effect.

Extends: Data.TaggedError("SPARQLError")<{ reason: any }> Methods

  • constructor(reason: any) Defined at: line 15
class NotFoundError extends Data.TaggedError("NotFoundError")<{ itemType: QanaryItemType }>

Indicates that the requested Qanary annotation type was not present in the graph.

Extends: Data.TaggedError("NotFoundError")<{ itemType: QanaryItemType }> Methods

  • constructor(itemType: QanaryItemType) Defined at: line 26
class TriplestoreService extends Context.Tag("Triplestore")<TriplestoreService, TriplestoreInterface>()

Effect service for querying clarification data from the configured triplestore.

Extends: Context.Tag("Triplestore")<TriplestoreService, TriplestoreInterface>() Properties

  • Live (unknown): Live implementation backed by the TRIPLESTORE_URL environment config. Defined at: line 49
type TriplestoreInterface = {
/**
* Loads all non-empty clarification annotations from the given named graph.
*/
readonly queryClarifications: (graphUri: string) => Effect.Effect<Array<QanaryClarificationQuestion>, SPARQLError>;
/**
* Loads the most recent non-empty final answer annotation from the given named graph.
*/
readonly queryFinalAnswer: (graphUri: string) => Effect.Effect<QanaryFinalAnswer, NotFoundError | SPARQLError>;
}

Contract for triplestore reads needed by the chatbot package.

Defined at: line 35