added test method to check the creation of relations between context and projects
This commit is contained in:
parent
6b51b69cf7
commit
04a0d1ba6e
|
@ -5,18 +5,18 @@ import java.util.*;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import eu.dnetlib.dhp.schema.oaf.Project;
|
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
import eu.dnetlib.dhp.schema.common.ModelSupport;
|
import eu.dnetlib.dhp.schema.common.ModelSupport;
|
||||||
import eu.dnetlib.dhp.schema.dump.oaf.graph.Relation;
|
import eu.dnetlib.dhp.schema.dump.oaf.graph.Relation;
|
||||||
import eu.dnetlib.dhp.schema.oaf.Datasource;
|
import eu.dnetlib.dhp.schema.oaf.Datasource;
|
||||||
|
import eu.dnetlib.dhp.schema.oaf.Project;
|
||||||
import eu.dnetlib.dhp.utils.DHPUtils;
|
import eu.dnetlib.dhp.utils.DHPUtils;
|
||||||
|
|
||||||
public class CreateRelationTest {
|
public class CreateRelationTest {
|
||||||
|
@ -443,49 +443,57 @@ public class CreateRelationTest {
|
||||||
" <param name=\"creationdate\">2018-03-01T12:00:00</param>\n" +
|
" <param name=\"creationdate\">2018-03-01T12:00:00</param>\n" +
|
||||||
" <category claim=\"false\" id=\"elixir-gr::projects\" label=\"ELIXIR GR Projects\">\n" +
|
" <category claim=\"false\" id=\"elixir-gr::projects\" label=\"ELIXIR GR Projects\">\n" +
|
||||||
" <concept claim=\"false\" id=\"ni::projects::12\" label=\"\">\n" +
|
" <concept claim=\"false\" id=\"ni::projects::12\" label=\"\">\n" +
|
||||||
" <param name=\"projectfullname\">BIO-INFORMATICS RESEARCH NETWORK COORDINATING CENTER (BIRN-CC)</param>\n" +
|
" <param name=\"projectfullname\">BIO-INFORMATICS RESEARCH NETWORK COORDINATING CENTER (BIRN-CC)</param>\n"
|
||||||
|
+
|
||||||
" <param name=\"acronym\"/>\n" +
|
" <param name=\"acronym\"/>\n" +
|
||||||
" <param name=\"CD_PROJECT_NUMBER\">1U24RR025736-01</param>\n" +
|
" <param name=\"CD_PROJECT_NUMBER\">1U24RR025736-01</param>\n" +
|
||||||
" <param name=\"funder\">NIH</param>\n" +
|
" <param name=\"funder\">NIH</param>\n" +
|
||||||
" </concept>\n" +
|
" </concept>\n" +
|
||||||
" <concept claim=\"false\" id=\"ni::projects::13\" label=\"\">\n" +
|
" <concept claim=\"false\" id=\"ni::projects::13\" label=\"\">\n" +
|
||||||
" <param name=\"projectfullname\">COLLABORATIVE RESEARCH: The Cognitive Neuroscience of Category Learning</param>\n" +
|
" <param name=\"projectfullname\">COLLABORATIVE RESEARCH: The Cognitive Neuroscience of Category Learning</param>\n"
|
||||||
|
+
|
||||||
" <param name=\"acronym\"/>\n" +
|
" <param name=\"acronym\"/>\n" +
|
||||||
" <param name=\"CD_PROJECT_NUMBER\">0223843</param>\n" +
|
" <param name=\"CD_PROJECT_NUMBER\">0223843</param>\n" +
|
||||||
" <param name=\"funder\">NSF</param>\n" +
|
" <param name=\"funder\">NSF</param>\n" +
|
||||||
" </concept>\n" +
|
" </concept>\n" +
|
||||||
" <concept claim=\"false\" id=\"ni::projects::14\" label=\"\">\n" +
|
" <concept claim=\"false\" id=\"ni::projects::14\" label=\"\">\n" +
|
||||||
" <param name=\"projectfullname\">The Cognitive Atlas: Developing an Interdisciplinary Knowledge Base Through Socia</param>\n" +
|
" <param name=\"projectfullname\">The Cognitive Atlas: Developing an Interdisciplinary Knowledge Base Through Socia</param>\n"
|
||||||
|
+
|
||||||
" <param name=\"acronym\"/>\n" +
|
" <param name=\"acronym\"/>\n" +
|
||||||
" <param name=\"CD_PROJECT_NUMBER\">5R01MH082795-05</param>\n" +
|
" <param name=\"CD_PROJECT_NUMBER\">5R01MH082795-05</param>\n" +
|
||||||
" <param name=\"funder\">NIH</param>\n" +
|
" <param name=\"funder\">NIH</param>\n" +
|
||||||
" </concept>\n" +
|
" </concept>\n" +
|
||||||
" <concept claim=\"false\" id=\"ni::projects::15\" label=\"\">\n" +
|
" <concept claim=\"false\" id=\"ni::projects::15\" label=\"\">\n" +
|
||||||
" <param name=\"projectfullname\">Fragmented early life environmental and emotional / cognitive vulnerabilities</param>\n" +
|
" <param name=\"projectfullname\">Fragmented early life environmental and emotional / cognitive vulnerabilities</param>\n"
|
||||||
|
+
|
||||||
" <param name=\"acronym\"/>\n" +
|
" <param name=\"acronym\"/>\n" +
|
||||||
" <param name=\"CD_PROJECT_NUMBER\">1P50MH096889-01A1</param>\n" +
|
" <param name=\"CD_PROJECT_NUMBER\">1P50MH096889-01A1</param>\n" +
|
||||||
" <param name=\"funder\">NIH</param>\n" +
|
" <param name=\"funder\">NIH</param>\n" +
|
||||||
" </concept>\n" +
|
" </concept>\n" +
|
||||||
" <concept claim=\"false\" id=\"ni::projects::16\" label=\"\">\n" +
|
" <concept claim=\"false\" id=\"ni::projects::16\" label=\"\">\n" +
|
||||||
" <param name=\"projectfullname\">Enhancement of the 1000 Functional Connectome Project</param>\n" +
|
" <param name=\"projectfullname\">Enhancement of the 1000 Functional Connectome Project</param>\n"
|
||||||
|
+
|
||||||
" <param name=\"acronym\"/>\n" +
|
" <param name=\"acronym\"/>\n" +
|
||||||
" <param name=\"CD_PROJECT_NUMBER\">1R03MH096321-01A1</param>\n" +
|
" <param name=\"CD_PROJECT_NUMBER\">1R03MH096321-01A1</param>\n" +
|
||||||
" <param name=\"funder\">TUBITAK</param>\n" +
|
" <param name=\"funder\">TUBITAK</param>\n" +
|
||||||
" </concept>\n" +
|
" </concept>\n" +
|
||||||
" <concept claim=\"false\" id=\"ni::projects::17\" label=\"\">\n" +
|
" <concept claim=\"false\" id=\"ni::projects::17\" label=\"\">\n" +
|
||||||
" <param name=\"projectfullname\">CRCNS Data Sharing: An open data repository for cognitive neuroscience: The OpenfMRI Project</param>\n" +
|
" <param name=\"projectfullname\">CRCNS Data Sharing: An open data repository for cognitive neuroscience: The OpenfMRI Project</param>\n"
|
||||||
|
+
|
||||||
" <param name=\"acronym\"/>\n" +
|
" <param name=\"acronym\"/>\n" +
|
||||||
" <param name=\"CD_PROJECT_NUMBER\">1131441</param>\n" +
|
" <param name=\"CD_PROJECT_NUMBER\">1131441</param>\n" +
|
||||||
" <param name=\"funder\">NSF</param>\n" +
|
" <param name=\"funder\">NSF</param>\n" +
|
||||||
" </concept>\n" +
|
" </concept>\n" +
|
||||||
" <concept claim=\"false\" id=\"ni::projects::18\" label=\"\">\n" +
|
" <concept claim=\"false\" id=\"ni::projects::18\" label=\"\">\n" +
|
||||||
" <param name=\"projectfullname\">Enhancing Human Cortical Plasticity: Visual Psychophysics and fMRI</param>\n" +
|
" <param name=\"projectfullname\">Enhancing Human Cortical Plasticity: Visual Psychophysics and fMRI</param>\n"
|
||||||
|
+
|
||||||
" <param name=\"acronym\"/>\n" +
|
" <param name=\"acronym\"/>\n" +
|
||||||
" <param name=\"CD_PROJECT_NUMBER\">0121950</param>\n" +
|
" <param name=\"CD_PROJECT_NUMBER\">0121950</param>\n" +
|
||||||
" <param name=\"funder\">NSF</param>\n" +
|
" <param name=\"funder\">NSF</param>\n" +
|
||||||
" </concept>\n" +
|
" </concept>\n" +
|
||||||
" <concept claim=\"false\" id=\"ni::projects::18\" label=\"\">\n" +
|
" <concept claim=\"false\" id=\"ni::projects::18\" label=\"\">\n" +
|
||||||
" <param name=\"projectfullname\">Transforming statistical methodology for neuroimaging meta-analysis.</param>\n" +
|
" <param name=\"projectfullname\">Transforming statistical methodology for neuroimaging meta-analysis.</param>\n"
|
||||||
|
+
|
||||||
" <param name=\"acronym\"/>\n" +
|
" <param name=\"acronym\"/>\n" +
|
||||||
" <param name=\"CD_PROJECT_NUMBER\">100309</param>\n" +
|
" <param name=\"CD_PROJECT_NUMBER\">100309</param>\n" +
|
||||||
" <param name=\"funder\">WT</param>\n" +
|
" <param name=\"funder\">WT</param>\n" +
|
||||||
|
@ -631,7 +639,6 @@ public class CreateRelationTest {
|
||||||
|
|
||||||
cInfoList.forEach(c -> System.out.println(new Gson().toJson(c)));
|
cInfoList.forEach(c -> System.out.println(new Gson().toJson(c)));
|
||||||
|
|
||||||
|
|
||||||
List<Relation> rList = new ArrayList<>();
|
List<Relation> rList = new ArrayList<>();
|
||||||
|
|
||||||
cInfoList.forEach(cInfo -> Process.getRelation(cInfo).forEach(rList::add));
|
cInfoList.forEach(cInfo -> Process.getRelation(cInfo).forEach(rList::add));
|
||||||
|
|
Loading…
Reference in New Issue