Permalink
Browse files

mods fields mapper, WIP

  • Loading branch information...
1 parent 4b2739b commit a33318ef563b6f8291e76a2d61ddd6eae7940009 Aleksey Rosolovskiy committed Mar 14, 2013
Showing with 4 additions and 5 deletions.
  1. +4 −5 lib/akamod/mods_to_dpla.py
@@ -15,7 +15,7 @@
def getprop(d, p):
- selector_getprop(d, p, True)
+ return selector_getprop(d, p, True)
CONTEXT = {
"@vocab": "http://purl.org/dc/terms/",
@@ -42,8 +42,7 @@ def getprop(d, p):
"end" : {
"@id" : "dpla:dateRangeEnd",
"@type": "xsd:date"
- },
- "name": "xsd:string"
+ }
}
def physical_description_handler(d, p):
@@ -69,7 +68,7 @@ def subject_handler(d, p):
def location_handler(d, p):
location = getprop(d, p)
- format = getprop(d, "physicalDescription/internetMediaType", True)
+ format = getprop(d, "physicalDescription/internetMediaType")
out = {}
try:
for _dict in location:
@@ -107,7 +106,7 @@ def location_handler(d, p):
}
AGGREGATION_TRANSFORMER = {
- "id" : lambda d, p: {"id": getprop(d, p), "@id" : "http://dp.la/api/items/"+getprop(d, p)},
+ "id" : lambda d, p: {"id": getprop(d, p), "@id" : "http://dp.la/api/items/" + getprop(d, p)},
"_id" : lambda d, p: {"_id": getprop(d, p)},
"originalRecord" : lambda d, p: {"originalRecord": getprop(d, p)},
"ingestType" : lambda d, p: {"ingestType": getprop(d, p)},

0 comments on commit a33318e

Please sign in to comment.