Repository navigation
feat(indexer): stop virtual crates at records, with stubs for linked records - #141
Merged
Merged
Conversation
…records (#139) A virtual crate now holds its entity and everything it links to, directly or through entities that aren't records, up to the records it reaches. Each linked record is a stub (@id, @type, name, description, plus filename for a file), and what it links to is left out, so no record's description is copied into another's metadata. Before, the RO-Crate library followed every link, records included, so most rows held nearly their whole crate. The Australian Slang Survey Data crate's 35 rows drop from 3.4 GB to 1.1 GB: its files hold only a stub of their object, and its objects hold their participants with their postcode polygons.
johnf
force-pushed
the
spec/139-one-level-virtual-crates
branch
from
November 25, 2026 23:09
b8b644f to
3cba854
Compare
This was referenced Nov 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #139
Summary
A virtual crate now shows everything the crate says about its entity, broken down at record boundaries: each linked record is a stub, and the walk stops there.
conformsTois plain references. A record without its ownconformsTotakes the crate root's as{"@id"}references. Before, these were live entities that dragged in the profile and everything it linked to.GLOSSARY.mdupdates Virtual crate and adds Stub. The README already says to runpnpm index --forcewhen an upgrade changes what the indexes hold, so it is unchanged.derive(), insrc/indexer/derive.test.tsunder "rule 15".Evidence
derive()on the Australian Slang Survey Data crate (hdl10.26180~30102115, local copy of v3), before and after:metaacross 35 rows#Item01-VeryGood: its participants and their postcode polygons)derive()timepnpm test: 517 passed, with 100% coverage ofsrc/.pnpm lint(biome, knip, tsc) is clean.Merge Danger
Door: two-way. Nothing in the repository or the schema changes, and reverting followed by
pnpm index --forcerestores the old virtual crates.Blast Radius: served metadata, and indexing memory.
pnpm index --forceafter deploying.metaas text locally takes the heap to 2.36 GB, which is above the worker's default heap of about 2.1 GB. The row writer batches 1,000 rows at a time, so all 35 go in one write, and the Slang crate may still run out of memory. Batching by size as well is the spec's out-of-scope "indexing memory" issue.author,speaker,citation) show only a linked record's stub.Follow-up
A stub's id is the deposited id, so a crate-relative one can't be fetched from the API. Whether to rewrite relative ids when building the virtual crate, or to reject them at import, is #142. The current leaning is to rewrite them.
Review findings not fixed