Skip to content

Commit

Permalink
Recommend that YAML keys be sorted by "spec order".
Browse files Browse the repository at this point in the history
This commit adds a recommendation that

1) the keys in the YAML metadata block (in both "embedded" and
   "external" modes) SHOULD be sorted in the same order as the
    corresponding slots are listed in the definition of the MappingSet
    class in the SSSOM model;

2) the keys in the 'curie_map' dictionary (i.e. the prefix names) SHOULD
   be sorted by alphabetical order.
  • Loading branch information
gouttegd committed Sep 18, 2023
1 parent fd78f06 commit 653e0e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Next

- Add issue_tracker_item and issue_tracker [model elements](https://github.com/mapping-commons/sssom/pull/259).
- Add recommendation to sort the keys in the YAML metadata block.

## SSSOM version 0.13.0

Expand Down
2 changes: 2 additions & 0 deletions src/docs/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ Note that the following prefixes are built-in and (1) MUST NOT be changed from t
(The "canonical order" corresponds to the exact order of elements as seen in the specification.)
This precludes spurious diffs in a git setting, which is an important concern for the continuous reviewing of mappings by curators and users.

**Canonical ordering of keys in the YAML metadata block**. For the same reason (avoiding spurious diffs), the keys in the YAML metadata block SHOULD be sorted in the same order as they are listed in the [MappingSet specification](https://mapping-commons.github.io/sssom/MappingSet/); keys in the `curie_map` dictionary SHOULD be sorted by alphabetical order. Those recommendations apply whether the metadata block is embedded in the TSV file or kept in a separate file.

Note that only metadata elements permissible in a global context (G, or L/G) can be used in the metadata-file.

We recommend to use the following *filename conventions* for SSSOM metadatafiles:
Expand Down

0 comments on commit 653e0e5

Please sign in to comment.