Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We fixed an issue with opacity of disabled icon-buttons [#7195](https://github.com/JabRef/jabref/issues/7195)
- We fixed an issue where journal abbreviations in UTF-8 were not recognized [#5850](https://github.com/JabRef/jabref/issues/5850)
- We fixed an issue where the article title with curly brackets fails to download the arXiv link (pdf file). [#7633](https://github.com/JabRef/jabref/issues/7633)
- We fixed an issue where urls must be embedded in a style tag when importing EndNote style Xml files. Now it can parse url with or without a style tag. [#6199](https://github.com/JabRef/jabref/issues/6199)
- We fixed an issue where the article title with colon fails to download the arXiv link (pdf file). [#7660](https://github.com/JabRef/issues/7660)

### Removed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,30 @@ private Optional<String> getUrl(Record record) {
}

private Optional<String> getUrlValue(Url url) {
return Optional.ofNullable(url)
.map(Url::getStyle)
.map(Style::getContent)
.map(this::clean);
Optional<List<Object>> urlContent = Optional.ofNullable(url).map(Url::getContent);
List<Object> list = urlContent.orElse(Collections.emptyList());
Optional<String> ret;
if (list.size() == 0) {
return Optional.empty();
} else {
boolean isStyleExist = false;
int style_index = -1;
for (int i = 0; i < list.size(); i++) {
if (list.get(i) instanceof Style) {
isStyleExist = true;
style_index = i;
}
}
if (!isStyleExist) {
ret = Optional.ofNullable((String) list.get(0))
.map(this::clean);
} else {
ret = Optional.ofNullable((Style) list.get(style_index))
.map(Style::getContent)
.map(this::clean);
}
}
return ret;
}

private List<String> getKeywords(Record record) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/xjc/endnote/endnote.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@
</xs:complexType>
</xs:element>
<xs:element name="url">
<xs:complexType>
<xs:complexType mixed="true">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah cool, did not know about this!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yah, it's funny. I just knew that when I was looking up some relevant docs yesterday.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does anyone know whether there is a globally updated "endnote.xsd"?

I am of the community believing that schema schecking is a good thing (json schema, xml schema, ...). (Side note: some say that even the schema should be sent along with the message: https://microservice-api-patterns.org/patterns/structure/elementStereotypes/MetadataElement#)

If a third party releases an schema for their data meaning that data produced by their software can be read in case it conforms to that schema, I would not try to change that schema.

Google lead me to https://forums.zotero.org/discussion/26493/endnote-xml-export-import - however, this his very outdated. Maybe, endnote.xsd is not maintained anymore and we can go ahead to create a fork?

I just wanted to double check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean a globally standardized version of "endnote.xsd"?

I do not know much about it yet. But sending messages with its corresponding schema is indeed reasonable in order to parse the info correctedly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Endnote only has a dtd not an xsd https://support.clarivate.com/Endnote/s/article/EndNote-XML-Document-Type-Definition?language=en_US
Seems like the xsd was somehow generated from an xml file. The xsd has been in JabRef since ages

<xs:sequence>
<xs:element minOccurs="0" ref="style"/>
</xs:sequence>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@article{,
abstract = {test abstract},
author = {Ahmad, AS and Ormiston-Smith, N and Sasieni, PD},
doi = {10.1038/bjc.2014.606},
file = {:file\://localhost/Users/user/Documents/Bookends/Attachments/Ahmad%20et%20al%202015.pdf:PDF},
isbn = {1532-1827 (Electronic) 0007-0920 (Linking)},
keywords = {Age Factors; Aged; Aged, 80 and over; Female; Great Britain/epidemiology; Humans; Male; Middle Aged; Models, Statistical; Neoplasms/*epidemiology; Risk Assessment; Risk Factors; Sex Characteristics},
number = {5},
pages = {943-7},
title = {Trends in the lifetime risk of developing cancer in Great Britain: comparison of risk for those born from 1930 to 1960},
volume = {112},
year = {2015},
journal = {Br J Cancer},
note = {some notes},
url = {http://www.ncbi.nlm.nih.gov/pubmed/25647015},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8"?>
<xml>
<records>
<record>
<database name="Library1.bdb" path="/Users/user/Documents/Bookends/Library1.bdb">Library1.bdb</database>
<source-app name="Bookends" version="13.0.5">Bookends</source-app>
<rec-number>2954</rec-number>
<ref-type name="Journal Article">17</ref-type>
<contributors>
<authors>
<author>
<style face="normal" size="100%">Ahmad, AS</style>
</author>
<author>
<style face="normal" size="100%">Ormiston-Smith, N</style>
</author>
<author>
<style face="normal" size="100%">Sasieni, PD</style>
</author>
</authors>
</contributors>
<auth-address>
<style face="normal" size="100%">Queen Mary University of London, Centre for Cancer Prevention, Wolfson
Institute of Preventive Medicine, Charterhouse Square, London EC1M 6BQ, UK.&#xA;Cancer Research UK,
Head of Statistical Information, Angel Building, 407 St John Street, London EC1V 4AD, UK.
</style>
</auth-address>
<titles>
<title>
<style face="normal" size="100%">Trends in the lifetime risk of developing cancer in Great Britain:
comparison of risk for those born from 1930 to 1960
</style>
</title>
<secondary-title>
<style face="normal" size="100%">Br J Cancer</style>
</secondary-title>
</titles>
<pages>
<style face="normal" size="100%">943-7</style>
</pages>
<number>
<style face="normal" size="100%">5</style>
</number>
<volume>
<style face="normal" size="100%">112</style>
</volume>
<dates>
<year>
<style face="normal" size="100%">2015</style>
</year>
<pub-dates>
<date>
<style face="normal" size="100%">Mar 3</style>
</date>
</pub-dates>
</dates>
<keywords>
<keyword>
<style face="normal" size="100%">Age Factors</style>
</keyword>
<keyword>
<style face="normal" size="100%">Aged</style>
</keyword>
<keyword>
<style face="normal" size="100%">Aged, 80 and over</style>
</keyword>
<keyword>
<style face="normal" size="100%">Female</style>
</keyword>
<keyword>
<style face="normal" size="100%">Great Britain/epidemiology</style>
</keyword>
<keyword>
<style face="normal" size="100%">Humans</style>
</keyword>
<keyword>
<style face="normal" size="100%">Male</style>
</keyword>
<keyword>
<style face="normal" size="100%">Middle Aged</style>
</keyword>
<keyword>
<style face="normal" size="100%">Models, Statistical</style>
</keyword>
<keyword>
<style face="normal" size="100%">Neoplasms/*epidemiology</style>
</keyword>
<keyword>
<style face="normal" size="100%">Risk Assessment</style>
</keyword>
<keyword>
<style face="normal" size="100%">Risk Factors</style>
</keyword>
<keyword>
<style face="normal" size="100%">Sex Characteristics</style>
</keyword>
</keywords>
<abstract>
<style face="normal" size="100%">test abstract
</style>
</abstract>
<notes>
<style face="normal" size="100%">some notes
</style>
</notes>
<urls>
<related-urls>
<url>
<style face="normal" size="100%">http://www.ncbi.nlm.nih.gov/pubmed/25647015</style>
</url>
</related-urls>
<pdf-urls>
<url>
file://localhost/Users/user/Documents/Bookends/Attachments/Ahmad%20et%20al%202015.pdf
</url>
</pdf-urls>
</urls>
<isbn>
<style face="normal" size="100%">1532-1827 (Electronic)&#xD;0007-0920 (Linking)</style>
</isbn>
<electronic-resource-num>
<style face="normal" size="100%">10.1038/bjc.2014.606</style>
</electronic-resource-num>
<accession-num>
<style face="normal" size="100%">25647015</style>
</accession-num>
</record>
</records>
</xml>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@article{,
author = {Chapman, A. G.},
isbn = {0012-9658},
number = {1},
pages = {93-105},
title = {An ecological basis for reforestation of submariginal lands in the Central Hardwood Region},
volume = {18},
year = {1937},
journal = {Ecology},
note = {some notes},
url = {<Go to ISI>://000200148800007}
}
@book{,
author = {Strohecker, H. F.},
isbn = {0012-9658},
number = {1},
journal = {Ecology},
note = {some other notes},
pages = {162-168},
title = {A survey of soil temperatures in the Chicago area},
volume = {18},
url = {<Go to ISI>://000200148800014},
year = {1937}
}
Loading