[dumpSubset] wf for the creation of the dump per country start from the beginning

This commit is contained in:
Miriam Baglioni 2023-07-28 11:31:42 +02:00
parent 25be584028
commit a06640d344
3 changed files with 24 additions and 25 deletions

View File

@ -18,7 +18,7 @@ import org.apache.http.entity.ContentType;
import org.apache.http.entity.InputStreamEntity; import org.apache.http.entity.InputStreamEntity;
import org.apache.http.entity.StringEntity; import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.CloseableHttpClient;
//import org.apache.http.impl.client.HttpClients; // import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils; import org.apache.http.util.EntityUtils;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -122,7 +122,8 @@ public class ZenodoAPIClient implements Serializable {
// Get response body // Get response body
json = response.body().string(); json = response.body().string();
eu.dnetlib.dhp.common.api.zenodo.ZenodoModel newSubmission = new Gson().fromJson(json, eu.dnetlib.dhp.common.api.zenodo.ZenodoModel.class); eu.dnetlib.dhp.common.api.zenodo.ZenodoModel newSubmission = new Gson()
.fromJson(json, eu.dnetlib.dhp.common.api.zenodo.ZenodoModel.class);
this.bucket = newSubmission.getLinks().getBucket(); this.bucket = newSubmission.getLinks().getBucket();
this.deposition_id = newSubmission.getId(); this.deposition_id = newSubmission.getId();
@ -132,7 +133,6 @@ public class ZenodoAPIClient implements Serializable {
} }
// public int uploadIS2(InputStream is, String fileName) throws IOException { // public int uploadIS2(InputStream is, String fileName) throws IOException {
// //
// final String crlf = "\r\n"; // final String crlf = "\r\n";

View File

@ -81,7 +81,7 @@
</global> </global>
<!-- <start to="save_community_map" />--> <!-- <start to="save_community_map" />-->
<start to="make_archive" /> <start to="save_community_map" />
<action name="save_community_map"> <action name="save_community_map">
<java> <java>

View File

@ -7,8 +7,6 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.nio.file.Files; import java.nio.file.Files;
import eu.dnetlib.dhp.oa.zenodoapi.ZenodoAPIClient;
import eu.dnetlib.dhp.oa.zenodoapi.MissingConceptDoiException;
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.*; import org.apache.hadoop.fs.*;
import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Assertions;
@ -19,7 +17,8 @@ import org.junit.jupiter.api.Test;
import com.google.gson.Gson; import com.google.gson.Gson;
import eu.dnetlib.dhp.oa.graph.dump.community.CommunityMap; import eu.dnetlib.dhp.oa.graph.dump.community.CommunityMap;
import eu.dnetlib.dhp.oa.zenodoapi.MissingConceptDoiException;
import eu.dnetlib.dhp.oa.zenodoapi.ZenodoAPIClient;
@Disabled @Disabled
public class ZenodoUploadTest { public class ZenodoUploadTest {
@ -86,8 +85,7 @@ public class ZenodoUploadTest {
System.out.println(client.sendMretadata(metadata)); System.out.println(client.sendMretadata(metadata));
// System.out.println(client.publish());
//System.out.println(client.publish());
} }
@ -138,7 +136,7 @@ public class ZenodoUploadTest {
} }
//System.out.println(client.publish()); // System.out.println(client.publish());
} }
@ -162,6 +160,7 @@ public class ZenodoUploadTest {
// Assertions.assertEquals(202, client.publish()); // Assertions.assertEquals(202, client.publish());
} }
@Test @Test
void readCommunityMap() throws IOException { void readCommunityMap() throws IOException {
LocalFileSystem fs = FileSystem.getLocal(new Configuration()); LocalFileSystem fs = FileSystem.getLocal(new Configuration());