-
Notifications
You must be signed in to change notification settings - Fork 48
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
Create concrete classes for license individuals #588
Conversation
Fixes #574 Signed-off-by: Gary O'Neall <[email protected]>
@goneall Thank you for this! Taking a look now and I will circle back. |
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.
@goneall Thanks again for this!
I don't have a particular preference for whether to take the approach you described here, or the alternate approach you mentioned of having the individuals NoneLicense / NoAssertionLicense use IndividualLicense
directly.
I'll defer to others if there are strong feelings on that point, but since there haven't been any comments here for the past couple of weeks, I'm inclined to go with what you proposed here.
Assuming we take this approach, I have a few comments -- please see below and let me know what you think!
|
||
## Summary | ||
|
||
A concrete subclass of AnyLicenseInfo used by Individuals in the ExpandedLicensing profile. |
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.
See my overall comment about whether to use the approach described here or the alternative you mentioned in the discussion thread. Assuming we use the one you did here, though, then is it accurate that IndividualLicense is a "concrete" subclass? Or is it an abstract subclass, since only the NoneLicense and NoAssertionLicense classes should actually be instantiated?
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.
Thanks @swinslow - really good catches.
After reviewing the comments, I no longer see a need for the IndividualLicense class, I can just subclass AnyLicenseInfo directly for None and NoAssertion license types.
I'll update the PR accordingly.
|
||
- name: IndividualLicense | ||
- SubclassOf: /SimpleLicensing/AnyLicenseInfo | ||
- Instantiability: Concrete |
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.
Same question / comment as above
|
||
## Summary | ||
|
||
A License when no assertion can be made about its actual value. |
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.
To align with the NoneLicense class text below, should this say something like:
"A concrete subclass of IndividualLicense used by the NoAssertionLicense Individual in the ExpandedLicensing profile."
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.
I'll align with the text below.
|
||
## Summary | ||
|
||
A concrete subclass of AnyLicenseInfo used by Individuals in the ExpandedLicensing profile. |
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.
Should this reference IndividualLicense
instead of AnyLicenseInfo
? And also specify which Individual uses it? E.g.:
"A concrete subclass of IndividualLicense used by the NoneLicense Individual in the ExpandedLicensing profile."
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.
We'll solve this by getting rid of IndividualLicense
Per review comments, I'm removing the IndividualLicense to resolve inconsistencies in the previous commit.
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.
I don't agree with creating two new classes, with the exact same name as the individuals(!). People will confuse them, they might use the class instead of the individual, etc. It will become messy very quickly,..
And having these classes does not really help. They are concrete, so... can I use them to create more instances/individuals? I shouldn't be able to do so.
I think this approach creates more problems than it solves.
What is the problem we're trying to solve?
I agree with @zvr that this approach seems overly complicated and unlikely to lead to the targeted goal. It seems to me that the simple solution to the issue identified in #574 is simply to make NoAssertionLicense and NoneLicense to be individuals of the LicenseExpression class which is an already existing concrete subclass of AnyLicenseInfo. You could simply have In the definition of the NOTE: Individuals are simply instance objects. They are asserted to be members of one or more classes and they MUST have an globally unique ID (in our case an spdxId). This means that in the SPDX spec where we specify Individuals we need to be explicit that the "name" specified for the Individual is actually its spdxId and those names need to explicitly include the base SPDX id prefix for SPDX defined Individuals (i.e., something more like "https://ontology.spdx.org/3.0/licenses/individuals/NoAssertionLicense" rather than just "NoAssertionLicense"). In a nutshell, the only changes required in a PR would be:
|
@@ -1,21 +0,0 @@ | |||
SPDX-License-Identifier: Community-Spec-1.0 | |||
|
|||
# IndividualLicense |
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.
IndividualLicenseInfo instead of IndividualLicense
Restore this class
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.
IndividualLicensingInfo... since it's not info on a license
Based on tech call on 23 Jan 2023:
|
Updates the individuals for license per review comments Signed-off-by: Gary O'Neall <[email protected]>
@zvr @sbarnum I just updated the PR with the changes we discussed. I used the names "NONE" and "NOASSERTION" to be compatible with the previous names used in SPDX 2.X. For the ID's, I didn't include anything in the markdown file. I figure we would generate the correct ID based on the individual name and profile rather than specify it in the file. |
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.
Sorry, I am late to this PR and from reading the diff I can not understand why there are files .../Classes/NoAssertionLicense.md
and .../Individuals/NoAssertionLicense.md
, but seemingly no connection between them.
Please ignore my question, if that is clear for everyone else.
@@ -15,7 +15,7 @@ the SPDX creator has intentionally provided no information (no meaning should be | |||
## Metadata | |||
|
|||
- name: NoAssertionLicense | |||
- type: /SimpleLicensing/AnyLicenseInfo | |||
- type: IndividualLicensingInfo |
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.
why is model/ExpandedLicensing/Individuals/NoAssertionLicense.md not of type model/ExpandedLicensing/Classes/NoAssertionLicense.md? I am confused to see it in Individuals and Classes an the same time
## Metadata | ||
|
||
- name: NoAssertionLicense | ||
- SubclassOf: /SimpleLicensing/AnyLicenseInfo |
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.
Why is model/ExpandedLicensing/Classes/NoAssertionLicense.md not a subclass of model/ExpandedLicensing/Classes/IndividualLicensingInfo.md, which is "A concrete subclass of AnyLicenseInfo used by Individuals in the ExpandedLicensing profile."
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.
This file should be deleted.
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.
If the two class files are deleted, this is good to go.
## Metadata | ||
|
||
- name: NoAssertionLicense | ||
- SubclassOf: /SimpleLicensing/AnyLicenseInfo |
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.
This file should be deleted.
|
||
- name: NoneLicense | ||
- SubclassOf: /SimpleLicensing/AnyLicenseInfo | ||
- Instantiability: Concrete |
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.
This file should be deleted.
Signed-off-by: Gary O'Neall <[email protected]>
Good catch @zvr - The two files are now deleted |
There are only two properties that ANY Individual in ANY ontology MUST define: ID and TYPE. I strongly believe that the markdown version of the spec needs to include the IDs for ANY Individuals including these two. The intent of the markdown version of the spec is for human readability and clarity. I believe including a 'name' but not the one and only one ID to use for each Individual is very highly likely to lead to confusion and invalid content. |
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.
I believe that the IDs for each Individual needs to be included in their respective markdown definition files.
Explanation is in a comment in the Conversation for this PR.
Everything else looks great.
I don't feel strongly, but I believe the ID's can be assigned by convention in the same way we assign ID's to the class and properties without explicitly stating them in the markdown. Probably worth a 10 minute discussion with @sbarnum @zvr myself and anyone else interested in the RDF IDs. One issue for RC2 is that adding an ID field may break the spec-parser. I'll create a separate issue to track fixing this either before RC2 if there is time, or after RC2 and before final release. |
@sbarnum yes, the individuals must have an id (and they will, in the generated docs and RDF ontology). @goneall yes, if you put it right now it will break the spec-parser. I will make and push the change on Tue 13 Feb at the latest. I propose we merge this one and we know we have to add the IRIs at a later stage. If you both remember, I had proposed to use |
I'll go ahead and merge - we have another issue to track the creation of the IDs. |
Fixes #574
This PR implements concrete classes by the same name as the individuals. The concrete classes inherit from a comment
IndividualLicense
class.An alternative solution to #574 is to have the individuals use the
IndividualLicense
type directly.The only reason I chose this approach is that having different types may match some language implementations more closely - but I could easily be persuaded to take the alternative solution.