Skip to content

Commit ceffb6f

Browse files
authored
Merge pull request #9254 from philippconzett/patch-2
Make productionPlace multiple, facetable, and enabled for Advanced Search #9253
2 parents f40df82 + 0978dbd commit ceffb6f

File tree

5 files changed

+49
-4
lines changed

5 files changed

+49
-4
lines changed

conf/solr/8.11.1/schema.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@
347347
<field name="producerName" type="text_en" multiValued="true" stored="true" indexed="true"/>
348348
<field name="producerURL" type="text_en" multiValued="true" stored="true" indexed="true"/>
349349
<field name="productionDate" type="text_en" multiValued="false" stored="true" indexed="true"/>
350-
<field name="productionPlace" type="text_en" multiValued="false" stored="true" indexed="true"/>
350+
<field name="productionPlace" type="text_en" multiValued="true" stored="true" indexed="true"/>
351351
<field name="publication" type="text_en" multiValued="true" stored="true" indexed="true"/>
352352
<field name="publicationCitation" type="text_en" multiValued="true" stored="true" indexed="true"/>
353353
<field name="publicationIDNumber" type="text_en" multiValued="true" stored="true" indexed="true"/>
+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
## Metadata field Production Location now repeatable, facetable, and enabled for Advanced Search
2+
This enhancement allows depositors to define multiple instances of the metadata field Production Location in the Citation Metadata block, users to filter search results using the filter facets, and using the field in the Advanced Search option.
3+
4+
## Major Use Cases and Infrastructure Enhancements
5+
* Data contained in a dataset may have been produced at multiple places. Making the field Production Location repeatable will make it possible to reflect this fact in the dataset metadata. Making the field facetable and enabled for Advanced Search will allow us to customize Dataverse collections more appropriately. (Issue #9253, PR #9254)
6+
7+
### Additional Upgrade Steps
8+
9+
Update the Citation metadata block:
10+
11+
- `wget https://github.com/IQSS/dataverse/releases/download/v5.13/citation.tsv`
12+
- `curl http://localhost:8080/api/admin/datasetfield/load -X POST --data-binary @citation.tsv -H "Content-type: text/tab-separated-values"`
13+
14+
## Additional Release Steps
15+
16+
1\. Replace Solr schema.xml to allow multiple production locations to be used. See specific instructions below for those installations without custom metadata blocks (1a) and those with custom metadata blocks (1b).
17+
18+
1a\.
19+
20+
For installations without Custom Metadata Blocks:
21+
22+
-stop solr instance (usually service solr stop, depending on solr installation/OS, see the [Installation Guide](https://guides.dataverse.org/en/5.13/installation/prerequisites.html#solr-init-script)
23+
24+
-replace schema.xml
25+
26+
cp /tmp/dvinstall/schema.xml /usr/local/solr/solr-8.11.1/server/solr/collection1/conf
27+
28+
-start solr instance (usually service solr start, depending on solr/OS)
29+
30+
31+
1b\.
32+
33+
For installations with Custom Metadata Blocks:
34+
35+
-stop solr instance (usually service solr stop, depending on solr installation/OS, see the [Installation Guide](https://guides.dataverse.org/en/5.13/installation/prerequisites.html#solr-init-script)
36+
37+
- edit the following line to your schema.xml (to indicate that productionPlace is now multiValued='true"):
38+
39+
`<field name="productionPlace" type="string" stored="true" indexed="true" multiValued="true"/>`
40+
41+
- restart solr instance (usually service solr start, depending on solr/OS)
42+

doc/sphinx-guides/source/_static/api/ddi_dataset.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
<producer affiliation="ProducerAffiliation1" abbr="ProducerAbbreviation1" role="http://ProducerLogoURL1.org" URI="http://ProducerURL1.org">LastProducer1, FirstProducer1</producer>
3535
<producer affiliation="ProducerAffiliation2" abbr="ProducerAbbreviation2" role="http://ProducerLogoURL2.org" URI="http://ProducerURL2.org">LastProducer2, FirstProducer2</producer>
3636
<prodDate>1003-01-01</prodDate>
37-
<prodPlac>ProductionPlace</prodPlac>
37+
<prodPlac>ProductionPlace One</prodPlac>
38+
<prodPlac>ProductionPlace Two</prodPlac>
3839
<software version="SoftwareVersion1">SoftwareName1</software>
3940
<software version="SoftwareVersion2">SoftwareName2</software>
4041
<grantNo agency="GrantInformationGrantAgency1">GrantInformationGrantNumber1</grantNo>

scripts/api/data/metadatablocks/citation.tsv

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
producerURL URL The URL of the producer's website https:// url 39 <a href="#VALUE" target="_blank" rel="noopener">#VALUE</a> FALSE FALSE FALSE FALSE FALSE FALSE producer citation
4444
producerLogoURL Logo URL The URL of the producer's logo https:// url 40 <img src="#VALUE" alt="#NAME" class="metadata-logo"/><br/> FALSE FALSE FALSE FALSE FALSE FALSE producer citation
4545
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
46-
productionPlace Production Location The location where the data and any related materials were produced or collected text 42 FALSE FALSE FALSE FALSE FALSE FALSE citation
46+
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
4747
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
4848
contributorType Type Indicates the type of contribution made to the dataset text 44 #VALUE TRUE TRUE FALSE TRUE FALSE FALSE contributor citation
4949
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

src/main/java/edu/harvard/iq/dataverse/api/imports/ImportDDIServiceBean.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,9 @@ private void processProdStmt(XMLStreamReader xmlr, MetadataBlockDTO citation) th
13521352
} else if (xmlr.getLocalName().equals("prodDate")) {
13531353
citation.getFields().add(FieldDTO.createPrimitiveFieldDTO("productionDate", parseDate(xmlr, "prodDate")));
13541354
} else if (xmlr.getLocalName().equals("prodPlac")) {
1355-
citation.getFields().add(FieldDTO.createPrimitiveFieldDTO("productionPlace", parseDate(xmlr, "prodPlac")));
1355+
List<String> prodPlac = new ArrayList<>();
1356+
prodPlac.add(parseText(xmlr, "prodPlac"));
1357+
citation.getFields().add(FieldDTO.createMultiplePrimitiveFieldDTO(DatasetFieldConstant.productionPlace, prodPlac));
13561358
} else if (xmlr.getLocalName().equals("software")) {
13571359
HashSet<FieldDTO> set = new HashSet<>();
13581360
addToSet(set,"softwareVersion", xmlr.getAttributeValue(null, "version"));

0 commit comments

Comments
 (0)