aboutsummaryrefslogtreecommitdiffstats
path: root/skate/map.go
diff options
context:
space:
mode:
Diffstat (limited to 'skate/map.go')
-rw-r--r--skate/map.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/skate/map.go b/skate/map.go
index 53aed1e..34e2f2c 100644
--- a/skate/map.go
+++ b/skate/map.go
@@ -394,6 +394,25 @@ func MapperPartial(p []byte) (fields [][]byte, err error) {
return nil, nil
}
+// MapperBrefWork maps bref for comparison with other datasets,
+// such as COCI (which uses DOI).
+func MapperBrefWork(p []byte) (fields [][]byte, err error) {
+ var bref BiblioRef
+ if err := json.Unmarshal(p, &bref); err != nil {
+ return nil, err
+ }
+ return [][]byte{[]byte(bref.SourceWorkIdent), p}, nil
+}
+
+// MapperReleaseWork maps release to work ident.
+func MapperReleaseWork(p []byte) (fields [][]byte, err error) {
+ var release Release
+ if err := json.Unmarshal(p, &release); err != nil {
+ return nil, err
+ }
+ return [][]byte{[]byte(release.WorkID), p}, nil
+}
+
// sandcrawlerSlugify normalizes a string.
func sandcrawlerSlugify(s string) string {
slug := strings.ToLower(strings.TrimSpace(s))