forked from D-Net/dnet-hadoop
refactoring
This commit is contained in:
parent
e3cce9a5a0
commit
8eb70e6657
|
@ -79,8 +79,8 @@ public class PrepareAffiliationRelationsTest {
|
||||||
.getPath();
|
.getPath();
|
||||||
|
|
||||||
String pubmedAffiliationRelationsPath = getClass()
|
String pubmedAffiliationRelationsPath = getClass()
|
||||||
.getResource("/eu/dnetlib/dhp/actionmanager/bipaffiliations/doi_to_ror.json")
|
.getResource("/eu/dnetlib/dhp/actionmanager/bipaffiliations/doi_to_ror.json")
|
||||||
.getPath();
|
.getPath();
|
||||||
|
|
||||||
String outputPath = workingDir.toString() + "/actionSet";
|
String outputPath = workingDir.toString() + "/actionSet";
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,6 @@ import org.jetbrains.annotations.NotNull;
|
||||||
*/
|
*/
|
||||||
public class QueryCommunityAPI {
|
public class QueryCommunityAPI {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static String get(String geturl) throws IOException {
|
private static String get(String geturl) throws IOException {
|
||||||
URL url = new URL(geturl);
|
URL url = new URL(geturl);
|
||||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||||
|
@ -34,32 +32,31 @@ public class QueryCommunityAPI {
|
||||||
|
|
||||||
public static String communities(String baseURL) throws IOException {
|
public static String communities(String baseURL) throws IOException {
|
||||||
|
|
||||||
return get(baseURL + "communities");
|
return get(baseURL + "communities");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String community(String id, String baseURL ) throws IOException {
|
public static String community(String id, String baseURL) throws IOException {
|
||||||
|
|
||||||
return get(baseURL + id);
|
return get(baseURL + id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String communityDatasource(String id, String baseURL ) throws IOException {
|
public static String communityDatasource(String id, String baseURL) throws IOException {
|
||||||
|
|
||||||
return get(baseURL + id + "/contentproviders");
|
|
||||||
|
|
||||||
|
return get(baseURL + id + "/contentproviders");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String communityPropagationOrganization(String id, String baseURL ) throws IOException {
|
public static String communityPropagationOrganization(String id, String baseURL) throws IOException {
|
||||||
|
|
||||||
return get(baseURL + id + "/propagationOrganizations");
|
return get(baseURL + id + "/propagationOrganizations");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String communityProjects(String id, String page, String size, String baseURL ) throws IOException {
|
public static String communityProjects(String id, String page, String size, String baseURL) throws IOException {
|
||||||
|
|
||||||
return get(baseURL + id + "/projects/" + page + "/" + size);
|
return get(baseURL + id + "/projects/" + page + "/" + size);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class PrepareResultCommunitySet {
|
||||||
final String outputPath = parser.get("outputPath");
|
final String outputPath = parser.get("outputPath");
|
||||||
log.info("outputPath: {}", outputPath);
|
log.info("outputPath: {}", outputPath);
|
||||||
|
|
||||||
final String baseURL = parser.get("baseURL");
|
final String baseURL = parser.get("baseURL");
|
||||||
log.info("baseUEL: {}", baseURL);
|
log.info("baseUEL: {}", baseURL);
|
||||||
|
|
||||||
final CommunityEntityMap projectsMap = Utils.getCommunityProjects(baseURL);
|
final CommunityEntityMap projectsMap = Utils.getCommunityProjects(baseURL);
|
||||||
|
|
|
@ -1576,7 +1576,7 @@ public class BulkTagJobTest {
|
||||||
"-outputPath", workingDir.toString() + "/",
|
"-outputPath", workingDir.toString() + "/",
|
||||||
// "-baseURL", "https://services.openaire.eu/openaire/community/",
|
// "-baseURL", "https://services.openaire.eu/openaire/community/",
|
||||||
"-pathMap", pathMap,
|
"-pathMap", pathMap,
|
||||||
"-taggingConf", taggingConf
|
"-taggingConf", taggingConf
|
||||||
});
|
});
|
||||||
|
|
||||||
final JavaSparkContext sc = JavaSparkContext.fromSparkContext(spark.sparkContext());
|
final JavaSparkContext sc = JavaSparkContext.fromSparkContext(spark.sparkContext());
|
||||||
|
|
Loading…
Reference in New Issue