Last change
on this file since 6715 was
6715,
checked in by davor.ostojic@oeaw.ac.at, 9 years ago
|
cross-mapping
vocabulary-entry instead of invertedMap
|
-
Property svn:mime-type set to
text/plain
|
File size:
1.0 KB
|
Line | |
---|
1 | package eu.clarin.cmdi.vlo.importer; |
---|
2 | |
---|
3 | import java.util.ArrayList; |
---|
4 | import java.util.Arrays; |
---|
5 | import java.util.List; |
---|
6 | import java.util.Map; |
---|
7 | |
---|
8 | import eu.clarin.cmdi.vlo.Plural2Singular; |
---|
9 | import eu.clarin.cmdi.vlo.StringUtils; |
---|
10 | |
---|
11 | public class ResourceClassPostProcessor extends PostProcessorsWithVocabularyMap { |
---|
12 | |
---|
13 | /** |
---|
14 | * Postprocess ResourceClass values |
---|
15 | * @param value extracted ResourcClass information |
---|
16 | * @return Value with some normalisation |
---|
17 | */ |
---|
18 | @Override |
---|
19 | public List<String> process(String value) { |
---|
20 | String result = value; |
---|
21 | |
---|
22 | // replace DCMI URLs with DCMI type |
---|
23 | result = result.replaceFirst("http://purl.org/dc/dcmitype/", ""); |
---|
24 | |
---|
25 | result.trim(); |
---|
26 | |
---|
27 | // first letter should be upper case |
---|
28 | if(result.length() > 1) { |
---|
29 | result = StringUtils.capitalizeFirstLetter(value); |
---|
30 | } |
---|
31 | |
---|
32 | result = normalize(value); |
---|
33 | |
---|
34 | return Arrays.asList(result); |
---|
35 | } |
---|
36 | |
---|
37 | @Override |
---|
38 | public String getNormalizationMapURL() { |
---|
39 | return MetadataImporter.config.getResourceClassMapUrl(); |
---|
40 | } |
---|
41 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.