introduced specific type for result.subject

This commit is contained in:
Claudio Atzori 2022-08-04 14:55:43 +02:00
parent 3e9c91a741
commit 5e6dce133c
5 changed files with 27 additions and 6 deletions

View File

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

View File

@ -38,6 +38,9 @@ public class ModelConstants {
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 = "FOS";
public static final String DNET_SUBJECT_TYPOLOGIES = "dnet:subject_classification_typologies";
public static final String DNET_RESULT_TYPOLOGIES = "dnet:result_typologies";

View File

@ -60,7 +60,7 @@ public class Result extends OafEntity implements Serializable {
/**
* The Subject.
*/
private List<StructuredProperty> subject;
private List<Subject> subject;
/**
* The Title.
@ -258,7 +258,7 @@ public class Result extends OafEntity implements Serializable {
*
* @return the subject
*/
public List<StructuredProperty> getSubject() {
public List<Subject> getSubject() {
return subject;
}
@ -267,7 +267,7 @@ public class Result extends OafEntity implements Serializable {
*
* @param subject the subject
*/
public void setSubject(List<StructuredProperty> subject) {
public void setSubject(List<Subject> subject) {
this.subject = subject;
}

View File

@ -0,0 +1,6 @@
package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
public class Subject extends StructuredProperty implements Serializable {
}

View File

@ -443,8 +443,8 @@ class MergeTest {
Publication a = publication();
Publication b = publication();
a.setSubject(Arrays.asList(setSP("a", "open", "classe"), setSP("b", "open", "classe")));
b.setSubject(Arrays.asList(setSP("A", "open", "classe"), setSP("c", "open", "classe")));
a.setSubject(Arrays.asList(setSub("a", "open", "classe"), setSub("b", "open", "classe")));
b.setSubject(Arrays.asList(setSub("A", "open", "classe"), setSub("c", "open", "classe")));
a.mergeFrom(b);
@ -599,6 +599,18 @@ class MergeTest {
return k;
}
private Subject setSub(final String value, final String schema, final String classname) {
Subject s = new Subject();
s.setValue(value);
Qualifier q = new Qualifier();
q.setClassname(classname);
q.setClassid(classname);
q.setSchemename(schema);
q.setSchemeid(schema);
s.setQualifier(q);
return s;
}
/**
* Sets sp.
*