forked from D-Net/dnet-hadoop
100 changed files with 6 additions and 7817 deletions
@ -1,11 +0,0 @@
|
||||
Description of the project |
||||
-------------------------- |
||||
This project defines **object schemas** of the OpenAIRE main entities and the relationships that intercur among them. |
||||
Namely it defines the model for |
||||
|
||||
- **research product (result)** which subclasses in publication, dataset, other research product, software |
||||
- **data source** object describing the data provider (institutional repository, aggregators, cris systems) |
||||
- **organization** research bodies managing a data source or participating to a research project |
||||
- **project** research project |
||||
|
||||
Te serialization of such objects (data store files) are used to pass data between workflow nodes in the processing pipeline. |
@ -1,73 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<parent> |
||||
<groupId>eu.dnetlib.dhp</groupId> |
||||
<artifactId>dhp</artifactId> |
||||
<version>1.2.4-SNAPSHOT</version> |
||||
<relativePath>../pom.xml</relativePath> |
||||
</parent> |
||||
|
||||
<artifactId>dhp-schemas</artifactId> |
||||
<packaging>jar</packaging> |
||||
|
||||
<description>This module contains common schema classes meant to be used across the dnet-hadoop submodules</description> |
||||
|
||||
<build> |
||||
<plugins> |
||||
<plugin> |
||||
<groupId>net.alchim31.maven</groupId> |
||||
<artifactId>scala-maven-plugin</artifactId> |
||||
<version>4.0.1</version> |
||||
<executions> |
||||
<execution> |
||||
<id>scala-compile-first</id> |
||||
<phase>initialize</phase> |
||||
<goals> |
||||
<goal>add-source</goal> |
||||
<goal>compile</goal> |
||||
</goals> |
||||
</execution> |
||||
<execution> |
||||
<id>scala-test-compile</id> |
||||
<phase>process-test-resources</phase> |
||||
<goals> |
||||
<goal>testCompile</goal> |
||||
</goals> |
||||
</execution> |
||||
</executions> |
||||
<configuration> |
||||
<scalaVersion>${scala.version}</scalaVersion> |
||||
</configuration> |
||||
</plugin> |
||||
|
||||
</plugins> |
||||
</build> |
||||
|
||||
<dependencies> |
||||
|
||||
<dependency> |
||||
<groupId>commons-io</groupId> |
||||
<artifactId>commons-io</artifactId> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>org.apache.commons</groupId> |
||||
<artifactId>commons-lang3</artifactId> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>com.fasterxml.jackson.core</groupId> |
||||
<artifactId>jackson-databind</artifactId> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>com.google.guava</groupId> |
||||
<artifactId>guava</artifactId> |
||||
</dependency> |
||||
|
||||
</dependencies> |
||||
|
||||
|
||||
</project> |
@ -1,40 +0,0 @@
|
||||
|
||||
package eu.dnetlib.dhp.schema.action; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; |
||||
|
||||
import eu.dnetlib.dhp.schema.oaf.Oaf; |
||||
|
||||
@JsonDeserialize(using = AtomicActionDeserializer.class) |
||||
public class AtomicAction<T extends Oaf> implements Serializable { |
||||
|
||||
private Class<T> clazz; |
||||
|
||||
private T payload; |
||||
|
||||
public AtomicAction() { |
||||
} |
||||
|
||||
public AtomicAction(Class<T> clazz, T payload) { |
||||
this.clazz = clazz; |
||||
this.payload = payload; |
||||
} |
||||
|
||||
public Class<T> getClazz() { |
||||
return clazz; |
||||
} |
||||
|
||||
public void setClazz(Class<T> clazz) { |
||||
this.clazz = clazz; |
||||
} |
||||
|
||||
public T getPayload() { |
||||
return payload; |
||||
} |
||||
|
||||
public void setPayload(T payload) { |
||||
this.payload = payload; |
||||
} |
||||
} |
@ -1,32 +0,0 @@
|
||||
|
||||
package eu.dnetlib.dhp.schema.action; |
||||
|
||||
import java.io.IOException; |
||||
|
||||
import com.fasterxml.jackson.core.JsonParser; |
||||
import com.fasterxml.jackson.core.JsonProcessingException; |
||||
import com.fasterxml.jackson.databind.DeserializationContext; |
||||
import com.fasterxml.jackson.databind.JsonDeserializer; |
||||
import com.fasterxml.jackson.databind.JsonNode; |
||||
import com.fasterxml.jackson.databind.ObjectMapper; |
||||
|
||||
import eu.dnetlib.dhp.schema.oaf.Oaf; |
||||
|
||||
public class AtomicActionDeserializer extends JsonDeserializer { |
||||
|
||||
@Override |
||||
public Object deserialize(JsonParser jp, DeserializationContext ctxt) |
||||
throws IOException { |
||||
JsonNode node = jp.getCodec().readTree(jp); |
||||
String classTag = node.get("clazz").asText(); |
||||
JsonNode payload = node.get("payload"); |
||||
ObjectMapper mapper = new ObjectMapper(); |
||||
|
||||
try { |
||||
final Class<?> clazz = Class.forName(classTag); |
||||
return new AtomicAction(clazz, (Oaf) mapper.readValue(payload.toString(), clazz)); |
||||
} catch (ClassNotFoundException e) { |
||||
throw new IOException(e); |
||||
} |
||||
} |
||||
} |
@ -1,21 +0,0 @@
|
||||
|
||||
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()); |
||||
} |
||||
} |
@ -1,69 +0,0 @@
|
||||
|
||||
package eu.dnetlib.dhp.schema.common; |
||||
|
||||
import java.util.Comparator; |
||||
|
||||
import eu.dnetlib.dhp.schema.oaf.Qualifier; |
||||
|
||||
public class LicenseComparator 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("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); |
||||
} |
||||
} |
@ -1,7 +0,0 @@
|
||||
|
||||
package eu.dnetlib.dhp.schema.common; |
||||
|
||||
/** Main entity types in the Graph */ |
||||
public enum MainEntityType { |
||||
result, datasource, organization, project |
||||
} |
@ -1,130 +0,0 @@
|
||||
|
||||
package eu.dnetlib.dhp.schema.common; |
||||
|
||||
import eu.dnetlib.dhp.schema.oaf.DataInfo; |
||||
import eu.dnetlib.dhp.schema.oaf.KeyValue; |
||||
import eu.dnetlib.dhp.schema.oaf.Qualifier; |
||||
|
||||
public class 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 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_DATA_CITE_DATE = "dnet:dataCite_date"; |
||||
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 SYSIMPORT_CROSSWALK_REPOSITORY = "sysimport:crosswalk:repository"; |
||||
public static final String SYSIMPORT_CROSSWALK_ENTITYREGISTRY = "sysimport:crosswalk:entityregistry"; |
||||
public static final String USER_CLAIM = "user:claim"; |
||||
|
||||
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"; |
||||
/** |
||||
* @deprecated Use {@link ModelConstants#RELATIONSHIP} instead. |
||||
*/ |
||||
@Deprecated |
||||
public static final String PUBLICATION_DATASET = "publicationDataset"; |
||||
public static final String IS_RELATED_TO = "isRelatedTo"; |
||||
public static final String SUPPLEMENT = "supplement"; |
||||
public static final String IS_SUPPLEMENT_TO = "isSupplementTo"; |
||||
public static final String IS_SUPPLEMENTED_BY = "isSupplementedBy"; |
||||
public static final String PART = "part"; |
||||
public static final String IS_PART_OF = "isPartOf"; |
||||
public static final String HAS_PARTS = "hasParts"; |
||||
public static final String RELATIONSHIP = "relationship"; |
||||
public static final String CITATION = "citation"; |
||||
public static final String CITES = "cites"; |
||||
public static final String IS_CITED_BY = "isCitedBy"; |
||||
public static final String REVIEW = "review"; |
||||
public static final String REVIEWS = "reviews"; |
||||
public static final String IS_REVIEWED_BY = "isReviewedBy"; |
||||
|
||||
public static final String RESULT_PROJECT = "resultProject"; |
||||
public static final String OUTCOME = "outcome"; |
||||
public static final String IS_PRODUCED_BY = "isProducedBy"; |
||||
public static final String PRODUCES = "produces"; |
||||
|
||||
public static final String DATASOURCE_ORGANIZATION = "datasourceOrganization"; |
||||
public static final String PROVISION = "provision"; |
||||
public static final String IS_PROVIDED_BY = "isProvidedBy"; |
||||
public static final String PROVIDES = "provides"; |
||||
|
||||
public static final String PROJECT_ORGANIZATION = "projectOrganization"; |
||||
public static final String PARTICIPATION = "participation"; |
||||
public static final String HAS_PARTICIPANT = "hasParticipant"; |
||||
public static final String IS_PARTICIPANT = "isParticipant"; |
||||
|
||||
public static final String RESULT_ORGANIZATION = "resultOrganization"; |
||||
public static final String AFFILIATION = "affiliation"; |
||||
public static final String IS_AUTHOR_INSTITUTION_OF = "isAuthorInstitutionOf"; |
||||
public static final String HAS_AUTHOR_INSTITUTION = "hasAuthorInstitution"; |
||||
|
||||
public static final String MERGES = "merges"; |
||||
|
||||
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 KeyValue UNKNOWN_REPOSITORY = keyValue( |
||||
"10|openaire____::55045bd2a65019fd8e6741a755395c8c", "Unknown Repository"); |
||||
|
||||
public static final Qualifier UNKNOWN_COUNTRY = qualifier(UNKNOWN, "Unknown", DNET_COUNTRY_TYPE, DNET_COUNTRY_TYPE); |
||||
|
||||
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(String key, String value) { |
||||
KeyValue kv = new KeyValue(); |
||||
kv.setKey(key); |
||||
kv.setValue(value); |
||||
kv.setDataInfo(new DataInfo()); |
||||
return kv; |
||||
} |
||||
} |
@ -1,501 +0,0 @@
|
||||
|
||||
package eu.dnetlib.dhp.schema.common; |
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument; |
||||
|
||||
import java.text.ParseException; |
||||
import java.text.SimpleDateFormat; |
||||
import java.time.Instant; |
||||
import java.time.format.DateTimeFormatter; |
||||
import java.time.temporal.TemporalAccessor; |
||||
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.lang3.StringUtils; |
||||
|
||||
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 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 { |
||||
relationInverseMap |
||||
.put( |
||||
"personResult_authorship_isAuthorOf", new RelationInverse() |
||||
.setRelation("isAuthorOf") |
||||
.setInverse("hasAuthor") |
||||
.setRelType("personResult") |
||||
.setSubReltype("authorship")); |
||||
relationInverseMap |
||||
.put( |
||||
"personResult_authorship_hasAuthor", new RelationInverse() |
||||
.setInverse("isAuthorOf") |
||||
.setRelation("hasAuthor") |
||||
.setRelType("personResult") |
||||
.setSubReltype("authorship")); |
||||
relationInverseMap |
||||
.put( |
||||
"projectOrganization_participation_isParticipant", new RelationInverse() |
||||
.setRelation("isParticipant") |
||||
.setInverse("hasParticipant") |
||||
.setRelType("projectOrganization") |
||||
.setSubReltype("participation")); |
||||
relationInverseMap |
||||
.put( |
||||
"projectOrganization_participation_hasParticipant", new RelationInverse() |
||||
.setInverse("isParticipant") |
||||
.setRelation("hasParticipant") |
||||
.setRelType("projectOrganization") |
||||
.setSubReltype("participation")); |
||||
relationInverseMap |
||||
.put( |
||||
"resultOrganization_affiliation_hasAuthorInstitution", new RelationInverse() |
||||
.setRelation("hasAuthorInstitution") |
||||
.setInverse("isAuthorInstitutionOf") |
||||
.setRelType("resultOrganization") |
||||
.setSubReltype("affiliation")); |
||||
relationInverseMap |
||||
.put( |
||||
"resultOrganization_affiliation_isAuthorInstitutionOf", new RelationInverse() |
||||
.setInverse("hasAuthorInstitution") |
||||
.setRelation("isAuthorInstitutionOf") |
||||
.setRelType("resultOrganization") |
||||
.setSubReltype("affiliation")); |
||||
relationInverseMap |
||||
.put( |
||||
"organizationOrganization_dedup_merges", new RelationInverse() |
||||
.setRelation("merges") |
||||
.setInverse("isMergedIn") |
||||
.setRelType("organizationOrganization") |
||||
.setSubReltype("dedup")); |
||||
relationInverseMap |
||||
.put( |
||||
"organizationOrganization_dedup_isMergedIn", new RelationInverse() |
||||
.setInverse("merges") |
||||
.setRelation("isMergedIn") |
||||
.setRelType("organizationOrganization") |
||||
.setSubReltype("dedup")); |
||||
relationInverseMap |
||||
.put( |
||||
"organizationOrganization_dedupSimilarity_isSimilarTo", new RelationInverse() |
||||
.setInverse("isSimilarTo") |
||||
.setRelation("isSimilarTo") |
||||
.setRelType("organizationOrganization") |
||||
.setSubReltype("dedupSimilarity")); |
||||
|
||||
relationInverseMap |
||||
.put( |
||||
"resultProject_outcome_isProducedBy", new RelationInverse() |
||||
.setRelation("isProducedBy") |
||||
.setInverse("produces") |
||||
.setRelType("resultProject") |
||||
.setSubReltype("outcome")); |
||||
relationInverseMap |
||||
.put( |
||||
"resultProject_outcome_produces", new RelationInverse() |
||||
.setInverse("isProducedBy") |
||||
.setRelation("produces") |
||||
.setRelType("resultProject") |
||||
.setSubReltype("outcome")); |
||||
relationInverseMap |
||||
.put( |
||||
"projectPerson_contactPerson_isContact", new RelationInverse() |
||||
.setRelation("isContact") |
||||
.setInverse("hasContact") |
||||
.setRelType("projectPerson") |
||||
.setSubReltype("contactPerson")); |
||||
relationInverseMap |
||||
.put( |
||||
"projectPerson_contactPerson_hasContact", new RelationInverse() |
||||
.setInverse("isContact") |
||||
.setRelation("hasContact") |
||||
.setRelType("personPerson") |
||||
.setSubReltype("coAuthorship")); |
||||
relationInverseMap |
||||
.put( |
||||
"personPerson_coAuthorship_isCoauthorOf", new RelationInverse() |
||||
.setInverse("isCoAuthorOf") |
||||
.setRelation("isCoAuthorOf") |
||||
.setRelType("personPerson") |
||||
.setSubReltype("coAuthorship")); |
||||
relationInverseMap |
||||
.put( |
||||
"personPerson_dedup_merges", new RelationInverse() |
||||
.setInverse("isMergedIn") |
||||
.setRelation("merges") |
||||
.setRelType("personPerson") |
||||
.setSubReltype("dedup")); |
||||
relationInverseMap |
||||
.put( |
||||
"personPerson_dedup_isMergedIn", new RelationInverse() |
||||
.setInverse("merges") |
||||
.setRelation("isMergedIn") |
||||
.setRelType("personPerson") |
||||
.setSubReltype("dedup")); |
||||
relationInverseMap |
||||
.put( |
||||
"personPerson_dedupSimilarity_isSimilarTo", new RelationInverse() |
||||
.setInverse("isSimilarTo") |
||||
.setRelation("isSimilarTo") |
||||
.setRelType("personPerson") |
||||
.setSubReltype("dedupSimilarity")); |
||||
relationInverseMap |
||||
.put( |
||||
"datasourceOrganization_provision_isProvidedBy", new RelationInverse() |
||||
.setInverse("provides") |
||||
.setRelation("isProvidedBy") |
||||
.setRelType("datasourceOrganization") |
||||
.setSubReltype("provision")); |
||||
relationInverseMap |
||||
.put( |
||||
"datasourceOrganization_provision_provides", new RelationInverse() |
||||
.setInverse("isProvidedBy") |
||||
.setRelation("provides") |
||||
.setRelType("datasourceOrganization") |
||||
.setSubReltype("provision")); |
||||
relationInverseMap |
||||
.put( |
||||
"resultResult_similarity_hasAmongTopNSimilarDocuments", new RelationInverse() |
||||
.setInverse("isAmongTopNSimilarDocuments") |
||||
.setRelation("hasAmongTopNSimilarDocuments") |
||||
.setRelType("resultResult") |
||||
.setSubReltype("similarity")); |
||||
relationInverseMap |
||||
.put( |
||||
"resultResult_similarity_isAmongTopNSimilarDocuments", new RelationInverse() |
||||
.setInverse("hasAmongTopNSimilarDocuments") |
||||
.setRelation("isAmongTopNSimilarDocuments") |
||||
.setRelType("resultResult") |
||||
.setSubReltype("similarity")); |
||||
relationInverseMap |
||||
.put( |
||||
"resultResult_relationship_isRelatedTo", new RelationInverse() |
||||
.setInverse("isRelatedTo") |
||||
.setRelation("isRelatedTo") |
||||
.setRelType("resultResult") |
||||
.setSubReltype("relationship")); |
||||
relationInverseMap |
||||
.put( |
||||
"resultResult_similarity_isAmongTopNSimilarDocuments", new RelationInverse() |
||||
.setInverse("hasAmongTopNSimilarDocuments") |
||||
.setRelation("isAmongTopNSimilarDocuments") |
||||
.setRelType("resultResult") |
||||
.setSubReltype("similarity")); |
||||
relationInverseMap |
||||
.put( |
||||
"resultResult_supplement_isSupplementTo", new RelationInverse() |
||||
.setInverse("isSupplementedBy") |
||||
.setRelation("isSupplementTo") |
||||
.setRelType("resultResult") |
||||
.setSubReltype("supplement")); |
||||
relationInverseMap |
||||
.put( |
||||
"resultResult_supplement_isSupplementedBy", new RelationInverse() |
||||
.setInverse("isSupplementTo") |
||||
.setRelation("isSupplementedBy") |
||||
.setRelType("resultResult") |
||||
.setSubReltype("supplement")); |
||||
relationInverseMap |
||||
.put( |
||||
"resultResult_part_isPartOf", new RelationInverse() |
||||
.setInverse("hasPart") |
||||
.setRelation("isPartOf") |
||||
.setRelType("resultResult") |
||||
.setSubReltype("part")); |
||||
relationInverseMap |
||||
.put( |
||||
"resultResult_part_hasPart", new RelationInverse() |
||||
.setInverse("isPartOf") |
||||
.setRelation("hasPart") |
||||
.setRelType("resultResult") |
||||
.setSubReltype("part")); |
||||
relationInverseMap |
||||
.put( |
||||
"resultResult_dedup_merges", new RelationInverse() |
||||
.setInverse("isMergedIn") |
||||
.setRelation("merges") |
||||
.setRelType("resultResult") |
||||
.setSubReltype("dedup")); |
||||
relationInverseMap |
||||
.put( |
||||
"resultResult_dedup_isMergedIn", new RelationInverse() |
||||
.setInverse("merges") |
||||
.setRelation("isMergedIn") |
||||
.setRelType("resultResult") |
||||
.setSubReltype("dedup")); |
||||
relationInverseMap |
||||
.put( |
||||
"resultResult_dedupSimilarity_isSimilarTo", new RelationInverse() |
||||
.setInverse("isSimilarTo") |
||||
.setRelation("isSimilarTo") |
||||
.setRelType("resultResult") |
||||
.setSubReltype("dedupSimilarity")); |
||||
|
||||
} |
||||
|
||||
private static final String schemeTemplate = "dnet:%s_%s_relations"; |
||||
|
||||
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, |
||||
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 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 = Date.from(Instant.from(DateTimeFormatter.ISO_INSTANT.parse(dateA))); |
||||
final Date b = Date.from(Instant.from(DateTimeFormatter.ISO_INSTANT.parse(dateB))); |
||||
|
||||
return a.before(b) ? dateA : dateB; |
||||
} else { |
||||
return null; |
||||
} |
||||
} |
||||
} |
@ -1,46 +0,0 @@
|
||||
|
||||
package eu.dnetlib.dhp.schema.common; |
||||
|
||||
public class RelationInverse { |
||||
private String relation; |
||||
private String inverse; |
||||
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 getRelation() { |
||||
return relation; |
||||
} |
||||
|
||||
public RelationInverse setRelation(String relation) { |
||||
this.relation = relation; |
||||
return this; |
||||
} |
||||
|
||||
public String getInverse() { |
||||
return inverse; |
||||
} |
||||
|
||||
public RelationInverse setInverse(String inverse) { |
||||
this.inverse = inverse; |
||||
return this; |
||||
} |
||||
|
||||
} |
@ -1,29 +0,0 @@
|
||||
|
||||
package eu.dnetlib.dhp.schema.dump.oaf; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* Used to refer to the Article Processing Charge information. Not dumped in this release. 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 String currency; |
||||
private String amount; |
||||
|
||||
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; |
||||
} |
||||
} |
@ -1,31 +0,0 @@
|
||||
|
||||
package eu.dnetlib.dhp.schema.dump.oaf; |
||||
|
||||
/** |
||||
* AccessRight. Used to represent the result access rights. It extends the eu.dnet.lib.dhp.schema.dump.oaf.Qualifier |
||||
* element with a parameter scheme of type String to store the scheme. Values for this element are found against the |
||||
* COAR access right scheme. The classid of the element accessright in eu.dnetlib.dhp.schema.oaf.Result is used to get |
||||
* the COAR corresponding code whose value will be used to set the code parameter. The COAR label corresponding to the |
||||
* COAR code will be used to set the label parameter. The scheme value will always be the one referring to the COAR |
||||
* access right scheme |
||||
*/ |
||||
public class AccessRight extends Qualifier { |
||||
|
||||
private String scheme; |
||||
|
||||
public String getScheme() { |
||||
return scheme; |
||||
} |
||||
|
||||
public void setScheme(String scheme) { |
||||
this.scheme = scheme; |
||||
} |
||||
|
||||
public static AccessRight newInstance(String code, String label, String scheme) { |
||||
AccessRight ar = new AccessRight(); |
||||
ar.setCode(code); |
||||
ar.setLabel(label); |
||||
ar.setScheme(scheme); |
||||
return ar; |
||||
} |
||||
} |
@ -1,73 +0,0 @@
|
||||
|
||||
package eu.dnetlib.dhp.schema.dump.oaf; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* Used to represent the generic author of the result. It has six parameters: - name of type String to store the given |
||||
* name of the author. The value for this parameter corresponds to eu.dnetlib.dhp.schema.oaf.Author name - surname of |
||||
* type String to store the family name of the author. The value for this parameter corresponds to |
||||
* eu.dnetlib.dhp.schema.oaf.Author surname - fullname of type String to store the fullname of the author. The value for |
||||
* this parameter corresponds to eu.dnetlib.dhp.schema.oaf.Author fullname - rank of type Integer to store the rank on |
||||
* the author in the result's authors list. The value for this parameter corresponds to eu.dnetlib.dhp.schema.oaf.Author |
||||
* rank - pid of type eu.dnetlib.dhp.schema.dump.oaf.Pid to store the persistent identifier for the author. For the |
||||
* moment only ORCID identifiers will be dumped. - The id element is instantiated by using the following values in the |
||||
* eu.dnetlib.dhp.schema.oaf.Result pid: * Qualifier.classid for scheme * value for value - The provenance element is |
||||
* instantiated only if the dataInfo is set for the pid in the result to be dumped. The provenance element is |
||||
* instantiated by using the following values in the eu.dnetlib.dhp.schema.oaf.Result pid: * |
||||
* dataInfo.provenanceaction.classname for provenance * dataInfo.trust for trust |
||||
*/ |
||||
public class Author implements Serializable { |
||||
|
||||
private String fullname; |
||||
|
||||
private String name; |
||||
|
||||
private String surname; |
||||
|
||||
private Integer rank; |
||||
|
||||
private Pid pid; |
||||
|
||||
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 Pid getPid() { |
||||
return pid; |
||||
} |
||||
|
||||
public void setPid(Pid pid) { |
||||
this.pid = pid; |
||||
} |
||||
|
||||
} |
@ -1,136 +0,0 @@
|
||||
|
||||
package eu.dnetlib.dhp.schema.dump.oaf; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* To store information about the conference or journal where the result has been presented or published. It contains |
||||
* eleven parameters: - name of type String to store the name of the journal or conference. It corresponds to the |
||||
* parameter name of eu.dnetlib.dhp.schema.oaf.Journal - issnPrinted ot type String to store the journal printed issn. |
||||
* It corresponds to the parameter issnPrinted of eu.dnetlib.dhp.schema.oaf.Journal - issnOnline of type String to store |
||||
* the journal online issn. It corresponds to the parameter issnOnline of eu.dnetlib.dhp.schema.oaf.Journal - |
||||
* issnLinking of type String to store the journal linking issn. It corresponds to the parameter issnLinking of |
||||
* eu.dnetlib.dhp.schema.oaf.Journal - ep of type String to store the end page. It corresponds to the parameter ep of |
||||
* eu.dnetlib.dhp.schema.oaf.Journal - iss of type String to store the journal issue. It corresponds to the parameter |
||||
* iss of eu.dnetlib.dhp.schema.oaf.Journal - sp of type String to store the start page. It corresponds to the parameter |
||||
* sp of eu.dnetlib.dhp.schema.oaf.Journal - vol of type String to store the Volume. It corresponds to the parameter vol |
||||
* of eu.dnetlib.dhp.schema.oaf.Journal - edition of type String to store the edition of the journal or conference |
||||
* proceeding. It corresponds to the parameter edition of eu.dnetlib.dhp.schema.oaf.Journal - conferenceplace of type |
||||
* String to store the place of the conference. It corresponds to the parameter conferenceplace of |
||||
* eu.dnetlib.dhp.schema.oaf.Journal - conferencedate of type String to store the date of the conference. It corresponds |
||||
* to the parameter conferencedate of eu.dnetlib.dhp.schema.oaf.Journal |
||||
*/ |
||||
public class Container implements Serializable { |
||||
|
||||
private String name; |
||||
|
||||
private String issnPrinted; |
||||
|
||||
private String issnOnline; |
||||
|
||||
private String issnLinking; |
||||
|
||||
private String ep; |
||||
|
||||
private String iss; |
||||
|
||||
private String sp; |
||||
|
||||
private String vol; |
||||
|
||||
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 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 getSp() { |
||||
return sp; |
||||
} |
||||
|
||||
public void setSp(String sp) { |
||||
this.sp = sp; |
||||
} |
||||
|
||||
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; |
||||
} |
||||
|
||||
} |
@ -1,38 +0,0 @@
|
||||
|
||||
package eu.dnetlib.dhp.schema.dump.oaf; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* To represent the information described by a scheme and a value in that scheme (i.e. pid). It has two parameters: - |
||||
* scheme of type String to store the scheme - value of type String to store the value in that scheme |
||||
*/ |
||||
public class ControlledField implements Serializable { |
||||
private String scheme; |
||||
private String value; |
||||
|
||||
public String getScheme() { |
||||
return scheme; |
||||
} |
||||
|
||||
public void setScheme(String scheme) { |
||||
this.scheme = scheme; |
||||
} |
||||
|
||||
public String getValue() { |
||||
return value; |
||||
} |
||||
|
||||
public void setValue(String value) { |
||||
this.value = value; |
||||
} |
||||
|
||||
public static ControlledField newInstance(String scheme, String value) { |
||||
ControlledField cf = new ControlledField(); |
||||
|
||||
cf.setScheme(scheme); |
||||
cf.setValue(value); |
||||
|
||||
return cf; |
||||
} |
||||
} |
@ -1,37 +0,0 @@
|
||||
|
||||
package eu.dnetlib.dhp.schema.dump.oaf; |
||||
|
||||
/** |
||||
* Represents the country associated to this result. It extends eu.dnetlib.dhp.schema.dump.oaf.Qualifier with a |
||||
* provenance parameter of type eu.dnetlib.dhp.schema.dumo.oaf.Provenance. The country in not mapped if its value in the |
||||
* result reprensented in the internal format is Unknown. 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 extends Qualifier { |
||||
|
||||
private Provenance provenance; |
||||
|
||||
public Provenance getProvenance() { |
||||
return provenance; |
||||
} |
||||
|
||||
public void setProvenance(Provenance provenance) { |
||||
this.provenance = provenance; |
||||
} |
||||
|
||||
public static Country newInstance(String code, String label, Provenance provenance) { |
||||
Country c = new Country(); |
||||
c.setProvenance(provenance); |
||||
c.setCode(code); |
||||
c.setLabel(label); |
||||
return c; |
||||
} |
||||
|
||||
public static Country newInstance(String code, String label, String provenance, String trust) { |
||||
return newInstance(code, label, Provenance.newInstance(provenance, trust)); |
||||
} |
||||
|
||||
} |
@ -1,36 +0,0 @@
|
||||
|
||||
package eu.dnetlib.dhp.schema.dump.oaf; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
public class Funder implements Serializable { |
||||
private String shortName; |
||||
|
||||
private String name; |
||||
|
||||
private String jurisdiction; |
||||
|
||||
public String getJurisdiction() { |
||||
return jurisdiction; |
||||
} |
||||
|
||||
public void setJurisdiction(String jurisdiction) { |
||||
this.jurisdiction = jurisdiction; |
||||
} |
||||
|
||||
public String getShortName() { |
||||
return shortName; |
||||