Skip to content

Commit

Permalink
remove "schemaVersion" from output #4371
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed Nov 5, 2018
1 parent 33cd45f commit 3a95edf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
16 changes: 9 additions & 7 deletions src/main/java/edu/harvard/iq/dataverse/DatasetVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -1690,14 +1690,16 @@ public String getJsonLd() {
}

/**
* Should "schemaVersion" be removed? https://schema.org/version/3.4/
* says, "Note that schema.org release numbers are not generally
* included when you use schema.org. In contexts (e.g. related standards
* work) when a particular release needs to be cited, this document
* provides the appropriate URL."
* https://schema.org/version/3.4/ says, "Note that schema.org release
* numbers are not generally included when you use schema.org. In
* contexts (e.g. related standards work) when a particular release
* needs to be cited, this document provides the appropriate URL."
*
* For the reason above we decided to take out schemaVersion but we're
* leaving this Javadoc in here to remind us that we made this decision.
* We used to include "https://schema.org/version/3.3" in the output for
* "schemaVersion".
*/
job.add("schemaVersion", "https://schema.org/version/3.3");

TermsOfUseAndAccess terms = this.getTermsOfUseAndAccess();
if (terms != null) {
JsonObjectBuilder license = Json.createObjectBuilder().add("@type", "Dataset");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void testGetJsonLd() throws ParseException {
assertEquals("https://doi.org/10.5072/FK2/LK0D1H", obj.getString("@id"));
assertEquals("https://doi.org/10.5072/FK2/LK0D1H", obj.getString("identifier"));
assertEquals("https://doi.org/10.5072/FK2/LK0D1H", obj.getString("url"));
assertEquals("https://schema.org/version/3.3", obj.getString("schemaVersion"));
assertEquals(null, obj.getString("schemaVersion", null));
assertEquals("Dataset", obj.getJsonObject("license").getString("@type"));
assertEquals("CC0", obj.getJsonObject("license").getString("text"));
assertEquals("https://creativecommons.org/publicdomain/zero/1.0/", obj.getJsonObject("license").getString("url"));
Expand Down Expand Up @@ -189,7 +189,7 @@ public void testGetJsonLdNonCC0License() throws ParseException {
assertEquals("https://doi.org/10.5072/FK2/LK0D1H", obj.getString("@id"));
assertEquals("https://doi.org/10.5072/FK2/LK0D1H", obj.getString("identifier"));
assertEquals("https://doi.org/10.5072/FK2/LK0D1H", obj.getString("url"));
assertEquals("https://schema.org/version/3.3", obj.getString("schemaVersion"));
assertEquals(null, obj.getString("schemaVersion", null));
assertEquals("Dataset", obj.getJsonObject("license").getString("@type"));
assertEquals("Call me maybe", obj.getJsonObject("license").getString("text"));
assertEquals("1955-11-05", obj.getString("dateModified"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public void testExportDataset() throws Exception {
assertEquals("https://doi.org/10.5072/FK2/RV16HK", json2.getJsonArray("citation").getJsonObject(0).getString("identifier"));
assertEquals("2002/2005", json2.getJsonArray("temporalCoverage").getString(0));
assertEquals("2001-10-01/2015-11-15", json2.getJsonArray("temporalCoverage").getString(1));
assertEquals("https://schema.org/version/3.3", json2.getString("schemaVersion"));
assertEquals(null, json2.getString("schemaVersion", null));
assertEquals("Dataset", json2.getJsonObject("license").getString("@type"));
assertEquals("CC0", json2.getJsonObject("license").getString("text"));
assertEquals("https://creativecommons.org/publicdomain/zero/1.0/", json2.getJsonObject("license").getString("url"));
Expand Down

0 comments on commit 3a95edf

Please sign in to comment.