Skip to content

Commit 00020e2

Browse files
stevenfereyluddanieljeromeroucou
authored
10288 Add keywordTermURI metadata in keyword block (#10371)
* New keywordTermURI Metadata in keyword Metadata Block * update of the keywordVocabularyURI metadata to make it consistent with its name Controlled Vocabulary URL * fix description and watermark properties * 10288 adding documentation * 10288 - adaptation of the SolR schema and dataset exports * 10288 - Adjustment of typo and sql * Adaptations for Dataverse 6.2 * 10288 - rollback keywordVocabularyURL to keywordVocabularyURI * 10288 - removing obsolete SQL script * 10288 - Label modification to follow Dataverse recommendations * 10288 - Added valueURI attribute for OpenAire export * Fix NoResultException on DatasetServiceBean.findDeep (.getSingleResult():L137) --------- Co-authored-by: Ludovic DANIEL <ludovic.daniel@smile.fr> Co-authored-by: Jérôme ROUCOU <jerome.roucou@inrae.fr>
1 parent ad58f3e commit 00020e2

15 files changed

Lines changed: 208 additions & 133 deletions

File tree

conf/solr/9.3.0/schema.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@
326326
<field name="journalVolumeIssue" type="text_en" multiValued="true" stored="true" indexed="true"/>
327327
<field name="keyword" type="text_en" multiValued="true" stored="true" indexed="true"/>
328328
<field name="keywordValue" type="text_en" multiValued="true" stored="true" indexed="true"/>
329+
<field name="keywordTermURI" type="text_en" multiValued="true" stored="true" indexed="true"/>
329330
<field name="keywordVocabulary" type="text_en" multiValued="true" stored="true" indexed="true"/>
330331
<field name="keywordVocabularyURI" type="text_en" multiValued="true" stored="true" indexed="true"/>
331332
<field name="kindOfData" type="text_en" multiValued="true" stored="true" indexed="true"/>
@@ -565,6 +566,7 @@
565566
<copyField source="journalVolumeIssue" dest="_text_" maxChars="3000"/>
566567
<copyField source="keyword" dest="_text_" maxChars="3000"/>
567568
<copyField source="keywordValue" dest="_text_" maxChars="3000"/>
569+
<copyField source="keywordTermURI" dest="_text_" maxChars="3000"/>
568570
<copyField source="keywordVocabulary" dest="_text_" maxChars="3000"/>
569571
<copyField source="keywordVocabularyURI" dest="_text_" maxChars="3000"/>
570572
<copyField source="kindOfData" dest="_text_" maxChars="3000"/>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
### New keywordTermURI Metadata in keyword Metadata Block
2+
3+
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.
4+
5+
## Upgrade Instructions
6+
7+
1\. Update the Citation metadata block
8+
9+
- `wget https://github.com/IQSS/dataverse/releases/download/v6.3/citation.tsv`
10+
- `curl http://localhost:8080/api/admin/datasetfield/load -X POST --data-binary @citation.tsv -H "Content-type: text/tab-separated-values"`
11+
12+
2\. Update your Solr `schema.xml` to include the new field.
13+
14+
For details, please see https://guides.dataverse.org/en/latest/admin/metadatacustomization.html#updating-the-solr-schema
15+
16+
17+
3\. Reindex Solr.
18+
19+
Once the schema.xml is updated, Solr must be restarted and a reindex initiated.
20+
For details, see https://guides.dataverse.org/en/latest/admin/solr-search-index.html but here is the reindex command:
21+
22+
`curl http://localhost:8080/api/admin/index`
23+
24+
25+
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).
26+
27+
28+
## Notes for Dataverse Installation Administrators
29+
30+
### Data migration to the new `keywordTermURI` field
31+
32+
You can migrate your `keywordValue` data containing URIs to the new `keywordTermURI` field.
33+
In case of data migration, view the affected data with the following database query:
34+
35+
```
36+
SELECT value FROM datasetfieldvalue dfv
37+
INNER JOIN datasetfield df ON df.id = dfv.datasetfield_id
38+
WHERE df.datasetfieldtype_id = (SELECT id FROM datasetfieldtype WHERE name = 'keywordValue')
39+
AND value ILIKE 'http%';
40+
```
41+
42+
If you wish to migrate your data, a database update is then necessary:
43+
44+
```
45+
UPDATE datasetfield df
46+
SET datasetfieldtype_id = (SELECT id FROM datasetfieldtype WHERE name = 'keywordTermURI')
47+
FROM datasetfieldvalue dfv
48+
WHERE dfv.datasetfield_id = df.id
49+
AND df.datasetfieldtype_id = (SELECT id FROM datasetfieldtype WHERE name = 'keywordValue')
50+
AND dfv.value ILIKE 'http%';
51+
```
52+
53+
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).

scripts/api/data/dataset-create-new-all-default-fields.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,12 @@
231231
"typeClass": "primitive",
232232
"value": "KeywordTerm1"
233233
},
234+
"keywordTermURI": {
235+
"typeName": "keywordTermURI",
236+
"multiple": false,
237+
"typeClass": "primitive",
238+
"value": "http://keywordTermURI1.org"
239+
},
234240
"keywordVocabulary": {
235241
"typeName": "keywordVocabulary",
236242
"multiple": false,
@@ -251,6 +257,12 @@
251257
"typeClass": "primitive",
252258
"value": "KeywordTerm2"
253259
},
260+
"keywordTermURI": {
261+
"typeName": "keywordTermURI",
262+
"multiple": false,
263+
"typeClass": "primitive",
264+
"value": "http://keywordTermURI2.org"
265+
},
254266
"keywordVocabulary": {
255267
"typeName": "keywordVocabulary",
256268
"multiple": false,

0 commit comments

Comments
 (0)