2022-02-22 12:53:19 +01:00
|
|
|
|
|
|
|
package eu.dnetlib.dhp.rdfconverter.bioschema;
|
|
|
|
|
|
|
|
import java.io.InputStream;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import org.apache.commons.io.IOUtils;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
import eu.dnetlib.dhp.rdfconverter.utils.RDFConverter;
|
|
|
|
|
|
|
|
public class ConverterTest {
|
|
|
|
|
|
|
|
static Logger logger = LoggerFactory.getLogger(ConverterTest.class);
|
|
|
|
|
2022-04-05 10:47:17 +02:00
|
|
|
@Test
|
|
|
|
public void disprotToDataciteTest() throws Exception {
|
|
|
|
InputStream is = ConverterTest.class.getResourceAsStream("/eu/dnetlib/dhp/rdfconverter/bioschema/disprot.nq");
|
|
|
|
String nq = IOUtils.toString(is);
|
|
|
|
RDFConverter converter = new RDFConverter();
|
|
|
|
ArrayList<String> results = converter.nQuadsFile2DataciteJson(nq, "Protein");
|
|
|
|
results.stream().forEach(r -> {
|
|
|
|
logger.info("JSON DATACITE >> " + r);
|
|
|
|
});
|
|
|
|
}
|
2022-02-22 12:53:19 +01:00
|
|
|
|
|
|
|
@Test
|
|
|
|
public void pedCitationTest() throws Exception {
|
|
|
|
InputStream is = ConverterTest.class.getResourceAsStream("/eu/dnetlib/dhp/rdfconverter/bioschema/ped.nq");
|
|
|
|
String nq = IOUtils.toString(is);
|
|
|
|
RDFConverter converter = new RDFConverter();
|
|
|
|
ArrayList<String> results = converter.nQuadsFile2DataciteJson(nq, "Protein");
|
2022-03-18 14:51:57 +01:00
|
|
|
results.stream().forEach(r -> {
|
|
|
|
logger.info("JSON DATACITE >> " + r);
|
|
|
|
});
|
2022-02-22 12:53:19 +01:00
|
|
|
}
|
|
|
|
}
|