openaire / guidelines-cris-managers

OpenAIRE Guidelines for CRIS Managers based on CERIF-XML
https://openaire-guidelines-for-cris-managers.readthedocs.io/
6 stars 16 forks source link

The Creators element in xsd is different of documentation #142

Open tomfris opened 1 year ago

tomfris commented 1 year ago

We are trying to deliver datasets to openaire from FRIS , the flemish research information portal (researchportal.be). We have problems delivering the creator -element.

The Creators element in xsd is different of documentation, as you can see in the snippet below the Creators contains a sequence of “cfLinkWithDisplayNameToPersonWithAffiliationsOrOrgUnitType” 1 2 3 The creators of this product</xs:documentation> 4 </xs:annotation> 5 6 7 <xs:element cflink:link=https://w3id.org/cerif/model#Person_ResultProduct(https://w3id.org/cerif/vocab/PersonOutputContributions#Creator) https://w3id.org/cerif/model#OrganisationUnit_ResultProduct(https://w3id.org/cerif/vocab/OrganisationOutputContributions#Creator) maxOccurs="unbounded" minOccurs="0" name="Creator" type="cfLinkWithDisplayNameToPersonWithAffiliationsOrOrgUnitType"/> 8 </xs:sequence> 9 </xs:complexType> 10</xs:element>

Below you can see the cfLinkWithDisplayNameToPersonWithAffiliationsOrOrgUnitType structure, it’s based on cfLinkWithDisplayNameBaseType

1 2 3 4 5 6 7 </xs:choice> 8 </xs:extension> 9 </xs:complexContent> 10 </xs:complexType>

And the cfLinkWithDisplayNameBaseType contains only “DisplayName” 1<xs:complexType name="cfLinkWithDisplayNameBaseType"> 2 3 4 5 6 </xs:sequence> 7 </xs:extension> 8 </xs:complexContent> 9 </xs:complexType>

So it’s not possible to create a person object with "FamilyNames” and “FirstNames” like is described in documentation: 1 2 3 Singhal 4 Sonal 5 6

You can check further using xsd provided by openaire guidelines-cris-managers/openaire-cerif-profile.xsd at master · openaire/guidelines-cris-managers

Can you please tell us how to fix this?

jdvorak001 commented 1 year ago

@tomfris, would you please have an error message from the validator (or are you using some other XML parser)?

tomfris commented 1 year ago

No, we don't have any errors in the validator, because we are not building the creator object, since we don't know how.

We are using the openaire validator: https://github.com/EuroCRIS/openaire-cris-validator, but there everything passes.

You can have a look at our endpoint : https://app.r4.researchportal.be/interface/oai?verb=ListRecords&metadataPrefix=oai_dc&set=openaire_cris_products.

jdvorak001 commented 1 year ago

I trust it should be possible to add a <Creators> section following the example. The <Person> element inside each <Creator> is permitted by the PersonWithAffiliations__Group. It is the effect of the <xs:extension> in cfLinkWithDisplayNameToPersonWithAffiliationsOrOrgUnit__Type that this is supported by the Schema. Perhaps Example 2 on this W3Schools page sheds some light into it.

In case I am not guessing correctly where the problem is please email me and we could have a short call.

tomfris commented 1 year ago

The problem is that the person element is not present under the Creator element :

`

Doe John

`

Are we using the wrong xsd?

we can discuss tomorrow during the meeting.

BR, Tom

NazimeAtimene commented 1 year ago

Hi, this still blocks us, did you manage to reproduce it with the POC that we've provided to you? Please let us know if you need more information. Cheers, Nazime

ACz-UniBi commented 1 year ago

Dear @tomfris , @NazimeAtimene ,

if I use the command line call, eg. xjc -d ./temp -verbose -xmlschema schemas/openaire-cerif-profile.xsd to create classes, then the Person.java class is created, which seems to be missing at https://github.com/NazimeAtimene/openaire/tree/master/target/generated-sources/xmlbeans/eu/openaire/cerifProfile/x11 .

Could you elaborate more about creating the classes from _openaire_cerifprofile.xsd ?

Best, Andreas

NazimeAtimene commented 1 year ago

Hi @ACz-UniBi, We're using JAXB module to generate the classes from the XSD. We will try using your command to see if it's a generation issue and let you know asap. Thanks for your help. Regards,

jdvorak001 commented 1 year ago

I'm not seeing any mention of a JAXB plugin to generate the sources in the pom.xml file, so am I correct in guessing you're currently generating the sources through your IDE? I believe the POM file would be a more fitting place if you want to get repeatable builds. A plugin like this one could help.

NazimeAtimene commented 1 year ago

Hi @jdvorak001, Thanks for your reply, you're right in the provided example we're using xmlbeans-maven-plugin to generate classes from provided xsd as we had issues with jaxb and JAVA 17 (solved). We're working on it now, and will provide you with more insights asap. Thanks for your concern. Regards,

NazimeAtimene commented 1 year ago

Hi, We managed to include the creator, The issue was in the plugin that we used to generate the classes from the XSD. Thanks for your concern. You can close this ticket. Regards,

ACz-UniBi commented 1 year ago

Thank you @NazimeAtimene for the note. Could share your solution here or in your repo before we close the ticket?

Thanks a lot.

NazimeAtimene commented 1 year ago

Hi @ACz-UniBi, We've pushed the changes in the repo. Kind regards,