Revision 49029
Added by Claudio Atzori over 6 years ago
IndexConfigTest.java | ||
---|---|---|
11 | 11 |
public static final String config = |
12 | 12 |
"index.conf { " |
13 | 13 |
+ "result { dups = true, links = [" |
14 |
+ "{ relType = personResult_authorship_hasAuthor, targetEntity = person, expandAs = rel, symmetric = true, fields = [title,dateofacceptance,publisher,resulttype,collectedfrom] }, " |
|
15 | 14 |
+ "{ relType = resultProject_outcome_isProducedBy, targetEntity = result, expandAs = rel, symmetric = true, fields = [title,dateofacceptance,publisher,resulttype], max = 1 }, " |
16 | 15 |
+ "{ relType = resultResult_dedup_isMergedIn, targetEntity = result, expandAs = child, symmetric = true, fields = [title,dateofacceptance,publisher,resulttype,pid] }, " |
17 | 16 |
+ "{ relType = resultResult_dedup_merges, targetEntity = result, expandAs = child, symmetric = true, fields = [title,dateofacceptance,publisher,resulttype,pid] }, " |
... | ... | |
23 | 22 |
+ "{ relType = resultResult_part_isPartOf, targetEntity = result, expandAs = rel, symmetric = true, fields = [title,dateofacceptance,publisher,resulttype,similarity,type,pid,url] }," |
24 | 23 |
+ "{ relType = resultResult_part_hasPart, targetEntity = result, expandAs = rel, symmetric = true, fields = [title,dateofacceptance,publisher,resulttype,similarity,type,pid,url] }" |
25 | 24 |
+ "]}, " |
26 |
+ "person { dups = false, links = [" |
|
27 |
+ "{ relType = personResult_authorship_isAuthorOf, targetEntity = result, expandAs = rel, symmetric = true, fields = [fullname,ranking,pid], max = 2 }, " |
|
28 |
+ "{ relType = projectPerson_contactPerson_isContact, targetEntity = project, expandAs = rel, symmetric = true, fields = [fullname,email,fax,phone] } " |
|
29 |
+ "]}, " |
|
30 | 25 |
+ "datasource { dups = false, links = [" |
31 | 26 |
+ "{ relType = datasourceOrganization_provision_provides, targetEntity = organization, expandAs = rel, symmetric = true, fields = [officialname,websiteurl,datasourcetype,aggregatortype] } " |
32 | 27 |
+ "]}, " |
... | ... | |
39 | 34 |
+ "]}, " |
40 | 35 |
+ "project { dups = false, links = [" |
41 | 36 |
+ "{ relType = projectOrganization_participation_hasParticipant, targetEntity = organization, expandAs = rel, symmetric = true, fields = [code,acronym,title,websiteurl,contracttype,fundingtree] }, " |
42 |
+ "{ relType = resultProject_outcome_produces, targetEntity = result, expandAs = rel, symmetric = true, fields = [code,acronym,title,websiteurl,contracttype,fundingtree] }, " |
|
43 |
+ "{ relType = projectPerson_contactPerson_hasContact, targetEntity = person, expandAs = rel, symmetric = true, fields = [code,acronym,title,websiteurl,contracttype,fundingtree] } " |
|
37 |
+ "{ relType = resultProject_outcome_produces, targetEntity = result, expandAs = rel, symmetric = true, fields = [code,acronym,title,websiteurl,contracttype,fundingtree] } " |
|
44 | 38 |
+ "], excludeFields = [jsonextrainfo,optional1,optional2]}} "; |
45 | 39 |
|
46 | 40 |
public static final String configWithIncludesExcludes = |
... | ... | |
55 | 49 |
+ "{ relType = resultResult_supplement_isSupplementedBy, targetEntity = result, expandAs = rel, symmetric = true, fields = [title,dateofacceptance,publisher,resulttype,similarity,type,pid,url,collectedfrom] }," |
56 | 50 |
+ "{ relType = resultResult_part_isPartOf, targetEntity = result, expandAs = rel, symmetric = true, fields = [title,dateofacceptance,publisher,resulttype,similarity,type,pid,url] }," |
57 | 51 |
+ "{ relType = resultResult_part_hasPart, targetEntity = result, expandAs = rel, symmetric = true, fields = [title,dateofacceptance,publisher,resulttype,similarity,type,pid,url] }" |
58 |
+ "], excludeFields = [jsonextrainfo] }, " |
|
59 |
+ "person { dups = false, links = [" |
|
60 |
+ "{ relType = personResult_authorship_isAuthorOf, targetEntity = result, expandAs = rel, symmetric = true, fields = [fullname,ranking,pid], max = 2 }, " |
|
61 |
+ "{ relType = projectPerson_contactPerson_isContact, targetEntity = project, expandAs = rel, symmetric = true, fields = [fullname,email,fax,phone] } " |
|
62 |
+ "], includeFields=[fullname, ranking]}" |
|
52 |
+ "], excludeFields = [jsonextrainfo] } " |
|
63 | 53 |
+ "}"; |
64 | 54 |
|
65 | 55 |
public static final String wrongConfig = |
66 | 56 |
"index.conf { " |
67 |
+ "person { dups = false, links = ["
|
|
57 |
+ "author { dups = false, links = ["
|
|
68 | 58 |
+ "{ relType = personResult_authorship_isAuthorOf, targetEntity = result, expandAs = rel, symmetric = true, fields = [fullname,ranking,pid], max = 2 }, " |
69 | 59 |
+ "{ relType = projectPerson_contactPerson_isContact, targetEntity = project, expandAs = rel, symmetric = true, fields = [fullname,email,fax,phone] } " |
70 | 60 |
+ "], includeFields=[fullname, ranking], excludeFields=[email] }" |
... | ... | |
128 | 118 |
final EntityConfigTable map = conf.getConfigMap(); |
129 | 119 |
assertNotNull(map); |
130 | 120 |
assertTrue(map.size() > 0); |
131 |
assertTrue(map.hasIncludeFields(Type.person)); |
|
132 | 121 |
assertTrue(map.hasExcludeFields(Type.result)); |
133 | 122 |
} |
134 | 123 |
|
Also available in: Unified diff
getting rid of person entities