Skip to content
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

possible problem with RIS publication year #4816

Closed
1 task done
CodeSJS opened this issue Mar 27, 2019 · 8 comments
Closed
1 task done

possible problem with RIS publication year #4816

CodeSJS opened this issue Mar 27, 2019 · 8 comments
Assignees
Labels
bug Confirmed bugs or reports that are very likely to be bugs good first issue An issue intended for project-newcomers. Varies in difficulty. import
Projects

Comments

@CodeSJS
Copy link

CodeSJS commented Mar 27, 2019

JabRef version on

Steps to reproduce the behavior:

  1. ...import ris file (control i)

Please see the attached ris.gz file. Using either JabRef 4.3.1 or dev-5.0, JabRef imports publication year as 2019, when it is really 2005.

At first I thought it was a problem with the journal (J. Chem. Phys.) web site. Then I saw that the Y1 and PY fields in the ris file were correctly set to 2005. The Y2 field is 2019, but that is supposed to be the access date.

The bib file works fine, since it does not contain a field for access date.

Please let me know if the problem is really with the journal after all, and I'll communicate with them.

Thanks for JabRef!

Log File
Paste an excerpt of your log file here
@tobiasdiez tobiasdiez added this to Needs triage in Bugs via automation Mar 28, 2019
@Siedlerchr
Copy link
Member

@CodeSJS Thanks for your report. Unfortuantely here is no attached file visible. Could you please add this?

@CodeSJS
Copy link
Author

CodeSJS commented Mar 28, 2019 via email

@CodeSJS
Copy link
Author

CodeSJS commented Mar 28, 2019

Hmm, I'm still not sure files are attached. I'm trying again.
Sherwin

aip_jcp123.bib.gz
aip_jcp123.ris.gz

@Siedlerchr Siedlerchr added the bug Confirmed bugs or reports that are very likely to be bugs label Mar 28, 2019
@Siedlerchr
Copy link
Member

@CodeSJS Thanks! You can only add files to an issue here at github, replying via mail with attachments does not work.

I could confirm the behaviour.
When I add the entry via DOI doi:10.1063/1.1954747 I get the correct date 2005.

@Siedlerchr Siedlerchr added the good first issue An issue intended for project-newcomers. Varies in difficulty. label Mar 28, 2019
@Siedlerchr Siedlerchr self-assigned this Mar 28, 2019
Bugs automation moved this from Needs triage to Closed Mar 29, 2019
@Siedlerchr
Copy link
Member

Should be fixed now in the latest master, the first valid year found is now taken and no longer overwritten.

We would like to ask you to use a development build from https://builds.jabref.org/master and report back if it works for you. Please remember to make a backup of your library before trying-out this version.

@CodeSJS
Copy link
Author

CodeSJS commented Mar 30, 2019

Thanks for working on this.

The import is now correct for the example I supplied, but it may not be a solid fix. If for some reason the Y2 field precedes Y1 or PY, then I confirmed that the JabRef development master still gets the publication year wrong.

Y2 is access year, should never be imported as publication year, so I guess JabRef should ignore this field. PY, publication year, should be the desired field. Y1 is "primary date". I searched, but could not find out how primary date differs from publication year, other than is a full year-month-day.

Regards,
Sherwin

@Siedlerchr Siedlerchr reopened this Mar 30, 2019
Bugs automation moved this from Closed to Needs triage Mar 30, 2019
@Siedlerchr
Copy link
Member

@CodeSJS JabRef checks multiple fields for dates:
Y1, Y2, PY, DA
with my fix the first found date in one of the fields is taken.

I looked and found that the original code was adapted for compatibility with a word press plugin #3634 from @dsifford

Y1 and PY seem to be synonyms.
Y2 should be date-accessed or sth simliar, agree that this should be removed.
DA is another date field, but I have no idea for what it is used.
https://en.wikipedia.org/wiki/RIS_(file_format)

} else if (!foundDate && (("Y1".equals(tag) || "Y2".equals(tag) || "PY".equals(tag) || "DA".equals(tag)) && (value.length() >= 4))) {
String year = value.substring(0, 4);
try {
Year.parse(year, formatter);
//if the year is parsebale we have found our date
fields.put(FieldName.YEAR, value.substring(0, 4));
foundDate = true;
} catch (DateTimeParseException ex) {
//We can't parse the year, we ignore it
}

@tobiasdiez tobiasdiez moved this from Needs triage to Low priority in Bugs Apr 24, 2019
@victorjof victorjof mentioned this issue Jul 4, 2019
6 tasks
@Siedlerchr
Copy link
Member

Thanks to @victorjof this issue should be already fixed in master

Bugs automation moved this from Normal priority to Closed Aug 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs good first issue An issue intended for project-newcomers. Varies in difficulty. import
Projects
Archived in project
Bugs
  
Done
Development

No branches or pull requests

3 participants