Skip to content

qanary-component-helpers/create-clarification-annotation

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

qanary-component-helpers/create-clarification-annotation

Section titled “qanary-component-helpers/create-clarification-annotation”
  • Package: @leipzigtreechat/qanary-component-helpers
  • Source file: packages/qanary-component-helpers/src/create-clarification-annotation.ts

Options for creating a clarification annotation in the knowledge graph.

function escapeSparqlTripleQuoted(text: string): string

Escapes a string for safe use inside a SPARQL triple-quoted literal ("""…""").

The only problematic sequence is three consecutive double-quotes which would prematurely close the literal. We also escape backslashes so that existing escape sequences are preserved.

Parameters

  • text (string) Returns
  • string Defined at: line 25
function createClarificationAnnotation({
message,
componentName,
clarificationQuestion,
}: ICreateClarificationAnnotationOptions): Promise<void>

Writes an AnnotationOfClarification into the Qanary knowledge graph.

The annotation is stored as:

?annotation a <urn:qanary#AnnotationOfClarification> ;
oa:hasBody "the question text" .

This is the format expected by the chatbot’s TriplestoreService.queryClarifications().

Parameters

  • { message, componentName, clarificationQuestion, } (ICreateClarificationAnnotationOptions) Returns
  • Promise<void> Defined at: line 41
interface ICreateClarificationAnnotationOptions

Options for creating a clarification annotation in the knowledge graph.

Properties

  • message (IQanaryMessage): The qanary message containing the endpoint and graph
  • componentName (string): The component name that creates the annotation
  • clarificationQuestion (string): The clarification question text to store Defined at: line 9