Skip to content

Commit

Permalink
change "author" to "creator" #4371
Browse files Browse the repository at this point in the history
"I think Google Dataset Search is ignoring author and prefers creator"
  • Loading branch information
pdurbin committed Oct 11, 2018
1 parent c95e53d commit a6915d7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/edu/harvard/iq/dataverse/DatasetVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ public String getJsonLd() {
}
authors.add(author);
}
job.add("author", authors);
job.add("creator", authors);
/**
* We are aware that there is a "datePublished" field but it means "Date
* of first broadcast/publication." This only makes sense for a 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public void testGetJsonLd() throws ParseException {
assertEquals("", obj.getString("name"));
// TODO: If it ever becomes easier to mock authors, test them.
JsonArray emptyArray = Json.createArrayBuilder().build();
assertEquals(emptyArray, obj.getJsonArray("author"));
assertEquals(emptyArray, obj.getJsonArray("creator"));
// TODO: If it ever becomes easier to mock subjects, test them.
assertEquals(emptyArray, obj.getJsonArray("keywords"));
assertEquals("Dataverse", obj.getJsonObject("provider").getString("name"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import edu.harvard.iq.dataverse.util.json.JsonUtil;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.PrintWriter;
import java.io.StringReader;
import java.nio.file.Files;
import java.nio.file.Paths;
Expand Down Expand Up @@ -161,8 +162,8 @@ public void testExportDataset() throws Exception {
assertEquals("Dataset", json2.getString("@type"));
assertEquals("https://doi.org/myAuthority/myIdentifier", json2.getString("identifier"));
assertEquals("Darwin's Finches", json2.getString("name"));
assertEquals("Finch, Fiona", json2.getJsonArray("author").getJsonObject(0).getString("name"));
assertEquals("Birds Inc.", json2.getJsonArray("author").getJsonObject(0).getString("affiliation"));
assertEquals("Finch, Fiona", json2.getJsonArray("creator").getJsonObject(0).getString("name"));
assertEquals("Birds Inc.", json2.getJsonArray("creator").getJsonObject(0).getString("affiliation"));
assertEquals("1955-11-05", json2.getString("dateModified"));
assertEquals("1", json2.getString("version"));
assertEquals("Darwin's finches (also known as the Galápagos finches) are a group of about fifteen species of passerine birds.", json2.getString("description"));
Expand Down

0 comments on commit a6915d7

Please sign in to comment.