You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two related gaps around string formats the schemas constrain:
Regex-constrained types are untested. The round-trip synthesizer cannot generate values that satisfy a pattern, so RoundTripTest filters out every type whose properties are all pattern-constrained: "Every property of "ORCID" is constrained by a regular expression, which the synthesizer does not generate values for", and the same for SWHID. The digital-identifier types are the ones users most often get wrong, and they are the least tested.
Format coverage in the generated classes is narrow.mustMatchPattern appears in 13 files of the latest model, mustBeValidEmail, mustBeValidDate and mustBeValidTime in a few dozen more. The schemas carry _formats (iri, email, date, date-time, time, ECMA262) for many more properties. A property declared iri becomes a plain string here, so a non-IRI value is accepted and exported.
openMINDS_Python has the same hole from the other direction: formatting and multiline are captured in every Property but validate() has # todo: check formatting, multiline, and its IRI check only runs when the value is already an IRI object.
Proposal:
Give the synthesizer a small table of valid example values per pattern (an ORCID, a DOI, a SWHID, an email) so those types enter the round-trip suite.
Have the pipeline emit a validator for every _formats entry, not only the ones it currently maps, and add an IRI validator.
Add the identifier types to the interop fixture, since the Python library is stricter about some of them and lenient about others; the corpus (Shared JSON-LD conformance corpus with openMINDS_Python #162) is where the agreed behaviour should live.
Two related gaps around string formats the schemas constrain:
Regex-constrained types are untested. The round-trip synthesizer cannot generate values that satisfy a pattern, so
RoundTripTestfilters out every type whose properties are all pattern-constrained: "Every property of "ORCID" is constrained by a regular expression, which the synthesizer does not generate values for", and the same forSWHID. The digital-identifier types are the ones users most often get wrong, and they are the least tested.Format coverage in the generated classes is narrow.
mustMatchPatternappears in 13 files of the latest model,mustBeValidEmail,mustBeValidDateandmustBeValidTimein a few dozen more. The schemas carry_formats(iri, email, date, date-time, time, ECMA262) for many more properties. A property declarediribecomes a plainstringhere, so a non-IRI value is accepted and exported.openMINDS_Python has the same hole from the other direction:
formattingandmultilineare captured in everyPropertybutvalidate()has# todo: check formatting, multiline, and its IRI check only runs when the value is already anIRIobject.Proposal:
_formatsentry, not only the ones it currently maps, and add an IRI validator.🤖 Generated with Claude Code