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; package eu.dnetlib.dhp.schema.dump.oaf;
import java.util.List; import java.util.List;
import java.util.Objects;
public class Context extends Qualifier { public class Context extends Qualifier {
private List<Provenance> provenance; private List<Provenance> provenance;
@ -13,4 +14,15 @@ public class Context extends Qualifier {
public void setProvenance(List<Provenance> provenance) { public void setProvenance(List<Provenance> provenance) {
this.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; 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)); return newInstance(code, label, Provenance.newInstance(provenance, trust));
} }

View File

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

View File

@ -1,31 +1,36 @@
package eu.dnetlib.dhp.schema.dump.oaf; package eu.dnetlib.dhp.schema.dump.oaf;
import java.io.Serializable; import java.io.Serializable;
public class Provenance implements Serializable { public class Provenance implements Serializable {
private String provenance; private String provenance;
private String trust; private String trust;
public String getProvenance() { public String getProvenance() {
return provenance; return provenance;
} }
public void setProvenance(String provenance) { public void setProvenance(String provenance) {
this.provenance = provenance; this.provenance = provenance;
} }
public String getTrust() { public String getTrust() {
return trust; return trust;
} }
public void setTrust(String trust) { public void setTrust(String trust) {
this.trust = trust; this.trust = trust;
} }
public static Provenance newInstance(String provenance, String trust){ public static Provenance newInstance(String provenance, String trust) {
Provenance p = new Provenance(); Provenance p = new Provenance();
p.provenance = provenance; p.provenance = provenance;
p.trust = trust; p.trust = trust;
return p; 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.io.Serializable;
import java.util.List; 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; private List<Author> author;
@ -40,8 +42,6 @@ public class Result extends OafEntity implements Serializable {
private AccessRight bestaccessright; private AccessRight bestaccessright;
private List<Context> context;
private List<ExternalReference> externalReference; private List<ExternalReference> externalReference;
private List<Instance> instance; private List<Instance> instance;
@ -66,6 +66,56 @@ public class Result extends OafEntity implements Serializable {
private List<GeoLocation> geolocation; // dataset 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() { public List<Author> getAuthor() {
return author; return author;
} }
@ -202,14 +252,6 @@ public class Result extends OafEntity implements Serializable {
this.bestaccessright = bestaccessright; this.bestaccessright = bestaccessright;
} }
public List<Context> getContext() {
return context;
}
public void setContext(List<Context> context) {
this.context = context;
}
public List<ExternalReference> getExternalReference() { public List<ExternalReference> getExternalReference() {
return externalReference; return externalReference;
} }

View File

@ -1,25 +1,26 @@
package eu.dnetlib.dhp.schema.dump.oaf; package eu.dnetlib.dhp.schema.dump.oaf;
import java.io.Serializable; import java.io.Serializable;
public class Subject implements Serializable { public class Subject implements Serializable {
private ControlledField subject; private ControlledField subject;
private Provenance provenance; private Provenance provenance;
public ControlledField getSubject() { public ControlledField getSubject() {
return subject; return subject;
} }
public void setSubject(ControlledField subject) { public void setSubject(ControlledField subject) {
this.subject = subject; this.subject = subject;
} }
public Provenance getProvenance() { public Provenance getProvenance() {
return provenance; return provenance;
} }
public void setProvenance(Provenance provenance) { public void setProvenance(Provenance provenance) {
this.provenance = provenance; this.provenance = provenance;
} }
} }