Skip to content

Commit

Permalink
Use all attr of MappingSet instead of the previous two
Browse files Browse the repository at this point in the history
  • Loading branch information
hrshdhgd committed Dec 14, 2023
1 parent 4c480a5 commit fc8c43c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/sssom/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def parse_sssom_json(
meta = {}

# Update metadata with values from JSON document
meta_keys_to_update = [MAPPING_SET_ID, LICENSE]
meta_keys_to_update = [attr for attr in dir(MappingSet) if not attr.startswith("_")]
meta.update({key: jsondoc[key] for key in meta_keys_to_update if key in jsondoc})

converter_from_jsonld = Converter.from_jsonld(file_path)
Expand Down Expand Up @@ -330,9 +330,7 @@ def _address_multivalued_slot(k: str, v: Any) -> Union[str, List[str]]:

def _init_mapping_set(meta: Optional[MetadataType]) -> MappingSet:
_metadata = dict(ChainMap(meta or {}, get_default_metadata()))
mapping_set = MappingSet(
mapping_set_id=_metadata["mapping_set_id"], license=_metadata["license"]
)
mapping_set = MappingSet(mapping_set_id=_metadata[MAPPING_SET_ID], license=_metadata[LICENSE])
_set_metadata_in_mapping_set(mapping_set=mapping_set, metadata=meta)
return mapping_set

Expand Down

0 comments on commit fc8c43c

Please sign in to comment.