Skip to content
4 changes: 4 additions & 0 deletions code/internal/+openminds/+internal/+utility/+string/uriJoin.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
function strURI = uriJoin(varargin)
%uriJoin Join segments of a URI using the forward slash (/)
try
if isa(varargin{1}, 'string')
listOfStrings = [varargin{:}];
strURI = join(listOfStrings, "/");
elseif isa(varargin{1}, 'char')
listOfStrings = varargin;
strURI = strjoin(listOfStrings, '/');
end
catch
varargin{:}
Comment thread Fixed
Comment thread Fixed
end
end
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
6 changes: 6 additions & 0 deletions code/internal/+openminds/getModelVersion.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
end
versionNum = cachedVersionNumber;

% Todo: remove. Pin latest version to v4.0 as v5.0 is not supported yet.
if versionNum == "latest"
versionNum = openminds.internal.utility.VersionNumber("4.0");
versionNum.Format = "vX.Y";
end

if outputType == "char"
versionNum = char(versionNum);
end
Expand Down
3 changes: 2 additions & 1 deletion tools/tests/+ommtest/+internal/MetaTypeTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ function testRegistrySingleton(testCase)

registry = MetaTypeRegistry.getSingleton();
testCase.verifyClass(registry, 'openminds.internal.meta.MetaTypeRegistry');
testCase.verifyEqual(registry.ModelVersion, "latest")
% Todo: uncomment. Currently pinned to v4.0 as v5.0 is not supported yet.
% testCase.verifyEqual(registry.ModelVersion, "latest")

% Verify that we get the same handle if we ask for the singleton again
newRegistry = MetaTypeRegistry.getSingleton();
Expand Down
Loading