Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geospatial properties name fix #10306

Merged
merged 13 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions conf/solr/9.3.0/schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
<field name="keywordVocabularyURI" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="kindOfData" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="language" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="northLongitude" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="northLatitude" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="notesText" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="originOfSources" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="otherDataAppraisal" type="text_en" multiValued="false" stored="true" indexed="true"/>
Expand Down Expand Up @@ -370,7 +370,7 @@
<field name="software" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="softwareName" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="softwareVersion" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="southLongitude" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="southLatitude" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="state" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="studyAssayCellType" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="studyAssayMeasurementType" type="text_en" multiValued="true" stored="true" indexed="true"/>
Expand Down Expand Up @@ -566,7 +566,7 @@
<copyField source="keywordVocabularyURI" dest="_text_" maxChars="3000"/>
<copyField source="kindOfData" dest="_text_" maxChars="3000"/>
<copyField source="language" dest="_text_" maxChars="3000"/>
<copyField source="northLongitude" dest="_text_" maxChars="3000"/>
<copyField source="northLatitude" dest="_text_" maxChars="3000"/>
<copyField source="notesText" dest="_text_" maxChars="3000"/>
<copyField source="originOfSources" dest="_text_" maxChars="3000"/>
<copyField source="otherDataAppraisal" dest="_text_" maxChars="3000"/>
Expand Down Expand Up @@ -609,7 +609,7 @@
<copyField source="software" dest="_text_" maxChars="3000"/>
<copyField source="softwareName" dest="_text_" maxChars="3000"/>
<copyField source="softwareVersion" dest="_text_" maxChars="3000"/>
<copyField source="southLongitude" dest="_text_" maxChars="3000"/>
<copyField source="southLatitude" dest="_text_" maxChars="3000"/>
<copyField source="state" dest="_text_" maxChars="3000"/>
<copyField source="studyAssayCellType" dest="_text_" maxChars="3000"/>
<copyField source="studyAssayMeasurementType" dest="_text_" maxChars="3000"/>
Expand Down
4 changes: 4 additions & 0 deletions doc/release-notes/5645-geospatial-props-nslong-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Across the application, the Geospatial metadata block fields for north and south were labeled incorrectly as ‘Longitudes,’ as reported on #5645. After updating to this version of Dataverse, users will need to update all the endpoints that used ‘northLongitude’ and ‘southLongitude’ to ‘northLatitude’ and ‘southLatitude,’ respectively.


TODO: Whoever puts the release notes together should make sure there is the standard note about updating the schema after upgrading.
2 changes: 2 additions & 0 deletions doc/sphinx-guides/source/api/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ This API changelog is experimental and we would love feedback on its usefulness.
v6.2
----

- The fields "northLongitude" and "southLongitude" have been deprecated in favor of "northLatitude" and "southLatitude" in the Geolocation metadata block. After upgrading to 6.2 or later, you will need to use the new fields when creating or updating a dataset.

- **/api/datasets/{id}/versions/{versionId}**: The includeFiles parameter has been renamed to excludeFiles. The default behavior remains the same, which is to include files. However, when excludeFiles is set to true, the files will be excluded. A bug that caused the API to only return a deaccessioned dataset if the user had edit privileges has been fixed.
- **/api/datasets/{id}/versions**: The includeFiles parameter has been renamed to excludeFiles. The default behavior remains the same, which is to include files. However, when excludeFiles is set to true, the files will be excluded.

