1
0
Fork 0

adding to propagation constants the ones needed for propagation of project to result and addition of new accumulator Set in typed row to collect values of a type

This commit is contained in:
Miriam Baglioni 2020-02-19 14:55:54 +01:00
parent 7167673a58
commit 8aa3b4d7c0
2 changed files with 25 additions and 12 deletions

View File

@ -23,6 +23,9 @@ public class PropagationConstant {
public final static String PROPAGATION_COUNTRY_INSTREPO_CLASS_NAME = "Propagation of country to result collected from datasources of type institutional repositories";
public final static String PROPAGATION_RELATION_RESULT_ORGANIZATION_INST_REPO_CLASS_ID = "result:organization:instrepo";
public final static String PROPAGATION_RELATION_RESULT_ORGANIZATION_INST_REPO_CLASS_NAME = "Propagation of affiliation to result collected from datasources of type institutional repository";
public final static String PROPAGATION_RELATION_RESULT_PROJECT_SEM_REL_CLASS_ID = "result:project:semrel";
public final static String PROPAGATION_RELATION_RESULT_PROJECT_SEM_REL_CLASS_NAME = "Propagation of result to project through semantic relation";
public final static String RELATION_DATASOURCEORGANIZATION_REL_TYPE = "datasourceOrganization";
public final static String RELATION_DATASOURCEORGANIZATION_SUBREL_TYPE = "provision";
@ -34,6 +37,14 @@ public class PropagationConstant {
public final static String RELATION_ORGANIZATION_RESULT_REL_CLASS = "isAuthorInstitutionOf";
public final static String RELATION_RESULT_ORGANIZATION_REL_CLASS = "hasAuthorInstitution";
public static final String RELATION_RESULTRESULT_REL_TYPE = "resultResult";
public static final String RELATION_RESULTRESULT_SUBREL_TYPE = "supplement";
public static final String RELATION_RESULTPROJECT_REL_TYPE = "resultProject";
public static final String RELATION_RESULTPROJECT_SUBREL_TYPE = "outcome";
public static final String RELATION_RESULT_PROJECT_REL_CLASS = "isProducedBy";
public static final String RELATION_PROJECT_RESULT_REL_CLASS = "produces";
public static Country getCountry(String country){
Country nc = new Country();

View File

@ -2,31 +2,33 @@ package eu.dnetlib.dhp;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.*;
public class TypedRow implements Serializable {
private String sourceId;
private String targetId;
private String type;
private String country;
private String value;
private Set<String> accumulator;
public List<String> getAccumulator() {
public Set<String> getAccumulator() {
return accumulator;
}
public TypedRow setAccumulator(List<String> accumulator) {
public TypedRow setAccumulator(Set<String> accumulator) {
this.accumulator = accumulator;
return this;
}
private List<String> accumulator;
public void addAll(Set<String> toadd){
this.accumulator.addAll(toadd);
}
public void add(String a){
if (accumulator == null){
accumulator = new ArrayList<>();
accumulator = new HashSet<>();
}
accumulator.add(a);
}
@ -35,12 +37,12 @@ public class TypedRow implements Serializable {
return accumulator.iterator();
}
public String getCountry() {
return country;
public String getValue() {
return value;
}
public TypedRow setCountry(String country) {
this.country = country;
public TypedRow setValue(String value) {
this.value = value;
return this;
}