Error loading DataCite schema v.4 crosswalk stylesheet

182 views
Skip to first unread message

Kiriaki Roditi

unread,
Oct 7, 2024, 8:16:44 AM10/7/24
to dspac...@googlegroups.com

Hello to All,

 

Having trouble updating the Datacite crosswalk to use Schema version 4 on a DSpace v.6.3 installation.

I have updated DIM2DataCite.xsl , dspace.fg, local.cfg and DataCiteConnector.java to use http://datacite.org/schema/kernel-4

 

The error in the console when I try to update a DOI is

ERROR:  'Syntax error in ''.'

FATAL ERROR:  'line 242: Required attribute 'select' is missing.'

 

This is the excerpt from the logs

ERROR org.dspace.content.crosswalk.XSLTCrosswalk @ Failed to initialize XSLTCrosswalk(DataCite):  javax.xml.transform.TransformerConfigurationException: line 242: Required attribute 'select' is missing.

ERROR org.dspace.identifier.doi.DataCiteConnector @ Caught an CrosswalkException while reserving a DOI for DSO with type 2 and ID 6ba15ba8-0fae-43e7-b7cc-73de23d9098d. Won't reserve the doi.

org.dspace.content.crosswalk.CrosswalkInternalException: Failed to initialize transformer, probably error loading stylesheet.

                at org.dspace.content.crosswalk.XSLTDisseminationCrosswalk.disseminateElement(XSLTDisseminationCrosswalk.java:225)

                at org.dspace.identifier.doi.DataCiteConnector.reserveDOI(DataCiteConnector.java:422)

                at org.dspace.identifier.doi.DataCiteConnector.updateMetadata(DataCiteConnector.java:582)

                at org.dspace.identifier.DOIIdentifierProvider.updateMetadataOnline(DOIIdentifierProvider.java:420)

                at org.dspace.identifier.doi.DOIOrganiser.update(DOIOrganiser.java:594)

                at org.dspace.identifier.doi.DOIOrganiser.runCLI(DOIOrganiser.java:240)

                at org.dspace.identifier.doi.DOIOrganiser.main(DOIOrganiser.java:71)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                at java.lang.reflect.Method.invoke(Method.java:498)

                at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229)

                at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81)

ERROR org.dspace.identifier.doi.DOIOrganiser @ It wasn't possible to update this identifier:  doi: Exceptions code:  CONVERSION_ERROR

org.dspace.identifier.doi.DOIIdentifierException: CrosswalkException occured while converting ITEM/6ba15ba8-0fae-43e7-b7cc-73de23d9098d using crosswalk DataCite.

                at org.dspace.identifier.doi.DataCiteConnector.reserveDOI(DataCiteConnector.java:440)

                at org.dspace.identifier.doi.DataCiteConnector.updateMetadata(DataCiteConnector.java:582)

                at org.dspace.identifier.DOIIdentifierProvider.updateMetadataOnline(DOIIdentifierProvider.java:420)

                at org.dspace.identifier.doi.DOIOrganiser.update(DOIOrganiser.java:594)

                at org.dspace.identifier.doi.DOIOrganiser.runCLI(DOIOrganiser.java:240)

                at org.dspace.identifier.doi.DOIOrganiser.main(DOIOrganiser.java:71)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                at java.lang.reflect.Method.invoke(Method.java:498)

                at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229)

                at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81)

Caused by: org.dspace.content.crosswalk.CrosswalkInternalException: Failed to initialize transformer, probably error loading stylesheet.

                at org.dspace.content.crosswalk.XSLTDisseminationCrosswalk.disseminateElement(XSLTDisseminationCrosswalk.java:225)

                at org.dspace.identifier.doi.DataCiteConnector.reserveDOI(DataCiteConnector.java:422)

                ... 11 more

 

What am I missing?

Is there another configuration property that I need to change? Does it have to do with the metadata stored in dc.type field?

 

Thank you for your time,

 

Kiriaki Roditi

Systems Engineer

 


ELiDOC Systems & Services

 

 

mw...@iu.edu

