Revision 43514
Added by Claudio Atzori over 7 years ago
GTAuthorMapper.java | ||
---|---|---|
6 | 6 |
import eu.dnetlib.data.proto.FieldTypeProtos.Qualifier; |
7 | 7 |
import eu.dnetlib.data.proto.FieldTypeProtos.StringField; |
8 | 8 |
import eu.dnetlib.data.proto.KindProtos.Kind; |
9 |
import eu.dnetlib.data.proto.OafProtos.Oaf;
|
|
10 |
import eu.dnetlib.data.proto.OafProtos.OafEntity;
|
|
9 |
import eu.dnetlib.data.proto.DNGFProtos.DNGF;
|
|
10 |
import eu.dnetlib.data.proto.DNGFProtos.DNGFEntity;
|
|
11 | 11 |
import eu.dnetlib.data.proto.PersonProtos.Person; |
12 | 12 |
import eu.dnetlib.data.proto.PersonProtos.Person.CoAuthor; |
13 | 13 |
import eu.dnetlib.data.proto.PersonProtos.Person.MergedPerson; |
... | ... | |
17 | 17 |
|
18 | 18 |
public class GTAuthorMapper { |
19 | 19 |
|
20 |
public Oaf map(final GTAuthor gta) {
|
|
20 |
public DNGF map(final GTAuthor gta) {
|
|
21 | 21 |
|
22 |
final Oaf.Builder oaf = Oaf.newBuilder();
|
|
22 |
final DNGF.Builder oaf = DNGF.newBuilder();
|
|
23 | 23 |
|
24 | 24 |
oaf.setDataInfo(getDataInfo()); |
25 | 25 |
oaf.setLastupdatetimestamp(System.currentTimeMillis()); |
26 | 26 |
oaf.setKind(Kind.entity); |
27 |
oaf.setEntity(getOafEntity(gta));
|
|
27 |
oaf.setEntity(getDNGFEntity(gta));
|
|
28 | 28 |
|
29 | 29 |
return oaf.build(); |
30 | 30 |
} |
31 | 31 |
|
32 |
private OafEntity getOafEntity(final GTAuthor gta) {
|
|
33 |
final OafEntity.Builder entity = OafEntity.newBuilder();
|
|
32 |
private DNGFEntity getDNGFEntity(final GTAuthor gta) {
|
|
33 |
final DNGFEntity.Builder entity = DNGFEntity.newBuilder();
|
|
34 | 34 |
entity.setType(Type.person); |
35 | 35 |
entity.setId(gta.getId()); |
36 | 36 |
entity.setPerson(getPerson(gta)); |
Also available in: Unified diff
created dataset dedicated entities