1
0
Fork 0

changed the definition of the model to intesert porvenance information to some classes

This commit is contained in:
Miriam Baglioni 2020-07-24 17:23:57 +02:00
parent c0f3059676
commit 00f2b8410a
6 changed files with 122 additions and 61 deletions

View File

@ -2,6 +2,7 @@
package eu.dnetlib.dhp.schema.dump.oaf;
import java.util.List;
import java.util.Objects;
public class Context extends Qualifier {
private List<Provenance> provenance;
@ -13,4 +14,15 @@ public class Context extends Qualifier {
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);
}
}

View File

@ -21,7 +21,7 @@ public class Country extends Qualifier {
return c;
}
public static Country newInstance(String code, String label, String provenance, String trust){
public static Country newInstance(String code, String label, String provenance, String trust) {
return newInstance(code, label, Provenance.newInstance(provenance, trust));
}

View File

@ -1,3 +1,4 @@
package eu.dnetlib.dhp.schema.dump.oaf;
import java.io.Serializable;

View File

@ -1,3 +1,4 @@
package eu.dnetlib.dhp.schema.dump.oaf;
import java.io.Serializable;
@ -22,10 +23,14 @@ public class Provenance implements Serializable {
this.trust = trust;
}
public static Provenance newInstance(String provenance, String trust){
public static Provenance newInstance(String provenance, String trust) {
Provenance p = new Provenance();
p.provenance = provenance;
p.trust = trust;
return p;
}
public String toString(){
return provenance + trust;
}
}

View File

@ -4,7 +4,9 @@ package eu.dnetlib.dhp.schema.dump.oaf;
import java.io.Serializable;
import java.util.List;
public class Result extends OafEntity implements Serializable {
import eu.dnetlib.dhp.schema.dump.oaf.community.Project;
public class Result implements Serializable {
private List<Author> author;
@ -40,8 +42,6 @@ public class Result extends OafEntity implements Serializable {
private AccessRight bestaccessright;
private List<Context> context;
private List<ExternalReference> externalReference;
private List<Instance> instance;
@ -66,6 +66,56 @@ public class Result extends OafEntity implements Serializable {
private List<GeoLocation> geolocation; // dataset
private String id;
private List<String> originalId;
private List<ControlledField> pid;
private String dateofcollection;
private Long lastupdatetimestamp;
public Long getLastupdatetimestamp() {
return lastupdatetimestamp;
}
public void setLastupdatetimestamp(Long lastupdatetimestamp) {
this.lastupdatetimestamp = lastupdatetimestamp;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public List<String> getOriginalId() {
return originalId;
}
public void setOriginalId(List<String> originalId) {
this.originalId = originalId;
}
public List<ControlledField> getPid() {
return pid;
}
public void setPid(List<ControlledField> pid) {
this.pid = pid;
}
public String getDateofcollection() {
return dateofcollection;
}
public void setDateofcollection(String dateofcollection) {
this.dateofcollection = dateofcollection;
}
public List<Author> getAuthor() {
return author;
}
@ -202,14 +252,6 @@ public class Result extends OafEntity implements Serializable {
this.bestaccessright = bestaccessright;
}
public List<Context> getContext() {
return context;
}
public void setContext(List<Context> context) {
this.context = context;
}
public List<ExternalReference> getExternalReference() {
return externalReference;
}

View File

@ -1,3 +1,4 @@
package eu.dnetlib.dhp.schema.dump.oaf;
import java.io.Serializable;