2020-04-27 14:52:31 +02:00
|
|
|
|
2020-03-13 09:13:20 +01:00
|
|
|
package eu.dnetlib.scholexplorer.relation;
|
|
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
import java.util.HashMap;
|
2020-04-28 11:23:29 +02:00
|
|
|
|
2020-04-18 12:42:58 +02:00
|
|
|
import org.apache.commons.io.IOUtils;
|
2020-03-13 09:13:20 +01:00
|
|
|
|
2020-04-28 11:23:29 +02:00
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
|
2020-04-18 12:42:58 +02:00
|
|
|
public class RelationMapper extends HashMap<String, RelInfo> implements Serializable {
|
2020-03-13 09:13:20 +01:00
|
|
|
|
2020-04-27 14:52:31 +02:00
|
|
|
public static RelationMapper load() throws Exception {
|
2020-03-13 09:13:20 +01:00
|
|
|
|
2020-04-27 14:52:31 +02:00
|
|
|
final String json = IOUtils.toString(RelationMapper.class.getResourceAsStream("relations.json"));
|
2020-03-13 09:13:20 +01:00
|
|
|
|
2020-04-27 14:52:31 +02:00
|
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
|
|
return mapper.readValue(json, RelationMapper.class);
|
|
|
|
}
|
2020-03-13 09:13:20 +01:00
|
|
|
}
|