feat: read documents written for any known openMINDS namespace - #112
Open
ehennestad wants to merge 2 commits into
Open
feat: read documents written for any known openMINDS namespace#112ehennestad wants to merge 2 commits into
ehennestad wants to merge 2 commits into
Conversation
Contributor
Test Results (R2022a)760 tests 758 ✅ 2m 44s ⏱️ For more details on these failures, see this check. Results for commit d042a60. ♻️ This comment has been updated with latest results. |
A document written before openMINDS v4 uses the openminds.ebrains.eu namespace, and one written from v4 uses openminds.om-i.org. Reading either one required the active model to match the document, so a v3 file failed under a v4 model with an assertion about the expected prefix, and a v4 file failed under a v3 model. Types.fromAtType now accepts both namespaces. The type name is the last segment of the @type in either form, and the types that share a name are the same type, so the document maps onto the active model regardless of which version wrote it. A namespace that belongs to neither is still rejected, now with an error naming both accepted prefixes and the value that was given rather than an assertion. A type name that does not exist in the active model was previously an eval error naming a MATLAB enumeration. It now reports the type name and the model version that does not have it. jsonld2struct stripped the vocabulary prefix by replacing a hardcoded openminds.ebrains.eu vocabulary IRI. Documents in expanded form written under v4 use a different vocabulary IRI and were left with property names that no type class has. It now strips every known openMINDS vocabulary, listed in one place. Cross-namespace reads are not warned about. A property that a version does not have fails when it is assigned, and the deserializer already reports every node it could not read, so genuine incompatibilities surface on their own. A warning on every legacy document would fire on correct use. The fixture test for legacy documents changes from asserting a clear rejection to asserting the document loads, which is what its own comment anticipated. A test that a foreign namespace is still rejected takes its place. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ehennestad
force-pushed
the
support-cross-namespace-loading
branch
from
August 28, 2026 12:59
d2c72e3 to
d042a60
Compare
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.
Documents written before openMINDS v4 use the
openminds.ebrains.eunamespace; from v4 they useopenminds.om-i.org. Reading one required the active model to match the document, so a v3 file failed under a v4 model and vice versa.Type resolution
Types.fromAtTypeasserted that every@typestarts with the base URI of the active model:Both namespaces are now accepted. The type name is the last segment of the
@typein either form —.../core/Personand.../types/Personboth end inPerson— and the types that share a name are the same type, so a document maps onto the active model whichever version wrote it.A namespace belonging to neither is still rejected, now with an error naming both accepted prefixes and the value actually given, rather than an assertion that only names one.
A type name that does not exist in the active model previously surfaced as an
evalfailure mentioning a MATLAB enumeration. It now reports the type name and the model version that lacks it.Vocabulary prefixes
jsonld2structremoved the vocabulary prefix from property names by replacing a hardcoded string:Documents in expanded form written under v4 use
https://openminds.om-i.org/props/, so their property names kept the prefix and matched nothing on the type classes. Every known openMINDS vocabulary is now stripped, listed in one place ingetVocabularyIRIs.What is deliberately not done
Cross-namespace reads produce no warning. A property that a version does not have fails when it is assigned, and the deserializer added earlier in this stack already reports every node it could not read, with identifiers. Genuine incompatibilities therefore surface on their own, whereas a warning on every legacy document would fire on entirely correct use and get ignored.
This is partial compatibility, not a migration layer. Types that were renamed or removed between versions will not resolve, and will be reported as unreadable nodes.
Tests
The fixture test for legacy documents changes from asserting a clear rejection to asserting that the document loads — which is what that test's own comment anticipated when it was written. A new test takes its place, checking that a document from a genuinely foreign namespace is still rejected with
OPENMINDS_MATLAB:Types:InvalidAtType.🤖 Generated with Claude Code