Skip to content

fix(sefariasqlite): stop orienting links between reference works and texts - #97

Merged
kdroidFilter merged 1 commit into
masterfrom
fix/reference-work-orientation-503
Oct 8, 2026
Merged

kdroidFilter merged 1 commit into
masterfrom
fix/reference-work-orientation-503

Conversation

@kdroidFilter

Copy link
Copy Markdown
Owner

Fixes kdroidFilter/Zayit#503

Problem

Otzar La'azei Rashi appears in Rashi's מקורות panel. Sefaria types the Otzar La'azei Rashi → Rashi on X rows as commentary (~3.8k links). The dictionary has no dependence while Rashi on X does, so the dependence-asymmetry step of resolveDirectionalConnectionTypesForMeta picks the dictionary as the base. The reverse is also wrong: ~2.5k links like Shabbat → Otzar made Otzar appear as a commentator on the Talmud.

Fix

  • Flag books whose top-level Sefaria category is Reference (isReferenceWork, BookPayload → BookMeta).
  • When exactly one side of an oriented link is a reference work, store it as REFERENCE, so it no longer feeds the SOURCE view or the commentators panel.
  • Links where both sides are reference works keep their orientation (Hafla'ah she-ba'Arakhin on Sefer HeArukh, the Hagahot on Shem HaGedolim).

Checked against the current DB: apart from Otzar, only 3 links are affected, and all 3 were wrong (e.g. Ibn Ezra on Tehillim as a commentary on Machberet Menachem).

Tests

  • SefariaLinksImporterTest: reference work vs. commentary → REFERENCE; commentary on a reference work → still oriented.
  • :sefariasqlite:jvmTest passes. The DB was not regenerated.

…texts

Sefaria types the Otzar La'azei Rashi -> Rashi on X rows as `commentary`.
The dictionary has no `dependence` while Rashi does, so the dependence
asymmetry made the dictionary Rashi's base, and it showed up in Rashi's
sources panel (and as a commentator on the Talmud in the other direction).

Flag books whose top-level Sefaria category is `Reference` and store
oriented links between a reference work and a non-reference book as
REFERENCE. Links inside the reference category (Hafla'ah she-ba'Arakhin
on Sefer HeArukh) keep their orientation.

Fixes kdroidFilter/Zayit#503

Signed-off-by: Elie Gambache <elyahou.hadass@gmail.com>
@kdroidFilter
kdroidFilter merged commit 307373f into master Oct 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Le'azei Rashi shows up as a source

1 participant