Suggestions

Functions

accept_suggestion

accept_suggestion(suggestions: SuggestionRecord, accepted: ConceptSuggestion) -> AcceptedSuggestion:

Select one of the suggestions and make an AcceptedSuggestion out of it

ParameterTypeDescription
suggestionsSuggestionRecordA record of concepts retrieved by a search
acceptedConceptSuggestionA search result the user wants to accept

Returns AcceptedSuggestion

An AcceptedSuggestion with the details of this record and the chosen suggestion

Classes

ConceptSuggestion

class ConceptSuggestion:
    concept_id: int
    concept_name: str
    domain_id: str
    vocabulary_id: str
    standard_concept: str
    score: float = 0.0

A dataclass to hold a suggested concept

AttributeTypeDescription
concept_idintThe concept_id from the concept table
concept_namestrThe concept_name from the concept table
domain_idstrThe domain_id from the concept table
vocabulary_idstrThe vocabulary_id from the concept table
standard_conceptstrThe standard_concept from the concept table
scorefloatIf the concept has been retrieved with a score, this is it, else 0.0

AcceptedSuggestion

class AcceptedSuggestion:
    search_term: str
    domains: List[str]
    vocabs: List[str]
    search_standard_concept: bool
    valid_concept: bool
    search_mode: Literal["text-search", "vector-search", "ai-search"]
    concept_id: int
    concept_name: str
    domain_id: str
    vocabulary_id: str
    standard_concept: str
    score: float = 0.0

A dataclass to hold a suggestion accepted by a user

AttributeTypeDescription
search_termstrThe search term used to find the accepted concept
domainsList[str]The domains used to find the accepted concept
vocabsList[str]The vocabularies used to find the accepted concept
search_standard_conceptboolWhether only standard concepts were included in search
valid_conceptboolWhether only valid concepts were included in search
search_modeLiteral["text-search", "vector-search", "ai-search"]The search mode used to find the concept
concept_idintThe concept_id from the concept table
concept_namestrThe concept_name from the concept table
domain_idstrThe domain_id from the concept table
vocabulary_idstrThe vocabulary_id from the concept table
standard_conceptstrThe standard_concept from the concept table
scorefloatIf the concept has been retrieved with a score, this is it, else 0.0

SuggestionRecord

class SuggestionRecord:
    search_term: str
    domains: List[str]
    vocabs: List[str]
    standard_concept: bool
    valid_concept: bool
    search_mode: Literal["text-search", "vector-search", "ai-search"]
    suggestion: List[ConceptSuggestion]

A dataclass to hold the concepts retrieved by a search

AttributeTypeDescription
search_termstrThe search term used in search
domainsList[str]The domains included in search
vocabsList[str]The vocabularies included in search
standard_conceptboolWhether only standard concepts were included in search
valid_conceptboolWhether only valid concepts were included in search
search_modeLiteral[“text-search”, “vector-search”, “ai-search”]The search mode used to find concepts
suggestionList[ConceptSuggestion]Details of the concepts in search results