remove a bit of syntactic sugar on the object inheritance :(

This commit is contained in:
Sandro La Bruzzo 2019-10-25 18:10:30 +02:00
parent c74335ebc7
commit 9ee4e5a196
30 changed files with 572 additions and 784 deletions

View File

@ -21,53 +21,47 @@ public class Author implements Serializable {
return fullname; return fullname;
} }
public Author setFullname(String fullname) { public void setFullname(String fullname) {
this.fullname = fullname; this.fullname = fullname;
return this;
} }
public String getName() { public String getName() {
return name; return name;
} }
public Author setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
return this;
} }
public String getSurname() { public String getSurname() {
return surname; return surname;
} }
public Author setSurname(String surname) { public void setSurname(String surname) {
this.surname = surname; this.surname = surname;
return this;
} }
public Integer getRank() { public Integer getRank() {
return rank; return rank;
} }
public Author setRank(Integer rank) { public void setRank(Integer rank) {
this.rank = rank; this.rank = rank;
return this;
} }
public List<KeyValue> getPid() { public List<KeyValue> getPid() {
return pid; return pid;
} }
public Author setPid(List<KeyValue> pid) { public void setPid(List<KeyValue> pid) {
this.pid = pid; this.pid = pid;
return this;
} }
public List<Field<String>> getAffiliation() { public List<Field<String>> getAffiliation() {
return affiliation; return affiliation;
} }
public Author setAffiliation(List<Field<String>> affiliation) { public void setAffiliation(List<Field<String>> affiliation) {
this.affiliation = affiliation; this.affiliation = affiliation;
return this;
} }
} }

View File

@ -12,17 +12,15 @@ public class Context implements Serializable {
return id; return id;
} }
public Context setId(String id) { public void setId(String id) {
this.id = id; this.id = id;
return this;
} }
public List<DataInfo> getDataInfo() { public List<DataInfo> getDataInfo() {
return dataInfo; return dataInfo;
} }
public Context setDataInfo(List<DataInfo> dataInfo) { public void setDataInfo(List<DataInfo> dataInfo) {
this.dataInfo = dataInfo; this.dataInfo = dataInfo;
return this;
} }
} }

View File

@ -17,53 +17,47 @@ public class DataInfo implements Serializable {
return invisible; return invisible;
} }
public DataInfo setInvisible(Boolean invisible) { public void setInvisible(Boolean invisible) {
this.invisible = invisible; this.invisible = invisible;
return this;
} }
public Boolean getInferred() { public Boolean getInferred() {
return inferred; return inferred;
} }
public DataInfo setInferred(Boolean inferred) { public void setInferred(Boolean inferred) {
this.inferred = inferred; this.inferred = inferred;
return this;
} }
public Boolean getDeletedbyinference() { public Boolean getDeletedbyinference() {
return deletedbyinference; return deletedbyinference;
} }
public DataInfo setDeletedbyinference(Boolean deletedbyinference) { public void setDeletedbyinference(Boolean deletedbyinference) {
this.deletedbyinference = deletedbyinference; this.deletedbyinference = deletedbyinference;
return this;
} }
public String getTrust() { public String getTrust() {
return trust; return trust;
} }
public DataInfo setTrust(String trust) { public void setTrust(String trust) {
this.trust = trust; this.trust = trust;
return this;
} }
public String getInferenceprovenance() { public String getInferenceprovenance() {
return inferenceprovenance; return inferenceprovenance;
} }
public DataInfo setInferenceprovenance(String inferenceprovenance) { public void setInferenceprovenance(String inferenceprovenance) {
this.inferenceprovenance = inferenceprovenance; this.inferenceprovenance = inferenceprovenance;
return this;
} }
public Qualifier getProvenanceaction() { public Qualifier getProvenanceaction() {
return provenanceaction; return provenanceaction;
} }
public DataInfo setProvenanceaction(Qualifier provenanceaction) { public void setProvenanceaction(Qualifier provenanceaction) {
this.provenanceaction = provenanceaction; this.provenanceaction = provenanceaction;
return this;
} }
} }

View File

@ -3,7 +3,7 @@ package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
public class Dataset extends Result<Dataset> implements Serializable { public class Dataset extends Result implements Serializable {
private Field<String> storagedate; private Field<String> storagedate;
@ -23,67 +23,55 @@ public class Dataset extends Result<Dataset> implements Serializable {
return storagedate; return storagedate;
} }
public Dataset setStoragedate(Field<String> storagedate) { public void setStoragedate(Field<String> storagedate) {
this.storagedate = storagedate; this.storagedate = storagedate;
return this;
} }
public Field<String> getDevice() { public Field<String> getDevice() {
return device; return device;
} }
public Dataset setDevice(Field<String> device) { public void setDevice(Field<String> device) {
this.device = device; this.device = device;
return this;
} }
public Field<String> getSize() { public Field<String> getSize() {
return size; return size;
} }
public Dataset setSize(Field<String> size) { public void setSize(Field<String> size) {
this.size = size; this.size = size;
return this;
} }
public Field<String> getVersion() { public Field<String> getVersion() {
return version; return version;
} }
public Dataset setVersion(Field<String> version) { public void setVersion(Field<String> version) {
this.version = version; this.version = version;
return this;
} }
public Field<String> getLastmetadataupdate() { public Field<String> getLastmetadataupdate() {
return lastmetadataupdate; return lastmetadataupdate;
} }
public Dataset setLastmetadataupdate(Field<String> lastmetadataupdate) { public void setLastmetadataupdate(Field<String> lastmetadataupdate) {
this.lastmetadataupdate = lastmetadataupdate; this.lastmetadataupdate = lastmetadataupdate;
return this;
} }
public Field<String> getMetadataversionnumber() { public Field<String> getMetadataversionnumber() {
return metadataversionnumber; return metadataversionnumber;
} }
public Dataset setMetadataversionnumber(Field<String> metadataversionnumber) { public void setMetadataversionnumber(Field<String> metadataversionnumber) {
this.metadataversionnumber = metadataversionnumber; this.metadataversionnumber = metadataversionnumber;
return this;
} }
public List<GeoLocation> getGeolocation() { public List<GeoLocation> getGeolocation() {
return geolocation; return geolocation;
} }
public Dataset setGeolocation(List<GeoLocation> geolocation) { public void setGeolocation(List<GeoLocation> geolocation) {
this.geolocation = geolocation; this.geolocation = geolocation;
return this;
}
@Override
protected Dataset self() {
return this;
} }
} }

View File

@ -3,7 +3,7 @@ package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
public class Datasource extends OafEntity<Datasource> implements Serializable { public class Datasource extends OafEntity implements Serializable {
private Qualifier datasourcetype; private Qualifier datasourcetype;
@ -86,319 +86,279 @@ public class Datasource extends OafEntity<Datasource> implements Serializable {
return datasourcetype; return datasourcetype;
} }
public Datasource setDatasourcetype(Qualifier datasourcetype) { public void setDatasourcetype(Qualifier datasourcetype) {
this.datasourcetype = datasourcetype; this.datasourcetype = datasourcetype;
return this;
} }
public Qualifier getOpenairecompatibility() { public Qualifier getOpenairecompatibility() {
return openairecompatibility; return openairecompatibility;
} }
public Datasource setOpenairecompatibility(Qualifier openairecompatibility) { public void setOpenairecompatibility(Qualifier openairecompatibility) {
this.openairecompatibility = openairecompatibility; this.openairecompatibility = openairecompatibility;
return this;
} }
public Field<String> getOfficialname() { public Field<String> getOfficialname() {
return officialname; return officialname;
} }
public Datasource setOfficialname(Field<String> officialname) { public void setOfficialname(Field<String> officialname) {
this.officialname = officialname; this.officialname = officialname;
return this;
} }
public Field<String> getEnglishname() { public Field<String> getEnglishname() {
return englishname; return englishname;
} }
public Datasource setEnglishname(Field<String> englishname) { public void setEnglishname(Field<String> englishname) {
this.englishname = englishname; this.englishname = englishname;
return this;
} }
public Field<String> getWebsiteurl() { public Field<String> getWebsiteurl() {
return websiteurl; return websiteurl;
} }
public Datasource setWebsiteurl(Field<String> websiteurl) { public void setWebsiteurl(Field<String> websiteurl) {
this.websiteurl = websiteurl; this.websiteurl = websiteurl;
return this;
} }
public Field<String> getLogourl() { public Field<String> getLogourl() {
return logourl; return logourl;
} }
public Datasource setLogourl(Field<String> logourl) { public void setLogourl(Field<String> logourl) {
this.logourl = logourl; this.logourl = logourl;
return this;
} }
public Field<String> getContactemail() { public Field<String> getContactemail() {
return contactemail; return contactemail;
} }
public Datasource setContactemail(Field<String> contactemail) { public void setContactemail(Field<String> contactemail) {
this.contactemail = contactemail; this.contactemail = contactemail;
return this;
} }
public Field<String> getNamespaceprefix() { public Field<String> getNamespaceprefix() {
return namespaceprefix; return namespaceprefix;
} }
public Datasource setNamespaceprefix(Field<String> namespaceprefix) { public void setNamespaceprefix(Field<String> namespaceprefix) {
this.namespaceprefix = namespaceprefix; this.namespaceprefix = namespaceprefix;
return this;
} }
public Field<String> getLatitude() { public Field<String> getLatitude() {
return latitude; return latitude;
} }
public Datasource setLatitude(Field<String> latitude) { public void setLatitude(Field<String> latitude) {
this.latitude = latitude; this.latitude = latitude;
return this;
} }
public Field<String> getLongitude() { public Field<String> getLongitude() {
return longitude; return longitude;
} }
public Datasource setLongitude(Field<String> longitude) { public void setLongitude(Field<String> longitude) {
this.longitude = longitude; this.longitude = longitude;
return this;
} }
public Field<String> getDateofvalidation() { public Field<String> getDateofvalidation() {
return dateofvalidation; return dateofvalidation;
} }
public Datasource setDateofvalidation(Field<String> dateofvalidation) { public void setDateofvalidation(Field<String> dateofvalidation) {
this.dateofvalidation = dateofvalidation; this.dateofvalidation = dateofvalidation;
return this;
} }
public Field<String> getDescription() { public Field<String> getDescription() {
return description; return description;
} }
public Datasource setDescription(Field<String> description) { public void setDescription(Field<String> description) {
this.description = description; this.description = description;
return this;
} }
public List<StructuredProperty> getSubjects() { public List<StructuredProperty> getSubjects() {
return subjects; return subjects;
} }
public Datasource setSubjects(List<StructuredProperty> subjects) { public void setSubjects(List<StructuredProperty> subjects) {
this.subjects = subjects; this.subjects = subjects;
return this;
} }
public Field<String> getOdnumberofitems() { public Field<String> getOdnumberofitems() {
return odnumberofitems; return odnumberofitems;
} }
public Datasource setOdnumberofitems(Field<String> odnumberofitems) { public void setOdnumberofitems(Field<String> odnumberofitems) {
this.odnumberofitems = odnumberofitems; this.odnumberofitems = odnumberofitems;
return this;
} }
public Field<String> getOdnumberofitemsdate() { public Field<String> getOdnumberofitemsdate() {
return odnumberofitemsdate; return odnumberofitemsdate;
} }
public Datasource setOdnumberofitemsdate(Field<String> odnumberofitemsdate) { public void setOdnumberofitemsdate(Field<String> odnumberofitemsdate) {
this.odnumberofitemsdate = odnumberofitemsdate; this.odnumberofitemsdate = odnumberofitemsdate;
return this;
} }
public Field<String> getOdpolicies() { public Field<String> getOdpolicies() {
return odpolicies; return odpolicies;
} }
public Datasource setOdpolicies(Field<String> odpolicies) { public void setOdpolicies(Field<String> odpolicies) {
this.odpolicies = odpolicies; this.odpolicies = odpolicies;
return this;
} }
public List<Field<String>> getOdlanguages() { public List<Field<String>> getOdlanguages() {
return odlanguages; return odlanguages;
} }
public Datasource setOdlanguages(List<Field<String>> odlanguages) { public void setOdlanguages(List<Field<String>> odlanguages) {
this.odlanguages = odlanguages; this.odlanguages = odlanguages;
return this;
} }
public List<Field<String>> getOdcontenttypes() { public List<Field<String>> getOdcontenttypes() {
return odcontenttypes; return odcontenttypes;
} }
public Datasource setOdcontenttypes(List<Field<String>> odcontenttypes) { public void setOdcontenttypes(List<Field<String>> odcontenttypes) {
this.odcontenttypes = odcontenttypes; this.odcontenttypes = odcontenttypes;
return this;
} }
public List<Field<String>> getAccessinfopackage() { public List<Field<String>> getAccessinfopackage() {
return accessinfopackage; return accessinfopackage;
} }
public Datasource setAccessinfopackage(List<Field<String>> accessinfopackage) { public void setAccessinfopackage(List<Field<String>> accessinfopackage) {
this.accessinfopackage = accessinfopackage; this.accessinfopackage = accessinfopackage;
return this;
} }
public Field<String> getReleasestartdate() { public Field<String> getReleasestartdate() {
return releasestartdate; return releasestartdate;
} }
public Datasource setReleasestartdate(Field<String> releasestartdate) { public void setReleasestartdate(Field<String> releasestartdate) {
this.releasestartdate = releasestartdate; this.releasestartdate = releasestartdate;
return this;
} }
public Field<String> getReleaseenddate() { public Field<String> getReleaseenddate() {
return releaseenddate; return releaseenddate;
} }
public Datasource setReleaseenddate(Field<String> releaseenddate) { public void setReleaseenddate(Field<String> releaseenddate) {
this.releaseenddate = releaseenddate; this.releaseenddate = releaseenddate;
return this;
} }
public Field<String> getMissionstatementurl() { public Field<String> getMissionstatementurl() {
return missionstatementurl; return missionstatementurl;
} }
public Datasource setMissionstatementurl(Field<String> missionstatementurl) { public void setMissionstatementurl(Field<String> missionstatementurl) {
this.missionstatementurl = missionstatementurl; this.missionstatementurl = missionstatementurl;
return this;
} }
public Field<Boolean> getDataprovider() { public Field<Boolean> getDataprovider() {
return dataprovider; return dataprovider;
} }
public Datasource setDataprovider(Field<Boolean> dataprovider) { public void setDataprovider(Field<Boolean> dataprovider) {
this.dataprovider = dataprovider; this.dataprovider = dataprovider;
return this;
} }
public Field<Boolean> getServiceprovider() { public Field<Boolean> getServiceprovider() {
return serviceprovider; return serviceprovider;
} }
public Datasource setServiceprovider(Field<Boolean> serviceprovider) { public void setServiceprovider(Field<Boolean> serviceprovider) {
this.serviceprovider = serviceprovider; this.serviceprovider = serviceprovider;
return this;
} }
public Field<String> getDatabaseaccesstype() { public Field<String> getDatabaseaccesstype() {
return databaseaccesstype; return databaseaccesstype;
} }
public Datasource setDatabaseaccesstype(Field<String> databaseaccesstype) { public void setDatabaseaccesstype(Field<String> databaseaccesstype) {
this.databaseaccesstype = databaseaccesstype; this.databaseaccesstype = databaseaccesstype;
return this;
} }
public Field<String> getDatauploadtype() { public Field<String> getDatauploadtype() {
return datauploadtype; return datauploadtype;
} }
public Datasource setDatauploadtype(Field<String> datauploadtype) { public void setDatauploadtype(Field<String> datauploadtype) {
this.datauploadtype = datauploadtype; this.datauploadtype = datauploadtype;
return this;
} }
public Field<String> getDatabaseaccessrestriction() { public Field<String> getDatabaseaccessrestriction() {
return databaseaccessrestriction; return databaseaccessrestriction;
} }
public Datasource setDatabaseaccessrestriction(Field<String> databaseaccessrestriction) { public void setDatabaseaccessrestriction(Field<String> databaseaccessrestriction) {
this.databaseaccessrestriction = databaseaccessrestriction; this.databaseaccessrestriction = databaseaccessrestriction;
return this;
} }
public Field<String> getDatauploadrestriction() { public Field<String> getDatauploadrestriction() {
return datauploadrestriction; return datauploadrestriction;
} }
public Datasource setDatauploadrestriction(Field<String> datauploadrestriction) { public void setDatauploadrestriction(Field<String> datauploadrestriction) {
this.datauploadrestriction = datauploadrestriction; this.datauploadrestriction = datauploadrestriction;
return this;
} }
public Field<Boolean> getVersioning() { public Field<Boolean> getVersioning() {
return versioning; return versioning;
} }
public Datasource setVersioning(Field<Boolean> versioning) { public void setVersioning(Field<Boolean> versioning) {
this.versioning = versioning; this.versioning = versioning;
return this;
} }
public Field<String> getCitationguidelineurl() { public Field<String> getCitationguidelineurl() {
return citationguidelineurl; return citationguidelineurl;
} }
public Datasource setCitationguidelineurl(Field<String> citationguidelineurl) { public void setCitationguidelineurl(Field<String> citationguidelineurl) {
this.citationguidelineurl = citationguidelineurl; this.citationguidelineurl = citationguidelineurl;
return this;
} }
public Field<String> getQualitymanagementkind() { public Field<String> getQualitymanagementkind() {
return qualitymanagementkind; return qualitymanagementkind;
} }
public Datasource setQualitymanagementkind(Field<String> qualitymanagementkind) { public void setQualitymanagementkind(Field<String> qualitymanagementkind) {
this.qualitymanagementkind = qualitymanagementkind; this.qualitymanagementkind = qualitymanagementkind;
return this;
} }
public Field<String> getPidsystems() { public Field<String> getPidsystems() {
return pidsystems; return pidsystems;
} }
public Datasource setPidsystems(Field<String> pidsystems) { public void setPidsystems(Field<String> pidsystems) {
this.pidsystems = pidsystems; this.pidsystems = pidsystems;
return this;
} }
public Field<String> getCertificates() { public Field<String> getCertificates() {
return certificates; return certificates;
} }
public Datasource setCertificates(Field<String> certificates) { public void setCertificates(Field<String> certificates) {
this.certificates = certificates; this.certificates = certificates;
return this;
} }
public List<KeyValue> getPolicies() { public List<KeyValue> getPolicies() {
return policies; return policies;
} }
public Datasource setPolicies(List<KeyValue> policies) { public void setPolicies(List<KeyValue> policies) {
this.policies = policies; this.policies = policies;
return this;
} }
public Journal getJournal() { public Journal getJournal() {
return journal; return journal;
} }
public Datasource setJournal(Journal journal) { public void setJournal(Journal journal) {
this.journal = journal; this.journal = journal;
return this;
}
@Override
protected Datasource self() {
return this;
} }
} }

