Skip to content
6 changes: 2 additions & 4 deletions code/internal/+openminds/+internal/+vocab/getSchemaName.m
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions code/internal/+openminds/+internal/getControlledInstance.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tools/tests/unitTests/testReadTheDocLinks.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading