diff --git a/code/internal/+openminds/+internal/+vocab/getSchemaName.m b/code/internal/+openminds/+internal/+vocab/getSchemaName.m index c9130968..e10bf6d6 100644 --- a/code/internal/+openminds/+internal/+vocab/getSchemaName.m +++ b/code/internal/+openminds/+internal/+vocab/getSchemaName.m @@ -24,14 +24,12 @@ end C = struct2cell(typesVocab); - S = [C{:}]; - - allNames = {S.name}; + allNames = cellfun(@(c) string(c.name), C); isMatch = strcmpi(allNames, nameAlias); if ~any(isMatch) - allLabels = {S.label}; + allLabels = cellfun(@(c) string(c.label), C); isMatch = strcmpi(allLabels, nameAlias); end diff --git a/code/internal/+openminds/+internal/@InstanceLibrary/InstanceLibrary.m b/code/internal/+openminds/+internal/@InstanceLibrary/InstanceLibrary.m index 333e1cbc..de242631 100644 --- a/code/internal/+openminds/+internal/@InstanceLibrary/InstanceLibrary.m +++ b/code/internal/+openminds/+internal/@InstanceLibrary/InstanceLibrary.m @@ -148,6 +148,9 @@ function postSetLibraryVersion(obj) numInstances = numel(filePaths); [types, modules, subGroups] = deal(repmat("", numInstances, 1)); + + hasWarned = containers.Map(); + for i = 1:numInstances thisFolderSplit = split(folderNames(i), filesep); @@ -179,7 +182,13 @@ function postSetLibraryVersion(obj) modules(i) = "core"; subGroups(i) = missing; else - error('The instance folder with name "%s" is not implemented. Please report', thisFolderSplit(1)) + + if ~isKey(hasWarned, thisFolderSplit(1)) + warning('OPENMINDS:InstanceLibrary:createInstanceTable:MissingTypeMapping', ... + ['The instance folder with name "%s" is not ', ... + 'mapped to an openMINDS type. Please report'], thisFolderSplit(1)) + hasWarned(thisFolderSplit(1)) = true; + end end end diff --git a/code/internal/+openminds/+internal/getControlledInstance.m b/code/internal/+openminds/+internal/getControlledInstance.m index d8d7c7d3..87c151a9 100644 --- a/code/internal/+openminds/+internal/getControlledInstance.m +++ b/code/internal/+openminds/+internal/getControlledInstance.m @@ -13,6 +13,13 @@ if ismissing(versionNumber) versionNumber = openminds.getModelVersion("VersionNumber"); end + + % Todo: remove. Pin latest version to v4.0 as instances from v5.0 are not + % supported yet. + if versionNumber == "latest" + versionNumber = openminds.internal.utility.VersionNumber("4.0"); + versionNumber.Format = "vX.Y"; + end versionNumber = string(versionNumber); % Make type name lowercase unless it is an abbreviated typename like diff --git a/tools/tests/unitTests/testReadTheDocLinks.m b/tools/tests/unitTests/testReadTheDocLinks.m index bc8af99c..62320deb 100644 --- a/tools/tests/unitTests/testReadTheDocLinks.m +++ b/tools/tests/unitTests/testReadTheDocLinks.m @@ -31,18 +31,18 @@ function testInvalidDocumentationUrl(testCase) 'MATLAB:webservices:HTTP404StatusCodeError') end - function testSchemaDocLinkUBERONParcellation(testCase) + function testSchemaDocLinkBiologicalSex(testCase) import openminds.internal.utility.getSchemaDocLink url = getSchemaDocLink(... - "openminds.controlledterms.UBERONParcellation", ... + "openminds.controlledterms.BiologicalSex", ... "Raw URL"); try webread(url); catch ME errorMessage = sprintf([... - 'Failed to read documentation for UBERONParcellation with error:\n', ... + 'Failed to read documentation for BiologicalSex with error:\n', ... '%s'], ME.message); testCase.verifyFail(errorMessage) end