View File

@ -31,71 +31,63 @@ public class ExternalReference implements Serializable {
return sitename; return sitename;
} }
public ExternalReference setSitename(String sitename) { public void setSitename(String sitename) {
this.sitename = sitename; this.sitename = sitename;
return this;
} }
public String getLabel() { public String getLabel() {
return label; return label;
} }
public ExternalReference setLabel(String label) { public void setLabel(String label) {
this.label = label; this.label = label;
return this;
} }
public String getUrl() { public String getUrl() {
return url; return url;
} }
public ExternalReference setUrl(String url) { public void setUrl(String url) {
this.url = url; this.url = url;
return this;
} }
public String getDescription() { public String getDescription() {
return description; return description;
} }
public ExternalReference setDescription(String description) { public void setDescription(String description) {
this.description = description; this.description = description;
return this;
} }
public Qualifier getQualifier() { public Qualifier getQualifier() {
return qualifier; return qualifier;
} }
public ExternalReference setQualifier(Qualifier qualifier) { public void setQualifier(Qualifier qualifier) {
this.qualifier = qualifier; this.qualifier = qualifier;
return this;
} }
public String getRefidentifier() { public String getRefidentifier() {
return refidentifier; return refidentifier;
} }
public ExternalReference setRefidentifier(String refidentifier) { public void setRefidentifier(String refidentifier) {
this.refidentifier = refidentifier; this.refidentifier = refidentifier;
return this;
} }
public String getQuery() { public String getQuery() {
return query; return query;
} }
public ExternalReference setQuery(String query) { public void setQuery(String query) {
this.query = query; this.query = query;
return this;
} }
public DataInfo getDataInfo() { public DataInfo getDataInfo() {
return dataInfo; return dataInfo;
} }
public ExternalReference setDataInfo(DataInfo dataInfo) { public void setDataInfo(DataInfo dataInfo) {
this.dataInfo = dataInfo; this.dataInfo = dataInfo;
return this;
} }
} }

View File

@ -18,44 +18,39 @@ public class ExtraInfo implements Serializable {
return name; return name;
} }
public ExtraInfo setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
return this;
} }
public String getTypology() { public String getTypology() {
return typology; return typology;
} }
public ExtraInfo setTypology(String typology) { public void setTypology(String typology) {
this.typology = typology; this.typology = typology;
return this;
} }
public String getProvenance() { public String getProvenance() {
return provenance; return provenance;
} }
public ExtraInfo setProvenance(String provenance) { public void setProvenance(String provenance) {
this.provenance = provenance; this.provenance = provenance;
return this;
} }
public String getTrust() { public String getTrust() {
return trust; return trust;
} }
public ExtraInfo setTrust(String trust) { public void setTrust(String trust) {
this.trust = trust; this.trust = trust;
return this;
} }
public String getValue() { public String getValue() {
return value; return value;
} }
public ExtraInfo setValue(String value) { public void setValue(String value) {
this.value = value; this.value = value;
return this;
} }
} }

View File

@ -12,17 +12,15 @@ public class Field<T> implements Serializable {
return value; return value;
} }
public Field<T> setValue(T value) { public void setValue(T value) {
this.value = value; this.value = value;
return this;
} }
public DataInfo getDataInfo() { public DataInfo getDataInfo() {
return dataInfo; return dataInfo;
} }
public Field<T> setDataInfo(DataInfo dataInfo) { public void setDataInfo(DataInfo dataInfo) {
this.dataInfo = dataInfo; this.dataInfo = dataInfo;
return this;
} }
} }

View File

@ -14,26 +14,23 @@ public class GeoLocation implements Serializable {
return point; return point;
} }
public GeoLocation setPoint(String point) { public void setPoint(String point) {
this.point = point; this.point = point;
return this;
} }
public String getBox() { public String getBox() {
return box; return box;
} }
public GeoLocation setBox(String box) { public void setBox(String box) {
this.box = box; this.box = box;
return this;
} }
public String getPlace() { public String getPlace() {
return place; return place;
} }
public GeoLocation setPlace(String place) { public void setPlace(String place) {
this.place = place; this.place = place;
return this;
} }
} }

View File

@ -25,71 +25,63 @@ public class Instance implements Serializable {
return license; return license;
} }
public Instance setLicense(Field<String> license) { public void setLicense(Field<String> license) {
this.license = license; this.license = license;
return this;
} }
public Qualifier getAccessright() { public Qualifier getAccessright() {
return accessright; return accessright;
} }
public Instance setAccessright(Qualifier accessright) { public void setAccessright(Qualifier accessright) {
this.accessright = accessright; this.accessright = accessright;
return this;
} }
public Qualifier getInstancetype() { public Qualifier getInstancetype() {
return instancetype; return instancetype;
} }
public Instance setInstancetype(Qualifier instancetype) { public void setInstancetype(Qualifier instancetype) {
this.instancetype = instancetype; this.instancetype = instancetype;
return this;
} }
public KeyValue getHostedby() { public KeyValue getHostedby() {
return hostedby; return hostedby;
} }
public Instance setHostedby(KeyValue hostedby) { public void setHostedby(KeyValue hostedby) {
this.hostedby = hostedby; this.hostedby = hostedby;
return this;
} }
public String getUrl() { public String getUrl() {
return url; return url;
} }
public Instance setUrl(String url) { public void setUrl(String url) {
this.url = url; this.url = url;
return this;
} }
public String getDistributionlocation() { public String getDistributionlocation() {
return distributionlocation; return distributionlocation;
} }
public Instance setDistributionlocation(String distributionlocation) { public void setDistributionlocation(String distributionlocation) {
this.distributionlocation = distributionlocation; this.distributionlocation = distributionlocation;
return this;
} }
public KeyValue getCollectedfrom() { public KeyValue getCollectedfrom() {
return collectedfrom; return collectedfrom;
} }
public Instance setCollectedfrom(KeyValue collectedfrom) { public void setCollectedfrom(KeyValue collectedfrom) {
this.collectedfrom = collectedfrom; this.collectedfrom = collectedfrom;
return this;
} }
public Field<String> getDateofacceptance() { public Field<String> getDateofacceptance() {
return dateofacceptance; return dateofacceptance;
} }
public Instance setDateofacceptance(Field<String> dateofacceptance) { public void setDateofacceptance(Field<String> dateofacceptance) {
this.dateofacceptance = dateofacceptance; this.dateofacceptance = dateofacceptance;
return this;
} }
} }

View File

