-
Notifications
You must be signed in to change notification settings - Fork 5
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
Extend collection.yml to accept Metanorma source files as entries #328
Comments
Refer to https://github.com/metanorma/iso-10303-srl/commit/5472f9468bf0eff1d2ae2defcd18bc8a3627e891, there are several proposed changes in yaml files. The
to
The
to
|
The goal of this change is to change the way to collect resources to build the collection. Previously, The proposed change is to find the resources to build the collection in As the format of @ronaldtse @opoudjis If there are any concerns or suggestions, please let me know. |
In order to minimize the impact of the original code, we can first create a separate function say |
The only collections used are in BSI and BIPM. |
You know very well that my response to you wanting to break backward compatibility is violent disagreement. There is in fact no particular need to break anything at all from what I am seeing, all of this can be handled as manifest preprocessing, and I've laid out to Koonwa in chat what that would look like. The collection-level manifest change can be handled separately, because there is no existing support of YAML files as file references in a manifest. So if you iterate the manifest and find a file reference, sure, process it differently. This can go straight in:
There is no reason to change In my own work, I am introducing separate directives on how files will be preprocessed for ISO 10303 specific processing:
Those directives WILL BE IGNORED by metanorma code. They will be used in the preprocessing of Lutaml that happens out of scope of metanorma code, to determine which templates to use and how; see collection-nn.rb. Coming to the document-level manifest, there are three changes. Two are straight forward, one is not well thought out, and I object to it.
So in https://github.com/metanorma/metanorma/blob/main/lib/metanorma/collection_manifest.rb, in both from_yaml and from_xml, you need to introduce a step at the start, before the recursive processing of manifests, to recurse it down. To take the YAML instance:
The document identifier in the manifest has to match the document identifier provided inside documents for links between documents, for bibliographic processing. That identifier is how links between documents are resolved, which is the entire point of collections. So the identifier is essential to all processing.
It is a complete waste of a week for a marginal improvement in user laziness. The suggestion is unjustifiable, and if you insist on it, it's your problem. |
Ease of use is extremely important and in fact likely the most important thing here. This also helps streamline our documentation needs when the way things work match user expectations. We can discuss with the exact parameters are but naming keys as
There are 3 cases:
For the first case, there is no need to have an additional "identifier". This is what we're facing now. I know I've not made this clear but here it is. |
Indeed nothing "breaks" here. What I'm saying that if things "have to break" for improvements in collection.yml, so be it because they are under our control. |
With regards to |
OK, I have been clear in what I have said. There is some ease of use introduced, but attachments can only be referenced with an identifier supplied in the manifest. That means that skipping identifiers in the manifest is not encouraging users to be careful. Requiring the identifier up front in processing the manifest is how the code has been built, and if the identifier is not available upfront early, the code will have to be refactored. I have said how that needs to be done, and what code is used to extract the identifier from the document, if it is in Semantic XML. I'll also add that, in the recent work to process interleaved manifests and document references, I deal with manifests under docref by making their key be a GUID. That solution can in fact be used as a temporary solution, to defer extracting the document ID until you actually need it. But the key for the entry will then need to be updated from the GUID to the document ID, once the document is parsed. @kwkwan this is all for your benefit since you're the one doing the refactoring, hope you're monitoring this. :-) |
@opoudjis Thanks for the detail explanation, the importance of the identifier is clear. It is quite difficult to remove identifier. Therefore, the identifier is just removed from the collection.yml. A function You may refer to the changes in cc @ronaldtse |
I see you have enacted @ronaldtse perverse change of I don't approve of that, but there is no point in me arguing this. @kwkwan You will need to update the documentation for collection manifests as well. And the documentation needs to document both the old and the new formats. |
The refactoring you've introduced @kwkwan has been useful, but there is a lot that is not clearly thought through about this. So:
|
There are now three active branches of Metanorma work:
I am now taking over this ticket, and I am going to start collapsing these branches:
|
Progress report from the schedule I introduced 5 days ago:
Done, and I've confirmed the updates have stuck in rspec with the old structure. I am working on the tests for the new structure now.
I've dropped it, and moved code specific to the new structure into manifest postprocessing.
I am already skipping that new_yaml_format check.
Done, processing of YAML references are handled as recursive calls to YAML Shale manifests, and made in postprocessing.
Done and tested.
Done.
Done.
Will look at this after I'm done.
I have intervened, and the code needed out of collection_construct_model has already been moved out of it, but for the hooks.
Wait on me. |
All done. |
No description provided.
The text was updated successfully, but these errors were encountered: