Automatically propagate/condense slots when parsing/writing. #629
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR completes support for propagation and condensation (#584) by making all parsing functions automatically perform propagation (unless explicitly told not to) before returning the parsed set, and all writing functions automatically perform condensation (again unless explicitly told not to) prior to writing a set.
This notably allows to successfully parse a set containing literal records, where the
object_typeslot has been condensed (#606).Some exceptions to the default behaviour described above:
parse_obographs_jsonandparse_alignment_xml, because it does not make much sense for those parsers anyway (a set extracted from a OBOGraph-JSON cannot be condensed in the first place). The reason those functions are still made to accept apropagateoptional parameter is so that all parsing functions can be called in exactly the same way (important for code that is using theget_parsing_functionwithout knowing exactly which function they will be calling).write_rdfandwrite_owl, because it is a more sensible default. RDF or OWL applications are not aware of the concept of “condensed slots”, so it is better to provide them with non-condensed sets.write_fhir_jsonandwrite_ontoportal_json, because they are deprecated and changing their behaviour is best avoided.On the command line side,
--no-propagateand--no-condenseoptions are added to the following subcommands:convert,parse,validate,merge.I personally do not believe it would be worth it to add those options to every single command. For example, if you do not want the result of, say,
sssom queryto be condensed, you can always useconvertafterwards with the--no-condenseoption. The need for disabling condensation should be rare anyway, so that should be enough. Still, open to other opinions about this.closes #586
closes #606