middleware.vocabulary.search_index¶
Build and query a lexical index over indexed RDF vocabulary terms.
Attributes¶
Classes¶
Normalized searchable fields for one vocabulary term. |
|
Lexical index over indexed vocabulary terms for ranked search. |
Functions¶
|
Remove combining marks after NFKD normalization. |
|
Split camelCase and separator-heavy identifiers into spaced words. |
|
Lowercase, accent-stripped text suitable for lexical matching. |
|
Return alphanumeric tokens extracted from normalized |
|
Return the fragment or final path segment of |
Module Contents¶
- class middleware.vocabulary.search_index.IndexedTerm¶
Normalized searchable fields for one vocabulary term.
- middleware.vocabulary.search_index.strip_accents(text: str) str¶
Remove combining marks after NFKD normalization.
- middleware.vocabulary.search_index.split_identifier(text: str) str¶
Split camelCase and separator-heavy identifiers into spaced words.
- middleware.vocabulary.search_index.normalize_text(text: str) str¶
Lowercase, accent-stripped text suitable for lexical matching.
- middleware.vocabulary.search_index.tokenize(text: str) tuple[str, Ellipsis]¶
Return alphanumeric tokens extracted from normalized
text.
- middleware.vocabulary.search_index.uri_local_name(uri: str) str¶
Return the fragment or final path segment of
uri.
- class middleware.vocabulary.search_index.VocabularySearchIndex¶
Lexical index over indexed vocabulary terms for ranked search.
- terms: tuple[IndexedTerm, Ellipsis]¶
- terms_by_uri: collections.abc.Mapping[str, IndexedTerm]¶
- classmethod build(context: middleware.vocabulary_configuration.VocabularyContext) Self¶
Index every term from
contextindexed vocabularies.
- search(query: str, *, vocabularies: tuple[str, Ellipsis] = (), term_types: tuple[middleware.namespaces.common.VocabularyTermType, Ellipsis] = (), limit: int = 8) middleware.vocabulary.search_model.TermSearchResponse¶
Rank indexed terms against
queryand return the toplimithits.