Compare commits

..

66 Commits

Author SHA1 Message Date
Claudio Atzori 9eaad49a2e Merge pull request 'Organizations types' (#32) from org_type into master
Reviewed-on: #32
2024-05-22 11:44:44 +02:00
Claudio Atzori 055afdc5fc Merge branch 'master' into org_type 2024-05-22 11:33:07 +02:00
Claudio Atzori cf3135ac5a [maven-release-plugin] prepare for next development iteration 2024-05-14 12:32:12 +02:00
Claudio Atzori 2502d512d1 [maven-release-plugin] prepare release dhp-schemas-6.1.2 2024-05-14 12:32:05 +02:00
Claudio Atzori 3531ac7f66 Merge pull request 'project.oamandatepublications' (#33) from solr_json_model into master
Reviewed-on: #33
2024-05-14 12:27:21 +02:00
Claudio Atzori f422a58b95 added field to the JSON solr records project.oamandatepublications 2024-05-14 12:17:12 +02:00
Claudio Atzori 97df2e3c48 adding typology to organizations 2024-05-09 12:16:29 +02:00
Claudio Atzori 4a7e960409 [maven-release-plugin] prepare for next development iteration 2024-04-19 17:26:56 +02:00
Claudio Atzori a835c8db1e [maven-release-plugin] prepare release dhp-schemas-6.1.1 2024-04-19 17:26:52 +02:00
Claudio Atzori 2a4b84af79 updated changelog 2024-04-19 17:26:05 +02:00
Claudio Atzori 2324536a61 Merge pull request 'doidoost_dismiss' (#31) from doidoost_dismiss into master
Reviewed-on: #31
2024-04-19 17:24:42 +02:00
Sandro La Bruzzo b336c40970 Merge remote-tracking branch 'origin/master' into doidoost_dismiss 2024-04-11 17:39:22 +02:00
Sandro La Bruzzo 48adfff200 added some MAG costant 2024-04-11 12:06:08 +02:00
Claudio Atzori 5118d7f08a updated changelog 2024-03-27 10:30:20 +01:00
Claudio Atzori 2e2556f3c9 [maven-release-plugin] prepare for next development iteration 2024-03-22 16:11:07 +01:00
Claudio Atzori 4092dcbef2 [maven-release-plugin] prepare release dhp-schemas-6.1.0 2024-03-22 16:11:03 +01:00
Claudio Atzori 7480ec0ab3 removed equals and hashcode methods from the Oaf model, utility classes moved in dhp-common 2024-03-22 16:10:20 +01:00
Claudio Atzori 46eec69aed [maven-release-plugin] prepare for next development iteration 2024-03-22 10:24:19 +01:00
Claudio Atzori 17f69b4cb4 [maven-release-plugin] prepare release dhp-schemas-6.0.0 2024-03-22 10:24:15 +01:00
Claudio Atzori 4488c3eb60 added more model hard limits 2024-03-22 10:22:23 +01:00
Claudio Atzori 1f2b70aa95 Merge pull request 'solr json payload model' (#30) from solr_json_model into master
Reviewed-on: #30
2024-03-22 10:20:36 +01:00
Claudio Atzori 04654b16f9 WIP: included deletedbyinference flag 2024-03-12 09:55:21 +01:00
Claudio Atzori b0eec2e5bb added serialVersionUID 2024-03-06 20:49:27 +01:00
Claudio Atzori 890c039a91 WIP: updated static builders 2024-03-04 16:28:37 +01:00
Claudio Atzori da06e17041 WIP: updated alternative titles definition 2024-03-04 10:58:35 +01:00
Claudio Atzori db99c7f113 WIP: defining model classes used to store the json payload in the Solr documents 2024-03-01 15:25:28 +01:00
Claudio Atzori f6745a9d30 WIP: defining model classes used to store the json payload in the Solr documents 2024-03-01 12:26:58 +01:00
Claudio Atzori 6b3165bec2 [maven-release-plugin] prepare for next development iteration 2024-01-29 16:34:20 +01:00
Claudio Atzori 9758ef9a78 [maven-release-plugin] prepare release dhp-schemas-5.17.3 2024-01-29 16:34:16 +01:00
Claudio Atzori 79eaae42ff Merge branch 'master' of https://code-repo.d4science.org/D-Net/dhp-schemas 2024-01-29 16:32:46 +01:00
Claudio Atzori 1b285cca59 bumped version, updated changelog 2024-01-29 16:32:36 +01:00
Claudio Atzori 9ef028aca1 Merge pull request 'Transformative agreement' (#29) from transformative_agreement into master
Reviewed-on: #29
2024-01-29 16:29:00 +01:00
Claudio Atzori ad42b0ac3c added result level textual field to store the transformative agreement information 2024-01-29 16:28:14 +01:00
Claudio Atzori b5f29dc17c Merge pull request 'code of conduct and contributing' (#28) from contributing into master
Reviewed-on: #28
2024-01-24 15:40:07 +01:00
Claudio Atzori bb630de8ab added code of conduct and contributing files 2024-01-24 10:45:44 +01:00
Claudio Atzori 90afc76f5f [maven-release-plugin] prepare for next development iteration 2024-01-10 14:54:58 +01:00
Claudio Atzori 49aef3cf22 [maven-release-plugin] prepare release dhp-schemas-4.17.3 2024-01-10 14:54:54 +01:00
Claudio Atzori e3f4cb9cc0 integrated changes from contextInEntities PR#27, updated CHANGES.md 2024-01-10 14:45:01 +01:00
Miriam Baglioni 70cc447dbb apdate the changelog 2024-01-10 12:12:17 +01:00
Miriam Baglioni 3aa0ea4123 moving context at the level of the entity 2024-01-10 12:07:33 +01:00
Claudio Atzori 2dcdb69c16 Update 'CHANGES.md' 2023-12-19 10:26:41 +01:00
Claudio Atzori 1491dd6708 Update 'CHANGES.md' 2023-11-20 11:35:05 +01:00
Claudio Atzori a2105fe6e2 [maven-release-plugin] prepare for next development iteration 2023-10-25 11:33:08 +02:00
Claudio Atzori 40b86f1e4c [maven-release-plugin] prepare release dhp-schemas-4.17.2 2023-10-25 11:33:04 +02:00
Alessia Bardi 77a12c0a2d Merge pull request 'COAR based resource & irish tender fields' (#25) from resource_types into master
Reviewed-on: #25
2023-10-25 11:08:49 +02:00
Claudio Atzori d9a988c3f1 merged latest fix from the master branch 2023-10-25 10:02:10 +02:00
Claudio Atzori 6067254a6c extended changelog 2023-10-25 10:00:14 +02:00
Claudio Atzori 58fd156d5d [maven-release-plugin] prepare for next development iteration 2023-10-20 22:25:29 +02:00
Claudio Atzori 3ccee68e0e [maven-release-plugin] prepare release dhp-schemas-3.17.2 2023-10-20 22:25:25 +02:00
Claudio Atzori c54607f8ab Merge pull request 'fix_merge_instance' (#26) from fix_merge_instance into master
Reviewed-on: #26
2023-10-20 22:24:31 +02:00
Claudio Atzori efe30b1637 pom version 2023-10-20 22:23:54 +02:00
Claudio Atzori b54f4eabe7 return the base instance when merging an empty enrichment 2023-10-20 14:33:03 +02:00
Claudio Atzori 9ec184ff15 Introduced fields for the Irish tender 2023-10-16 12:59:29 +02:00
Claudio Atzori d56343164b added fields required by the Irish tender 2023-10-13 09:08:00 +02:00
Claudio Atzori fd56e17442 Introducing InstanceTypeMapping 2023-10-11 10:33:02 +02:00
Claudio Atzori 6ce896ca0a [maven-release-plugin] prepare for next development iteration 2023-06-12 13:42:17 +02:00
Claudio Atzori c341fe012b [maven-release-plugin] prepare release dhp-schemas-3.17.1 2023-06-12 13:42:13 +02:00
Claudio Atzori f57efd75b5 udpated changelog 2023-06-12 13:41:24 +02:00
Claudio Atzori 28b81c55bb added extra organization specific PID types 2023-06-12 13:39:00 +02:00
Claudio Atzori f32852e3dd Merge pull request 'instance level fulltext' (#24) from instance_fulltext into master
Reviewed-on: #24
2023-06-12 13:36:45 +02:00
Claudio Atzori 66ffad1ca0 bumped version 2023-05-26 15:09:20 +02:00
Claudio Atzori 7a285680a0 added fulltext field on the instance level 2023-05-25 16:28:13 +02:00
Claudio Atzori fdf0115f81 [maven-release-plugin] prepare for next development iteration 2023-02-21 16:17:15 +01:00
Claudio Atzori 145aeb2295 [maven-release-plugin] prepare release dhp-schemas-3.16.0 2023-02-21 16:17:11 +01:00
Claudio Atzori c216f79e8e bumped version, updated changelog 2023-02-21 16:16:23 +01:00
Miriam Baglioni 0327320b53 [UsageCount] Added measure at the level of the OafEntity 2023-02-10 16:50:19 +01:00
92 changed files with 4968 additions and 1494 deletions

View File

@ -4,9 +4,16 @@
| **Version** | **Changes** | **Readiness** |
|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|
| 3.15.0 | [Graph model] </br> <ul><li>added w3id as PID type, with ROHub as authority.</li> <ul> | beta |
| 3.14.0 | [Graph model] </br> <ul><li>introduced specific type for result.subject</li> <ul> | beta |
| 2.13.0 | [Scholexplorer] </br> <ul><li>update swagger annotation jar version to be compatible with new implementation of openAPI ui</li> <ul> | beta |
| 6.1.1 | [Graph model] </br> <ul><li>Introduced constants used in the DOIBoost dismission.</li></ul> | beta |
| 6.1.0 | [Graph model] </br> <ul><li>Introduced model classes to provide a JSON representation of records embedding information from the related entities.</li></ul> | beta |
| 5.17.3 | [Graph model] </br> <ul><li>added result level textual field to store the transformative agreement information.</li></ul> | beta |
| 4.17.3 | [Graph model] </br> <ul><li>moved context at the level of the entity. </li></ul> | beta |
| 4.17.2 | [Graph model] </br> <ul><li>added InstaceTypeMapping field on the instance level.</li><li>new result level fields to support the activities in the Irish tender `isGreen`, `openAccessColor`, `isInDiamondJournal`, `publiclyFunded`</li><ul> | production |
| 3.17.1 | [Graph model] </br> <ul><li>added fulltext field on the instance level.</li><li>added extra organization specific PID types</li><ul> | production |
| 3.16.0 | [Graph model] </br> <ul><li>added entity level measures.</li><ul> | production |
| 3.15.0 | [Graph model] </br> <ul><li>added w3id as PID type, with ROHub as authority.</li> <ul> | production |
| 3.14.0 | [Graph model] </br> <ul><li>introduced specific type for result.subject</li> <ul> | production |
| 2.13.0 | [Scholexplorer] </br> <ul><li>update swagger annotation jar version to be compatible with new implementation of openAPI ui</li> <ul> | production |
| 2.12.1 | [Graph model] </br> <ul><li>added field oafEntity.eoscifguidelines</li> <ul> | production |
| 2.12.0 | [Graph model] </br> <ul><li>Introducing EOSC Services as datasources</li> <ul> | production |
| 2.11.33 | [Scholexplorer] </br> <ul><li>Moved Scholix API Data model into dhp-schemas</li><li>implementation of the compareTo method on Scholix objects and all model properties</li> <li>Unit Test to verify that compareTo works on different case</li> <ul> | production |

43
CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1,43 @@
# Contributor Code of Conduct
Openness, transparency and our community-driven participatory approach guide us in our day-to-day interactions and decision-making. Our open source projects are no exception. Trust, respect, collaboration and transparency are core values we believe should live and breathe within our projects. Our community welcomes participants from around the world with different experiences, unique perspectives, and great ideas to share.
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Attempting collaboration before conflict
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
- Violence, threats of violence, or inciting others to commit self-harm
- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, intentionally spreading misinformation, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Abuse of the reporting process to intentionally harass or exclude others
- Advocating for, or encouraging, any of the above behavior
- Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), [version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html).

10
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,10 @@
# Contributing to D-Net Hadoop
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
This project and everyone participating in it is governed by our [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [dnet-team@isti.cnr.it](mailto:dnet-team@isti.cnr.it).
The following is a set of guidelines for contributing to this project and its packages. These are mostly guidelines, not rules, which applies to this project as a while, including all its sub-modules.
Use your best judgment, and feel free to propose changes to this document in a pull request.
All contributions are welcome, all contributions will be considered to be contributed under the [project license](#LICENSE.md).

View File

View File

@ -1,5 +1,14 @@
Description of the project
--------------------------
Introduction
====================
This project adheres to the Contributor Covenant [code of conduct](CODE_OF_CONDUCT.md).
By participating, you are expected to uphold this code. Please report unacceptable behavior to [dnet-team@isti.cnr.it](mailto:dnet-team@isti.cnr.it).
This project is licensed under the [AGPL v3 or later version](#LICENSE.md).
Purpose
====================
This project defines **object schemas** of the OpenAIRE main entities and the relationships that intercur among them.
Namely it defines the model for
@ -7,5 +16,8 @@ Namely it defines the model for
- the scholexplorer content representation, defined under the package `eu.dnetlib.dhp.schema.sx`
- the contents acquired from the metadata aggregation subsystem, defined under the package `eu.dnetlib.dhp.schema.mdstore`
- the ORCID common schemas, defined under the package `eu.dnetlib.dhp.schema.orcid`
- the Solr common schemas used to represent the information returned to the Explore portal and the APIs, defined under
the package `eu.dnetlib.dhp.schema.solr`
Te serialization of such objects (data store files) are used to pass data between workflow nodes in the processing pipeline.
The serialization of such objects (data store files) are used to pass data between workflow nodes in the processing pipeline
and / or intended to be shared across components.

View File

@ -5,7 +5,7 @@
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>dhp-schemas</artifactId>
<packaging>jar</packaging>
<version>4.0.0-SNAPSHOT</version>
<version>6.1.3-SNAPSHOT</version>
<licenses>
<license>

View File

@ -0,0 +1,69 @@
package eu.dnetlib.dhp.schema.common;
import java.util.Comparator;
import eu.dnetlib.dhp.schema.oaf.Qualifier;
public class AccessRightComparator<T extends Qualifier> implements Comparator<T> {
@Override
public int compare(T left, T right) {
if (left == null && right == null)
return 0;
if (left == null)
return 1;
if (right == null)
return -1;
String lClass = left.getClassid();
String rClass = right.getClassid();
if (lClass.equals(rClass))
return 0;
if (lClass.equals("OPEN SOURCE"))
return -1;
if (rClass.equals("OPEN SOURCE"))
return 1;
if (lClass.equals("OPEN"))
return -1;
if (rClass.equals("OPEN"))
return 1;
if (lClass.equals("6MONTHS"))
return -1;
if (rClass.equals("6MONTHS"))
return 1;
if (lClass.equals("12MONTHS"))
return -1;
if (rClass.equals("12MONTHS"))
return 1;
if (lClass.equals("EMBARGO"))
return -1;
if (rClass.equals("EMBARGO"))
return 1;
if (lClass.equals("RESTRICTED"))
return -1;
if (rClass.equals("RESTRICTED"))
return 1;
if (lClass.equals("CLOSED"))
return -1;
if (rClass.equals("CLOSED"))
return 1;
if (lClass.equals("UNKNOWN"))
return -1;
if (rClass.equals("UNKNOWN"))
return 1;
// Else (but unlikely), lexicographical ordering will do.
return lClass.compareTo(rClass);
}
}

View File

@ -0,0 +1,21 @@
package eu.dnetlib.dhp.schema.common;
import eu.dnetlib.dhp.schema.oaf.OafEntity;
/** Actual entity types in the Graph */
public enum EntityType {
publication, dataset, otherresearchproduct, software, datasource, organization, project;
/**
* Resolves the EntityType, given the relative class name
*
* @param clazz the given class name
* @param <T> actual OafEntity subclass
* @return the EntityType associated to the given class
*/
public static <T extends OafEntity> EntityType fromClass(Class<T> clazz) {
return EntityType.valueOf(clazz.getSimpleName().toLowerCase());
}
}

View File

@ -0,0 +1,7 @@
package eu.dnetlib.dhp.schema.common;
/** Main entity types in the Graph */
public enum MainEntityType {
result, datasource, organization, project
}

View File

@ -0,0 +1,261 @@
package eu.dnetlib.dhp.schema.common;
import eu.dnetlib.dhp.schema.oaf.AccessRight;
import eu.dnetlib.dhp.schema.oaf.DataInfo;
import eu.dnetlib.dhp.schema.oaf.KeyValue;
import eu.dnetlib.dhp.schema.oaf.Qualifier;
public class ModelConstants {
private ModelConstants() {}
public static final String ORCID = "orcid";
public static final String ORCID_PENDING = "orcid_pending";
public static final String ORCID_CLASSNAME = "Open Researcher and Contributor ID";
public static final String ORCID_DS = ORCID.toUpperCase();
public static final String CROSSREF_ID = "10|openaire____::081b82f96300b6a6e3d282bad31cb6e2";
public static final String MAG_ID ="10|openaire____::5f532a3fc4f1ea403f37070f59a7a53a";
public static final String DATACITE_ID = "10|openaire____::9e3be59865b2c1c335d32dae2fe7b254";
public static final String ZENODO_OD_ID = "10|opendoar____::358aee4cc897452c00244351e4d91f69";
public static final String ZENODO_R3_ID = "10|re3data_____::7b0ad08687b2c960d5aeef06f811d5e6";
public static final String EUROPE_PUBMED_CENTRAL_ID = "10|opendoar____::8b6dd7db9af49e67306feb59a8bdc52c";
public static final String PUBMED_CENTRAL_ID = "10|opendoar____::eda80a3d5b344bc40f3bc04f65b7a357";
public static final String ARXIV_ID = "10|opendoar____::6f4922f45568161a8cdf4ad2299f6d23";
public static final String ROHUB_ID = "10|fairsharing_::1b69ebedb522700034547abc5652ffac";
public static final String OPENORGS_NAME = "OpenOrgs Database";
public static final String MAG_NAME = "Microsoft Academic Graph";
public static final String OPENOCITATIONS_NAME = "OpenCitations";
public static final String OPENOCITATIONS_ID = "10|openaire____::c06df618c5de1c786535ccf3f8b7b059";
public static final String OPEN_APC_NAME = "OpenAPC Global Initiative";
public static final String OPEN_APC_ID = "10|apc_________::e2b1600b229fc30663c8a1f662debddf";
// VOCABULARY VALUE
public static final String ACCESS_RIGHT_OPEN = "OPEN";
public static final String ACCESS_RIGHT_EMBARGO = "EMBARGO";
public static final String ACCESS_RIGHT_CLOSED = "CLOSED";
public static final String DNET_SUBJECT_KEYWORD = "keyword";
public static final String DNET_SUBJECT_FOS_CLASSID = "FOS";
public static final String DNET_SUBJECT_FOS_CLASSNAME = "Fields of Science and Technology classification";
public static final String DNET_SUBJECT_TYPOLOGIES = "dnet:subject_classification_typologies";
public static final String DNET_RESULT_TYPOLOGIES = "dnet:result_typologies";
public static final String DNET_PUBLICATION_RESOURCE = "dnet:publication_resource";
public static final String DNET_ACCESS_MODES = "dnet:access_modes";
public static final String DNET_LANGUAGES = "dnet:languages";
public static final String DNET_PID_TYPES = "dnet:pid_types";
public static final String DNET_DATACITE_DATE = "dnet:dataCite_date";
public static final String DNET_DATACITE_TITLE = "dnet:dataCite_title";
public static final String DNET_DATA_CITE_RESOURCE = "dnet:dataCite_resource";
public static final String DNET_PROVENANCE_ACTIONS = "dnet:provenanceActions";
public static final String DNET_COUNTRY_TYPE = "dnet:countries";
public static final String DNET_REVIEW_LEVELS = "dnet:review_levels";
public static final String DNET_PROGRAMMING_LANGUAGES = "dnet:programming_languages";
public static final String DNET_EXTERNAL_REFERENCE_TYPE = "dnet:externalReference_typologies";
public static final String DNET_RELATION_RELTYPE = "dnet:relation_relType";
public static final String DNET_RELATION_SUBRELTYPE = "dnet:relation_subRelType";
public static final String DNET_RELATION_RELCLASS = "dnet:relation_relClass";
public static final String OPENAIRE_COAR_RESOURCE_TYPES_3_1 = "openaire::coar_resource_types_3_1";
public static final String OPENAIRE_USER_RESOURCE_TYPES = "openaire::user_resource_types";
public static final String OPENAIRE_META_RESOURCE_TYPE = "openaire::meta_resource_types";
public static final String PEER_REVIEWED_CLASSNAME = "nonPeerReviewed";
public static final String NON_PEER_REVIEWED_CLASSNAME = "nonPeerReviewed";
public static final String PEER_REVIEWED_CLASSID = "0001";
public static final String NON_PEER_REVIEWED_CLASSID = "0002";
public static final String SYSIMPORT_CROSSWALK_REPOSITORY = "sysimport:crosswalk:repository";
public static final String SYSIMPORT_CROSSWALK_ENTITYREGISTRY = "sysimport:crosswalk:entityregistry";
public static final String SYSIMPORT_ACTIONSET = "sysimport:actionset";
public static final String SYSIMPORT_ORCID_NO_DOI = "sysimport:actionset:orcidworks-no-doi";
public static final String USER_CLAIM = "user:claim";
public static final String HARVESTED = "Harvested";
public static final String PROVENANCE_DEDUP = "sysimport:dedup";
public static final String PROVENANCE_ENRICH = "sysimport:enrich";
public static final Qualifier PROVENANCE_ACTION_SET_QUALIFIER = qualifier(
SYSIMPORT_ACTIONSET, SYSIMPORT_ACTIONSET, DNET_PROVENANCE_ACTIONS, DNET_PROVENANCE_ACTIONS);
public static final String DATASET_RESULTTYPE_CLASSID = "dataset";
public static final String PUBLICATION_RESULTTYPE_CLASSID = "publication";
public static final String SOFTWARE_RESULTTYPE_CLASSID = "software";
public static final String ORP_RESULTTYPE_CLASSID = "other";
public static final String RESULT_RESULT = "resultResult"; // relType
/**
* @deprecated Use {@link ModelConstants#RELATIONSHIP} instead.
*/
@Deprecated
public static final String PUBLICATION_DATASET = "publicationDataset"; // subreltype
public static final String SUPPLEMENT = "supplement"; // subreltype
public static final String IS_SUPPLEMENT_TO = "IsSupplementTo";
public static final String IS_SUPPLEMENTED_BY = "IsSupplementedBy";
public static final String PART = "part"; // subreltype
public static final String IS_PART_OF = "IsPartOf";
public static final String HAS_PART = "HasPart";
public static final String RELATIONSHIP = "relationship"; // subreltype
public static final String IS_RELATED_TO = "IsRelatedTo";
public static final String IS_IDENTICAL_TO = "IsIdenticalTo";
public static final String REFERENCES = "References";
public static final String IS_REFERENCED_BY = "IsReferencedBy";
public static final String CONTINUES = "Continues";
public static final String IS_CONTINUED_BY = "IsContinuedBy";
public static final String DOCUMENTS = "Documents";
public static final String IS_DOCUMENTED_BY = "IsDocumentedBy";
public static final String IS_SOURCE_OF = "IsSourceOf";
public static final String IS_DERIVED_FROM = "IsDerivedFrom";
public static final String COMPILES = "Compiles";
public static final String IS_COMPILED_BY = "IsCompiledBy";
public static final String DESCRIBES = "Describes";
public static final String IS_DESCRIBED_BY = "IsDescribedBy";
public static final String IS_METADATA_FOR = "IsMetadataFor";
public static final String IS_METADATA_OF = "IsMetadataOf";
public static final String HAS_ASSOCIATION_WITH = "HasAssociationWith";
public static final String IS_REQUIRED_BY = "IsRequiredBy";
public static final String REQUIRES = "Requires";
public static final String CITATION = "citation"; // subreltype
public static final String CITES = "Cites";
public static final String IS_CITED_BY = "IsCitedBy";
public static final String REVIEW = "review"; // subreltype
public static final String REVIEWS = "Reviews";
public static final String IS_REVIEWED_BY = "IsReviewedBy";
public static final String VERSION = "version"; // subreltype
public static final String IS_VERSION_OF = "IsVersionOf";
public static final String HAS_VERSION = "HasVersion";
public static final String IS_PREVIOUS_VERSION_OF = "IsPreviousVersionOf";
public static final String IS_NEW_VERSION_OF = "IsNewVersionOf";
public static final String IS_VARIANT_FORM_OF = "IsVariantFormOf";
public static final String IS_ORIGINAL_FORM_OF = "IsOriginalFormOf";
public static final String IS_OBSOLETED_BY = "IsObsoletedBy";
public static final String OBSOLETES = "Obsoletes";
public static final String RESULT_PROJECT = "resultProject"; // relType
public static final String OUTCOME = "outcome"; // subreltype
public static final String IS_PRODUCED_BY = "isProducedBy";
public static final String PRODUCES = "produces";
public static final String DATASOURCE_ORGANIZATION = "datasourceOrganization"; // relType
public static final String PROVISION = "provision"; // subreltype
public static final String IS_PROVIDED_BY = "isProvidedBy";
public static final String PROVIDES = "provides";
public static final String PROJECT_ORGANIZATION = "projectOrganization"; // relType
public static final String PARTICIPATION = "participation"; // subreltype
public static final String HAS_PARTICIPANT = "hasParticipant";
public static final String IS_PARTICIPANT = "isParticipant";
public static final String RESULT_ORGANIZATION = "resultOrganization"; // relType
public static final String AFFILIATION = "affiliation"; // subreltype
public static final String IS_AUTHOR_INSTITUTION_OF = "isAuthorInstitutionOf";
public static final String HAS_AUTHOR_INSTITUTION = "hasAuthorInstitution";
public static final String ORG_ORG_RELTYPE = "organizationOrganization"; // relType
public static final String IS_PARENT_OF = "IsParentOf";
public static final String IS_CHILD_OF = "IsChildOf";
public static final String DEDUP = "dedup"; // subreltype
public static final String MERGES = "merges";
public static final String IS_MERGED_IN = "isMergedIn";
public static final String SIMILARITY = "similarity"; // subreltype
public static final String IS_SIMILAR_TO = "isSimilarTo";
public static final String IS_AMONG_TOP_N_SIMILAR_DOCS = "IsAmongTopNSimilarDocuments";
public static final String HAS_AMONG_TOP_N_SIMILAR_DOCS = "HasAmongTopNSimilarDocuments";
public static final String IS_DIFFERENT_FROM = "isDifferentFrom";
public static final String UNKNOWN = "UNKNOWN";
public static final String NOT_AVAILABLE = "not available";
public static final Qualifier PUBLICATION_DEFAULT_RESULTTYPE = qualifier(
PUBLICATION_RESULTTYPE_CLASSID, PUBLICATION_RESULTTYPE_CLASSID,
DNET_RESULT_TYPOLOGIES, DNET_RESULT_TYPOLOGIES);
public static final Qualifier DATASET_DEFAULT_RESULTTYPE = qualifier(
DATASET_RESULTTYPE_CLASSID, DATASET_RESULTTYPE_CLASSID,
DNET_RESULT_TYPOLOGIES, DNET_RESULT_TYPOLOGIES);
public static final Qualifier SOFTWARE_DEFAULT_RESULTTYPE = qualifier(
SOFTWARE_RESULTTYPE_CLASSID, SOFTWARE_RESULTTYPE_CLASSID,
DNET_RESULT_TYPOLOGIES, DNET_RESULT_TYPOLOGIES);
public static final Qualifier ORP_DEFAULT_RESULTTYPE = qualifier(
ORP_RESULTTYPE_CLASSID, ORP_RESULTTYPE_CLASSID,
DNET_RESULT_TYPOLOGIES, DNET_RESULT_TYPOLOGIES);
public static final Qualifier REPOSITORY_PROVENANCE_ACTIONS = qualifier(
SYSIMPORT_CROSSWALK_REPOSITORY, SYSIMPORT_CROSSWALK_REPOSITORY,
DNET_PROVENANCE_ACTIONS, DNET_PROVENANCE_ACTIONS);
public static final Qualifier ENTITYREGISTRY_PROVENANCE_ACTION = qualifier(
SYSIMPORT_CROSSWALK_ENTITYREGISTRY, SYSIMPORT_CROSSWALK_ENTITYREGISTRY,
DNET_PROVENANCE_ACTIONS, DNET_PROVENANCE_ACTIONS);
public static final String UNKNOWN_REPOSITORY_ORIGINALID = "openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18";
public static final KeyValue UNKNOWN_REPOSITORY = keyValue(
"10|openaire____::55045bd2a65019fd8e6741a755395c8c", "Unknown Repository");
public static final Qualifier UNKNOWN_COUNTRY = qualifier(UNKNOWN, "Unknown", DNET_COUNTRY_TYPE, DNET_COUNTRY_TYPE);
public static final Qualifier MAIN_TITLE_QUALIFIER = qualifier(
"main title", "main title", DNET_DATACITE_TITLE, DNET_DATACITE_TITLE);
public static final Qualifier ALTERNATIVE_TITLE_QUALIFIER = qualifier(
"alternative title", "alternative title", DNET_DATACITE_TITLE, DNET_DATACITE_TITLE);
public static final Qualifier SUBTITLE_QUALIFIER = qualifier(
"subtitle", "subtitle", DNET_DATACITE_TITLE, DNET_DATACITE_TITLE);
public static final AccessRight OPEN_ACCESS_RIGHT() {
final AccessRight result = new AccessRight();
result.setClassid(ACCESS_RIGHT_OPEN);
result.setClassid(ACCESS_RIGHT_OPEN);
result.setSchemeid(ModelConstants.DNET_ACCESS_MODES);
result.setSchemename(ModelConstants.DNET_ACCESS_MODES);
return result;
}
private static Qualifier qualifier(
final String classid,
final String classname,
final String schemeid,
final String schemename) {
final Qualifier q = new Qualifier();
q.setClassid(classid);
q.setClassname(classname);
q.setSchemeid(schemeid);
q.setSchemename(schemename);
return q;
}
private static KeyValue keyValue(final String key, final String value) {
final KeyValue kv = new KeyValue();
kv.setKey(key);
kv.setValue(value);
kv.setDataInfo(new DataInfo());
return kv;
}
}

View File

@ -0,0 +1,412 @@
package eu.dnetlib.dhp.schema.common;
import static com.google.common.base.Preconditions.checkArgument;
import static eu.dnetlib.dhp.schema.common.ModelConstants.*;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.ParseException;
import java.util.Date;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Function;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.lang3.StringUtils;
import com.github.sisyphsu.dateparser.DateParserUtils;
import com.google.common.collect.Maps;
import eu.dnetlib.dhp.schema.oaf.*;
/** Oaf model utility methods. */
public class ModelSupport {
/** Defines the mapping between the actual entity type and the main entity type */
private static final Map<EntityType, MainEntityType> entityMapping = Maps.newHashMap();
static {
entityMapping.put(EntityType.publication, MainEntityType.result);
entityMapping.put(EntityType.dataset, MainEntityType.result);
entityMapping.put(EntityType.otherresearchproduct, MainEntityType.result);
entityMapping.put(EntityType.software, MainEntityType.result);
entityMapping.put(EntityType.datasource, MainEntityType.datasource);
entityMapping.put(EntityType.organization, MainEntityType.organization);
entityMapping.put(EntityType.project, MainEntityType.project);
}
/**
* Defines the mapping between the actual entity types and the relative classes implementing them
*/
public static final Map<EntityType, Class> entityTypes = Maps.newHashMap();
static {
entityTypes.put(EntityType.datasource, Datasource.class);
entityTypes.put(EntityType.organization, Organization.class);
entityTypes.put(EntityType.project, Project.class);
entityTypes.put(EntityType.dataset, Dataset.class);
entityTypes.put(EntityType.otherresearchproduct, OtherResearchProduct.class);
entityTypes.put(EntityType.software, Software.class);
entityTypes.put(EntityType.publication, Publication.class);
}
public static final Map<String, Class> oafTypes = Maps.newHashMap();
static {
oafTypes.put("datasource", Datasource.class);
oafTypes.put("organization", Organization.class);
oafTypes.put("project", Project.class);
oafTypes.put("dataset", Dataset.class);
oafTypes.put("otherresearchproduct", OtherResearchProduct.class);
oafTypes.put("software", Software.class);
oafTypes.put("publication", Publication.class);
oafTypes.put("relation", Relation.class);
}
public static final Map<Class, String> idPrefixMap = Maps.newHashMap();
static {
idPrefixMap.put(Datasource.class, "10");
idPrefixMap.put(Organization.class, "20");
idPrefixMap.put(Project.class, "40");
idPrefixMap.put(Dataset.class, "50");
idPrefixMap.put(OtherResearchProduct.class, "50");
idPrefixMap.put(Software.class, "50");
idPrefixMap.put(Publication.class, "50");
}
public static final Map<String, String> entityIdPrefix = Maps.newHashMap();
static {
entityIdPrefix.put("datasource", "10");
entityIdPrefix.put("organization", "20");
entityIdPrefix.put("project", "40");
entityIdPrefix.put("result", "50");
}
public static final Map<String, String> idPrefixEntity = Maps.newHashMap();
static {
idPrefixEntity.put("10", "datasource");
idPrefixEntity.put("20", "organization");
idPrefixEntity.put("40", "project");
idPrefixEntity.put("50", "result");
}
public static final Map<String, RelationInverse> relationInverseMap = Maps.newHashMap();
static {
set(relationInverseMap, PROJECT_ORGANIZATION, PARTICIPATION, IS_PARTICIPANT, HAS_PARTICIPANT);
set(relationInverseMap, RESULT_ORGANIZATION, AFFILIATION, IS_AUTHOR_INSTITUTION_OF, HAS_AUTHOR_INSTITUTION);
set(relationInverseMap, ORG_ORG_RELTYPE, DEDUP, IS_MERGED_IN, MERGES);
set(relationInverseMap, ORG_ORG_RELTYPE, DEDUP, IS_SIMILAR_TO, IS_SIMILAR_TO);
set(relationInverseMap, RESULT_PROJECT, OUTCOME, IS_PRODUCED_BY, PRODUCES);
set(relationInverseMap, DATASOURCE_ORGANIZATION, PROVISION, IS_PROVIDED_BY, PROVIDES);
set(relationInverseMap, RESULT_RESULT, SIMILARITY, IS_AMONG_TOP_N_SIMILAR_DOCS, HAS_AMONG_TOP_N_SIMILAR_DOCS);
set(relationInverseMap, RESULT_RESULT, SUPPLEMENT, IS_SUPPLEMENT_TO, IS_SUPPLEMENTED_BY);
set(relationInverseMap, RESULT_RESULT, PART, IS_PART_OF, HAS_PART);
set(relationInverseMap, RESULT_RESULT, DEDUP, IS_MERGED_IN, MERGES);
set(relationInverseMap, RESULT_RESULT, DEDUP, IS_SIMILAR_TO, IS_SIMILAR_TO);
set(relationInverseMap, RESULT_RESULT, CITATION, IS_CITED_BY, CITES);
set(relationInverseMap, RESULT_RESULT, RELATIONSHIP, IS_IDENTICAL_TO, IS_IDENTICAL_TO);
set(relationInverseMap, RESULT_RESULT, RELATIONSHIP, IS_REFERENCED_BY, REFERENCES);
set(relationInverseMap, RESULT_RESULT, RELATIONSHIP, IS_CONTINUED_BY, CONTINUES);
set(relationInverseMap, RESULT_RESULT, RELATIONSHIP, IS_DOCUMENTED_BY, DOCUMENTS);
set(relationInverseMap, RESULT_RESULT, RELATIONSHIP, IS_DERIVED_FROM, IS_SOURCE_OF);
set(relationInverseMap, RESULT_RESULT, RELATIONSHIP, IS_RELATED_TO, IS_RELATED_TO);
set(relationInverseMap, RESULT_RESULT, RELATIONSHIP, IS_COMPILED_BY, COMPILES);
set(relationInverseMap, RESULT_RESULT, RELATIONSHIP, IS_DESCRIBED_BY, DESCRIBES);
set(relationInverseMap, RESULT_RESULT, RELATIONSHIP, IS_METADATA_FOR, IS_METADATA_OF);
set(relationInverseMap, RESULT_RESULT, RELATIONSHIP, HAS_ASSOCIATION_WITH, HAS_ASSOCIATION_WITH);
set(relationInverseMap, RESULT_RESULT, RELATIONSHIP, IS_REQUIRED_BY, REQUIRES);
set(relationInverseMap, RESULT_RESULT, VERSION, IS_PREVIOUS_VERSION_OF, IS_NEW_VERSION_OF);
set(relationInverseMap, RESULT_RESULT, VERSION, IS_VARIANT_FORM_OF, IS_ORIGINAL_FORM_OF);
set(relationInverseMap, RESULT_RESULT, VERSION, IS_OBSOLETED_BY, OBSOLETES);
set(relationInverseMap, RESULT_RESULT, VERSION, IS_VERSION_OF, HAS_VERSION);
set(relationInverseMap, RESULT_RESULT, REVIEW, IS_REVIEWED_BY, REVIEWS);
}
private static void set(Map<String, RelationInverse> relationInverseMap, String relType, String subRelType, String relClass, String inverseRelClass) {
relationInverseMap
.put(
rel(relType, subRelType, relClass), new RelationInverse()
.setInverseRelClass(inverseRelClass)
.setRelClass(relClass)
.setRelType(relType)
.setSubReltype(subRelType));
if (!relClass.equals(inverseRelClass)) {
relationInverseMap
.put(
rel(relType, subRelType, inverseRelClass), new RelationInverse()
.setInverseRelClass(relClass)
.setRelClass(inverseRelClass)
.setRelType(relType)
.setSubReltype(subRelType));
}
}
/**
* Helper method: lookup relation inverse, given the direct relation encoding (case insensitive)
* @param encoding
* @return the relation inverse descriptor, throws @IllegalArgumentException when not found.
*/
public static RelationInverse findInverse(String encoding) {
return ModelSupport.relationInverseMap
.entrySet()
.stream()
.filter(r -> encoding.equalsIgnoreCase(r.getKey()))
.findFirst()
.map(r -> r.getValue())
.orElseThrow(() -> new IllegalArgumentException("invalid relationship: " + encoding));
}
/**
* Helper method: fina a relation filtering by a relation name
* @param relationName
* @return
*/
public static RelationInverse findRelation(final String relationName) {
return relationInverseMap.values()
.stream()
.filter(r -> relationName.equalsIgnoreCase(r.getRelClass()))
.findFirst()
.orElse(null);
}
/**
* Helper method: combines the relation attributes
* @param relType
* @param subRelType
* @param relClass
* @return
*/
public static String rel(String relType, String subRelType, String relClass) {
return String.format("%s_%s_%s", relType, subRelType, relClass);
}
private static final String schemeTemplate = "dnet:%s_%s_relations";
public static final String DATE_FORMAT = "yyyy-MM-dd";
private ModelSupport() {
}
public static <E extends OafEntity> String getIdPrefix(Class<E> clazz) {
return idPrefixMap.get(clazz);
}
/**
* Checks subclass-superclass relationship.
*
* @param subClazzObject Subclass object instance
* @param superClazzObject Superclass object instance
* @param <X> Subclass type
* @param <Y> Superclass type
* @return True if X is a subclass of Y
*/
public static <X extends Oaf, Y extends Oaf> Boolean isSubClass(
X subClazzObject, Y superClazzObject) {
return isSubClass(subClazzObject.getClass(), superClazzObject.getClass());
}
/**
* Checks subclass-superclass relationship.
*
* @param subClazzObject Subclass object instance
* @param superClazz Superclass class
* @param <X> Subclass type
* @param <Y> Superclass type
* @return True if X is a subclass of Y
*/
public static <X extends Oaf, Y extends Oaf> Boolean isSubClass(
X subClazzObject, Class<Y> superClazz) {
return isSubClass(subClazzObject.getClass(), superClazz);
}
/**
* Checks subclass-superclass relationship.
*
* @param subClazz Subclass class
* @param superClazz Superclass class
* @param <X> Subclass type
* @param <Y> Superclass type
* @return True if X is a subclass of Y
*/
public static <X extends Oaf, Y extends Oaf> Boolean isSubClass(
Class<X> subClazz, Class<Y> superClazz) {
return superClazz.isAssignableFrom(subClazz);
}
/**
* Lists all the OAF model classes
*
* @param <T>
* @return
*/
public static <T extends Oaf> Class<T>[] getOafModelClasses() {
return new Class[] {
Author.class,
Context.class,
Country.class,
DataInfo.class,
Dataset.class,
Datasource.class,
ExternalReference.class,
ExtraInfo.class,
Field.class,
GeoLocation.class,
Instance.class,
AccessRight.class,
OpenAccessRoute.class,
Journal.class,
KeyValue.class,
Oaf.class,
OafEntity.class,
OAIProvenance.class,
Organization.class,
OriginDescription.class,
OtherResearchProduct.class,
Project.class,
Publication.class,
Qualifier.class,
Relation.class,
Result.class,
Software.class,
StructuredProperty.class
};
}
public static String getMainType(final EntityType type) {
return entityMapping.get(type).name();
}
public static boolean isResult(EntityType type) {
return MainEntityType.result.name().equals(getMainType(type));
}
public static String getScheme(final String sourceType, final String targetType) {
return String
.format(
schemeTemplate,
entityMapping.get(EntityType.valueOf(sourceType)).name(),
entityMapping.get(EntityType.valueOf(targetType)).name());
}
public static <T extends Oaf> String tableIdentifier(String dbName, String tableName) {
checkArgument(StringUtils.isNotBlank(dbName), "DB name cannot be empty");
checkArgument(StringUtils.isNotBlank(tableName), "table name cannot be empty");
return String.format("%s.%s", dbName, tableName);
}
public static <T extends Oaf> String tableIdentifier(String dbName, Class<T> clazz) {
checkArgument(Objects.nonNull(clazz), "clazz is needed to derive the table name, thus cannot be null");
return tableIdentifier(dbName, clazz.getSimpleName().toLowerCase());
}
public static <T extends Oaf> Function<T, String> idFn() {
return x -> {
if (isSubClass(x, Relation.class)) {
return idFnForRelation(x);
}
return idFnForOafEntity(x);
};
}
private static <T extends Oaf> String idFnForRelation(T t) {
Relation r = (Relation) t;
return Optional
.ofNullable(r.getSource())
.map(
source -> Optional
.ofNullable(r.getTarget())
.map(
target -> Optional
.ofNullable(r.getRelType())
.map(
relType -> Optional
.ofNullable(r.getSubRelType())
.map(
subRelType -> Optional
.ofNullable(r.getRelClass())
.map(
relClass -> String
.join(
source,
target,
relType,
subRelType,
relClass))
.orElse(
String
.join(
source,
target,
relType,
subRelType)))
.orElse(String.join(source, target, relType)))
.orElse(String.join(source, target)))
.orElse(source))
.orElse(null);
}
private static <T extends Oaf> String idFnForOafEntity(T t) {
return ((OafEntity) t).getId();
}
public static String md5(final String s) {
try {
final MessageDigest md = MessageDigest.getInstance("MD5");
md.update(s.getBytes(StandardCharsets.UTF_8));
return new String(Hex.encodeHex(md.digest()));
} catch (final NoSuchAlgorithmException e) {
throw new IllegalStateException(e);
}
}
public static String generateIdentifier(final String originalId, final String nsPrefix) {
return String.format("%s::%s", nsPrefix, md5(originalId));
}
public static String oldest(String dateA, String dateB) throws ParseException {
if (StringUtils.isBlank(dateA)) {
return dateB;
}
if (StringUtils.isBlank(dateB)) {
return dateA;
}
if (StringUtils.isNotBlank(dateA) && StringUtils.isNotBlank(dateB)) {
final Date a = DateParserUtils.parseDate(dateA);
final Date b = DateParserUtils.parseDate(dateB);
if (Objects.nonNull(a) && Objects.nonNull(b)) {
return a.before(b) ? dateA : dateB;
} else {
return null;
}
} else {
return null;
}
}
}

View File

@ -0,0 +1,44 @@
package eu.dnetlib.dhp.schema.common;
import java.util.Comparator;
import eu.dnetlib.dhp.schema.oaf.Qualifier;
public class RefereedComparator implements Comparator<Qualifier> {
@Override
public int compare(Qualifier left, Qualifier right) {
if (left == null && right == null)
return 0;
if (left == null)
return 1;
if (right == null)
return -1;
String lClass = left.getClassid();
String rClass = right.getClassid();
if (lClass.equals(rClass))
return 0;
if (lClass.equals(ModelConstants.PEER_REVIEWED_CLASSID))
return -1;
if (rClass.equals(ModelConstants.PEER_REVIEWED_CLASSID))
return 1;
if (lClass.equals(ModelConstants.NON_PEER_REVIEWED_CLASSID))
return -1;
if (rClass.equals(ModelConstants.NON_PEER_REVIEWED_CLASSID))
return 1;
if (lClass.equals(ModelConstants.UNKNOWN))
return -1;
if (rClass.equals(ModelConstants.UNKNOWN))
return 1;
// Else (but unlikely), lexicographical ordering will do.
return lClass.compareTo(rClass);
}
}

View File

@ -0,0 +1,46 @@
package eu.dnetlib.dhp.schema.common;
public class RelationInverse {
private String relClass;
private String inverseRelClass;
private String relType;
private String subReltype;
public String getRelType() {
return relType;
}
public RelationInverse setRelType(String relType) {
this.relType = relType;
return this;
}
public String getSubReltype() {
return subReltype;
}
public RelationInverse setSubReltype(String subReltype) {
this.subReltype = subReltype;
return this;
}
public String getRelClass() {
return relClass;
}
public RelationInverse setRelClass(String relClass) {
this.relClass = relClass;
return this;
}
public String getInverseRelClass() {
return inverseRelClass;
}
public RelationInverse setInverseRelClass(String inverseRelClass) {
this.inverseRelClass = inverseRelClass;
return this;
}
}

View File

@ -3,6 +3,8 @@ 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
*/
@ -36,7 +38,6 @@ public class MetadataRecord implements Serializable {
}
public MetadataRecord(
String id,
String originalId,
String encoding,
Provenance provenance,
@ -48,7 +49,7 @@ public class MetadataRecord implements Serializable {
this.provenance = provenance;
this.body = body;
this.dateOfCollection = dateOfCollection;
this.id = id;
this.id = ModelSupport.generateIdentifier(originalId, this.provenance.getNsPrefix());
}
public String getId() {

View File

@ -1,6 +1,7 @@
package eu.dnetlib.dhp.schema.oaf;
import java.util.Objects;
import java.util.Optional;
/**
@ -8,6 +9,7 @@ import java.util.Optional;
*/
public class AccessRight extends Qualifier {
private static final long serialVersionUID = -8945177777173510134L;
private OpenAccessRoute openAccessRoute;
public OpenAccessRoute getOpenAccessRoute() {
@ -18,32 +20,4 @@ public class AccessRight extends Qualifier {
this.openAccessRoute = openAccessRoute;
}
@Override
public String toComparableString() {
String s = super.toComparableString();
return Optional
.ofNullable(getOpenAccessRoute())
.map(x -> s + "::" + x)
.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());
}
}

View File

@ -6,6 +6,7 @@ import java.util.*;
public class Author implements Serializable {
private static final long serialVersionUID = 1625492739044457437L;
private String fullname;
private String name;
@ -15,7 +16,9 @@ public class Author implements Serializable {
// START WITH 1
private Integer rank;
private List<AuthorPid> pid;
private List<StructuredProperty> pid;
private List<Field<String>> affiliation;
public String getFullname() {
return fullname;
@ -49,31 +52,20 @@ public class Author implements Serializable {
this.rank = rank;
}
public List<AuthorPid> getPid() {
public List<StructuredProperty> getPid() {
return pid;
}
public void setPid(List<AuthorPid> pid) {
public void setPid(List<StructuredProperty> pid) {
this.pid = pid;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Author author = (Author) o;
return Objects.equals(fullname, author.fullname)
&& Objects.equals(name, author.name)
&& Objects.equals(surname, author.surname)
&& Objects.equals(rank, author.rank)
&& Objects.equals(pid, author.pid);
public List<Field<String>> getAffiliation() {
return affiliation;
}
@Override
public int hashCode() {
return Objects.hash(fullname, name, surname, rank, pid);
public void setAffiliation(List<Field<String>> affiliation) {
this.affiliation = affiliation;
}
}

View File

@ -1,16 +0,0 @@
package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
public class AuthorPid extends StructuredProperty implements Serializable {
private DataInfo dataInfo;
public DataInfo getDataInfo() {
return dataInfo;
}
public void setDataInfo(DataInfo dataInfo) {
this.dataInfo = dataInfo;
}
}

View File

@ -3,8 +3,11 @@ package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
public class Context implements Serializable {
private static final long serialVersionUID = -778899398223144398L;
private String id;
private List<DataInfo> dataInfo;
@ -25,22 +28,4 @@ public class Context implements Serializable {
this.dataInfo = dataInfo;
}
@Override
public int hashCode() {
return id == null ? 0 : id.hashCode();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Context other = (Context) obj;
return id.equals(other.getId());
}
}

View File

@ -1,10 +1,9 @@
package eu.dnetlib.dhp.schema.oaf;
import java.util.Objects;
public class Country extends Qualifier {
private static final long serialVersionUID = 1587334433446567175L;
private DataInfo dataInfo;
public DataInfo getDataInfo() {
@ -15,20 +14,4 @@ public class Country extends Qualifier {
this.dataInfo = dataInfo;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
if (!super.equals(o))
return false;
Country country = (Country) o;
return Objects.equals(dataInfo, country.dataInfo);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), dataInfo);
}
}

View File

@ -6,11 +6,23 @@ import java.util.Objects;
public class DataInfo implements Serializable {
private static final long serialVersionUID = -277099962930866451L;
private Boolean invisible = false;
private Boolean inferred;
private Float trust;
private Boolean deletedbyinference = false;
private String trust;
private String inferenceprovenance;
private Qualifier provenanceaction;
public Boolean getInvisible() {
return invisible;
}
public void setInvisible(Boolean invisible) {
this.invisible = invisible;
}
public Boolean getInferred() {
return inferred;
}
@ -19,11 +31,19 @@ public class DataInfo implements Serializable {
this.inferred = inferred;
}
public Float getTrust() {
public Boolean getDeletedbyinference() {
return deletedbyinference;
}
public void setDeletedbyinference(Boolean deletedbyinference) {
this.deletedbyinference = deletedbyinference;
}
public String getTrust() {
return trust;
}
public void setTrust(Float trust) {
public void setTrust(String trust) {
this.trust = trust;
}
@ -43,23 +63,4 @@ public class DataInfo implements Serializable {
this.provenanceaction = provenanceaction;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
DataInfo dataInfo = (DataInfo) o;
return Objects.equals(inferred, dataInfo.inferred)
&& Objects.equals(trust, dataInfo.trust)
&& Objects.equals(inferenceprovenance, dataInfo.inferenceprovenance)
&& Objects.equals(provenanceaction, dataInfo.provenanceaction);
}
@Override
public int hashCode() {
return Objects
.hash(
inferred, trust, inferenceprovenance, provenanceaction);
}
}

View File

@ -4,72 +4,75 @@ package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
import java.util.List;
import eu.dnetlib.dhp.schema.common.ModelConstants;
public class Dataset extends Result implements Serializable {
private String storagedate;
private static final long serialVersionUID = 916526716184645549L;
private Field<String> storagedate;
// candidate for removal
private String device;
private Field<String> device;
private String size;
private Field<String> size;
private String version;
private Field<String> version;
private String lastmetadataupdate;
private Field<String> lastmetadataupdate;
private String metadataversionnumber;
private Field<String> metadataversionnumber;
private List<GeoLocation> geolocation;
public Dataset() {
setResulttype(RESULTTYPE.dataset);
setResulttype(ModelConstants.DATASET_DEFAULT_RESULTTYPE);
}
public String getStoragedate() {
public Field<String> getStoragedate() {
return storagedate;
}
public void setStoragedate(String storagedate) {
public void setStoragedate(Field<String> storagedate) {
this.storagedate = storagedate;
}
public String getDevice() {
public Field<String> getDevice() {
return device;
}
public void setDevice(String device) {
public void setDevice(Field<String> device) {
this.device = device;
}
public String getSize() {
public Field<String> getSize() {
return size;
}
public void setSize(String size) {
public void setSize(Field<String> size) {
this.size = size;
}
public String getVersion() {
public Field<String> getVersion() {
return version;
}
public void setVersion(String version) {
public void setVersion(Field<String> version) {
this.version = version;
}
public String getLastmetadataupdate() {
public Field<String> getLastmetadataupdate() {
return lastmetadataupdate;
}
public void setLastmetadataupdate(String lastmetadataupdate) {
public void setLastmetadataupdate(Field<String> lastmetadataupdate) {
this.lastmetadataupdate = lastmetadataupdate;
}
public String getMetadataversionnumber() {
public Field<String> getMetadataversionnumber() {
return metadataversionnumber;
}
public void setMetadataversionnumber(String metadataversionnumber) {
public void setMetadataversionnumber(Field<String> metadataversionnumber) {
this.metadataversionnumber = metadataversionnumber;
}
@ -80,4 +83,5 @@ public class Dataset extends Result implements Serializable {
public void setGeolocation(List<GeoLocation> geolocation) {
this.geolocation = geolocation;
}
}

View File

@ -4,7 +4,7 @@ package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
import java.util.List;
public class Datasource extends Entity implements Serializable {
public class Datasource extends OafEntity implements Serializable {
private static final long serialVersionUID = 1019089598408414496L;
@ -20,83 +20,83 @@ public class Datasource extends Entity implements Serializable {
private Qualifier openairecompatibility;
private String officialname;
private Field<String> officialname;
private String englishname;
private Field<String> englishname;
private String websiteurl;
private Field<String> websiteurl;
private String logourl;
private Field<String> logourl;
private String contactemail;
private Field<String> contactemail;
private String namespaceprefix;
private Field<String> namespaceprefix;
private String latitude;
private Field<String> latitude;
private String longitude;
private Field<String> longitude;
private String dateofvalidation;
private Field<String> dateofvalidation;
private String description;
private Field<String> description;
private List<StructuredProperty> subjects;
// opendoar specific fields (od*)
@Deprecated
private String odnumberofitems;
private Field<String> odnumberofitems;
@Deprecated
private String odnumberofitemsdate;
private Field<String> odnumberofitemsdate;
@Deprecated
private String odpolicies;
private Field<String> odpolicies;
@Deprecated
private List<String> odlanguages;
private List<Field<String>> odlanguages;
private List<String> languages;
@Deprecated
private List<String> odcontenttypes;
private List<Field<String>> odcontenttypes;
private List<String> accessinfopackage;
private List<Field<String>> accessinfopackage;
// re3data fields
private String releasestartdate;
private Field<String> releasestartdate;
private String releaseenddate;
private Field<String> releaseenddate;
private String missionstatementurl;
private Field<String> missionstatementurl;
@Deprecated
private Boolean dataprovider;
private Field<Boolean> dataprovider;
@Deprecated
private Boolean serviceprovider;
private Field<Boolean> serviceprovider;
// {open, restricted or closed}
private String databaseaccesstype;
private Field<String> databaseaccesstype;
// {open, restricted or closed}
private String datauploadtype;
private Field<String> datauploadtype;
// {feeRequired, registration, other}
private String databaseaccessrestriction;
private Field<String> databaseaccessrestriction;
// {feeRequired, registration, other}
private String datauploadrestriction;
private Field<String> datauploadrestriction;
@Deprecated
private Boolean versioning;
private Field<Boolean> versioning;
private Boolean versioncontrol;
private String citationguidelineurl;
private Field<String> citationguidelineurl;
private String pidsystems;
private Field<String> pidsystems;
private String certificates;
private Field<String> certificates;
@Deprecated
private List<KeyValue> policies;
@ -143,7 +143,7 @@ public class Datasource extends Entity implements Serializable {
return datasourcetype;
}
public void setDatasourcetype(Qualifier datasourcetype) {
public void setDatasourcetype(final Qualifier datasourcetype) {
this.datasourcetype = datasourcetype;
}
@ -151,7 +151,7 @@ public class Datasource extends Entity implements Serializable {
return datasourcetypeui;
}
public void setDatasourcetypeui(Qualifier datasourcetypeui) {
public void setDatasourcetypeui(final Qualifier datasourcetypeui) {
this.datasourcetypeui = datasourcetypeui;
}
@ -175,87 +175,87 @@ public class Datasource extends Entity implements Serializable {
return openairecompatibility;
}
public void setOpenairecompatibility(Qualifier openairecompatibility) {
public void setOpenairecompatibility(final Qualifier openairecompatibility) {
this.openairecompatibility = openairecompatibility;
}
public String getOfficialname() {
public Field<String> getOfficialname() {
return officialname;
}
public void setOfficialname(String officialname) {
public void setOfficialname(final Field<String> officialname) {
this.officialname = officialname;
}
public String getEnglishname() {
public Field<String> getEnglishname() {
return englishname;
}
public void setEnglishname(String englishname) {
public void setEnglishname(final Field<String> englishname) {
this.englishname = englishname;
}
public String getWebsiteurl() {
public Field<String> getWebsiteurl() {
return websiteurl;
}
public void setWebsiteurl(String websiteurl) {
public void setWebsiteurl(final Field<String> websiteurl) {
this.websiteurl = websiteurl;
}
public String getLogourl() {
public Field<String> getLogourl() {
return logourl;
}
public void setLogourl(String logourl) {
public void setLogourl(final Field<String> logourl) {
this.logourl = logourl;
}
public String getContactemail() {
public Field<String> getContactemail() {
return contactemail;
}
public void setContactemail(String contactemail) {
public void setContactemail(final Field<String> contactemail) {
this.contactemail = contactemail;
}
public String getNamespaceprefix() {
public Field<String> getNamespaceprefix() {
return namespaceprefix;
}
public void setNamespaceprefix(String namespaceprefix) {
public void setNamespaceprefix(final Field<String> namespaceprefix) {
this.namespaceprefix = namespaceprefix;
}
public String getLatitude() {
public Field<String> getLatitude() {
return latitude;
}
public void setLatitude(String latitude) {
public void setLatitude(final Field<String> latitude) {
this.latitude = latitude;
}
public String getLongitude() {
public Field<String> getLongitude() {
return longitude;
}
public void setLongitude(String longitude) {
public void setLongitude(final Field<String> longitude) {
this.longitude = longitude;
}
public String getDateofvalidation() {
public Field<String> getDateofvalidation() {
return dateofvalidation;
}
public void setDateofvalidation(String dateofvalidation) {
public void setDateofvalidation(final Field<String> dateofvalidation) {
this.dateofvalidation = dateofvalidation;
}
public String getDescription() {
public Field<String> getDescription() {
return description;
}
public void setDescription(String description) {
public void setDescription(final Field<String> description) {
this.description = description;
}
@ -263,39 +263,39 @@ public class Datasource extends Entity implements Serializable {
return subjects;
}
public void setSubjects(List<StructuredProperty> subjects) {
public void setSubjects(final List<StructuredProperty> subjects) {
this.subjects = subjects;
}
public String getOdnumberofitems() {
public Field<String> getOdnumberofitems() {
return odnumberofitems;
}
public void setOdnumberofitems(String odnumberofitems) {
public void setOdnumberofitems(final Field<String> odnumberofitems) {
this.odnumberofitems = odnumberofitems;
}
public String getOdnumberofitemsdate() {
public Field<String> getOdnumberofitemsdate() {
return odnumberofitemsdate;
}
public void setOdnumberofitemsdate(String odnumberofitemsdate) {
public void setOdnumberofitemsdate(final Field<String> odnumberofitemsdate) {
this.odnumberofitemsdate = odnumberofitemsdate;
}
public String getOdpolicies() {
public Field<String> getOdpolicies() {
return odpolicies;
}
public void setOdpolicies(String odpolicies) {
public void setOdpolicies(final Field<String> odpolicies) {
this.odpolicies = odpolicies;
}
public List<String> getOdlanguages() {
public List<Field<String>> getOdlanguages() {
return odlanguages;
}
public void setOdlanguages(List<String> odlanguages) {
public void setOdlanguages(final List<Field<String>> odlanguages) {
this.odlanguages = odlanguages;
}
@ -303,103 +303,103 @@ public class Datasource extends Entity implements Serializable {
return languages;
}
public void setLanguages(List<String> languages) {
public void setLanguages(final List<String> languages) {
this.languages = languages;
}
public List<String> getOdcontenttypes() {
public List<Field<String>> getOdcontenttypes() {
return odcontenttypes;
}
public void setOdcontenttypes(List<String> odcontenttypes) {
public void setOdcontenttypes(final List<Field<String>> odcontenttypes) {
this.odcontenttypes = odcontenttypes;
}
public List<String> getAccessinfopackage() {
public List<Field<String>> getAccessinfopackage() {
return accessinfopackage;
}
public void setAccessinfopackage(List<String> accessinfopackage) {
public void setAccessinfopackage(final List<Field<String>> accessinfopackage) {
this.accessinfopackage = accessinfopackage;
}
public String getReleasestartdate() {
public Field<String> getReleasestartdate() {
return releasestartdate;
}
public void setReleasestartdate(String releasestartdate) {
public void setReleasestartdate(final Field<String> releasestartdate) {
this.releasestartdate = releasestartdate;
}
public String getReleaseenddate() {
public Field<String> getReleaseenddate() {
return releaseenddate;
}
public void setReleaseenddate(String releaseenddate) {
public void setReleaseenddate(final Field<String> releaseenddate) {
this.releaseenddate = releaseenddate;
}
public String getMissionstatementurl() {
public Field<String> getMissionstatementurl() {
return missionstatementurl;
}
public void setMissionstatementurl(String missionstatementurl) {
public void setMissionstatementurl(final Field<String> missionstatementurl) {
this.missionstatementurl = missionstatementurl;
}
public Boolean getDataprovider() {
public Field<Boolean> getDataprovider() {
return dataprovider;
}
public void setDataprovider(Boolean dataprovider) {
public void setDataprovider(final Field<Boolean> dataprovider) {
this.dataprovider = dataprovider;
}
public Boolean getServiceprovider() {
public Field<Boolean> getServiceprovider() {
return serviceprovider;
}
public void setServiceprovider(Boolean serviceprovider) {
public void setServiceprovider(final Field<Boolean> serviceprovider) {
this.serviceprovider = serviceprovider;
}
public String getDatabaseaccesstype() {
public Field<String> getDatabaseaccesstype() {
return databaseaccesstype;
}
public void setDatabaseaccesstype(String databaseaccesstype) {
public void setDatabaseaccesstype(final Field<String> databaseaccesstype) {
this.databaseaccesstype = databaseaccesstype;
}
public String getDatauploadtype() {
public Field<String> getDatauploadtype() {
return datauploadtype;
}
public void setDatauploadtype(String datauploadtype) {
public void setDatauploadtype(final Field<String> datauploadtype) {
this.datauploadtype = datauploadtype;
}
public String getDatabaseaccessrestriction() {
public Field<String> getDatabaseaccessrestriction() {
return databaseaccessrestriction;
}
public void setDatabaseaccessrestriction(String databaseaccessrestriction) {
public void setDatabaseaccessrestriction(final Field<String> databaseaccessrestriction) {
this.databaseaccessrestriction = databaseaccessrestriction;
}
public String getDatauploadrestriction() {
public Field<String> getDatauploadrestriction() {
return datauploadrestriction;
}
public void setDatauploadrestriction(String datauploadrestriction) {
public void setDatauploadrestriction(final Field<String> datauploadrestriction) {
this.datauploadrestriction = datauploadrestriction;
}
public Boolean getVersioning() {
public Field<Boolean> getVersioning() {
return versioning;
}
public void setVersioning(Boolean versioning) {
public void setVersioning(final Field<Boolean> versioning) {
this.versioning = versioning;
}
@ -411,27 +411,27 @@ public class Datasource extends Entity implements Serializable {
this.versioncontrol = versioncontrol;
}
public String getCitationguidelineurl() {
public Field<String> getCitationguidelineurl() {
return citationguidelineurl;
}
public void setCitationguidelineurl(String citationguidelineurl) {
public void setCitationguidelineurl(final Field<String> citationguidelineurl) {
this.citationguidelineurl = citationguidelineurl;
}
public String getPidsystems() {
public Field<String> getPidsystems() {
return pidsystems;
}
public void setPidsystems(String pidsystems) {
public void setPidsystems(final Field<String> pidsystems) {
this.pidsystems = pidsystems;
}
public String getCertificates() {
public Field<String> getCertificates() {
return certificates;
}
public void setCertificates(String certificates) {
public void setCertificates(final Field<String> certificates) {
this.certificates = certificates;
}
@ -439,7 +439,7 @@ public class Datasource extends Entity implements Serializable {
return policies;
}
public void setPolicies(List<KeyValue> policies) {
public void setPolicies(final List<KeyValue> policies) {
this.policies = policies;
}
@ -447,7 +447,7 @@ public class Datasource extends Entity implements Serializable {
return journal;
}
public void setJournal(Journal journal) {
public void setJournal(final Journal journal) {
this.journal = journal;
}
@ -455,7 +455,7 @@ public class Datasource extends Entity implements Serializable {
return researchentitytypes;
}
public void setResearchentitytypes(List<String> researchentitytypes) {
public void setResearchentitytypes(final List<String> researchentitytypes) {
this.researchentitytypes = researchentitytypes;
}
@ -463,7 +463,7 @@ public class Datasource extends Entity implements Serializable {
return providedproducttypes;
}
public void setProvidedproducttypes(List<String> providedproducttypes) {
public void setProvidedproducttypes(final List<String> providedproducttypes) {
this.providedproducttypes = providedproducttypes;
}
@ -471,7 +471,7 @@ public class Datasource extends Entity implements Serializable {
return jurisdiction;
}
public void setJurisdiction(Qualifier jurisdiction) {
public void setJurisdiction(final Qualifier jurisdiction) {
this.jurisdiction = jurisdiction;
}
@ -479,7 +479,7 @@ public class Datasource extends Entity implements Serializable {
return thematic;
}
public void setThematic(Boolean thematic) {
public void setThematic(final Boolean thematic) {
this.thematic = thematic;
}
@ -487,7 +487,7 @@ public class Datasource extends Entity implements Serializable {
return contentpolicies;
}
public void setContentpolicies(List<Qualifier> contentpolicies) {
public void setContentpolicies(final List<Qualifier> contentpolicies) {
this.contentpolicies = contentpolicies;
}
@ -527,26 +527,10 @@ public class Datasource extends Entity implements Serializable {
return consenttermsofuse;
}
public void setConsenttermsofuse(Boolean consenttermsofuse) {
public void setConsenttermsofuse(final Boolean consenttermsofuse) {
this.consenttermsofuse = consenttermsofuse;
}
public Boolean getFulltextdownload() {
return fulltextdownload;
}
public void setFulltextdownload(Boolean fulltextdownload) {
this.fulltextdownload = fulltextdownload;
}
public String getConsenttermsofusedate() {
return consenttermsofusedate;
}
public void setConsenttermsofusedate(String consenttermsofusedate) {
this.consenttermsofusedate = consenttermsofusedate;
}
public String getLastconsenttermsofusedate() {
return lastconsenttermsofusedate;
}
@ -555,6 +539,22 @@ public class Datasource extends Entity implements Serializable {
this.lastconsenttermsofusedate = lastconsenttermsofusedate;
}
public Boolean getFulltextdownload() {
return fulltextdownload;
}
public void setFulltextdownload(final Boolean fulltextdownload) {
this.fulltextdownload = fulltextdownload;
}
public String getConsenttermsofusedate() {
return consenttermsofusedate;
}
public void setConsenttermsofusedate(final String consenttermsofusedate) {
this.consenttermsofusedate = consenttermsofusedate;
}
public List<EoscIfGuidelines> getEoscifguidelines() {
return eoscifguidelines;
}
@ -562,4 +562,5 @@ public class Datasource extends Entity implements Serializable {
public void setEoscifguidelines(List<EoscIfGuidelines> eoscifguidelines) {
this.eoscifguidelines = eoscifguidelines;
}
}

View File

@ -1,82 +0,0 @@
package eu.dnetlib.dhp.schema.oaf;
import java.util.Objects;
public class EntityDataInfo {
private Boolean inferred;
private Float trust;
private String inferenceprovenance;
private Qualifier provenanceaction;
private Boolean invisible = false;
private Boolean deletedbyinference = false;
public Boolean getInferred() {
return inferred;
}
public void setInferred(Boolean inferred) {
this.inferred = inferred;
}
public Float getTrust() {
return trust;
}
public void setTrust(Float trust) {
this.trust = trust;
}
public String getInferenceprovenance() {
return inferenceprovenance;
}
public void setInferenceprovenance(String inferenceprovenance) {
this.inferenceprovenance = inferenceprovenance;
}
public Qualifier getProvenanceaction() {
return provenanceaction;
}
public void setProvenanceaction(Qualifier provenanceaction) {
this.provenanceaction = provenanceaction;
}
public Boolean getInvisible() {
return invisible;
}
public void setInvisible(Boolean invisible) {
this.invisible = invisible;
}
public Boolean getDeletedbyinference() {
return deletedbyinference;
}
public void setDeletedbyinference(Boolean deletedbyinference) {
this.deletedbyinference = deletedbyinference;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
EntityDataInfo dataInfo = (EntityDataInfo) o;
return Objects.equals(inferred, dataInfo.inferred)
&& Objects.equals(trust, dataInfo.trust)
&& Objects.equals(inferenceprovenance, dataInfo.inferenceprovenance)
&& Objects.equals(provenanceaction, dataInfo.provenanceaction)
&& Objects.equals(deletedbyinference, dataInfo.deletedbyinference)
&& Objects.equals(invisible, dataInfo.invisible);
}
@Override
public int hashCode() {
return Objects.hash(
inferred, trust, inferenceprovenance, provenanceaction, deletedbyinference, invisible);
}
}

View File

@ -1,6 +1,7 @@
package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ -12,6 +13,7 @@ import org.apache.commons.lang3.StringUtils;
*/
public class EoscIfGuidelines implements Serializable {
private static final long serialVersionUID = -2166497471601245048L;
/**
* EOSC-IF local code. Later on it could be populated with a PID (e.g. DOI), but for the time being we stick to
* a more loose definition.
@ -65,33 +67,4 @@ public class EoscIfGuidelines implements Serializable {
this.semanticRelation = semanticRelation;
}
private String toComparableString() {
return Stream
.of(
Optional.ofNullable(getCode()).orElse(""),
Optional.ofNullable(getLabel()).orElse(""),
Optional.ofNullable(getUrl()).orElse(""),
Optional.ofNullable(getSemanticRelation()).orElse(""))
.filter(StringUtils::isNotBlank)
.collect(Collectors.joining("||"));
}
@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;
EoscIfGuidelines other = (EoscIfGuidelines) obj;
return toComparableString().equals(other.toComparableString());
}
}

View File

@ -6,6 +6,8 @@ import java.util.List;
import java.util.Objects;
public class ExternalReference implements Serializable {
private static final long serialVersionUID = -3711445600549155961L;
// source
private String sitename;
@ -27,6 +29,9 @@ public class ExternalReference implements Serializable {
// maps the oaf:reference/@query attribute
private String query;
// ExternalReferences might be also inferred
private DataInfo dataInfo;
public String getSitename() {
return sitename;
}
@ -83,26 +88,12 @@ public class ExternalReference implements Serializable {
this.query = query;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
ExternalReference that = (ExternalReference) o;
return Objects.equals(sitename, that.sitename)
&& Objects.equals(label, that.label)
&& Objects.equals(url, that.url)
&& Objects.equals(qualifier, that.qualifier)
&& Objects.equals(refidentifier, that.refidentifier)
&& Objects.equals(query, that.query);
public DataInfo getDataInfo() {
return dataInfo;
}
@Override
public int hashCode() {
return Objects
.hash(
sitename, label, url, qualifier, refidentifier, query);
public void setDataInfo(DataInfo dataInfo) {
this.dataInfo = dataInfo;
}
}

View File

@ -5,6 +5,8 @@ import java.io.Serializable;
import java.util.Objects;
public class ExtraInfo implements Serializable {
private static final long serialVersionUID = 8689244676887698486L;
private String name;
private String typology;
@ -56,22 +58,4 @@ public class ExtraInfo implements Serializable {
this.value = value;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
ExtraInfo extraInfo = (ExtraInfo) o;
return Objects.equals(name, extraInfo.name)
&& Objects.equals(typology, extraInfo.typology)
&& Objects.equals(provenance, extraInfo.provenance)
&& Objects.equals(trust, extraInfo.trust)
&& Objects.equals(value, extraInfo.value);
}
@Override
public int hashCode() {
return Objects.hash(name, typology, provenance, trust, value);
}
}

View File

@ -0,0 +1,46 @@
package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
import java.util.Objects;
public class Field<T> implements Serializable {
private static final long serialVersionUID = -4255501306375330131L;
private T value;
private DataInfo dataInfo;
public T getValue() {
return value;
}
public void setValue(T value) {
this.value = value;
}
public DataInfo getDataInfo() {
return dataInfo;
}
public void setDataInfo(DataInfo dataInfo) {
this.dataInfo = dataInfo;
}
@Override
public int hashCode() {
return getValue() == null ? 0 : getValue().hashCode();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Field<T> other = (Field<T>) obj;
return Objects.equals(getValue(), other.getValue());
}
}

View File

@ -2,6 +2,7 @@
package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
import java.util.Objects;
import org.apache.commons.lang3.StringUtils;
@ -9,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
public class GeoLocation implements Serializable {
private static final long serialVersionUID = 8096534610208458404L;
private String point;
private String box;
@ -39,38 +41,4 @@ public class GeoLocation implements Serializable {
this.place = place;
}
@JsonIgnore
public boolean isBlank() {
return StringUtils.isBlank(point) && StringUtils.isBlank(box) && StringUtils.isBlank(place);
}
public String toComparableString() {
return isBlank()
? ""
: String
.format(
"%s::%s%s",
point != null ? point.toLowerCase() : "",
box != null ? box.toLowerCase() : "",
place != null ? place.toLowerCase() : "");
}
@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;
GeoLocation other = (GeoLocation) obj;
return toComparableString().equals(other.toComparableString());
}
}

View File

@ -21,8 +21,9 @@ import java.util.Objects;
* - private String level3 to store the information about the level3 of the classification
* - private String classification to store the entire classification related to the programme
*/
public class H2020Classification implements Serializable {
private static final long serialVersionUID = 1062734689288369769L;
private H2020Programme h2020Programme;
private String level1;
private String level2;
@ -70,19 +71,4 @@ public class H2020Classification implements Serializable {
this.classification = classification;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
H2020Classification h2020classification = (H2020Classification) o;
return Objects.equals(level1, h2020classification.level1) &&
Objects.equals(level2, h2020classification.level2) &&
Objects.equals(level3, h2020classification.level3) &&
Objects.equals(classification, h2020classification.classification) &&
h2020Programme.equals(h2020classification.h2020Programme);
}
}

View File

@ -9,8 +9,9 @@ import java.util.Objects;
* - private String code to store the code of the programme
* - private String description to store the description of the programme
*/
public class H2020Programme implements Serializable {
private static final long serialVersionUID = -7851791644568592481L;
private String code;
private String description;
@ -30,15 +31,4 @@ public class H2020Programme implements Serializable {
this.description = description;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
H2020Programme h2020Programme = (H2020Programme) o;
return Objects.equals(code, h2020Programme.code);
}
}

View File

@ -3,21 +3,25 @@ package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
import java.util.List;
import java.util.Optional;
import com.google.common.base.Joiner;
public class Instance implements Serializable {
private License license;
private static final long serialVersionUID = 3918544870298859300L;
private Field<String> license;
private AccessRight accessright;
private Qualifier instancetype;
private List<InstanceTypeMapping> instanceTypeMapping;
private KeyValue hostedby;
private List<String> url;
private List<String> fulltext;
// other research products specifc
private String distributionlocation;
@ -27,23 +31,30 @@ public class Instance implements Serializable {
private List<StructuredProperty> alternateIdentifier;
private String dateofacceptance;
private Field<String> dateofacceptance;
// ( article | book ) processing charges. Defined here to cope with possible wrongly typed
// results
private String processingchargeamount;
private Field<String> processingchargeamount;
// currency - alphabetic code describe in ISO-4217. Defined here to cope with possible wrongly
// typed results
private String processingchargecurrency;
private Field<String> processingchargecurrency;
private Qualifier refereed; // peer-review status
public License getLicense() {
private List<Measure> measures;
/**
* Direct fulltext URL.
*/
private String fulltext;
public Field<String> getLicense() {
return license;
}
public void setLicense(License license) {
public void setLicense(Field<String> license) {
this.license = license;
}
@ -63,6 +74,14 @@ public class Instance implements Serializable {
this.instancetype = instancetype;
}
public List<InstanceTypeMapping> getInstanceTypeMapping() {
return instanceTypeMapping;
}
public void setInstanceTypeMapping(List<InstanceTypeMapping> instanceTypeMapping) {
this.instanceTypeMapping = instanceTypeMapping;
}
public KeyValue getHostedby() {
return hostedby;
}
@ -79,14 +98,6 @@ public class Instance implements Serializable {
this.url = url;
}
public List<String> getFulltext() {
return fulltext;
}
public void setFulltext(List<String> fulltext) {
this.fulltext = fulltext;
}
public String getDistributionlocation() {
return distributionlocation;
}
@ -111,11 +122,11 @@ public class Instance implements Serializable {
this.pid = pid;
}
public String getDateofacceptance() {
public Field<String> getDateofacceptance() {
return dateofacceptance;
}
public void setDateofacceptance(String dateofacceptance) {
public void setDateofacceptance(Field<String> dateofacceptance) {
this.dateofacceptance = dateofacceptance;
}
@ -127,19 +138,19 @@ public class Instance implements Serializable {
this.alternateIdentifier = alternateIdentifier;
}
public String getProcessingchargeamount() {
public Field<String> getProcessingchargeamount() {
return processingchargeamount;
}
public void setProcessingchargeamount(String processingchargeamount) {
public void setProcessingchargeamount(Field<String> processingchargeamount) {
this.processingchargeamount = processingchargeamount;
}
public String getProcessingchargecurrency() {
public Field<String> getProcessingchargecurrency() {
return processingchargecurrency;
}
public void setProcessingchargecurrency(String processingchargecurrency) {
public void setProcessingchargecurrency(Field<String> processingchargecurrency) {
this.processingchargecurrency = processingchargecurrency;
}
@ -151,33 +162,20 @@ public class Instance implements Serializable {
this.refereed = refereed;
}
public String toComparableString() {
return String
.format(
"%s::%s::%s::%s",
hostedby != null && hostedby.getKey() != null ? hostedby.getKey().toLowerCase() : "",
accessright != null && accessright.getClassid() != null ? accessright.getClassid() : "",
instancetype != null && instancetype.getClassid() != null ? instancetype.getClassid() : "",
url != null ? url : "");
public List<Measure> getMeasures() {
return measures;
}
@Override
public int hashCode() {
return toComparableString().hashCode();
public void setMeasures(List<Measure> measures) {
this.measures = measures;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
public String getFulltext() {
return fulltext;
}
Instance other = (Instance) obj;
return toComparableString().equals(other.toComparableString());
public void setFulltext(String fulltext) {
this.fulltext = fulltext;
}
}

View File

@ -0,0 +1,62 @@
package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
/**
* Defines a mapping between the original resource types and the type code and label available in a given vocabulary.
*/
public class InstanceTypeMapping implements Serializable {
private static final long serialVersionUID = -8209930054790495309L;
/**
* Original resource type, typically mapped from dc:type, datacite:resourceType.
*/
private String originalType;
/**
* Contains the code of the resource type resulted from the mapping.
*/
private String typeCode;
/**
* Contains the label of the resource type resulted from the mapping.
*/
private String typeLabel;
/**
* Contains name of the vocabulary used to produce this resource type mapping.
*/
private String vocabularyName;
public String getOriginalType() {
return originalType;
}
public void setOriginalType(String originalType) {
this.originalType = originalType;
}
public String getTypeCode() {
return typeCode;
}
public void setTypeCode(String typeCode) {
this.typeCode = typeCode;
}
public String getTypeLabel() {
return typeLabel;
}
public void setTypeLabel(String typeLabel) {
this.typeLabel = typeLabel;
}
public String getVocabularyName() {
return vocabularyName;
}
public void setVocabularyName(String vocabularyName) {
this.vocabularyName = vocabularyName;
}
}

View File

@ -6,6 +6,8 @@ import java.util.Objects;
public class Journal implements Serializable {
private static final long serialVersionUID = -8476321782780781681L;
private String name;
private String issnPrinted;
@ -28,6 +30,8 @@ public class Journal implements Serializable {
private String conferencedate;
private DataInfo dataInfo;
public String getName() {
return name;
}
@ -116,40 +120,12 @@ public class Journal implements Serializable {
this.conferencedate = conferencedate;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Journal journal = (Journal) o;
return Objects.equals(name, journal.name)
&& Objects.equals(issnPrinted, journal.issnPrinted)
&& Objects.equals(issnOnline, journal.issnOnline)
&& Objects.equals(issnLinking, journal.issnLinking)
&& Objects.equals(ep, journal.ep)
&& Objects.equals(iss, journal.iss)
&& Objects.equals(sp, journal.sp)
&& Objects.equals(vol, journal.vol)
&& Objects.equals(edition, journal.edition)
&& Objects.equals(conferenceplace, journal.conferenceplace)
&& Objects.equals(conferencedate, journal.conferencedate);
public DataInfo getDataInfo() {
return dataInfo;
}
@Override
public int hashCode() {
return Objects
.hash(
name,
issnPrinted,
issnOnline,
issnLinking,
ep,
iss,
sp,
vol,
edition,
conferenceplace,
conferencedate);
public void setDataInfo(DataInfo dataInfo) {
this.dataInfo = dataInfo;
}
}

View File

@ -2,17 +2,23 @@
package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
import java.util.Objects;
import java.util.Optional;
import org.apache.commons.lang3.StringUtils;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.base.Joiner;
public class KeyValue implements Serializable {
private static final long serialVersionUID = 1905267445569591240L;
private String key;
private String value;
private DataInfo dataInfo;
public String getKey() {
return key;
}
@ -29,36 +35,12 @@ public class KeyValue implements Serializable {
this.value = value;
}
public String toComparableString() {
return isBlank()
? ""
: String
.format(
"%s::%s",
key != null ? key.toLowerCase() : "", value != null ? value.toLowerCase() : "");
public DataInfo getDataInfo() {
return dataInfo;
}
@JsonIgnore
public boolean isBlank() {
return StringUtils.isBlank(key) && StringUtils.isBlank(value);
public void setDataInfo(DataInfo dataInfo) {
this.dataInfo = dataInfo;
}
@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;
KeyValue other = (KeyValue) obj;
return toComparableString().equals(other.toComparableString());
}
}

View File

@ -1,24 +0,0 @@
package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
public class License implements Serializable {
private String url;
public License() {
}
public License(String url) {
this.url = url;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}

View File

@ -11,16 +11,17 @@ import com.google.common.base.Objects;
*/
public class Measure implements Serializable {
private static final long serialVersionUID = 8383308453679722661L;
/**
* Unique measure identifier.
*/
private String id;
/**
* List of units associated with this measure. MeasureUnit provides a pair to store the label (key) and the value, plus
* List of units associated with this measure. KeyValue provides a pair to store the label (key) and the value, plus
* common provenance information.
*/
private List<MeasureUnit> unit;
private List<KeyValue> unit;
public String getId() {
return id;
@ -30,27 +31,12 @@ public class Measure implements Serializable {
this.id = id;
}
public List<MeasureUnit> getUnit() {
public List<KeyValue> getUnit() {
return unit;
}
public void setUnit(List<MeasureUnit> unit) {
public void setUnit(List<KeyValue> unit) {
this.unit = unit;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Measure measure = (Measure) o;
return Objects.equal(id, measure.id) &&
Objects.equal(unit, measure.unit);
}
@Override
public int hashCode() {
return Objects.hashCode(id, unit);
}
}

View File

@ -1,14 +0,0 @@
package eu.dnetlib.dhp.schema.oaf;
public class MeasureUnit extends KeyValue {
private DataInfo dataInfo;
public DataInfo getDataInfo() {
return dataInfo;
}
public void setDataInfo(DataInfo dataInfo) {
this.dataInfo = dataInfo;
}
}

View File

@ -6,6 +6,8 @@ import java.util.Objects;
public class OAIProvenance implements Serializable {
private static final long serialVersionUID = -767252660700352729L;
private OriginDescription originDescription;
public OriginDescription getOriginDescription() {
@ -16,18 +18,4 @@ public class OAIProvenance implements Serializable {
this.originDescription = originDescription;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
OAIProvenance that = (OAIProvenance) o;
return Objects.equals(originDescription, that.originDescription);
}
@Override
public int hashCode() {
return Objects.hash(originDescription);
}
}

View File

@ -1,6 +1,48 @@
package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public abstract class Oaf implements Serializable {
private static final long serialVersionUID = 94599232915572420L;
/**
* The list of datasource id/name pairs providing this relationship.
*/
protected List<KeyValue> collectedfrom;
private DataInfo dataInfo;
private Long lastupdatetimestamp;
public List<KeyValue> getCollectedfrom() {
return collectedfrom;
}
public void setCollectedfrom(List<KeyValue> collectedfrom) {
this.collectedfrom = collectedfrom;
}
public DataInfo getDataInfo() {
return dataInfo;
}
public void setDataInfo(DataInfo dataInfo) {
this.dataInfo = dataInfo;
}
public Long getLastupdatetimestamp() {
return lastupdatetimestamp;
}
public void setLastupdatetimestamp(Long lastupdatetimestamp) {
this.lastupdatetimestamp = lastupdatetimestamp;
}
public class Oaf implements Serializable {
}

View File

@ -5,48 +5,68 @@ import java.io.Serializable;
import java.util.*;
import java.util.stream.Collectors;
public abstract class Entity extends Oaf implements Serializable {
public abstract class OafEntity extends Oaf implements Serializable {
private static final long serialVersionUID = -7793594664115821897L;
private String id;
private List<String> originalId;
/**
* The list of datasource id/name pairs providing this Oaf.
*/
private List<KeyValue> collectedfrom;
private Long lastupdatetimestamp;
private List<StructuredProperty> pid;
private String dateofcollection;
private String dateoftransformation;
private List<ExtraInfo> extraInfo;
private OAIProvenance oaiprovenance;
/**
* The Measures.
*/
private List<Measure> measures;
private List<ExtraInfo> extraInfo;
/**
* The Context.
*/
private List<Context> context;
private EntityDataInfo dataInfo;
public List<KeyValue> getCollectedfrom() {
return collectedfrom;
/**
* Gets context.
*
* @return the context
*/
public List<Context> getContext() {
return context;
}
public void setCollectedfrom(List<KeyValue> collectedfrom) {
this.collectedfrom = collectedfrom;
/**
* Sets context.
*
* @param context the context
*/
public void setContext(List<Context> context) {
this.context = context;
}
public Long getLastupdatetimestamp() {
return lastupdatetimestamp;
/**
* Gets measures.
*
* @return the measures
*/
public List<Measure> getMeasures() {
return measures;
}
public void setLastupdatetimestamp(Long lastupdatetimestamp) {
this.lastupdatetimestamp = lastupdatetimestamp;
/**
* Sets measures.
*
* @param measures the measures
*/
public void setMeasures(List<Measure> measures) {
this.measures = measures;
}
public String getId() {
@ -85,24 +105,6 @@ public abstract class Entity extends Oaf implements Serializable {
return dateoftransformation;
}
/**
* Gets measures.
*
* @return the measures
*/
public List<Measure> getMeasures() {
return measures;
}
/**
* Sets measures.
*
* @param measures the measures
*/
public void setMeasures(List<Measure> measures) {
this.measures = measures;
}
public void setDateoftransformation(String dateoftransformation) {
this.dateoftransformation = dateoftransformation;
}
@ -115,29 +117,27 @@ public abstract class Entity extends Oaf implements Serializable {
this.extraInfo = extraInfo;
}
public EntityDataInfo getDataInfo() {
return dataInfo;
public OAIProvenance getOaiprovenance() {
return oaiprovenance;
}
public void setDataInfo(EntityDataInfo dataInfo) {
this.dataInfo = dataInfo;
public void setOaiprovenance(OAIProvenance oaiprovenance) {
this.oaiprovenance = oaiprovenance;
}
@Override
public int hashCode() {
return Objects.hash(getId());
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
if (!(o instanceof OafEntity))
return false;
if (!super.equals(o))
return false;
Entity oafEntity = (Entity) o;
return Objects.equals(id, oafEntity.id);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), id);
OafEntity oafEntity = (OafEntity) o;
return Objects.equals(getId(), oafEntity.getId());
}
}

View File

@ -0,0 +1,12 @@
package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
/**
* The OpenAccess color meant to be used on the result level
*/
public enum OpenAccessColor implements Serializable {
gold, hybrid, bronze
}

View File

@ -4,158 +4,166 @@ package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
import java.util.List;
public class Organization extends Entity implements Serializable {
public class Organization extends OafEntity implements Serializable {
private String legalshortname;
enum OrganizationType {
Archive, Company, Education, Facility, Government, Healthcare, Nonprofit, Other, Unknown
}
private String legalname;
private static final long serialVersionUID = -9048723860770504113L;
private List<String> alternativeNames;
private Field<String> legalshortname;
private String websiteurl;
private Field<String> legalname;
private String logourl;
private List<Field<String>> alternativeNames;
private String eclegalbody;
private Field<String> websiteurl;
private String eclegalperson;
private Field<String> logourl;
private String ecnonprofit;
private Field<String> eclegalbody;
private String ecresearchorganization;
private Field<String> eclegalperson;
private String echighereducation;
private Field<String> ecnonprofit;
private String ecinternationalorganizationeurinterests;
private Field<String> ecresearchorganization;
private String ecinternationalorganization;
private Field<String> echighereducation;
private String ecenterprise;
private Field<String> ecinternationalorganizationeurinterests;
private String ecsmevalidated;
private Field<String> ecinternationalorganization;
private String ecnutscode;
private Field<String> ecenterprise;
private Field<String> ecsmevalidated;
private Field<String> ecnutscode;
private Qualifier country;
public String getLegalshortname() {
private OrganizationType organizationType;
public Field<String> getLegalshortname() {
return legalshortname;
}
public void setLegalshortname(String legalshortname) {
public void setLegalshortname(Field<String> legalshortname) {
this.legalshortname = legalshortname;
}
public String getLegalname() {
public Field<String> getLegalname() {
return legalname;
}
public void setLegalname(String legalname) {
public void setLegalname(Field<String> legalname) {
this.legalname = legalname;
}
public List<String> getAlternativeNames() {
public List<Field<String>> getAlternativeNames() {
return alternativeNames;
}
public void setAlternativeNames(List<String> alternativeNames) {
public void setAlternativeNames(List<Field<String>> alternativeNames) {
this.alternativeNames = alternativeNames;
}
public String getWebsiteurl() {
public Field<String> getWebsiteurl() {
return websiteurl;
}
public void setWebsiteurl(String websiteurl) {
public void setWebsiteurl(Field<String> websiteurl) {
this.websiteurl = websiteurl;
}
public String getLogourl() {
public Field<String> getLogourl() {
return logourl;
}
public void setLogourl(String logourl) {
public void setLogourl(Field<String> logourl) {
this.logourl = logourl;
}
public String getEclegalbody() {
public Field<String> getEclegalbody() {
return eclegalbody;
}
public void setEclegalbody(String eclegalbody) {
public void setEclegalbody(Field<String> eclegalbody) {
this.eclegalbody = eclegalbody;
}
public String getEclegalperson() {
public Field<String> getEclegalperson() {
return eclegalperson;
}
public void setEclegalperson(String eclegalperson) {
public void setEclegalperson(Field<String> eclegalperson) {
this.eclegalperson = eclegalperson;
}
public String getEcnonprofit() {
public Field<String> getEcnonprofit() {
return ecnonprofit;
}
public void setEcnonprofit(String ecnonprofit) {
public void setEcnonprofit(Field<String> ecnonprofit) {
this.ecnonprofit = ecnonprofit;
}
public String getEcresearchorganization() {
public Field<String> getEcresearchorganization() {
return ecresearchorganization;
}
public void setEcresearchorganization(String ecresearchorganization) {
public void setEcresearchorganization(Field<String> ecresearchorganization) {
this.ecresearchorganization = ecresearchorganization;
}
public String getEchighereducation() {
public Field<String> getEchighereducation() {
return echighereducation;
}
public void setEchighereducation(String echighereducation) {
public void setEchighereducation(Field<String> echighereducation) {
this.echighereducation = echighereducation;
}
public String getEcinternationalorganizationeurinterests() {
public Field<String> getEcinternationalorganizationeurinterests() {
return ecinternationalorganizationeurinterests;
}
public void setEcinternationalorganizationeurinterests(
String ecinternationalorganizationeurinterests) {
Field<String> ecinternationalorganizationeurinterests) {
this.ecinternationalorganizationeurinterests = ecinternationalorganizationeurinterests;
}
public String getEcinternationalorganization() {
public Field<String> getEcinternationalorganization() {
return ecinternationalorganization;
}
public void setEcinternationalorganization(String ecinternationalorganization) {
public void setEcinternationalorganization(Field<String> ecinternationalorganization) {
this.ecinternationalorganization = ecinternationalorganization;
}
public String getEcenterprise() {
public Field<String> getEcenterprise() {
return ecenterprise;
}
public void setEcenterprise(String ecenterprise) {
public void setEcenterprise(Field<String> ecenterprise) {
this.ecenterprise = ecenterprise;
}
public String getEcsmevalidated() {
public Field<String> getEcsmevalidated() {
return ecsmevalidated;
}
public void setEcsmevalidated(String ecsmevalidated) {
public void setEcsmevalidated(Field<String> ecsmevalidated) {
this.ecsmevalidated = ecsmevalidated;
}
public String getEcnutscode() {
public Field<String> getEcnutscode() {
return ecnutscode;
}
public void setEcnutscode(String ecnutscode) {
public void setEcnutscode(Field<String> ecnutscode) {
this.ecnutscode = ecnutscode;
}
@ -167,4 +175,11 @@ public class Organization extends Entity implements Serializable {
this.country = country;
}
public OrganizationType getOrganizationType() {
return organizationType;
}
public void setOrganizationType(OrganizationType organizationType) {
this.organizationType = organizationType;
}
}

View File

@ -6,6 +6,8 @@ import java.util.Objects;
public class OriginDescription implements Serializable {
private static final long serialVersionUID = -7256156902727658863L;
private String harvestDate;
private Boolean altered = true;
@ -66,23 +68,4 @@ public class OriginDescription implements Serializable {
this.metadataNamespace = metadataNamespace;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
OriginDescription that = (OriginDescription) o;
return Objects.equals(harvestDate, that.harvestDate)
&& Objects.equals(altered, that.altered)
&& Objects.equals(baseURL, that.baseURL)
&& Objects.equals(identifier, that.identifier)
&& Objects.equals(datestamp, that.datestamp)
&& Objects.equals(metadataNamespace, that.metadataNamespace);
}
@Override
public int hashCode() {
return Objects.hash(harvestDate, altered, baseURL, identifier, datestamp, metadataNamespace);
}
}

View File

@ -4,39 +4,44 @@ package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
import java.util.List;
import eu.dnetlib.dhp.schema.common.ModelConstants;
public class OtherResearchProduct extends Result implements Serializable {
private List<String> contactperson;
private static final long serialVersionUID = -7611546868867175491L;
private List<String> contactgroup;
private List<Field<String>> contactperson;
private List<String> tool;
private List<Field<String>> contactgroup;
private List<Field<String>> tool;
public OtherResearchProduct() {
setResulttype(RESULTTYPE.otherresearchproduct);
setResulttype(ModelConstants.ORP_DEFAULT_RESULTTYPE);
}
public List<String> getContactperson() {
public List<Field<String>> getContactperson() {
return contactperson;
}
public void setContactperson(List<String> contactperson) {
public void setContactperson(List<Field<String>> contactperson) {
this.contactperson = contactperson;
}
public List<String> getContactgroup() {
public List<Field<String>> getContactgroup() {
return contactgroup;
}
public void setContactgroup(List<String> contactgroup) {
public void setContactgroup(List<Field<String>> contactgroup) {
this.contactgroup = contactgroup;
}
public List<String> getTool() {
public List<Field<String>> getTool() {
return tool;
}
public void setTool(List<String> tool) {
public void setTool(List<Field<String>> tool) {
this.tool = tool;
}
}

View File

@ -4,55 +4,59 @@ package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
import java.util.List;
public class Project extends Entity implements Serializable {
import org.apache.commons.lang3.StringUtils;
private String websiteurl;
public class Project extends OafEntity implements Serializable {
private String code;
private static final long serialVersionUID = 5783959097903529424L;
private String acronym;
private Field<String> websiteurl;
private String title;
private Field<String> code;
private String startdate;
private Field<String> acronym;
private String enddate;
private Field<String> title;
private String callidentifier;
private Field<String> startdate;
private String keywords;
private Field<String> enddate;
private String duration;
private Field<String> callidentifier;
private String ecsc39;
private Field<String> keywords;
private String oamandatepublications;
private Field<String> duration;
private String ecarticle29_3;
private Field<String> ecsc39;
private Field<String> oamandatepublications;
private Field<String> ecarticle29_3;
private List<StructuredProperty> subjects;
private List<String> fundingtree;
private List<Field<String>> fundingtree;
private Qualifier contracttype;
private String optional1;
private Field<String> optional1;
private String optional2;
private Field<String> optional2;
private String jsonextrainfo;
private Field<String> jsonextrainfo;
private String contactfullname;
private Field<String> contactfullname;
private String contactfax;
private Field<String> contactfax;
private String contactphone;
private Field<String> contactphone;
private String contactemail;
private Field<String> contactemail;
private String summary;
private Field<String> summary;
private String currency;
private Field<String> currency;
private Float totalcost;
@ -62,7 +66,7 @@ public class Project extends Entity implements Serializable {
private String h2020topicdescription;
private List<H2020Classification>h2020classification;
private List<H2020Classification> h2020classification;
public String getH2020topicdescription() {
return h2020topicdescription;
@ -88,99 +92,99 @@ public class Project extends Entity implements Serializable {
this.h2020classification = h2020classification;
}
public String getWebsiteurl() {
public Field<String> getWebsiteurl() {
return websiteurl;
}
public void setWebsiteurl( String websiteurl) {
public void setWebsiteurl(Field<String> websiteurl) {
this.websiteurl = websiteurl;
}
public String getCode() {
public Field<String> getCode() {
return code;
}
public void setCode( String code) {
public void setCode(Field<String> code) {
this.code = code;
}
public String getAcronym() {
public Field<String> getAcronym() {
return acronym;
}
public void setAcronym( String acronym) {
public void setAcronym(Field<String> acronym) {
this.acronym = acronym;
}
public String getTitle() {
public Field<String> getTitle() {
return title;
}
public void setTitle( String title) {
public void setTitle(Field<String> title) {
this.title = title;
}
public String getStartdate() {
public Field<String> getStartdate() {
return startdate;
}
public void setStartdate( String startdate) {
public void setStartdate(Field<String> startdate) {
this.startdate = startdate;
}
public String getEnddate() {
public Field<String> getEnddate() {
return enddate;
}
public void setEnddate( String enddate) {
public void setEnddate(Field<String> enddate) {
this.enddate = enddate;
}
public String getCallidentifier() {
public Field<String> getCallidentifier() {
return callidentifier;
}
public void setCallidentifier( String callidentifier) {
public void setCallidentifier(Field<String> callidentifier) {
this.callidentifier = callidentifier;
}
public String getKeywords() {
public Field<String> getKeywords() {
return keywords;
}
public void setKeywords( String keywords) {
public void setKeywords(Field<String> keywords) {
this.keywords = keywords;
}
public String getDuration() {
public Field<String> getDuration() {
return duration;
}
public void setDuration( String duration) {
public void setDuration(Field<String> duration) {
this.duration = duration;
}
public String getEcsc39() {
public Field<String> getEcsc39() {
return ecsc39;
}
public void setEcsc39( String ecsc39) {
public void setEcsc39(Field<String> ecsc39) {
this.ecsc39 = ecsc39;
}
public String getOamandatepublications() {
public Field<String> getOamandatepublications() {
return oamandatepublications;
}
public void setOamandatepublications( String oamandatepublications) {
public void setOamandatepublications(Field<String> oamandatepublications) {
this.oamandatepublications = oamandatepublications;
}
public String getEcarticle29_3() {
public Field<String> getEcarticle29_3() {
return ecarticle29_3;
}
public void setEcarticle29_3( String ecarticle29_3) {
public void setEcarticle29_3(Field<String> ecarticle29_3) {
this.ecarticle29_3 = ecarticle29_3;
}
@ -192,11 +196,11 @@ public class Project extends Entity implements Serializable {
this.subjects = subjects;
}
public List< String> getFundingtree() {
public List<Field<String>> getFundingtree() {
return fundingtree;
}
public void setFundingtree(List< String> fundingtree) {
public void setFundingtree(List<Field<String>> fundingtree) {
this.fundingtree = fundingtree;
}
@ -208,75 +212,75 @@ public class Project extends Entity implements Serializable {
this.contracttype = contracttype;
}
public String getOptional1() {
public Field<String> getOptional1() {
return optional1;
}
public void setOptional1( String optional1) {
public void setOptional1(Field<String> optional1) {
this.optional1 = optional1;
}
public String getOptional2() {
public Field<String> getOptional2() {
return optional2;
}
public void setOptional2( String optional2) {
public void setOptional2(Field<String> optional2) {
this.optional2 = optional2;
}
public String getJsonextrainfo() {
public Field<String> getJsonextrainfo() {
return jsonextrainfo;
}
public void setJsonextrainfo( String jsonextrainfo) {
public void setJsonextrainfo(Field<String> jsonextrainfo) {
this.jsonextrainfo = jsonextrainfo;
}
public String getContactfullname() {
public Field<String> getContactfullname() {
return contactfullname;
}
public void setContactfullname( String contactfullname) {
public void setContactfullname(Field<String> contactfullname) {
this.contactfullname = contactfullname;
}
public String getContactfax() {
public Field<String> getContactfax() {
return contactfax;
}
public void setContactfax( String contactfax) {
public void setContactfax(Field<String> contactfax) {
this.contactfax = contactfax;
}
public String getContactphone() {
public Field<String> getContactphone() {
return contactphone;
}
public void setContactphone( String contactphone) {
public void setContactphone(Field<String> contactphone) {
this.contactphone = contactphone;
}
public String getContactemail() {
public Field<String> getContactemail() {
return contactemail;
}
public void setContactemail( String contactemail) {
public void setContactemail(Field<String> contactemail) {
this.contactemail = contactemail;
}
public String getSummary() {
public Field<String> getSummary() {
return summary;
}
public void setSummary( String summary) {
public void setSummary(Field<String> summary) {
this.summary = summary;
}
public String getCurrency() {
public Field<String> getCurrency() {
return currency;
}
public void setCurrency( String currency) {
public void setCurrency(Field<String> currency) {
this.currency = currency;
}

View File

@ -1,26 +0,0 @@
package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
public class Provenance implements Serializable {
private KeyValue collectedfrom;
private DataInfo dataInfo;
public KeyValue getCollectedfrom() {
return collectedfrom;
}
public void setCollectedfrom(KeyValue collectedfrom) {
this.collectedfrom = collectedfrom;
}
public DataInfo getDataInfo() {
return dataInfo;
}
public void setDataInfo(DataInfo dataInfo) {
this.dataInfo = dataInfo;
}
}

View File

@ -3,10 +3,25 @@ package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
import eu.dnetlib.dhp.schema.common.ModelConstants;
public class Publication extends Result implements Serializable {
private static final long serialVersionUID = 4155353046627214846L;
// publication specific
private Journal journal;
public Publication() {
setResulttype(RESULTTYPE.publication);
setResulttype(ModelConstants.PUBLICATION_DEFAULT_RESULTTYPE);
}
public Journal getJournal() {
return journal;
}
public void setJournal(Journal journal) {
this.journal = journal;
}
}

View File

@ -1,23 +0,0 @@
package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
public class Publisher implements Serializable {
private String name;
public Publisher() {
}
public Publisher(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -2,18 +2,19 @@
package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
import java.util.stream.Stream;
import java.util.Objects;
import java.util.Optional;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.EqualsBuilder;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.base.Joiner;
public class Qualifier implements Serializable {
private static final long serialVersionUID = 6632548656644563076L;
private String classid;
private String classname;
private String schemeid;
private String schemename;
public String getClassid() {
return classid;
@ -39,30 +40,12 @@ public class Qualifier implements Serializable {
this.schemeid = schemeid;
}
public String toComparableString() {
return Joiner
.on("::")
.join(
Stream.of(getClassid(), getClassname(), getSchemeid())
.filter(StringUtils::isNotBlank).iterator());
public String getSchemename() {
return schemename;
}
@Override
public int hashCode() {
return toComparableString().hashCode();
public void setSchemename(String schemename) {
this.schemename = schemename;
}
@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());
}
}

View File

@ -1,451 +1,148 @@
package eu.dnetlib.dhp.schema.oaf;
import java.beans.Transient;
import java.io.Serializable;
import java.util.*;
import static com.google.common.base.Preconditions.checkArgument;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import eu.dnetlib.dhp.schema.common.ModelSupport;
/**
* Relation models any edge between two nodes in the OpenAIRE graph. It has a source id and a target id pointing to
* graph node identifiers, and it is further characterised by the semantic of the link through the fields relType,
* graph node identifiers and it is further characterised by the semantic of the link through the fields relType,
* subRelType and relClass. Provenance information is modeled according to the dataInfo element and collectedFrom, while
* individual relationship types can provide extra information via the properties field.
*/
public class Relation extends Oaf implements Serializable {
public class Relation extends Oaf {
private static final long serialVersionUID = -7061565324218172207L;
public enum RELTYPE {
resultResult,
resultProject,
resultOrganization,
projectOrganization,
datasourceOrganization,
organizationOrganization;
}
/**
* Main relationship classifier, values include 'resultResult', 'resultProject', 'resultOrganization', etc.
*/
private String relType;
public enum SUBRELTYPE {
affiliation,
citation,
dedup,
outcome,
part,
participation,
provision,
relationship,
review,
similarity,
supplement,
version;
public static boolean exists(String subreltype) {
try {
SUBRELTYPE.valueOf(subreltype);
return true;
} catch (IllegalArgumentException | NullPointerException e) {
return false;
}
}
}
/**
* Further classifies a relationship, values include 'affiliation', 'similarity', 'supplement', etc.
*/
private String subRelType;
public enum RELCLASS {
IsVersionOf,
IsSourceOf,
isMergedIn,
IsIdenticalTo,
Documents,
IsAmongTopNSimilarDocuments,
IsSupplementedBy,
IsObsoletedBy,
Continues,
IsParentOf,
IsReferencedBy,
IsCitedBy,
Compiles,
IsPreviousVersionOf,
HasPart,
IsDocumentedBy,
HasAmongTopNSimilarDocuments,
isParticipant,
hasAuthorInstitution,
IsRelatedTo,
Requires,
Describes,
IsReviewedBy,
IsContinuedBy,
provides,
IsChildOf,
IsDescribedBy,
IsNewVersionOf,
IsPartOf,
HasVersion,
hasParticipant,
isAuthorInstitutionOf,
IsVariantFormOf,
isProducedBy,
IsMetadataFor,
HasAssociationWith,
Cites,
IsRequiredBy,
IsOriginalFormOf,
IsSupplementTo,
IsMetadataOf,
References,
IsCompiledBy,
isProvidedBy,
merges,
IsDerivedFrom,
Obsoletes,
Reviews,
isSimilarTo,
isDifferentFrom,
produces;
/**
* Indicates the direction of the relationship, values include 'isSupplementTo', 'isSupplementedBy', 'merges,
* 'isMergedIn'.
*/
private String relClass;
public static boolean exists(String relclass) {
try {
RELCLASS.valueOf(relclass);
return true;
} catch (IllegalArgumentException | NullPointerException e) {
return false;
}
}
@Transient
public SUBRELTYPE getSubRel() {
switch (this) {
case isParticipant:
case hasParticipant:
return SUBRELTYPE.participation;
case isAuthorInstitutionOf:
case hasAuthorInstitution:
return SUBRELTYPE.affiliation;
case isMergedIn:
case merges:
case isSimilarTo:
case isDifferentFrom:
return SUBRELTYPE.dedup;
case isProducedBy:
case produces:
return SUBRELTYPE.outcome;
case isProvidedBy:
case provides:
return SUBRELTYPE.provision;
case IsAmongTopNSimilarDocuments:
case HasAmongTopNSimilarDocuments:
return SUBRELTYPE.similarity;
case IsSupplementedBy:
case IsSupplementTo:
return SUBRELTYPE.supplement;
case IsPartOf:
case HasPart:
return SUBRELTYPE.part;
case IsCitedBy:
case Cites:
return SUBRELTYPE.citation;
case IsIdenticalTo:
case IsReferencedBy:
case References:
case IsContinuedBy:
case Continues:
case IsDocumentedBy:
case Documents:
case IsDerivedFrom:
case IsSourceOf:
case IsRelatedTo:
case IsCompiledBy:
case Compiles:
case IsDescribedBy:
case Describes:
case IsMetadataFor:
case IsMetadataOf:
case HasAssociationWith:
case IsRequiredBy:
case Requires:
case IsChildOf:
case IsParentOf:
return SUBRELTYPE.relationship;
case IsPreviousVersionOf:
case IsNewVersionOf:
case IsVariantFormOf:
case IsOriginalFormOf:
case IsObsoletedBy:
case Obsoletes:
case IsVersionOf:
case HasVersion:
return SUBRELTYPE.version;
case IsReviewedBy:
case Reviews:
return SUBRELTYPE.review;
}
// makes the compiler happy
throw new IllegalArgumentException("missing SubRel mapping for" + this);
}
/**
* The source entity id.
*/
private String source;
/**
* This mehtod is an implementation of the valueOF case insensitive
* @param value the input Value
* @return the RELCLASS
*/
public static RELCLASS lookUp(String value) {
Optional<RELCLASS> rvlaue = Arrays.stream(RELCLASS.values()).filter(e -> e.name().equalsIgnoreCase(value)).findAny();
if (rvlaue.isPresent())
return rvlaue.get();
throw new IllegalArgumentException("value: "+value+" not found");
}
/**
* The target entity id.
*/
private String target;
@Transient
public RELCLASS getInverse() {
switch (this) {
case IsVersionOf:
return HasVersion;
case IsSourceOf:
return IsDerivedFrom;
case isMergedIn:
return merges;
case IsIdenticalTo:
return IsIdenticalTo;
case Documents:
return IsDocumentedBy;
case IsAmongTopNSimilarDocuments:
return HasAmongTopNSimilarDocuments;
case IsSupplementedBy:
return IsSupplementTo;
case IsObsoletedBy:
return Obsoletes;
case Continues:
return IsContinuedBy;
case IsParentOf:
return IsChildOf;
case IsReferencedBy:
return References;
case IsCitedBy:
return Cites;
case Compiles:
return IsCompiledBy;
case IsPreviousVersionOf:
return IsNewVersionOf;
case HasPart:
return IsPartOf;
case IsDocumentedBy:
return Documents;
case HasAmongTopNSimilarDocuments:
return IsAmongTopNSimilarDocuments;
case isParticipant:
return hasParticipant;
case hasAuthorInstitution:
return isAuthorInstitutionOf;
case IsRelatedTo:
return IsRelatedTo;
case Requires:
return IsRequiredBy;
case Describes:
return IsDescribedBy;
case IsReviewedBy:
return Reviews;
case IsContinuedBy:
return Continues;
case provides:
return isProvidedBy;
case IsChildOf:
return IsParentOf;
case IsDescribedBy:
return Describes;
case IsNewVersionOf:
return IsPreviousVersionOf;
case IsPartOf:
return HasPart;
case HasVersion:
return IsVersionOf;
case hasParticipant:
return isParticipant;
case isAuthorInstitutionOf:
return hasAuthorInstitution;
case IsVariantFormOf:
return IsOriginalFormOf;
case isProducedBy:
return produces;
case IsMetadataFor:
return IsMetadataOf;
case Cites:
return IsCitedBy;
case IsRequiredBy:
return Requires;
case IsOriginalFormOf:
return IsVariantFormOf;
case IsSupplementTo:
return IsSupplementedBy;
case IsMetadataOf:
return IsMetadataFor;
case References:
return IsReferencedBy;
case IsCompiledBy:
return Compiles;
case isProvidedBy:
return provides;
case merges:
return isMergedIn;
case IsDerivedFrom:
return IsSourceOf;
case Obsoletes:
return IsObsoletedBy;
case Reviews:
return IsReviewedBy;
case produces:
return isProducedBy;
case isSimilarTo:
return isSimilarTo;
case isDifferentFrom:
return isDifferentFrom;
}
// makes the compiler happy
throw new IllegalArgumentException("missing inverse mapping for" + this);
}
}
/**
* Was this relationship authoritatively validated?
*/
private Boolean validated;
/**
* Main relationship classifier, values include 'resultResult', 'resultProject', 'resultOrganization', etc.
*/
private RELTYPE relType;
/**
* When was this relationship authoritatively validated.
*/
private String validationDate;
/**
* Further classifies a relationship, values include 'affiliation', 'similarity', 'supplement', etc.
*/
private SUBRELTYPE subRelType;
/**
* List of relation specific properties. Values include 'similarityLevel', indicating the similarity score between a
* pair of publications.
*/
private List<KeyValue> properties = new ArrayList<>();
/**
* Indicates the direction of the relationship, values include 'isSupplementTo', 'isSupplementedBy', 'merges,
* 'isMergedIn'.
*/
private RELCLASS relClass;
public String getRelType() {
return relType;
}
/**
* The source entity id.
*/
private String source;
public void setRelType(final String relType) {
this.relType = relType;
}
/**
* The target entity id.
*/
private String target;
public String getSubRelType() {
return subRelType;
}
/**
* Was this relationship authoritatively validated?
*/
private Boolean validated;
public void setSubRelType(final String subRelType) {
this.subRelType = subRelType;
}
/**
* When was this relationship authoritatively validated.
*/
private String validationDate;
public String getRelClass() {
return relClass;
}
private List<Provenance> provenance;
public void setRelClass(final String relClass) {
this.relClass = relClass;
}
/**
* List of relation specific properties. Values include 'similarityLevel', indicating the similarity score between a
* pair of publications.
*/
private List<KeyValue> properties = new ArrayList<>();
public String getSource() {
return source;
}
public RELTYPE getRelType() {
return relType;
}
public void setSource(final String source) {
this.source = source;
}
public void setRelType(final RELTYPE relType) {
this.relType = relType;
}
public String getTarget() {
return target;
}
public SUBRELTYPE getSubRelType() {
return subRelType;
}
public void setTarget(final String target) {
this.target = target;
}
public void setSubRelType(final SUBRELTYPE subRelType) {
this.subRelType = subRelType;
}
public List<KeyValue> getProperties() {
return properties;
}
public RELCLASS getRelClass() {
return relClass;
}
public void setProperties(List<KeyValue> properties) {
this.properties = properties;
}
public void setRelClass(final RELCLASS relClass) {
this.relClass = relClass;
}
public Boolean getValidated() {
return Objects.nonNull(validated) && validated;
}
public String getSource() {
return source;
}
public void setValidated(Boolean validated) {
this.validated = validated;
}
public void setSource(final String source) {
this.source = source;
}
public String getValidationDate() {
return validationDate;
}
public String getTarget() {
return target;
}
public void setValidationDate(String validationDate) {
this.validationDate = validationDate;
}
public void setTarget(final String target) {
this.target = target;
}
@Override
public int hashCode() {
return Objects.hash(getRelType(), getSubRelType(), getRelClass(), getSource(), getTarget());
}
public List<KeyValue> getProperties() {
return properties;
}
public void setProperties(List<KeyValue> properties) {
this.properties = properties;
}
public Boolean getValidated() {
return Objects.nonNull(validated) && validated;
}
public void setValidated(Boolean validated) {
this.validated = validated;
}
public String getValidationDate() {
return validationDate;
}
public void setValidationDate(String validationDate) {
this.validationDate = validationDate;
}
public List<Provenance> getProvenance() {
return provenance;
}
public void setProvenance(List<Provenance> provenance) {
this.provenance = provenance;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Relation relation = (Relation) o;
return relType.equals(relation.relType)
&& subRelType.equals(relation.subRelType)
&& relClass.equals(relation.relClass)
&& source.equals(relation.source)
&& target.equals(relation.target);
}
public Relation inverse() {
final Relation inverse = new Relation();
inverse.setSource(this.target);
inverse.setTarget(this.source);
inverse.setRelClass(this.relClass.getInverse());
inverse.setRelType(this.relType);
inverse.setSubRelType(this.subRelType);
inverse.setProperties(this.properties);
inverse.setValidated(validated);
inverse.setProvenance(provenance);
inverse.setValidationDate(validationDate);
return inverse;
}
@Override
public int hashCode() {
return Objects.hash(relType, subRelType, relClass, source, target, provenance);
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Relation relation = (Relation) o;
return Objects.equals(getRelType(), relation.getRelType()) &&
Objects.equals(getSubRelType(), relation.getSubRelType()) &&
Objects.equals(getRelClass(), relation.getRelClass()) &&
Objects.equals(getSource(), relation.getSource()) &&
Objects.equals(getTarget(), relation.getTarget());
}
}

View File

@ -4,27 +4,24 @@ package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* The type Result.
*/
public class Result extends Entity implements Serializable {
public class Result extends OafEntity implements Serializable {
public enum RESULTTYPE {
publication,
dataset,
software,
otherresearchproduct
}
private static final long serialVersionUID = 5597290552671699408L;
/**
* ( article | book ) processing charges.
*/
private String processingchargeamount;
private Field<String> processingchargeamount;
/**
* currency - alphabetic code describe in ISO-4217.
*/
private String processingchargecurrency;
private Field<String> processingchargecurrency;
/**
* The Author.
@ -32,13 +29,20 @@ public class Result extends Entity implements Serializable {
private List<Author> author;
/**
* The Resulttype. It allows subclassing results into publications | datasets | software | orp
* The Resulttype.
*/
private RESULTTYPE resulttype;
// resulttype allows subclassing results into publications | datasets | software
private Qualifier resulttype;
/**
* Temporary field suporting the analysis of the new COAR-based resource types
*/
private Qualifier metaResourceType;
/**
* The Language.
*/
// common fields
private Qualifier language;
/**
@ -64,42 +68,42 @@ public class Result extends Entity implements Serializable {
/**
* The Description.
*/
private List<String> description;
private List<Field<String>> description;
/**
* The Dateofacceptance.
*/
private String dateofacceptance;
private Field<String> dateofacceptance;
/**
* The Publisher.
*/
private Publisher publisher;
private Field<String> publisher;
/**
* The Embargoenddate.
*/
private String embargoenddate;
private Field<String> embargoenddate;
/**
* The Source.
*/
private List<String> source;
private List<Field<String>> source;
/**
* The Fulltext.
* The list of direct fulltext URLs.
*/
private List<String> fulltext;
private List<Field<String>> fulltext;
/**
* The Format.
*/
private List<String> format;
private List<Field<String>> format;
/**
* The Contributor.
*/
private List<String> contributor;
private List<Field<String>> contributor;
/**
* The Resourcetype.
@ -109,20 +113,13 @@ public class Result extends Entity implements Serializable {
/**
* The Coverage.
*/
private List<String> coverage;
private List<Field<String>> coverage;
/**
* The Bestaccessright.
*/
private Qualifier bestaccessright;
private Journal journal;
/**
* The Context.
*/
private List<Context> context;
/**
* The External reference.
*/
@ -138,21 +135,39 @@ public class Result extends Entity implements Serializable {
*/
private List<EoscIfGuidelines> eoscifguidelines;
private OAIProvenance oaiprovenance;
@JsonProperty("isGreen")
private Boolean isGreen;
public String getProcessingchargeamount() {
private OpenAccessColor openAccessColor;
@JsonProperty("isInDiamondJournal")
private Boolean isInDiamondJournal;
private Boolean publiclyFunded;
private String transformativeAgreement;
public String getTransformativeAgreement() {
return transformativeAgreement;
}
public void setTransformativeAgreement(String transformativeAgreement) {
this.transformativeAgreement = transformativeAgreement;
}
public Field<String> getProcessingchargeamount() {
return processingchargeamount;
}
public void setProcessingchargeamount(String processingchargeamount) {
public void setProcessingchargeamount(Field<String> processingchargeamount) {
this.processingchargeamount = processingchargeamount;
}
public String getProcessingchargecurrency() {
public Field<String> getProcessingchargecurrency() {
return processingchargecurrency;
}
public void setProcessingchargecurrency(String processingchargecurrency) {
public void setProcessingchargecurrency(Field<String> processingchargecurrency) {
this.processingchargecurrency = processingchargecurrency;
}
@ -179,7 +194,7 @@ public class Result extends Entity implements Serializable {
*
* @return the resulttype
*/
public RESULTTYPE getResulttype() {
public Qualifier getResulttype() {
return resulttype;
}
@ -188,10 +203,18 @@ public class Result extends Entity implements Serializable {
*
* @param resulttype the resulttype
*/
public void setResulttype(RESULTTYPE resulttype) {
public void setResulttype(Qualifier resulttype) {
this.resulttype = resulttype;
}
public Qualifier getMetaResourceType() {
return metaResourceType;
}
public void setMetaResourceType(Qualifier metaResourceType) {
this.metaResourceType = metaResourceType;
}
/**
* Gets language.
*
@ -287,7 +310,7 @@ public class Result extends Entity implements Serializable {
*
* @return the description
*/
public List<String> getDescription() {
public List<Field<String>> getDescription() {
return description;
}
@ -296,7 +319,7 @@ public class Result extends Entity implements Serializable {
*
* @param description the description
*/
public void setDescription(List<String> description) {
public void setDescription(List<Field<String>> description) {
this.description = description;
}
@ -305,7 +328,7 @@ public class Result extends Entity implements Serializable {
*
* @return the dateofacceptance
*/
public String getDateofacceptance() {
public Field<String> getDateofacceptance() {
return dateofacceptance;
}
@ -314,7 +337,7 @@ public class Result extends Entity implements Serializable {
*
* @param dateofacceptance the dateofacceptance
*/
public void setDateofacceptance(String dateofacceptance) {
public void setDateofacceptance(Field<String> dateofacceptance) {
this.dateofacceptance = dateofacceptance;
}
@ -323,7 +346,7 @@ public class Result extends Entity implements Serializable {
*
* @return the publisher
*/
public Publisher getPublisher() {
public Field<String> getPublisher() {
return publisher;
}
@ -332,7 +355,7 @@ public class Result extends Entity implements Serializable {
*
* @param publisher the publisher
*/
public void setPublisher(Publisher publisher) {
public void setPublisher(Field<String> publisher) {
this.publisher = publisher;
}
@ -341,7 +364,7 @@ public class Result extends Entity implements Serializable {
*
* @return the embargoenddate
*/
public String getEmbargoenddate() {
public Field<String> getEmbargoenddate() {
return embargoenddate;
}
@ -350,7 +373,7 @@ public class Result extends Entity implements Serializable {
*
* @param embargoenddate the embargoenddate
*/
public void setEmbargoenddate(String embargoenddate) {
public void setEmbargoenddate(Field<String> embargoenddate) {
this.embargoenddate = embargoenddate;
}
@ -359,7 +382,7 @@ public class Result extends Entity implements Serializable {
*
* @return the source
*/
public List<String> getSource() {
public List<Field<String>> getSource() {
return source;
}
@ -368,7 +391,7 @@ public class Result extends Entity implements Serializable {
*
* @param source the source
*/
public void setSource(List<String> source) {
public void setSource(List<Field<String>> source) {
this.source = source;
}
@ -377,7 +400,7 @@ public class Result extends Entity implements Serializable {
*
* @return the fulltext
*/
public List<String> getFulltext() {
public List<Field<String>> getFulltext() {
return fulltext;
}
@ -386,7 +409,7 @@ public class Result extends Entity implements Serializable {
*
* @param fulltext the fulltext
*/
public void setFulltext(List<String> fulltext) {
public void setFulltext(List<Field<String>> fulltext) {
this.fulltext = fulltext;
}
@ -395,7 +418,7 @@ public class Result extends Entity implements Serializable {
*
* @return the format
*/
public List<String> getFormat() {
public List<Field<String>> getFormat() {
return format;
}
@ -404,7 +427,7 @@ public class Result extends Entity implements Serializable {
*
* @param format the format
*/
public void setFormat(List<String> format) {
public void setFormat(List<Field<String>> format) {
this.format = format;
}
@ -413,7 +436,7 @@ public class Result extends Entity implements Serializable {
*
* @return the contributor
*/
public List<String> getContributor() {
public List<Field<String>> getContributor() {
return contributor;
}
@ -422,7 +445,7 @@ public class Result extends Entity implements Serializable {
*
* @param contributor the contributor
*/
public void setContributor(List<String> contributor) {
public void setContributor(List<Field<String>> contributor) {
this.contributor = contributor;
}
@ -449,7 +472,7 @@ public class Result extends Entity implements Serializable {
*
* @return the coverage
*/
public List<String> getCoverage() {
public List<Field<String>> getCoverage() {
return coverage;
}
@ -458,7 +481,7 @@ public class Result extends Entity implements Serializable {
*
* @param coverage the coverage
*/
public void setCoverage(List<String> coverage) {
public void setCoverage(List<Field<String>> coverage) {
this.coverage = coverage;
}
@ -480,32 +503,6 @@ public class Result extends Entity implements Serializable {
this.bestaccessright = bestaccessright;
}
public Journal getJournal() {
return journal;
}
public void setJournal(Journal journal) {
this.journal = journal;
}
/**
* Gets context.
*
* @return the context
*/
public List<Context> getContext() {
return context;
}
/**
* Sets context.
*
* @param context the context
*/
public void setContext(List<Context> context) {
this.context = context;
}
/**
* Gets external reference.
*
@ -550,11 +547,36 @@ public class Result extends Entity implements Serializable {
this.eoscifguidelines = eoscifguidelines;
}
public OAIProvenance getOaiprovenance() {
return oaiprovenance;
public Boolean getIsGreen() {
return isGreen;
}
public void setOaiprovenance(OAIProvenance oaiprovenance) {
this.oaiprovenance = oaiprovenance;
public void setIsGreen(Boolean green) {
isGreen = green;
}
public OpenAccessColor getOpenAccessColor() {
return openAccessColor;
}
public void setOpenAccessColor(OpenAccessColor openAccessColor) {
this.openAccessColor = openAccessColor;
}
public Boolean getIsInDiamondJournal() {
return isInDiamondJournal;
}
public void setIsInDiamondJournal(Boolean inDiamondJournal) {
isInDiamondJournal = inDiamondJournal;
}
public Boolean getPubliclyFunded() {
return publiclyFunded;
}
public void setPubliclyFunded(Boolean publiclyFunded) {
this.publiclyFunded = publiclyFunded;
}
}

View File

@ -4,32 +4,47 @@ package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
import java.util.List;
import eu.dnetlib.dhp.schema.common.ModelConstants;
public class Software extends Result implements Serializable {
private List<String> documentationUrl;
private static final long serialVersionUID = -3096641763359312576L;
private List<Field<String>> documentationUrl;
// candidate for removal
private String codeRepositoryUrl;
private List<StructuredProperty> license;
// candidate for removal
private Field<String> codeRepositoryUrl;
private Qualifier programmingLanguage;
public Software() {
setResulttype(RESULTTYPE.software);
setResulttype(ModelConstants.SOFTWARE_DEFAULT_RESULTTYPE);
}
public List<String> getDocumentationUrl() {
public List<Field<String>> getDocumentationUrl() {
return documentationUrl;
}
public void setDocumentationUrl(List<String> documentationUrl) {
public void setDocumentationUrl(List<Field<String>> documentationUrl) {
this.documentationUrl = documentationUrl;
}
public String getCodeRepositoryUrl() {
public List<StructuredProperty> getLicense() {
return license;
}
public void setLicense(List<StructuredProperty> license) {
this.license = license;
}
public Field<String> getCodeRepositoryUrl() {
return codeRepositoryUrl;
}
public void setCodeRepositoryUrl(String codeRepositoryUrl) {
public void setCodeRepositoryUrl(Field<String> codeRepositoryUrl) {
this.codeRepositoryUrl = codeRepositoryUrl;
}
@ -40,4 +55,5 @@ public class Software extends Result implements Serializable {
public void setProgrammingLanguage(Qualifier programmingLanguage) {
this.programmingLanguage = programmingLanguage;
}
}

View File

@ -2,6 +2,7 @@
package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ -10,10 +11,14 @@ import org.apache.commons.lang3.StringUtils;
public class StructuredProperty implements Serializable {
private static final long serialVersionUID = -8490243153237377762L;
private String value;
private Qualifier qualifier;
private DataInfo dataInfo;
public String getValue() {
return value;
}
@ -30,31 +35,12 @@ public class StructuredProperty implements Serializable {
this.qualifier = qualifier;
}
public String toComparableString() {
return Stream
.of(
Optional.ofNullable(getQualifier()).map(q -> q.toComparableString()).orElse(""),
Optional.ofNullable(getValue()).map(String::toLowerCase).orElse(""))
.filter(StringUtils::isNotBlank)
.collect(Collectors.joining("||"));
public DataInfo getDataInfo() {
return dataInfo;
}
@Override
public int hashCode() {
return toComparableString().hashCode();
public void setDataInfo(DataInfo dataInfo) {
this.dataInfo = dataInfo;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
StructuredProperty other = (StructuredProperty) obj;
return toComparableString().equals(other.toComparableString());
}
}

View File

@ -4,13 +4,6 @@ import java.io.Serializable;
public class Subject extends StructuredProperty implements Serializable {
private DataInfo dataInfo;
private static final long serialVersionUID = 5072481219939207428L;
public DataInfo getDataInfo() {
return dataInfo;
}
public void setDataInfo(DataInfo dataInfo) {
this.dataInfo = dataInfo;
}
}

View File

@ -0,0 +1,39 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
/**
* Used to refer to the Article Processing Charge information. It contains two parameters: -
* currency of type String to store the currency of the APC - amount of type String to stores the charged amount
*/
public class APC implements Serializable {
private static final long serialVersionUID = 8324447899738993669L;
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;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public String getAmount() {
return amount;
}
public void setAmount(String amount) {
this.amount = amount;
}
}

View File

@ -0,0 +1,41 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
/**
* This class models the access rights of research products.
*/
public class AccessRight implements Serializable {
private static final long serialVersionUID = 7995566912611238604L;
private String value;
private OpenAccessRoute openAccessRoute;
public static AccessRight newInstance(String value, OpenAccessRoute openAccessRoute) {
AccessRight accessRight = new AccessRight();
accessRight.setValue(value);
accessRight.setOpenAccessRoute(openAccessRoute);
return accessRight;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public OpenAccessRoute getOpenAccessRoute() {
return openAccessRoute;
}
public void setOpenAccessRoute(OpenAccessRoute openAccessRoute) {
this.openAccessRoute = openAccessRoute;
}
}

View File

@ -0,0 +1,72 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
public class Author implements Serializable {
private static final long serialVersionUID = 5482727671039062564L;
private String fullname;
private String name;
private String surname;
private Integer rank;
/**
* The author's persistent identifiers
*/
private List<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);
a.setSurname(surname);
a.setRank(rank);
a.setPid(pid);
return a;
}
public String getFullname() {
return fullname;
}
public void setFullname(String fullname) {
this.fullname = fullname;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSurname() {
return surname;
}
public void setSurname(String surname) {
this.surname = surname;
}
public Integer getRank() {
return rank;
}
public void setRank(Integer rank) {
this.rank = rank;
}
public List<Pid> getPid() {
return pid;
}
public void setPid(List<Pid> pid) {
this.pid = pid;
}
}

View File

@ -0,0 +1,44 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
/**
* BestAccessRight. Used to represent the result best access rights.
*/
public class BestAccessRight implements Serializable {
private static final long serialVersionUID = 689431927147731065L;
/**
* AccessRight code
*/
private String code; // the classid in the Qualifier
/**
* Label for the access mode
*/
private String label; // the classname in the Qualifier
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public static BestAccessRight newInstance(String code, String label) {
BestAccessRight ar = new BestAccessRight();
ar.code = code;
ar.label = label;
return ar;
}
}

View File

@ -0,0 +1,44 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
import com.google.common.collect.Lists;
public class Category implements Serializable {
private String id;
private String label;
private List<Concept> concept = Lists.newArrayList();
public static Category newInstance(String id, String label) {
Category category = new Category();
category.setId(id);
category.setLabel(label);
return category;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public List<Concept> getConcept() {
return concept;
}
public void setConcept(List<Concept> concept) {
this.concept = concept;
}
}

View File

@ -0,0 +1,35 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class CodeLabel implements Serializable {
private static final long serialVersionUID = 8182033641583483845L;
private String code;
private String label;
public static CodeLabel newInstance(String code, String label) {
CodeLabel cl = new CodeLabel();
cl.setCode(code);
cl.setLabel(label);
return cl;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
}

View File

@ -0,0 +1,34 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class Concept implements Serializable {
private static final long serialVersionUID = -2309379406128410374L;
private String id;
private String label;
public static Concept newInstance(String id, String label) {
Concept concept = new Concept();
concept.setId(id);
concept.setLabel(label);
return concept;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
}

View File

@ -0,0 +1,55 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
import com.google.common.collect.Lists;
public class Context implements Serializable {
private String id;
private String label;
private String type;
private List<Category> category = Lists.newArrayList();
public static Context newInstance(String id, String label, String type, List<Category> category) {
Context context = new Context();
context.setId(id);
context.setLabel(label);
context.setType(type);
context.setCategory(category);
return context;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public List<Category> getCategory() {
return category;
}
public void setCategory(List<Category> category) {
this.category = category;
}
}

View File

@ -0,0 +1,49 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
/**
* Represents the country associated to the generic entity. The value for this element correspond to: - code corresponds
* to the classid of eu.dnetlib.dhp.schema.oaf.Country - label corresponds to the classname of
* eu.dnetlib.dhp.schema.oaf.Country - provenance set only if the dataInfo associated to the Country of the result to be
* dumped is not null. In this case : - provenance corresponds to dataInfo.provenanceaction.classid (to be modified with
* datainfo.provenanceaction.classname) - trust corresponds to dataInfo.trust
*/
public class Country implements Serializable {
private static final long serialVersionUID = 544249673120027949L;
/**
* ISO 3166-1 alpha-2 country code (i.e. IT)
*/
private String code; // the classid in the Qualifier
/**
* The label for that code (i.e. Italy)
*/
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;
}
public void setCode(String code) {
this.code = code;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
}

View File

@ -0,0 +1,538 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
public class Datasource implements Serializable {
private static final long serialVersionUID = -5817484869244344681L;
private CodeLabel datasourcetype;
private CodeLabel datasourcetypeui;
private CodeLabel eosctype; // Data Source | Service
private CodeLabel eoscdatasourcetype;
private CodeLabel openairecompatibility;
private String officialname;
private String englishname;
private String websiteurl;
private String logourl;
private String contactemail;
private String namespaceprefix;
private String latitude;
private String longitude;
private String dateofvalidation;
private String description;
private List<Subject> subjects;
private String odnumberofitems;
private String odnumberofitemsdate;
private String odpolicies;
private List<String> odlanguages;
private List<String> languages;
private List<String> odcontenttypes;
private List<String> accessinfopackage;
// re3data fields
private String releasestartdate;
private String releaseenddate;
private String missionstatementurl;
private Boolean dataprovider;
private Boolean serviceprovider;
// {open, restricted or closed}
private String databaseaccesstype;
// {open, restricted or closed}
private String datauploadtype;
// {feeRequired, registration, other}
private String databaseaccessrestriction;
// {feeRequired, registration, other}
private String datauploadrestriction;
private Boolean versioning;
private Boolean versioncontrol;
private String citationguidelineurl;
private String pidsystems;
private String certificates;
private List<CodeLabel> policies;
private Journal journal;
// New field for EOSC
private List<String> researchentitytypes;
// New field for EOSC
private List<String> providedproducttypes;
// New field for EOSC
private CodeLabel jurisdiction;
// New field for EOSC
private Boolean thematic;
// New field for EOSC
private List<CodeLabel> contentpolicies;
private String submissionpolicyurl;
private String preservationpolicyurl;
private List<String> researchproductaccesspolicies;
private List<String> researchproductmetadataaccesspolicies;
private Boolean consenttermsofuse;
private Boolean fulltextdownload;
private String consenttermsofusedate;
private String lastconsenttermsofusedate;
public CodeLabel getDatasourcetype() {
return datasourcetype;
}
public void setDatasourcetype(CodeLabel datasourcetype) {
this.datasourcetype = datasourcetype;
}
public CodeLabel getDatasourcetypeui() {
return datasourcetypeui;
}
public void setDatasourcetypeui(CodeLabel datasourcetypeui) {
this.datasourcetypeui = datasourcetypeui;
}
public CodeLabel getEosctype() {
return eosctype;
}
public void setEosctype(CodeLabel eosctype) {
this.eosctype = eosctype;
}
public CodeLabel getEoscdatasourcetype() {
return eoscdatasourcetype;
}
public void setEoscdatasourcetype(CodeLabel eoscdatasourcetype) {
this.eoscdatasourcetype = eoscdatasourcetype;
}
public CodeLabel getOpenairecompatibility() {
return openairecompatibility;
}
public void setOpenairecompatibility(CodeLabel openairecompatibility) {
this.openairecompatibility = openairecompatibility;
}
public String getOfficialname() {
return officialname;
}
public void setOfficialname(String officialname) {
this.officialname = officialname;
}
public String getEnglishname() {
return englishname;
}
public void setEnglishname(String englishname) {
this.englishname = englishname;
}
public String getWebsiteurl() {
return websiteurl;
}
public void setWebsiteurl(String websiteurl) {
this.websiteurl = websiteurl;
}
public String getLogourl() {
return logourl;
}
public void setLogourl(String logourl) {
this.logourl = logourl;
}
public String getContactemail() {
return contactemail;
}
public void setContactemail(String contactemail) {
this.contactemail = contactemail;
}
public String getNamespaceprefix() {
return namespaceprefix;
}
public void setNamespaceprefix(String namespaceprefix) {
this.namespaceprefix = namespaceprefix;
}
public String getLatitude() {
return latitude;
}
public void setLatitude(String latitude) {
this.latitude = latitude;
}
public String getLongitude() {
return longitude;
}
public void setLongitude(String longitude) {
this.longitude = longitude;
}
public String getDateofvalidation() {
return dateofvalidation;
}
public void setDateofvalidation(String dateofvalidation) {
this.dateofvalidation = dateofvalidation;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public List<Subject> getSubjects() {
return subjects;
}
public void setSubjects(List<Subject> subjects) {
this.subjects = subjects;
}
public String getOdnumberofitems() {
return odnumberofitems;
}
public void setOdnumberofitems(String odnumberofitems) {
this.odnumberofitems = odnumberofitems;
}
public String getOdnumberofitemsdate() {
return odnumberofitemsdate;
}
public void setOdnumberofitemsdate(String odnumberofitemsdate) {
this.odnumberofitemsdate = odnumberofitemsdate;
}
public String getOdpolicies() {
return odpolicies;
}
public void setOdpolicies(String odpolicies) {
this.odpolicies = odpolicies;
}
public List<String> getOdlanguages() {
return odlanguages;
}
public void setOdlanguages(List<String> odlanguages) {
this.odlanguages = odlanguages;
}
public List<String> getLanguages() {
return languages;
}
public void setLanguages(List<String> languages) {
this.languages = languages;
}
public List<String> getOdcontenttypes() {
return odcontenttypes;
}
public void setOdcontenttypes(List<String> odcontenttypes) {
this.odcontenttypes = odcontenttypes;
}
public List<String> getAccessinfopackage() {
return accessinfopackage;
}
public void setAccessinfopackage(List<String> accessinfopackage) {
this.accessinfopackage = accessinfopackage;
}
public String getReleasestartdate() {
return releasestartdate;
}
public void setReleasestartdate(String releasestartdate) {
this.releasestartdate = releasestartdate;
}
public String getReleaseenddate() {
return releaseenddate;
}
public void setReleaseenddate(String releaseenddate) {
this.releaseenddate = releaseenddate;
}
public String getMissionstatementurl() {
return missionstatementurl;
}
public void setMissionstatementurl(String missionstatementurl) {
this.missionstatementurl = missionstatementurl;
}
public Boolean getDataprovider() {
return dataprovider;
}
public void setDataprovider(Boolean dataprovider) {
this.dataprovider = dataprovider;
}
public Boolean getServiceprovider() {
return serviceprovider;
}
public void setServiceprovider(Boolean serviceprovider) {
this.serviceprovider = serviceprovider;
}
public String getDatabaseaccesstype() {
return databaseaccesstype;
}
public void setDatabaseaccesstype(String databaseaccesstype) {
this.databaseaccesstype = databaseaccesstype;
}
public String getDatauploadtype() {
return datauploadtype;
}
public void setDatauploadtype(String datauploadtype) {
this.datauploadtype = datauploadtype;
}
public String getDatabaseaccessrestriction() {
return databaseaccessrestriction;
}
public void setDatabaseaccessrestriction(String databaseaccessrestriction) {
this.databaseaccessrestriction = databaseaccessrestriction;
}
public String getDatauploadrestriction() {
return datauploadrestriction;
}
public void setDatauploadrestriction(String datauploadrestriction) {
this.datauploadrestriction = datauploadrestriction;
}
public Boolean getVersioning() {
return versioning;
}
public void setVersioning(Boolean versioning) {
this.versioning = versioning;
}
public Boolean getVersioncontrol() {
return versioncontrol;
}
public void setVersioncontrol(Boolean versioncontrol) {
this.versioncontrol = versioncontrol;
}
public String getCitationguidelineurl() {
return citationguidelineurl;
}
public void setCitationguidelineurl(String citationguidelineurl) {
this.citationguidelineurl = citationguidelineurl;
}
public String getPidsystems() {
return pidsystems;
}
public void setPidsystems(String pidsystems) {
this.pidsystems = pidsystems;
}
public String getCertificates() {
return certificates;
}
public void setCertificates(String certificates) {
this.certificates = certificates;
}
public List<CodeLabel> getPolicies() {
return policies;
}
public void setPolicies(List<CodeLabel> policies) {
this.policies = policies;
}
public Journal getJournal() {
return journal;
}
public void setJournal(Journal journal) {
this.journal = journal;
}
public List<String> getResearchentitytypes() {
return researchentitytypes;
}
public void setResearchentitytypes(List<String> researchentitytypes) {
this.researchentitytypes = researchentitytypes;
}
public List<String> getProvidedproducttypes() {
return providedproducttypes;
}
public void setProvidedproducttypes(List<String> providedproducttypes) {
this.providedproducttypes = providedproducttypes;
}
public CodeLabel getJurisdiction() {
return jurisdiction;
}
public void setJurisdiction(CodeLabel jurisdiction) {
this.jurisdiction = jurisdiction;
}
public Boolean getThematic() {
return thematic;
}
public void setThematic(Boolean thematic) {
this.thematic = thematic;
}
public List<CodeLabel> getContentpolicies() {
return contentpolicies;
}
public void setContentpolicies(List<CodeLabel> contentpolicies) {
this.contentpolicies = contentpolicies;
}
public String getSubmissionpolicyurl() {
return submissionpolicyurl;
}
public void setSubmissionpolicyurl(String submissionpolicyurl) {
this.submissionpolicyurl = submissionpolicyurl;
}
public String getPreservationpolicyurl() {
return preservationpolicyurl;
}
public void setPreservationpolicyurl(String preservationpolicyurl) {
this.preservationpolicyurl = preservationpolicyurl;
}
public List<String> getResearchproductaccesspolicies() {
return researchproductaccesspolicies;
}
public void setResearchproductaccesspolicies(List<String> researchproductaccesspolicies) {
this.researchproductaccesspolicies = researchproductaccesspolicies;
}
public List<String> getResearchproductmetadataaccesspolicies() {
return researchproductmetadataaccesspolicies;
}
public void setResearchproductmetadataaccesspolicies(List<String> researchproductmetadataaccesspolicies) {
this.researchproductmetadataaccesspolicies = researchproductmetadataaccesspolicies;
}
public Boolean getConsenttermsofuse() {
return consenttermsofuse;
}
public void setConsenttermsofuse(Boolean consenttermsofuse) {
this.consenttermsofuse = consenttermsofuse;
}
public Boolean getFulltextdownload() {
return fulltextdownload;
}
public void setFulltextdownload(Boolean fulltextdownload) {
this.fulltextdownload = fulltextdownload;
}
public String getConsenttermsofusedate() {
return consenttermsofusedate;
}
public void setConsenttermsofusedate(String consenttermsofusedate) {
this.consenttermsofusedate = consenttermsofusedate;
}
public String getLastconsenttermsofusedate() {
return lastconsenttermsofusedate;
}
public void setLastconsenttermsofusedate(String lastconsenttermsofusedate) {
this.lastconsenttermsofusedate = lastconsenttermsofusedate;
}
}

View File

@ -0,0 +1,79 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.commons.lang3.StringUtils;
/**
* Describes a reference to the EOSC Interoperability Framework (IF) Guidelines
*/
public class EoscIfGuidelines implements Serializable {
private static final long serialVersionUID = -6460491699309783829L;
/**
* EOSC-IF local code. Later on it could be populated with a PID (e.g. DOI), but for the time being we stick to
* a more loose definition.
*/
private String code;
/**
* EOSC-IF label
*/
private String label;
/**
* EOSC-IF url
*/
private String url;
/**
* EOSC-IF semantic relation (e.g. compliesWith). Values shall be controlled by a dedicated vocabulary.
*/
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;
}
public void setCode(String code) {
this.code = code;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getSemanticRelation() {
return semanticRelation;
}
public void setSemanticRelation(String semanticRelation) {
this.semanticRelation = semanticRelation;
}
}

View File

@ -0,0 +1,10 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class ExtraInfo implements Serializable {
private static final long serialVersionUID = -6627854860189757709L;
//TODO define me!
}

View File

@ -0,0 +1,66 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
public class Funder implements Serializable {
private static final long serialVersionUID = -8008317145200052214L;
private String id;
private String shortname;
private String name;
private Country jurisdiction;
private List<Pid> pid;
public static Funder newInstance(String id, String shortname, String name, Country jurisdiction, List<Pid> pid) {
Funder funder = new Funder();
funder.setId(id);
funder.setShortname(shortname);
funder.setName(name);
funder.setJurisdiction(jurisdiction);
funder.setPid(pid);
return funder;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getShortname() {
return shortname;
}
public void setShortname(String shortname) {
this.shortname = shortname;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Country getJurisdiction() {
return jurisdiction;
}
public void setJurisdiction(Country jurisdiction) {
this.jurisdiction = jurisdiction;
}
public List<Pid> getPid() {
return pid;
}
public void setPid(List<Pid> pid) {
this.pid = pid;
}
}

View File

@ -0,0 +1,62 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class Funding implements Serializable {
private static final long serialVersionUID = 1811734787904369695L;
private Funder funder;
private FundingLevel level0;
private FundingLevel level1;
private FundingLevel level2;
public static Funding newInstance(Funder funder, FundingLevel level0) {
return newInstance(funder, level0, null, null);
}
public static Funding newInstance(Funder funder, FundingLevel level0, FundingLevel level1) {
return newInstance(funder, level0, level1, null);
}
public static Funding newInstance(Funder funder, FundingLevel level0, FundingLevel level1, FundingLevel level2) {
Funding funding = new Funding();
funding.setFunder(funder);
funding.setLevel0(level0);
funding.setLevel1(level1);
funding.setLevel2(level2);
return funding;
}
public Funder getFunder() {
return funder;
}
public void setFunder(Funder funder) {
this.funder = funder;
}
public FundingLevel getLevel0() {
return level0;
}
public void setLevel0(FundingLevel level0) {
this.level0 = level0;
}
public FundingLevel getLevel1() {
return level1;
}
public void setLevel1(FundingLevel level1) {
this.level1 = level1;
}
public FundingLevel getLevel2() {
return level2;
}
public void setLevel2(FundingLevel level2) {
this.level2 = level2;
}
}

View File

@ -0,0 +1,46 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class FundingLevel implements Serializable {
private static final long serialVersionUID = 8270506546250477574L;
private String id;
private String description;
private String name;
public static FundingLevel newInstance(String id, String description, String name) {
FundingLevel level = new FundingLevel();
level.setId(id);
level.setDescription(description);
level.setName(name);
return level;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -0,0 +1,155 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
public class Instance implements Serializable {
private static final long serialVersionUID = 7440831757124257169L;
private String license;
private AccessRight accessright;
private String instancetype;
private Provenance hostedby;
private List<String> url;
// other research products specifc
private String distributionlocation;
private Provenance collectedfrom;
private List<Pid> pid;
private List<Pid> alternateIdentifier;
private String dateofacceptance;
// ( article | book ) processing charges. Defined here to cope with possible wrongly typed
// results
private APC processingcharges;
private String refereed; // peer-review status
private List<Measure> measures;
/**
* 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

@ -0,0 +1,145 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class Journal implements Serializable {
private static final long serialVersionUID = -103050431178898773L;
/**
* Name of the journal or conference
*/
private String name;
/**
* The issn
*/
private String issnPrinted;
/**
* The e-issn
*/
private String issnOnline;
/**
* The kinking issn
*/
private String issnLinking;
/**
* Start page
*/
private String sp;
/**
* End page
*/
private String ep;
/**
* Journal issue number
*/
private String iss;
/**
* Volume
*/
private String vol;
/**
* Edition of the journal or conference proceeding
*/
private String edition;
private String conferenceplace;
private String conferencedate;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getIssnPrinted() {
return issnPrinted;
}
public void setIssnPrinted(String issnPrinted) {
this.issnPrinted = issnPrinted;
}
public String getIssnOnline() {
return issnOnline;
}
public void setIssnOnline(String issnOnline) {
this.issnOnline = issnOnline;
}
public String getIssnLinking() {
return issnLinking;
}
public void setIssnLinking(String issnLinking) {
this.issnLinking = issnLinking;
}
public String getSp() {
return sp;
}
public void setSp(String sp) {
this.sp = sp;
}
public String getEp() {
return ep;
}
public void setEp(String ep) {
this.ep = ep;
}
public String getIss() {
return iss;
}
public void setIss(String iss) {
this.iss = iss;
}
public String getVol() {
return vol;
}
public void setVol(String vol) {
this.vol = vol;
}
public String getEdition() {
return edition;
}
public void setEdition(String edition) {
this.edition = edition;
}
public String getConferenceplace() {
return conferenceplace;
}
public void setConferenceplace(String conferenceplace) {
this.conferenceplace = conferenceplace;
}
public String getConferencedate() {
return conferencedate;
}
public void setConferencedate(String conferencedate) {
this.conferencedate = conferencedate;
}
}

View File

@ -0,0 +1,42 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class Language implements Serializable {
private static final long serialVersionUID = -8308628905005193974L;
/**
* alpha-3/ISO 639-2 code of the language
*/
private String code; // the classid in the Qualifier
/**
* Language label in English
*/
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;
}
public void setCode(String code) {
this.code = code;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
}

View File

@ -0,0 +1,10 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class Measure implements Serializable {
private static final long serialVersionUID = 57939927121851504L;
//TODO define me!
}

View File

@ -0,0 +1,13 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
/**
* The OpenAccess color meant to be used on the result level
*/
public enum OpenAccessColor implements Serializable {
gold, hybrid, bronze
}

View File

@ -0,0 +1,15 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
/**
* 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 implements Serializable {
gold, green, hybrid, bronze
}

View File

@ -0,0 +1,169 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
public class Organization implements Serializable {
private static final long serialVersionUID = -4287924905285274034L;
private String legalshortname;
private String legalname;
private List<String> alternativeNames;
private String websiteurl;
private String logourl;
private String eclegalbody;
private String eclegalperson;
private String ecnonprofit;
private String ecresearchorganization;
private String echighereducation;
private String ecinternationalorganizationeurinterests;
private String ecinternationalorganization;
private String ecenterprise;
private String ecsmevalidated;
private String ecnutscode;
private CodeLabel country;
public String getLegalshortname() {
return legalshortname;
}
public void setLegalshortname(String legalshortname) {
this.legalshortname = legalshortname;
}
public String getLegalname() {
return legalname;
}
public void setLegalname(String legalname) {
this.legalname = legalname;
}
public List<String> getAlternativeNames() {
return alternativeNames;
}
public void setAlternativeNames(List<String> alternativeNames) {
this.alternativeNames = alternativeNames;
}
public String getWebsiteurl() {
return websiteurl;
}
public void setWebsiteurl(String websiteurl) {
this.websiteurl = websiteurl;
}
public String getLogourl() {
return logourl;
}
public void setLogourl(String logourl) {
this.logourl = logourl;
}
public String getEclegalbody() {
return eclegalbody;
}
public void setEclegalbody(String eclegalbody) {
this.eclegalbody = eclegalbody;
}
public String getEclegalperson() {
return eclegalperson;
}
public void setEclegalperson(String eclegalperson) {
this.eclegalperson = eclegalperson;
}
public String getEcnonprofit() {
return ecnonprofit;
}
public void setEcnonprofit(String ecnonprofit) {
this.ecnonprofit = ecnonprofit;
}
public String getEcresearchorganization() {
return ecresearchorganization;
}
public void setEcresearchorganization(String ecresearchorganization) {
this.ecresearchorganization = ecresearchorganization;
}
public String getEchighereducation() {
return echighereducation;
}
public void setEchighereducation(String echighereducation) {
this.echighereducation = echighereducation;
}
public String getEcinternationalorganizationeurinterests() {
return ecinternationalorganizationeurinterests;
}
public void setEcinternationalorganizationeurinterests(String ecinternationalorganizationeurinterests) {
this.ecinternationalorganizationeurinterests = ecinternationalorganizationeurinterests;
}
public String getEcinternationalorganization() {
return ecinternationalorganization;
}
public void setEcinternationalorganization(String ecinternationalorganization) {
this.ecinternationalorganization = ecinternationalorganization;
}
public String getEcenterprise() {
return ecenterprise;
}
public void setEcenterprise(String ecenterprise) {
this.ecenterprise = ecenterprise;
}
public String getEcsmevalidated() {
return ecsmevalidated;
}
public void setEcsmevalidated(String ecsmevalidated) {
this.ecsmevalidated = ecsmevalidated;
}
public String getEcnutscode() {
return ecnutscode;
}
public void setEcnutscode(String ecnutscode) {
this.ecnutscode = ecnutscode;
}
public CodeLabel getCountry() {
return country;
}
public void setCountry(CodeLabel country) {
this.country = country;
}
}

View File

@ -0,0 +1,35 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class Pid implements Serializable {
private static final long serialVersionUID = -943684282582228545L;
private String type;
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;
}
public void setType(String type) {
this.type = type;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

View File

@ -0,0 +1,183 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
public class Project implements Serializable {
private static final long serialVersionUID = -3712733565189222788L;
private String websiteurl;
private String code;
private String acronym;
private String title;
private String startdate;
private String enddate;
private String callidentifier;
private String keywords;
private String duration;
private String oamandatepublications;
private String ecarticle29_3;
private List<Subject> subjects;
private CodeLabel contracttype;
private String summary;
private String currency;
private Float totalcost;
private Float fundedamount;
private Funding funding;
public String getWebsiteurl() {
return websiteurl;
}
public void setWebsiteurl(String websiteurl) {
this.websiteurl = websiteurl;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getAcronym() {
return acronym;
}
public void setAcronym(String acronym) {
this.acronym = acronym;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getStartdate() {
return startdate;
}
public void setStartdate(String startdate) {
this.startdate = startdate;
}
public String getEnddate() {
return enddate;
}
public void setEnddate(String enddate) {
this.enddate = enddate;
}
public String getCallidentifier() {
return callidentifier;
}
public void setCallidentifier(String callidentifier) {
this.callidentifier = callidentifier;
}
public String getKeywords() {
return keywords;
}
public void setKeywords(String keywords) {
this.keywords = keywords;
}
public String getDuration() {
return duration;
}
public void setDuration(String duration) {
this.duration = duration;
}
public String getOamandatepublications() {
return oamandatepublications;
}
public void setOamandatepublications(String oamandatepublications) {
this.oamandatepublications = oamandatepublications;
}
public String getEcarticle29_3() {
return ecarticle29_3;
}
public void setEcarticle29_3(String ecarticle29_3) {
this.ecarticle29_3 = ecarticle29_3;
}
public List<Subject> getSubjects() {
return subjects;
}
public void setSubjects(List<Subject> subjects) {
this.subjects = subjects;
}
public CodeLabel getContracttype() {
return contracttype;
}
public void setContracttype(CodeLabel contracttype) {
this.contracttype = contracttype;
}
public String getSummary() {
return summary;
}
public void setSummary(String summary) {
this.summary = summary;
}
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public Float getTotalcost() {
return totalcost;
}
public void setTotalcost(Float totalcost) {
this.totalcost = totalcost;
}
public Float getFundedamount() {
return fundedamount;
}
public void setFundedamount(Float fundedamount) {
this.fundedamount = fundedamount;
}
public Funding getFunding() {
return funding;
}
public void setFunding(Funding funding) {
this.funding = funding;
}
}

View File

@ -0,0 +1,35 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class Provenance implements Serializable {
private static final long serialVersionUID = -474833313621479191L;
private String dsId;
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;
}
public void setDsId(String dsId) {
this.dsId = dsId;
}
public String getDsName() {
return dsName;
}
public void setDsName(String dsName) {
this.dsName = dsName;
}
}

View File

@ -0,0 +1,14 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public enum RecordType implements Serializable {
publication,
dataset,
otherresearchproduct,
software,
datasource,
organization,
project;
}

View File

@ -0,0 +1,218 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
public class RelatedRecord implements Serializable {
private static final long serialVersionUID = -7251015928787319389L;
private RelatedRecordHeader header;
// common fields
private String title;
private String websiteurl; // datasource, organizations, projects
// results
private String dateofacceptance;
private String publisher;
private List<Pid> pid;
private String codeRepositoryUrl;
private String resulttype;
private List<Provenance> collectedfrom;
private List<Instance> instances;
// datasource
private String officialname;
private CodeLabel datasourcetype;
private CodeLabel datasourcetypeui;
private CodeLabel openairecompatibility;
// organization
private String legalname;
private String legalshortname;
private Country country;
// project
private String projectTitle;
private String code;
private String acronym;
private CodeLabel contracttype;
private Funding funding;
public RelatedRecordHeader getHeader() {
return header;
}
public void setHeader(RelatedRecordHeader header) {
this.header = header;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getWebsiteurl() {
return websiteurl;
}
public void setWebsiteurl(String websiteurl) {
this.websiteurl = websiteurl;
}
public String getDateofacceptance() {
return dateofacceptance;
}
public void setDateofacceptance(String dateofacceptance) {
this.dateofacceptance = dateofacceptance;
}
public String getPublisher() {
return publisher;
}
public void setPublisher(String publisher) {
this.publisher = publisher;
}
public List<Pid> getPid() {
return pid;
}
public void setPid(List<Pid> pid) {
this.pid = pid;
}
public String getCodeRepositoryUrl() {
return codeRepositoryUrl;
}
public void setCodeRepositoryUrl(String codeRepositoryUrl) {
this.codeRepositoryUrl = codeRepositoryUrl;
}
public String getResulttype() {
return resulttype;
}
public void setResulttype(String resulttype) {
this.resulttype = resulttype;
}
public List<Provenance> getCollectedfrom() {
return collectedfrom;
}
public void setCollectedfrom(List<Provenance> collectedfrom) {
this.collectedfrom = collectedfrom;
}
public List<Instance> getInstances() {
return instances;
}
public void setInstances(List<Instance> instances) {
this.instances = instances;
}
public String getOfficialname() {
return officialname;
}
public void setOfficialname(String officialname) {
this.officialname = officialname;
}
public CodeLabel getDatasourcetype() {
return datasourcetype;
}
public void setDatasourcetype(CodeLabel datasourcetype) {
this.datasourcetype = datasourcetype;
}
public CodeLabel getDatasourcetypeui() {
return datasourcetypeui;
}
public void setDatasourcetypeui(CodeLabel datasourcetypeui) {
this.datasourcetypeui = datasourcetypeui;
}
public CodeLabel getOpenairecompatibility() {
return openairecompatibility;
}
public void setOpenairecompatibility(CodeLabel openairecompatibility) {
this.openairecompatibility = openairecompatibility;
}
public String getLegalname() {
return legalname;
}
public void setLegalname(String legalname) {
this.legalname = legalname;
}
public String getLegalshortname() {
return legalshortname;
}
public void setLegalshortname(String legalshortname) {
this.legalshortname = legalshortname;
}
public Country getCountry() {
return country;
}
public void setCountry(Country country) {
this.country = country;
}
public String getProjectTitle() {
return projectTitle;
}
public void setProjectTitle(String projectTitle) {
this.projectTitle = projectTitle;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getAcronym() {
return acronym;
}
public void setAcronym(String acronym) {
this.acronym = acronym;
}
public CodeLabel getContracttype() {
return contracttype;
}
public void setContracttype(CodeLabel contracttype) {
this.contracttype = contracttype;
}
public Funding getFunding() {
return funding;
}
public void setFunding(Funding funding) {
this.funding = funding;
}
}

View File

@ -0,0 +1,57 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class RelatedRecordHeader implements Serializable {
private static final long serialVersionUID = -1491635071695452382L;
private String relationType;
private String relationClass;
private String relatedIdentifier;
private RecordType relatedRecordType;
public static RelatedRecordHeader newInstance(String relationType, String relationClass, String relatedIdentifier, RecordType relatedRecordType) {
RelatedRecordHeader header = new RelatedRecordHeader();
header.setRelationType(relationType);
header.setRelationClass(relationClass);
header.setRelatedIdentifier(relatedIdentifier);
header.setRelatedRecordType(relatedRecordType);
return header;
}
public String getRelationType() {
return relationType;
}
public void setRelationType(String relationType) {
this.relationType = relationType;
}
public String getRelationClass() {
return relationClass;
}
public void setRelationClass(String relationClass) {
this.relationClass = relationClass;
}
public String getRelatedIdentifier() {
return relatedIdentifier;
}
public void setRelatedIdentifier(String relatedIdentifier) {
this.relatedIdentifier = relatedIdentifier;
}
public RecordType getRelatedRecordType() {
return relatedRecordType;
}
public void setRelatedRecordType(RecordType relatedRecordType) {
this.relatedRecordType = relatedRecordType;
}
}

View File

@ -0,0 +1,431 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
public class Result implements Serializable {
private static final long serialVersionUID = -9121038426985022737L;
/**
* Type of the result: one of 'publication', 'dataset', 'software', 'other' (see also https://api.openaire.eu/vocabularies/dnet:result_typologies)
*/
private String resulttype;
/**
* Authors of the result
*/
private List<Author> author;
/**
* The Subject.
*/
private List<Subject> subject;
/**
* The result language
*/
private Language language;
/**
* The list of countries associated to this result
*/
private List<Country> country;
/**
* A name or title by which a scientific result is known. May be the title of a publication, of a dataset or the name of a piece of software.
*/
private String maintitle;
/**
* Explanatory or alternative names by which a scientific result is known.
*/
private List<String> otherTitles;
private List<String> description;
/**
* Main date of the research product: typically the publication or issued date. In case of a research result with
* different versions with different dates, the date of the result is selected as the most frequent well-formatted date.
* If not available, then the most recent and complete date among those that are well-formatted.
* For statistics, the year is extracted and the result is counted only among the result of that year.
* Example:
* Pre-print date: 2019-02-03,
* Article date provided by repository: 2020-02,
* Article date provided by Crossref: 2020,
* OpenAIRE will set as date 2019-02-03, because its the most recent among the complete and well-formed dates.
* If then the repository updates the metadata and set a complete date (e.g. 2020-02-12), then this will be the new
* date for the result because it becomes the most recent most complete date.
* However, if OpenAIRE then collects the pre-print from another repository with date 2019-02-03, then this will be
* the winning date because it becomes the most frequent well-formatted date.
*/
private String publicationdate; // dateofacceptance
/**
* The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource.
*/
private String publisher;
/**
* Date when the embargo ends and this result turns Open Access
*/
private String embargoenddate;
/**
* See definition of Dublin Core field dc:source
*/
private List<String> source;
private List<String> format;
/**
* Contributors for the result
*/
private List<String> contributor;
private List<String> coverage;
/**
* The openest of the access rights of this result.
*/
private BestAccessRight bestaccessright;
/**
* The direct link to the full-text as collected from the data source
*/
private List<String> fulltext;
/**
* Journal has information about the conference or journal where the result has been presented or published
*/
private Journal journal;
/**
* Only for results with type 'software': URL to the software documentation
*/
private List<String> documentationUrl; // software
/**
* Only for results with type 'software': the URL to the repository with the source code
*/
private String codeRepositoryUrl; // software
/**
* Only for results with type 'software': the programming language
*/
private String programmingLanguage; // software
/**
* Only for results with type 'software': Information on the person responsible for providing further information regarding the resource
*/
private List<String> contactperson; // orp
/**
* Only for results with type 'software': Information on the group responsible for providing further information regarding the resource
*/
private List<String> contactgroup; // orp
/**
* Only for results with type 'other': tool useful for the interpretation and/or re-used of the research product
*/
private List<String> tool; // orp
/**
* Only for results with type 'dataset': the declared size of the dataset
*/
private String size; // dataset
/**
* Version of the result
*/
private String version; // dataset
/**
* EOSC Interoperability Framework Guidelines
*/
private List<EoscIfGuidelines> eoscifguidelines;
@JsonProperty("isGreen")
private Boolean isGreen;
private OpenAccessColor openAccessColor;
@JsonProperty("isInDiamondJournal")
private Boolean isInDiamondJournal;
private Boolean publiclyFunded;
private String transformativeAgreement;
/**
* Each instance is one specific materialisation or version of the result. For example, you can have one result with
* three instance: one is the pre-print, one is the post-print, one is te published version
*/
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 List<String> getOtherTitles() {
return otherTitles;
}
public void setOtherTitles(List<String> otherTitles) {
this.otherTitles = otherTitles;
}
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

@ -0,0 +1,122 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
public class SolrRecord implements Serializable {
private static final long serialVersionUID = 2852901817696335899L;
private SolrRecordHeader header;
private List<Provenance> collectedfrom;
/**
* List of persistent identifiers
*/
private List<Pid> pid;
private List<Context> context;
private List<Measure> measures;
private List<ExtraInfo> extraInfo;
private Result result;
private Datasource datasource;
private Project project;
private Organization organization;
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

@ -0,0 +1,64 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
public class SolrRecordHeader implements Serializable {
private static final long serialVersionUID = -6052397109220149426L;
/**
* The OpenAIRE identifiers for this record
*/
private String id;
/**
* Identifiers of the record at the original sources
*/
private List<String> originalId;
private RecordType recordType;
private Boolean deletedbyinference;
public static SolrRecordHeader newInstance(String id, List<String> originalId, RecordType recordType, Boolean deletedbyinference) {
SolrRecordHeader header = new SolrRecordHeader();
header.setId(id);
header.setOriginalId(originalId);
header.setRecordType(recordType);
header.setDeletedbyinference(deletedbyinference);
return header;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public List<String> getOriginalId() {
return originalId;
}
public void setOriginalId(List<String> originalId) {
this.originalId = originalId;
}
public RecordType getRecordType() {
return recordType;
}
public void setRecordType(RecordType recordType) {
this.recordType = recordType;
}
public Boolean getDeletedbyinference() {
return deletedbyinference;
}
public void setDeletedbyinference(Boolean deletedbyinference) {
this.deletedbyinference = deletedbyinference;
}
}

View File

@ -0,0 +1,35 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class Subject implements Serializable {
private static final long serialVersionUID = -7242293435544930481L;
private String value;
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;
}
public void setValue(String value) {
this.value = value;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}

View File

@ -0,0 +1,100 @@
package eu.dnetlib.dhp.schema.sx
import eu.dnetlib.dhp.schema.common.ModelConstants
import eu.dnetlib.dhp.schema.oaf.{AccessRight, DataInfo, Field, KeyValue, Qualifier, StructuredProperty}
object OafUtils {
def generateKeyValue(key: String, value: String): KeyValue = {
val kv: KeyValue = new KeyValue()
kv.setKey(key)
kv.setValue(value)
kv.setDataInfo(generateDataInfo("0.9"))
kv
}
def generateDataInfo(trust: String = "0.9", invisible: Boolean = false): DataInfo = {
val di = new DataInfo
di.setDeletedbyinference(false)
di.setInferred(false)
di.setInvisible(invisible)
di.setTrust(trust)
di.setProvenanceaction(createQualifier(ModelConstants.SYSIMPORT_ACTIONSET, ModelConstants.DNET_PROVENANCE_ACTIONS))
di
}
def createQualifier(cls: String, sch: String): Qualifier = {
createQualifier(cls, cls, sch, sch)
}
def createQualifier(classId: String, className: String, schemeId: String, schemeName: String): Qualifier = {
val q: Qualifier = new Qualifier
q.setClassid(classId)
q.setClassname(className)
q.setSchemeid(schemeId)
q.setSchemename(schemeName)
q
}
def createAccessRight(classId: String, className: String, schemeId: String, schemeName: String): AccessRight = {
val accessRight: AccessRight = new AccessRight
accessRight.setClassid(classId)
accessRight.setClassname(className)
accessRight.setSchemeid(schemeId)
accessRight.setSchemename(schemeName)
accessRight
}
def asField[T](value: T): Field[T] = {
val tmp = new Field[T]
tmp.setValue(value)
tmp
}
def createSP(value: String, classId: String,className:String, schemeId: String, schemeName:String): StructuredProperty = {
val sp = new StructuredProperty
sp.setQualifier(createQualifier(classId,className, schemeId, schemeName))
sp.setValue(value)
sp
}
def createSP(value: String, classId: String,className:String, schemeId: String, schemeName:String, dataInfo: DataInfo): StructuredProperty = {
val sp = new StructuredProperty
sp.setQualifier(createQualifier(classId,className, schemeId, schemeName))
sp.setValue(value)
sp.setDataInfo(dataInfo)
sp
}
def createSP(value: String, classId: String, schemeId: String): StructuredProperty = {
val sp = new StructuredProperty
sp.setQualifier(createQualifier(classId, schemeId))
sp.setValue(value)
sp
}
def createSP(value: String, classId: String, schemeId: String, dataInfo: DataInfo): StructuredProperty = {
val sp = new StructuredProperty
sp.setQualifier(createQualifier(classId, schemeId))
sp.setValue(value)
sp.setDataInfo(dataInfo)
sp
}
}

File diff suppressed because one or more lines are too long

View File

@ -10,6 +10,7 @@ import org.junit.jupiter.api.Test;
import com.fasterxml.jackson.databind.ObjectMapper;
import eu.dnetlib.dhp.schema.common.ModelConstants;
import eu.dnetlib.dhp.schema.oaf.Relation;
/** @author claudio.atzori */
@ -22,9 +23,9 @@ class AtomicActionTest {
Relation rel = new Relation();
rel.setSource("1");
rel.setTarget("2");
rel.setRelType(Relation.RELTYPE.resultResult);
rel.setSubRelType(Relation.SUBRELTYPE.dedup);
rel.setRelClass(Relation.RELCLASS.merges);
rel.setRelType(ModelConstants.RESULT_RESULT);
rel.setSubRelType(ModelConstants.DEDUP);
rel.setRelClass(ModelConstants.MERGES);
AtomicAction aa1 = new AtomicAction(Relation.class, rel);

View File

@ -0,0 +1,53 @@
package eu.dnetlib.dhp.schema.common;
import static org.junit.jupiter.api.Assertions.*;
import java.io.IOException;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import eu.dnetlib.dhp.schema.oaf.OafEntity;
import eu.dnetlib.dhp.schema.oaf.Relation;
import eu.dnetlib.dhp.schema.oaf.Result;
public class ModelSupportTest {
@Nested
class IsSubClass {
@Test
void shouldReturnFalseWhenSubClassDoesNotExtendSuperClass() {
// when
Boolean result = ModelSupport.isSubClass(Relation.class, OafEntity.class);
// then
assertFalse(result);
}
@Test
void shouldReturnTrueWhenSubClassExtendsSuperClass() {
// when
Boolean result = ModelSupport.isSubClass(Result.class, OafEntity.class);
// then
assertTrue(result);
}
}
@Nested
class InverseRelation {
@Test
void findRelations() throws IOException {
assertNotNull(ModelSupport.findRelation("isMetadataFor"));
assertNotNull(ModelSupport.findRelation("ismetadatafor"));
assertNotNull(ModelSupport.findRelation("ISMETADATAFOR"));
assertNotNull(ModelSupport.findRelation("isRelatedTo"));
}
}
}

View File

@ -39,6 +39,7 @@ class MeasureTest {
List<Measure> m = Lists.newArrayList(popularity, influence);
String s = OBJECT_MAPPER.writeValueAsString(m);
System.out.println(s);
List<Measure> mm = OBJECT_MAPPER.readValue(s, new TypeReference<List<Measure>>() {
});
@ -46,8 +47,8 @@ class MeasureTest {
Assertions.assertNotNull(mm);
}
private MeasureUnit unit(String key, String value) {
MeasureUnit unit = new MeasureUnit();
private KeyValue unit(String key, String value) {
KeyValue unit = new KeyValue();
unit.setKey(key);
unit.setValue(value);
return unit;

View File

@ -1,34 +0,0 @@
package eu.dnetlib.dhp.schema.oaf;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class RelationTest {
@Test
public void checkExistRelType() {
assertTrue(Relation.SUBRELTYPE.exists(Relation.SUBRELTYPE.dedup.toString()));
assertFalse(Relation.SUBRELTYPE.exists("foo"));
}
@Test
public void checkSubRelType() {
Relation.RELCLASS rc = Relation.RELCLASS.merges;
assertEquals(Relation.SUBRELTYPE.dedup, rc.getSubRel());
for (Relation.RELCLASS value : Relation.RELCLASS.values()) {
System.out.printf("%s => %s\n", value, value.getSubRel());
}
}
@Test
public void lookRelClassUpTest() {
Assertions.assertEquals(Relation.RELCLASS.Compiles, Relation.RELCLASS.lookUp("compiles"));
Assertions.assertEquals(Relation.RELCLASS.IsMetadataFor, Relation.RELCLASS.lookUp("isMetaDATAFOr"));
Assertions.assertThrows(IllegalArgumentException.class, () -> Relation.RELCLASS.lookUp("hello"));
}
}