Revision 44642
Added by Michele Artini over 7 years ago
modules/dnet-isti/trunk/src/main/java/eu/dnetlib/msro/workflows/nodes/MergeRecordsJobNode.java | ||
---|---|---|
89 | 89 |
} |
90 | 90 |
} |
91 | 91 |
|
92 |
for (final Object o : master.selectNodes(".//*[local-name()='project']")) { |
|
92 |
final Element projectsNode = (Element) master.selectSingleNode("./*[local-name()='projects']"); |
|
93 |
for (final Object o : projectsNode.selectNodes("./*")) { |
|
93 | 94 |
((Node) o).detach(); |
94 | 95 |
} |
95 |
for (final Object o : pkgNode.selectNodes("//projects/*")) {
|
|
96 |
master.add(((Node) o).detach());
|
|
96 |
for (final Object o : pkgNode.selectNodes("./*[local-name()='projects']/*")) {
|
|
97 |
projectsNode.add(((Node) o).detach());
|
|
97 | 98 |
} |
98 | 99 |
|
99 | 100 |
pkgNode.getParent().add(master.detach()); |
... | ... | |
113 | 114 |
final Element nodeMaster = (Element) master.selectSingleNode(rule.getParentXpath()); |
114 | 115 |
|
115 | 116 |
if (nodeMaster == null) { |
116 |
log.warn("Missing parent node in master record, xpath: " + rule.getParentXpath());
|
|
117 |
log.warn("Missing parent node in MASTER record, xpath: " + rule.getParentXpath());
|
|
117 | 118 |
return; |
118 | 119 |
} |
119 | 120 |
|
120 | 121 |
final Element nodeOther = (Element) other.selectSingleNode(rule.getParentXpath()); |
121 | 122 |
|
122 | 123 |
if (nodeOther == null) { |
123 |
log.warn("Missing parent node in other record, xpath: " + rule.getParentXpath());
|
|
124 |
log.warn("Missing parent node in SECOND record, xpath: " + rule.getParentXpath());
|
|
124 | 125 |
return; |
125 | 126 |
} |
126 | 127 |
|
modules/dnet-isti/trunk/src/main/resources/eu/dnetlib/bootstrap/profiles/TransformationRuleDSResources/people2dataciteTransform.xml | ||
---|---|---|
93 | 93 |
|
94 | 94 |
<xsl:for-each select="//dc:type"> |
95 | 95 |
<resourceType resourceTypeGeneral="Text"> |
96 |
<xsl:value-of |
|
97 |
select="TransformationFunction:convertString($tf, ., 'TextTypologies')" |
|
98 |
/> |
|
99 |
|
|
96 |
<xsl:value-of select="TransformationFunction:convertString($tf, ., 'TextTypologies')" /> |
|
100 | 97 |
</resourceType> |
101 | 98 |
</xsl:for-each> |
99 |
|
|
102 | 100 |
<alternateIdentifiers> |
103 |
<xsl:for-each select="//dc:identifier"> |
|
104 |
<alternateIdentifier > |
|
105 |
<xsl:attribute name="alternateIdentifierType" > |
|
106 |
<xsl:choose> |
|
107 |
<xsl:when test="starts-with(., 'http')">url</xsl:when> |
|
108 |
<xsl:when test="contains(.,'doi')">doi</xsl:when> |
|
109 |
<xsl:when test="contains(.,'issn')">issn</xsl:when> |
|
110 |
<xsl:when test="contains(.,'isbn')">isbn</xsl:when> |
|
111 |
<xsl:when test="starts-with(., 'urn')">urn</xsl:when> |
|
112 |
<xsl:otherwise>unknown</xsl:otherwise> |
|
113 |
</xsl:choose> |
|
114 |
</xsl:attribute> |
|
115 |
<xsl:value-of select="."/> |
|
116 |
</alternateIdentifier> |
|
117 |
|
|
118 |
</xsl:for-each> |
|
101 |
<xsl:for-each select="//dc:identifier"> |
|
102 |
<alternateIdentifier> |
|
103 |
<xsl:attribute name="alternateIdentifierType" > |
|
104 |
<xsl:choose> |
|
105 |
<xsl:when test="starts-with(., 'http')">url</xsl:when> |
|
106 |
<xsl:when test="contains(.,'doi')">doi</xsl:when> |
|
107 |
<xsl:when test="contains(.,'issn')">issn</xsl:when> |
|
108 |
<xsl:when test="contains(.,'isbn')">isbn</xsl:when> |
|
109 |
<xsl:when test="starts-with(., 'urn')">urn</xsl:when> |
|
110 |
<xsl:otherwise>unknown</xsl:otherwise> |
|
111 |
</xsl:choose> |
|
112 |
</xsl:attribute> |
|
113 |
<xsl:value-of select="."/> |
|
114 |
</alternateIdentifier> |
|
115 |
</xsl:for-each> |
|
119 | 116 |
</alternateIdentifiers> |
120 | 117 |
|
121 | 118 |
<relatedIdentifiers/> |
modules/dnet-isti/trunk/src/main/resources/eu/dnetlib/bootstrap/profiles/TransformationRuleDSResources/puma2datacite.xml | ||
---|---|---|
18 | 18 |
|
19 | 19 |
<xsl:variable name="tf" select="TransformationFunction:getInstance()"/> |
20 | 20 |
|
21 |
|
|
22 | 21 |
<xsl:template match="/"> |
23 | 22 |
<oai:record> |
24 | 23 |
<xsl:copy-of select="//*[local-name()='header']"/> |
... | ... | |
103 | 102 |
<xsl:for-each select="//dc:type"> |
104 | 103 |
<resourceType resourceTypeGeneral="Text"><xsl:value-of select="TransformationFunction:convertString($tf, ., 'TextTypologies')" /></resourceType> |
105 | 104 |
</xsl:for-each> |
106 |
<xsl:if test="//dc:url"> |
|
107 |
<alternateIdentifiers > |
|
108 |
<xsl:for-each select="//dc:url"> |
|
109 |
<alternateIdentifier > |
|
110 |
<xsl:attribute name="alternateIdentifierType" >url</xsl:attribute> |
|
111 |
<xsl:value-of select="."/> |
|
112 |
</alternateIdentifier> |
|
113 |
</xsl:for-each> |
|
114 |
<xsl:for-each select="//dc:identifier.resource"> |
|
115 |
<alternateIdentifier > |
|
116 |
<xsl:attribute name="alternateIdentifierType" >url</xsl:attribute> |
|
117 |
<xsl:value-of select="."/> |
|
118 |
</alternateIdentifier> |
|
119 |
</xsl:for-each> |
|
120 | 105 |
|
121 |
</alternateIdentifiers> |
|
122 |
</xsl:if> |
|
106 |
<alternateIdentifiers> |
|
107 |
<xsl:for-each select="//dc:url"> |
|
108 |
<alternateIdentifier > |
|
109 |
<xsl:attribute name="alternateIdentifierType" >url</xsl:attribute> |
|
110 |
<xsl:value-of select="."/> |
|
111 |
</alternateIdentifier> |
|
112 |
</xsl:for-each> |
|
113 |
<xsl:for-each select="//dc:identifier.resource"> |
|
114 |
<alternateIdentifier > |
|
115 |
<xsl:attribute name="alternateIdentifierType" >url</xsl:attribute> |
|
116 |
<xsl:value-of select="."/> |
|
117 |
</alternateIdentifier> |
|
118 |
</xsl:for-each> |
|
119 |
</alternateIdentifiers> |
|
120 |
|
|
123 | 121 |
<relatedIdentifiers /> |
124 | 122 |
<sizes /> |
125 | 123 |
<formats /> |
Also available in: Unified diff
partial implementation of merge node