-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unicode issue - Non english characters as question mark #9
Comments
Yuck some sort of encoding issue at some point in the pipeline. At what stage exactly did you notice the question marks? The API call for the above record does seem to encode unicode characters properly in the name (and not |
The issue is in downloaded file from figshare. To reproduce, run the following java code on decompressed file - package com.racloop.crossref;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class FileRead {
public static void main(String[] args) {
String filePath = "/Volumes/Seagate/crossrefworks.json";
BufferedReader fileReader = null;
try {
fileReader =
new BufferedReader(new FileReader(filePath));
String line = fileReader.readLine();
int index = 0;
while (line != null) {
index++;
line = fileReader.readLine();
if(line.contains("58d96fec0c62134f84023a29")) {
System.out.println(line);
break;
}
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
fileReader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
} |
I've confirmed the question marks using.
I'll look into where these question marks first infiltrated the pipeline. |
It looks like the question marks are part of our MongoDB database (and did not get inserted by import pymongo
client = pymongo.MongoClient('localhost', 27017)
crossref_db = client.crossref
result = crossref_db.works.find({'DOI': '10.1097/01.hjr.0000224482.95597.7a'})
result['author'] Which returns:
So the question is now whether our pipeline clobbered the unicode characters or whether there was an upstream issue that we inherited. |
Note that I have found an instance where unicode content was encoded properly: crossref_db.works.find_one({'DOI': '10.7717/peerj.100'})['author'] See "Angélica" below:
I'm thinking that the issue with the metadata for https://doi.org/10.1097/01.hjr.0000224482.95597.7a was an upstream issue. If we take a look at the current metadata:
I've pasted some of the relevant timestamp fields: "created": {
"date-parts": [
[
2006,
9,
22
]
],
"date-time": "2006-09-22T08:19:38Z",
"timestamp": 1158913178000
}, "deposited": {
"date-parts": [
[
2017,
12,
29
]
],
"date-time": "2017-12-29T04:03:00Z",
"timestamp": 1514520180000
}, "indexed": {
"date-parts": [
[
2018,
5,
3
]
],
"date-time": "2018-05-03T03:51:58Z",
"timestamp": 1525319518794
}, I'm not sure what indexed means, but it looks like the publisher re-deposited the information to Crossref on 2017-12-29, at which point I'm guessing they fixed the author names. You'll find that publishers often deposit incorrect information, and this may be a case where they have improved there metadata since we queried Crossref. If this specific record is of importance to you, it may be fix in @bnewbold's slightly more recent Crossref dump using this codebase at https://archive.org/download/crossref_doi_dump_201801. |
For DOI |
Glad that the error was not on our end! |
I am able to download, decompress, load and run successfully. But there is one big issue - non english characters in crossrefworks.json are replaced by question mark '?'.
Below is example of one such record.
The text was updated successfully, but these errors were encountered: