Revision 57517
Added by Michele Artini over 4 years ago
Similarity.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.mapreduce.hbase.openorgs; |
2 | 2 |
|
3 |
import com.fasterxml.jackson.annotation.JsonProperty; |
|
4 |
import com.fasterxml.jackson.core.JsonProcessingException; |
|
5 |
import com.fasterxml.jackson.databind.ObjectMapper; |
|
6 |
|
|
7 | 3 |
public class Similarity { |
8 | 4 |
|
9 |
private static final ObjectMapper objectMapper = new ObjectMapper(); |
|
10 |
|
|
11 |
@JsonProperty("local_id") |
|
12 | 5 |
private String openOrgID; |
13 | 6 |
|
14 |
@JsonProperty("oa_id") |
|
15 |
private String openaireId; |
|
16 |
|
|
17 |
@JsonProperty("oa_original_id") |
|
18 | 7 |
private String openaireOriginalId; |
19 | 8 |
|
20 |
@JsonProperty("oa_name") |
|
21 | 9 |
private String name; |
22 | 10 |
|
23 |
@JsonProperty("oa_acronym") |
|
24 | 11 |
private String acronym; |
25 | 12 |
|
26 |
@JsonProperty("oa_country") |
|
27 | 13 |
private String country; |
28 | 14 |
|
29 |
@JsonProperty("oa_url") |
|
30 | 15 |
private String url; |
31 | 16 |
|
32 |
@JsonProperty("oa_collectedfrom") |
|
33 | 17 |
private String collectedFrom; |
34 | 18 |
|
35 | 19 |
public String getOpenOrgID() { |
... | ... | |
40 | 24 |
this.openOrgID = openOrgID; |
41 | 25 |
} |
42 | 26 |
|
43 |
public String getOpenaireId() { |
|
44 |
return openaireId; |
|
45 |
} |
|
46 |
|
|
47 |
public void setOpenaireId(final String openaireId) { |
|
48 |
this.openaireId = openaireId; |
|
49 |
} |
|
50 |
|
|
51 | 27 |
public String getOpenaireOriginalId() { |
52 | 28 |
return openaireOriginalId; |
53 | 29 |
} |
... | ... | |
96 | 72 |
this.collectedFrom = collectedFrom; |
97 | 73 |
} |
98 | 74 |
|
99 |
public String toJson() throws JsonProcessingException {
|
|
100 |
return objectMapper.writeValueAsString(this);
|
|
75 |
public String toTsv() {
|
|
76 |
return String.format("%s\t%s\t%s\t%s\t%s\t%s\t%s", openOrgID, openaireOriginalId, name, acronym, country, url, collectedFrom);
|
|
101 | 77 |
} |
102 |
|
|
103 |
public byte[] toJsonBytes() throws JsonProcessingException { |
|
104 |
return objectMapper.writeValueAsBytes(this); |
|
105 |
} |
|
106 | 78 |
} |
Also available in: Unified diff
OpenOrgs DB: use of tsv for rels