Last active
December 21, 2015 16:49
-
-
Save ostephens/6336085 to your computer and use it in GitHub Desktop.
GREL (Google Refine Expression Language) to extract ISSN from the GOKb Co-referencing service. Gives appropriate errors if multiple records or multiple ISSNs in GOKb Co-reference Service response
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if( | |
length(value.parseJson()["records"])>1, | |
"Multiple Records match that identifier, check CRED (Web UI) for errors", | |
with( | |
filter(value.parseJson()["records"][0]["sameAs"],v,v["namespace"]=="issn"), | |
issns, | |
if(length(issns)>1,"Multiple ISSNs for one Title": ","") + forEach(issns,v,v["identifier"]).join(",") | |
) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment