-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add metadata to schema #9
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Two comments. These comments are just for discussion and consideration at this point. No need to implement in the PR.
-
There are about 20 partTypes and we will likely have
is_...
for all these partTypes.- I have wondered if you want a more generic function such as
get_partType(p, partType_name)
. The explicit approach you have is good and probably the best, but we'll have many of these helper functions. - Have names for functions and
PartData
more closely adhere to the definitions in the dictionary. Instead ofis_cat_val(p)
useis_category(p)
. Instead ofall_rows
useall_parts
. Instead ofatt_rows
useattributes
, etc.
- I have wondered if you want a more generic function such as
-
We aren't ready or don't want a full OOP approach to parts because the children and dependencies are quite complicated, but partData properties could get long. It may make sense to split up partsData into a few separate objects that reflect major parts sections. Everything in the ODM dictionary is a part, but there are a few higher-order parts, including:
- Tables - Consider taking tables out of partData and putting that into a separate object. User data is reported in tables. ODM defines key tables, but users may define additional tables if they want.
- partType = measures, methods and attributes. User data is reported using measures, methods and attributes. Consider renaming partData into an object that describes the contents of these three main 'reportTypes'.
User data is reported using three partTypes: measures, methods and attributes. These are high-level parts -- in OOP terms, they would be children of parts, but parents of many properties. We don't have a name to describe these three partTypes, but we need one. Maybe 'reportTypes'? Regardless, I'd consider an object that holds properties of these three types. Properties such as categorySets, categories, etc. are properties (or children) of these three partTypes.
@zargot Looks good to me. Regards to Doug's comments/
|
I think I have to understand this better before doing something about it. I'm guessing it will become more apparent after implementing more of the rules, etc. Thanks 👍 |
Good idea. 👍 |
This PR adds most of the missing meta fields in the generated Cerberus schema.
PartData has also been partially rewritten, as it was a big mess.
I will cleanup the commits before merging.