Skip to content

Support predicate_id and mapping_justification being propagatable - #20

Open
gouttegd wants to merge 5 commits into
mainfrom
make-predicate-id-propagatable
Open

gouttegd wants to merge 5 commits into
mainfrom
make-predicate-id-propagatable

Conversation

@gouttegd

@gouttegd gouttegd commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

There is an ongoing discussion in the SSSOM spec about making predicate_id and mapping_justification propagatable.

This PR supports them being propagatable but with the caveat that their condensation is strongly discouraged: they are always propagated when reading a set, but never condensed when writing, unless this is explicitly asked for.

gouttegd and others added 5 commits September 25, 2026 16:25
With the recent changes to the Java generator in LinkML-Py,
EntityReference-typed slots are no longer automatically mapped to
String - they are mapped to URI instead. We need to explicitly override
that.
The SSSOM spec may (or not…) soon mark some slots as being propagatable
while recommending against their condensation.

We support this by making the `Propagatable` field annotation accept an
optional boolean parameter (`condensationDiscouraged`). A slot marked
with `Propagatable(condensationDiscouraged=true)` will always be
propagated as any other propagatable slot, but by default will not be
condensed.
Add a mechanism to mark slots whose condensation is to be discouraged
directly within the SSSOM schema. Update the Java generator and the
template accordingly to exploit that annotation when present.
As currently under discussion in the SSSOM spec, we mark the
predicate_id and mapping_justification slots (as well as the
predicate_label slot) as being propagatable but with the caveat that
their condensation is discouraged.
Add a `setForceCondensation()` method to SSSOMWriter to allow client
code to force the writer to condense all propagatable slots, even those
that should not be condensed. The default behaviour remains not to
condense those slots.

Also expose that settings to the command line tool, in the form of a new
option `--condense-all-slots`.
@drkotireddysaripalli

Copy link
Copy Markdown

One source-level edge in this PR seems worth checking: the cached slot set depends on which operation runs first.

At the pinned head's getSlots(boolean force), force controls which names enter the single slots cache, but only when that cache is first populated. Subsequent calls return that same set regardless of the new argument. Propagation passes true, while condensation passes forceCondensation, which defaults to false.

With a single helper reused at a fixed compatible version, the source appears to allow these two order-dependent outcomes:

  1. Ordinary condensation, then propagation: the first call caches a set excluding the discouraged core slots. A subsequent propagation of a fully condensed core-slot set reuses that restricted set, so its core values appear to be skipped despite propagation requesting all slots.
  2. Propagation, then ordinary condensation: the first call caches all propagatable slots. After propagation fills the records and removes their set-level values, a subsequent ordinary condensation reuses the unrestricted set and appears able to condense those core slots even though forcing is disabled.

The first sequence can use different mapping sets; the second can use the same set after the first operation. Keeping the version fixed matters because changing maxVersion clears the cache. Changing the force setting does not.

The new core propagation test sets forcing to false afterward, but does not then invoke condensation. The new forced-condensation test also begins with a fresh helper. Testing both operation orders on one helper would therefore exercise a different path from those existing cases. Caching the full eligible set and filtering per operation, or keeping separately keyed sets, seems worth considering.

This is a source inspection and proposed regression check, not an executed Java reproducer. I have not run the Java/Maven suite. The writer's condenseSet currently creates a fresh helper, so I am limiting this observation to reuse through the public SlotPropagator methods, not alleging a failure in the ordinary writer/CLI path or an adopted SSSOM rule.

Affiliation: Bharath Healthcare / Pinnacle Blooms Network. Prepared with Codex assistance; the pinned code paths, existing tests, and limits were reviewed.

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.

2 participants