This commit is contained in:
Claudio Atzori 2019-11-14 15:43:07 +01:00
commit 6a7bee5e43
8 changed files with 295 additions and 1 deletions

View File

@ -21,6 +21,17 @@
<artifactId>commons-io</artifactId> <artifactId>commons-io</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>dhp-common</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies> </dependencies>

View File

@ -0,0 +1,118 @@
package eu.dnetlib.dhp.schema.dli;
import java.io.Serializable;
import java.util.List;
public class Entity implements Serializable {
private String identifier;
private List<Pid> pid;
private List<String> title;
private List<String> date;
private String typology;
private List<String> authors;
private List<Subject> subject;
private String description;
private String completionStatus;
private List<Provenance> collectedFrom;
private List<String> publisher;
public String getIdentifier() {
return identifier;
}
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
public List<Pid> getPid() {
return pid;
}
public void setPid(List<Pid> pid) {
this.pid = pid;
}
public List<String> getTitle() {
return title;
}
public void setTitle(List<String> title) {
this.title = title;
}
public List<String> getDate() {
return date;
}
public void setDate(List<String> date) {
this.date = date;
}
public String getTypology() {
return typology;
}
public void setTypology(String typology) {
this.typology = typology;
}
public List<String> getAuthors() {
return authors;
}
public void setAuthors(List<String> authors) {
this.authors = authors;
}
public List<Subject> getSubject() {
return subject;
}
public void setSubject(List<Subject> subject) {
this.subject = subject;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public List<Provenance> getCollectedFrom() {
return collectedFrom;
}
public void setCollectedFrom(List<Provenance> collectedFrom) {
this.collectedFrom = collectedFrom;
}
public List<String> getPublisher() {
return publisher;
}
public void setPublisher(List<String> publisher) {
this.publisher = publisher;
}
public String getCompletionStatus() {
return completionStatus;
}
public void setCompletionStatus(String completionStatus) {
this.completionStatus = completionStatus;
}
}

View File

@ -0,0 +1,33 @@
package eu.dnetlib.dhp.schema.dli;
import eu.dnetlib.dhp.utils.DHPUtils;
import org.apache.commons.lang3.StringUtils;
public class Pid {
private String pid;
private String pidType;
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
public String getPidType() {
return pidType;
}
public void setPidType(String pidType) {
this.pidType = pidType;
}
public String generateId() {
if(StringUtils.isEmpty(pid) || StringUtils.isEmpty(pidType))
return null;
return DHPUtils.md5(String.format("%s::%s", pid, pidType));
}
}

View File

@ -0,0 +1,35 @@
package eu.dnetlib.dhp.schema.dli;
public class Provenance {
private String datasourceId;
private String datasourceName;
private String completionStatus;
public String getDatasourceId() {
return datasourceId;
}
public void setDatasourceId(String datasourceId) {
this.datasourceId = datasourceId;
}
public String getDatasourceName() {
return datasourceName;
}
public void setDatasourceName(String datasourceName) {
this.datasourceName = datasourceName;
}
public String getCompletionStatus() {
return completionStatus;
}
public void setCompletionStatus(String completionStatus) {
this.completionStatus = completionStatus;
}
}

View File

@ -0,0 +1,47 @@
package eu.dnetlib.dhp.schema.dli;
import java.io.Serializable;
import java.util.List;
public class Relation implements Serializable {
private String source;
private String target;
private List<Provenance> provenance;
private RelationSemantic semantic;
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getTarget() {
return target;
}
public void setTarget(String target) {
this.target = target;
}
public List<Provenance> getProvenance() {
return provenance;
}
public void setProvenance(List<Provenance> provenance) {
this.provenance = provenance;
}
public RelationSemantic getSemantic() {
return semantic;
}
public void setSemantic(RelationSemantic semantic) {
this.semantic = semantic;
}
}

View File

@ -0,0 +1,16 @@
package eu.dnetlib.dhp.schema.dli;
import java.io.Serializable;
public class RelationSemantic extends Subject implements Serializable {
public String inverse;
public String getInverse() {
return inverse;
}
public void setInverse(String inverse) {
this.inverse = inverse;
}
}

View File

@ -0,0 +1,35 @@
package eu.dnetlib.dhp.schema.dli;
import java.io.Serializable;
public class Subject implements Serializable {
private String schema;
private String value;
public Subject() {
}
public Subject(String schema, String value) {
this.schema = schema;
this.value = value;
}
public String getSchema() {
return schema;
}
public void setSchema(String schema) {
this.schema = schema;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

View File

@ -35,5 +35,4 @@ public class SparkGraphImporterJobTest {
//Assert.assertEquals(String.format("mapped %s must be %s", t._1(), MAX), MAX, t._2().longValue()); //Assert.assertEquals(String.format("mapped %s must be %s", t._1(), MAX), MAX, t._2().longValue());
}); });
} }
} }