Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
initial alignment with NMDC
Browse files Browse the repository at this point in the history
  • Loading branch information
turbomam committed Dec 7, 2021
1 parent 391489a commit 78d1fe9
Show file tree
Hide file tree
Showing 4 changed files with 1,713 additions and 1,623 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN = pipenv run
SCHEMA_NAME = mixs
SCHEMA_SRC = $(SCHEMA_DIR)/$(SCHEMA_NAME).yaml
#PKG_TGTS = graphql json jsonschema owl rdf jsonld shex
PKG_TGTS = graphql json jsonschema owl
PKG_TGTS = json jsonschema owl
TGTS = docs $(PKG_TGTS)

# Global generation options
Expand Down
70 changes: 47 additions & 23 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 17 additions & 4 deletions gsctools/mixs_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,14 @@ def create_slot(self, row, enums: dict = {}) -> (str, Dict):
logging.error(f'Bad name: {s_name} in {row}')
return None, None
comments = []
annotations = {}
# for k in ('Expected value', 'Preferred unit', 'Occurrence', 'Position'): position was in editors's sheet but is not being used in MIxS 6. We may want to add it back at some point.
for k in ('Expected value', 'Preferred unit', 'Occurrence'):
# for k in ('Expected value', 'Preferred unit', 'Occurrence'):
for k in ('Expected value', 'Preferred unit'):
if k in row and row[k] != '':
comments.append(f'{k}: {row[k]}')
multivalued = row.get('Occurrence', '') == 'm'
annotations['Occurrence'] = row.get('Occurrence', '')

# the column header is not consistent between sheets here
# column headers are now unique as MIXS ID, but this still works
Expand Down Expand Up @@ -225,16 +228,22 @@ def create_slot(self, row, enums: dict = {}) -> (str, Dict):
'examples': [
{'value': row['Example']}
],
'comments': comments
'comments': comments,
"aliases": []
}
slot["aliases"].append(s_name)
# 'aliases': [s_name]
# 'annotations': annotations

if (action_column and row[action_column] == 'deprecated term') or\
('Discussion' in row and row['Discussion'] == 'remove'):
slot['deprecated'] = 'Deprecated in mixs6'

#if len(exact_mappings) > 0:
# slot['exact_mappings'] = exact_mappings
if pattern is not None:
slot['pattern'] = pattern
# slot['pattern'] = pattern
slot['string_serialization'] = pattern
# the link to GH issues were removed. We may want to add them back in.
# LINK = 'Link to GH issue'
# if LINK in row:
Expand Down Expand Up @@ -434,7 +443,11 @@ def convert(self) -> Dict[str, Any]:
cmt = f"This field is used uniquely in: {packages_str}"
else:
cmt = f"This field is used in: {len(s.keys())} packages: {packages_str}"
slots[s_id]['comments'].append(cmt)
# slots[s_id]['comments'].append(cmt)
# slots[s_id]['annotations'] = {}
# if 'annotations' not in slots[s_id]:
# slots[s_id]['annotations'] = {}
# slots[s_id]['annotations']['associated_packages'] = cmt


for p in env_packages:
Expand Down
Loading

0 comments on commit 78d1fe9

Please sign in to comment.