Expand Down
16 changes: 8 additions & 8 deletions scripts/api/data/dataset-create-new-all-default-fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -907,14 +907,14 @@
"typeClass": "primitive",
"value": "-70"
},
"northLongitude": {
"typeName": "northLongitude",
"northLatitude": {
"typeName": "northLatitude",
"multiple": false,
"typeClass": "primitive",
"value": "43"
},
"southLongitude": {
"typeName": "southLongitude",
"southLatitude": {
"typeName": "southLatitude",
"multiple": false,
"typeClass": "primitive",
"value": "42"
Expand All @@ -933,14 +933,14 @@
"typeClass": "primitive",
"value": "-13"
},
"northLongitude": {
"typeName": "northLongitude",
"northLatitude": {
"typeName": "northLatitude",
"multiple": false,
"typeClass": "primitive",
"value": "29"
},
"southLongitude": {
"typeName": "southLongitude",
"southLatitude": {
"typeName": "southLatitude",
"multiple": false,
"typeClass": "primitive",
"value": "28"
Expand Down
4 changes: 2 additions & 2 deletions scripts/api/data/metadatablocks/geospatial.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
geographicBoundingBox Geographic Bounding Box The fundamental geometric description for any Dataset that models geography is the geographic bounding box. It describes the minimum box, defined by west and east longitudes and north and south latitudes, which includes the largest geographic extent of the Dataset's geographic coverage. This element is used in the first pass of a coordinate-based search. Inclusion of this element in the codebook is recommended, but is required if the bound polygon box is included. none 6 FALSE FALSE TRUE FALSE FALSE FALSE geospatial
westLongitude Westernmost (Left) Longitude Westernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -180,0 <= West Bounding Longitude Value <= 180,0. text 7 FALSE FALSE FALSE FALSE FALSE FALSE geographicBoundingBox geospatial
eastLongitude Easternmost (Right) Longitude Easternmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -180,0 <= East Bounding Longitude Value <= 180,0. text 8 FALSE FALSE FALSE FALSE FALSE FALSE geographicBoundingBox geospatial
northLongitude Northernmost (Top) Latitude Northernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -90,0 <= North Bounding Latitude Value <= 90,0. text 9 FALSE FALSE FALSE FALSE FALSE FALSE geographicBoundingBox geospatial
southLongitude Southernmost (Bottom) Latitude Southernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -90,0 <= South Bounding Latitude Value <= 90,0. text 10 FALSE FALSE FALSE FALSE FALSE FALSE geographicBoundingBox geospatial
northLatitude Northernmost (Top) Latitude Northernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -90,0 <= North Bounding Latitude Value <= 90,0. text 9 FALSE FALSE FALSE FALSE FALSE FALSE geographicBoundingBox geospatial
southLatitude Southernmost (Bottom) Latitude Southernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -90,0 <= South Bounding Latitude Value <= 90,0. text 10 FALSE FALSE FALSE FALSE FALSE FALSE geographicBoundingBox geospatial
#controlledVocabulary DatasetField Value identifier displayOrder
country Afghanistan 0
country Albania 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ public class DatasetFieldConstant implements java.io.Serializable {
public final static String geographicUnit="geographicUnit";
public final static String westLongitude="westLongitude";
public final static String eastLongitude="eastLongitude";
public final static String northLatitude="northLongitude"; //Changed to match DB - incorrectly entered into DB: https://github.com/IQSS/dataverse/issues/5645
public final static String southLatitude="southLongitude"; //Incorrect in DB: https://github.com/IQSS/dataverse/issues/5645
public final static String northLatitude="northLatitude";
public final static String southLatitude="southLatitude";
public final static String unitOfAnalysis="unitOfAnalysis";
public final static String universe="universe";
public final static String kindOfData="kindOfData";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -828,9 +828,9 @@ private HashSet<FieldDTO> processGeoBndBox(XMLStreamReader xmlr) throws XMLStrea
} else if (xmlr.getLocalName().equals("eastBL")) {
addToSet(set,"eastLongitude", parseText(xmlr));
} else if (xmlr.getLocalName().equals("southBL")) {
addToSet(set,"southLongitude", parseText(xmlr));
addToSet(set,"southLatitude", parseText(xmlr));
} else if (xmlr.getLocalName().equals("northBL")) {
addToSet(set,"northLongitude", parseText(xmlr));
addToSet(set,"northLatitude", parseText(xmlr));
}
} else if (event == XMLStreamConstants.END_ELEMENT) {
if (xmlr.getLocalName().equals("geoBndBox")) break;
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/propertyFiles/geospatial.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ datasetfieldtype.geographicUnit.title=Geographic Unit
datasetfieldtype.geographicBoundingBox.title=Geographic Bounding Box
datasetfieldtype.westLongitude.title=Westernmost (Left) Longitude
datasetfieldtype.eastLongitude.title=Easternmost (Right) Longitude
datasetfieldtype.northLongitude.title=Northernmost (Top) Latitude
datasetfieldtype.southLongitude.title=Southernmost (Bottom) Latitude
datasetfieldtype.northLatitude.title=Northernmost (Top) Latitude
datasetfieldtype.southLatitude.title=Southernmost (Bottom) Latitude
datasetfieldtype.geographicCoverage.description=Information on the geographic coverage of the data. Includes the total geographic scope of the data.
datasetfieldtype.country.description=The country or nation that the Dataset is about.
datasetfieldtype.state.description=The state or province that the Dataset is about. Use GeoNames for correct spelling and avoid abbreviations.
Expand All @@ -21,8 +21,8 @@ datasetfieldtype.geographicUnit.description=Lowest level of geographic aggregati
datasetfieldtype.geographicBoundingBox.description=The fundamental geometric description for any Dataset that models geography is the geographic bounding box. It describes the minimum box, defined by west and east longitudes and north and south latitudes, which includes the largest geographic extent of the Dataset's geographic coverage. This element is used in the first pass of a coordinate-based search. Inclusion of this element in the codebook is recommended, but is required if the bound polygon box is included.
datasetfieldtype.westLongitude.description=Westernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -180,0 <= West Bounding Longitude Value <= 180,0.
datasetfieldtype.eastLongitude.description=Easternmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -180,0 <= East Bounding Longitude Value <= 180,0.
datasetfieldtype.northLongitude.description=Northernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -90,0 <= North Bounding Latitude Value <= 90,0.
datasetfieldtype.southLongitude.description=Southernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -90,0 <= South Bounding Latitude Value <= 90,0.
datasetfieldtype.northLatitude.description=Northernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -90,0 <= North Bounding Latitude Value <= 90,0.
datasetfieldtype.southLatitude.description=Southernmost coordinate delimiting the geographic extent of the Dataset. A valid range of values, expressed in decimal degrees, is -90,0 <= South Bounding Latitude Value <= 90,0.
datasetfieldtype.geographicCoverage.watermark=
datasetfieldtype.country.watermark=
datasetfieldtype.state.watermark=
Expand All @@ -32,8 +32,8 @@ datasetfieldtype.geographicUnit.watermark=
datasetfieldtype.geographicBoundingBox.watermark=
datasetfieldtype.westLongitude.watermark=
datasetfieldtype.eastLongitude.watermark=
datasetfieldtype.northLongitude.watermark=
datasetfieldtype.southLongitude.watermark=
datasetfieldtype.northLatitude.watermark=
datasetfieldtype.southLatitude.watermark=
controlledvocabulary.country.afghanistan=Afghanistan
controlledvocabulary.country.albania=Albania
controlledvocabulary.country.algeria=Algeria
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
UPDATE datasetfieldtype
SET name = 'northLatitude'
WHERE name = 'northLongitude';

UPDATE datasetfieldtype
SET name = 'southLatitude'
WHERE name = 'southLongitude';
4 changes: 2 additions & 2 deletions src/test/java/edu/harvard/iq/dataverse/api/NetcdfIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ public void testExtraBoundingBoxFromNetcdf() throws IOException {
.statusCode(OK.getStatusCode())
.body("data.latestVersion.metadataBlocks.geospatial.fields[0].value[0].westLongitude.value", equalTo("-16.320007"))
.body("data.latestVersion.metadataBlocks.geospatial.fields[0].value[0].eastLongitude.value", equalTo("-6.220001"))
.body("data.latestVersion.metadataBlocks.geospatial.fields[0].value[0].northLongitude.value", equalTo("49.62"))
.body("data.latestVersion.metadataBlocks.geospatial.fields[0].value[0].southLongitude.value", equalTo("41.8"));
.body("data.latestVersion.metadataBlocks.geospatial.fields[0].value[0].northLatitude.value", equalTo("49.62"))
.body("data.latestVersion.metadataBlocks.geospatial.fields[0].value[0].southLatitude.value", equalTo("41.8"));
}

}
8 changes: 4 additions & 4 deletions src/test/java/edu/harvard/iq/dataverse/api/SearchIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -1197,12 +1197,12 @@ public void testGeospatialSearch() {
.add("multiple", false)
.add("typeName", "westLongitude")
)
.add("southLongitude",
.add("southLatitude",
Json.createObjectBuilder()
.add("value", "42.33661")
.add("typeClass", "primitive")
.add("multiple", false)
.add("typeName", "southLongitude")
.add("typeName", "southLatitude")
)
.add("eastLongitude",
Json.createObjectBuilder()
Expand All @@ -1211,12 +1211,12 @@ public void testGeospatialSearch() {
.add("multiple", false)
.add("typeName", "eastLongitude")
)
.add("northLongitude",
.add("northLatitude",
Json.createObjectBuilder()
.add("value", "42.409599")
.add("typeClass", "primitive")
.add("multiple", false)
.add("typeName", "northLongitude")
.add("typeName", "northLatitude")
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -927,15 +927,15 @@ public void testWriteGeoLocationElement() throws XMLStreamException, IOException
+ "<geoLocationBox>"
+ "<westBoundLongitude>10</westBoundLongitude>"
+ "<eastBoundLongitude>20</eastBoundLongitude>"
+ "<northBoundLatitude>30</northBoundLatitude>"
+ "<southBoundLatitude>40</southBoundLatitude>"
+ "<northBoundLatitude>30</northBoundLatitude>"
+ "</geoLocationBox>"
+ "</geoLocation>"
+ "<geoLocation>"
+ "<geoLocationBox>"
+ "<eastBoundLongitude>60</eastBoundLongitude>"
+ "<southBoundLatitude>80</southBoundLatitude>"
+ "<northBoundLatitude>70</northBoundLatitude>"
+ "<eastBoundLongitude>60</eastBoundLongitude>"
+ "<westBoundLongitude>50</westBoundLongitude>"
+ "</geoLocationBox>"
+ "</geoLocation></geoLocations>",
Expand Down Expand Up @@ -966,8 +966,8 @@ public void testWriteGeoLocationElement2() throws XMLStreamException, IOExceptio
+ "<geoLocationBox>"
+ "<eastBoundLongitude>23</eastBoundLongitude>"
+ "<northBoundLatitude>786</northBoundLatitude>"
+ "<westBoundLongitude>45</westBoundLongitude>"
+ "<southBoundLatitude>34</southBoundLatitude>"
+ "<westBoundLongitude>45</westBoundLongitude>"
+ "</geoLocationBox>"
+ "</geoLocation></geoLocations>",
stringWriter.toString());
Expand Down
Loading
Loading