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 9eb9743 commit 7f7ba07
Showing 1 changed file with 0 additions and 46 deletions.
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 7f7ba07

Please sign in to comment.