From a5f4bd7d339f8b7a37483d6beda6d124d7a90887 Mon Sep 17 00:00:00 2001 From: stevenferey Date: Wed, 7 Feb 2024 17:10:39 +0100 Subject: [PATCH 01/12] New keywordTermURI Metadata in keyword Metadata Block --- ...-add-term_uri-metadata-in-keyword-block.md | 3 + scripts/api/data/metadatablocks/citation.tsv | 113 +++++++++--------- .../java/propertyFiles/citation.properties | 3 + 3 files changed, 63 insertions(+), 56 deletions(-) create mode 100644 doc/release-notes/10288-add-term_uri-metadata-in-keyword-block.md diff --git a/doc/release-notes/10288-add-term_uri-metadata-in-keyword-block.md b/doc/release-notes/10288-add-term_uri-metadata-in-keyword-block.md new file mode 100644 index 00000000000..f0b94375592 --- /dev/null +++ b/doc/release-notes/10288-add-term_uri-metadata-in-keyword-block.md @@ -0,0 +1,3 @@ +### New keywordTermURI Metadata in keyword Metadata Block + +Adding a new metadata "keywordTermURI" to the keyword metadata block to facilitate the integration of controlled vocabulary services. (Issue #10288) \ No newline at end of file diff --git a/scripts/api/data/metadatablocks/citation.tsv b/scripts/api/data/metadatablocks/citation.tsv index b21b6bcce57..0d8378d8512 100644 --- a/scripts/api/data/metadatablocks/citation.tsv +++ b/scripts/api/data/metadatablocks/citation.tsv @@ -23,62 +23,63 @@ subject Subject The area of study relevant to the Dataset text 19 TRUE TRUE TRUE TRUE TRUE TRUE citation http://purl.org/dc/terms/subject keyword Keyword A key term that describes an important aspect of the Dataset and information about any controlled vocabulary used none 20 FALSE FALSE TRUE FALSE TRUE FALSE citation keywordValue Term A key term that describes important aspects of the Dataset text 21 #VALUE TRUE FALSE FALSE TRUE TRUE FALSE keyword citation - keywordVocabulary Controlled Vocabulary Name The controlled vocabulary used for the keyword term (e.g. LCSH, MeSH) text 22 (#VALUE) FALSE FALSE FALSE FALSE TRUE FALSE keyword citation - keywordVocabularyURI Controlled Vocabulary URL The URL where one can access information about the term's controlled vocabulary https:// url 23 #VALUE FALSE FALSE FALSE FALSE TRUE FALSE keyword citation - topicClassification Topic Classification Indicates a broad, important topic or subject that the Dataset covers and information about any controlled vocabulary used none 24 FALSE FALSE TRUE FALSE FALSE FALSE citation - topicClassValue Term A topic or subject term text 25 #VALUE TRUE FALSE FALSE TRUE FALSE FALSE topicClassification citation - topicClassVocab Controlled Vocabulary Name The controlled vocabulary used for the keyword term (e.g. LCSH, MeSH) text 26 (#VALUE) FALSE FALSE FALSE FALSE FALSE FALSE topicClassification citation - topicClassVocabURI Controlled Vocabulary URL The URL where one can access information about the term's controlled vocabulary https:// url 27 #VALUE FALSE FALSE FALSE FALSE FALSE FALSE topicClassification citation - publication Related Publication The article or report that uses the data in the Dataset. The full list of related publications will be displayed on the metadata tab none 28 FALSE FALSE TRUE FALSE TRUE FALSE citation http://purl.org/dc/terms/isReferencedBy - publicationCitation Citation The full bibliographic citation for the related publication textbox 29 #VALUE TRUE FALSE FALSE FALSE TRUE FALSE publication citation http://purl.org/dc/terms/bibliographicCitation - publicationIDType Identifier Type The type of identifier that uniquely identifies a related publication text 30 #VALUE: TRUE TRUE FALSE FALSE TRUE FALSE publication citation http://purl.org/spar/datacite/ResourceIdentifierScheme - publicationIDNumber Identifier The identifier for a related publication text 31 #VALUE TRUE FALSE FALSE FALSE TRUE FALSE publication citation http://purl.org/spar/datacite/ResourceIdentifier - publicationURL URL The URL form of the identifier entered in the Identifier field, e.g. the DOI URL if a DOI was entered in the Identifier field. Used to display what was entered in the ID Type and ID Number fields as a link. If what was entered in the Identifier field has no URL form, the URL of the publication webpage is used, e.g. a journal article webpage https:// url 32 #VALUE FALSE FALSE FALSE FALSE FALSE FALSE publication citation https://schema.org/distribution - notesText Notes Additional information about the Dataset textbox 33 FALSE FALSE FALSE FALSE TRUE FALSE citation - language Language A language that the Dataset's files is written in text 34 TRUE TRUE TRUE TRUE FALSE FALSE citation http://purl.org/dc/terms/language - producer Producer The entity, such a person or organization, managing the finances or other administrative processes involved in the creation of the Dataset none 35 FALSE FALSE TRUE FALSE FALSE FALSE citation - producerName Name The name of the entity, e.g. the person's name or the name of an organization 1) FamilyName, GivenName or 2) Organization text 36 #VALUE TRUE FALSE FALSE TRUE FALSE TRUE producer citation - producerAffiliation Affiliation The name of the entity affiliated with the producer, e.g. an organization's name Organization XYZ text 37 (#VALUE) FALSE FALSE FALSE FALSE FALSE FALSE producer citation - producerAbbreviation Abbreviated Name The producer's abbreviated name (e.g. IQSS, ICPSR) text 38 (#VALUE) FALSE FALSE FALSE FALSE FALSE FALSE producer citation - producerURL URL The URL of the producer's website https:// url 39 #VALUE FALSE FALSE FALSE FALSE FALSE FALSE producer citation - producerLogoURL Logo URL The URL of the producer's logo https:// url 40
FALSE FALSE FALSE FALSE FALSE FALSE producer citation - productionDate Production Date The date when the data were produced (not distributed, published, or archived) YYYY-MM-DD date 41 TRUE FALSE FALSE TRUE FALSE FALSE citation - productionPlace Production Location The location where the data and any related materials were produced or collected text 42 TRUE FALSE TRUE TRUE FALSE FALSE citation - contributor Contributor The entity, such as a person or organization, responsible for collecting, managing, or otherwise contributing to the development of the Dataset none 43 : FALSE FALSE TRUE FALSE FALSE FALSE citation http://purl.org/dc/terms/contributor - contributorType Type Indicates the type of contribution made to the dataset text 44 #VALUE TRUE TRUE FALSE TRUE FALSE FALSE contributor citation - contributorName Name The name of the contributor, e.g. the person's name or the name of an organization 1) FamilyName, GivenName or 2) Organization text 45 #VALUE TRUE FALSE FALSE TRUE FALSE FALSE contributor citation - grantNumber Funding Information Information about the Dataset's financial support none 46 : FALSE FALSE TRUE FALSE FALSE FALSE citation https://schema.org/sponsor - grantNumberAgency Agency The agency that provided financial support for the Dataset Organization XYZ text 47 #VALUE TRUE FALSE FALSE TRUE FALSE FALSE grantNumber citation - grantNumberValue Identifier The grant identifier or contract identifier of the agency that provided financial support for the Dataset text 48 #VALUE TRUE FALSE FALSE TRUE FALSE FALSE grantNumber citation - distributor Distributor The entity, such as a person or organization, designated to generate copies of the Dataset, including any editions or revisions none 49 FALSE FALSE TRUE FALSE FALSE FALSE citation - distributorName Name The name of the entity, e.g. the person's name or the name of an organization 1) FamilyName, GivenName or 2) Organization text 50 #VALUE TRUE FALSE FALSE TRUE FALSE FALSE distributor citation - distributorAffiliation Affiliation The name of the entity affiliated with the distributor, e.g. an organization's name Organization XYZ text 51 (#VALUE) FALSE FALSE FALSE FALSE FALSE FALSE distributor citation - distributorAbbreviation Abbreviated Name The distributor's abbreviated name (e.g. IQSS, ICPSR) text 52 (#VALUE) FALSE FALSE FALSE FALSE FALSE FALSE distributor citation - distributorURL URL The URL of the distributor's webpage https:// url 53 #VALUE FALSE FALSE FALSE FALSE FALSE FALSE distributor citation - distributorLogoURL Logo URL The URL of the distributor's logo image, used to show the image on the Dataset's page https:// url 54
FALSE FALSE FALSE FALSE FALSE FALSE distributor citation - distributionDate Distribution Date The date when the Dataset was made available for distribution/presentation YYYY-MM-DD date 55 TRUE FALSE FALSE TRUE FALSE FALSE citation - depositor Depositor The entity, such as a person or organization, that deposited the Dataset in the repository 1) FamilyName, GivenName or 2) Organization text 56 FALSE FALSE FALSE FALSE FALSE FALSE citation - dateOfDeposit Deposit Date The date when the Dataset was deposited into the repository YYYY-MM-DD date 57 FALSE FALSE FALSE TRUE FALSE FALSE citation http://purl.org/dc/terms/dateSubmitted - timePeriodCovered Time Period The time period that the data refer to. Also known as span. This is the time period covered by the data, not the dates of coding, collecting data, or making documents machine-readable none 58 ; FALSE FALSE TRUE FALSE FALSE FALSE citation https://schema.org/temporalCoverage - timePeriodCoveredStart Start Date The start date of the time period that the data refer to YYYY-MM-DD date 59 #NAME: #VALUE TRUE FALSE FALSE TRUE FALSE FALSE timePeriodCovered citation - timePeriodCoveredEnd End Date The end date of the time period that the data refer to YYYY-MM-DD date 60 #NAME: #VALUE TRUE FALSE FALSE TRUE FALSE FALSE timePeriodCovered citation - dateOfCollection Date of Collection The dates when the data were collected or generated none 61 ; FALSE FALSE TRUE FALSE FALSE FALSE citation - dateOfCollectionStart Start Date The date when the data collection started YYYY-MM-DD date 62 #NAME: #VALUE FALSE FALSE FALSE FALSE FALSE FALSE dateOfCollection citation - dateOfCollectionEnd End Date The date when the data collection ended YYYY-MM-DD date 63 #NAME: #VALUE FALSE FALSE FALSE FALSE FALSE FALSE dateOfCollection citation - kindOfData Data Type The type of data included in the files (e.g. survey data, clinical data, or machine-readable text) text 64 TRUE FALSE TRUE TRUE FALSE FALSE citation http://rdf-vocabulary.ddialliance.org/discovery#kindOfData - series Series Information about the dataset series to which the Dataset belong none 65 : FALSE FALSE TRUE FALSE FALSE FALSE citation - seriesName Name The name of the dataset series text 66 #VALUE TRUE FALSE FALSE TRUE FALSE FALSE series citation - seriesInformation Information Can include 1) a history of the series and 2) a summary of features that apply to the series textbox 67 #VALUE FALSE FALSE FALSE FALSE FALSE FALSE series citation - software Software Information about the software used to generate the Dataset none 68 , FALSE FALSE TRUE FALSE FALSE FALSE citation https://www.w3.org/TR/prov-o/#wasGeneratedBy - softwareName Name The name of software used to generate the Dataset text 69 #VALUE FALSE TRUE FALSE FALSE FALSE FALSE software citation - softwareVersion Version The version of the software used to generate the Dataset, e.g. 4.11 text 70 #NAME: #VALUE FALSE FALSE FALSE FALSE FALSE FALSE software citation - relatedMaterial Related Material Information, such as a persistent ID or citation, about the material related to the Dataset, such as appendices or sampling information available outside of the Dataset textbox 71 FALSE FALSE TRUE FALSE FALSE FALSE citation - relatedDatasets Related Dataset Information, such as a persistent ID or citation, about a related dataset, such as previous research on the Dataset's subject textbox 72 FALSE FALSE TRUE FALSE FALSE FALSE citation http://purl.org/dc/terms/relation - otherReferences Other Reference Information, such as a persistent ID or citation, about another type of resource that provides background or supporting material to the Dataset text 73 FALSE FALSE TRUE FALSE FALSE FALSE citation http://purl.org/dc/terms/references - dataSources Data Source Information, such as a persistent ID or citation, about sources of the Dataset (e.g. a book, article, serial, or machine-readable data file) textbox 74 FALSE FALSE TRUE FALSE FALSE FALSE citation https://www.w3.org/TR/prov-o/#wasDerivedFrom - originOfSources Origin of Historical Sources For historical sources, the origin and any rules followed in establishing them as sources textbox 75 FALSE FALSE FALSE FALSE FALSE FALSE citation - characteristicOfSources Characteristic of Sources Characteristics not already noted elsewhere textbox 76 FALSE FALSE FALSE FALSE FALSE FALSE citation - accessToSources Documentation and Access to Sources 1) Methods or procedures for accessing data sources and 2) any special permissions needed for access textbox 77 FALSE FALSE FALSE FALSE FALSE FALSE citation + keywordTermURI Term URI Keyword URI points to the web presence of the term. Enter an absolute URI, starting by https:// https:// url 22 #VALUE FALSE FALSE FALSE FALSE TRUE FALSE keyword citation + keywordVocabulary Controlled Vocabulary Name The controlled vocabulary used for the keyword term (e.g. LCSH, MeSH) text 23 (#VALUE) FALSE FALSE FALSE FALSE TRUE FALSE keyword citation + keywordVocabularyURI Controlled Vocabulary URL The URL where one can access information about the term's controlled vocabulary https:// url 24 #VALUE FALSE FALSE FALSE FALSE TRUE FALSE keyword citation + topicClassification Topic Classification Indicates a broad, important topic or subject that the Dataset covers and information about any controlled vocabulary used none 25 FALSE FALSE TRUE FALSE FALSE FALSE citation + topicClassValue Term A topic or subject term text 26 #VALUE TRUE FALSE FALSE TRUE FALSE FALSE topicClassification citation + topicClassVocab Controlled Vocabulary Name The controlled vocabulary used for the keyword term (e.g. LCSH, MeSH) text 27 (#VALUE) FALSE FALSE FALSE FALSE FALSE FALSE topicClassification citation + topicClassVocabURI Controlled Vocabulary URL The URL where one can access information about the term's controlled vocabulary https:// url 28 #VALUE FALSE FALSE FALSE FALSE FALSE FALSE topicClassification citation + publication Related Publication The article or report that uses the data in the Dataset. The full list of related publications will be displayed on the metadata tab none 29 FALSE FALSE TRUE FALSE TRUE FALSE citation http://purl.org/dc/terms/isReferencedBy + publicationCitation Citation The full bibliographic citation for the related publication textbox 30 #VALUE TRUE FALSE FALSE FALSE TRUE FALSE publication citation http://purl.org/dc/terms/bibliographicCitation + publicationIDType Identifier Type The type of identifier that uniquely identifies a related publication text 31 #VALUE: TRUE TRUE FALSE FALSE TRUE FALSE publication citation http://purl.org/spar/datacite/ResourceIdentifierScheme + publicationIDNumber Identifier The identifier for a related publication text 32 #VALUE TRUE FALSE FALSE FALSE TRUE FALSE publication citation http://purl.org/spar/datacite/ResourceIdentifier + publicationURL URL The URL form of the identifier entered in the Identifier field, e.g. the DOI URL if a DOI was entered in the Identifier field. Used to display what was entered in the ID Type and ID Number fields as a link. If what was entered in the Identifier field has no URL form, the URL of the publication webpage is used, e.g. a journal article webpage https:// url 33 #VALUE FALSE FALSE FALSE FALSE FALSE FALSE publication citation https://schema.org/distribution + notesText Notes Additional information about the Dataset textbox 34 FALSE FALSE FALSE FALSE TRUE FALSE citation + language Language A language that the Dataset's files is written in text 35 TRUE TRUE TRUE TRUE FALSE FALSE citation http://purl.org/dc/terms/language + producer Producer The entity, such a person or organization, managing the finances or other administrative processes involved in the creation of the Dataset none 36 FALSE FALSE TRUE FALSE FALSE FALSE citation + producerName Name The name of the entity, e.g. the person's name or the name of an organization 1) FamilyName, GivenName or 2) Organization text 37 #VALUE TRUE FALSE FALSE TRUE FALSE TRUE producer citation + producerAffiliation Affiliation The name of the entity affiliated with the producer, e.g. an organization's name Organization XYZ text 38 (#VALUE) FALSE FALSE FALSE FALSE FALSE FALSE producer citation + producerAbbreviation Abbreviated Name The producer's abbreviated name (e.g. IQSS, ICPSR) text 39 (#VALUE) FALSE FALSE FALSE FALSE FALSE FALSE producer citation + producerURL URL The URL of the producer's website https:// url 40 #VALUE FALSE FALSE FALSE FALSE FALSE FALSE producer citation + producerLogoURL Logo URL The URL of the producer's logo https:// url 41
FALSE FALSE FALSE FALSE FALSE FALSE producer citation + productionDate Production Date The date when the data were produced (not distributed, published, or archived) YYYY-MM-DD date 42 TRUE FALSE FALSE TRUE FALSE FALSE citation + productionPlace Production Location The location where the data and any related materials were produced or collected text 43 TRUE FALSE TRUE TRUE FALSE FALSE citation + contributor Contributor The entity, such as a person or organization, responsible for collecting, managing, or otherwise contributing to the development of the Dataset none 44 : FALSE FALSE TRUE FALSE FALSE FALSE citation http://purl.org/dc/terms/contributor + contributorType Type Indicates the type of contribution made to the dataset text 45 #VALUE TRUE TRUE FALSE TRUE FALSE FALSE contributor citation + contributorName Name The name of the contributor, e.g. the person's name or the name of an organization 1) FamilyName, GivenName or 2) Organization text 46 #VALUE TRUE FALSE FALSE TRUE FALSE FALSE contributor citation + grantNumber Funding Information Information about the Dataset's financial support none 47 : FALSE FALSE TRUE FALSE FALSE FALSE citation https://schema.org/sponsor + grantNumberAgency Agency The agency that provided financial support for the Dataset Organization XYZ text 48 #VALUE TRUE FALSE FALSE TRUE FALSE FALSE grantNumber citation + grantNumberValue Identifier The grant identifier or contract identifier of the agency that provided financial support for the Dataset text 49 #VALUE TRUE FALSE FALSE TRUE FALSE FALSE grantNumber citation + distributor Distributor The entity, such as a person or organization, designated to generate copies of the Dataset, including any editions or revisions none 50 FALSE FALSE TRUE FALSE FALSE FALSE citation + distributorName Name The name of the entity, e.g. the person's name or the name of an organization 1) FamilyName, GivenName or 2) Organization text 51 #VALUE TRUE FALSE FALSE TRUE FALSE FALSE distributor citation + distributorAffiliation Affiliation The name of the entity affiliated with the distributor, e.g. an organization's name Organization XYZ text 52 (#VALUE) FALSE FALSE FALSE FALSE FALSE FALSE distributor citation + distributorAbbreviation Abbreviated Name The distributor's abbreviated name (e.g. IQSS, ICPSR) text 53 (#VALUE) FALSE FALSE FALSE FALSE FALSE FALSE distributor citation + distributorURL URL The URL of the distributor's webpage https:// url 54 #VALUE FALSE FALSE FALSE FALSE FALSE FALSE distributor citation + distributorLogoURL Logo URL The URL of the distributor's logo image, used to show the image on the Dataset's page https:// url 55
FALSE FALSE FALSE FALSE FALSE FALSE distributor citation + distributionDate Distribution Date The date when the Dataset was made available for distribution/presentation YYYY-MM-DD date 56 TRUE FALSE FALSE TRUE FALSE FALSE citation + depositor Depositor The entity, such as a person or organization, that deposited the Dataset in the repository 1) FamilyName, GivenName or 2) Organization text 57 FALSE FALSE FALSE FALSE FALSE FALSE citation + dateOfDeposit Deposit Date The date when the Dataset was deposited into the repository YYYY-MM-DD date 58 FALSE FALSE FALSE TRUE FALSE FALSE citation http://purl.org/dc/terms/dateSubmitted + timePeriodCovered Time Period The time period that the data refer to. Also known as span. This is the time period covered by the data, not the dates of coding, collecting data, or making documents machine-readable none 59 ; FALSE FALSE TRUE FALSE FALSE FALSE citation https://schema.org/temporalCoverage + timePeriodCoveredStart Start Date The start date of the time period that the data refer to YYYY-MM-DD date 60 #NAME: #VALUE TRUE FALSE FALSE TRUE FALSE FALSE timePeriodCovered citation + timePeriodCoveredEnd End Date The end date of the time period that the data refer to YYYY-MM-DD date 61 #NAME: #VALUE TRUE FALSE FALSE TRUE FALSE FALSE timePeriodCovered citation + dateOfCollection Date of Collection The dates when the data were collected or generated none 62 ; FALSE FALSE TRUE FALSE FALSE FALSE citation + dateOfCollectionStart Start Date The date when the data collection started YYYY-MM-DD date 63 #NAME: #VALUE FALSE FALSE FALSE FALSE FALSE FALSE dateOfCollection citation + dateOfCollectionEnd End Date The date when the data collection ended YYYY-MM-DD date 64 #NAME: #VALUE FALSE FALSE FALSE FALSE FALSE FALSE dateOfCollection citation + kindOfData Data Type The type of data included in the files (e.g. survey data, clinical data, or machine-readable text) text 65 TRUE FALSE TRUE TRUE FALSE FALSE citation http://rdf-vocabulary.ddialliance.org/discovery#kindOfData + series Series Information about the dataset series to which the Dataset belong none 66 : FALSE FALSE TRUE FALSE FALSE FALSE citation + seriesName Name The name of the dataset series text 67 #VALUE TRUE FALSE FALSE TRUE FALSE FALSE series citation + seriesInformation Information Can include 1) a history of the series and 2) a summary of features that apply to the series textbox 68 #VALUE FALSE FALSE FALSE FALSE FALSE FALSE series citation + software Software Information about the software used to generate the Dataset none 69 , FALSE FALSE TRUE FALSE FALSE FALSE citation https://www.w3.org/TR/prov-o/#wasGeneratedBy + softwareName Name The name of software used to generate the Dataset text 70 #VALUE FALSE TRUE FALSE FALSE FALSE FALSE software citation + softwareVersion Version The version of the software used to generate the Dataset, e.g. 4.11 text 71 #NAME: #VALUE FALSE FALSE FALSE FALSE FALSE FALSE software citation + relatedMaterial Related Material Information, such as a persistent ID or citation, about the material related to the Dataset, such as appendices or sampling information available outside of the Dataset textbox 72 FALSE FALSE TRUE FALSE FALSE FALSE citation + relatedDatasets Related Dataset Information, such as a persistent ID or citation, about a related dataset, such as previous research on the Dataset's subject textbox 73 FALSE FALSE TRUE FALSE FALSE FALSE citation http://purl.org/dc/terms/relation + otherReferences Other Reference Information, such as a persistent ID or citation, about another type of resource that provides background or supporting material to the Dataset text 74 FALSE FALSE TRUE FALSE FALSE FALSE citation http://purl.org/dc/terms/references + dataSources Data Source Information, such as a persistent ID or citation, about sources of the Dataset (e.g. a book, article, serial, or machine-readable data file) textbox 75 FALSE FALSE TRUE FALSE FALSE FALSE citation https://www.w3.org/TR/prov-o/#wasDerivedFrom + originOfSources Origin of Historical Sources For historical sources, the origin and any rules followed in establishing them as sources textbox 76 FALSE FALSE FALSE FALSE FALSE FALSE citation + characteristicOfSources Characteristic of Sources Characteristics not already noted elsewhere textbox 77 FALSE FALSE FALSE FALSE FALSE FALSE citation + accessToSources Documentation and Access to Sources 1) Methods or procedures for accessing data sources and 2) any special permissions needed for access textbox 78 FALSE FALSE FALSE FALSE FALSE FALSE citation #controlledVocabulary DatasetField Value identifier displayOrder subject Agricultural Sciences D01 0 subject Arts and Humanities D0 1 diff --git a/src/main/java/propertyFiles/citation.properties b/src/main/java/propertyFiles/citation.properties index f35ede79b50..45caabb990a 100644 --- a/src/main/java/propertyFiles/citation.properties +++ b/src/main/java/propertyFiles/citation.properties @@ -22,6 +22,7 @@ datasetfieldtype.dsDescriptionValue.title=Text datasetfieldtype.dsDescriptionDate.title=Date datasetfieldtype.subject.title=Subject datasetfieldtype.keyword.title=Keyword +datasetfieldtype.keywordTermURI.title=Term URI datasetfieldtype.keywordValue.title=Term datasetfieldtype.keywordVocabulary.title=Controlled Vocabulary Name datasetfieldtype.keywordVocabularyURI.title=Controlled Vocabulary URL @@ -100,6 +101,7 @@ datasetfieldtype.dsDescriptionValue.description=A summary describing the purpose datasetfieldtype.dsDescriptionDate.description=The date when the description was added to the Dataset. If the Dataset contains more than one description, e.g. the data producer supplied one description and the data repository supplied another, this date is used to distinguish between the descriptions datasetfieldtype.subject.description=The area of study relevant to the Dataset datasetfieldtype.keyword.description=A key term that describes an important aspect of the Dataset and information about any controlled vocabulary used +datasetfieldtype.keywordTermURL.description=Keyword URI points to the web presence of the term. Enter an absolute URI, starting by https:// datasetfieldtype.keywordValue.description=A key term that describes important aspects of the Dataset datasetfieldtype.keywordVocabulary.description=The controlled vocabulary used for the keyword term (e.g. LCSH, MeSH) datasetfieldtype.keywordVocabularyURI.description=The URL where one can access information about the term's controlled vocabulary @@ -178,6 +180,7 @@ datasetfieldtype.dsDescriptionValue.watermark= datasetfieldtype.dsDescriptionDate.watermark=YYYY-MM-DD datasetfieldtype.subject.watermark= datasetfieldtype.keyword.watermark= +datasetfieldtype.keywordTermURL.watermark=https:// datasetfieldtype.keywordValue.watermark= datasetfieldtype.keywordVocabulary.watermark= datasetfieldtype.keywordVocabularyURI.watermark=https:// From 9f728453eff6041a3becee2a093fb3479af2d317 Mon Sep 17 00:00:00 2001 From: stevenferey Date: Wed, 7 Feb 2024 17:12:46 +0100 Subject: [PATCH 02/12] update of the keywordVocabularyURI metadata to make it consistent with its name Controlled Vocabulary URL --- scripts/api/data/metadatablocks/citation.tsv | 2 +- src/main/java/propertyFiles/citation.properties | 2 +- .../V6.1.0.2__10288-update_keywordVocabularyURI_metadata.sql | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/db/migration/V6.1.0.2__10288-update_keywordVocabularyURI_metadata.sql diff --git a/scripts/api/data/metadatablocks/citation.tsv b/scripts/api/data/metadatablocks/citation.tsv index 0d8378d8512..39a763db9d9 100644 --- a/scripts/api/data/metadatablocks/citation.tsv +++ b/scripts/api/data/metadatablocks/citation.tsv @@ -25,7 +25,7 @@ keywordValue Term A key term that describes important aspects of the Dataset text 21 #VALUE TRUE FALSE FALSE TRUE TRUE FALSE keyword citation keywordTermURI Term URI Keyword URI points to the web presence of the term. Enter an absolute URI, starting by https:// https:// url 22 #VALUE FALSE FALSE FALSE FALSE TRUE FALSE keyword citation keywordVocabulary Controlled Vocabulary Name The controlled vocabulary used for the keyword term (e.g. LCSH, MeSH) text 23 (#VALUE) FALSE FALSE FALSE FALSE TRUE FALSE keyword citation - keywordVocabularyURI Controlled Vocabulary URL The URL where one can access information about the term's controlled vocabulary https:// url 24 #VALUE FALSE FALSE FALSE FALSE TRUE FALSE keyword citation + keywordVocabularyURL Controlled Vocabulary URL The URL where one can access information about the term's controlled vocabulary https:// url 24 #VALUE FALSE FALSE FALSE FALSE TRUE FALSE keyword citation topicClassification Topic Classification Indicates a broad, important topic or subject that the Dataset covers and information about any controlled vocabulary used none 25 FALSE FALSE TRUE FALSE FALSE FALSE citation topicClassValue Term A topic or subject term text 26 #VALUE TRUE FALSE FALSE TRUE FALSE FALSE topicClassification citation topicClassVocab Controlled Vocabulary Name The controlled vocabulary used for the keyword term (e.g. LCSH, MeSH) text 27 (#VALUE) FALSE FALSE FALSE FALSE FALSE FALSE topicClassification citation diff --git a/src/main/java/propertyFiles/citation.properties b/src/main/java/propertyFiles/citation.properties index 45caabb990a..4c5f05fec81 100644 --- a/src/main/java/propertyFiles/citation.properties +++ b/src/main/java/propertyFiles/citation.properties @@ -25,7 +25,7 @@ datasetfieldtype.keyword.title=Keyword datasetfieldtype.keywordTermURI.title=Term URI datasetfieldtype.keywordValue.title=Term datasetfieldtype.keywordVocabulary.title=Controlled Vocabulary Name -datasetfieldtype.keywordVocabularyURI.title=Controlled Vocabulary URL +datasetfieldtype.keywordVocabularyURL.title=Controlled Vocabulary URL datasetfieldtype.topicClassification.title=Topic Classification datasetfieldtype.topicClassValue.title=Term datasetfieldtype.topicClassVocab.title=Controlled Vocabulary Name diff --git a/src/main/resources/db/migration/V6.1.0.2__10288-update_keywordVocabularyURI_metadata.sql b/src/main/resources/db/migration/V6.1.0.2__10288-update_keywordVocabularyURI_metadata.sql new file mode 100644 index 00000000000..ee47d3e9a28 --- /dev/null +++ b/src/main/resources/db/migration/V6.1.0.2__10288-update_keywordVocabularyURI_metadata.sql @@ -0,0 +1,5 @@ +-- update of the "keywordVocabularyURI" metadata to make it consistent with its name "Controlled Vocabulary URL" +UPDATE datasetfieldtype SET name = 'keywordVocabularyURL' +WHERE name = 'keywordVocabularyURI' +AND parentdatasetfieldtype_id = ( + SELECT id FROM datasetfieldtype WHERE name = 'keyword') ; \ No newline at end of file From c103610d09168269ccf7dc408b7b2736be0ad644 Mon Sep 17 00:00:00 2001 From: stevenferey Date: Wed, 7 Feb 2024 17:21:31 +0100 Subject: [PATCH 03/12] fix description and watermark properties --- src/main/java/propertyFiles/citation.properties | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/propertyFiles/citation.properties b/src/main/java/propertyFiles/citation.properties index 4c5f05fec81..3f0a0c4dd12 100644 --- a/src/main/java/propertyFiles/citation.properties +++ b/src/main/java/propertyFiles/citation.properties @@ -101,10 +101,10 @@ datasetfieldtype.dsDescriptionValue.description=A summary describing the purpose datasetfieldtype.dsDescriptionDate.description=The date when the description was added to the Dataset. If the Dataset contains more than one description, e.g. the data producer supplied one description and the data repository supplied another, this date is used to distinguish between the descriptions datasetfieldtype.subject.description=The area of study relevant to the Dataset datasetfieldtype.keyword.description=A key term that describes an important aspect of the Dataset and information about any controlled vocabulary used -datasetfieldtype.keywordTermURL.description=Keyword URI points to the web presence of the term. Enter an absolute URI, starting by https:// +datasetfieldtype.keywordTermURI.description=Keyword URI points to the web presence of the term. Enter an absolute URI, starting by https:// datasetfieldtype.keywordValue.description=A key term that describes important aspects of the Dataset datasetfieldtype.keywordVocabulary.description=The controlled vocabulary used for the keyword term (e.g. LCSH, MeSH) -datasetfieldtype.keywordVocabularyURI.description=The URL where one can access information about the term's controlled vocabulary +datasetfieldtype.keywordVocabularyURL.description=The URL where one can access information about the term's controlled vocabulary datasetfieldtype.topicClassification.description=Indicates a broad, important topic or subject that the Dataset covers and information about any controlled vocabulary used datasetfieldtype.topicClassValue.description=A topic or subject term datasetfieldtype.topicClassVocab.description=The controlled vocabulary used for the keyword term (e.g. LCSH, MeSH) @@ -180,10 +180,10 @@ datasetfieldtype.dsDescriptionValue.watermark= datasetfieldtype.dsDescriptionDate.watermark=YYYY-MM-DD datasetfieldtype.subject.watermark= datasetfieldtype.keyword.watermark= -datasetfieldtype.keywordTermURL.watermark=https:// +datasetfieldtype.keywordTermURI.watermark=https:// datasetfieldtype.keywordValue.watermark= datasetfieldtype.keywordVocabulary.watermark= -datasetfieldtype.keywordVocabularyURI.watermark=https:// +datasetfieldtype.keywordVocabularyURL.watermark=https:// datasetfieldtype.topicClassification.watermark= datasetfieldtype.topicClassValue.watermark= datasetfieldtype.topicClassVocab.watermark= From 5e9d9349c40ae88cf8566878c6c1c5e3e0c6202d Mon Sep 17 00:00:00 2001 From: stevenferey Date: Wed, 28 Feb 2024 15:50:04 +0100 Subject: [PATCH 04/12] 10288 adding documentation --- ...-add-term_uri-metadata-in-keyword-block.md | 47 ++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/doc/release-notes/10288-add-term_uri-metadata-in-keyword-block.md b/doc/release-notes/10288-add-term_uri-metadata-in-keyword-block.md index f0b94375592..e060cf23505 100644 --- a/doc/release-notes/10288-add-term_uri-metadata-in-keyword-block.md +++ b/doc/release-notes/10288-add-term_uri-metadata-in-keyword-block.md @@ -1,3 +1,48 @@ ### New keywordTermURI Metadata in keyword Metadata Block -Adding a new metadata "keywordTermURI" to the keyword metadata block to facilitate the integration of controlled vocabulary services. (Issue #10288) \ No newline at end of file +Adding a new metadata "keywordTermURI" to the keyword metadata block to facilitate the integration of controlled vocabulary services, in particular by adding the possibility of saving the "term" and its associated URI. (Issue #10288) + +## Upgrade Instructions + +1\. Update the Citation metadata block + +- `wget https://github.com/IQSS/dataverse/releases/download/v6.2/citation.tsv` +- `curl http://localhost:8080/api/admin/datasetfield/load -X POST --data-binary @citation.tsv -H "Content-type: text/tab-separated-values"` + +2\. Update your Solr `schema.xml` to include the new field. + + For details, please see https://guides.dataverse.org/en/latest/admin/metadatacustomization.html#updating-the-solr-schema + + +3\. Once schema.xml is updated, Solr should be restarted and a ['Reindex in Place'](https://guides.dataverse.org/en/latest/admin/solr-search-index.html#reindex-in-place) will be required. + + +4\. Run ReExportAll to update dataset metadata exports. Follow the directions in the [Admin Guide](http://guides.dataverse.org/en/latest/admin/metadataexport.html#batch-exports-through-the-api). + + +## Notes for Dataverse Installation Administrators + +### Data migration to the new "keywordTermURI" field + +You can migrate your "keywordValue" data containing URIs to the new "keywordTermURI" field. +You can visualize the data that can be migrated with the following database query: + +``` +SELECT value FROM datasetfieldvalue dfv +INNER JOIN datasetfield df ON df.id = dfv.datasetfield_id +WHERE df.datasetfieldtype_id = (SELECT id FROM datasetfieldtype WHERE name = 'keywordValue') +AND value LIKE lower('http%'); +``` + +If you wish to migrate your data, a database update is then necessary: + +``` +UPDATE datasetfield df +SET datasetfieldtype_id = (SELECT id FROM datasetfieldtype WHERE name = 'keywordTermURI') +FROM datasetfieldvalue dfv +WHERE dfv.datasetfield_id = df.id +AND df.datasetfieldtype_id = (SELECT id FROM datasetfieldtype WHERE name = 'keywordValue') +AND dfv.value LIKE lower('http%'); +``` + +A ['Reindex in Place'](https://guides.dataverse.org/en/latest/admin/solr-search-index.html#reindex-in-place) will be required and ReExportAll will need to be run to update the metadata exports of the dataset. Follow the directions in the [Admin Guide](http://guides.dataverse.org/en/latest/admin/metadataexport.html#batch-exports-through-the-api). \ No newline at end of file From 221311c68857f96f63a0ba969bbc6459edb27fe6 Mon Sep 17 00:00:00 2001 From: stevenferey Date: Fri, 1 Mar 2024 16:47:38 +0100 Subject: [PATCH 05/12] 10288 - adaptation of the SolR schema and dataset exports --- conf/solr/9.3.0/schema.xml | 6 +- ...dataset-create-new-all-default-fields.json | 20 ++++-- .../iq/dataverse/DatasetFieldConstant.java | 7 +- .../harvard/iq/dataverse/DatasetKeyword.java | 68 ------------------- .../api/imports/ImportDDIServiceBean.java | 2 +- .../dataverse/export/ddi/DdiExportUtil.java | 14 ++-- .../export/openaire/OpenAireExportUtil.java | 16 +++-- ...-update_keywordVocabularyURI_metadata.sql} | 0 .../export/OpenAireExportUtilTest.java | 4 +- .../export/SchemaDotOrgExporterTest.java | 3 +- .../dataverse/export/dataset-all-defaults.txt | 20 ++++-- .../dataset-create-new-all-ddi-fields.json | 20 ++++-- .../dataverse/export/ddi/dataset-finch1.json | 20 ++++-- src/test/resources/json/dataset-finch2.json | 20 ++++-- .../json/dataset-long-description.json | 20 ++++-- 15 files changed, 127 insertions(+), 113 deletions(-) delete mode 100644 src/main/java/edu/harvard/iq/dataverse/DatasetKeyword.java rename src/main/resources/db/migration/{V6.1.0.2__10288-update_keywordVocabularyURI_metadata.sql => V6.1.0.4__10288-update_keywordVocabularyURI_metadata.sql} (100%) diff --git a/conf/solr/9.3.0/schema.xml b/conf/solr/9.3.0/schema.xml index 3711ffeddba..39cf791aafc 100644 --- a/conf/solr/9.3.0/schema.xml +++ b/conf/solr/9.3.0/schema.xml @@ -323,8 +323,9 @@ + - + @@ -562,8 +563,9 @@ + - + diff --git a/scripts/api/data/dataset-create-new-all-default-fields.json b/scripts/api/data/dataset-create-new-all-default-fields.json index 1118ed98a03..28b8d16417a 100644 --- a/scripts/api/data/dataset-create-new-all-default-fields.json +++ b/scripts/api/data/dataset-create-new-all-default-fields.json @@ -231,14 +231,20 @@ "typeClass": "primitive", "value": "KeywordTerm1" }, + "keywordTermURI": { + "typeName": "keywordTermURI", + "multiple": false, + "typeClass": "primitive", + "value": "http://keywordTermURI1.org" + }, "keywordVocabulary": { "typeName": "keywordVocabulary", "multiple": false, "typeClass": "primitive", "value": "KeywordVocabulary1" }, - "keywordVocabularyURI": { - "typeName": "keywordVocabularyURI", + "keywordVocabularyURL": { + "typeName": "keywordVocabularyURL", "multiple": false, "typeClass": "primitive", "value": "http://KeywordVocabularyURL1.org" @@ -251,14 +257,20 @@ "typeClass": "primitive", "value": "KeywordTerm2" }, + "keywordTermURI": { + "typeName": "keywordTermURI", + "multiple": false, + "typeClass": "primitive", + "value": "http://keywordTermURI2.org" + }, "keywordVocabulary": { "typeName": "keywordVocabulary", "multiple": false, "typeClass": "primitive", "value": "KeywordVocabulary2" }, - "keywordVocabularyURI": { - "typeName": "keywordVocabularyURI", + "keywordVocabularyURL": { + "typeName": "keywordVocabularyURL", "multiple": false, "typeClass": "primitive", "value": "http://KeywordVocabularyURL2.org" diff --git a/src/main/java/edu/harvard/iq/dataverse/DatasetFieldConstant.java b/src/main/java/edu/harvard/iq/dataverse/DatasetFieldConstant.java index 1621b80df55..5045c062730 100644 --- a/src/main/java/edu/harvard/iq/dataverse/DatasetFieldConstant.java +++ b/src/main/java/edu/harvard/iq/dataverse/DatasetFieldConstant.java @@ -91,8 +91,9 @@ public class DatasetFieldConstant implements java.io.Serializable { public final static String datasetVersionValue="datasetVersionValue"; public final static String versionDate="versionDate"; public final static String keywordValue="keywordValue"; + public final static String keywordTermURI="keywordTermURI"; public final static String keywordVocab="keywordVocabulary"; //SEK 6/10/2016 to match what is in the db - public final static String keywordVocabURI="keywordVocabularyURI"; //SEK 6/10/2016 to match what is in the db + public final static String keywordVocabURL="keywordVocabularyURL"; //SEK 6/10/2016 to match what is in the db public final static String topicClassValue="topicClassValue"; public final static String topicClassVocab="topicClassVocab"; public final static String topicClassVocabURI="topicClassVocabURI"; @@ -310,8 +311,8 @@ public String getKeywordVocab() { return keywordVocab; } - public String getKeywordVocabURI() { - return keywordVocabURI; + public String getKeywordVocabURL() { + return keywordVocabURL; } public String getTopicClassValue() { diff --git a/src/main/java/edu/harvard/iq/dataverse/DatasetKeyword.java b/src/main/java/edu/harvard/iq/dataverse/DatasetKeyword.java deleted file mode 100644 index 747e3c068f1..00000000000 --- a/src/main/java/edu/harvard/iq/dataverse/DatasetKeyword.java +++ /dev/null @@ -1,68 +0,0 @@ -package edu.harvard.iq.dataverse; - -/** - * - * @author skraffmiller - */ - -public class DatasetKeyword { - - private int displayOrder; - public int getDisplayOrder() { - return this.displayOrder; - } - public void setDisplayOrder(int displayOrder) { - this.displayOrder = displayOrder; - } - - private DatasetField value; - public DatasetField getValue() { - return this.value; - } - public void setValue(DatasetField value) { - this.value = value; - } - - private DatasetVersion datasetVersion; - public DatasetVersion getDatasetVersion() { - return datasetVersion; - } - public void setDatasetVersion(DatasetVersion metadata) { - this.datasetVersion = metadata; - } - /* - @Version - private Long version; - public Long getVersion() { - return this.version; - } - public void setVersion(Long version) { - this.version = version; - } */ - - private DatasetField vocab; - public DatasetField getVocab() { - return this.vocab; - } - public void setVocab(DatasetField vocab) { - this.vocab = vocab; - } - - private DatasetField vocabURI; - public DatasetField getVocabURI() { - return this.vocabURI; - } - public void setVocabURI(DatasetField vocabURI) { - this.vocabURI = vocabURI; - } - - - public boolean isEmpty() { - /*return ((value==null || value.getValue().trim().equals("")) - && (vocab==null || vocab.getValue().trim().equals("")) - && (vocabURI==null || vocabURI.getValue().trim().equals("")));*/ - return false; - } - - -} diff --git a/src/main/java/edu/harvard/iq/dataverse/api/imports/ImportDDIServiceBean.java b/src/main/java/edu/harvard/iq/dataverse/api/imports/ImportDDIServiceBean.java index 73a83035fc5..8b5bb2867b0 100644 --- a/src/main/java/edu/harvard/iq/dataverse/api/imports/ImportDDIServiceBean.java +++ b/src/main/java/edu/harvard/iq/dataverse/api/imports/ImportDDIServiceBean.java @@ -546,7 +546,7 @@ private void processSubject(XMLStreamReader xmlr, MetadataBlockDTO citation) thr if (xmlr.getLocalName().equals("keyword")) { HashSet set = new HashSet<>(); addToSet(set,"keywordVocabulary", xmlr.getAttributeValue(null, "vocab")); - addToSet(set, "keywordVocabularyURI", xmlr.getAttributeValue(null, "vocabURI") ); + addToSet(set, "keywordVocabularyURL", xmlr.getAttributeValue(null, "vocabURI") ); addToSet(set,"keywordValue", parseText(xmlr)); if (!set.isEmpty()) { keywords.add(set); diff --git a/src/main/java/edu/harvard/iq/dataverse/export/ddi/DdiExportUtil.java b/src/main/java/edu/harvard/iq/dataverse/export/ddi/DdiExportUtil.java index 9a689f7a4ed..4fe745df205 100644 --- a/src/main/java/edu/harvard/iq/dataverse/export/ddi/DdiExportUtil.java +++ b/src/main/java/edu/harvard/iq/dataverse/export/ddi/DdiExportUtil.java @@ -714,7 +714,7 @@ private static void writeSubjectElement(XMLStreamWriter xmlw, DatasetVersionDTO for (HashSet foo : fieldDTO.getMultipleCompound()) { String keywordValue = ""; String keywordVocab = ""; - String keywordURI = ""; + String keywordURL = ""; for (Iterator iterator = foo.iterator(); iterator.hasNext();) { FieldDTO next = iterator.next(); if (DatasetFieldConstant.keywordValue.equals(next.getTypeName())) { @@ -726,8 +726,8 @@ private static void writeSubjectElement(XMLStreamWriter xmlw, DatasetVersionDTO if (DatasetFieldConstant.keywordVocab.equals(next.getTypeName())) { keywordVocab = next.getSinglePrimitive(); } - if (DatasetFieldConstant.keywordVocabURI.equals(next.getTypeName())) { - keywordURI = next.getSinglePrimitive(); + if (DatasetFieldConstant.keywordVocabURL.equals(next.getTypeName())) { + keywordURL = next.getSinglePrimitive(); } } if (!keywordValue.isEmpty()) { @@ -735,8 +735,8 @@ private static void writeSubjectElement(XMLStreamWriter xmlw, DatasetVersionDTO if (!keywordVocab.isEmpty()) { writeAttribute(xmlw, "vocab", keywordVocab); } - if (!keywordURI.isEmpty()) { - writeAttribute(xmlw, "vocabURI", keywordURI); + if (!keywordURL.isEmpty()) { + writeAttribute(xmlw, "vocabURI", keywordURL); } if (lang != null && isCVV) { writeAttribute(xmlw, "xml:lang", defaultLocale.getLanguage()); @@ -756,8 +756,8 @@ DatasetFieldConstant.keywordValue, CITATION_BLOCK_NAME, new Locale(lang), if (!keywordVocab.isEmpty()) { writeAttribute(xmlw, "vocab", keywordVocab); } - if (!keywordURI.isEmpty()) { - writeAttribute(xmlw, "vocabURI", keywordURI); + if (!keywordURL.isEmpty()) { + writeAttribute(xmlw, "vocabURI", keywordURL); } writeAttribute(xmlw, "xml:lang", lang); xmlw.writeCharacters(translatedValue); diff --git a/src/main/java/edu/harvard/iq/dataverse/export/openaire/OpenAireExportUtil.java b/src/main/java/edu/harvard/iq/dataverse/export/openaire/OpenAireExportUtil.java index 7b0a92a4372..c6db0059555 100644 --- a/src/main/java/edu/harvard/iq/dataverse/export/openaire/OpenAireExportUtil.java +++ b/src/main/java/edu/harvard/iq/dataverse/export/openaire/OpenAireExportUtil.java @@ -446,7 +446,8 @@ public static void writeSubjectsElement(XMLStreamWriter xmlw, DatasetVersionDTO for (HashSet fieldDTOs : fieldDTO.getMultipleCompound()) { String subject = null; String subjectScheme = null; - String schemeURI = null; + String keywordTermURI = null; + String keywordVocabURL = null; for (Iterator iterator = fieldDTOs.iterator(); iterator.hasNext();) { FieldDTO next = iterator.next(); @@ -454,18 +455,23 @@ public static void writeSubjectsElement(XMLStreamWriter xmlw, DatasetVersionDTO subject = next.getSinglePrimitive(); } + if (DatasetFieldConstant.keywordTermURI.equals(next.getTypeName())) { + keywordTermURI = next.getSinglePrimitive(); + } + if (DatasetFieldConstant.keywordVocab.equals(next.getTypeName())) { subjectScheme = next.getSinglePrimitive(); } - - if (DatasetFieldConstant.keywordVocabURI.equals(next.getTypeName())) { - schemeURI = next.getSinglePrimitive(); + + if (DatasetFieldConstant.keywordVocabURL.equals(next.getTypeName())) { + keywordVocabURL = next.getSinglePrimitive(); } } if (StringUtils.isNotBlank(subject)) { subject_check = writeOpenTag(xmlw, "subjects", subject_check); - writeSubjectElement(xmlw, subjectScheme, schemeURI, subject, language); + // we prioritize the keywordTermURI metadata to populate schemeURI + writeSubjectElement(xmlw, subjectScheme, StringUtils.isNotBlank(keywordTermURI) ? keywordTermURI : keywordVocabURL, subject, language); } } } diff --git a/src/main/resources/db/migration/V6.1.0.2__10288-update_keywordVocabularyURI_metadata.sql b/src/main/resources/db/migration/V6.1.0.4__10288-update_keywordVocabularyURI_metadata.sql similarity index 100% rename from src/main/resources/db/migration/V6.1.0.2__10288-update_keywordVocabularyURI_metadata.sql rename to src/main/resources/db/migration/V6.1.0.4__10288-update_keywordVocabularyURI_metadata.sql diff --git a/src/test/java/edu/harvard/iq/dataverse/export/OpenAireExportUtilTest.java b/src/test/java/edu/harvard/iq/dataverse/export/OpenAireExportUtilTest.java index 76ca853d5cc..43dc46f5e9d 100644 --- a/src/test/java/edu/harvard/iq/dataverse/export/OpenAireExportUtilTest.java +++ b/src/test/java/edu/harvard/iq/dataverse/export/OpenAireExportUtilTest.java @@ -303,9 +303,9 @@ public void testSubjectsElement() throws XMLStreamException, IOException { + "Business and Management" + "Engineering" + "Law" - + "KeywordTerm1" - + "KeywordTerm2" + "", stringWriter.toString()); diff --git a/src/test/java/edu/harvard/iq/dataverse/export/SchemaDotOrgExporterTest.java b/src/test/java/edu/harvard/iq/dataverse/export/SchemaDotOrgExporterTest.java index d600ccac53c..333fa44df3d 100644 --- a/src/test/java/edu/harvard/iq/dataverse/export/SchemaDotOrgExporterTest.java +++ b/src/test/java/edu/harvard/iq/dataverse/export/SchemaDotOrgExporterTest.java @@ -322,8 +322,9 @@ private static void mockDatasetFieldSvc() { DatasetFieldType keywordType = datasetFieldTypeSvc.add(new DatasetFieldType("keyword", DatasetFieldType.FieldType.TEXT, true)); Set keywordChildTypes = new HashSet<>(); keywordChildTypes.add(datasetFieldTypeSvc.add(new DatasetFieldType("keywordValue", DatasetFieldType.FieldType.TEXT, false))); + keywordChildTypes.add(datasetFieldTypeSvc.add(new DatasetFieldType("keywordTermURI", DatasetFieldType.FieldType.TEXT, false))); keywordChildTypes.add(datasetFieldTypeSvc.add(new DatasetFieldType("keywordVocabulary", DatasetFieldType.FieldType.TEXT, false))); - keywordChildTypes.add(datasetFieldTypeSvc.add(new DatasetFieldType("keywordVocabularyURI", DatasetFieldType.FieldType.TEXT, false))); + keywordChildTypes.add(datasetFieldTypeSvc.add(new DatasetFieldType("keywordVocabularyURL", DatasetFieldType.FieldType.TEXT, false))); keywordType.setChildDatasetFieldTypes(keywordChildTypes); DatasetFieldType topicClassificationType = datasetFieldTypeSvc.add(new DatasetFieldType("topicClassification", DatasetFieldType.FieldType.TEXT, true)); diff --git a/src/test/java/edu/harvard/iq/dataverse/export/dataset-all-defaults.txt b/src/test/java/edu/harvard/iq/dataverse/export/dataset-all-defaults.txt index c9e429729df..1fbd8d714f3 100644 --- a/src/test/java/edu/harvard/iq/dataverse/export/dataset-all-defaults.txt +++ b/src/test/java/edu/harvard/iq/dataverse/export/dataset-all-defaults.txt @@ -271,14 +271,20 @@ "typeClass": "primitive", "value": "KeywordTerm1" }, + "keywordTermURI": { + "typeName": "keywordTermURI", + "multiple": false, + "typeClass": "primitive", + "value": "http://keywordTermURI1.org" + }, "keywordVocabulary": { "typeName": "keywordVocabulary", "multiple": false, "typeClass": "primitive", "value": "KeywordVocabulary1" }, - "keywordVocabularyURI": { - "typeName": "keywordVocabularyURI", + "keywordVocabularyURL": { + "typeName": "keywordVocabularyURL", "multiple": false, "typeClass": "primitive", "value": "http://KeywordVocabularyURL1.org" @@ -291,14 +297,20 @@ "typeClass": "primitive", "value": "KeywordTerm2" }, + "keywordTermURI": { + "typeName": "keywordTermURI", + "multiple": false, + "typeClass": "primitive", + "value": "http://keywordTermURI2.org" + }, "keywordVocabulary": { "typeName": "keywordVocabulary", "multiple": false, "typeClass": "primitive", "value": "KeywordVocabulary2" }, - "keywordVocabularyURI": { - "typeName": "keywordVocabularyURI", + "keywordVocabularyURL": { + "typeName": "keywordVocabularyURL", "multiple": false, "typeClass": "primitive", "value": "http://KeywordVocabularyURL2.org" diff --git a/src/test/java/edu/harvard/iq/dataverse/export/ddi/dataset-create-new-all-ddi-fields.json b/src/test/java/edu/harvard/iq/dataverse/export/ddi/dataset-create-new-all-ddi-fields.json index bdff949bb36..fbdd1c94376 100644 --- a/src/test/java/edu/harvard/iq/dataverse/export/ddi/dataset-create-new-all-ddi-fields.json +++ b/src/test/java/edu/harvard/iq/dataverse/export/ddi/dataset-create-new-all-ddi-fields.json @@ -230,14 +230,20 @@ "typeClass": "primitive", "value": "KeywordTerm1" }, + "keywordTermURI": { + "typeName": "keywordTermURI", + "multiple": false, + "typeClass": "primitive", + "value": "http://keywordTermURI1.org" + }, "keywordVocabulary": { "typeName": "keywordVocabulary", "multiple": false, "typeClass": "primitive", "value": "KeywordVocabulary1" }, - "keywordVocabularyURI": { - "typeName": "keywordVocabularyURI", + "keywordVocabularyURL": { + "typeName": "keywordVocabularyURL", "multiple": false, "typeClass": "primitive", "value": "http://KeywordVocabularyURL1.org" @@ -250,14 +256,20 @@ "typeClass": "primitive", "value": "KeywordTerm2" }, + "keywordTermURI": { + "typeName": "keywordTermURI", + "multiple": false, + "typeClass": "primitive", + "value": "http://keywordTermURI2.org" + }, "keywordVocabulary": { "typeName": "keywordVocabulary", "multiple": false, "typeClass": "primitive", "value": "KeywordVocabulary2" }, - "keywordVocabularyURI": { - "typeName": "keywordVocabularyURI", + "keywordVocabularyURL": { + "typeName": "keywordVocabularyURL", "multiple": false, "typeClass": "primitive", "value": "http://KeywordVocabularyURL2.org" diff --git a/src/test/java/edu/harvard/iq/dataverse/export/ddi/dataset-finch1.json b/src/test/java/edu/harvard/iq/dataverse/export/ddi/dataset-finch1.json index 9bdc7e45349..57be1876647 100644 --- a/src/test/java/edu/harvard/iq/dataverse/export/ddi/dataset-finch1.json +++ b/src/test/java/edu/harvard/iq/dataverse/export/ddi/dataset-finch1.json @@ -238,14 +238,20 @@ "typeClass": "primitive", "value": "Keyword Value 1" }, + "keywordTermURI": { + "typeName": "keywordTermURI", + "multiple": false, + "typeClass": "primitive", + "value": "http://keywordTermURI1.org" + }, "keywordVocabulary": { "typeName": "keywordVocabulary", "multiple": false, "typeClass": "primitive", "value": "Keyword Vocabulary" }, - "keywordVocabularyURI": { - "typeName": "keywordVocabularyURI", + "keywordVocabularyURL": { + "typeName": "keywordVocabularyURL", "multiple": false, "typeClass": "primitive", "value": "http://www.keyword.com/one" @@ -258,14 +264,20 @@ "typeClass": "primitive", "value": "Keyword Value Two" }, + "keywordTermURI": { + "typeName": "keywordTermURI", + "multiple": false, + "typeClass": "primitive", + "value": "http://keywordTermURI1.org" + }, "keywordVocabulary": { "typeName": "keywordVocabulary", "multiple": false, "typeClass": "primitive", "value": "Keyword Vocabulary" }, - "keywordVocabularyURI": { - "typeName": "keywordVocabularyURI", + "keywordVocabularyURL": { + "typeName": "keywordVocabularyURL", "multiple": false, "typeClass": "primitive", "value": "http://www.keyword.com/one" diff --git a/src/test/resources/json/dataset-finch2.json b/src/test/resources/json/dataset-finch2.json index 4bd6f33eb42..443488dcf22 100644 --- a/src/test/resources/json/dataset-finch2.json +++ b/src/test/resources/json/dataset-finch2.json @@ -100,14 +100,20 @@ "typeClass": "primitive", "value": "KeywordTerm1" }, + "keywordTermURI": { + "typeName": "keywordTermURI", + "multiple": false, + "typeClass": "primitive", + "value": "http://keywordTermURI1.org" + }, "keywordVocabulary": { "typeName": "keywordVocabulary", "multiple": false, "typeClass": "primitive", "value": "KeywordVocabulary1" }, - "keywordVocabularyURI": { - "typeName": "keywordVocabularyURI", + "keywordVocabularyURL": { + "typeName": "keywordVocabularyURL", "multiple": false, "typeClass": "primitive", "value": "http://KeywordVocabularyURL1.org" @@ -120,14 +126,20 @@ "typeClass": "primitive", "value": "KeywordTerm2" }, + "keywordTermURI": { + "typeName": "keywordTermURI", + "multiple": false, + "typeClass": "primitive", + "value": "http://keywordTermURI2.org" + }, "keywordVocabulary": { "typeName": "keywordVocabulary", "multiple": false, "typeClass": "primitive", "value": "KeywordVocabulary2" }, - "keywordVocabularyURI": { - "typeName": "keywordVocabularyURI", + "keywordVocabularyURL": { + "typeName": "keywordVocabularyURL", "multiple": false, "typeClass": "primitive", "value": "http://KeywordVocabularyURL2.org" diff --git a/src/test/resources/json/dataset-long-description.json b/src/test/resources/json/dataset-long-description.json index a6e5c291322..6ad610a20c1 100644 --- a/src/test/resources/json/dataset-long-description.json +++ b/src/test/resources/json/dataset-long-description.json @@ -92,14 +92,20 @@ "typeClass": "primitive", "value": "KeywordTerm1" }, + "keywordTermURI": { + "typeName": "keywordTermURI", + "multiple": false, + "typeClass": "primitive", + "value": "http://keywordTermURI1.org" + }, "keywordVocabulary": { "typeName": "keywordVocabulary", "multiple": false, "typeClass": "primitive", "value": "KeywordVocabulary1" }, - "keywordVocabularyURI": { - "typeName": "keywordVocabularyURI", + "keywordVocabularyURL": { + "typeName": "keywordVocabularyURL", "multiple": false, "typeClass": "primitive", "value": "http://KeywordVocabularyURL1.org" @@ -112,14 +118,20 @@ "typeClass": "primitive", "value": "KeywordTerm2" }, + "keywordTermURI": { + "typeName": "keywordTermURI", + "multiple": false, + "typeClass": "primitive", + "value": "http://keywordTermURI2.org" + }, "keywordVocabulary": { "typeName": "keywordVocabulary", "multiple": false, "typeClass": "primitive", "value": "KeywordVocabulary2" }, - "keywordVocabularyURI": { - "typeName": "keywordVocabularyURI", + "keywordVocabularyURL": { + "typeName": "keywordVocabularyURL", "multiple": false, "typeClass": "primitive", "value": "http://KeywordVocabularyURL2.org" From f4efb01bacb4e807a116b99e1e26f25cd67c9994 Mon Sep 17 00:00:00 2001 From: stevenferey Date: Tue, 12 Mar 2024 17:13:15 +0100 Subject: [PATCH 06/12] 10288 - Adjustment of typo and sql --- ...-add-term_uri-metadata-in-keyword-block.md | 21 ++++++++++++------- .../iq/dataverse/DatasetFieldConstant.java | 4 ++-- ...-update_keywordVocabularyURI_metadata.sql} | 0 3 files changed, 15 insertions(+), 10 deletions(-) rename src/main/resources/db/migration/{V6.1.0.4__10288-update_keywordVocabularyURI_metadata.sql => V6.1.0.6__10288-update_keywordVocabularyURI_metadata.sql} (100%) diff --git a/doc/release-notes/10288-add-term_uri-metadata-in-keyword-block.md b/doc/release-notes/10288-add-term_uri-metadata-in-keyword-block.md index e060cf23505..0ac37ecc2c8 100644 --- a/doc/release-notes/10288-add-term_uri-metadata-in-keyword-block.md +++ b/doc/release-notes/10288-add-term_uri-metadata-in-keyword-block.md @@ -1,6 +1,6 @@ ### New keywordTermURI Metadata in keyword Metadata Block -Adding a new metadata "keywordTermURI" to the keyword metadata block to facilitate the integration of controlled vocabulary services, in particular by adding the possibility of saving the "term" and its associated URI. (Issue #10288) +Adding a new metadata `keywordTermURI` to the `keyword` metadata block to facilitate the integration of controlled vocabulary services, in particular by adding the possibility of saving the "term" and its associated URI. (Issue #10288) ## Upgrade Instructions @@ -14,24 +14,29 @@ Adding a new metadata "keywordTermURI" to the keyword metadata block to facilita For details, please see https://guides.dataverse.org/en/latest/admin/metadatacustomization.html#updating-the-solr-schema -3\. Once schema.xml is updated, Solr should be restarted and a ['Reindex in Place'](https://guides.dataverse.org/en/latest/admin/solr-search-index.html#reindex-in-place) will be required. +3\. Reindex Solr. + + Once the schema.xml is updated, Solr must be restarted and a reindex initiated. + For details, see https://guides.dataverse.org/en/latest/admin/solr-search-index.html but here is the reindex command: + `curl http://localhost:8080/api/admin/index` -4\. Run ReExportAll to update dataset metadata exports. Follow the directions in the [Admin Guide](http://guides.dataverse.org/en/latest/admin/metadataexport.html#batch-exports-through-the-api). + +4\. Run ReExportAll to update dataset metadata exports. Follow the instructions in the [Metadata Export of Admin Guide](https://guides.dataverse.org/en/latest/admin/metadataexport.html#batch-exports-through-the-api). ## Notes for Dataverse Installation Administrators -### Data migration to the new "keywordTermURI" field +### Data migration to the new `keywordTermURI` field -You can migrate your "keywordValue" data containing URIs to the new "keywordTermURI" field. -You can visualize the data that can be migrated with the following database query: +You can migrate your `keywordValue` data containing URIs to the new `keywordTermURI` field. +In case of data migration, view the affected data with the following database query: ``` SELECT value FROM datasetfieldvalue dfv INNER JOIN datasetfield df ON df.id = dfv.datasetfield_id WHERE df.datasetfieldtype_id = (SELECT id FROM datasetfieldtype WHERE name = 'keywordValue') -AND value LIKE lower('http%'); +AND value ILIKE 'http%'; ``` If you wish to migrate your data, a database update is then necessary: @@ -42,7 +47,7 @@ SET datasetfieldtype_id = (SELECT id FROM datasetfieldtype WHERE name = 'keywor FROM datasetfieldvalue dfv WHERE dfv.datasetfield_id = df.id AND df.datasetfieldtype_id = (SELECT id FROM datasetfieldtype WHERE name = 'keywordValue') -AND dfv.value LIKE lower('http%'); +AND dfv.value ILIKE 'http%'; ``` A ['Reindex in Place'](https://guides.dataverse.org/en/latest/admin/solr-search-index.html#reindex-in-place) will be required and ReExportAll will need to be run to update the metadata exports of the dataset. Follow the directions in the [Admin Guide](http://guides.dataverse.org/en/latest/admin/metadataexport.html#batch-exports-through-the-api). \ No newline at end of file diff --git a/src/main/java/edu/harvard/iq/dataverse/DatasetFieldConstant.java b/src/main/java/edu/harvard/iq/dataverse/DatasetFieldConstant.java index 5045c062730..c050885dbf7 100644 --- a/src/main/java/edu/harvard/iq/dataverse/DatasetFieldConstant.java +++ b/src/main/java/edu/harvard/iq/dataverse/DatasetFieldConstant.java @@ -92,8 +92,8 @@ public class DatasetFieldConstant implements java.io.Serializable { public final static String versionDate="versionDate"; public final static String keywordValue="keywordValue"; public final static String keywordTermURI="keywordTermURI"; - public final static String keywordVocab="keywordVocabulary"; //SEK 6/10/2016 to match what is in the db - public final static String keywordVocabURL="keywordVocabularyURL"; //SEK 6/10/2016 to match what is in the db + public final static String keywordVocab="keywordVocabulary"; + public final static String keywordVocabURL="keywordVocabularyURL"; public final static String topicClassValue="topicClassValue"; public final static String topicClassVocab="topicClassVocab"; public final static String topicClassVocabURI="topicClassVocabURI"; diff --git a/src/main/resources/db/migration/V6.1.0.4__10288-update_keywordVocabularyURI_metadata.sql b/src/main/resources/db/migration/V6.1.0.6__10288-update_keywordVocabularyURI_metadata.sql similarity index 100% rename from src/main/resources/db/migration/V6.1.0.4__10288-update_keywordVocabularyURI_metadata.sql rename to src/main/resources/db/migration/V6.1.0.6__10288-update_keywordVocabularyURI_metadata.sql From 34642124e1f4a724bbb361d06672b68236763a9b Mon Sep 17 00:00:00 2001 From: stevenferey Date: Wed, 3 Apr 2024 15:30:48 +0200 Subject: [PATCH 07/12] Adaptations for Dataverse 6.2 --- .../10288-add-term_uri-metadata-in-keyword-block.md | 4 ++-- ... V6.2.0.1__10288-update_keywordVocabularyURI_metadata.sql} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename src/main/resources/db/migration/{V6.1.0.6__10288-update_keywordVocabularyURI_metadata.sql => V6.2.0.1__10288-update_keywordVocabularyURI_metadata.sql} (100%) diff --git a/doc/release-notes/10288-add-term_uri-metadata-in-keyword-block.md b/doc/release-notes/10288-add-term_uri-metadata-in-keyword-block.md index 0ac37ecc2c8..eb3a79dbf25 100644 --- a/doc/release-notes/10288-add-term_uri-metadata-in-keyword-block.md +++ b/doc/release-notes/10288-add-term_uri-metadata-in-keyword-block.md @@ -1,12 +1,12 @@ ### New keywordTermURI Metadata in keyword Metadata Block -Adding a new metadata `keywordTermURI` to the `keyword` metadata block to facilitate the integration of controlled vocabulary services, in particular by adding the possibility of saving the "term" and its associated URI. (Issue #10288) +Adding a new metadata `keywordTermURI` to the `keyword` metadata block to facilitate the integration of controlled vocabulary services, in particular by adding the possibility of saving the "term" and its associated URI. For more information, see #10288 and PR #10371. ## Upgrade Instructions 1\. Update the Citation metadata block -- `wget https://github.com/IQSS/dataverse/releases/download/v6.2/citation.tsv` +- `wget https://github.com/IQSS/dataverse/releases/download/v6.3/citation.tsv` - `curl http://localhost:8080/api/admin/datasetfield/load -X POST --data-binary @citation.tsv -H "Content-type: text/tab-separated-values"` 2\. Update your Solr `schema.xml` to include the new field. diff --git a/src/main/resources/db/migration/V6.1.0.6__10288-update_keywordVocabularyURI_metadata.sql b/src/main/resources/db/migration/V6.2.0.1__10288-update_keywordVocabularyURI_metadata.sql similarity index 100% rename from src/main/resources/db/migration/V6.1.0.6__10288-update_keywordVocabularyURI_metadata.sql rename to src/main/resources/db/migration/V6.2.0.1__10288-update_keywordVocabularyURI_metadata.sql From c54b3902140f8b9a9be7bf0aa6cf42b003a8fd2c Mon Sep 17 00:00:00 2001 From: Ludovic DANIEL Date: Wed, 17 Apr 2024 11:21:22 +0200 Subject: [PATCH 08/12] 10288 - rollback keywordVocabularyURL to keywordVocabularyURI --- conf/solr/9.3.0/schema.xml | 4 ++-- .../dataset-create-new-all-default-fields.json | 8 ++++---- scripts/api/data/metadatablocks/citation.tsv | 2 +- .../harvard/iq/dataverse/DatasetFieldConstant.java | 6 +++--- .../api/imports/ImportDDIServiceBean.java | 2 +- .../iq/dataverse/export/ddi/DdiExportUtil.java | 14 +++++++------- .../export/openaire/OpenAireExportUtil.java | 8 ++++---- src/main/java/propertyFiles/citation.properties | 6 +++--- ..._10288-update_keywordVocabularyURI_metadata.sql | 5 ----- .../dataverse/export/SchemaDotOrgExporterTest.java | 2 +- .../iq/dataverse/export/dataset-all-defaults.txt | 8 ++++---- .../ddi/dataset-create-new-all-ddi-fields.json | 8 ++++---- .../iq/dataverse/export/ddi/dataset-finch1.json | 8 ++++---- src/test/resources/json/dataset-finch2.json | 8 ++++---- .../resources/json/dataset-long-description.json | 8 ++++---- 15 files changed, 46 insertions(+), 51 deletions(-) delete mode 100644 src/main/resources/db/migration/V6.1.0.6__10288-update_keywordVocabularyURI_metadata.sql diff --git a/conf/solr/9.3.0/schema.xml b/conf/solr/9.3.0/schema.xml index 39cf791aafc..daa348099c4 100644 --- a/conf/solr/9.3.0/schema.xml +++ b/conf/solr/9.3.0/schema.xml @@ -325,7 +325,7 @@ - + @@ -565,7 +565,7 @@ - + diff --git a/scripts/api/data/dataset-create-new-all-default-fields.json b/scripts/api/data/dataset-create-new-all-default-fields.json index 28b8d16417a..800234fbb6e 100644 --- a/scripts/api/data/dataset-create-new-all-default-fields.json +++ b/scripts/api/data/dataset-create-new-all-default-fields.json @@ -243,8 +243,8 @@ "typeClass": "primitive", "value": "KeywordVocabulary1" }, - "keywordVocabularyURL": { - "typeName": "keywordVocabularyURL", + "keywordVocabularyURI": { + "typeName": "keywordVocabularyURI", "multiple": false, "typeClass": "primitive", "value": "http://KeywordVocabularyURL1.org" @@ -269,8 +269,8 @@ "typeClass": "primitive", "value": "KeywordVocabulary2" }, - "keywordVocabularyURL": { - "typeName": "keywordVocabularyURL", + "keywordVocabularyURI": { + "typeName": "keywordVocabularyURI", "multiple": false, "typeClass": "primitive", "value": "http://KeywordVocabularyURL2.org" diff --git a/scripts/api/data/metadatablocks/citation.tsv b/scripts/api/data/metadatablocks/citation.tsv index e151c1838b0..b1eeb826399 100644 --- a/scripts/api/data/metadatablocks/citation.tsv +++ b/scripts/api/data/metadatablocks/citation.tsv @@ -25,7 +25,7 @@ keywordValue Term A key term that describes important aspects of the Dataset text 21 #VALUE TRUE FALSE FALSE TRUE TRUE FALSE keyword citation keywordTermURI Term URI Keyword URI points to the web presence of the term. Enter an absolute URI, starting by https:// https:// url 22 #VALUE FALSE FALSE FALSE FALSE TRUE FALSE keyword citation keywordVocabulary Controlled Vocabulary Name The controlled vocabulary used for the keyword term (e.g. LCSH, MeSH) text 23 (#VALUE) FALSE FALSE FALSE FALSE TRUE FALSE keyword citation - keywordVocabularyURL Controlled Vocabulary URL The URL where one can access information about the term's controlled vocabulary https:// url 24 #VALUE FALSE FALSE FALSE FALSE TRUE FALSE keyword citation + keywordVocabularyURI Controlled Vocabulary URL The URL where one can access information about the term's controlled vocabulary https:// url 24 #VALUE FALSE FALSE FALSE FALSE TRUE FALSE keyword citation topicClassification Topic Classification Indicates a broad, important topic or subject that the Dataset covers and information about any controlled vocabulary used none 25 FALSE FALSE TRUE FALSE FALSE FALSE citation topicClassValue Term A topic or subject term text 26 #VALUE TRUE FALSE FALSE TRUE FALSE FALSE topicClassification citation topicClassVocab Controlled Vocabulary Name The controlled vocabulary used for the keyword term (e.g. LCSH, MeSH) text 27 (#VALUE) FALSE FALSE FALSE FALSE FALSE FALSE topicClassification citation diff --git a/src/main/java/edu/harvard/iq/dataverse/DatasetFieldConstant.java b/src/main/java/edu/harvard/iq/dataverse/DatasetFieldConstant.java index c050885dbf7..dfa2ac22924 100644 --- a/src/main/java/edu/harvard/iq/dataverse/DatasetFieldConstant.java +++ b/src/main/java/edu/harvard/iq/dataverse/DatasetFieldConstant.java @@ -93,7 +93,7 @@ public class DatasetFieldConstant implements java.io.Serializable { public final static String keywordValue="keywordValue"; public final static String keywordTermURI="keywordTermURI"; public final static String keywordVocab="keywordVocabulary"; - public final static String keywordVocabURL="keywordVocabularyURL"; + public final static String keywordVocabURI="keywordVocabularyURI"; public final static String topicClassValue="topicClassValue"; public final static String topicClassVocab="topicClassVocab"; public final static String topicClassVocabURI="topicClassVocabURI"; @@ -311,8 +311,8 @@ public String getKeywordVocab() { return keywordVocab; } - public String getKeywordVocabURL() { - return keywordVocabURL; + public String getKeywordVocabURI() { + return keywordVocabURI; } public String getTopicClassValue() { diff --git a/src/main/java/edu/harvard/iq/dataverse/api/imports/ImportDDIServiceBean.java b/src/main/java/edu/harvard/iq/dataverse/api/imports/ImportDDIServiceBean.java index 8b5bb2867b0..73a83035fc5 100644 --- a/src/main/java/edu/harvard/iq/dataverse/api/imports/ImportDDIServiceBean.java +++ b/src/main/java/edu/harvard/iq/dataverse/api/imports/ImportDDIServiceBean.java @@ -546,7 +546,7 @@ private void processSubject(XMLStreamReader xmlr, MetadataBlockDTO citation) thr if (xmlr.getLocalName().equals("keyword")) { HashSet set = new HashSet<>(); addToSet(set,"keywordVocabulary", xmlr.getAttributeValue(null, "vocab")); - addToSet(set, "keywordVocabularyURL", xmlr.getAttributeValue(null, "vocabURI") ); + addToSet(set, "keywordVocabularyURI", xmlr.getAttributeValue(null, "vocabURI") ); addToSet(set,"keywordValue", parseText(xmlr)); if (!set.isEmpty()) { keywords.add(set); diff --git a/src/main/java/edu/harvard/iq/dataverse/export/ddi/DdiExportUtil.java b/src/main/java/edu/harvard/iq/dataverse/export/ddi/DdiExportUtil.java index 4fe745df205..9a689f7a4ed 100644 --- a/src/main/java/edu/harvard/iq/dataverse/export/ddi/DdiExportUtil.java +++ b/src/main/java/edu/harvard/iq/dataverse/export/ddi/DdiExportUtil.java @@ -714,7 +714,7 @@ private static void writeSubjectElement(XMLStreamWriter xmlw, DatasetVersionDTO for (HashSet foo : fieldDTO.getMultipleCompound()) { String keywordValue = ""; String keywordVocab = ""; - String keywordURL = ""; + String keywordURI = ""; for (Iterator iterator = foo.iterator(); iterator.hasNext();) { FieldDTO next = iterator.next(); if (DatasetFieldConstant.keywordValue.equals(next.getTypeName())) { @@ -726,8 +726,8 @@ private static void writeSubjectElement(XMLStreamWriter xmlw, DatasetVersionDTO if (DatasetFieldConstant.keywordVocab.equals(next.getTypeName())) { keywordVocab = next.getSinglePrimitive(); } - if (DatasetFieldConstant.keywordVocabURL.equals(next.getTypeName())) { - keywordURL = next.getSinglePrimitive(); + if (DatasetFieldConstant.keywordVocabURI.equals(next.getTypeName())) { + keywordURI = next.getSinglePrimitive(); } } if (!keywordValue.isEmpty()) { @@ -735,8 +735,8 @@ private static void writeSubjectElement(XMLStreamWriter xmlw, DatasetVersionDTO if (!keywordVocab.isEmpty()) { writeAttribute(xmlw, "vocab", keywordVocab); } - if (!keywordURL.isEmpty()) { - writeAttribute(xmlw, "vocabURI", keywordURL); + if (!keywordURI.isEmpty()) { + writeAttribute(xmlw, "vocabURI", keywordURI); } if (lang != null && isCVV) { writeAttribute(xmlw, "xml:lang", defaultLocale.getLanguage()); @@ -756,8 +756,8 @@ DatasetFieldConstant.keywordValue, CITATION_BLOCK_NAME, new Locale(lang), if (!keywordVocab.isEmpty()) { writeAttribute(xmlw, "vocab", keywordVocab); } - if (!keywordURL.isEmpty()) { - writeAttribute(xmlw, "vocabURI", keywordURL); + if (!keywordURI.isEmpty()) { + writeAttribute(xmlw, "vocabURI", keywordURI); } writeAttribute(xmlw, "xml:lang", lang); xmlw.writeCharacters(translatedValue); diff --git a/src/main/java/edu/harvard/iq/dataverse/export/openaire/OpenAireExportUtil.java b/src/main/java/edu/harvard/iq/dataverse/export/openaire/OpenAireExportUtil.java index c6db0059555..a7bd3e5b5e7 100644 --- a/src/main/java/edu/harvard/iq/dataverse/export/openaire/OpenAireExportUtil.java +++ b/src/main/java/edu/harvard/iq/dataverse/export/openaire/OpenAireExportUtil.java @@ -447,7 +447,7 @@ public static void writeSubjectsElement(XMLStreamWriter xmlw, DatasetVersionDTO String subject = null; String subjectScheme = null; String keywordTermURI = null; - String keywordVocabURL = null; + String keywordVocabURI = null; for (Iterator iterator = fieldDTOs.iterator(); iterator.hasNext();) { FieldDTO next = iterator.next(); @@ -463,15 +463,15 @@ public static void writeSubjectsElement(XMLStreamWriter xmlw, DatasetVersionDTO subjectScheme = next.getSinglePrimitive(); } - if (DatasetFieldConstant.keywordVocabURL.equals(next.getTypeName())) { - keywordVocabURL = next.getSinglePrimitive(); + if (DatasetFieldConstant.keywordVocabURI.equals(next.getTypeName())) { + keywordVocabURI = next.getSinglePrimitive(); } } if (StringUtils.isNotBlank(subject)) { subject_check = writeOpenTag(xmlw, "subjects", subject_check); // we prioritize the keywordTermURI metadata to populate schemeURI - writeSubjectElement(xmlw, subjectScheme, StringUtils.isNotBlank(keywordTermURI) ? keywordTermURI : keywordVocabURL, subject, language); + writeSubjectElement(xmlw, subjectScheme, StringUtils.isNotBlank(keywordTermURI) ? keywordTermURI : keywordVocabURI, subject, language); } } } diff --git a/src/main/java/propertyFiles/citation.properties b/src/main/java/propertyFiles/citation.properties index 3f0a0c4dd12..fba880d620e 100644 --- a/src/main/java/propertyFiles/citation.properties +++ b/src/main/java/propertyFiles/citation.properties @@ -25,7 +25,7 @@ datasetfieldtype.keyword.title=Keyword datasetfieldtype.keywordTermURI.title=Term URI datasetfieldtype.keywordValue.title=Term datasetfieldtype.keywordVocabulary.title=Controlled Vocabulary Name -datasetfieldtype.keywordVocabularyURL.title=Controlled Vocabulary URL +datasetfieldtype.keywordVocabularyURI.title=Controlled Vocabulary URL datasetfieldtype.topicClassification.title=Topic Classification datasetfieldtype.topicClassValue.title=Term datasetfieldtype.topicClassVocab.title=Controlled Vocabulary Name @@ -104,7 +104,7 @@ datasetfieldtype.keyword.description=A key term that describes an important aspe datasetfieldtype.keywordTermURI.description=Keyword URI points to the web presence of the term. Enter an absolute URI, starting by https:// datasetfieldtype.keywordValue.description=A key term that describes important aspects of the Dataset datasetfieldtype.keywordVocabulary.description=The controlled vocabulary used for the keyword term (e.g. LCSH, MeSH) -datasetfieldtype.keywordVocabularyURL.description=The URL where one can access information about the term's controlled vocabulary +datasetfieldtype.keywordVocabularyURI.description=The URL where one can access information about the term's controlled vocabulary datasetfieldtype.topicClassification.description=Indicates a broad, important topic or subject that the Dataset covers and information about any controlled vocabulary used datasetfieldtype.topicClassValue.description=A topic or subject term datasetfieldtype.topicClassVocab.description=The controlled vocabulary used for the keyword term (e.g. LCSH, MeSH) @@ -183,7 +183,7 @@ datasetfieldtype.keyword.watermark= datasetfieldtype.keywordTermURI.watermark=https:// datasetfieldtype.keywordValue.watermark= datasetfieldtype.keywordVocabulary.watermark= -datasetfieldtype.keywordVocabularyURL.watermark=https:// +datasetfieldtype.keywordVocabularyURI.watermark=https:// datasetfieldtype.topicClassification.watermark= datasetfieldtype.topicClassValue.watermark= datasetfieldtype.topicClassVocab.watermark= diff --git a/src/main/resources/db/migration/V6.1.0.6__10288-update_keywordVocabularyURI_metadata.sql b/src/main/resources/db/migration/V6.1.0.6__10288-update_keywordVocabularyURI_metadata.sql deleted file mode 100644 index ee47d3e9a28..00000000000 --- a/src/main/resources/db/migration/V6.1.0.6__10288-update_keywordVocabularyURI_metadata.sql +++ /dev/null @@ -1,5 +0,0 @@ --- update of the "keywordVocabularyURI" metadata to make it consistent with its name "Controlled Vocabulary URL" -UPDATE datasetfieldtype SET name = 'keywordVocabularyURL' -WHERE name = 'keywordVocabularyURI' -AND parentdatasetfieldtype_id = ( - SELECT id FROM datasetfieldtype WHERE name = 'keyword') ; \ No newline at end of file diff --git a/src/test/java/edu/harvard/iq/dataverse/export/SchemaDotOrgExporterTest.java b/src/test/java/edu/harvard/iq/dataverse/export/SchemaDotOrgExporterTest.java index 333fa44df3d..2139589b4c3 100644 --- a/src/test/java/edu/harvard/iq/dataverse/export/SchemaDotOrgExporterTest.java +++ b/src/test/java/edu/harvard/iq/dataverse/export/SchemaDotOrgExporterTest.java @@ -324,7 +324,7 @@ private static void mockDatasetFieldSvc() { keywordChildTypes.add(datasetFieldTypeSvc.add(new DatasetFieldType("keywordValue", DatasetFieldType.FieldType.TEXT, false))); keywordChildTypes.add(datasetFieldTypeSvc.add(new DatasetFieldType("keywordTermURI", DatasetFieldType.FieldType.TEXT, false))); keywordChildTypes.add(datasetFieldTypeSvc.add(new DatasetFieldType("keywordVocabulary", DatasetFieldType.FieldType.TEXT, false))); - keywordChildTypes.add(datasetFieldTypeSvc.add(new DatasetFieldType("keywordVocabularyURL", DatasetFieldType.FieldType.TEXT, false))); + keywordChildTypes.add(datasetFieldTypeSvc.add(new DatasetFieldType("keywordVocabularyURI", DatasetFieldType.FieldType.TEXT, false))); keywordType.setChildDatasetFieldTypes(keywordChildTypes); DatasetFieldType topicClassificationType = datasetFieldTypeSvc.add(new DatasetFieldType("topicClassification", DatasetFieldType.FieldType.TEXT, true)); diff --git a/src/test/java/edu/harvard/iq/dataverse/export/dataset-all-defaults.txt b/src/test/java/edu/harvard/iq/dataverse/export/dataset-all-defaults.txt index 1fbd8d714f3..23444e5c2b0 100644 --- a/src/test/java/edu/harvard/iq/dataverse/export/dataset-all-defaults.txt +++ b/src/test/java/edu/harvard/iq/dataverse/export/dataset-all-defaults.txt @@ -283,8 +283,8 @@ "typeClass": "primitive", "value": "KeywordVocabulary1" }, - "keywordVocabularyURL": { - "typeName": "keywordVocabularyURL", + "keywordVocabularyURI": { + "typeName": "keywordVocabularyURI", "multiple": false, "typeClass": "primitive", "value": "http://KeywordVocabularyURL1.org" @@ -309,8 +309,8 @@ "typeClass": "primitive", "value": "KeywordVocabulary2" }, - "keywordVocabularyURL": { - "typeName": "keywordVocabularyURL", + "keywordVocabularyURI": { + "typeName": "keywordVocabularyURI", "multiple": false, "typeClass": "primitive", "value": "http://KeywordVocabularyURL2.org" diff --git a/src/test/java/edu/harvard/iq/dataverse/export/ddi/dataset-create-new-all-ddi-fields.json b/src/test/java/edu/harvard/iq/dataverse/export/ddi/dataset-create-new-all-ddi-fields.json index fbdd1c94376..5d439244c1c 100644 --- a/src/test/java/edu/harvard/iq/dataverse/export/ddi/dataset-create-new-all-ddi-fields.json +++ b/src/test/java/edu/harvard/iq/dataverse/export/ddi/dataset-create-new-all-ddi-fields.json @@ -242,8 +242,8 @@ "typeClass": "primitive", "value": "KeywordVocabulary1" }, - "keywordVocabularyURL": { - "typeName": "keywordVocabularyURL", + "keywordVocabularyURI": { + "typeName": "keywordVocabularyURI", "multiple": false, "typeClass": "primitive", "value": "http://KeywordVocabularyURL1.org" @@ -268,8 +268,8 @@ "typeClass": "primitive", "value": "KeywordVocabulary2" }, - "keywordVocabularyURL": { - "typeName": "keywordVocabularyURL", + "keywordVocabularyURI": { + "typeName": "keywordVocabularyURI", "multiple": false, "typeClass": "primitive", "value": "http://KeywordVocabularyURL2.org" diff --git a/src/test/java/edu/harvard/iq/dataverse/export/ddi/dataset-finch1.json b/src/test/java/edu/harvard/iq/dataverse/export/ddi/dataset-finch1.json index 57be1876647..73bb2b9120a 100644 --- a/src/test/java/edu/harvard/iq/dataverse/export/ddi/dataset-finch1.json +++ b/src/test/java/edu/harvard/iq/dataverse/export/ddi/dataset-finch1.json @@ -250,8 +250,8 @@ "typeClass": "primitive", "value": "Keyword Vocabulary" }, - "keywordVocabularyURL": { - "typeName": "keywordVocabularyURL", + "keywordVocabularyURI": { + "typeName": "keywordVocabularyURI", "multiple": false, "typeClass": "primitive", "value": "http://www.keyword.com/one" @@ -276,8 +276,8 @@ "typeClass": "primitive", "value": "Keyword Vocabulary" }, - "keywordVocabularyURL": { - "typeName": "keywordVocabularyURL", + "keywordVocabularyURI": { + "typeName": "keywordVocabularyURI", "multiple": false, "typeClass": "primitive", "value": "http://www.keyword.com/one" diff --git a/src/test/resources/json/dataset-finch2.json b/src/test/resources/json/dataset-finch2.json index 443488dcf22..b214eacfa3c 100644 --- a/src/test/resources/json/dataset-finch2.json +++ b/src/test/resources/json/dataset-finch2.json @@ -112,8 +112,8 @@ "typeClass": "primitive", "value": "KeywordVocabulary1" }, - "keywordVocabularyURL": { - "typeName": "keywordVocabularyURL", + "keywordVocabularyURI": { + "typeName": "keywordVocabularyURI", "multiple": false, "typeClass": "primitive", "value": "http://KeywordVocabularyURL1.org" @@ -138,8 +138,8 @@ "typeClass": "primitive", "value": "KeywordVocabulary2" }, - "keywordVocabularyURL": { - "typeName": "keywordVocabularyURL", + "keywordVocabularyURI": { + "typeName": "keywordVocabularyURI", "multiple": false, "typeClass": "primitive", "value": "http://KeywordVocabularyURL2.org" diff --git a/src/test/resources/json/dataset-long-description.json b/src/test/resources/json/dataset-long-description.json index 6ad610a20c1..4d5478b0f63 100644 --- a/src/test/resources/json/dataset-long-description.json +++ b/src/test/resources/json/dataset-long-description.json @@ -104,8 +104,8 @@ "typeClass": "primitive", "value": "KeywordVocabulary1" }, - "keywordVocabularyURL": { - "typeName": "keywordVocabularyURL", + "keywordVocabularyURI": { + "typeName": "keywordVocabularyURI", "multiple": false, "typeClass": "primitive", "value": "http://KeywordVocabularyURL1.org" @@ -130,8 +130,8 @@ "typeClass": "primitive", "value": "KeywordVocabulary2" }, - "keywordVocabularyURL": { - "typeName": "keywordVocabularyURL", + "keywordVocabularyURI": { + "typeName": "keywordVocabularyURI", "multiple": false, "typeClass": "primitive", "value": "http://KeywordVocabularyURL2.org" From 7a980abd72b37aef395cfec0071006bf4f803ae2 Mon Sep 17 00:00:00 2001 From: stevenferey Date: Wed, 24 Apr 2024 16:47:59 +0200 Subject: [PATCH 09/12] 10288 - removing obsolete SQL script --- .../V6.2.0.1__10288-update_keywordVocabularyURI_metadata.sql | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 src/main/resources/db/migration/V6.2.0.1__10288-update_keywordVocabularyURI_metadata.sql diff --git a/src/main/resources/db/migration/V6.2.0.1__10288-update_keywordVocabularyURI_metadata.sql b/src/main/resources/db/migration/V6.2.0.1__10288-update_keywordVocabularyURI_metadata.sql deleted file mode 100644 index ee47d3e9a28..00000000000 --- a/src/main/resources/db/migration/V6.2.0.1__10288-update_keywordVocabularyURI_metadata.sql +++ /dev/null @@ -1,5 +0,0 @@ --- update of the "keywordVocabularyURI" metadata to make it consistent with its name "Controlled Vocabulary URL" -UPDATE datasetfieldtype SET name = 'keywordVocabularyURL' -WHERE name = 'keywordVocabularyURI' -AND parentdatasetfieldtype_id = ( - SELECT id FROM datasetfieldtype WHERE name = 'keyword') ; \ No newline at end of file From 05feae2aab840310b22ae3c683959d60f9acc919 Mon Sep 17 00:00:00 2001 From: stevenferey Date: Thu, 2 May 2024 14:37:05 +0200 Subject: [PATCH 10/12] 10288 - Label modification to follow Dataverse recommendations --- scripts/api/data/metadatablocks/citation.tsv | 2 +- src/main/java/propertyFiles/citation.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/api/data/metadatablocks/citation.tsv b/scripts/api/data/metadatablocks/citation.tsv index e93b3829db1..b9fbfb0f0f4 100644 --- a/scripts/api/data/metadatablocks/citation.tsv +++ b/scripts/api/data/metadatablocks/citation.tsv @@ -23,7 +23,7 @@ subject Subject The area of study relevant to the Dataset text 19 TRUE TRUE TRUE TRUE TRUE TRUE citation http://purl.org/dc/terms/subject keyword Keyword A key term that describes an important aspect of the Dataset and information about any controlled vocabulary used none 20 FALSE FALSE TRUE FALSE TRUE FALSE citation keywordValue Term A key term that describes important aspects of the Dataset text 21 #VALUE TRUE FALSE FALSE TRUE TRUE FALSE keyword citation - keywordTermURI Term URI Keyword URI points to the web presence of the term. Enter an absolute URI, starting by https:// https:// url 22 #VALUE FALSE FALSE FALSE FALSE TRUE FALSE keyword citation + keywordTermURI Term URI A URI that points to the web presence of the Keyword Term https:// url 22 #VALUE FALSE FALSE FALSE FALSE TRUE FALSE keyword citation keywordVocabulary Controlled Vocabulary Name The controlled vocabulary used for the keyword term (e.g. LCSH, MeSH) text 23 (#VALUE) FALSE FALSE FALSE FALSE TRUE FALSE keyword citation keywordVocabularyURI Controlled Vocabulary URL The URL where one can access information about the term's controlled vocabulary https:// url 24 #VALUE FALSE FALSE FALSE FALSE TRUE FALSE keyword citation topicClassification Topic Classification Indicates a broad, important topic or subject that the Dataset covers and information about any controlled vocabulary used none 25 FALSE FALSE TRUE FALSE FALSE FALSE citation diff --git a/src/main/java/propertyFiles/citation.properties b/src/main/java/propertyFiles/citation.properties index fba880d620e..cb864eb78e9 100644 --- a/src/main/java/propertyFiles/citation.properties +++ b/src/main/java/propertyFiles/citation.properties @@ -101,7 +101,7 @@ datasetfieldtype.dsDescriptionValue.description=A summary describing the purpose datasetfieldtype.dsDescriptionDate.description=The date when the description was added to the Dataset. If the Dataset contains more than one description, e.g. the data producer supplied one description and the data repository supplied another, this date is used to distinguish between the descriptions datasetfieldtype.subject.description=The area of study relevant to the Dataset datasetfieldtype.keyword.description=A key term that describes an important aspect of the Dataset and information about any controlled vocabulary used -datasetfieldtype.keywordTermURI.description=Keyword URI points to the web presence of the term. Enter an absolute URI, starting by https:// +datasetfieldtype.keywordTermURI.description=A URI that points to the web presence of the Keyword Term datasetfieldtype.keywordValue.description=A key term that describes important aspects of the Dataset datasetfieldtype.keywordVocabulary.description=The controlled vocabulary used for the keyword term (e.g. LCSH, MeSH) datasetfieldtype.keywordVocabularyURI.description=The URL where one can access information about the term's controlled vocabulary From 165100d8b20a92434225f897b3d0d83737a509a5 Mon Sep 17 00:00:00 2001 From: stevenferey Date: Tue, 28 May 2024 10:40:21 +0200 Subject: [PATCH 11/12] 10288 - Added valueURI attribute for OpenAire export --- .../export/openaire/OpenAireExportUtil.java | 12 +++++++----- .../iq/dataverse/export/OpenAireExportUtilTest.java | 6 ++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/main/java/edu/harvard/iq/dataverse/export/openaire/OpenAireExportUtil.java b/src/main/java/edu/harvard/iq/dataverse/export/openaire/OpenAireExportUtil.java index 8a4c95f39df..4b8822e8b66 100644 --- a/src/main/java/edu/harvard/iq/dataverse/export/openaire/OpenAireExportUtil.java +++ b/src/main/java/edu/harvard/iq/dataverse/export/openaire/OpenAireExportUtil.java @@ -437,7 +437,7 @@ public static void writeSubjectsElement(XMLStreamWriter xmlw, DatasetVersionDTO for (String subject : fieldDTO.getMultipleVocab()) { if (StringUtils.isNotBlank(subject)) { subject_check = writeOpenTag(xmlw, "subjects", subject_check); - writeSubjectElement(xmlw, null, null, subject, language); + writeSubjectElement(xmlw, null, null, null, subject, language); } } } @@ -470,8 +470,7 @@ public static void writeSubjectsElement(XMLStreamWriter xmlw, DatasetVersionDTO if (StringUtils.isNotBlank(subject)) { subject_check = writeOpenTag(xmlw, "subjects", subject_check); - // we prioritize the keywordTermURI metadata to populate schemeURI - writeSubjectElement(xmlw, subjectScheme, StringUtils.isNotBlank(keywordTermURI) ? keywordTermURI : keywordVocabURI, subject, language); + writeSubjectElement(xmlw, subjectScheme, keywordTermURI, keywordVocabURI, subject, language); } } } @@ -499,7 +498,7 @@ public static void writeSubjectsElement(XMLStreamWriter xmlw, DatasetVersionDTO if (StringUtils.isNotBlank(subject)) { subject_check = writeOpenTag(xmlw, "subjects", subject_check); - writeSubjectElement(xmlw, subjectScheme, schemeURI, subject, language); + writeSubjectElement(xmlw, subjectScheme, null, schemeURI, subject, language); } } } @@ -519,7 +518,7 @@ public static void writeSubjectsElement(XMLStreamWriter xmlw, DatasetVersionDTO * @param language * @throws XMLStreamException */ - private static void writeSubjectElement(XMLStreamWriter xmlw, String subjectScheme, String schemeURI, String value, String language) throws XMLStreamException { + private static void writeSubjectElement(XMLStreamWriter xmlw, String subjectScheme, String valueURI, String schemeURI, String value, String language) throws XMLStreamException { // write a subject Map subject_map = new HashMap(); @@ -530,6 +529,9 @@ private static void writeSubjectElement(XMLStreamWriter xmlw, String subjectSche if (StringUtils.isNotBlank(subjectScheme)) { subject_map.put("subjectScheme", subjectScheme); } + if (StringUtils.isNotBlank(valueURI)) { + subject_map.put("valueURI", valueURI); + } if (StringUtils.isNotBlank(schemeURI)) { subject_map.put("schemeURI", schemeURI); } diff --git a/src/test/java/edu/harvard/iq/dataverse/export/OpenAireExportUtilTest.java b/src/test/java/edu/harvard/iq/dataverse/export/OpenAireExportUtilTest.java index 2ab3d21efc1..2da15147255 100644 --- a/src/test/java/edu/harvard/iq/dataverse/export/OpenAireExportUtilTest.java +++ b/src/test/java/edu/harvard/iq/dataverse/export/OpenAireExportUtilTest.java @@ -304,9 +304,11 @@ public void testSubjectsElement() throws XMLStreamException, IOException { + "Business and Management" + "Engineering" + "Law" - + "KeywordTerm1" - + "KeywordTerm2" + "", stringWriter.toString()); From a79cdbf17ea42afd577816a01a5ac3e35d0135f6 Mon Sep 17 00:00:00 2001 From: Ludovic DANIEL Date: Wed, 29 May 2024 15:59:13 +0200 Subject: [PATCH 12/12] Fix NoResultException on DatasetServiceBean.findDeep (.getSingleResult():L137) --- .../iq/dataverse/DatasetServiceBean.java | 53 ++++++++++--------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/src/main/java/edu/harvard/iq/dataverse/DatasetServiceBean.java b/src/main/java/edu/harvard/iq/dataverse/DatasetServiceBean.java index 2686584f307..dab0ff43fcf 100644 --- a/src/main/java/edu/harvard/iq/dataverse/DatasetServiceBean.java +++ b/src/main/java/edu/harvard/iq/dataverse/DatasetServiceBean.java @@ -19,8 +19,6 @@ import edu.harvard.iq.dataverse.export.ExportService; import edu.harvard.iq.dataverse.globus.GlobusServiceBean; import edu.harvard.iq.dataverse.harvest.server.OAIRecordServiceBean; -import edu.harvard.iq.dataverse.pidproviders.PidProvider; -import edu.harvard.iq.dataverse.pidproviders.PidUtil; import edu.harvard.iq.dataverse.search.IndexServiceBean; import edu.harvard.iq.dataverse.settings.SettingsServiceBean; import edu.harvard.iq.dataverse.util.BundleUtil; @@ -41,11 +39,10 @@ import jakarta.ejb.TransactionAttributeType; import jakarta.inject.Named; import jakarta.persistence.EntityManager; -import jakarta.persistence.LockModeType; import jakarta.persistence.NoResultException; +import jakarta.persistence.NonUniqueResultException; import jakarta.persistence.PersistenceContext; import jakarta.persistence.Query; -import jakarta.persistence.StoredProcedureQuery; import jakarta.persistence.TypedQuery; import org.apache.commons.lang3.StringUtils; @@ -115,28 +112,32 @@ public Dataset find(Object pk) { * @return a dataset with pre-fetched file objects */ public Dataset findDeep(Object pk) { - return (Dataset) em.createNamedQuery("Dataset.findById") - .setParameter("id", pk) - // Optimization hints: retrieve all data in one query; this prevents point queries when iterating over the files - .setHint("eclipselink.left-join-fetch", "o.files.ingestRequest") - .setHint("eclipselink.left-join-fetch", "o.files.thumbnailForDataset") - .setHint("eclipselink.left-join-fetch", "o.files.dataTables") - .setHint("eclipselink.left-join-fetch", "o.files.auxiliaryFiles") - .setHint("eclipselink.left-join-fetch", "o.files.ingestReports") - .setHint("eclipselink.left-join-fetch", "o.files.dataFileTags") - .setHint("eclipselink.left-join-fetch", "o.files.fileMetadatas") - .setHint("eclipselink.left-join-fetch", "o.files.fileMetadatas.fileCategories") - .setHint("eclipselink.left-join-fetch", "o.files.fileMetadatas.varGroups") - //.setHint("eclipselink.left-join-fetch", "o.files.guestbookResponses - .setHint("eclipselink.left-join-fetch", "o.files.embargo") - .setHint("eclipselink.left-join-fetch", "o.files.retention") - .setHint("eclipselink.left-join-fetch", "o.files.fileAccessRequests") - .setHint("eclipselink.left-join-fetch", "o.files.owner") - .setHint("eclipselink.left-join-fetch", "o.files.releaseUser") - .setHint("eclipselink.left-join-fetch", "o.files.creator") - .setHint("eclipselink.left-join-fetch", "o.files.alternativePersistentIndentifiers") - .setHint("eclipselink.left-join-fetch", "o.files.roleAssignments") - .getSingleResult(); + try { + return (Dataset) em.createNamedQuery("Dataset.findById") + .setParameter("id", pk) + // Optimization hints: retrieve all data in one query; this prevents point queries when iterating over the files + .setHint("eclipselink.left-join-fetch", "o.files.ingestRequest") + .setHint("eclipselink.left-join-fetch", "o.files.thumbnailForDataset") + .setHint("eclipselink.left-join-fetch", "o.files.dataTables") + .setHint("eclipselink.left-join-fetch", "o.files.auxiliaryFiles") + .setHint("eclipselink.left-join-fetch", "o.files.ingestReports") + .setHint("eclipselink.left-join-fetch", "o.files.dataFileTags") + .setHint("eclipselink.left-join-fetch", "o.files.fileMetadatas") + .setHint("eclipselink.left-join-fetch", "o.files.fileMetadatas.fileCategories") + .setHint("eclipselink.left-join-fetch", "o.files.fileMetadatas.varGroups") + //.setHint("eclipselink.left-join-fetch", "o.files.guestbookResponses + .setHint("eclipselink.left-join-fetch", "o.files.embargo") + .setHint("eclipselink.left-join-fetch", "o.files.retention") + .setHint("eclipselink.left-join-fetch", "o.files.fileAccessRequests") + .setHint("eclipselink.left-join-fetch", "o.files.owner") + .setHint("eclipselink.left-join-fetch", "o.files.releaseUser") + .setHint("eclipselink.left-join-fetch", "o.files.creator") + .setHint("eclipselink.left-join-fetch", "o.files.alternativePersistentIndentifiers") + .setHint("eclipselink.left-join-fetch", "o.files.roleAssignments") + .getSingleResult(); + } catch (NoResultException | NonUniqueResultException ex) { + return null; + } } public List findByOwnerId(Long ownerId) {