Skip to content

Commit

Permalink
Remove DC cleanup
Browse files Browse the repository at this point in the history
This was possible thanks to mapping-commons/sssom#302
  • Loading branch information
cthoyt committed Jul 25, 2023
1 parent a9b0f27 commit e24fec2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pansql = "^0.0.1"
pyyaml = ">=6.0"
rdflib = ">=6.3.2"
sparqlwrapper = ">=2.0.0"
sssom-schema = ">=0.13.0"
sssom-schema = ">=0.14.0"
validators = ">=0.20.0"
scipy = {version = "*", extras = ["scipy"]}

Expand Down
15 changes: 0 additions & 15 deletions src/sssom/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,9 @@ def add_built_in_prefixes_to_prefix_map(
raise ValueError(
f"Built-in prefix {k} is specified ({prefix_map[k]}) but differs from default ({builtinmap[k]})"
)
clean_dc(prefix_map)
return prefix_map


def clean_dc(prefix_map):
"""Remove a common issue with prefix maps in-place for DC/DCTERMS.
This happens when both DC and DCTERMS are set to the new URI prefix
for DCTERMS. DC has historically been used to point to DC elements.
If this happens, then the prefix map doesn't follow the bijectivity
rule. This function deletes the DC annotation in favor of the keeping
the DCTERMS one. This should be fixed upstream in the SSSOM Schema.
"""
if "dc" in prefix_map and "dcterms" in prefix_map and prefix_map["dc"] == prefix_map["dcterms"]:
del prefix_map["dc"]


def get_default_metadata() -> Metadata:
"""Get @context property value from the sssom_context variable in the auto-generated 'internal_context.py' file.
Expand All @@ -125,7 +111,6 @@ def get_default_metadata() -> Metadata:
del prefix_map["@vocab"]

prefix_map.update({(k, v) for k, v in contxt_external.items() if k not in prefix_map})
clean_dc(prefix_map)
_raise_on_invalid_prefix_map(prefix_map)

metadata = Metadata(prefix_map=prefix_map, metadata=metadata_dict)
Expand Down

0 comments on commit e24fec2

Please sign in to comment.