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

The Creators element in xsd is different of documentation #142

Open
tomfris opened this issue Mar 8, 2023 · 12 comments
Open

The Creators element in xsd is different of documentation #142

tomfris opened this issue Mar 8, 2023 · 12 comments

Comments

@tomfris
Copy link

tomfris commented Mar 8, 2023

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 “cfLinkWithDisplayNameToPersonWithAffiliationsOrOrgUnit__Type”
1<xs:element cflink:container="ordered" minOccurs="0" name="Creators">
2 xs:annotation
3 xs:documentationThe creators of this product</xs:documentation>
4 </xs:annotation>
5 xs:complexType
6 xs:sequence
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="cfLinkWithDisplayNameToPersonWithAffiliationsOrOrgUnit__Type"/>
8 </xs:sequence>
9 </xs:complexType>
10</xs:element>

Below you can see the cfLinkWithDisplayNameToPersonWithAffiliationsOrOrgUnit__Type structure, it’s based on cfLinkWithDisplayName__BaseType

1<xs:complexType name="cfLinkWithDisplayNameToPersonWithAffiliationsOrOrgUnit__Type">
2 xs:complexContent
3 <xs:extension base="cfLinkWithDisplayName__BaseType">
4 xs:choice
5 <xs:group ref="PersonWithAffiliations__Group"/>
6 <xs:element ref="OrgUnit__SubstitutionGroupHead"/>
7 </xs:choice>
8 </xs:extension>
9 </xs:complexContent>
10 </xs:complexType>

And the cfLinkWithDisplayName__BaseType contains only “DisplayName”
1<xs:complexType name="cfLinkWithDisplayName__BaseType">
2 xs:complexContent
3 <xs:extension base="cfLink__BaseType">
4 xs:sequence
5 <xs:element minOccurs="0" name="DisplayName" type="xs:string"/>
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
Copy link
Collaborator

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

@tomfris
Copy link
Author

tomfris commented Mar 9, 2023

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
Copy link
Collaborator

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
Copy link
Author

tomfris commented Mar 14, 2023

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

<Creators> <Creator> <Person__SubstitutionGroupHead> <PersonName> <FamilyNames>Doe</FamilyNames> <FirstNames>John</FirstNames> </PersonName> </Person__SubstitutionGroupHead> </Creator> </Creators>

Are we using the wrong xsd?

we can discuss tomorrow during the meeting.

BR,
Tom

@NazimeAtimene
Copy link

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
Copy link
Member

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_cerif_profile.xsd ?

Best, Andreas

@NazimeAtimene
Copy link

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
Copy link
Collaborator

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
Copy link

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
Copy link

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
Copy link
Member

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

Thanks a lot.

@NazimeAtimene
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants