openminds.base.ControlledTerm.deserializeFromName (line 154) handles a name that matches no known instance with
warning('No matching instances were found for name "%s"', instanceName)
and returns a blank term with a fresh blank-node id. The caller gets an object of the right class with no name, no definition and no controlled-instance IRI, and a warning that is easy to lose in a long import. A collection then holds a term that serializes as an anonymous node under the controlled-terms type, which is invalid openMINDS: a controlled term must be one of the published instances.
The matching itself is generous: case-insensitive, whitespace-stripped, then matlab.lang.makeValidName with deletion. That is helpful for typing Species("mus musculus"), but it also means a near-miss silently resolves to nothing rather than to an error naming the closest instances. This is one cause of the ChemicalSubstance round-trip gap recorded in ommtest.helper.knownRoundTripGap.
Proposal:
- Error by default with an identified id, listing the nearest known names (edit distance on the
CONTROLLED_INSTANCES constant is cheap).
- Keep a lenient mode as an explicit option for interactive use.
- Never construct a controlled term without a controlled-instance IRI unless the caller asked for a reference (
IsReference=true with an id).
🤖 Generated with Claude Code
openminds.base.ControlledTerm.deserializeFromName(line 154) handles a name that matches no known instance withand returns a blank term with a fresh blank-node id. The caller gets an object of the right class with no name, no definition and no controlled-instance IRI, and a warning that is easy to lose in a long import. A collection then holds a term that serializes as an anonymous node under the controlled-terms type, which is invalid openMINDS: a controlled term must be one of the published instances.
The matching itself is generous: case-insensitive, whitespace-stripped, then
matlab.lang.makeValidNamewith deletion. That is helpful for typingSpecies("mus musculus"), but it also means a near-miss silently resolves to nothing rather than to an error naming the closest instances. This is one cause of theChemicalSubstanceround-trip gap recorded inommtest.helper.knownRoundTripGap.Proposal:
CONTROLLED_INSTANCESconstant is cheap).IsReference=truewith an id).🤖 Generated with Claude Code