-
Notifications
You must be signed in to change notification settings - Fork 310
schema/ListedLicense: Punt license text into <text> #452
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
Conversation
403d643
to
c8a395d
Compare
I've added a WIP commit showing the changes to Apache-2.0 and u-boot-exception-2.0. If you remove all the other files you can use |
c8a395d
to
619e2f7
Compare
By differentiating between formattedAltText..., which may contain <alt> and <optional>, and formattedFixedText..., which may not. The optionalType is using formattedAltTextGroup, because nesting variable content inside an optional element can be useful [1,2]. The <alt> element, on the other hand, specifies all the variable options in its match attribute, so there's no need for nesting variable elements inside the alt body. Also require fixed text for <notes>, since those aren't templates. And drop the unused notesType, since they're vanilla formatted text. We almost certainly want to drop titleText and copyrightText fro the formatted*TextGroup choices, but I'm leaving that for [3]. [1]: spdx#393 [2]: spdx#462 [3]: spdx#452
619e2f7
to
3eee08f
Compare
I think this is a good improvement (it will simplify some of the code in the tools). One consideration is the name of the field. In the JSON and RDF/XML formats of the license data, the license text uses a property name of For consistency, we could use the same terms. |
I'm generally in favor of simple names (like |
I was also thinking of the advantages of a simpler name. It would actually be easier to implement with a simple name since there is common code for parsing the license and exception XML. The history on the longer names comes from the use in tag/value which doesn't always have a hierarchical structure to pull context from. Since we don't really have that issue here, I'm leaning toward |
+1 for this approach, as long as we're sure this doesn't introduce ambiguity with other formats downstream from the XML. In other words, the RDF/JSON/etc. still has the complete context. |
Whatever tool is converting from XML can translate tag names too, so I don't think this will be a problem. |
I'll make sure the tool retains the same format when translating to the JSON and other formats. |
3eee08f
to
a31d982
Compare
I can rebase this and inject the remaining |
Two considerations on timing I can think of - possible merge conflicts and impact on the tooling. I'm thinking we start rebasing and reviewing soon. For the possible merge conflicts with existing PR's: Most of the PR's are @wking and I can take care of any conflict with #570 so those won't be an issue. The other PR's are #587 , #551 and #489. This seems a small enough set to be manageable. For the tooling: The tool which tests the licenses texts will need to be updated with this XML schema change. I suggest we review and merge these changes before we enable the license text testing in PR #593 This way, I can update the tool before we start using it. |
As it stands, there's not an easy way to extract the license text from the XML format without removing <crossRefs>, <notes>, <standardLicenseHeader>, and other siblings. With this change (which, if accepted, I still have to propagate into src/) we collect it in <text>, just like we already collect the header text in <standardLicenseHeader>. Also use <all> instead of <choice> for <LicenseType> children. With that, <crossRefs> could have occured multiple times, etc. With this change, it can only occur once, although the children can still appear in any order (we'd use <sequence> if we cared about child order).
Catch up with the previous commit's schema change.
a31d982
to
c478ba1
Compare
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.
Whew! All looks good.
Thanks @wking ! |
As it stands, there's not an easy way to extract the license text from the XML format without removing
<crossRefs>
,<notes>
,<standardLicenseHeader>
, and other siblings. With this change (which, if accepted, I still have to propagate intosrc/
) we collect it in<text>
, just like we already collect the header text in<standardLicenseHeader>
.This is a WIP, because of the pending
src/
migration. If this PR gets a green light, I'll go ahead and migratesrc/
before we merge it.