@ -32,107 +32,95 @@ public class Journal implements Serializable {
return name; return name;
} }
public Journal setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
return this;
} }
public String getIssnPrinted() { public String getIssnPrinted() {
return issnPrinted; return issnPrinted;
} }
public Journal setIssnPrinted(String issnPrinted) { public void setIssnPrinted(String issnPrinted) {
this.issnPrinted = issnPrinted; this.issnPrinted = issnPrinted;
return this;
} }
public String getIssnOnline() { public String getIssnOnline() {
return issnOnline; return issnOnline;
} }
public Journal setIssnOnline(String issnOnline) { public void setIssnOnline(String issnOnline) {
this.issnOnline = issnOnline; this.issnOnline = issnOnline;
return this;
} }
public String getIssnLinking() { public String getIssnLinking() {
return issnLinking; return issnLinking;
} }
public Journal setIssnLinking(String issnLinking) { public void setIssnLinking(String issnLinking) {
this.issnLinking = issnLinking; this.issnLinking = issnLinking;
return this;
} }
public String getEp() { public String getEp() {
return ep; return ep;
} }
public Journal setEp(String ep) { public void setEp(String ep) {
this.ep = ep; this.ep = ep;
return this;
} }
public String getIss() { public String getIss() {
return iss; return iss;
} }
public Journal setIss(String iss) { public void setIss(String iss) {
this.iss = iss; this.iss = iss;
return this;
} }
public String getSp() { public String getSp() {
return sp; return sp;
} }
public Journal setSp(String sp) { public void setSp(String sp) {
this.sp = sp; this.sp = sp;
return this;
} }
public String getVol() { public String getVol() {
return vol; return vol;
} }
public Journal setVol(String vol) { public void setVol(String vol) {
this.vol = vol; this.vol = vol;
return this;
} }
public String getEdition() { public String getEdition() {
return edition; return edition;
} }
public Journal setEdition(String edition) { public void setEdition(String edition) {
this.edition = edition; this.edition = edition;
return this;
} }
public String getConferenceplace() { public String getConferenceplace() {
return conferenceplace; return conferenceplace;
} }
public Journal setConferenceplace(String conferenceplace) { public void setConferenceplace(String conferenceplace) {
this.conferenceplace = conferenceplace; this.conferenceplace = conferenceplace;
return this;
} }
public String getConferencedate() { public String getConferencedate() {
return conferencedate; return conferencedate;
} }
public Journal setConferencedate(String conferencedate) { public void setConferencedate(String conferencedate) {
this.conferencedate = conferencedate; this.conferencedate = conferencedate;
return this;
} }
public DataInfo getDataInfo() { public DataInfo getDataInfo() {
return dataInfo; return dataInfo;
} }
public Journal setDataInfo(DataInfo dataInfo) { public void setDataInfo(DataInfo dataInfo) {
this.dataInfo = dataInfo; this.dataInfo = dataInfo;
return this;
} }
} }

View File

@ -14,26 +14,23 @@ public class KeyValue implements Serializable {
return key; return key;
} }
public KeyValue setKey(String key) { public void setKey(String key) {
this.key = key; this.key = key;
return this;
} }
public String getValue() { public String getValue() {
return value; return value;
} }
public KeyValue setValue(String value) { public void setValue(String value) {
this.value = value; this.value = value;
return this;
} }
public DataInfo getDataInfo() { public DataInfo getDataInfo() {
return dataInfo; return dataInfo;
} }
public KeyValue setDataInfo(DataInfo dataInfo) { public void setDataInfo(DataInfo dataInfo) {
this.dataInfo = dataInfo; this.dataInfo = dataInfo;
return this;
} }
} }

View File

@ -10,8 +10,7 @@ public class OAIProvenance implements Serializable {
return originDescription; return originDescription;
} }
public OAIProvenance setOriginDescription(OriginDescription originDescription) { public void setOriginDescription(OriginDescription originDescription) {
this.originDescription = originDescription; this.originDescription = originDescription;
return this;
} }
} }

View File

@ -2,29 +2,25 @@ package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable; import java.io.Serializable;
public abstract class Oaf<T extends Oaf<T>> implements Serializable { public abstract class Oaf implements Serializable {
private DataInfo dataInfo; private DataInfo dataInfo;
private Long lastupdatetimestamp; private Long lastupdatetimestamp;
protected abstract T self();
public DataInfo getDataInfo() { public DataInfo getDataInfo() {
return dataInfo; return dataInfo;
} }
public T setDataInfo(DataInfo dataInfo) { public void setDataInfo(DataInfo dataInfo) {
this.dataInfo = dataInfo; this.dataInfo = dataInfo;
return self();
} }
public Long getLastupdatetimestamp() { public Long getLastupdatetimestamp() {
return lastupdatetimestamp; return lastupdatetimestamp;
} }
public T setLastupdatetimestamp(Long lastupdatetimestamp) { public void setLastupdatetimestamp(Long lastupdatetimestamp) {
this.lastupdatetimestamp = lastupdatetimestamp; this.lastupdatetimestamp = lastupdatetimestamp;
return self();
} }
} }

View File

@ -3,7 +3,7 @@ package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
public abstract class OafEntity<T extends OafEntity<T>> extends Oaf<T> implements Serializable { public abstract class OafEntity extends Oaf implements Serializable {
private String id; private String id;
@ -25,71 +25,63 @@ public abstract class OafEntity<T extends OafEntity<T>> extends Oaf<T> implement
return id; return id;
} }
public T setId(String id) { public void setId(String id) {
this.id = id; this.id = id;
return self();
} }
public List<String> getOriginalId() { public List<String> getOriginalId() {
return originalId; return originalId;
} }
public T setOriginalId(List<String> originalId) { public void setOriginalId(List<String> originalId) {
this.originalId = originalId; this.originalId = originalId;
return self();
} }
public List<KeyValue> getCollectedfrom() { public List<KeyValue> getCollectedfrom() {
return collectedfrom; return collectedfrom;
} }
public T setCollectedfrom(List<KeyValue> collectedfrom) { public void setCollectedfrom(List<KeyValue> collectedfrom) {
this.collectedfrom = collectedfrom; this.collectedfrom = collectedfrom;
return self();
} }
public List<StructuredProperty> getPid() { public List<StructuredProperty> getPid() {
return pid; return pid;
} }
public T setPid(List<StructuredProperty> pid) { public void setPid(List<StructuredProperty> pid) {
this.pid = pid; this.pid = pid;
return self();
} }
public String getDateofcollection() { public String getDateofcollection() {
return dateofcollection; return dateofcollection;
} }
public T setDateofcollection(String dateofcollection) { public void setDateofcollection(String dateofcollection) {
this.dateofcollection = dateofcollection; this.dateofcollection = dateofcollection;
return self();
} }
public String getDateoftransformation() { public String getDateoftransformation() {
return dateoftransformation; return dateoftransformation;
} }
public T setDateoftransformation(String dateoftransformation) { public void setDateoftransformation(String dateoftransformation) {
this.dateoftransformation = dateoftransformation; this.dateoftransformation = dateoftransformation;
return self();
} }
public List<ExtraInfo> getExtraInfo() { public List<ExtraInfo> getExtraInfo() {
return extraInfo; return extraInfo;
} }
public T setExtraInfo(List<ExtraInfo> extraInfo) { public void setExtraInfo(List<ExtraInfo> extraInfo) {
this.extraInfo = extraInfo; this.extraInfo = extraInfo;
return self();
} }
public OAIProvenance getOaiprovenance() { public OAIProvenance getOaiprovenance() {
return oaiprovenance; return oaiprovenance;
} }
public T setOaiprovenance(OAIProvenance oaiprovenance) { public void setOaiprovenance(OAIProvenance oaiprovenance) {
this.oaiprovenance = oaiprovenance; this.oaiprovenance = oaiprovenance;
return self();
} }
} }

View File

@ -3,7 +3,7 @@ package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
public class Organization extends OafEntity<Organization> implements Serializable { public class Organization extends OafEntity implements Serializable {
private Field<String> legalshortname; private Field<String> legalshortname;
@ -41,148 +41,127 @@ public class Organization extends OafEntity<Organization> implements Serializabl
return legalshortname; return legalshortname;
} }
public Organization setLegalshortname(Field<String> legalshortname) { public void setLegalshortname(Field<String> legalshortname) {
this.legalshortname = legalshortname; this.legalshortname = legalshortname;
return this;
} }
public Field<String> getLegalname() { public Field<String> getLegalname() {
return legalname; return legalname;
} }
public Organization setLegalname(Field<String> legalname) { public void setLegalname(Field<String> legalname) {
this.legalname = legalname; this.legalname = legalname;
return this;
} }
public List<Field<String>> getAlternativeNames() { public List<Field<String>> getAlternativeNames() {
return alternativeNames; return alternativeNames;
} }
public Organization setAlternativeNames(List<Field<String>> alternativeNames) { public void setAlternativeNames(List<Field<String>> alternativeNames) {
this.alternativeNames = alternativeNames; this.alternativeNames = alternativeNames;
return this;
} }
public Field<String> getWebsiteurl() { public Field<String> getWebsiteurl() {
return websiteurl; return websiteurl;
} }
public Organization setWebsiteurl(Field<String> websiteurl) { public void setWebsiteurl(Field<String> websiteurl) {
this.websiteurl = websiteurl; this.websiteurl = websiteurl;
return this;
} }
public Field<String> getLogourl() { public Field<String> getLogourl() {
return logourl; return logourl;
} }
public Organization setLogourl(Field<String> logourl) { public void setLogourl(Field<String> logourl) {
this.logourl = logourl; this.logourl = logourl;
return this;
} }
public Field<String> getEclegalbody() { public Field<String> getEclegalbody() {
return eclegalbody; return eclegalbody;
} }
public Organization setEclegalbody(Field<String> eclegalbody) { public void setEclegalbody(Field<String> eclegalbody) {
this.eclegalbody = eclegalbody; this.eclegalbody = eclegalbody;
return this;
} }
public Field<String> getEclegalperson() { public Field<String> getEclegalperson() {
return eclegalperson; return eclegalperson;
} }
public Organization setEclegalperson(Field<String> eclegalperson) { public void setEclegalperson(Field<String> eclegalperson) {
this.eclegalperson = eclegalperson; this.eclegalperson = eclegalperson;
return this;
} }
public Field<String> getEcnonprofit() { public Field<String> getEcnonprofit() {
return ecnonprofit; return ecnonprofit;
} }
public Organization setEcnonprofit(Field<String> ecnonprofit) { public void setEcnonprofit(Field<String> ecnonprofit) {
this.ecnonprofit = ecnonprofit; this.ecnonprofit = ecnonprofit;
return this;
} }
public Field<String> getEcresearchorganization() { public Field<String> getEcresearchorganization() {
return ecresearchorganization; return ecresearchorganization;
} }
public Organization setEcresearchorganization(Field<String> ecresearchorganization) { public void setEcresearchorganization(Field<String> ecresearchorganization) {
this.ecresearchorganization = ecresearchorganization; this.ecresearchorganization = ecresearchorganization;
return this;
} }
public Field<String> getEchighereducation() { public Field<String> getEchighereducation() {
return echighereducation; return echighereducation;
} }
public Organization setEchighereducation(Field<String> echighereducation) { public void setEchighereducation(Field<String> echighereducation) {
this.echighereducation = echighereducation; this.echighereducation = echighereducation;
return this;
} }
public Field<String> getEcinternationalorganizationeurinterests() { public Field<String> getEcinternationalorganizationeurinterests() {
return ecinternationalorganizationeurinterests; return ecinternationalorganizationeurinterests;
} }
public Organization setEcinternationalorganizationeurinterests(Field<String> ecinternationalorganizationeurinterests) { public void setEcinternationalorganizationeurinterests(Field<String> ecinternationalorganizationeurinterests) {
this.ecinternationalorganizationeurinterests = ecinternationalorganizationeurinterests; this.ecinternationalorganizationeurinterests = ecinternationalorganizationeurinterests;
return this;
} }
public Field<String> getEcinternationalorganization() { public Field<String> getEcinternationalorganization() {
return ecinternationalorganization; return ecinternationalorganization;
} }
public Organization setEcinternationalorganization(Field<String> ecinternationalorganization) { public void setEcinternationalorganization(Field<String> ecinternationalorganization) {
this.ecinternationalorganization = ecinternationalorganization; this.ecinternationalorganization = ecinternationalorganization;
return this;
} }
public Field<String> getEcenterprise() { public Field<String> getEcenterprise() {
return ecenterprise; return ecenterprise;
} }
public Organization setEcenterprise(Field<String> ecenterprise) { public void setEcenterprise(Field<String> ecenterprise) {
this.ecenterprise = ecenterprise; this.ecenterprise = ecenterprise;
return this;
} }
public Field<String> getEcsmevalidated() { public Field<String> getEcsmevalidated() {
return ecsmevalidated; return ecsmevalidated;
} }
public Organization setEcsmevalidated(Field<String> ecsmevalidated) { public void setEcsmevalidated(Field<String> ecsmevalidated) {
this.ecsmevalidated = ecsmevalidated; this.ecsmevalidated = ecsmevalidated;
return this;
} }
public Field<String> getEcnutscode() { public Field<String> getEcnutscode() {
return ecnutscode; return ecnutscode;
} }
public Organization setEcnutscode(Field<String> ecnutscode) { public void setEcnutscode(Field<String> ecnutscode) {
this.ecnutscode = ecnutscode; this.ecnutscode = ecnutscode;
return this;
} }
public Qualifier getCountry() { public Qualifier getCountry() {
return country; return country;
} }
public Organization setCountry(Qualifier country) { public void setCountry(Qualifier country) {
this.country = country; this.country = country;
return this;
}
@Override
protected Organization self() {
return this;
} }
} }

View File

