ontocast.tool.vector_store.core¶
Core contracts and models for ontology vector storage.
GraphAtom
¶
Bases: BasePydanticModel
Embedding-ready ontology entity atom.
Source code in ontocast/tool/vector_store/core.py
representation
property
¶
Combined embedding text view for generic consumers.
OntologySearchHit
¶
Bases: BasePydanticModel
Typed retrieval result that separates atom payload from ranking metadata.
Source code in ontocast/tool/vector_store/core.py
OntologySearchHitsByChannel
¶
Bases: BasePydanticModel
Per-query retrieval hits split by vector channel (dense core/neighborhood + optional BM25).
Source code in ontocast/tool/vector_store/core.py
VectorStoreManager
¶
Bases: Tool
Abstract interface for vector store implementations.
Source code in ontocast/tool/vector_store/core.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | |
afetch_vectors(atom_ids)
async
¶
Async wrapper around :meth:fetch_vectors.
apply_tenancy(tenant, project, *, sep=TENANCY_SEP)
¶
Switch the active tenant/project partition when supported.
Source code in ontocast/tool/vector_store/core.py
asearch_patch_hits_many(queries, top_k=None, filter_iri=None, filter_version=None, filter_hash=None)
abstractmethod
async
¶
Async variant of :meth:search_patch_hits_many.
Source code in ontocast/tool/vector_store/core.py
clean_tenancy(tenant, project)
async
¶
Drop or empty vector collections derived from tenant / project.
Source code in ontocast/tool/vector_store/core.py
close()
¶
Release any backend connection held by this store.
Default is a no-op: backends that open no long-lived handle (LanceDB connects per call) have nothing to release.
delete_ontology(iri, version=None, ontology_hash=None)
abstractmethod
¶
Delete all indexed atoms for a specific ontology IRI.
fetch_atoms_by_ids(atom_ids)
¶
Batch-fetch atom payloads by atom_id (for lexical-trigger injection).
Source code in ontocast/tool/vector_store/core.py
fetch_vectors(atom_ids)
abstractmethod
¶
index_ontology(ontology)
abstractmethod
¶
initialize()
abstractmethod
async
¶
list_indexed_ontology_iris()
¶
Return distinct ontology_iri values present in the ontology store.
match_lexical_triggers(text, *, max_atoms=None)
¶
Match raw text against the lexical-trigger index and return atoms.
Source code in ontocast/tool/vector_store/core.py
prune_orphan_ontology_iris(keep_iris)
¶
Delete indexed atoms whose ontology_iri is not in keep_iris.
An empty keep_iris is refused rather than treated as "everything is
an orphan". Pruning exists to follow IRI renames, and no rename makes
every ontology disappear at once -- an empty catalog means the source of
truth could not be read, and deleting the whole index on that basis is
unrecoverable. Callers that genuinely want an empty store should call
:meth:wipe_store.
Returns the orphan IRIs that were deleted (sorted); empty when the prune was refused.
Source code in ontocast/tool/vector_store/core.py
reindex_ontology(ontology)
¶
Replace all atoms for a given ontology and return indexed count.
search_patch_hits(query, top_k=None, filter_iri=None, filter_version=None, filter_hash=None)
abstractmethod
¶
Search ontology atoms and return rank-fused scored hit objects.
Source code in ontocast/tool/vector_store/core.py
search_patch_hits_many(queries, top_k=None, filter_iri=None, filter_version=None, filter_hash=None)
abstractmethod
¶
Search ontology atoms for many queries with split-channel outputs.
Source code in ontocast/tool/vector_store/core.py
search_patches(query, top_k=None, filter_iri=None, filter_version=None, filter_hash=None)
abstractmethod
¶
Search ontology patches by query text (top_k None → store default).
Source code in ontocast/tool/vector_store/core.py
supports_tenancy_partition()
¶
wipe_store()
async
¶
Drop the currently configured ontology/facts collections or tables.
Call :meth:initialize afterwards to recreate empty schema.
Source code in ontocast/tool/vector_store/core.py
canonicalize_entity_role(role)
¶
Normalize role labels to vector-store vocabulary.