-
Notifications
You must be signed in to change notification settings - Fork 501
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9102 from GlobalDataverseCommunityConsortium/IQSS…
…/9100_OpenAire_update_for_Orgs IQSS/9100 OpenAire update for orgs
- Loading branch information
Showing
12 changed files
with
87 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Changes made in v5.13 and v5.14 in multiple PRs to improve the embedded Schema.org metadata in dataset pages will only be propagated to the Schema.Org JSON-LD metadata export if a reExportAll() is done. | ||
|
||
The 5.14 release notes should include the standard instructions for doing a reExportAll after updating the code. |
28 changes: 0 additions & 28 deletions
28
src/main/java/edu/harvard/iq/dataverse/export/openaire/Cleanup.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package edu.harvard.iq.dataverse.export.openaire; | ||
package edu.harvard.iq.dataverse.util; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.IOException; | ||
|
@@ -9,10 +9,10 @@ | |
import java.util.logging.Level; | ||
|
||
/** | ||
* | ||
* Used by PersonOrOrgUtil | ||
* @author [email protected] | ||
*/ | ||
public class FirstNames { | ||
class FirstNames { | ||
|
||
private static FirstNames instance = null; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
package edu.harvard.iq.dataverse.export.openaire; | ||
package edu.harvard.iq.dataverse.util; | ||
|
||
import edu.harvard.iq.dataverse.util.StringUtil; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.util.ArrayList; | ||
|
@@ -15,10 +14,10 @@ | |
import opennlp.tools.util.Span; | ||
|
||
/** | ||
* | ||
* Used by PersonOrOrgUtil | ||
* @author [email protected] | ||
*/ | ||
public class Organizations { | ||
class Organizations { | ||
|
||
private static Organizations instance = null; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,8 @@ | |
import javax.crypto.IllegalBlockSizeException; | ||
import javax.crypto.NoSuchPaddingException; | ||
import javax.crypto.spec.SecretKeySpec; | ||
|
||
import org.apache.commons.lang3.StringUtils; | ||
import org.jsoup.Jsoup; | ||
|
||
/** | ||
|
@@ -198,4 +200,23 @@ private static SecretKeySpec generateKeyFromString(final String secKey) throws U | |
SecretKeySpec secretKeySpec = new SecretKeySpec(key, "AES"); | ||
return secretKeySpec; | ||
} | ||
|
||
/** | ||
* Normalize sentence | ||
* | ||
* @author [email protected] | ||
* | ||
* | ||
* @param sentence full name or organization name | ||
* @return normalize string value | ||
*/ | ||
static public String normalize(String sentence) { | ||
if (StringUtils.isBlank(sentence)) { | ||
return ""; | ||
} | ||
|
||
sentence = sentence.trim().replaceAll(", *", ", ").replaceAll(" +", " "); | ||
|
||
return sentence; | ||
} | ||
} |
29 changes: 0 additions & 29 deletions
29
src/test/java/edu/harvard/iq/dataverse/export/CleanupTest.java
This file was deleted.
Oops, something went wrong.
6 changes: 4 additions & 2 deletions
6
...rd/iq/dataverse/export/FirstNameTest.java → ...vard/iq/dataverse/util/FirstNameTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
...q/dataverse/export/OrganizationsTest.java → .../iq/dataverse/util/OrganizationsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
src/test/java/edu/harvard/iq/dataverse/util/PersonOrOrgUtilTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -354,5 +354,23 @@ public void testNonEmpty_emptyString() { | |
String expected = ""; | ||
assertFalse(StringUtil.nonEmpty(expected)); | ||
} | ||
|
||
/** | ||
* full name or organization name cleanup. | ||
* | ||
* @author [email protected] | ||
* | ||
* Name is composed of: <First Names> <Family Name> | ||
*/ | ||
@Test | ||
public void testNormalize() { | ||
assertEquals(StringUtil.normalize(" Francesco "), "Francesco"); | ||
assertEquals(StringUtil.normalize("Francesco Cadili "), "Francesco Cadili"); | ||
assertEquals(StringUtil.normalize(" Cadili,Francesco"), "Cadili, Francesco"); | ||
assertEquals(StringUtil.normalize("Cadili, Francesco "), "Cadili, Francesco"); | ||
assertEquals(StringUtil.normalize(null), ""); | ||
|
||
// TODO: organization examples... | ||
} | ||
} | ||
} |