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

7128 Change the source value from DVN to archive. #7132

Merged
merged 1 commit into from
Jul 30, 2020
Merged

7128 Change the source value from DVN to archive. #7132

merged 1 commit into from
Jul 30, 2020

Conversation

JingMa87
Copy link
Contributor

What this PR does / why we need it: Improves the DDI XML according to the XSD

Which issue(s) this PR closes: 7128

Closes #7128

Special notes for your reviewer: The fix we've all been waiting for.

Suggestions on how to test this: You can validate here https://www.freeformatter.com/xml-validator-xsd.html with this XSD https://ddialliance.org/Specification/DDI-Codebook/2.5/XMLSchema/codebook.xsd. You do need to fix the import elements first. These are the correct ones:

   <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="https://ddialliance.org/Specification/DDI-Codebook/2.5/XMLSchema/xml.xsd"/>
   <xs:import namespace="http://www.w3.org/1999/xhtml" schemaLocation="https://ddialliance.org/Specification/DDI-Codebook/2.5/XMLSchema/ddi-xhtml11.xsd"/>
   <xs:import namespace="http://purl.org/dc/terms/" schemaLocation="https://ddialliance.org/Specification/DDI-Codebook/2.5/XMLSchema/dcterms.xsd"/>

Does this PR introduce a user interface change? If mockups are available, please link/include them here: No

Is there a release notes update needed for this change?: No

Additional documentation:

@coveralls
Copy link

Coverage Status

Coverage remained the same at 19.61% when pulling 9bb8289 on JingMa87:7128-fix-ddi-export-source-attribute into 941d17d on IQSS:develop.

Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

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

Looks good. @jggautier said he prefers "archive" instead of "producer" at #7094 (comment)

Also, code wise, when I asked about this during a recent tech hours, it doesn't seem like our app needs "DVN" under "source" to function properly and that it's a well known issue that it doesn't validate.

I didn't attempt to do any validation myself.

@kcondon kcondon self-assigned this Jul 29, 2020
@kcondon
Copy link
Contributor

kcondon commented Jul 29, 2020

@JingMa87 Would you show me how to adjust this xml to use the correct import elements?

<?xml version='1.0' encoding='UTF-8'?><codeBook xmlns="ddi:codebook:2_5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="ddi:codebook:2_5 https://ddialliance.org/Specification/DDI-Codebook/2.5/XMLSchema/codebook.xsd" version="2.5"><docDscr><citation><titlStmt><titl>Test Again</titl><IDNo agency="DOI">doi:10.70122/FK2/1DAG4Z</IDNo></titlStmt><distStmt><distrbtr source="archive">Root</distrbtr><distDate>2020-07-29</distDate></distStmt><verStmt source="archive"><version date="2020-07-29" type="RELEASED">1</version></verStmt><biblCit>Admin, Dataverse, 2020, "Test Again", https://doi.org/10.70122/FK2/1DAG4Z, Root, V1</biblCit></citation></docDscr><stdyDscr><citation><titlStmt><titl>Test Again</titl><IDNo agency="DOI">doi:10.70122/FK2/1DAG4Z</IDNo></titlStmt><rspStmt><AuthEnty affiliation="Dataverse.org">Admin, Dataverse</AuthEnty></rspStmt><prodStmt/><distStmt><distrbtr source="archive">Root</distrbtr><contact affiliation="Dataverse.org" email="dataverse@mailinator.com">Admin, Dataverse</contact><depositr>Admin, Dataverse</depositr><depDate>2020-07-29</depDate></distStmt></citation><stdyInfo><subject><keyword>Arts and Humanities</keyword></subject><abstract>1</abstract><sumDscr/></stdyInfo><method><dataColl><sources/></dataColl><anlyInfo/></method><dataAccs><notes type="DVN:TOU" level="dv">CC0 Waiver</notes><setAvail/><useStmt/></dataAccs><othrStdyMat/></stdyDscr></codeBook>

@jggautier
Copy link
Contributor

jggautier commented Jul 29, 2020

Hey @JingMa87. I use https://www.freeformatter.com/xml-validator-xsd.html to check for XML validation and it gets the schemalocation info from the top <codeBook> element in the XML document itself. The "import elements" you mentioned looks like similar information, so you're saying they need to be used instead or in addition? I'd be curious to know why and how, too. I've been working with the assumption that the info needed to validate these DDI XML docs against the DDI Codebook schema is already in the DDI XML doc's <codeBook> element.

@JingMa87
Copy link
Contributor Author

JingMa87 commented Jul 30, 2020

@kcondon @jggautier That's interesting, I've been adding the XSD separately which causes the import error. In your case you don't have to change anything, but in case you add the XSD separately you have to fix the import statements in the XSD schema. It uses definitions like "xml:lang" and "dc:elementsAndRefinementsGroup" which come from other schemas, respectively xml.xsd and dcterms.xsd. The import statements for those schemas are not correct when used like this.

@kcondon
Copy link
Contributor

kcondon commented Jul 30, 2020

@JingMa87 OK, thanks for the info. I do see the dvn/source error go away but am now seeing this:

Cvc-complex-type.2.4.a: Invalid Content Was Found Starting With Element 'setAvail'. One Of '{"ddi:codebook:2_5":notes}' Is Expected., Line '1', Column '1324'.

Does this need to be corrected here or will this wait for another iteration?

@JingMa87
Copy link
Contributor Author

@kcondon I addressed that problem in this issue and accompanying PR: #7127.

@kcondon
Copy link
Contributor

kcondon commented Jul 30, 2020

@JingMa87 Yes, I see that you addressed the dvn issue. What I am saying is there is another issue and I do not know whether it is a result of this being incorrect in some way or just another issue that should/will be addressed later.

@JingMa87
Copy link
Contributor Author

@kcondon It's another problem and in my last comment I added the GitHub issue which addresses that. ;)

@kcondon
Copy link
Contributor

kcondon commented Jul 30, 2020

@JingMa87 OK thanks for the clarification. I see so many prs it is not always so easy to interpret them.

@kcondon kcondon merged commit a6f580f into IQSS:develop Jul 30, 2020
@JingMa87 JingMa87 deleted the 7128-fix-ddi-export-source-attribute branch July 30, 2020 17:09
@djbrooke djbrooke added this to the Dataverse 5 milestone Jul 30, 2020
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

Successfully merging this pull request may close these issues.

The source attribute in the DDI XML response has the incorrect value "DVN"
6 participants