unread,
Oct 7, 2024, 10:22:19 AM10/7/24
to dspac...@googlegroups.com
On Mon, Oct 07, 2024 at 12:16:32PM +0000, Kiriaki Roditi wrote:
> You don't often get email from kiriaki...@elidoc.gr. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
> Hello to All,
>
> Having trouble updating the Datacite crosswalk to use Schema version 4 on a DSpace v.6.3 installation.
> I have updated DIM2DataCite.xsl<https://github.com/DSpace/DSpace/blob/main/dspace/config/crosswalks/DIM2DataCite.xsl> , dspace.fg, local.cfg and DataCiteConnector.java to use http://datacite.org/schema/kernel-4
>
> The error in the console when I try to update a DOI is
> ERROR: 'Syntax error in ''.'
> FATAL ERROR: 'line 242: Required attribute 'select' is missing.'

It appears that your edited DIM2DataCite.xsl has an error on line 242.
Probably an 'apply-templates' element is missing its required 'select'.
> --
> All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
> ---
> You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com<mailto:dspace-tech...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/DU0PR10MB7459EBC163D3560C71230205907D2%40DU0PR10MB7459.EURPRD10.PROD.OUTLOOK.COM<https://groups.google.com/d/msgid/dspace-tech/DU0PR10MB7459EBC163D3560C71230205907D2%40DU0PR10MB7459.EURPRD10.PROD.OUTLOOK.COM?utm_medium=email&utm_source=footer>.

--
Mark H. Wood
Lead Technology Analyst

University Library
Indiana University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
library.indianapolis.iu.edu
signature.asc

Kiriaki Roditi

unread,
Oct 8, 2024, 6:39:33 AM10/8/24
to dspac...@googlegroups.com
Thank you for the prompt response!
The only part of the file I have edited, compared to the one referenced from Github, is in the beginning, the properties for
<xsl:param name="prefix"> and <xsl:param name="publisher">

I have tested with some alternative versions of DIM2DataCite.xsl published in an August commit and the error is always in the same line of the resourceType element.
https://github.com/DSpace/DSpace/blob/e8a2e73fcc9b7944408daf6a6f683b69939949cd/dspace/config/crosswalks/DIM2DataCite.xsl#L242
Our institution 's metadata is in Greek (language code: el), dc.type field is required and filled for all repository items and it works effortlessly for Datacite Schema v.3

Is there some other configuration file (i.e. pom.xml, spring...) that I should declare the new Datacite Schema version?

Many thanks,
Kiriaki
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/ZwPukkTJbtOPqy3H%40iu.edu.

Danilo Di Nuzzo

unread,
Jan 9, 2025, 3:10:51 PM1/9/25
to DSpace Technical Support
Hi Kiriaki,

I think that the item with ID 6ba15ba8-0fae-43e7-b7cc-73de23d9098d hasn't attribute dc.type and the XSLT processor tries to apply the rule present in DIM2DataCite.xsl at row 242, but this line is wrong because the tag <xsl:value-of> requires the select attribute.

You can try to fix this issue in two ways:
  • adding the type metadata to each items with value Other;
  • replacing the line 242 of DIM2DataCite.xsl with a costant string (Other) or introducing a parameter (<xsl:param name="defaultType">Other</xsl:param>) and change the line 242 with <xsl:value-of select="$defaultType">


Danilo Di Nuzzo (danilo....@r-dev.it)
CTO at Revolution Development Srl

John Sarris

unread,
Jan 10, 2025, 5:56:59 AM1/10/25
to DSpace Technical Support
Hi,

this is indeed the solution. 
First declaring a variable, as stated by Danilo, by <xsl:param name="defaultType">Other</xsl:param>
and then using this variable, by replacing
<xsl:value-of>Other</xsl:value-of> with <xsl:value-of select="$defaultType"/> (Just pay attention to a minor syntactical error in the closing tag, it should be />)

Have a nice year

John

-- 
Dr. John Sarris

IT System Administrator
Library & Information Center
National Technical University of Athens (NTUA), Greece

Kiriaki Roditi

unread,
Jan 10, 2025, 7:32:18 AM1/10/25
to DSpace Technical Support

Hello all,

 

Danilo thank you very much for the help!

John thank you for the feedback!

I have been testing this all morning but unfortunately it did not work for me.

 

Changed the resourceType element as described and modified an item’s metadata field dc.type to a term in English. I created the Datacite.xml file through the console ( dsrun org.dspace.content.crosswalk.XSLTDisseminationCrosswalk DataCite myhandle  ) for this item and tested.

Pasting  the resource type xml element, created with the new stylesheet:

  <resourceType resourceTypeGeneral="Other">Bachelor Thesis</resourceType>

and the three first lines from the xml

<?xml version="1.0" encoding="UTF-8"?>

<resource xmlns=http://datacite.org/schema/kernel-4 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:dspace=http://www.dspace.org/xmlns/dspace/dim xsi:schemaLocation=http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4/metadata.xsd>

  <creators>

    <creator>

 

When I run doi-organiser --update-doi myhandle a get a 422 error

This is the log excerpt from my last test.

2025-01-10 13:49:35,554 WARN  org.dspace.identifier.doi.DataCiteConnector @ While reserving the DOI doi:xxxxxx, we got a http status code 422 and the message "DOI xxxxxx: This element is not expected. Expected is one of ( {http://datacite.org/schema/kernel-4}identifier, {http://datacite.org/schema/kernel-4}creators, {http://datacite.org/schema/kernel-4}titles, {http://datacite.org/schema/kernel-4}publisher, {http://datacite.org/schema/kernel-4}publicationYear, {http://datacite.org/schema/kernel-4}resourceType, {http://datacite.org/schema/kernel-4}subjects, {http://datacite.org/schema/kernel-4}contributors, {http://datacite.org/schema/kernel-4}dates, {http://datacite.org/schema/kernel-4}language ). at line 3, column 0".

2025-01-10 13:49:35,944 ERROR org.dspace.identifier.doi.DOIOrganiser @ It wasn't possible to update this identifier:  doi:xxxxxx Exceptions code:  BAD_ANSWER

org.dspace.identifier.doi.DOIIdentifierException: Unable to parse an answer from DataCite API. Please have a look into DSpace logs.

                at org.dspace.identifier.doi.DataCiteConnector.reserveDOI(DataCiteConnector.java:500)

                at org.dspace.identifier.doi.DataCiteConnector.updateMetadata(DataCiteConnector.java:582)

                at org.dspace.identifier.DOIIdentifierProvider.updateMetadataOnline(DOIIdentifierProvider.java:420)

                at org.dspace.identifier.doi.DOIOrganiser.update(DOIOrganiser.java:594)

                at org.dspace.identifier.doi.DOIOrganiser.runCLI(DOIOrganiser.java:342)

                at org.dspace.identifier.doi.DOIOrganiser.main(DOIOrganiser.java:71)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                at java.lang.reflect.Method.invoke(Method.java:498)

                at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229)

                at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81)

 

But, when I used the mentioned Datacite.xml file to create a Draft DOI through Fabrica it worked.

 

How else can I reproduce what the API sends to Datacite? Any thoughts?

 

Greetings from sunny Athens,

Kiriaki

--

All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.

Danilo Di Nuzzo

unread,
Jan 12, 2025, 6:59:27 AM1/12/25
to DSpace Technical Support
Hello All,

John thanks you for the feedback/correction.

Kiriaki unfortunately your DSpace version does not write in the log the input xml when the DataCite service returns a 422.

The doi-organiser --update-doi handle command could add an additional information to the xml to send to DataCite API, the DOI that DSpace reserved for the content.
 
Can you verify if the configuration of DataCite schemaLocation is right? 
You should check that the properties crosswalk.dissemination.DataCite.schemaLocation and crosswalk.dissemination.DataCite.namespace do not refer to the http://datacite.org/schema/kernel-3 but to the http://datacite.org/schema/kernel-4 otherwise the doi-organiser command will add a new tag for the DOI as <identifier schemaLocation="http://datacite.org/schema/kernel-3" identifierType="DOI">XX.XXXXX/YYYY</identifier> and the wrong schemaLocation will throw an error in the DataCite API

if need change this properties:

crosswalk.dissemination.DataCite.schemaLocation = \
    http://datacite.org/schema/kernel-3 \
    http://schema.datacite.org/meta/kernel-3/metadata.xsd
crosswalk.dissemination.DataCite.namespace = http://datacite.org/schema/kernel-3

with this:

crosswalk.dissemination.DataCite.schemaLocation = \
    http://datacite.org/schema/kernel-4 \
    http://schema.datacite.org/meta/kernel-4/metadata.xsd
crosswalk.dissemination.DataCite.namespace = http://datacite.org/schema/kernel-4

and try to update the DOI.

I hope that this can help you to resolve the problem.

Have a nice day,

Danilo Di Nuzzo (danilo....@r-dev.it)
CTO at Revolution Development Srl
Reply all
Reply to author
Forward
0 new messages