Skip to content

Dataverse topic class term uri - #12614

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

Dataverse topic class term uri#12614
ffritze wants to merge 17 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

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.

@pdurbin I have updated the documentation by adapting the former keywordTermURI migration with https://github.com/IQSS/dataverse/releases/tag/v6.3

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.

Interesting. From a quick look I'm wondering if all that SQL should be put into a migration script so it can be run automatically. If you're not familiar with how we use Flyway for this: https://guides.dataverse.org/en/6.11/developers/sql-upgrade-scripts.html

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 don't think it can be automated - people may have been using the existing field correctly, in which case values shouldn't be migrated.

"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. 😄

datasetfieldtype.originOfSources.title=Origin of Historical Sources
datasetfieldtype.characteristicOfSources.title=Characteristic of Sources
datasetfieldtype.accessToSources.title=Documentation and Access to Sources
datasetfieldtype.title.description=The main title of the Dataset

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.

Somewhere in here we need a description. See Properties Check / Metadata Blocks Properties (pull_request) and "missing key" below:

Image

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.

Thanks for the info. It should have been fixed.

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.

Yes! Thanks!

@cmbz cmbz added FY27 Sprint 4 FY27 Sprint 4 (2026-08-12 - 2026-08-26) FY27 Sprint 5 FY27 Sprint 5 (2026-08-26 - 2026-09-09) labels Aug 26, 2026
"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.

I'm just putting this here at the bottom.

JSF tests are failing: Dataverse JSF Frontend Tests Workflow / main-jsf-tests-workflow (pull_request)

@srmanda-cs do you think this is because a new subfield was added? 🤔

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.

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.

@srmanda-cs says he's working on a fix! 🎉 ❤️ See #dev > JSF tests, automated with Playwright @ 💬

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.

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.

Passing now! Thanks, @srmanda-cs! ❤️ 🎉 🚀

@cmbz cmbz modified the milestones: 6.14, 6.13 Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY27 Sprint 4 FY27 Sprint 4 (2026-08-12 - 2026-08-26) FY27 Sprint 5 FY27 Sprint 5 (2026-08-26 - 2026-09-09) 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

4 participants