placeholders for setters in createpublication

This commit is contained in:
miconis 2019-10-25 10:57:19 +02:00
commit df37bd6aaf
24 changed files with 532 additions and 300 deletions

View File

@ -15,44 +15,48 @@ public class Author implements Serializable {
// json containing a Citation or Statistics
private String value;
public String getName() {
return name;
}
public void setName(String name) {
public Author setName(String name) {
this.name = name;
return this;
}
public String getTypology() {
return typology;
}
public void setTypology(String typology) {
public Author setTypology(String typology) {
this.typology = typology;
return this;
}
public String getProvenance() {
return provenance;
}
public void setProvenance(String provenance) {
public Author setProvenance(String provenance) {
this.provenance = provenance;
return this;
}
public String getTrust() {
return trust;
}
public void setTrust(String trust) {
public Author setTrust(String trust) {
this.trust = trust;
return this;
}
public String getValue() {
return value;
}
public void setValue(String value) {
public Author setValue(String value) {
this.value = value;
return this;
}
}

View File

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

View File

@ -23,55 +23,62 @@ public class Dataset extends Result implements Serializable {
return storagedate;
}
public void setStoragedate(Field<String> storagedate) {
public Dataset setStoragedate(Field<String> storagedate) {
this.storagedate = storagedate;
return this;
}
public Field<String> getDevice() {
return device;
}
public void setDevice(Field<String> device) {
public Dataset setDevice(Field<String> device) {
this.device = device;
return this;
}
public Field<String> getSize() {
return size;
}
public void setSize(Field<String> size) {
public Dataset setSize(Field<String> size) {
this.size = size;
return this;
}
public Field<String> getVersion() {
return version;
}
public void setVersion(Field<String> version) {
public Dataset setVersion(Field<String> version) {
this.version = version;
return this;
}
public Field<String> getLastmetadataupdate() {
return lastmetadataupdate;
}
public void setLastmetadataupdate(Field<String> lastmetadataupdate) {
public Dataset setLastmetadataupdate(Field<String> lastmetadataupdate) {
this.lastmetadataupdate = lastmetadataupdate;
return this;
}
public Field<String> getMetadataversionnumber() {
return metadataversionnumber;
}
public void setMetadataversionnumber(Field<String> metadataversionnumber) {
public Dataset setMetadataversionnumber(Field<String> metadataversionnumber) {
this.metadataversionnumber = metadataversionnumber;
return this;
}
public List<GeoLocation> getGeolocation() {
return geolocation;
}
public void setGeolocation(List<GeoLocation> geolocation) {
public Dataset setGeolocation(List<GeoLocation> geolocation) {
this.geolocation = geolocation;
return this;
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -12,15 +12,17 @@ public abstract class Oaf implements Serializable {
return dataInfo;
}
public void setDataInfo(DataInfo dataInfo) {
public Oaf setDataInfo(DataInfo dataInfo) {
this.dataInfo = dataInfo;
return this;
}
public Long getLastupdatetimestamp() {
return lastupdatetimestamp;
}
public void setLastupdatetimestamp(Long lastupdatetimestamp) {
public Oaf setLastupdatetimestamp(Long lastupdatetimestamp) {
this.lastupdatetimestamp = lastupdatetimestamp;
return this;
}
}

View File

@ -17,9 +17,6 @@ public abstract class OafEntity extends Oaf implements Serializable {
private String dateoftransformation;
//TODO remove this field
private List<OafEntity> children;
private List<ExtraInfo> extraInfo;
private OAIProvenance oaiprovenance;
@ -29,71 +26,71 @@ public abstract class OafEntity extends Oaf implements Serializable {
return id;
}
public void setId(String id) {
public OafEntity setId(String id) {
this.id = id;
return this;
}
public List<String> getOriginalId() {
return originalId;
}
public void setOriginalId(List<String> originalId) {
public OafEntity setOriginalId(List<String> originalId) {
this.originalId = originalId;
return this;
}
public List<KeyValue> getCollectedfrom() {
return collectedfrom;
}
public void setCollectedfrom(List<KeyValue> collectedfrom) {
public OafEntity setCollectedfrom(List<KeyValue> collectedfrom) {
this.collectedfrom = collectedfrom;
return this;
}
public List<StructuredProperty> getPid() {
return pid;
}
public void setPid(List<StructuredProperty> pid) {
public OafEntity setPid(List<StructuredProperty> pid) {
this.pid = pid;
return this;
}
public String getDateofcollection() {
return dateofcollection;
}
public void setDateofcollection(String dateofcollection) {
public OafEntity setDateofcollection(String dateofcollection) {
this.dateofcollection = dateofcollection;
return this;
}
public String getDateoftransformation() {
return dateoftransformation;
}
public void setDateoftransformation(String dateoftransformation) {
public OafEntity setDateoftransformation(String dateoftransformation) {
this.dateoftransformation = dateoftransformation;
}
public List<OafEntity> getChildren() {
return children;
}
public void setChildren(List<OafEntity> children) {
this.children = children;
return this;
}
public List<ExtraInfo> getExtraInfo() {
return extraInfo;
}
public void setExtraInfo(List<ExtraInfo> extraInfo) {
public OafEntity setExtraInfo(List<ExtraInfo> extraInfo) {
this.extraInfo = extraInfo;
return this;
}
public OAIProvenance getOaiprovenance() {
return oaiprovenance;
}
public void setOaiprovenance(OAIProvenance oaiprovenance) {
public OafEntity setOaiprovenance(OAIProvenance oaiprovenance) {
this.oaiprovenance = oaiprovenance;
return this;
}
}

View File

@ -37,132 +37,147 @@ public class Organization extends OafEntity implements Serializable {
private Qualifier country;
public Field<String> getLegalshortname() {
return legalshortname;
}
public void setLegalshortname(Field<String> legalshortname) {
public Organization setLegalshortname(Field<String> legalshortname) {
this.legalshortname = legalshortname;
return this;
}
public Field<String> getLegalname() {
return legalname;
}
public void setLegalname(Field<String> legalname) {
public Organization setLegalname(Field<String> legalname) {
this.legalname = legalname;
return this;
}
public List<Field<String>> getAlternativeNames() {
return alternativeNames;
}
public void setAlternativeNames(List<Field<String>> alternativeNames) {
public Organization setAlternativeNames(List<Field<String>> alternativeNames) {
this.alternativeNames = alternativeNames;
return this;
}
public Field<String> getWebsiteurl() {
return websiteurl;
}
public void setWebsiteurl(Field<String> websiteurl) {
public Organization setWebsiteurl(Field<String> websiteurl) {
this.websiteurl = websiteurl;
return this;
}
public Field<String> getLogourl() {
return logourl;
}
public void setLogourl(Field<String> logourl) {
public Organization setLogourl(Field<String> logourl) {
this.logourl = logourl;
return this;
}
public Field<String> getEclegalbody() {
return eclegalbody;
}
public void setEclegalbody(Field<String> eclegalbody) {
public Organization setEclegalbody(Field<String> eclegalbody) {
this.eclegalbody = eclegalbody;
return this;
}
public Field<String> getEclegalperson() {
return eclegalperson;
}
public void setEclegalperson(Field<String> eclegalperson) {
public Organization setEclegalperson(Field<String> eclegalperson) {
this.eclegalperson = eclegalperson;
return this;
}
public Field<String> getEcnonprofit() {
return ecnonprofit;
}
public void setEcnonprofit(Field<String> ecnonprofit) {
public Organization setEcnonprofit(Field<String> ecnonprofit) {
this.ecnonprofit = ecnonprofit;
return this;
}
public Field<String> getEcresearchorganization() {
return ecresearchorganization;
}
public void setEcresearchorganization(Field<String> ecresearchorganization) {
public Organization setEcresearchorganization(Field<String> ecresearchorganization) {
this.ecresearchorganization = ecresearchorganization;
return this;
}
public Field<String> getEchighereducation() {
return echighereducation;
}
public void setEchighereducation(Field<String> echighereducation) {
public Organization setEchighereducation(Field<String> echighereducation) {
this.echighereducation = echighereducation;
return this;
}
public Field<String> getEcinternationalorganizationeurinterests() {
return ecinternationalorganizationeurinterests;
}
public void setEcinternationalorganizationeurinterests(Field<String> ecinternationalorganizationeurinterests) {
public Organization setEcinternationalorganizationeurinterests(Field<String> ecinternationalorganizationeurinterests) {
this.ecinternationalorganizationeurinterests = ecinternationalorganizationeurinterests;
return this;
}
public Field<String> getEcinternationalorganization() {
return ecinternationalorganization;
}
public void setEcinternationalorganization(Field<String> ecinternationalorganization) {
public Organization setEcinternationalorganization(Field<String> ecinternationalorganization) {
this.ecinternationalorganization = ecinternationalorganization;
return this;
}
public Field<String> getEcenterprise() {
return ecenterprise;
}
public void setEcenterprise(Field<String> ecenterprise) {
public Organization setEcenterprise(Field<String> ecenterprise) {
this.ecenterprise = ecenterprise;
return this;
}
public Field<String> getEcsmevalidated() {
return ecsmevalidated;
}
public void setEcsmevalidated(Field<String> ecsmevalidated) {
public Organization setEcsmevalidated(Field<String> ecsmevalidated) {
this.ecsmevalidated = ecsmevalidated;
return this;
}
public Field<String> getEcnutscode() {
return ecnutscode;
}
public void setEcnutscode(Field<String> ecnutscode) {
public Organization setEcnutscode(Field<String> ecnutscode) {
this.ecnutscode = ecnutscode;
return this;
}
public Qualifier getCountry() {
return country;
}
public void setCountry(Qualifier country) {
public Organization setCountry(Qualifier country) {
this.country = country;
return this;
}
}

View File

@ -16,61 +16,58 @@ public class OriginDescription implements Serializable {
private String metadataNamespace;
private OriginDescription originDescription;
public String getHarvestDate() {
return harvestDate;
}
public void setHarvestDate(String harvestDate) {
public OriginDescription setHarvestDate(String harvestDate) {
this.harvestDate = harvestDate;
return this;
}
public Boolean getAltered() {
return altered;
}
public void setAltered(Boolean altered) {
public OriginDescription setAltered(Boolean altered) {
this.altered = altered;
return this;
}
public String getBaseURL() {
return baseURL;
}
public void setBaseURL(String baseURL) {
public OriginDescription setBaseURL(String baseURL) {
this.baseURL = baseURL;
return this;
}
public String getIdentifier() {
return identifier;
}
public void setIdentifier(String identifier) {
public OriginDescription setIdentifier(String identifier) {
this.identifier = identifier;
return this;
}
public String getDatestamp() {
return datestamp;
}
public void setDatestamp(String datestamp) {
public OriginDescription setDatestamp(String datestamp) {
this.datestamp = datestamp;
return this;
}
public String getMetadataNamespace() {
return metadataNamespace;
}
public void setMetadataNamespace(String metadataNamespace) {
public OriginDescription setMetadataNamespace(String metadataNamespace) {
this.metadataNamespace = metadataNamespace;
return this;
}
public OriginDescription getOriginDescription() {
return originDescription;
}
public void setOriginDescription(OriginDescription originDescription) {
this.originDescription = originDescription;
}
}

View File

@ -4,6 +4,7 @@ import java.io.Serializable;
import java.util.List;
public class OtherResearchProducts extends Result implements Serializable {
private List<Field<String>> contactperson;
private List<Field<String>> contactgroup;
@ -14,23 +15,26 @@ public class OtherResearchProducts extends Result implements Serializable {
return contactperson;
}
public void setContactperson(List<Field<String>> contactperson) {
public OtherResearchProducts setContactperson(List<Field<String>> contactperson) {
this.contactperson = contactperson;
return this;
}
public List<Field<String>> getContactgroup() {
return contactgroup;
}
public void setContactgroup(List<Field<String>> contactgroup) {
public OtherResearchProducts setContactgroup(List<Field<String>> contactgroup) {
this.contactgroup = contactgroup;
return this;
}
public List<Field<String>> getTool() {
return tool;
}
public void setTool(List<Field<String>> tool) {
public OtherResearchProducts setTool(List<Field<String>> tool) {
this.tool = tool;
return this;
}
}

View File

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

View File

@ -11,7 +11,8 @@ public class Publication extends Result implements Serializable {
return journal;
}
public void setJournal(Journal journal) {
public Publication setJournal(Journal journal) {
this.journal = journal;
return this;
}
}

View File

@ -9,8 +9,6 @@ public class Qualifier implements Serializable {
private String schemeid;
private String schemename;
private DataInfo dataInfo;
public String getClassid() {
return classid;
}
@ -47,12 +45,4 @@ public class Qualifier implements Serializable {
return this;
}
public DataInfo getDataInfo() {
return dataInfo;
}
public Qualifier setDataInfo(DataInfo dataInfo) {
this.dataInfo = dataInfo;
return this;
}
}

View File

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

View File

@ -17,31 +17,35 @@ public class Software extends Result implements Serializable {
return documentationUrl;
}
public void setDocumentationUrl(List<Field<String>> documentationUrl) {
public Software setDocumentationUrl(List<Field<String>> documentationUrl) {
this.documentationUrl = documentationUrl;
return this;
}
public List<StructuredProperty> getLicense() {
return license;
}
public void setLicense(List<StructuredProperty> license) {
public Software setLicense(List<StructuredProperty> license) {
this.license = license;
return this;
}
public Field<String> getCodeRepositoryUrl() {
return codeRepositoryUrl;
}
public void setCodeRepositoryUrl(Field<String> codeRepositoryUrl) {
public Software setCodeRepositoryUrl(Field<String> codeRepositoryUrl) {
this.codeRepositoryUrl = codeRepositoryUrl;
return this;
}
public Qualifier getProgrammingLanguage() {
return programmingLanguage;
}
public void setProgrammingLanguage(Qualifier programmingLanguage) {
public Software setProgrammingLanguage(Qualifier programmingLanguage) {
this.programmingLanguage = programmingLanguage;
return this;
}
}

View File

@ -1,14 +1,12 @@
package eu.dnetlib.dhp.graph;
import eu.dnetlib.data.proto.KindProtos;
import eu.dnetlib.data.proto.OafProtos;
import eu.dnetlib.data.proto.*;
import eu.dnetlib.dhp.schema.oaf.*;
import java.io.Serializable;
import java.util.stream.Collectors;
import static eu.dnetlib.dhp.graph.ProtoUtils.mapDataInfo;
import static eu.dnetlib.dhp.graph.ProtoUtils.mapKV;
import static eu.dnetlib.dhp.graph.ProtoUtils.*;
public class ProtoConverter implements Serializable {
@ -60,54 +58,109 @@ public class ProtoConverter implements Serializable {
}
private static Organization convertOrganization(OafProtos.Oaf oaf) {
return new Organization();
final DatasourceProtos.Datasource.Metadata m = oaf.getEntity().getDatasource().getMetadata();
final Organization org = setOaf(new Organization(), oaf);
return setEntity(org, oaf);
//TODO set org fields
}
private static Datasource convertDataSource(OafProtos.Oaf oaf) {
final Datasource result = new Datasource();
//Set Oaf Fields
result.setDataInfo(ProtoUtils.mapDataInfo(oaf.getDataInfo()));
result.setLastupdatetimestamp(oaf.getLastupdatetimestamp());
//setting Entity fields
final OafProtos.OafEntity entity = oaf.getEntity();
result.setId(entity.getId());
result.setOriginalId(entity.getOriginalIdList());
result.setCollectedfrom(entity.getCollectedfromList()
final DatasourceProtos.Datasource.Metadata m = oaf.getEntity().getDatasource().getMetadata();
final Datasource datasource = setOaf(new Datasource(), oaf);
return setEntity(datasource, oaf)
.setAccessinfopackage(m.getAccessinfopackageList()
.stream()
.map(ProtoUtils::mapStringField)
.collect(Collectors.toList()))
.setCertificates(mapStringField(m.getCertificates()))
.setCitationguidelineurl(mapStringField(m.getCitationguidelineurl()))
.setContactemail(mapStringField(m.getContactemail()))
.setDatabaseaccessrestriction(mapStringField(m.getDatabaseaccessrestriction()))
.setDatabaseaccesstype(mapStringField(m.getDatabaseaccesstype()))
.setDataprovider(mapBoolField(m.getDataprovider()))
.setDatasourcetype(mapQualifier(m.getDatasourcetype()))
.setDatauploadrestriction(mapStringField(m.getDatauploadrestriction()))
.setCitationguidelineurl(mapStringField(m.getCitationguidelineurl()))
.setDatauploadtype(mapStringField(m.getDatauploadtype()))
.setDateofvalidation(mapStringField(m.getDateofvalidation()))
.setDescription(mapStringField(m.getDescription()))
.setEnglishname(mapStringField(m.getEnglishname()))
.setLatitude(mapStringField(m.getLatitude()))
.setLongitude(mapStringField(m.getLongitude()))
.setLogourl(mapStringField(m.getLogourl()))
.setMissionstatementurl(mapStringField(m.getMissionstatementurl()))
.setNamespaceprefix(mapStringField(m.getNamespaceprefix()))
.setOdcontenttypes(m.getOdcontenttypesList()
.stream()
.map(ProtoUtils::mapStringField)
.collect(Collectors.toList()))
.setOdlanguages(m.getOdlanguagesList()
.stream()
.map(ProtoUtils::mapStringField)
.collect(Collectors.toList()))
.setOdnumberofitems(mapStringField(m.getOdnumberofitems()))
.setOdnumberofitemsdate(mapStringField(m.getOdnumberofitemsdate()))
.setOdpolicies(mapStringField(m.getOdpolicies()))
.setOfficialname(mapStringField(m.getOfficialname()))
.setOpenairecompatibility(mapQualifier(m.getOpenairecompatibility()))
.setPidsystems(mapStringField(m.getPidsystems()))
.setPolicies(m.getPoliciesList()
.stream()
.map(ProtoUtils::mapKV)
.collect(Collectors.toList()));
result.setPid(entity.getPidList()
.collect(Collectors.toList()))
.setQualitymanagementkind(mapStringField(m.getQualitymanagementkind()))
.setReleaseenddate(mapStringField(m.getReleaseenddate()))
.setServiceprovider(mapBoolField(m.getServiceprovider()))
.setReleasestartdate(mapStringField(m.getReleasestartdate()))
.setSubjects(m.getSubjectsList()
.stream()
.map(ProtoUtils::mapStructuredProperty)
.collect(Collectors.toList()));
result.setDateofcollection(entity.getDateofcollection());
result.setDateoftransformation(entity.getDateoftransformation());
result.setExtraInfo(entity.getExtraInfoList()
.stream()
.map(ProtoUtils::mapExtraInfo)
.collect(Collectors.toList()));
return result;
.collect(Collectors.toList()))
.setVersioning(mapBoolField(m.getVersioning()))
.setWebsiteurl(mapStringField(m.getWebsiteurl()))
.setJournal(mapJournal(m.getJournal()));
}
private static Project convertProject(OafProtos.Oaf oaf) {
return new Project();
final ProjectProtos.Project.Metadata m = oaf.getEntity().getProject().getMetadata();
final Project project = setOaf(new Project(), oaf);
return setEntity(project, oaf)
.setAcronym(mapStringField(m.getAcronym()))
.setCallidentifier(mapStringField(m.getCallidentifier()))
.setCode(mapStringField(m.getCode()))
.setContactemail(mapStringField(m.getContactemail()))
.setContactfax(mapStringField(m.getContactfax()))
.setContactfullname(mapStringField(m.getContactfullname()))
.setContactphone(mapStringField(m.getContactphone()))
.setContracttype(mapQualifier(m.getContracttype()))
.setCurrency(mapStringField(m.getCurrency()))
.setDuration(mapStringField(m.getDuration()))
.setEcarticle29_3(mapStringField(m.getEcarticle293()))
.setEcsc39(mapStringField(m.getEcsc39()))
.setOamandatepublications(mapStringField(m.getOamandatepublications()))
.setStartdate(mapStringField(m.getStartdate()))
.setEnddate(mapStringField(m.getEnddate()))
.setFundedamount(m.getFundedamount())
.setTotalcost(m.getTotalcost())
.setKeywords(mapStringField(m.getKeywords()))
.setSubjects(m.getSubjectsList().stream()
.map(sp -> mapStructuredProperty(sp))
.collect(Collectors.toList()))
.setTitle(mapStringField(m.getTitle()))
.setWebsiteurl(mapStringField(m.getWebsiteurl()))
.setFundingtree(m.getFundingtreeList().stream()
.map(f -> mapStringField(f))
.collect(Collectors.toList()))
.setJsonextrainfo(mapStringField(m.getJsonextrainfo()))
.setSummary(mapStringField(m.getSummary()))
.setOptional1(mapStringField(m.getOptional1()))
.setOptional2(mapStringField(m.getOptional2()));
}
private static Result convertResult(OafProtos.Oaf oaf) {
switch (oaf.getEntity().getResult().getMetadata().getResulttype().getClassid()) {
case "dataset":
return createDataset(oaf);
case "publication":
@ -131,29 +184,17 @@ public class ProtoConverter implements Serializable {
private static Publication createPublication(OafProtos.Oaf oaf) {
Publication result = new Publication();
//Set Oaf Fields
result.setDataInfo(ProtoUtils.mapDataInfo(oaf.getDataInfo()));
result.setLastupdatetimestamp(oaf.getLastupdatetimestamp());
ResultProtos.Result.Metadata m = oaf.getEntity().getResult().getMetadata();
Publication publication = setOaf(new Publication(), oaf);
return setEntity(publication, oaf)
.setJournal(mapJournal(m.getJournal()))
.setRefereed(mapStringField(m.getRefereed()));
//setting Entity fields
final OafProtos.OafEntity entity = oaf.getEntity();
result.setId(entity.getId());
result.setJournal(null);
result.setAuthor(null);
result.setChildren(null);
result.setCollectedfrom(entity.getCollectedfromList()
.stream()
.map(ProtoUtils::mapKV)
.collect(Collectors.toList()));
result.setContext(null);
result.setContributor(null);
@ -164,10 +205,6 @@ public class ProtoConverter implements Serializable {
result.setDateofacceptance(result.getDateofacceptance());
result.setDateofcollection(entity.getDateofcollection());
result.setDateoftransformation(entity.getDateoftransformation());
result.setDescription(entity.getResult().getMetadata().getDescriptionList()
.stream()
.map(ProtoUtils::mapStringField)
@ -177,11 +214,6 @@ public class ProtoConverter implements Serializable {
result.setExternalReference(null);
result.setExtraInfo(entity.getExtraInfoList()
.stream()
.map(ProtoUtils::mapExtraInfo)
.collect(Collectors.toList()));
result.setFormat(entity.getResult().getMetadata().getFormatList()
.stream()
.map(ProtoUtils::mapStringField)
@ -189,23 +221,15 @@ public class ProtoConverter implements Serializable {
result.setFulltext(null);
result.setInstance(null);
result.setInstance(entity.getResult().getInstanceList());
result.setLanguage(ProtoUtils.mapQualifier(entity.getResult().getMetadata().getLanguage()));
result.setOaiprovenance(null);
result.setOriginalId(entity.getOriginalIdList());
result.setPid(entity.getPidList()
.stream()
.map(ProtoUtils::mapStructuredProperty)
.collect(Collectors.toList()));
result.setPublisher(ProtoUtils.mapStringField(entity.getResult().getMetadata().getPublisher()));
result.setRefereed(null);
result.setRelevantdate(null);
result.setResourcetype(null);

View File

@ -5,6 +5,8 @@ import eu.dnetlib.data.proto.FieldTypeProtos;
import eu.dnetlib.data.proto.OafProtos;
import eu.dnetlib.dhp.schema.oaf.*;
import java.util.stream.Collectors;
public class ProtoUtils {
public static OafProtos.Oaf parse(String json) throws JsonFormat.ParseException {
@ -13,6 +15,33 @@ public class ProtoUtils {
return builder.build();
}
public static <T extends Oaf> T setOaf(T oaf, OafProtos.Oaf o) {
oaf.setDataInfo(mapDataInfo(o.getDataInfo())).setLastupdatetimestamp(o.getLastupdatetimestamp());
return oaf;
}
public static <T extends OafEntity> T setEntity(T entity, OafProtos.Oaf oaf) {
//setting Entity fields
final OafProtos.OafEntity e = oaf.getEntity();
entity
.setId(e.getId())
.setOriginalId(e.getOriginalIdList())
.setCollectedfrom(e.getCollectedfromList()
.stream()
.map(ProtoUtils::mapKV)
.collect(Collectors.toList()))
.setPid(e.getPidList().stream()
.map(ProtoUtils::mapStructuredProperty)
.collect(Collectors.toList()))
.setDateofcollection(entity.getDateofcollection())
.setDateoftransformation(entity.getDateoftransformation())
.setExtraInfo(e.getExtraInfoList()
.stream()
.map(ProtoUtils::mapExtraInfo)
.collect(Collectors.toList()));
return entity;
}
public static KeyValue mapKV(FieldTypeProtos.KeyValue kv) {
return new KeyValue()
.setKey(kv.getKey())
@ -34,8 +63,8 @@ public class ProtoUtils {
.setClassid(q.getClassid())
.setClassname(q.getClassname())
.setSchemeid(q.getSchemeid())
.setSchemename(q.getSchemename())
.setDataInfo(q.hasDataInfo() ? mapDataInfo(q.getDataInfo()) : null);
.setSchemename(q.getSchemename());
//.setDataInfo(q.hasDataInfo() ? mapDataInfo(q.getDataInfo()) : null);
}
public static StructuredProperty mapStructuredProperty(FieldTypeProtos.StructuredProperty sp) {
@ -54,6 +83,23 @@ public class ProtoUtils {
.setValue(extraInfo.getValue());
}
public static OAIProvenance mapOAIProvenance(FieldTypeProtos.OAIProvenance oaiProvenance) {
return new OAIProvenance().setOriginDescription(mapOriginalDescription(oaiProvenance.getOriginDescription()));
}
public static OriginDescription mapOriginalDescription(FieldTypeProtos.OAIProvenance.OriginDescription originDescription) {
final OriginDescription originDescriptionResult = new OriginDescription()
.setHarvestDate(originDescription.getHarvestDate())
.setAltered(originDescription.getAltered())
.setBaseURL(originDescription.getBaseURL())
.setIdentifier(originDescription.getIdentifier())
.setDatestamp(originDescription.getDatestamp())
.setMetadataNamespace(originDescription.getMetadataNamespace());
// if (originDescription.hasOriginDescription())
// originDescriptionResult.setOriginDescription(mapOriginalDescription(originDescription.getOriginDescription()));
return originDescriptionResult;
}
public static Field<String> mapStringField(FieldTypeProtos.StringField s) {
return new Field<String>()
.setValue(s.getValue())
@ -72,4 +118,20 @@ public class ProtoUtils {
.setDataInfo(b.hasDataInfo() ? mapDataInfo(b.getDataInfo()) : null);
}
public static Journal mapJournal(FieldTypeProtos.Journal j) {
return new Journal()
.setConferencedate(j.getConferencedate())
.setConferenceplace(j.getConferenceplace())
.setEdition(j.getEdition())
.setEp(j.getEp())
.setIss(j.getIss())
.setIssnLinking(j.getIssnLinking())
.setIssnOnline(j.getIssnOnline())
.setIssnPrinted(j.getIssnPrinted())
.setName(j.getName())
.setSp(j.getSp())
.setVol(j.getVol())
.setDataInfo(mapDataInfo(j.getDataInfo()));
}
}

View File

@ -1,15 +1,21 @@
package eu.dnetlib.dhp.graph;
import eu.dnetlib.dhp.schema.oaf.Datasource;
import eu.dnetlib.dhp.schema.oaf.Oaf;
import eu.dnetlib.dhp.schema.oaf.Publication;
import org.apache.hadoop.io.Text;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.api.java.function.PairFunction;
import org.apache.spark.sql.Dataset;
import org.apache.spark.sql.Encoder;
import org.apache.spark.sql.Encoders;
import org.apache.spark.sql.SparkSession;
import scala.Tuple2;
import javax.xml.crypto.Data;
public class SparkGraphImporterJob {
@ -29,21 +35,21 @@ public class SparkGraphImporterJob {
final JavaSparkContext sc = new JavaSparkContext(spark.sparkContext());
final String path = "file:///Users/miconis/Downloads/part-m-02236";
final JavaRDD<Tuple2<String, String>> inputRDD = sc.sequenceFile(path, Text.class, Text.class)
.map(item -> new Tuple2<>(item._1.toString(), item._2.toString()));
final JavaRDD<Tuple2<String, String>> inputRDD = sc.sequenceFile("file:///Users/miconis/Downloads/part-m-02236", Text.class, Text.class).map(item -> new Tuple2<>(item._1.toString(), item._2.toString()));
String body = inputRDD
final JavaRDD<Datasource> datasources = inputRDD
.filter(s -> s._1().split("@")[2].equalsIgnoreCase("body"))
.map(Tuple2::_2)
.first();
.map(ProtoConverter::convert)
.filter(s-> s instanceof Datasource)
.map(s->(Datasource)s);
final Encoder<Datasource> encoder = Encoders.bean(Datasource.class);
final Dataset<Datasource> mdstore = spark.createDataset(datasources.rdd(), encoder);
System.out.println("body = " + body);
System.out.println(mdstore.count());
// .map(Tuple2::_2)
// .map(ProtoConverter::convert)
// .mapToPair((PairFunction<Oaf, String,Integer>) s-> new Tuple2<String, Integer>(s.getClass().getName(),1))
// .reduceByKey(Integer::sum).collect().forEach(System.out::println);
//
//
// .filter(s -> s instanceof Publication)

View File

@ -1,5 +1,6 @@
package eu.dnetlib.dhp.graph;
import com.fasterxml.jackson.databind.ObjectMapper;
import eu.dnetlib.dhp.schema.oaf.Datasource;
import eu.dnetlib.dhp.schema.oaf.Oaf;
import eu.dnetlib.dhp.schema.oaf.Publication;
@ -25,6 +26,9 @@ public class ProtoConverterTest {
System.out.println(ds.getId());
ObjectMapper mapper = new ObjectMapper();
System.out.println(mapper.writeValueAsString(result));
}

View File

@ -250,7 +250,7 @@
<dependency>
<groupId>eu.dnetlib</groupId>
<artifactId>dnet-openaire-data-protos</artifactId>
<version>3.9.4</version>
<version>3.9.5</version>
</dependency>
</dependencies>