WIP: defining model classes used to store the json payload in the Solr documents

This commit is contained in:
Claudio Atzori 2024-03-01 15:25:28 +01:00
parent f6745a9d30
commit db99c7f113
15 changed files with 528 additions and 27 deletions

View File

@ -10,6 +10,14 @@ public class APC implements Serializable {
private String currency;
private String amount;
public static APC newInstance(String currency, String amount) {
APC apc = new APC();
apc.setCurrency(currency);
apc.setAmount(amount);
return apc;
}
public String getCurrency() {
return currency;
}

View File

@ -1,6 +1,7 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
public class Author implements Serializable {
@ -15,9 +16,9 @@ public class Author implements Serializable {
/**
* The author's persistent identifiers
*/
private Pid pid;
private List<Pid> pid;
public static Author newInstance(String fullname, String name, String surname, int rank, Pid pid) {
public static Author newInstance(String fullname, String name, String surname, int rank, List<Pid> pid) {
Author a = new Author();
a.setFullname(fullname);
a.setName(name);
@ -59,11 +60,11 @@ public class Author implements Serializable {
this.rank = rank;
}
public Pid getPid() {
public List<Pid> getPid() {
return pid;
}
public void setPid(Pid pid) {
public void setPid(List<Pid> pid) {
this.pid = pid;
}
}

View File

@ -9,7 +9,7 @@ public class Category implements Serializable {
private String label;
private List<Concept> concept;
private Category newInstance(String id, String label) {
public Category newInstance(String id, String label) {
Category category = new Category();
category.setId(id);
category.setLabel(label);

View File

@ -7,7 +7,7 @@ public class Concept implements Serializable {
private String id;
private String label;
private Concept newInstance(String id, String label) {
public Concept newInstance(String id, String label) {
Concept concept = new Concept();
concept.setId(id);
concept.setLabel(label);

View File

@ -10,7 +10,7 @@ public class Context implements Serializable {
private String type;
private List<Category> category;
private Context newInstance(String id, String label, String type, List<Category> category) {
public Context newInstance(String id, String label, String type, List<Category> category) {
Context context = new Context();
context.setId(id);
context.setLabel(label);

View File

@ -21,6 +21,13 @@ public class Country implements Serializable {
*/
private String label; // the classname in the Qualifier
public static Country newInstance(String code, String label) {
Country c = new Country();
c.setCode(code);
c.setLabel(label);
return c;
}
public String getCode() {
return code;
}
@ -37,11 +44,4 @@ public class Country implements Serializable {
this.label = label;
}
public static Country newInstance(String code, String label) {
Country c = new Country();
c.setCode(code);
c.setLabel(label);
return c;
}
}

View File

@ -33,6 +33,15 @@ public class EoscIfGuidelines implements Serializable {
*/
private String semanticRelation;
public static EoscIfGuidelines newInstance(String code, String label, String url, String semanticRelation) {
EoscIfGuidelines e = new EoscIfGuidelines();
e.setCode(code);
e.setLabel(label);
e.setUrl(url);
e.setSemanticRelation(semanticRelation);
return e;
}
public String getCode() {
return code;
}

View File

@ -3,4 +3,6 @@ package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class ExtraInfo implements Serializable {
//TODO define me!
}

View File

@ -38,4 +38,116 @@ public class Instance implements Serializable {
* Direct fulltext URL.
*/
private String fulltext;
public String getLicense() {
return license;
}
public void setLicense(String license) {
this.license = license;
}
public AccessRight getAccessright() {
return accessright;
}
public void setAccessright(AccessRight accessright) {
this.accessright = accessright;
}
public String getInstancetype() {
return instancetype;
}
public void setInstancetype(String instancetype) {
this.instancetype = instancetype;
}
public Provenance getHostedby() {
return hostedby;
}
public void setHostedby(Provenance hostedby) {
this.hostedby = hostedby;
}
public List<String> getUrl() {
return url;
}
public void setUrl(List<String> url) {
this.url = url;
}
public String getDistributionlocation() {
return distributionlocation;
}
public void setDistributionlocation(String distributionlocation) {
this.distributionlocation = distributionlocation;
}
public Provenance getCollectedfrom() {
return collectedfrom;
}
public void setCollectedfrom(Provenance collectedfrom) {
this.collectedfrom = collectedfrom;
}
public List<Pid> getPid() {
return pid;
}
public void setPid(List<Pid> pid) {
this.pid = pid;
}
public List<Pid> getAlternateIdentifier() {
return alternateIdentifier;
}
public void setAlternateIdentifier(List<Pid> alternateIdentifier) {
this.alternateIdentifier = alternateIdentifier;
}
public String getDateofacceptance() {
return dateofacceptance;
}
public void setDateofacceptance(String dateofacceptance) {
this.dateofacceptance = dateofacceptance;
}
public APC getProcessingcharges() {
return processingcharges;
}
public void setProcessingcharges(APC processingcharges) {
this.processingcharges = processingcharges;
}
public String getRefereed() {
return refereed;
}
public void setRefereed(String refereed) {
this.refereed = refereed;
}
public List<Measure> getMeasures() {
return measures;
}
public void setMeasures(List<Measure> measures) {
this.measures = measures;
}
public String getFulltext() {
return fulltext;
}
public void setFulltext(String fulltext) {
this.fulltext = fulltext;
}
}

View File

@ -14,6 +14,13 @@ public class Language implements Serializable {
*/
private String label; // the classname in the Qualifier
public static Language newInstance(String code, String label) {
Language lang = new Language();
lang.setCode(code);
lang.setLabel(label);
return lang;
}
public String getCode() {
return code;
}
@ -30,10 +37,4 @@ public class Language implements Serializable {
this.label = label;
}
public static Language newInstance(String code, String value) {
Language qualifier = new Language();
qualifier.setCode(code);
qualifier.setLabel(value);
return qualifier;
}
}

View File

@ -8,6 +8,13 @@ public class Pid implements Serializable {
private String value;
public static Pid newInstance(String type, String value) {
Pid p = new Pid();
p.setType(type);
p.setValue(value);
return p;
}
public String getType() {
return type;
}

View File

@ -8,6 +8,13 @@ public class Provenance implements Serializable {
private String dsName;
public static Provenance newInstance(String dsId, String dsName) {
Provenance p = new Provenance();
p.setDsId(dsId);
p.setDsName(dsName);
return p;
}
public String getDsId() {
return dsId;
}

View File

@ -140,6 +140,11 @@ public class Result implements Serializable {
*/
private String version; // dataset
/**
* EOSC Interoperability Framework Guidelines
*/
private List<EoscIfGuidelines> eoscifguidelines;
@JsonProperty("isGreen")
private Boolean isGreen;
@ -158,4 +163,267 @@ public class Result implements Serializable {
*/
private List<Instance> instance;
public String getResulttype() {
return resulttype;
}
public void setResulttype(String resulttype) {
this.resulttype = resulttype;
}
public List<Author> getAuthor() {
return author;
}
public void setAuthor(List<Author> author) {
this.author = author;
}
public List<Subject> getSubject() {
return subject;
}
public void setSubject(List<Subject> subject) {
this.subject = subject;
}
public Language getLanguage() {
return language;
}
public void setLanguage(Language language) {
this.language = language;
}
public List<Country> getCountry() {
return country;
}
public void setCountry(List<Country> country) {
this.country = country;
}
public String getMaintitle() {
return maintitle;
}
public void setMaintitle(String maintitle) {
this.maintitle = maintitle;
}
public String getSubtitle() {
return subtitle;
}
public void setSubtitle(String subtitle) {
this.subtitle = subtitle;
}
public List<String> getDescription() {
return description;
}
public void setDescription(List<String> description) {
this.description = description;
}
public String getPublicationdate() {
return publicationdate;
}
public void setPublicationdate(String publicationdate) {
this.publicationdate = publicationdate;
}
public String getPublisher() {
return publisher;
}
public void setPublisher(String publisher) {
this.publisher = publisher;
}
public String getEmbargoenddate() {
return embargoenddate;
}
public void setEmbargoenddate(String embargoenddate) {
this.embargoenddate = embargoenddate;
}
public List<String> getSource() {
return source;
}
public void setSource(List<String> source) {
this.source = source;
}
public List<String> getFormat() {
return format;
}
public void setFormat(List<String> format) {
this.format = format;
}
public List<String> getContributor() {
return contributor;
}
public void setContributor(List<String> contributor) {
this.contributor = contributor;
}
public List<String> getCoverage() {
return coverage;
}
public void setCoverage(List<String> coverage) {
this.coverage = coverage;
}
public BestAccessRight getBestaccessright() {
return bestaccessright;
}
public void setBestaccessright(BestAccessRight bestaccessright) {
this.bestaccessright = bestaccessright;
}
public List<String> getFulltext() {
return fulltext;
}
public void setFulltext(List<String> fulltext) {
this.fulltext = fulltext;
}
public Journal getJournal() {
return journal;
}
public void setJournal(Journal journal) {
this.journal = journal;
}
public List<String> getDocumentationUrl() {
return documentationUrl;
}
public void setDocumentationUrl(List<String> documentationUrl) {
this.documentationUrl = documentationUrl;
}
public String getCodeRepositoryUrl() {
return codeRepositoryUrl;
}
public void setCodeRepositoryUrl(String codeRepositoryUrl) {
this.codeRepositoryUrl = codeRepositoryUrl;
}
public String getProgrammingLanguage() {
return programmingLanguage;
}
public void setProgrammingLanguage(String programmingLanguage) {
this.programmingLanguage = programmingLanguage;
}
public List<String> getContactperson() {
return contactperson;
}
public void setContactperson(List<String> contactperson) {
this.contactperson = contactperson;
}
public List<String> getContactgroup() {
return contactgroup;
}
public void setContactgroup(List<String> contactgroup) {
this.contactgroup = contactgroup;
}
public List<String> getTool() {
return tool;
}
public void setTool(List<String> tool) {
this.tool = tool;
}
public String getSize() {
return size;
}
public void setSize(String size) {
this.size = size;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public List<EoscIfGuidelines> getEoscifguidelines() {
return eoscifguidelines;
}
public void setEoscifguidelines(List<EoscIfGuidelines> eoscifguidelines) {
this.eoscifguidelines = eoscifguidelines;
}
public Boolean getGreen() {
return isGreen;
}
public void setGreen(Boolean green) {
isGreen = green;
}
public OpenAccessColor getOpenAccessColor() {
return openAccessColor;
}
public void setOpenAccessColor(OpenAccessColor openAccessColor) {
this.openAccessColor = openAccessColor;
}
public Boolean getInDiamondJournal() {
return isInDiamondJournal;
}
public void setInDiamondJournal(Boolean inDiamondJournal) {
isInDiamondJournal = inDiamondJournal;
}
public Boolean getPubliclyFunded() {
return publiclyFunded;
}
public void setPubliclyFunded(Boolean publiclyFunded) {
this.publiclyFunded = publiclyFunded;
}
public String getTransformativeAgreement() {
return transformativeAgreement;
}
public void setTransformativeAgreement(String transformativeAgreement) {
this.transformativeAgreement = transformativeAgreement;
}
public List<Instance> getInstance() {
return instance;
}
public void setInstance(List<Instance> instance) {
this.instance = instance;
}
}

View File

@ -16,17 +16,10 @@ public class SolrRecord implements Serializable {
private List<Context> context;
/**
* EOSC Interoperability Framework Guidelines
*/
private List<EoscIfGuidelines> eoscifguidelines;
private List<Measure> measures;
private List<ExtraInfo> extraInfo;
private Result result;
private Datasource datasource;
@ -37,5 +30,91 @@ public class SolrRecord implements Serializable {
private List<RelatedRecord> links;
public SolrRecordHeader getHeader() {
return header;
}
public void setHeader(SolrRecordHeader header) {
this.header = header;
}
public List<Provenance> getCollectedfrom() {
return collectedfrom;
}
public void setCollectedfrom(List<Provenance> collectedfrom) {
this.collectedfrom = collectedfrom;
}
public List<Pid> getPid() {
return pid;
}
public void setPid(List<Pid> pid) {
this.pid = pid;
}
public List<Context> getContext() {
return context;
}
public void setContext(List<Context> context) {
this.context = context;
}
public List<Measure> getMeasures() {
return measures;
}
public void setMeasures(List<Measure> measures) {
this.measures = measures;
}
public List<ExtraInfo> getExtraInfo() {
return extraInfo;
}
public void setExtraInfo(List<ExtraInfo> extraInfo) {
this.extraInfo = extraInfo;
}
public Result getResult() {
return result;
}
public void setResult(Result result) {
this.result = result;
}
public Datasource getDatasource() {
return datasource;
}
public void setDatasource(Datasource datasource) {
this.datasource = datasource;
}
public Project getProject() {
return project;
}
public void setProject(Project project) {
this.project = project;
}
public Organization getOrganization() {
return organization;
}
public void setOrganization(Organization organization) {
this.organization = organization;
}
public List<RelatedRecord> getLinks() {
return links;
}
public void setLinks(List<RelatedRecord> links) {
this.links = links;
}
}

View File

@ -8,6 +8,13 @@ public class Subject implements Serializable {
private String type;
public static Subject newInstance(String value, String type) {
Subject s = new Subject();
s.setValue(value);
s.setType(type);
return s;
}
public String getValue() {
return value;
}