Revision 50572
Added by Michele Artini about 6 years ago
modules/dnet-isti/trunk/src/main/java/eu/dnetlib/xml/ISTIUtilityFunction.java | ||
---|---|---|
72 | 72 |
public static String calculatePersonName(final String s) { |
73 | 73 |
final Pattern pattern = Pattern.compile("info:cnr-pdr\\/author\\/(.+):(.+)\\/(.+)\\/(.+)"); |
74 | 74 |
final Matcher matcher = pattern.matcher(s); |
75 |
return matcher.find() ? capitalize(String.format("%s %s", matcher.group(3), matcher.group(4))) : "";
|
|
75 |
return matcher.find() ? capitalize(String.format("%s %s", matcher.group(4), matcher.group(3))) : "";
|
|
76 | 76 |
} |
77 | 77 |
|
78 | 78 |
// <xsl:for-each select="tokenize(istiFunction:cleanName(.), ';')"> |
modules/dnet-isti/trunk/src/main/java/eu/dnetlib/data/mdstore/plugins/EnrichOpenairePlugin.java | ||
---|---|---|
48 | 48 |
updateCitations(doc, n); |
49 | 49 |
updateUrls(doc, n); |
50 | 50 |
updateProjects(doc, n); |
51 |
updateBestLicence(doc, n); |
|
52 | 51 |
|
52 |
updateBestLicence(doc); |
|
53 |
|
|
53 | 54 |
return true; |
54 | 55 |
} else if (results.size() == 1) { |
55 | 56 |
log.warn("Too many responses"); |
... | ... | |
107 | 108 |
} |
108 | 109 |
|
109 | 110 |
for (final Object oin : n.selectNodes(".//instance")) { |
110 |
final String licence = ((Element) oin).valueOf("./licence/@classname").trim();
|
|
111 |
final String licence = ((Element) oin).valueOf("./accessright/@classname").trim();
|
|
111 | 112 |
final String hostedBy = ((Element) oin).valueOf("./hostedby/@name").trim(); |
112 | 113 |
for (final Object ourl : ((Element) oin).selectNodes("./webresource/url")) { |
113 | 114 |
final MyURL u = new MyURL(((Node) ourl).getText().trim(), hostedBy, licence); |
... | ... | |
176 | 177 |
} |
177 | 178 |
} |
178 | 179 |
|
179 |
private void updateBestLicence(final Document doc, final Node n) {
|
|
180 |
private void updateBestLicence(final Document doc) { |
|
180 | 181 |
final Set<String> availables = new HashSet<>(); |
181 | 182 |
for (final Object o : doc.selectNodes("//*[local-name()='alternateIdentifier']")) { |
182 | 183 |
availables.add(((Node) o).valueOf("@licence").trim().toUpperCase()); |
modules/dnet-isti/trunk/src/main/resources/eu/dnetlib/bootstrap/profiles/MDFormatDSResources/datacite_mdformat.xml | ||
---|---|---|
29 | 29 |
<FIELD indexable="true" name="date" result="false" stored="true" stat="false" tokenizable="false" xpath="//*[local-name() = 'date']"/> |
30 | 30 |
<FIELD indexable="true" name="affiliation" result="false" stored="true" stat="false" tokenizable="false" xpath="//*[local-name() = 'affiliation']"/> |
31 | 31 |
<FIELD indexable="true" name="group" result="false" stored="true" stat="false" tokenizable="false" xpath="//*[local-name() = 'affiliation' and @type = 'Servizio']/@group"/> |
32 |
<FIELD indexable="true" name="laboratory" result="false" stored="true" stat="false" tokenizable="false" xpath="//*[local-name() = 'affiliation' and (@type = 'Laboratorio' or or @type = 'Centro')]/@group"/>
|
|
32 |
<FIELD indexable="true" name="laboratory" result="false" stored="true" stat="false" tokenizable="false" xpath="//*[local-name() = 'affiliation' and (@type = 'Laboratorio' or @type = 'Centro')]/@group"/> |
|
33 | 33 |
<FIELD indexable="true" name="creatorforbrowsing" result="false" stored="false" stat="false" tokenizable="false" xpath="//*[local-name() = 'creator']/*[local-name()='creatorName']"/> |
34 | 34 |
<FIELD indexable="true" name="cnrcreatorforbrowsing" result="false" stored="false" stat="false" tokenizable="false" xpath="//*[local-name() = 'person']/*[local-name()='personName']"/> |
35 | 35 |
<FIELD indexable="true" name="doi" result="false" stat="false" stored="true" tokenizable="false" xpath="//*[local-name() = 'alternateIdentifier' and @alternateIdentifierType='doi']"/> |
Also available in: Unified diff
bug fixing