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,24 +1,25 @@
package eu.dnetlib.dhp.schema.dump.oaf;
import java.io.Serializable;
public class Pid implements Serializable {
private ControlledField pid;
private Provenance provenance;
private ControlledField pid;
private Provenance provenance;
public ControlledField getPid() {
return pid;
}
public ControlledField getPid() {
return pid;
}
public void setPid(ControlledField pid) {
this.pid = pid;
}
public void setPid(ControlledField pid) {
this.pid = pid;
}
public Provenance getProvenance() {
return provenance;
}
public Provenance getProvenance() {
return provenance;
}
public void setProvenance(Provenance provenance) {
this.provenance = provenance;
}
public void setProvenance(Provenance provenance) {
this.provenance = provenance;
}
}

View File

@ -1,31 +1,36 @@
package eu.dnetlib.dhp.schema.dump.oaf;
import java.io.Serializable;
public class Provenance implements Serializable {
private String provenance;
private String trust;
public class Provenance implements Serializable {
private String provenance;
private String trust;
public String getProvenance() {
return provenance;
}
public String getProvenance() {
return provenance;
}
public void setProvenance(String provenance) {
this.provenance = provenance;
}
public void setProvenance(String provenance) {
this.provenance = provenance;
}
public String getTrust() {
return trust;
}
public String getTrust() {
return trust;
}
public void setTrust(String trust) {
this.trust = trust;
}
public void setTrust(String trust) {
this.trust = trust;
}
public static Provenance newInstance(String provenance, String trust){
Provenance p = new Provenance();
p.provenance = provenance;
p.trust = trust;
return p;
}
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,25 +1,26 @@
package eu.dnetlib.dhp.schema.dump.oaf;
import java.io.Serializable;
public class Subject implements Serializable {
private ControlledField subject;
private Provenance provenance;
private ControlledField subject;
private Provenance provenance;
public ControlledField getSubject() {
return subject;
}
public ControlledField getSubject() {
return subject;
}
public void setSubject(ControlledField subject) {
this.subject = subject;
}
public void setSubject(ControlledField subject) {
this.subject = subject;
}
public Provenance getProvenance() {
return provenance;
}
public Provenance getProvenance() {
return provenance;
}
public void setProvenance(Provenance provenance) {
this.provenance = provenance;
}
public void setProvenance(Provenance provenance) {
this.provenance = provenance;
}
}