1 |
28058
|
claudio.at
|
package eu.dnetlib.data.mapreduce.hbase.index.config;
|
2 |
|
|
|
3 |
40205
|
claudio.at
|
import org.junit.Test;
|
4 |
|
|
|
5 |
28058
|
claudio.at
|
import static org.junit.Assert.assertEquals;
|
6 |
|
|
import static org.junit.Assert.assertNotNull;
|
7 |
|
|
|
8 |
|
|
public class RelClassesTest {
|
9 |
|
|
|
10 |
40205
|
claudio.at
|
public static final String relClassesJson =
|
11 |
48145
|
claudio.at
|
"[\"isProvidedBy:provides\","
|
12 |
|
|
+ "\"provides:isProvidedBy\","
|
13 |
|
|
+ "\"merges:isMergedIn\","
|
14 |
|
|
+ "\"isMergedIn:merges\","
|
15 |
|
|
+ "\"isSimilarTo:isSimilarTo\","
|
16 |
|
|
+ "\"isCoAuthorOf:isCoAuthorOf\","
|
17 |
|
|
+ "\"isAuthorOf:hasAuthor\","
|
18 |
|
|
+ "\"hasAuthor:isAuthorOf\","
|
19 |
|
|
+ "\"isParticipant:hasParticipant\","
|
20 |
|
|
+ "\"hasParticipant:isParticipant\","
|
21 |
|
|
+ "\"isProducedBy:produces\","
|
22 |
|
|
+ "\"produces:isProducedBy\","
|
23 |
|
|
+ "\"hasAmongTopNSimilarDocuments:isAmongTopNSimilarDocuments\","
|
24 |
|
|
+ "\"isAmongTopNSimilarDocuments:hasAmongTopNSimilarDocuments\","
|
25 |
|
|
+ "\"isRelatedTo:isRelatedTo\","
|
26 |
|
|
+ "\"isContact:hasContact\","
|
27 |
|
|
+ "\"hasContact:isContact\","
|
28 |
40205
|
claudio.at
|
+ "\"isContributorOf:hasContributor\","
|
29 |
|
|
+ "\"hasContributor:isContributorOf\","
|
30 |
48145
|
claudio.at
|
+ "\"isPartOf:hasPart\","
|
31 |
|
|
+ "\"hasPart:isPartOf\","
|
32 |
40205
|
claudio.at
|
+ "\"isSupplementedBy:isSupplementTo\","
|
33 |
48145
|
claudio.at
|
+ "\"isSupplementTo:isSupplementedBy\","
|
34 |
|
|
+ "\"hasAuthorInstitution:isAuthorInstitutionOf\","
|
35 |
|
|
+ "\"isAuthorInstitutionOf:hasAuthorInstitution\"]";
|
36 |
28058
|
claudio.at
|
|
37 |
|
|
@Test
|
38 |
|
|
public void testRelClasses() {
|
39 |
|
|
RelClasses relClasses = new RelClasses(relClassesJson);
|
40 |
|
|
assertNotNull(relClasses);
|
41 |
|
|
|
42 |
|
|
String providedBy = relClasses.getInverse("provides");
|
43 |
|
|
assertEquals(providedBy, "isProvidedBy");
|
44 |
|
|
|
45 |
|
|
String provides = relClasses.getInverse("isProvidedBy");
|
46 |
|
|
assertEquals(provides, "provides");
|
47 |
|
|
}
|
48 |
|
|
}
|