1
|
package eu.dnetlib.data.mapreduce.hbase.index.config;
|
2
|
|
3
|
import org.junit.Test;
|
4
|
|
5
|
import static org.junit.Assert.assertEquals;
|
6
|
import static org.junit.Assert.assertNotNull;
|
7
|
|
8
|
public class RelClassesTest {
|
9
|
|
10
|
public static final String relClassesJson =
|
11
|
"[\"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
|
+ "\"isContributorOf:hasContributor\","
|
29
|
+ "\"hasContributor:isContributorOf\","
|
30
|
+ "\"isPartOf:hasPart\","
|
31
|
+ "\"hasPart:isPartOf\","
|
32
|
+ "\"isSupplementedBy:isSupplementTo\","
|
33
|
+ "\"isSupplementTo:isSupplementedBy\","
|
34
|
+ "\"hasAuthorInstitution:isAuthorInstitutionOf\","
|
35
|
+ "\"isAuthorInstitutionOf:hasAuthorInstitution\"]";
|
36
|
|
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
|
}
|