Skip to content

Commit

Permalink
Remove updates made in the base oai mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
amywieliczka committed Dec 20, 2023
1 parent 9b76703 commit f38bcd8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 48 deletions.
2 changes: 0 additions & 2 deletions metadata_mapper/mappers/oai/oai_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ def map_subject(self) -> Union[list[dict[str, str]], None]:
value = [value]
return [{"name": v} for v in value if v]


def map_language(self) -> list:
value = self.source_metadata.get("language")

Expand All @@ -104,7 +103,6 @@ def map_language(self) -> list:

return [value]


def map_type(self) -> list:
"""
Iterates the `type` values. If they are part of the controlled vocabulary
Expand Down
46 changes: 0 additions & 46 deletions metadata_mapper/mappers/oai/samvera_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,6 @@

class SamveraRecord(OaiRecord):

TYPES = {
"img": "image",
"txt": "text"
}

TYPES_BASEURL = "http://id.loc.gov/vocabulary/resourceTypes/"

def UCLDC_map(self):
return {
"alternativeTitle": self.map_alternative_title,
"type": self.map_type,
}

def map_alternative_title(self) -> list:
value = self.source_metadata.get("alternative")

if isinstance(value, list):
return value

return [value]

def map_is_shown_at(self) -> str:
value = self.source_metadata.get("isShownAt")

Expand All @@ -42,31 +21,6 @@ def map_is_shown_by(self) -> str:
return value
return None

def map_type(self) -> list:
"""
Iterates the `type` values. If they are part of the controlled vocabulary
defined by `TYPES_BASEURL`, then they are mapped to the HR value.
Returns:
list
"""
types = self.source_metadata.get("type", [])
if isinstance(types, str):
types = [types]

type_list = []
for t in types:
mapped_type = None
for (type_k, type_v) in self.TYPES.items():
if mapped_type:
break
if t == f"{self.TYPES_BASEURL}{type_k}":
mapped_type = type_v
if not mapped_type:
mapped_type = t.replace(self.TYPES_BASEURL, "")
type_list.append(mapped_type.lower())
return type_list


class SamveraVernacular(OaiVernacular):
record_cls = SamveraRecord

0 comments on commit f38bcd8

Please sign in to comment.