dnet-hadoop/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/Context.java

44 lines
1.8 KiB
Java
Raw Normal View History

package eu.dnetlib.dhp.schema.dump.oaf.community;
import java.util.List;
import java.util.Objects;
2020-08-13 17:06:49 +02:00
import eu.dnetlib.dhp.schema.dump.oaf.Provenance;
import eu.dnetlib.dhp.schema.dump.oaf.Qualifier;
/**
2020-08-13 17:17:49 +02:00
* Reference to a relevant research infrastructure, initiative or community (RI/RC) among those collaborating with OpenAIRE.
* It extend eu.dnetlib.dhp.shema.dump.oaf.Qualifier with a parameter provenance of type
* List<eu.dnetlib.dhp.schema.dump.oaf.Provenance> to store the provenances of the association between the result
* and the RC/RI. The values for this element correspond to:
* - code: it corresponds to the id of the context in the result to be mapped.
* If the context id refers to a RC/RI and contains '::' only the part of the id before the first "::"
* will be used as value for code
2020-08-13 17:06:49 +02:00
* - label it corresponds to the label associated to the id. The information id taken from the profile of the RC/RI
2020-08-13 17:17:49 +02:00
* - provenance it is set only if the dataInfo associated to the contenxt element of the result to be dumped
* is not null. For each dataInfo one instance of type eu.dnetlib.dhp.schema.dump.oaf.Provenance
* is instantiated if the element datainfo.provenanceaction is not null. In this case
2020-08-13 17:06:49 +02:00
* - provenance corresponds to dataInfo.provenanceaction.classname
* - trust corresponds to dataInfo.trust
*/
public class Context extends Qualifier {
private List<Provenance> provenance;
public List<Provenance> getProvenance() {
return provenance;
}
public void setProvenance(List<Provenance> provenance) {
this.provenance = provenance;
}
@Override
public int hashCode() {
String provenance = new String();
this.provenance.forEach(p -> provenance.concat(p.toString()));
return Objects.hash(getCode(), getLabel(), provenance);
}
}