@ -20,54 +20,47 @@ public class OriginDescription implements Serializable {
return harvestDate; return harvestDate;
} }
public OriginDescription setHarvestDate(String harvestDate) { public void setHarvestDate(String harvestDate) {
this.harvestDate = harvestDate; this.harvestDate = harvestDate;
return this;
} }
public Boolean getAltered() { public Boolean getAltered() {
return altered; return altered;
} }
public OriginDescription setAltered(Boolean altered) { public void setAltered(Boolean altered) {
this.altered = altered; this.altered = altered;
return this;
} }
public String getBaseURL() { public String getBaseURL() {
return baseURL; return baseURL;
} }
public OriginDescription setBaseURL(String baseURL) { public void setBaseURL(String baseURL) {
this.baseURL = baseURL; this.baseURL = baseURL;
return this;
} }
public String getIdentifier() { public String getIdentifier() {
return identifier; return identifier;
} }
public OriginDescription setIdentifier(String identifier) { public void setIdentifier(String identifier) {
this.identifier = identifier; this.identifier = identifier;
return this;
} }
public String getDatestamp() { public String getDatestamp() {
return datestamp; return datestamp;
} }
public OriginDescription setDatestamp(String datestamp) { public void setDatestamp(String datestamp) {
this.datestamp = datestamp; this.datestamp = datestamp;
return this;
} }
public String getMetadataNamespace() { public String getMetadataNamespace() {
return metadataNamespace; return metadataNamespace;
} }
public OriginDescription setMetadataNamespace(String metadataNamespace) { public void setMetadataNamespace(String metadataNamespace) {
this.metadataNamespace = metadataNamespace; this.metadataNamespace = metadataNamespace;
return this;
} }
} }

View File

@ -3,7 +3,7 @@ package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
public class OtherResearchProducts extends Result<OtherResearchProducts> implements Serializable { public class OtherResearchProducts extends Result implements Serializable {
private List<Field<String>> contactperson; private List<Field<String>> contactperson;
@ -15,31 +15,23 @@ public class OtherResearchProducts extends Result<OtherResearchProducts> impleme
return contactperson; return contactperson;
} }
public OtherResearchProducts setContactperson(List<Field<String>> contactperson) { public void setContactperson(List<Field<String>> contactperson) {
this.contactperson = contactperson; this.contactperson = contactperson;
return this;
} }
public List<Field<String>> getContactgroup() { public List<Field<String>> getContactgroup() {
return contactgroup; return contactgroup;
} }
public OtherResearchProducts setContactgroup(List<Field<String>> contactgroup) { public void setContactgroup(List<Field<String>> contactgroup) {
this.contactgroup = contactgroup; this.contactgroup = contactgroup;
return this;
} }
public List<Field<String>> getTool() { public List<Field<String>> getTool() {
return tool; return tool;
} }
public OtherResearchProducts setTool(List<Field<String>> tool) { public void setTool(List<Field<String>> tool) {
this.tool = tool; this.tool = tool;
return this;
}
@Override
protected OtherResearchProducts self() {
return this;
} }
} }

View File

@ -3,7 +3,7 @@ package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
public class Project extends OafEntity<Project> implements Serializable { public class Project extends OafEntity implements Serializable {
private Field<String> websiteurl; private Field<String> websiteurl;
@ -61,238 +61,207 @@ public class Project extends OafEntity<Project> implements Serializable {
return websiteurl; return websiteurl;
} }
public Project setWebsiteurl(Field<String> websiteurl) { public void setWebsiteurl(Field<String> websiteurl) {
this.websiteurl = websiteurl; this.websiteurl = websiteurl;
return this;
} }
public Field<String> getCode() { public Field<String> getCode() {
return code; return code;
} }
public Project setCode(Field<String> code) { public void setCode(Field<String> code) {
this.code = code; this.code = code;
return this;
} }
public Field<String> getAcronym() { public Field<String> getAcronym() {
return acronym; return acronym;
} }
public Project setAcronym(Field<String> acronym) { public void setAcronym(Field<String> acronym) {
this.acronym = acronym; this.acronym = acronym;
return this;
} }
public Field<String> getTitle() { public Field<String> getTitle() {
return title; return title;
} }
public Project setTitle(Field<String> title) { public void setTitle(Field<String> title) {
this.title = title; this.title = title;
return this;
} }
public Field<String> getStartdate() { public Field<String> getStartdate() {
return startdate; return startdate;
} }
public Project setStartdate(Field<String> startdate) { public void setStartdate(Field<String> startdate) {
this.startdate = startdate; this.startdate = startdate;
return this;
} }
public Field<String> getEnddate() { public Field<String> getEnddate() {
return enddate; return enddate;
} }
public Project setEnddate(Field<String> enddate) { public void setEnddate(Field<String> enddate) {
this.enddate = enddate; this.enddate = enddate;
return this;
} }
public Field<String> getCallidentifier() { public Field<String> getCallidentifier() {
return callidentifier; return callidentifier;
} }
public Project setCallidentifier(Field<String> callidentifier) { public void setCallidentifier(Field<String> callidentifier) {
this.callidentifier = callidentifier; this.callidentifier = callidentifier;
return this;
} }
public Field<String> getKeywords() { public Field<String> getKeywords() {
return keywords; return keywords;
} }
public Project setKeywords(Field<String> keywords) { public void setKeywords(Field<String> keywords) {
this.keywords = keywords; this.keywords = keywords;
return this;
} }
public Field<String> getDuration() { public Field<String> getDuration() {
return duration; return duration;
} }
public Project setDuration(Field<String> duration) { public void setDuration(Field<String> duration) {
this.duration = duration; this.duration = duration;
return this;
} }
public Field<String> getEcsc39() { public Field<String> getEcsc39() {
return ecsc39; return ecsc39;
} }
public Project setEcsc39(Field<String> ecsc39) { public void setEcsc39(Field<String> ecsc39) {
this.ecsc39 = ecsc39; this.ecsc39 = ecsc39;
return this;
} }
public Field<String> getOamandatepublications() { public Field<String> getOamandatepublications() {
return oamandatepublications; return oamandatepublications;
} }
public Project setOamandatepublications(Field<String> oamandatepublications) { public void setOamandatepublications(Field<String> oamandatepublications) {
this.oamandatepublications = oamandatepublications; this.oamandatepublications = oamandatepublications;
return this;
} }
public Field<String> getEcarticle29_3() { public Field<String> getEcarticle29_3() {
return ecarticle29_3; return ecarticle29_3;
} }
public Project setEcarticle29_3(Field<String> ecarticle29_3) { public void setEcarticle29_3(Field<String> ecarticle29_3) {
this.ecarticle29_3 = ecarticle29_3; this.ecarticle29_3 = ecarticle29_3;
return this;
} }
public List<StructuredProperty> getSubjects() { public List<StructuredProperty> getSubjects() {
return subjects; return subjects;
} }
public Project setSubjects(List<StructuredProperty> subjects) { public void setSubjects(List<StructuredProperty> subjects) {
this.subjects = subjects; this.subjects = subjects;
return this;
} }
public List<Field<String>> getFundingtree() { public List<Field<String>> getFundingtree() {
return fundingtree; return fundingtree;
} }
public Project setFundingtree(List<Field<String>> fundingtree) { public void setFundingtree(List<Field<String>> fundingtree) {
this.fundingtree = fundingtree; this.fundingtree = fundingtree;
return this;
} }
public Qualifier getContracttype() { public Qualifier getContracttype() {
return contracttype; return contracttype;
} }
public Project setContracttype(Qualifier contracttype) { public void setContracttype(Qualifier contracttype) {
this.contracttype = contracttype; this.contracttype = contracttype;
return this;
} }
public Field<String> getOptional1() { public Field<String> getOptional1() {
return optional1; return optional1;
} }
public Project setOptional1(Field<String> optional1) { public void setOptional1(Field<String> optional1) {
this.optional1 = optional1; this.optional1 = optional1;
return this;
} }
public Field<String> getOptional2() { public Field<String> getOptional2() {
return optional2; return optional2;
} }
public Project setOptional2(Field<String> optional2) { public void setOptional2(Field<String> optional2) {
this.optional2 = optional2; this.optional2 = optional2;
return this;
} }
public Field<String> getJsonextrainfo() { public Field<String> getJsonextrainfo() {
return jsonextrainfo; return jsonextrainfo;
} }
public Project setJsonextrainfo(Field<String> jsonextrainfo) { public void setJsonextrainfo(Field<String> jsonextrainfo) {
this.jsonextrainfo = jsonextrainfo; this.jsonextrainfo = jsonextrainfo;
return this;
} }
public Field<String> getContactfullname() { public Field<String> getContactfullname() {
return contactfullname; return contactfullname;
} }
public Project setContactfullname(Field<String> contactfullname) { public void setContactfullname(Field<String> contactfullname) {
this.contactfullname = contactfullname; this.contactfullname = contactfullname;
return this;
} }
public Field<String> getContactfax() { public Field<String> getContactfax() {
return contactfax; return contactfax;
} }
public Project setContactfax(Field<String> contactfax) { public void setContactfax(Field<String> contactfax) {
this.contactfax = contactfax; this.contactfax = contactfax;
return this;
} }
public Field<String> getContactphone() { public Field<String> getContactphone() {
return contactphone; return contactphone;
} }
public Project setContactphone(Field<String> contactphone) { public void setContactphone(Field<String> contactphone) {
this.contactphone = contactphone; this.contactphone = contactphone;
return this;
} }
public Field<String> getContactemail() { public Field<String> getContactemail() {
return contactemail; return contactemail;
} }
public Project setContactemail(Field<String> contactemail) { public void setContactemail(Field<String> contactemail) {
this.contactemail = contactemail; this.contactemail = contactemail;
return this;
} }
public Field<String> getSummary() { public Field<String> getSummary() {
return summary; return summary;
} }
public Project setSummary(Field<String> summary) { public void setSummary(Field<String> summary) {
this.summary = summary; this.summary = summary;
return this;
} }
public Field<String> getCurrency() { public Field<String> getCurrency() {
return currency; return currency;
} }
public Project setCurrency(Field<String> currency) { public void setCurrency(Field<String> currency) {
this.currency = currency; this.currency = currency;
return this;
} }
public Float getTotalcost() { public Float getTotalcost() {
return totalcost; return totalcost;
} }
public Project setTotalcost(Float totalcost) { public void setTotalcost(Float totalcost) {
this.totalcost = totalcost; this.totalcost = totalcost;
return this;
} }
public Float getFundedamount() { public Float getFundedamount() {
return fundedamount; return fundedamount;
} }
public Project setFundedamount(Float fundedamount) { public void setFundedamount(Float fundedamount) {
this.fundedamount = fundedamount; this.fundedamount = fundedamount;
return this;
}
@Override
protected Project self() {
return this;
} }
} }

View File

@ -2,7 +2,7 @@ package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable; import java.io.Serializable;
public class Publication extends Result<Publication> implements Serializable { public class Publication extends Result implements Serializable {
// publication specific // publication specific
private Journal journal; private Journal journal;
@ -11,13 +11,7 @@ public class Publication extends Result<Publication> implements Serializable {
return journal; return journal;
} }
public Publication setJournal(Journal journal) { public void setJournal(Journal journal) {
this.journal = journal; this.journal = journal;
return this;
}
@Override
protected Publication self() {
return this;
} }
} }

View File

@ -13,36 +13,31 @@ public class Qualifier implements Serializable {
return classid; return classid;
} }
public Qualifier setClassid(String classid) { public void setClassid(String classid) {
this.classid = classid; this.classid = classid;
return this;
} }
public String getClassname() { public String getClassname() {
return classname; return classname;
} }
public Qualifier setClassname(String classname) { public void setClassname(String classname) {
this.classname = classname; this.classname = classname;
return this;
} }
public String getSchemeid() { public String getSchemeid() {
return schemeid; return schemeid;
} }
public Qualifier setSchemeid(String schemeid) { public void setSchemeid(String schemeid) {
this.schemeid = schemeid; this.schemeid = schemeid;
return this;
} }
public String getSchemename() { public String getSchemename() {
return schemename; return schemename;
} }
public Qualifier setSchemename(String schemename) { public void setSchemename(String schemename) {
this.schemename = schemename; this.schemename = schemename;
return this;
} }
} }

View File

@ -2,7 +2,7 @@ package eu.dnetlib.dhp.schema.oaf;
import java.util.List; import java.util.List;
public class Relation extends Oaf<Relation> { public class Relation extends Oaf {
private String relType; private String relType;
@ -20,58 +20,47 @@ public class Relation extends Oaf<Relation> {
return relType; return relType;
} }
public Relation setRelType(String relType) { public void setRelType(String relType) {
this.relType = relType; this.relType = relType;
return self();
} }
public String getSubRelType() { public String getSubRelType() {
return subRelType; return subRelType;
} }
public Relation setSubRelType(String subRelType) { public void setSubRelType(String subRelType) {
this.subRelType = subRelType; this.subRelType = subRelType;
return self();
} }
public String getRelClass() { public String getRelClass() {
return relClass; return relClass;
} }
public Relation setRelClass(String relClass) { public void setRelClass(String relClass) {
this.relClass = relClass; this.relClass = relClass;
return self();
} }
public String getSource() { public String getSource() {
return source; return source;
} }
public Relation setSource(String source) { public void setSource(String source) {
this.source = source; this.source = source;
return self();
} }
public String getTarget() { public String getTarget() {
return target; return target;
} }
public Relation setTarget(String target) { public void setTarget(String target) {
this.target = target; this.target = target;
return self();
} }
public List<KeyValue> getCollectedFrom() { public List<KeyValue> getCollectedFrom() {
return collectedFrom; return collectedFrom;
} }
public Relation setCollectedFrom(List<KeyValue> collectedFrom) { public void setCollectedFrom(List<KeyValue> collectedFrom) {
this.collectedFrom = collectedFrom; this.collectedFrom = collectedFrom;
return self();
}
@Override
protected Relation self() {
return this;
} }
} }

