forked from D-Net/dnet-hadoop
dhp-schema moved to dedicated module https://code-repo.d4science.org/D-Net/dhp-schemas
This commit is contained in:
parent
fa42026590
commit
82de6fb634
|
@ -1,123 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.mdstore;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import eu.dnetlib.dhp.schema.common.ModelSupport;
|
||||
|
||||
/**
|
||||
* This class models a record in a Metadata store collection on HDFS
|
||||
*/
|
||||
public class MetadataRecord implements Serializable {
|
||||
|
||||
/** The D-Net Identifier associated to the record */
|
||||
private String id;
|
||||
|
||||
/** The original Identifier of the record */
|
||||
private String originalId;
|
||||
|
||||
/** The encoding of the record, should be JSON or XML */
|
||||
private String encoding;
|
||||
|
||||
/**
|
||||
* The information about the provenance of the record see @{@link Provenance} for the model of this information
|
||||
*/
|
||||
private Provenance provenance;
|
||||
|
||||
/** The content of the metadata */
|
||||
private String body;
|
||||
|
||||
/** the date when the record has been stored */
|
||||
private Long dateOfCollection;
|
||||
|
||||
/** the date when the record has been stored */
|
||||
private Long dateOfTransformation;
|
||||
|
||||
public MetadataRecord() {
|
||||
|
||||
}
|
||||
|
||||
public MetadataRecord(
|
||||
String originalId,
|
||||
String encoding,
|
||||
Provenance provenance,
|
||||
String body,
|
||||
Long dateOfCollection) {
|
||||
|
||||
this.originalId = originalId;
|
||||
this.encoding = encoding;
|
||||
this.provenance = provenance;
|
||||
this.body = body;
|
||||
this.dateOfCollection = dateOfCollection;
|
||||
this.id = ModelSupport.generateIdentifier(originalId, this.provenance.getNsPrefix());
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getOriginalId() {
|
||||
return originalId;
|
||||
}
|
||||
|
||||
public void setOriginalId(String originalId) {
|
||||
this.originalId = originalId;
|
||||
}
|
||||
|
||||
public String getEncoding() {
|
||||
return encoding;
|
||||
}
|
||||
|
||||
public void setEncoding(String encoding) {
|
||||
this.encoding = encoding;
|
||||
}
|
||||
|
||||
public Provenance getProvenance() {
|
||||
return provenance;
|
||||
}
|
||||
|
||||
public void setProvenance(Provenance provenance) {
|
||||
this.provenance = provenance;
|
||||
}
|
||||
|
||||
public String getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
public void setBody(String body) {
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
public Long getDateOfCollection() {
|
||||
return dateOfCollection;
|
||||
}
|
||||
|
||||
public void setDateOfCollection(Long dateOfCollection) {
|
||||
this.dateOfCollection = dateOfCollection;
|
||||
}
|
||||
|
||||
public Long getDateOfTransformation() {
|
||||
return dateOfTransformation;
|
||||
}
|
||||
|
||||
public void setDateOfTransformation(Long dateOfTransformation) {
|
||||
this.dateOfTransformation = dateOfTransformation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (!(o instanceof MetadataRecord)) {
|
||||
return false;
|
||||
}
|
||||
return ((MetadataRecord) o).getId().equalsIgnoreCase(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return id.hashCode();
|
||||
}
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.mdstore;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Sandro La Bruzzo
|
||||
* <p>
|
||||
* Provenace class models the provenance of the record in the metadataStore It contains the identifier and the
|
||||
* name of the datasource that gives the record
|
||||
*/
|
||||
public class Provenance implements Serializable {
|
||||
|
||||
private String datasourceId;
|
||||
|
||||
private String datasourceName;
|
||||
|
||||
private String nsPrefix;
|
||||
|
||||
public Provenance() {
|
||||
}
|
||||
|
||||
public Provenance(String datasourceId, String datasourceName, String nsPrefix) {
|
||||
this.datasourceId = datasourceId;
|
||||
this.datasourceName = datasourceName;
|
||||
this.nsPrefix = nsPrefix;
|
||||
}
|
||||
|
||||
public String getDatasourceId() {
|
||||
return datasourceId;
|
||||
}
|
||||
|
||||
public void setDatasourceId(String datasourceId) {
|
||||
this.datasourceId = datasourceId;
|
||||
}
|
||||
|
||||
public String getDatasourceName() {
|
||||
return datasourceName;
|
||||
}
|
||||
|
||||
public void setDatasourceName(String datasourceName) {
|
||||
this.datasourceName = datasourceName;
|
||||
}
|
||||
|
||||
public String getNsPrefix() {
|
||||
return nsPrefix;
|
||||
}
|
||||
|
||||
public void setNsPrefix(String nsPrefix) {
|
||||
this.nsPrefix = nsPrefix;
|
||||
}
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.oaf;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* This class models the access rights of research products.
|
||||
*/
|
||||
public class AccessRight extends Qualifier {
|
||||
|
||||
private OpenAccessRoute openAccessRoute;
|
||||
|
||||
public OpenAccessRoute getOpenAccessRoute() {
|
||||
return openAccessRoute;
|
||||
}
|
||||
|
||||
public void setOpenAccessRoute(OpenAccessRoute openAccessRoute) {
|
||||
this.openAccessRoute = openAccessRoute;
|
||||
}
|
||||
|
||||
public String toComparableString() {
|
||||
String s = super.toComparableString();
|
||||
return Optional
|
||||
.ofNullable(getOpenAccessRoute())
|
||||
.map(x -> s + "::" + x.toString())
|
||||
.orElse(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return toComparableString().hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
|
||||
Qualifier other = (Qualifier) obj;
|
||||
|
||||
return toComparableString().equals(other.toComparableString());
|
||||
}
|
||||
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.oaf;
|
||||
|
||||
/**
|
||||
* This Enum models the OpenAccess status, currently including only the values from Unpaywall
|
||||
*
|
||||
* https://support.unpaywall.org/support/solutions/articles/44001777288-what-do-the-types-of-oa-status-green-gold-hybrid-and-bronze-mean-
|
||||
*/
|
||||
public enum OpenAccessRoute {
|
||||
|
||||
gold, green, hybrid, bronze
|
||||
|
||||
}
|
|
@ -1,79 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.orcid;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AuthorHistory implements Serializable {
|
||||
private String creationMethod;
|
||||
private String completionDate;
|
||||
private String submissionDate;
|
||||
private String lastModifiedDate;
|
||||
private boolean claimed;
|
||||
private String deactivationDate;
|
||||
private boolean verifiedEmail;
|
||||
private boolean verifiedPrimaryEmail;
|
||||
|
||||
public String getCreationMethod() {
|
||||
return creationMethod;
|
||||
}
|
||||
|
||||
public void setCreationMethod(String creationMethod) {
|
||||
this.creationMethod = creationMethod;
|
||||
}
|
||||
|
||||
public String getCompletionDate() {
|
||||
return completionDate;
|
||||
}
|
||||
|
||||
public void setCompletionDate(String completionDate) {
|
||||
this.completionDate = completionDate;
|
||||
}
|
||||
|
||||
public String getSubmissionDate() {
|
||||
return submissionDate;
|
||||
}
|
||||
|
||||
public void setSubmissionDate(String submissionDate) {
|
||||
this.submissionDate = submissionDate;
|
||||
}
|
||||
|
||||
public String getLastModifiedDate() {
|
||||
return lastModifiedDate;
|
||||
}
|
||||
|
||||
public void setLastModifiedDate(String lastModifiedDate) {
|
||||
this.lastModifiedDate = lastModifiedDate;
|
||||
}
|
||||
|
||||
public boolean isClaimed() {
|
||||
return claimed;
|
||||
}
|
||||
|
||||
public void setClaimed(boolean claimed) {
|
||||
this.claimed = claimed;
|
||||
}
|
||||
|
||||
public String getDeactivationDate() {
|
||||
return deactivationDate;
|
||||
}
|
||||
|
||||
public void setDeactivationDate(String deactivationDate) {
|
||||
this.deactivationDate = deactivationDate;
|
||||
}
|
||||
|
||||
public boolean isVerifiedEmail() {
|
||||
return verifiedEmail;
|
||||
}
|
||||
|
||||
public void setVerifiedEmail(boolean verifiedEmail) {
|
||||
this.verifiedEmail = verifiedEmail;
|
||||
}
|
||||
|
||||
public boolean isVerifiedPrimaryEmail() {
|
||||
return verifiedPrimaryEmail;
|
||||
}
|
||||
|
||||
public void setVerifiedPrimaryEmail(boolean verifiedPrimaryEmail) {
|
||||
this.verifiedPrimaryEmail = verifiedPrimaryEmail;
|
||||
}
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.orcid;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AuthorSummary extends OrcidData implements Serializable {
|
||||
private AuthorData authorData;
|
||||
private AuthorHistory authorHistory;
|
||||
|
||||
public AuthorData getAuthorData() {
|
||||
return authorData;
|
||||
}
|
||||
|
||||
public void setAuthorData(AuthorData authorData) {
|
||||
this.authorData = authorData;
|
||||
}
|
||||
|
||||
public AuthorHistory getAuthorHistory() {
|
||||
return authorHistory;
|
||||
}
|
||||
|
||||
public void setAuthorHistory(AuthorHistory authorHistory) {
|
||||
this.authorHistory = authorHistory;
|
||||
}
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.orcid;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import eu.dnetlib.dhp.schema.orcid.AuthorData;
|
||||
|
||||
/**
|
||||
* This class models the data related to a contributor, that are retrieved from an orcid publication
|
||||
*/
|
||||
|
||||
public class Contributor extends AuthorData implements Serializable {
|
||||
private String sequence;
|
||||
private String role;
|
||||
private transient boolean simpleMatch;
|
||||
private transient Double score;
|
||||
private transient boolean bestMatch;
|
||||
|
||||
public String getSequence() {
|
||||
return sequence;
|
||||
}
|
||||
|
||||
public void setSequence(String sequence) {
|
||||
this.sequence = sequence;
|
||||
}
|
||||
|
||||
public String getRole() {
|
||||
return role;
|
||||
}
|
||||
|
||||
public void setRole(String role) {
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
public boolean isSimpleMatch() {
|
||||
return simpleMatch;
|
||||
}
|
||||
|
||||
public void setSimpleMatch(boolean simpleMatch) {
|
||||
this.simpleMatch = simpleMatch;
|
||||
}
|
||||
|
||||
public Double getScore() {
|
||||
return score;
|
||||
}
|
||||
|
||||
public void setScore(Double score) {
|
||||
this.score = score;
|
||||
}
|
||||
|
||||
public boolean isBestMatch() {
|
||||
return bestMatch;
|
||||
}
|
||||
|
||||
public void setBestMatch(boolean bestMatch) {
|
||||
this.bestMatch = bestMatch;
|
||||
}
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.orcid;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* This class models the data related to external id, that are retrieved from an orcid publication
|
||||
*/
|
||||
|
||||
public class ExternalId implements Serializable {
|
||||
private String type;
|
||||
private String value;
|
||||
private String relationShip;
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getRelationShip() {
|
||||
return relationShip;
|
||||
}
|
||||
|
||||
public void setRelationShip(String relationShip) {
|
||||
this.relationShip = relationShip;
|
||||
}
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.orcid;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class OrcidData implements Serializable {
|
||||
protected String base64CompressData;
|
||||
protected String statusCode;
|
||||
protected String downloadDate;
|
||||
|
||||
public String getBase64CompressData() {
|
||||
return base64CompressData;
|
||||
}
|
||||
|
||||
public void setBase64CompressData(String base64CompressData) {
|
||||
this.base64CompressData = base64CompressData;
|
||||
}
|
||||
|
||||
public String getStatusCode() {
|
||||
return statusCode;
|
||||
}
|
||||
|
||||
public void setStatusCode(String statusCode) {
|
||||
this.statusCode = statusCode;
|
||||
}
|
||||
|
||||
public String getDownloadDate() {
|
||||
return downloadDate;
|
||||
}
|
||||
|
||||
public void setDownloadDate(String downloadDate) {
|
||||
this.downloadDate = downloadDate;
|
||||
}
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.orcid;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* This class models the data related to a publication date, that are retrieved from an orcid publication
|
||||
*/
|
||||
|
||||
public class PublicationDate implements Serializable {
|
||||
private String year;
|
||||
private String month;
|
||||
private String day;
|
||||
|
||||
public String getYear() {
|
||||
return year;
|
||||
}
|
||||
|
||||
public void setYear(String year) {
|
||||
this.year = year;
|
||||
}
|
||||
|
||||
public String getMonth() {
|
||||
return month;
|
||||
}
|
||||
|
||||
public void setMonth(String month) {
|
||||
this.month = month;
|
||||
}
|
||||
|
||||
public String getDay() {
|
||||
return day;
|
||||
}
|
||||
|
||||
public void setDay(String day) {
|
||||
this.day = day;
|
||||
}
|
||||
}
|
|
@ -1,79 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.orcid;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Summary implements Serializable {
|
||||
private String creationMethod;
|
||||
private String completionDate;
|
||||
private String submissionDate;
|
||||
private String lastModifiedDate;
|
||||
private boolean claimed;
|
||||
private String deactivationDate;
|
||||
private boolean verifiedEmail;
|
||||
private boolean verifiedPrimaryEmail;
|
||||
|
||||
public String getCreationMethod() {
|
||||
return creationMethod;
|
||||
}
|
||||
|
||||
public void setCreationMethod(String creationMethod) {
|
||||
this.creationMethod = creationMethod;
|
||||
}
|
||||
|
||||
public String getCompletionDate() {
|
||||
return completionDate;
|
||||
}
|
||||
|
||||
public void setCompletionDate(String completionDate) {
|
||||
this.completionDate = completionDate;
|
||||
}
|
||||
|
||||
public String getSubmissionDate() {
|
||||
return submissionDate;
|
||||
}
|
||||
|
||||
public void setSubmissionDate(String submissionDate) {
|
||||
this.submissionDate = submissionDate;
|
||||
}
|
||||
|
||||
public String getLastModifiedDate() {
|
||||
return lastModifiedDate;
|
||||
}
|
||||
|
||||
public void setLastModifiedDate(String lastModifiedDate) {
|
||||
this.lastModifiedDate = lastModifiedDate;
|
||||
}
|
||||
|
||||
public boolean isClaimed() {
|
||||
return claimed;
|
||||
}
|
||||
|
||||
public void setClaimed(boolean claimed) {
|
||||
this.claimed = claimed;
|
||||
}
|
||||
|
||||
public String getDeactivationDate() {
|
||||
return deactivationDate;
|
||||
}
|
||||
|
||||
public void setDeactivationDate(String deactivationDate) {
|
||||
this.deactivationDate = deactivationDate;
|
||||
}
|
||||
|
||||
public boolean isVerifiedEmail() {
|
||||
return verifiedEmail;
|
||||
}
|
||||
|
||||
public void setVerifiedEmail(boolean verifiedEmail) {
|
||||
this.verifiedEmail = verifiedEmail;
|
||||
}
|
||||
|
||||
public boolean isVerifiedPrimaryEmail() {
|
||||
return verifiedPrimaryEmail;
|
||||
}
|
||||
|
||||
public void setVerifiedPrimaryEmail(boolean verifiedPrimaryEmail) {
|
||||
this.verifiedPrimaryEmail = verifiedPrimaryEmail;
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.orcid;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Work extends OrcidData implements Serializable {
|
||||
WorkDetail workDetail;
|
||||
|
||||
public WorkDetail getWorkDetail() {
|
||||
return workDetail;
|
||||
}
|
||||
|
||||
public void setWorkDetail(WorkDetail workDetail) {
|
||||
this.workDetail = workDetail;
|
||||
}
|
||||
}
|
|
@ -1,109 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.orcid;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import eu.dnetlib.dhp.schema.orcid.Contributor;
|
||||
import eu.dnetlib.dhp.schema.orcid.ExternalId;
|
||||
import eu.dnetlib.dhp.schema.orcid.OrcidData;
|
||||
import eu.dnetlib.dhp.schema.orcid.PublicationDate;
|
||||
|
||||
/**
|
||||
* This class models the data that are retrieved from orcid publication
|
||||
*/
|
||||
|
||||
public class WorkDetail implements Serializable {
|
||||
|
||||
private String oid;
|
||||
private String id;
|
||||
private String sourceName;
|
||||
private String type;
|
||||
private List<String> titles;
|
||||
private List<String> urls;
|
||||
List<ExternalId> extIds;
|
||||
List<PublicationDate> publicationDates;
|
||||
List<Contributor> contributors;
|
||||
|
||||
public String getOid() {
|
||||
return oid;
|
||||
}
|
||||
|
||||
public void setOid(String oid) {
|
||||
this.oid = oid;
|
||||
}
|
||||
|
||||
public String getErrorCode() {
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
public void setErrorCode(String errorCode) {
|
||||
this.errorCode = errorCode;
|
||||
}
|
||||
|
||||
private String errorCode;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public List<String> getTitles() {
|
||||
return titles;
|
||||
}
|
||||
|
||||
public void setTitles(List<String> titles) {
|
||||
this.titles = titles;
|
||||
}
|
||||
|
||||
public String getSourceName() {
|
||||
return sourceName;
|
||||
}
|
||||
|
||||
public void setSourceName(String sourceName) {
|
||||
this.sourceName = sourceName;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public List<String> getUrls() {
|
||||
return urls;
|
||||
}
|
||||
|
||||
public void setUrls(List<String> urls) {
|
||||
this.urls = urls;
|
||||
}
|
||||
|
||||
public List<ExternalId> getExtIds() {
|
||||
return extIds;
|
||||
}
|
||||
|
||||
public void setExtIds(List<ExternalId> extIds) {
|
||||
this.extIds = extIds;
|
||||
}
|
||||
|
||||
public List<PublicationDate> getPublicationDates() {
|
||||
return publicationDates;
|
||||
}
|
||||
|
||||
public void setPublicationDates(List<PublicationDate> publicationDates) {
|
||||
this.publicationDates = publicationDates;
|
||||
}
|
||||
|
||||
public List<Contributor> getContributors() {
|
||||
return contributors;
|
||||
}
|
||||
|
||||
public void setContributors(List<Contributor> contributors) {
|
||||
this.contributors = contributors;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue