Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stacking of inferred schema constraints #166

Merged
merged 1 commit into from
May 18, 2022

Conversation

mristin
Copy link
Contributor

@mristin mristin commented May 18, 2022

We infer the schema constraints (currently only length and patterns)
based on the meta-model. We do not inherit them by default since we
usually generate the invariants for each class in the schema
separately and let the schema engine deal with the inheritance.

However, in the case of test data generation, it would be helpful if the
schema constraints are properly inherited among the classes.

In this patch, we re-structure the code and the tests to cater for that
use case and extend the logic with an additional function to stack the
schema constraints by the class ontology.

Unsurprisingly, a couple of bugs were discovered and fixed along
the re-structuring.

We infer the schema constraints (currently only length and patterns)
based on the meta-model. We do not inherit them by default since we
usually generate the invariants for each class in the schema
*separately* and let the schema engine deal with the inheritance.

However, in the case of test data generation, it would be helpful if the
schema constraints are properly inherited among the classes.

In this patch, we re-structure the code and the tests to cater for that
use case and extend the logic with an additional function to stack the
schema constraints by the class ontology.

Unsurprisingly, a couple of bugs were discovered and fixed along
the re-structuring.
@mristin mristin merged commit 071434f into main May 18, 2022
@mristin mristin deleted the mristin/Fix-max-length-not-inferred-on-id-shorts branch May 18, 2022 05:16
mristin added a commit that referenced this pull request May 24, 2022
* Verify the limitedness of type annotations (#156)
* Allow for subclass checks in intermediate (#164)
* Make stringify output multi-line string (#165)
* Fix stacking of inferred schema constraints (#166)
* Fix methods ignored in intermediate (#167)
* Allow contracts for impl.-specific methods (#168)
* Introduce ``specified_for`` for methods (#170)
* Re-visit inheritance of methods and signatures (#171)
* Add experimental support for ``any`` in invariants (#173)

C#
--
* Implement a practical set of visitors in C# (#151)
* Allow null enums in C# stringification (#152)
* Remove unused arguments in C# jsonization (#153)
* Specify more implementation keys in C# jsonization (#154)
* Fix documentation about classes in C# jsonization (#155)
* Write xmlization for C# (#157)
* Fix unspecified indention in C# (#161)
* Fix indention in snippets of C# jsonization (#162)
* Expect C# snippets for types in a directory (#169)

RDF+SHACL
---------
* Adapt RDF and SHACL to match aas-specs V3RC02 (#159)
@mristin mristin mentioned this pull request May 24, 2022
mristin added a commit that referenced this pull request May 24, 2022
* Verify the limitedness of type annotations (#156)
* Allow for subclass checks in intermediate (#164)
* Make stringify output multi-line string (#165)
* Fix stacking of inferred schema constraints (#166)
* Fix methods ignored in intermediate (#167)
* Allow contracts for impl.-specific methods (#168)
* Introduce ``specified_for`` for methods (#170)
* Re-visit inheritance of methods and signatures (#171)
* Add experimental support for ``any`` in invariants (#173)

C#
--
* Implement a practical set of visitors in C# (#151)
* Allow null enums in C# stringification (#152)
* Remove unused arguments in C# jsonization (#153)
* Specify more implementation keys in C# jsonization (#154)
* Fix documentation about classes in C# jsonization (#155)
* Write xmlization for C# (#157)
* Fix unspecified indention in C# (#161)
* Fix indention in snippets of C# jsonization (#162)
* Expect C# snippets for types in a directory (#169)

RDF+SHACL
---------
* Adapt RDF and SHACL to match aas-specs V3RC02 (#159)
mristin added a commit that referenced this pull request May 24, 2022
* Verify the limitedness of type annotations (#156)
* Allow for subclass checks in intermediate (#164)
* Make stringify output multi-line string (#165)
* Fix stacking of inferred schema constraints (#166)
* Fix methods ignored in intermediate (#167)
* Allow contracts for impl.-specific methods (#168)
* Introduce ``specified_for`` for methods (#170)
* Re-visit inheritance of methods and signatures (#171)
* Add experimental support for ``any`` in invariants (#173)

C#
--
* Implement a practical set of visitors in C# (#151)
* Allow null enums in C# stringification (#152)
* Remove unused arguments in C# jsonization (#153)
* Specify more implementation keys in C# jsonization (#154)
* Fix documentation about classes in C# jsonization (#155)
* Write xmlization for C# (#157)
* Fix unspecified indention in C# (#161)
* Fix indention in snippets of C# jsonization (#162)
* Expect C# snippets for types in a directory (#169)

RDF+SHACL
---------
* Adapt RDF and SHACL to match aas-specs V3RC02 (#159)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant