Skip to content

Dataverse topic class term uri - #12614

Open
ffritze wants to merge 10 commits into
IQSS:developfrom
TIK-NFL:dataverse_topicClassTermURI
Open

Dataverse topic class term uri#12614
ffritze wants to merge 10 commits into
IQSS:developfrom
TIK-NFL:dataverse_topicClassTermURI

Conversation

@ffritze

@ffritze ffritze commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
It adds a valueURI attribute for topicClassification subjects in the exporter implementation and adapts attributes in the
topicClassification context.

Which issue(s) this PR closes:

Special notes for your reviewer:
I think I have covered all the topic Classification logic. I am not quite sure if this is demanded but I could easily remove some parts of my implementation.

Suggestions on how to test this:

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

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

Additional documentation:

@pdurbin pdurbin moved this to Ready for Triage in IQSS Dataverse Project Aug 18, 2026
@pdurbin pdurbin moved this from Ready for Triage to Ready for Review ⏩ in IQSS Dataverse Project Aug 18, 2026
@pdurbin pdurbin added the Size: 10 A percentage of a sprint. 7 hours. label Aug 18, 2026
<topcClas subjectScheme="LOC Subject Headings" schemeURI="http://www.loc.gov/catdir/cpso/lcco/lcco.html">Elections -- California</topcClas>
]]></xhtml:samp>
</xhtml:div>
</xhtml:div>

@pdurbin pdurbin Aug 18, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ffritze I'm just leaving this comment at the bottom. Tests are not passing. I'm seeing errors like this:

[ERROR] Failures: 
[ERROR]   DdiExportUtilTest.testJson2DdiNoFiles:119 
Expecting:
 <control instance> and <test instance> to be similar
Expected attribute name '/codeBook[1]/stdyDscr[1]/stdyInfo[1]/subject[1]/topcClas[1]/@vocab' - comparing <topcClas...> at /codeBook[1]/stdyDscr[1]/stdyInfo[1]/subject[1]/topcClas[1]/@vocab to <topcClas...> at /codeBook[1]/stdyDscr[1]/stdyInfo[1]/subject[1]/topcClas[1]
expected:<<topcClas vocab="TC Vocabulary" vocabURI="http://www.topicclass.com/one" xmlns="ddi:codebook:2_5">TC Value 1</topcClas>> but was:<<topcClas schemeURI="http://www.topicclass.com/one" subjectScheme="TC Vocabulary" xmlns="ddi:codebook:2_5">TC Value 1</topcClas>>>
[ERROR]   DdiExportUtilTest.testJson2DdiNoFilesTermsOfUse:172 
Expecting:
 <control instance> and <test instance> to be similar
Expected attribute name '/codeBook[1]/stdyDscr[1]/stdyInfo[1]/subject[1]/topcClas[1]/@vocab' - comparing <topcClas...> at /codeBook[1]/stdyDscr[1]/stdyInfo[1]/subject[1]/topcClas[1]/@vocab to <topcClas...> at /codeBook[1]/stdyDscr[1]/stdyInfo[1]/subject[1]/topcClas[1]
expected:<<topcClas vocab="TC Vocabulary" vocabURI="http://www.topicclass.com/one" xmlns="ddi:codebook:2_5">TC Value 1</topcClas>> but was:<<topcClas schemeURI="http://www.topicclass.com/one" subjectScheme="TC Vocabulary" xmlns="ddi:codebook:2_5">TC Value 1</topcClas>>>

Can you please take a look?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi @pdurbin , I have updated my feature branch. I have decided not to change the src/test/resources/xml/xsd/ddi-codebook-2.5/ddi_codebook_2_5.xsd because it is loaded via the internet here src/test/java/edu/harvard/iq/dataverse/export/ddi/dataset-finch1.xml and therefore cannot be changed directly. So I have just made minimal changes to the DDI Exporter keeping the old attribute names and updating the metadata field from topicClassVocabURI to topicClassTermURI

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My main focus lay on the OAI oai_datacite export which is now working as expected.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ffritze tests are passing now! Thanks!

@@ -0,0 +1,38 @@
Analogue to the addition of a termURI field to the keywords in the citation metadata blocks, the same idea should also be applied to the topicClassification fields:

add a new subfield topicClassTermURI to the citation metadata block

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm confused. In this pull request should scripts/api/data/metadatablocks/citation.tsv be updated to include a new field?

Assuming so, this release note snippet should also include a ## Upgrade instructions section at the bottom explaining how to load it and how to update Solr to include the new field. https://github.com/IQSS/dataverse/releases/tag/v6.8 is probably a decent example. Here's a screenshot:

Image

"typeName": "topicClassTermURI",
"multiple": false,
"typeClass": "primitive",
"value": "http://www.topicClass.com/one"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Checks are failing:

Image

We should fix this. Don't worry, we'll help. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Size: 10 A percentage of a sprint. 7 hours.

Projects

Status: Ready for Review ⏩

Development

Successfully merging this pull request may close these issues.

Feature Request: Add new subfield topicClassTermURI to citation metadata

2 participants