Repository navigation
doc ingest: --ontology replaces --model, --catalog names --entities (and takes a mapped table) - #2206
Conversation
`--model` on `fluree doc ingest` named the ontology, which collided with every other "model" around it: `fluree model` (governance), `[doc.llm] model`, and the extraction model itself. It is now `--ontology`, with no alias, so `--model` is free to name the extraction model. `--catalog` is a visible alias for `--entities`, and a catalog (or any entities source) can now be a graph source mapped over a table (`fluree iceberg|sql|delta map`) as well as a ledger or a file: its labels are read through the mapping, and a mention keeps the IRI the mapping mints. Breaking: scripts passing `--model <ontology>` to `doc ingest` must pass `--ontology <ontology>`; the old spelling is a usage error. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016CjYmSGfnxzJgMSzBESNee
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016CjYmSGfnxzJgMSzBESNee
bplatz
left a comment
There was a problem hiding this comment.
Approving. One inline note on which graph sources count as a catalog, and one for the follow-up.
For the follow-up that gives --model its new meaning: since --model <ontology> has been on doc ingest since v4.2.0, a script that isn't updated will pass an ontology path or ledger name where an extraction-model name now goes. A value that looks like an ontology source (an RDF file extension, or the name of an existing ledger) could get a pointed "did you mean --ontology?" rather than reaching the LLM endpoint as a model name.
Checked and sound:
sqlanddeltaboth implyiceberg, so thecfg!(feature = "iceberg")gate covers every table source.- A mapped table is read through
fluree.graph(alias).query(), the pathfluree query <graph-source>takes, and the Delta test checks the minted mention IRIs (and fails with the branch disabled). - The rename is complete: the
--modelmentions left in the docs are theiceberg|sql|delta map --modelgovernance flag, a different command.
| async fn is_graph_source(fluree: &Fluree, id: &str) -> CliResult<bool> { | ||
| if !cfg!(feature = "iceberg") { | ||
| return Ok(false); | ||
| } | ||
| Ok(fluree | ||
| .nameservice() | ||
| .lookup_graph_source(id) | ||
| .await? | ||
| .is_some_and(|r| !r.retracted)) |
There was a problem hiding this comment.
This accepts any live graph source, including BM25, vector and geo indexes, not only a table mapped through iceberg|sql|delta map. Passed as --catalog, one of those reaches the label queries through the mapping path, where it would either fail with an error about the mapping or come back with no labels, and the ingest would carry on with an empty gazetteer. Checking r.source_type against R2rml | Iceberg | Sql | Delta, and refusing the rest with a clear message (x is a BM25 index, not a mapped table), would keep the error where the help text points.
There was a problem hiding this comment.
Good catch, and you're right: lookup_graph_source hands back any live record, so a BM25 index sailed through. In practice it failed with a misleading Ledger not found: memos-text:main rather than the empty gazetteer, but either way the error was nowhere near the help text.
Fixed in 0c50148. Opened::open now checks r.source_type.kind() == GraphSourceKind::Mapped (so R2RML, Iceberg, SQL and Delta) and refuses the rest by what they are: memos-text is a BM25 full-text index, not a table mapped as a graph source; a source is a ledger, a file, or a graph source from fluree iceberg|sql|delta map. The test uses the memos-text index the first ingest builds, and I checked that it fails against the old check.
`--catalog` / `--entities` accepted any live graph source, so a BM25, vector or geo index named there reached the label queries and failed with an unrelated "Ledger not found". A source is now read only when its kind is a mapped table (R2RML, Iceberg, SQL, Delta); an index is refused by what it is: "memos-text is a BM25 full-text index, not a table mapped as a graph source". Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016CjYmSGfnxzJgMSzBESNee
|
Thanks @bplatz! The inline one is fixed here (reply on the thread). On the |
Brings #2247, #2232, #2246, #2248, #2245, #2230, #2205, #2231, #2255, #2219, #2209, #2207, #2190, #2216, #2186, #2215, #2213, #2184, #2210, #2206, #2198, #2187, #2183, #2200, #2193, #2199, #2196 and #2145 into next. Resolutions: - Novelty: main's fact-state trim (a cutoff plus a bounded sweep) and the dictionary's coverage watermark sit on next's graph slots and per-graph OrdMaps. A commit's reification links count toward coverage. Planner stats from segment sums decline under annotations, whose link deltas only the walk counts, and otherwise carry the indexed link counts. - Stats-view identity: the index root's id reaches the snapshot through next's root decoder (`decode` takes the id, as `take_snapshot_metadata` does). `LedgerState::load_record` has a decoding-root form beside `load_decoding_root`. - Transact: #2184's parallel-relationship check runs in next's link cascade, counting the `rdf:reifies` links on the retracted edge that the transaction does not retract itself. Main's bundle `edge_reifiers` is dropped, and `subjects_with_prior_rows` and `enforce_single_target_reifiers` stay deleted. The upsert pre-check takes main's dictionary probe and bounded seek. - Query: geo search resolves the graph's POST tree once at open (pooled graphs keep their filter), an empty manifest when there is none. `branch_or_none` reads the dedicated branch, and the batched joins keep next's pooled lanes. The stats-view key hashes the root id. - Indexer: `apply_dict_novelty` and `compact_forward_streams` take the cycle's compaction budget, so the term dictionary keeps its reserved share. `Prefetched` holds `ContentBytes`. `relocalize_sorted_commit` rewrites next's 20-byte types records. - Disk cache: main's in-flight write registration, with an empty entry still read as crash debris that a write replaces. The process-wide eviction walk stays removed. - Graph import (#2232): fenced CAS and publishes, the seed carries the record's namespace and fence, 32-bit graph ids and next's loaders. An import into a graph of an existing ledger refuses triple terms and edge annotations: the splice merges no triple-term dictionary yet. - Iceberg: `create_iceberg_graph_source` goes with main (a source needs a mapping); the R2RML path keeps next's `model_instance`. - CLI: main's shared import flags without the leaflet flags; `graph import` routes through next's process-wide server routing, and `upload_source_import` serves next's `Destination`. Doc sources read a ledger through the command's open instance. - Tests: sibling ledger ids become distinct names, `genesis_ledger` is awaited, Cypher state dumps include each relationship's `rdf:reifies` link, and the graph-import arena test checks the refusal instead.
--modelonfluree doc ingesthas always named the ontology, which collides with pretty much every other "model" around it:fluree model(governance),[doc.llm] model(an LLM name), and, soon, the extraction model itself. So this renames it to--ontologyoutright, with no alias, which frees--modelto name the extraction model in a follow-up.--catalogbecomes a visible alias for--entities.While I was in here,
--entities/--catalogalso learned to take a graph source mapped over a table (fluree iceberg|sql|delta map), alongside a ledger or a file. Before this,Opened::openindoc_sources.rsonly checkedledger_exists, so a mapped source came back as "no such ledger". Now, when the name isn't a ledger but is a live graph source, its labels are read throughfluree.graph(alias).query(), the same R2RML-aware pathfluree query <graph-source>takes, and a mention keeps the IRI the mapping mints. That means a CRM or warehouse table can be the catalog directly, without exporting it to Turtle first.Breaking: a script passing
--model <ontology>todoc ingestnow gets a usage error (exit 2) and needs--ontology <ontology>. I think that's the right call while the flag is this young, but it's worth a line in the release notes, hence thebreaking-changelabel.What changed:
fluree-db-cli/src/cli.rs:DocIngestArgs.model→ontology;entitiesgetsvisible_alias = "catalog", and the help text names the graph-source form.fluree-db-cli/src/commands/doc.rs: the rename throughsetup_extraction,run_extractionandannounce(the run header now readsontology <source> (N classes, M properties)).fluree-db-cli/src/commands/doc_sources.rs: the graph-source branch inOpened(is_graph_source, which reads as missing in a build withouticeberg, so the error stays "no such ledger or graph source" there rather than a failed query).docs/cli/doc.mdanddocs/unstructured/**.Tests:
doc_ingest_catalog_names_the_entities_and_model_is_no_longer_the_ontology(integration.rs):--cataloggives the same scan as--entities, and--modelis refused with exit 2.doc_ingest_reads_a_catalog_from_a_mapped_table(delta_source.rs): maps the committeddim_storeDelta fixture withskos:prefLabelovername, ingests a memo naming two stores, and checks both mentions point athttp://example.org/store/{id}. I checked it isn't vacuous: with the graph-source branch disabled it fails with "no such ledger or graph source".cargo test -p fluree-db-cli --test integration doc_(16 passed),--test delta_source(3 passed),--test docs_coverage(5 passed), andcargo clippy -p fluree-db-cli --all-targets --no-deps(clean). I haven't run the full workspace suite locally, so CI is the gate for everything else.🤖 Generated with Claude Code
https://claude.ai/code/session_016CjYmSGfnxzJgMSzBESNee