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
Summary
Section titled “Summary”Options for creating a clarification annotation in the knowledge graph.
Functions
Section titled “Functions”escapeSparqlTripleQuoted
Section titled “escapeSparqlTripleQuoted”function escapeSparqlTripleQuoted(text: string): stringEscapes 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) ReturnsstringDefined at: line 25
createClarificationAnnotation
Section titled “createClarificationAnnotation”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) ReturnsPromise<void>Defined at: line 41
Interfaces
Section titled “Interfaces”ICreateClarificationAnnotationOptions
Section titled “ICreateClarificationAnnotationOptions”interface ICreateClarificationAnnotationOptionsOptions for creating a clarification annotation in the knowledge graph.
Properties
message(IQanaryMessage): The qanary message containing the endpoint and graphcomponentName(string): The component name that creates the annotationclarificationQuestion(string): The clarification question text to store Defined at: line 9
In qanary-component-helpers
Section titled “In qanary-component-helpers”qanary-component-helpers/apiqanary-component-helpers/baseqanary-component-helpers/commonqanary-component-helpers/configurationqanary-component-helpers/create-annotationqanary-component-helpers/create-clarification-annotationqanary-component-helpers/generate-clarification-questionqanary-component-helpers/generate-object-retryqanary-component-helpers/get-domain-instancesqanary-component-helpers/get-question-uriqanary-component-helpers/get-questionqanary-component-helpers/indexqanary-component-helpers/interfaces/question-sparql-responseqanary-component-helpers/llm-providerqanary-component-helpers/message-operationsqanary-component-helpers/query-file-loaderqanary-component-helpers/query-sparqlqanary-component-helpers/utils/question-uri-query