View File

@ -3,7 +3,7 @@ package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
public abstract class Result<T extends Result<T>> extends OafEntity<T> implements Serializable { public abstract class Result extends OafEntity implements Serializable {
private List<Author> author; private List<Author> author;
@ -53,188 +53,167 @@ public abstract class Result<T extends Result<T>> extends OafEntity<T> implement
return author; return author;
} }
public T setAuthor(List<Author> author) { public void setAuthor(List<Author> author) {
this.author = author; this.author = author;
return self();
} }
public Qualifier getResulttype() { public Qualifier getResulttype() {
return resulttype; return resulttype;
} }
public T setResulttype(Qualifier resulttype) { public void setResulttype(Qualifier resulttype) {
this.resulttype = resulttype; this.resulttype = resulttype;
return self();
} }
public Qualifier getLanguage() { public Qualifier getLanguage() {
return language; return language;
} }
public T setLanguage(Qualifier language) { public void setLanguage(Qualifier language) {
this.language = language; this.language = language;
return self();
} }
public List<Qualifier> getCountry() { public List<Qualifier> getCountry() {
return country; return country;
} }
public T setCountry(List<Qualifier> country) { public void setCountry(List<Qualifier> country) {
this.country = country; this.country = country;
return self();
} }
public List<StructuredProperty> getSubject() { public List<StructuredProperty> getSubject() {
return subject; return subject;
} }
public T setSubject(List<StructuredProperty> subject) { public void setSubject(List<StructuredProperty> subject) {
this.subject = subject; this.subject = subject;
return self();
} }
public List<StructuredProperty> getTitle() { public List<StructuredProperty> getTitle() {
return title; return title;
} }
public T setTitle(List<StructuredProperty> title) { public void setTitle(List<StructuredProperty> title) {
this.title = title; this.title = title;
return self();
} }
public List<StructuredProperty> getRelevantdate() { public List<StructuredProperty> getRelevantdate() {
return relevantdate; return relevantdate;
} }
public T setRelevantdate(List<StructuredProperty> relevantdate) { public void setRelevantdate(List<StructuredProperty> relevantdate) {
this.relevantdate = relevantdate; this.relevantdate = relevantdate;
return self();
} }
public List<Field<String>> getDescription() { public List<Field<String>> getDescription() {
return description; return description;
} }
public T setDescription(List<Field<String>> description) { public void setDescription(List<Field<String>> description) {
this.description = description; this.description = description;
return self();
} }
public Field<String> getDateofacceptance() { public Field<String> getDateofacceptance() {
return dateofacceptance; return dateofacceptance;
} }
public T setDateofacceptance(Field<String> dateofacceptance) { public void setDateofacceptance(Field<String> dateofacceptance) {
this.dateofacceptance = dateofacceptance; this.dateofacceptance = dateofacceptance;
return self();
} }
public Field<String> getPublisher() { public Field<String> getPublisher() {
return publisher; return publisher;
} }
public T setPublisher(Field<String> publisher) { public void setPublisher(Field<String> publisher) {
this.publisher = publisher; this.publisher = publisher;
return self();
} }
public Field<String> getEmbargoenddate() { public Field<String> getEmbargoenddate() {
return embargoenddate; return embargoenddate;
} }
public T setEmbargoenddate(Field<String> embargoenddate) { public void setEmbargoenddate(Field<String> embargoenddate) {
this.embargoenddate = embargoenddate; this.embargoenddate = embargoenddate;
return self();
} }
public List<Field<String>> getSource() { public List<Field<String>> getSource() {
return source; return source;
} }
public T setSource(List<Field<String>> source) { public void setSource(List<Field<String>> source) {
this.source = source; this.source = source;
return self();
} }
public List<Field<String>> getFulltext() { public List<Field<String>> getFulltext() {
return fulltext; return fulltext;
} }
public T setFulltext(List<Field<String>> fulltext) { public void setFulltext(List<Field<String>> fulltext) {
this.fulltext = fulltext; this.fulltext = fulltext;
return self();
} }
public List<Field<String>> getFormat() { public List<Field<String>> getFormat() {
return format; return format;
} }
public T setFormat(List<Field<String>> format) { public void setFormat(List<Field<String>> format) {
this.format = format; this.format = format;
return self();
} }
public List<Field<String>> getContributor() { public List<Field<String>> getContributor() {
return contributor; return contributor;
} }
public T setContributor(List<Field<String>> contributor) { public void setContributor(List<Field<String>> contributor) {
this.contributor = contributor; this.contributor = contributor;
return self();
} }
public Qualifier getResourcetype() { public Qualifier getResourcetype() {
return resourcetype; return resourcetype;
} }
public T setResourcetype(Qualifier resourcetype) { public void setResourcetype(Qualifier resourcetype) {
this.resourcetype = resourcetype; this.resourcetype = resourcetype;
return self();
} }
public List<Field<String>> getCoverage() { public List<Field<String>> getCoverage() {
return coverage; return coverage;
} }
public T setCoverage(List<Field<String>> coverage) { public void setCoverage(List<Field<String>> coverage) {
this.coverage = coverage; this.coverage = coverage;
return self();
} }
public Field<String> getRefereed() { public Field<String> getRefereed() {
return refereed; return refereed;
} }
public T setRefereed(Field<String> refereed) { public void setRefereed(Field<String> refereed) {
this.refereed = refereed; this.refereed = refereed;
return self();
} }
public List<Context> getContext() { public List<Context> getContext() {
return context; return context;
} }
public T setContext(List<Context> context) { public void setContext(List<Context> context) {
this.context = context; this.context = context;
return self();
} }
public List<ExternalReference> getExternalReference() { public List<ExternalReference> getExternalReference() {
return externalReference; return externalReference;
} }
public T setExternalReference(List<ExternalReference> externalReference) { public void setExternalReference(List<ExternalReference> externalReference) {
this.externalReference = externalReference; this.externalReference = externalReference;
return self();
} }
public List<Instance> getInstance() { public List<Instance> getInstance() {
return instance; return instance;
} }
public T setInstance(List<Instance> instance) { public void setInstance(List<Instance> instance) {
this.instance = instance; this.instance = instance;
return self();
} }
} }

View File

@ -3,7 +3,7 @@ package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
public class Software extends Result<Software> implements Serializable { public class Software extends Result implements Serializable {
private List<Field<String>> documentationUrl; private List<Field<String>> documentationUrl;
@ -17,40 +17,31 @@ public class Software extends Result<Software> implements Serializable {
return documentationUrl; return documentationUrl;
} }
public Software setDocumentationUrl(List<Field<String>> documentationUrl) { public void setDocumentationUrl(List<Field<String>> documentationUrl) {
this.documentationUrl = documentationUrl; this.documentationUrl = documentationUrl;
return this;
} }
public List<StructuredProperty> getLicense() { public List<StructuredProperty> getLicense() {
return license; return license;
} }
public Software setLicense(List<StructuredProperty> license) { public void setLicense(List<StructuredProperty> license) {
this.license = license; this.license = license;
return this;
} }
public Field<String> getCodeRepositoryUrl() { public Field<String> getCodeRepositoryUrl() {
return codeRepositoryUrl; return codeRepositoryUrl;
} }
public Software setCodeRepositoryUrl(Field<String> codeRepositoryUrl) { public void setCodeRepositoryUrl(Field<String> codeRepositoryUrl) {
this.codeRepositoryUrl = codeRepositoryUrl; this.codeRepositoryUrl = codeRepositoryUrl;
return this;
} }
public Qualifier getProgrammingLanguage() { public Qualifier getProgrammingLanguage() {
return programmingLanguage; return programmingLanguage;
} }
public Software setProgrammingLanguage(Qualifier programmingLanguage) { public void setProgrammingLanguage(Qualifier programmingLanguage) {
this.programmingLanguage = programmingLanguage; this.programmingLanguage = programmingLanguage;
return this;
}
@Override
protected Software self() {
return this;
} }
} }

View File

@ -14,26 +14,23 @@ public class StructuredProperty implements Serializable {
return value; return value;
} }
public StructuredProperty setValue(String value) { public void setValue(String value) {
this.value = value; this.value = value;
return this;
} }
public Qualifier getQualifier() { public Qualifier getQualifier() {
return qualifier; return qualifier;
} }
public StructuredProperty setQualifier(Qualifier qualifier) { public void setQualifier(Qualifier qualifier) {
this.qualifier = qualifier; this.qualifier = qualifier;
return this;
} }
public DataInfo getDataInfo() { public DataInfo getDataInfo() {
return dataInfo; return dataInfo;
} }
public StructuredProperty setDataInfo(DataInfo dataInfo) { public void setDataInfo(DataInfo dataInfo) {
this.dataInfo = dataInfo; this.dataInfo = dataInfo;
return this;
} }
} }

View File

