Skip to content

Mixin inheritance clarification - #270

Open
niegrzybkowski wants to merge 1 commit into
linkml:mainfrom
niegrzybkowski:mixin-inheritance-clarification
Open

Mixin inheritance clarification#270
niegrzybkowski wants to merge 1 commit into
linkml:mainfrom
niegrzybkowski:mixin-inheritance-clarification

Conversation

@niegrzybkowski

Copy link
Copy Markdown

@matentzn matentzn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is correct.

EDIT: withdrew some minor concerns, misread the issue.

- the value of `c.is_a` must be a ClassDefinitionReference
- the value of `c.mixins` must be a collection of ClassDefinitonReferences
- For any parent `p` of `c`, if `p.mixin` is True, then `c.mixin` SHOULD be True
- for any direct (`is_a`) ancestor `a` of `c`, if `a.mixin` is True, then `c.mixin` SHOULD be True

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"direct ancestor" is a bit of a contradiction, so better use the word "parent" (I dont mind the redundant "direct"):

Suggested change
- for any direct (`is_a`) ancestor `a` of `c`, if `a.mixin` is True, then `c.mixin` SHOULD be True
- for any direct `is_a` parent `a` of `c`, if `a.mixin` is True, then `c.mixin` SHOULD be True

- the value of `s.is_a` must be a **SlotDefinitionReference**
- the value of `s.mixins` must be a collection of **SlotDefinitionReference**s
- For any parent `p` of `s`, if `p.mixin` is True, then `s.mixin` SHOULD be True
- for any direct (`is_a`) ancestor `a` of `s`, if `a.mixin` is True, then `s.mixin` SHOULD be True

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- for any direct (`is_a`) ancestor `a` of `s`, if `a.mixin` is True, then `s.mixin` SHOULD be True
- for any direct `is_a` parent `a` of `s`, if `a.mixin` is True, then `s.mixin` SHOULD be True

@gouttegd gouttegd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Asked to review by @matentzn )

(i) I agree with the assessment in the original ticket that the current phrasing in the spec is wrong, as it would indeed imply that any class that uses a mixin (has a mixins parent) should itself be a mixin, which wouldn’t make any sense.

(ii) I agree with @matentzn ’s objection regarding the use of “direct ancestor” as a way to refer to a “is_a parent”. This is not how most people would understand such a term. In the absence of any established terminology to distinguish between “parent through a is_a relationship” and “parent through a mixins relationship”, better to always be explicit and to always talk about “is_a parent” and “mixins parent”.

So overall, agreeing with the general idea, but requesting the changes suggested by @matentzn.

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.

Specification: Clarify mixin inheritance structural conformance rules

3 participants