1
|
package eu.dnetlib.data.claims.migration.parser;
|
2
|
|
3
|
import eu.dnetlib.data.claimsDemo.ContextUtils;
|
4
|
import org.junit.Assert;
|
5
|
import org.junit.Test;
|
6
|
|
7
|
/**
|
8
|
* Created by argirok on 29/5/2018.
|
9
|
*/
|
10
|
public class ContextUtilsTest {
|
11
|
|
12
|
@Test
|
13
|
public void dmf2ContextTest() throws Exception {
|
14
|
|
15
|
String id= "egi::country::gr";
|
16
|
|
17
|
Assert.assertEquals("EGI Federation> EGI Countries> Greece", ContextUtils.extractLabel(id));
|
18
|
id= "egi";
|
19
|
Assert.assertEquals("EGI Federation", ContextUtils.extractLabel(id));
|
20
|
id="egi::classification";
|
21
|
Assert.assertEquals("EGI Federation> EGI classification scheme", ContextUtils.extractLabel(id));
|
22
|
id="egi::classification::natsc";
|
23
|
Assert.assertEquals("EGI Federation> EGI classification scheme> Natural Sciences", ContextUtils.extractLabel(id));
|
24
|
id="egi::classification::natsc::math";
|
25
|
Assert.assertEquals("EGI Federation> EGI classification scheme> Mathematics", ContextUtils.extractLabel(id));
|
26
|
id="egi::classification::natsc::math::applied";
|
27
|
Assert.assertEquals("EGI Federation> EGI classification scheme> Applied Mathematics", ContextUtils.extractLabel(id));
|
28
|
id="egi::classification::natsc::math::applied";
|
29
|
Assert.assertEquals("EGI Federation> EGI classification scheme> Applied Mathematics", ContextUtils.extractLabel(id));
|
30
|
id="aginfra::projects";
|
31
|
Assert.assertEquals("AGINFRA> AGINFRA+ Projects", ContextUtils.extractLabel(id));
|
32
|
id="aginfra::projects::1";
|
33
|
Assert.assertEquals("AGINFRA> AGINFRA+ Projects> European Foodbusiness Transfer Laboratory for stimulating entrepreneurial skills, for fostering innovation and for business creation in the Food Sector", ContextUtils.extractLabel(id));
|
34
|
|
35
|
/*
|
36
|
|
37
|
0
|
38
|
id "aginfra::projects"
|
39
|
label "AGINFRA+ Projects"
|
40
|
1
|
41
|
id "aginfra::subcommunity"
|
42
|
label "AGINFRA+ communities"
|
43
|
0
|
44
|
id "aginfra::projects::1"
|
45
|
label "European Foodbusiness Transfer Laboratory for stimulating entrepreneurial skills, for fostering innovation and for business creation in the Food Sector"
|
46
|
concepts
|
47
|
*/
|
48
|
}
|
49
|
}
|