@ -20,7 +20,7 @@ public class ProtoConverter implements Serializable {
return convertRelation(oaf); return convertRelation(oaf);
} }
} catch (Throwable e) { } catch (Throwable e) {
throw new RuntimeException(e); throw new RuntimeException("error on getting " + s, e);
} }
} }
@ -29,16 +29,16 @@ public class ProtoConverter implements Serializable {
final Relation rel = new Relation(); final Relation rel = new Relation();
rel.setDataInfo(mapDataInfo(oaf.getDataInfo())); rel.setDataInfo(mapDataInfo(oaf.getDataInfo()));
rel.setLastupdatetimestamp(oaf.getLastupdatetimestamp()); rel.setLastupdatetimestamp(oaf.getLastupdatetimestamp());
return rel rel.setSource(r.getSource());
.setSource(r.getSource()) rel.setTarget(r.getTarget());
.setTarget(r.getTarget()) rel.setRelType(r.getRelType().toString());
.setRelType(r.getRelType().toString()) rel.setSubRelType(r.getSubRelType().toString());
.setSubRelType(r.getSubRelType().toString()) rel.setRelClass(r.getRelClass());
.setRelClass(r.getRelClass()) rel.setCollectedFrom(r.getCollectedfromCount() > 0 ?
.setCollectedFrom(r.getCollectedfromCount() > 0 ?
r.getCollectedfromList().stream() r.getCollectedfromList().stream()
.map(kv -> mapKV(kv)) .map(kv -> mapKV(kv))
.collect(Collectors.toList()) : null); .collect(Collectors.toList()) : null);
return rel;
} }
private static OafEntity convertEntity(OafProtos.Oaf oaf) { private static OafEntity convertEntity(OafProtos.Oaf oaf) {
@ -60,119 +60,125 @@ public class ProtoConverter implements Serializable {
private static Organization convertOrganization(OafProtos.Oaf oaf) { private static Organization convertOrganization(OafProtos.Oaf oaf) {
final OrganizationProtos.Organization.Metadata m = oaf.getEntity().getOrganization().getMetadata(); final OrganizationProtos.Organization.Metadata m = oaf.getEntity().getOrganization().getMetadata();
final Organization org = setOaf(new Organization(), oaf); final Organization org = setOaf(new Organization(), oaf);
return setEntity(org, oaf) setEntity(org, oaf);
.setLegalshortname(mapStringField(m.getLegalshortname())) org.setLegalshortname(mapStringField(m.getLegalshortname()));
.setLegalname(mapStringField(m.getLegalname())) org.setLegalname(mapStringField(m.getLegalname()));
.setAlternativeNames(m.getAlternativeNamesList(). org.setAlternativeNames(m.getAlternativeNamesList().
stream() stream()
.map(ProtoUtils::mapStringField) .map(ProtoUtils::mapStringField)
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setWebsiteurl(mapStringField(m.getWebsiteurl())) org.setWebsiteurl(mapStringField(m.getWebsiteurl()));
.setLogourl(mapStringField(m.getLogourl())) org.setLogourl(mapStringField(m.getLogourl()));
.setEclegalbody(mapStringField(m.getEclegalbody())) org.setEclegalbody(mapStringField(m.getEclegalbody()));
.setEclegalperson(mapStringField(m.getEclegalperson())) org.setEclegalperson(mapStringField(m.getEclegalperson()));
.setEcnonprofit(mapStringField(m.getEcnonprofit())) org.setEcnonprofit(mapStringField(m.getEcnonprofit()));
.setEcresearchorganization(mapStringField(m.getEcresearchorganization())) org.setEcresearchorganization(mapStringField(m.getEcresearchorganization()));
.setEchighereducation(mapStringField(m.getEchighereducation())) org.setEchighereducation(mapStringField(m.getEchighereducation()));
.setEcinternationalorganizationeurinterests(mapStringField(m.getEcinternationalorganizationeurinterests())) org.setEcinternationalorganizationeurinterests(mapStringField(m.getEcinternationalorganizationeurinterests()));
.setEcinternationalorganization(mapStringField(m.getEcinternationalorganization())) org.setEcinternationalorganization(mapStringField(m.getEcinternationalorganization()));
.setEcenterprise(mapStringField(m.getEcenterprise())) org.setEcenterprise(mapStringField(m.getEcenterprise()));
.setEcsmevalidated(mapStringField(m.getEcsmevalidated())) org.setEcsmevalidated(mapStringField(m.getEcsmevalidated()));
.setEcnutscode(mapStringField(m.getEcnutscode())) org.setEcnutscode(mapStringField(m.getEcnutscode()));
.setCountry(mapQualifier(m.getCountry())); org.setCountry(mapQualifier(m.getCountry()));
return org;
} }
private static Datasource convertDataSource(OafProtos.Oaf oaf) { private static Datasource convertDataSource(OafProtos.Oaf oaf) {
final DatasourceProtos.Datasource.Metadata m = oaf.getEntity().getDatasource().getMetadata(); final DatasourceProtos.Datasource.Metadata m = oaf.getEntity().getDatasource().getMetadata();
final Datasource datasource = setOaf(new Datasource(), oaf); final Datasource datasource = setOaf(new Datasource(), oaf);
return setEntity(datasource, oaf) setEntity(datasource, oaf);
.setAccessinfopackage(m.getAccessinfopackageList() datasource.setAccessinfopackage(m.getAccessinfopackageList()
.stream() .stream()
.map(ProtoUtils::mapStringField) .map(ProtoUtils::mapStringField)
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setCertificates(mapStringField(m.getCertificates())) datasource.setCertificates(mapStringField(m.getCertificates()));
.setCitationguidelineurl(mapStringField(m.getCitationguidelineurl())) datasource.setCitationguidelineurl(mapStringField(m.getCitationguidelineurl()));
.setContactemail(mapStringField(m.getContactemail())) datasource.setContactemail(mapStringField(m.getContactemail()));
.setDatabaseaccessrestriction(mapStringField(m.getDatabaseaccessrestriction())) datasource.setDatabaseaccessrestriction(mapStringField(m.getDatabaseaccessrestriction()));
.setDatabaseaccesstype(mapStringField(m.getDatabaseaccesstype())) datasource.setDatabaseaccesstype(mapStringField(m.getDatabaseaccesstype()));
.setDataprovider(mapBoolField(m.getDataprovider())) datasource.setDataprovider(mapBoolField(m.getDataprovider()));
.setDatasourcetype(mapQualifier(m.getDatasourcetype())) datasource.setDatasourcetype(mapQualifier(m.getDatasourcetype()));
.setDatauploadrestriction(mapStringField(m.getDatauploadrestriction())) datasource.setDatauploadrestriction(mapStringField(m.getDatauploadrestriction()));
.setCitationguidelineurl(mapStringField(m.getCitationguidelineurl())) datasource.setCitationguidelineurl(mapStringField(m.getCitationguidelineurl()));
.setDatauploadtype(mapStringField(m.getDatauploadtype())) datasource.setDatauploadtype(mapStringField(m.getDatauploadtype()));
.setDateofvalidation(mapStringField(m.getDateofvalidation())) datasource.setDateofvalidation(mapStringField(m.getDateofvalidation()));
.setDescription(mapStringField(m.getDescription())) datasource.setDescription(mapStringField(m.getDescription()));
.setEnglishname(mapStringField(m.getEnglishname())) datasource.setEnglishname(mapStringField(m.getEnglishname()));
.setLatitude(mapStringField(m.getLatitude())) datasource.setLatitude(mapStringField(m.getLatitude()));
.setLongitude(mapStringField(m.getLongitude())) datasource.setLongitude(mapStringField(m.getLongitude()));
.setLogourl(mapStringField(m.getLogourl())) datasource.setLogourl(mapStringField(m.getLogourl()));
.setMissionstatementurl(mapStringField(m.getMissionstatementurl())) datasource.setMissionstatementurl(mapStringField(m.getMissionstatementurl()));
.setNamespaceprefix(mapStringField(m.getNamespaceprefix())) datasource.setNamespaceprefix(mapStringField(m.getNamespaceprefix()));
.setOdcontenttypes(m.getOdcontenttypesList() datasource.setOdcontenttypes(m.getOdcontenttypesList()
.stream() .stream()
.map(ProtoUtils::mapStringField) .map(ProtoUtils::mapStringField)
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setOdlanguages(m.getOdlanguagesList() datasource.setOdlanguages(m.getOdlanguagesList()
.stream() .stream()
.map(ProtoUtils::mapStringField) .map(ProtoUtils::mapStringField)
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setOdnumberofitems(mapStringField(m.getOdnumberofitems())) datasource.setOdnumberofitems(mapStringField(m.getOdnumberofitems()));
.setOdnumberofitemsdate(mapStringField(m.getOdnumberofitemsdate())) datasource.setOdnumberofitemsdate(mapStringField(m.getOdnumberofitemsdate()));
.setOdpolicies(mapStringField(m.getOdpolicies())) datasource.setOdpolicies(mapStringField(m.getOdpolicies()));
.setOfficialname(mapStringField(m.getOfficialname())) datasource.setOfficialname(mapStringField(m.getOfficialname()));
.setOpenairecompatibility(mapQualifier(m.getOpenairecompatibility())) datasource.setOpenairecompatibility(mapQualifier(m.getOpenairecompatibility()));
.setPidsystems(mapStringField(m.getPidsystems())) datasource.setPidsystems(mapStringField(m.getPidsystems()));
.setPolicies(m.getPoliciesList() datasource.setPolicies(m.getPoliciesList()
.stream() .stream()
.map(ProtoUtils::mapKV) .map(ProtoUtils::mapKV)
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setQualitymanagementkind(mapStringField(m.getQualitymanagementkind())) datasource.setQualitymanagementkind(mapStringField(m.getQualitymanagementkind()));
.setReleaseenddate(mapStringField(m.getReleaseenddate())) datasource.setReleaseenddate(mapStringField(m.getReleaseenddate()));
.setServiceprovider(mapBoolField(m.getServiceprovider())) datasource.setServiceprovider(mapBoolField(m.getServiceprovider()));
.setReleasestartdate(mapStringField(m.getReleasestartdate())) datasource.setReleasestartdate(mapStringField(m.getReleasestartdate()));
.setSubjects(m.getSubjectsList() datasource.setSubjects(m.getSubjectsList()
.stream() .stream()
.map(ProtoUtils::mapStructuredProperty) .map(ProtoUtils::mapStructuredProperty)
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setVersioning(mapBoolField(m.getVersioning())) datasource.setVersioning(mapBoolField(m.getVersioning()));
.setWebsiteurl(mapStringField(m.getWebsiteurl())) datasource.setWebsiteurl(mapStringField(m.getWebsiteurl()));
.setJournal(mapJournal(m.getJournal())); datasource.setJournal(mapJournal(m.getJournal()));
return datasource;
} }
private static Project convertProject(OafProtos.Oaf oaf) { private static Project convertProject(OafProtos.Oaf oaf) {
final ProjectProtos.Project.Metadata m = oaf.getEntity().getProject().getMetadata(); final ProjectProtos.Project.Metadata m = oaf.getEntity().getProject().getMetadata();
final Project project = setOaf(new Project(), oaf); final Project project = setOaf(new Project(), oaf);
return setEntity(project, oaf) setEntity(project, oaf);
.setAcronym(mapStringField(m.getAcronym())) project.setAcronym(mapStringField(m.getAcronym()));
.setCallidentifier(mapStringField(m.getCallidentifier())) project.setCallidentifier(mapStringField(m.getCallidentifier()));
.setCode(mapStringField(m.getCode())) project.setCode(mapStringField(m.getCode()));
.setContactemail(mapStringField(m.getContactemail())) project.setContactemail(mapStringField(m.getContactemail()));
.setContactfax(mapStringField(m.getContactfax())) project.setContactfax(mapStringField(m.getContactfax()));
.setContactfullname(mapStringField(m.getContactfullname())) project.setContactfullname(mapStringField(m.getContactfullname()));
.setContactphone(mapStringField(m.getContactphone())) project.setContactphone(mapStringField(m.getContactphone()));
.setContracttype(mapQualifier(m.getContracttype())) project.setContracttype(mapQualifier(m.getContracttype()));
.setCurrency(mapStringField(m.getCurrency())) project.setCurrency(mapStringField(m.getCurrency()));
.setDuration(mapStringField(m.getDuration())) project.setDuration(mapStringField(m.getDuration()));
.setEcarticle29_3(mapStringField(m.getEcarticle293())) project.setEcarticle29_3(mapStringField(m.getEcarticle293()));
.setEcsc39(mapStringField(m.getEcsc39())) project.setEcsc39(mapStringField(m.getEcsc39()));
.setOamandatepublications(mapStringField(m.getOamandatepublications())) project.setOamandatepublications(mapStringField(m.getOamandatepublications()));
.setStartdate(mapStringField(m.getStartdate())) project.setStartdate(mapStringField(m.getStartdate()));
.setEnddate(mapStringField(m.getEnddate())) project.setEnddate(mapStringField(m.getEnddate()));
.setFundedamount(m.getFundedamount()) project.setFundedamount(m.getFundedamount());
.setTotalcost(m.getTotalcost()) project.setTotalcost(m.getTotalcost());
.setKeywords(mapStringField(m.getKeywords())) project.setKeywords(mapStringField(m.getKeywords()));
.setSubjects(m.getSubjectsList().stream() project.setSubjects(m.getSubjectsList().stream()
.map(sp -> mapStructuredProperty(sp)) .map(sp -> mapStructuredProperty(sp))
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setTitle(mapStringField(m.getTitle())) project.setTitle(mapStringField(m.getTitle()));
.setWebsiteurl(mapStringField(m.getWebsiteurl())) project.setWebsiteurl(mapStringField(m.getWebsiteurl()));
.setFundingtree(m.getFundingtreeList().stream() project.setFundingtree(m.getFundingtreeList().stream()
.map(f -> mapStringField(f)) .map(f -> mapStringField(f))
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setJsonextrainfo(mapStringField(m.getJsonextrainfo())) project.setJsonextrainfo(mapStringField(m.getJsonextrainfo()));
.setSummary(mapStringField(m.getSummary())) project.setSummary(mapStringField(m.getSummary()));
.setOptional1(mapStringField(m.getOptional1())) project.setOptional1(mapStringField(m.getOptional1()));
.setOptional2(mapStringField(m.getOptional2())); project.setOptional2(mapStringField(m.getOptional2()));
return project;
} }
private static Result convertResult(OafProtos.Oaf oaf) { private static Result convertResult(OafProtos.Oaf oaf) {
@ -195,37 +201,40 @@ public class ProtoConverter implements Serializable {
ResultProtos.Result.Metadata m = oaf.getEntity().getResult().getMetadata(); ResultProtos.Result.Metadata m = oaf.getEntity().getResult().getMetadata();
Software software = setOaf(new Software(), oaf); Software software = setOaf(new Software(), oaf);
setEntity(software, oaf); setEntity(software, oaf);
return setResult(software, oaf) setResult(software, oaf);
.setDocumentationUrl(m.getDocumentationUrlList()
software.setDocumentationUrl(m.getDocumentationUrlList()
.stream() .stream()
.map(ProtoUtils::mapStringField) .map(ProtoUtils::mapStringField)
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setLicense(m.getLicenseList() software.setLicense(m.getLicenseList()
.stream() .stream()
.map(ProtoUtils::mapStructuredProperty) .map(ProtoUtils::mapStructuredProperty)
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setCodeRepositoryUrl(ProtoUtils.mapStringField(m.getCodeRepositoryUrl())) software.setCodeRepositoryUrl(ProtoUtils.mapStringField(m.getCodeRepositoryUrl()));
.setProgrammingLanguage(ProtoUtils.mapQualifier(m.getProgrammingLanguage())); software.setProgrammingLanguage(ProtoUtils.mapQualifier(m.getProgrammingLanguage()));
return software;
} }
private static OtherResearchProducts createORP(OafProtos.Oaf oaf) { private static OtherResearchProducts createORP(OafProtos.Oaf oaf) {
ResultProtos.Result.Metadata m = oaf.getEntity().getResult().getMetadata(); ResultProtos.Result.Metadata m = oaf.getEntity().getResult().getMetadata();
OtherResearchProducts otherResearchProducts = setOaf(new OtherResearchProducts(), oaf); OtherResearchProducts otherResearchProducts = setOaf(new OtherResearchProducts(), oaf);
setEntity(otherResearchProducts, oaf); setEntity(otherResearchProducts, oaf);
return setResult(otherResearchProducts, oaf) setResult(otherResearchProducts, oaf);
.setContactperson(m.getContactpersonList() otherResearchProducts.setContactperson(m.getContactpersonList()
.stream()
.map(ProtoUtils::mapStringField)
.collect(Collectors.toList()))
.setContactgroup(m.getContactgroupList()
.stream()
.map(ProtoUtils::mapStringField)
.collect(Collectors.toList()))
.setTool(m.getToolList()
.stream() .stream()
.map(ProtoUtils::mapStringField) .map(ProtoUtils::mapStringField)
.collect(Collectors.toList())); .collect(Collectors.toList()));
otherResearchProducts.setContactgroup(m.getContactgroupList()
.stream()
.map(ProtoUtils::mapStringField)
.collect(Collectors.toList()));
otherResearchProducts.setTool(m.getToolList()
.stream()
.map(ProtoUtils::mapStringField)
.collect(Collectors.toList()));
return otherResearchProducts;
} }
private static Publication createPublication(OafProtos.Oaf oaf) { private static Publication createPublication(OafProtos.Oaf oaf) {
@ -233,8 +242,9 @@ public class ProtoConverter implements Serializable {
ResultProtos.Result.Metadata m = oaf.getEntity().getResult().getMetadata(); ResultProtos.Result.Metadata m = oaf.getEntity().getResult().getMetadata();
Publication publication = setOaf(new Publication(), oaf); Publication publication = setOaf(new Publication(), oaf);
setEntity(publication, oaf); setEntity(publication, oaf);
return setResult(publication, oaf) setResult(publication, oaf);
.setJournal(mapJournal(m.getJournal())); publication.setJournal(mapJournal(m.getJournal()));
return publication;
} }
private static Dataset createDataset(OafProtos.Oaf oaf) { private static Dataset createDataset(OafProtos.Oaf oaf) {
@ -242,16 +252,18 @@ public class ProtoConverter implements Serializable {
ResultProtos.Result.Metadata m = oaf.getEntity().getResult().getMetadata(); ResultProtos.Result.Metadata m = oaf.getEntity().getResult().getMetadata();
Dataset dataset = setOaf(new Dataset(), oaf); Dataset dataset = setOaf(new Dataset(), oaf);
setEntity(dataset, oaf); setEntity(dataset, oaf);
return setResult(dataset, oaf) setResult(dataset, oaf);
.setStoragedate(ProtoUtils.mapStringField(m.getStoragedate())) dataset.setStoragedate(ProtoUtils.mapStringField(m.getStoragedate()));
.setDevice(ProtoUtils.mapStringField(m.getDevice())) dataset.setDevice(ProtoUtils.mapStringField(m.getDevice()));
.setSize(ProtoUtils.mapStringField(m.getSize())) dataset.setSize(ProtoUtils.mapStringField(m.getSize()));
.setVersion(ProtoUtils.mapStringField(m.getVersion())) dataset.setVersion(ProtoUtils.mapStringField(m.getVersion()));
.setLastmetadataupdate(ProtoUtils.mapStringField(m.getLastmetadataupdate())) dataset.setLastmetadataupdate(ProtoUtils.mapStringField(m.getLastmetadataupdate()));
.setMetadataversionnumber(ProtoUtils.mapStringField(m.getMetadataversionnumber())) dataset.setMetadataversionnumber(ProtoUtils.mapStringField(m.getMetadataversionnumber()));
.setGeolocation(m.getGeolocationList() dataset.setGeolocation(m.getGeolocationList()
.stream() .stream()
.map(ProtoUtils::mapGeolocation) .map(ProtoUtils::mapGeolocation)
.collect(Collectors.toList())); .collect(Collectors.toList()));
return dataset;
} }
} }

View File

@ -17,26 +17,26 @@ public class ProtoUtils {
} }
public static <T extends Oaf> T setOaf(T oaf, OafProtos.Oaf o) { public static <T extends Oaf> T setOaf(T oaf, OafProtos.Oaf o) {
oaf.setDataInfo(mapDataInfo(o.getDataInfo())).setLastupdatetimestamp(o.getLastupdatetimestamp()); oaf.setDataInfo(mapDataInfo(o.getDataInfo()));
oaf.setLastupdatetimestamp(o.getLastupdatetimestamp());
return oaf; return oaf;
} }
public static <T extends OafEntity> T setEntity(T entity, OafProtos.Oaf oaf) { public static <T extends OafEntity> T setEntity(T entity, OafProtos.Oaf oaf) {
//setting Entity fields //setting Entity fields
final OafProtos.OafEntity e = oaf.getEntity(); final OafProtos.OafEntity e = oaf.getEntity();
entity entity.setId(e.getId());
.setId(e.getId()) entity.setOriginalId(e.getOriginalIdList());
.setOriginalId(e.getOriginalIdList()) entity.setCollectedfrom(e.getCollectedfromList()
.setCollectedfrom(e.getCollectedfromList()
.stream() .stream()
.map(ProtoUtils::mapKV) .map(ProtoUtils::mapKV)
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setPid(e.getPidList().stream() entity.setPid(e.getPidList().stream()
.map(ProtoUtils::mapStructuredProperty) .map(ProtoUtils::mapStructuredProperty)
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setDateofcollection(entity.getDateofcollection()) entity.setDateofcollection(entity.getDateofcollection());
.setDateoftransformation(entity.getDateoftransformation()) entity.setDateoftransformation(entity.getDateoftransformation());
.setExtraInfo(e.getExtraInfoList() entity.setExtraInfo(e.getExtraInfoList()
.stream() .stream()
.map(ProtoUtils::mapExtraInfo) .map(ProtoUtils::mapExtraInfo)
.collect(Collectors.toList())); .collect(Collectors.toList()));
@ -46,59 +46,58 @@ public class ProtoUtils {
public static <T extends Result> T setResult(T entity, OafProtos.Oaf oaf) { public static <T extends Result> T setResult(T entity, OafProtos.Oaf oaf) {
//setting Entity fields //setting Entity fields
final ResultProtos.Result.Metadata m = oaf.getEntity().getResult().getMetadata(); final ResultProtos.Result.Metadata m = oaf.getEntity().getResult().getMetadata();
entity entity.setAuthor(m.getAuthorList()
.setAuthor(m.getAuthorList()
.stream() .stream()
.map(ProtoUtils::mapAuthor) .map(ProtoUtils::mapAuthor)
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setResulttype(mapQualifier(m.getResulttype())) entity.setResulttype(mapQualifier(m.getResulttype()));
.setLanguage(ProtoUtils.mapQualifier(m.getLanguage())) entity.setLanguage(ProtoUtils.mapQualifier(m.getLanguage()));
.setCountry(m.getCountryList() entity.setCountry(m.getCountryList()
.stream() .stream()
.map(ProtoUtils::mapQualifier) .map(ProtoUtils::mapQualifier)
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setSubject(m.getSubjectList() entity.setSubject(m.getSubjectList()
.stream() .stream()
.map(ProtoUtils::mapStructuredProperty) .map(ProtoUtils::mapStructuredProperty)
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setTitle(m.getTitleList() entity.setTitle(m.getTitleList()
.stream() .stream()
.map(ProtoUtils::mapStructuredProperty) .map(ProtoUtils::mapStructuredProperty)
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setRelevantdate(m.getRelevantdateList() entity.setRelevantdate(m.getRelevantdateList()
.stream() .stream()
.map(ProtoUtils::mapStructuredProperty) .map(ProtoUtils::mapStructuredProperty)
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setDescription(m.getDescriptionList() entity.setDescription(m.getDescriptionList()
.stream() .stream()
.map(ProtoUtils::mapStringField) .map(ProtoUtils::mapStringField)
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setDateofacceptance(ProtoUtils.mapStringField(m.getDateofacceptance())) entity.setDateofacceptance(ProtoUtils.mapStringField(m.getDateofacceptance()));
.setPublisher(ProtoUtils.mapStringField(m.getPublisher())) entity.setPublisher(ProtoUtils.mapStringField(m.getPublisher()));
.setEmbargoenddate(ProtoUtils.mapStringField(m.getEmbargoenddate())) entity.setEmbargoenddate(ProtoUtils.mapStringField(m.getEmbargoenddate()));
.setSource(m.getSourceList() entity.setSource(m.getSourceList()
.stream() .stream()
.map(ProtoUtils::mapStringField) .map(ProtoUtils::mapStringField)
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setFulltext(m.getFulltextList() entity.setFulltext(m.getFulltextList()
.stream() .stream()
.map(ProtoUtils::mapStringField) .map(ProtoUtils::mapStringField)
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setFormat(m.getFormatList() entity.setFormat(m.getFormatList()
.stream() .stream()
.map(ProtoUtils::mapStringField) .map(ProtoUtils::mapStringField)
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setContributor(m.getContributorList() entity.setContributor(m.getContributorList()
.stream() .stream()
.map(ProtoUtils::mapStringField) .map(ProtoUtils::mapStringField)
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setResourcetype(ProtoUtils.mapQualifier(m.getResourcetype())) entity.setResourcetype(ProtoUtils.mapQualifier(m.getResourcetype()));
.setCoverage(m.getCoverageList() entity.setCoverage(m.getCoverageList()
.stream() .stream()
.map(ProtoUtils::mapStringField) .map(ProtoUtils::mapStringField)
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setRefereed(mapStringField(m.getRefereed())) entity.setRefereed(mapStringField(m.getRefereed()));
.setContext(m.getContextList() entity.setContext(m.getContextList()
.stream() .stream()
.map(ProtoUtils::mapContext) .map(ProtoUtils::mapContext)
.collect(Collectors.toList())); .collect(Collectors.toList()));
@ -108,129 +107,140 @@ public class ProtoUtils {
private static Context mapContext(ResultProtos.Result.Context context) { private static Context mapContext(ResultProtos.Result.Context context) {
return new Context() final Context entity = new Context();
.setId(context.getId()) entity.setId(context.getId());
.setDataInfo(context.getDataInfoList() entity.setDataInfo(context.getDataInfoList()
.stream() .stream()
.map(ProtoUtils::mapDataInfo) .map(ProtoUtils::mapDataInfo)
.collect(Collectors.toList())); .collect(Collectors.toList()));
return entity;
} }
public static KeyValue mapKV(FieldTypeProtos.KeyValue kv) { public static KeyValue mapKV(FieldTypeProtos.KeyValue kv) {
return new KeyValue() final KeyValue keyValue = new KeyValue();
.setKey(kv.getKey()) keyValue.setKey(kv.getKey());
.setValue(kv.getValue()) keyValue.setValue(kv.getValue());
.setDataInfo(mapDataInfo(kv.getDataInfo())); keyValue.setDataInfo(mapDataInfo(kv.getDataInfo()));
return keyValue;
} }
public static DataInfo mapDataInfo(FieldTypeProtos.DataInfo d) { public static DataInfo mapDataInfo(FieldTypeProtos.DataInfo d) {
return new DataInfo() final DataInfo dataInfo = new DataInfo();
.setDeletedbyinference(d.getDeletedbyinference()) dataInfo.setDeletedbyinference(d.getDeletedbyinference());
.setInferenceprovenance(d.getInferenceprovenance()) dataInfo.setInferenceprovenance(d.getInferenceprovenance());
.setInferred(d.getInferred()) dataInfo.setInferred(d.getInferred());
.setInvisible(d.getInvisible()) dataInfo.setInvisible(d.getInvisible());
.setProvenanceaction(mapQualifier(d.getProvenanceaction())); dataInfo.setProvenanceaction(mapQualifier(d.getProvenanceaction()));
return dataInfo;
} }
public static Qualifier mapQualifier(FieldTypeProtos.Qualifier q) { public static Qualifier mapQualifier(FieldTypeProtos.Qualifier q) {
return new Qualifier() final Qualifier qualifier = new Qualifier();
.setClassid(q.getClassid()) qualifier.setClassid(q.getClassid());
.setClassname(q.getClassname()) qualifier.setClassname(q.getClassname());
.setSchemeid(q.getSchemeid()) qualifier.setSchemeid(q.getSchemeid());
.setSchemename(q.getSchemename()); qualifier.setSchemename(q.getSchemename());
//.setDataInfo(q.hasDataInfo() ? mapDataInfo(q.getDataInfo()) : null); return qualifier;
} }
public static StructuredProperty mapStructuredProperty(FieldTypeProtos.StructuredProperty sp) { public static StructuredProperty mapStructuredProperty(FieldTypeProtos.StructuredProperty sp) {
return new StructuredProperty() final StructuredProperty structuredProperty = new StructuredProperty();
.setValue(sp.getValue()) structuredProperty.setValue(sp.getValue());
.setQualifier(mapQualifier(sp.getQualifier())) structuredProperty.setQualifier(mapQualifier(sp.getQualifier()));
.setDataInfo(sp.hasDataInfo() ? mapDataInfo(sp.getDataInfo()) : null); structuredProperty.setDataInfo(mapDataInfo(sp.getDataInfo()));
return structuredProperty;
} }
public static ExtraInfo mapExtraInfo(FieldTypeProtos.ExtraInfo extraInfo) { public static ExtraInfo mapExtraInfo(FieldTypeProtos.ExtraInfo extraInfo) {
return new ExtraInfo() final ExtraInfo entity = new ExtraInfo();
.setName(extraInfo.getName()) entity.setName(extraInfo.getName());
.setTypology(extraInfo.getTypology()) entity.setTypology(extraInfo.getTypology());
.setProvenance(extraInfo.getProvenance()) entity.setProvenance(extraInfo.getProvenance());
.setTrust(extraInfo.getTrust()) entity.setTrust(extraInfo.getTrust());
.setValue(extraInfo.getValue()); entity.setValue(extraInfo.getValue());
return entity;
} }
public static OAIProvenance mapOAIProvenance(FieldTypeProtos.OAIProvenance oaiProvenance) { public static OAIProvenance mapOAIProvenance(FieldTypeProtos.OAIProvenance oaiProvenance) {
return new OAIProvenance().setOriginDescription(mapOriginalDescription(oaiProvenance.getOriginDescription())); final OAIProvenance entity = new OAIProvenance();
entity.setOriginDescription(mapOriginalDescription(oaiProvenance.getOriginDescription()));
return entity;
} }
public static OriginDescription mapOriginalDescription(FieldTypeProtos.OAIProvenance.OriginDescription originDescription) { public static OriginDescription mapOriginalDescription(FieldTypeProtos.OAIProvenance.OriginDescription originDescription) {
final OriginDescription originDescriptionResult = new OriginDescription() final OriginDescription originDescriptionResult = new OriginDescription();
.setHarvestDate(originDescription.getHarvestDate()) originDescriptionResult.setHarvestDate(originDescription.getHarvestDate());
.setAltered(originDescription.getAltered()) originDescriptionResult.setAltered(originDescription.getAltered());
.setBaseURL(originDescription.getBaseURL()) originDescriptionResult.setBaseURL(originDescription.getBaseURL());
.setIdentifier(originDescription.getIdentifier()) originDescriptionResult.setIdentifier(originDescription.getIdentifier());
.setDatestamp(originDescription.getDatestamp()) originDescriptionResult.setDatestamp(originDescription.getDatestamp());
.setMetadataNamespace(originDescription.getMetadataNamespace()); originDescriptionResult.setMetadataNamespace(originDescription.getMetadataNamespace());
// if (originDescription.hasOriginDescription())
// originDescriptionResult.setOriginDescription(mapOriginalDescription(originDescription.getOriginDescription()));
return originDescriptionResult; return originDescriptionResult;
} }
public static Field<String> mapStringField(FieldTypeProtos.StringField s) { public static Field<String> mapStringField(FieldTypeProtos.StringField s) {
return new Field<String>() final Field<String> stringField = new Field<>();
.setValue(s.getValue()) stringField.setValue(s.getValue());
.setDataInfo(s.hasDataInfo() ? mapDataInfo(s.getDataInfo()) : null); stringField.setDataInfo(mapDataInfo(s.getDataInfo()));
return stringField;
} }
public static Field<Boolean> mapBoolField(FieldTypeProtos.BoolField b) { public static Field<Boolean> mapBoolField(FieldTypeProtos.BoolField b) {
return new Field<Boolean>() final Field<Boolean> booleanField = new Field<>();
.setValue(b.getValue()) booleanField.setValue(b.getValue());
.setDataInfo(b.hasDataInfo() ? mapDataInfo(b.getDataInfo()) : null); booleanField.setDataInfo(mapDataInfo(b.getDataInfo()));
return booleanField;
} }
public static Field<Integer> mapIntField(FieldTypeProtos.IntField b) { public static Field<Integer> mapIntField(FieldTypeProtos.IntField b) {
return new Field<Integer>() final Field<Integer> entity = new Field<>();
.setValue(b.getValue()) entity.setValue(b.getValue());
.setDataInfo(b.hasDataInfo() ? mapDataInfo(b.getDataInfo()) : null); entity.setDataInfo(mapDataInfo(b.getDataInfo()));
return entity;
} }
public static Journal mapJournal(FieldTypeProtos.Journal j) { public static Journal mapJournal(FieldTypeProtos.Journal j) {
return new Journal() final Journal journal = new Journal();
.setConferencedate(j.getConferencedate()) journal.setConferencedate(j.getConferencedate());
.setConferenceplace(j.getConferenceplace()) journal.setConferenceplace(j.getConferenceplace());
.setEdition(j.getEdition()) journal.setEdition(j.getEdition());
.setEp(j.getEp()) journal.setEp(j.getEp());
.setIss(j.getIss()) journal.setIss(j.getIss());
.setIssnLinking(j.getIssnLinking()) journal.setIssnLinking(j.getIssnLinking());
.setIssnOnline(j.getIssnOnline()) journal.setIssnOnline(j.getIssnOnline());
.setIssnPrinted(j.getIssnPrinted()) journal.setIssnPrinted(j.getIssnPrinted());
.setName(j.getName()) journal.setName(j.getName());
.setSp(j.getSp()) journal.setSp(j.getSp());
.setVol(j.getVol()) journal.setVol(j.getVol());
.setDataInfo(mapDataInfo(j.getDataInfo())); journal.setDataInfo(mapDataInfo(j.getDataInfo()));
return journal;
} }
public static Author mapAuthor(FieldTypeProtos.Author author) { public static Author mapAuthor(FieldTypeProtos.Author author) {
return new Author() final Author entity = new Author();
.setFullname(author.getFullname()) entity.setFullname(author.getFullname());
.setName(author.getName()) entity.setName(author.getName());
.setSurname(author.getSurname()) entity.setSurname(author.getSurname());
.setRank(author.getRank()) entity.setRank(author.getRank());
.setPid(author.getPidList() entity.setPid(author.getPidList()
.stream() .stream()
.map(ProtoUtils::mapKV) .map(ProtoUtils::mapKV)
.collect(Collectors.toList())) .collect(Collectors.toList()));
.setAffiliation(author.getAffiliationList() entity.setAffiliation(author.getAffiliationList()
.stream() .stream()
.map(ProtoUtils::mapStringField) .map(ProtoUtils::mapStringField)
.collect(Collectors.toList())); .collect(Collectors.toList()));
return entity;
} }
public static GeoLocation mapGeolocation(ResultProtos.Result.GeoLocation geoLocation) { public static GeoLocation mapGeolocation(ResultProtos.Result.GeoLocation geoLocation) {
return new GeoLocation() final GeoLocation entity = new GeoLocation();
.setPoint(geoLocation.getPoint()) entity.setPoint(geoLocation.getPoint());
.setBox(geoLocation.getBox()) entity.setBox(geoLocation.getBox());
.setPlace(geoLocation.getPlace()); entity.setPlace(geoLocation.getPlace());
return entity;
} }
} }

View File

@ -1,7 +1,10 @@
package eu.dnetlib.dhp.graph; package eu.dnetlib.dhp.graph;
import eu.dnetlib.dhp.schema.oaf.Organization; import eu.dnetlib.dhp.application.ArgumentApplicationParser;
import eu.dnetlib.dhp.schema.oaf.*;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.spark.api.java.JavaRDD; import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext; import org.apache.spark.api.java.JavaSparkContext;
@ -14,49 +17,49 @@ import scala.Tuple2;
public class SparkGraphImporterJob { public class SparkGraphImporterJob {
public static void main(String[] args) throws Exception{ public static void main(String[] args) throws Exception {
//TODO add argument parser
// final ArgumentApplicationParser parser = new ArgumentApplicationParser(IOUtils.toString(SparkGraphImporterJob.class.getResourceAsStream("/eu/dnetlib/dhp/graph/graph_importer_parameters.json")));
// parser.parseArgument(args);
final ArgumentApplicationParser parser = new ArgumentApplicationParser(IOUtils.toString(SparkGraphImporterJob.class.getResourceAsStream("/eu/dnetlib/dhp/graph/input_graph_parameters.json")));
parser.parseArgument(args);
final SparkSession spark = SparkSession final SparkSession spark = SparkSession
.builder() .builder()
.appName("ImportGraph") .appName("ImportGraph")
//TODO replace with: master(parser.get("master")) .master(parser.get("master"))
.master("local[16]")
.getOrCreate(); .getOrCreate();
final JavaSparkContext sc = new JavaSparkContext(spark.sparkContext()); final JavaSparkContext sc = new JavaSparkContext(spark.sparkContext());
final String inputPath = parser.get("input");
final String outputPath = parser.get("outputDir");
final String path = "file:///Users/miconis/Downloads/part-m-02236"; // Read the input file and convert it into RDD of serializable object
final JavaRDD<Tuple2<String, String>> inputRDD = sc.sequenceFile(path, Text.class, Text.class) final JavaRDD<Tuple2<String, String>> inputRDD = sc.sequenceFile(inputPath, Text.class, Text.class)
.map(item -> new Tuple2<>(item._1.toString(), item._2.toString())); .map(item -> new Tuple2<>(item._1.toString(), item._2.toString()));
final JavaRDD<Oaf> oafRdd = inputRDD.filter(s -> !StringUtils.isBlank(s._2()) && !s._1().contains("@update")).map(Tuple2::_2).map(ProtoConverter::convert);
final String body = inputRDD.filter(s -> s._1().contains("20|") && s._1().split("@")[2].equalsIgnoreCase("body")).map(Tuple2::_2).first(); final Encoder<Organization> organizationEncoder = Encoders.bean(Organization.class);
final Encoder<Project> projectEncoder = Encoders.bean(Project.class);
final Encoder<Datasource> datasourceEncoder = Encoders.bean(Datasource.class);
System.out.println(body); final Encoder<eu.dnetlib.dhp.schema.oaf.Dataset> datasetEncoder = Encoders.bean(eu.dnetlib.dhp.schema.oaf.Dataset.class);
final Encoder<Publication> publicationEncoder = Encoders.bean(Publication.class);
final Encoder<Software> softwareEncoder = Encoders.bean(Software.class);
final Encoder<OtherResearchProducts> otherResearchProductsEncoder = Encoders.bean(OtherResearchProducts.class);
final Encoder<Relation> relationEncoder = Encoders.bean(Relation.class);
final JavaRDD<Organization> organization = inputRDD spark.createDataset(oafRdd.filter(s -> s instanceof Organization).map(s -> (Organization) s).rdd(), organizationEncoder).write().save(outputPath + "/organizations");
.filter(s -> s._1().split("@")[2].equalsIgnoreCase("body")) spark.createDataset(oafRdd.filter(s -> s instanceof Project).map(s -> (Project) s).rdd(), projectEncoder).write().save(outputPath + "/projects");
.map(Tuple2::_2) spark.createDataset(oafRdd.filter(s -> s instanceof Datasource).map(s -> (Datasource) s).rdd(), datasourceEncoder).write().save(outputPath + "/datasources");
.map(ProtoConverter::convert) spark.createDataset(oafRdd.filter(s -> s instanceof eu.dnetlib.dhp.schema.oaf.Dataset).map(s -> (eu.dnetlib.dhp.schema.oaf.Dataset) s).rdd(), datasetEncoder).write().save(outputPath + "/datasets");
.filter(s-> s instanceof Organization)
.map(s->(Organization)s);
final Encoder<Organization> encoder = Encoders.bean(Organization.class);
final Dataset<Organization> mdstore = spark.createDataset(organization.rdd(), encoder);
System.out.println(mdstore.count()); spark.createDataset(oafRdd.filter(s -> s instanceof Publication).map(s -> (Publication) s).rdd(), publicationEncoder).write().save(outputPath + "/publications");
spark.createDataset(oafRdd.filter(s -> s instanceof Software).map(s -> (Software) s).rdd(), softwareEncoder).write().save(outputPath + "/software");
// spark.createDataset(oafRdd.filter(s -> s instanceof OtherResearchProducts).map(s -> (OtherResearchProducts) s).rdd(), otherResearchProductsEncoder).write().save(outputPath + "/otherResearchProducts");
//
// .filter(s -> s instanceof Publication)
// .count();
spark.createDataset(oafRdd.filter(s -> s instanceof Relation).map(s -> (Relation) s).rdd(), relationEncoder).write().save(outputPath + "/relations");

View File

@ -0,0 +1,5 @@
[
{"paramName":"mt", "paramLongName":"master", "paramDescription": "should be local or yarn", "paramRequired": true},
{"paramName":"i", "paramLongName":"input", "paramDescription": "the path of the sequencial file to read", "paramRequired": true},
{"paramName":"o", "paramLongName":"outputDir", "paramDescription": "the path where store DataFrames on HDFS", "paramRequired": true}
]

View File

@ -6,7 +6,7 @@ public class SparkGraphImporterJobTest {
@Test @Test
public void testImport() throws Exception { public void testImport() throws Exception {
SparkGraphImporterJob.main(null); SparkGraphImporterJob.main(new String[]{"-mt", "local[*]","-i", "/home/sandro/part-m-02236", "-o", "/tmp/dataframes"});
} }
} }