fix: take an identifier-only mixed-type link from the instance library - #196
Open
ehennestad wants to merge 1 commit into
Open
ehennestad wants to merge 1 commit into
ehennestad wants to merge 1 commit into
Conversation
A property that holds several types held a bare @id as a MixedTypeReference, whatever the identifier named. When it named a controlled instance, the collection added it as a node, and saving failed because a reference of unknown type is not a metadata type. Controlled terms and IRI strings in the same properties are already taken from the library at construction; a struct carrying only a library IRI now is too, and a lookup the library cannot serve keeps the link as a reference and says why. The serializer no longer queues a reference as a document of its own, at any recursion depth. That closes the same failure for Node.serialize. ParcellationTerminologyVersion and QuantitativeRelationAssessment leave the known round-trip gaps, since the reason they were listed is gone. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
Test Results (R2022a)861 tests 857 ✅ 5m 3s ⏱️ Results for commit b5bc40f. |
Contributor
Test Results (R2026a)861 tests 859 ✅ 4m 30s ⏱️ Results for commit b5bc40f. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #196 +/- ##
==========================================
- Coverage 80.37% 80.25% -0.13%
==========================================
Files 424 424
Lines 4403 4436 +33
==========================================
+ Hits 3539 3560 +21
- Misses 864 876 +12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ehennestad
added this pull request to stack #201
September 19, 2026 16:29
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.
Fixes the R2026a test failure in run 34695830401:
RoundTripTest/testJsonLdRoundTrip(MetadataType=AnatomicalAtlasVersion)errored withOPENMINDS_MATLAB:MetaTypeRegistry:InvalidKeybecause the serializer was handed anopenminds.internal.MixedTypeReferenceas if it were a node.Cause
A property that holds several types stored a bare
{"@id": ...}as aMixedTypeReference, whatever the identifier named. When it named a controlled instance,Collection.addNodetreated it as a controlled instance and made it a node, and saving failed because a reference of unknown type is not a metadata type. The regenerated toolbox from openMetadataInitiative/openMINDS_MATLAB_pipeline#193 exposed this forAnatomicalAtlasVersion: its linked types gainedHasControlledInstance, so the round-trip synthesizer now fills them from real library documents, one of which linksusageConditionto a licence by@id. The same defect was already recorded inknownRoundTripGapforParcellationTerminologyVersionandQuantitativeRelationAssessment.Controlled terms built from a bare identifier, and IRI strings assigned to mixed-type properties, are already taken from the instance library at construction. A struct carrying only a library IRI was the one input that was not.
Change
MixedTypeSet: an identifier-only link whose identifier is a controlled instance IRI is taken from the library withopenminds.instanceFromIRIand checked against the allowed types. Any other identifier stays aMixedTypeReference. So does a library lookup that fails, with a warning carrying the cause; the library does not always hold what an IRI points to, for example an IRI spellingMNIColin27_1998where the file isMNI-Colin27_1998.Serializer.enqueueDocument: a reference is never queued as a document of its own, at any recursion depth. This also fixesNode.serialize()on a node holding a mixed-type reference, which failed the same way at the default recursion depth.knownRoundTripGap:ParcellationTerminologyVersionandQuantitativeRelationAssessmentare removed, since both now round-trip.Not changed
{"@type", "@id"}documents. That is round-trip stable and out of scope here, but in the atlas case it is 1339 near-empty documents out of 1365 and deserves its own issue.dictionary, which that release lacks; the call fails inside a try/catch and the affected properties are silently skipped. Worth a separate fix so the R2022a run stops passing vacuously.🤖 Generated with Claude Code