ontocast.tool.vector_store.patch_retriever¶
Retrieves multi-ontology context patches from vector search.
OntologyPatchRetriever
¶
Bases: Tool
Combines vector retrieval into one composite ontology graph.
Source code in ontocast/tool/vector_store/patch_retriever.py
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 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 | |
aretrieve(query, top_k=None, expand_sparql=True, subgraph_depth=1, max_total_triples=300, estimated_triples_per_query=24)
async
¶
Async single-query variant of :meth:aretrieve_ensemble.
Source code in ontocast/tool/vector_store/patch_retriever.py
aretrieve_ensemble(queries, top_k=None, expand_sparql=True, subgraph_depth=1, max_total_triples=300, estimated_triples_per_query=24)
async
¶
Vector search over all queries once, score-filter, dedupe, single subgraph expansion.
Hits are filtered per query and per channel relative to each channel's best
score (see PatchRetrievalConfig per-query ratio fields for core,
neighborhood, and BM25), then merged by rank fusion so channels with
different score distributions all contribute. Optional per-channel
min-best filters and min_merged_max_score reject weak or irrelevant
candidates.
Returns the merged RDF graph (possibly disconnected across ontologies) and sorted distinct ontology IRIs that contributed vector hits.
Source code in ontocast/tool/vector_store/patch_retriever.py
374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 | |
retrieve(query, top_k=None, expand_sparql=True, subgraph_depth=1, max_total_triples=300, estimated_triples_per_query=24)
¶
Retrieve top-k hits for one query and optional induced subgraph; returns source ontology IRIs.