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

XMP Writer incomplete #8491

Closed
2 tasks done
suppenkaspar109 opened this issue Feb 8, 2022 · 10 comments · Fixed by #8531
Closed
2 tasks done

XMP Writer incomplete #8491

suppenkaspar109 opened this issue Feb 8, 2022 · 10 comments · Fixed by #8531
Labels
export / save external files good first issue An issue intended for project-newcomers. Varies in difficulty.

Comments

@suppenkaspar109
Copy link

JabRef version

5.5 (latest release)

Operating system

Windows

Details on version and operating system

Win 11

Checked with the latest development build

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

  1. Create pdf with dummy metadata for each xmp-field (Type, Author, Date, Source, Contributor, Publisher, Subject, Relation, Language, Rights, Coverage, Format, Description)
  2. Import this pdf into jabref
  3. Change each field entry before writing metadata back to pdffile
  4. Write metadata back to pdf file
  5. Inspect metadata in pdf viewer

The problem is that not all field are written back to the pdf file.
There are setter/adder function in DublinCoreExtractor.java for the field: DESCRIPTION, IDENTIFIER, TITLE, FORMAT, CONTRIBUTOR, CREATOR, PUBLISHER, SUBJECT, RELATION
The DATE field is not fully converted (only year and month field)

Remaining fields are added as relation to the RELATION-Field (with /bibtex-prefix), however there are setter/adder function provided by pdfbox (in DublinCoreSchema.java):
COVERAGE, LANGUAGE, RIGHTS, SOURCE, TYPE

Please add these missing functions to DublinCoreExtractor.java, so the complete XMP functionality can be used in both ways. If possible fix the DATE transformation, so also the DAY field could be used. Thank you.

Appendix

...

Log File
Paste an excerpt of your log file here
@Siedlerchr Siedlerchr added external files good first issue An issue intended for project-newcomers. Varies in difficulty. labels Feb 8, 2022
@addak
Copy link
Contributor

addak commented Feb 22, 2022

Hi
If this issue isn't taken up, could I have a go at it?

@Siedlerchr
Copy link
Member

@addak Sure, but I recommend waiting until #8521 is merged to avoid any conflicts. You may however already make yourself familiar with the XMP-Importing.

@addak
Copy link
Contributor

addak commented Feb 22, 2022

already make yourself familiar with the XMP-Importing

I'm actually a new at this, so yeah, regarding that, is this page sufficient : https://docs.jabref.org/advanced/xmp ? Or are there any additional resources that would be helpful?

@Siedlerchr
Copy link
Member

That looks good so far, codewise the classes in org.jabref.logic.xmp are relevant. We also have unit tests for the import/export. So that should give you a good starting point. Otherwise for more advanced questions about XMP @btut might be helpful

@addak
Copy link
Contributor

addak commented Feb 23, 2022

Hi!
I have a question
So I can see that we have an DublinCoreExtractor.extractType method where it states that Type from both DC & BibTex are the same. Since I'm referring https://www.dublincore.org/specifications/dublin-core/usageguide/2001-04-12/generic/#type for DC type usage and https://www.bibtex.com/f/type-field/ for bibTex Type usage, I can see that it's not the case....
So yeah, do I implement the fillType following the assumption made or according tot he examples above?

Edit : Okay maybe the dublincore link is too old, as wikipedia's description suggests they are equivalent

@Siedlerchr
Copy link
Member

Hi, you have to differ between entrytype e.g. article, inproceedings, misc...
and the subfield type for an entrytype like TechReport where type specifies the concrete kind of the report (e.g. research report)

@addak
Copy link
Contributor

addak commented Feb 24, 2022

Hi!
So While I'm done with the first part
Regarding the date, I was thinking maybe we could use the qualifier property like
<dc:date> <rdf:Seq> <rdf:li xml:format="YYYY">2006</rdf:li> </rdf:Seq> </dc:date>
So that we can somehow store the format. We could , obviously, fallback to the way the date extraction/fill happens now. Currently looking if there's a way to get the format value into DublinCoreExtractor.

@Siedlerchr
Copy link
Member

Cool! Regarding dates, this should not be a problem to store incomplete dates (at least according to the spec(
https://www.dublincore.org/specifications/dublin-core/dcmi-terms/terms/date

This refers also a bit to #2753

addak added a commit to addak/jabref that referenced this issue Feb 26, 2022
addak added a commit to addak/jabref that referenced this issue Feb 26, 2022
addak added a commit to addak/jabref that referenced this issue Feb 26, 2022
addak added a commit to addak/jabref that referenced this issue Feb 26, 2022
@addak
Copy link
Contributor

addak commented Feb 26, 2022

I've created a PR for the issue. @Siedlerchr . Code changes are rough, and could be better. but as far as I understand the issue, I think this ought to be sufficient.

addak added a commit to addak/jabref that referenced this issue Feb 26, 2022
@Siedlerchr
Copy link
Member

Thanks, I will take a look when you're ready! Please check any relevant failing tests ( FetcherTests probably not relevant)

addak added a commit to addak/jabref that referenced this issue Feb 26, 2022
addak added a commit to addak/jabref that referenced this issue Feb 27, 2022
addak added a commit to addak/jabref that referenced this issue Feb 27, 2022
addak added a commit to addak/jabref that referenced this issue Feb 27, 2022
addak added a commit to addak/jabref that referenced this issue Feb 28, 2022
addak added a commit to addak/jabref that referenced this issue Feb 28, 2022
addak added a commit to addak/jabref that referenced this issue Mar 1, 2022
addak added a commit to addak/jabref that referenced this issue Mar 3, 2022
addak added a commit to addak/jabref that referenced this issue Mar 3, 2022
addak added a commit to addak/jabref that referenced this issue Mar 9, 2022
addak added a commit to addak/jabref that referenced this issue Mar 9, 2022
Siedlerchr pushed a commit that referenced this issue Mar 9, 2022
…onversion (#8531)

* #8491 : Add Missing Setters/Fillers. Support XMP(DC) -> BibTex For Day Field.

* #8491 : Implement Suggestions. Refactor. Add Test for XMP->BibTex for Date Field

* #8491 : Change changelog message and update method description

* #8491 : Address Requested Changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
export / save external files good first issue An issue intended for project-newcomers. Varies in difficulty.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants