Project

General

Profile

« Previous | Next » 

Revision 50073

View differences:

modules/dnet-isti/trunk/src/main/java/eu/dnetlib/data/mdstore/plugins/EnrichOpenairePlugin.java
98 98
		final Set<MyURL> urls = new HashSet<>();
99 99
		for (final Object o : urlList.selectNodes("./*[local-name() = 'alternateIdentifier' and @alternateIdentifierType='url']")) {
100 100
			final String url = ((Node) o).getText().trim();
101
			final String licence = StringUtils.defaultString(((Node) o).valueOf("@licence"), "UNKNOWN");
102
			final String hostedBy = StringUtils.defaultString(((Node) o).valueOf("@hostedBy"), "UNKNOWN");
101
			final String licence = StringUtils.defaultString(((Node) o).valueOf("@licence"), "Unknown");
102
			final String hostedBy = StringUtils.defaultString(((Node) o).valueOf("@hostedBy"), "Unknown");
103 103
			final MyURL u = new MyURL(url, hostedBy, licence);
104 104
			urls.remove(u);
105 105
			urls.add(u);
......
120 120
				.sorted((o1, o2) -> {
121 121
					final String l1 = o1.getLicence();
122 122
					final String l2 = o2.getLicence();
123
					final int n1 = l1.equalsIgnoreCase("Open Access") ? 0 : l1.equalsIgnoreCase("UNKNOWN") ? 2 : 1;
124
					final int n2 = l2.equalsIgnoreCase("Open Access") ? 0 : l2.equalsIgnoreCase("UNKNOWN") ? 2 : 1;
123
					final int n1 = l1.equalsIgnoreCase("Open Access") ? 0 : l1.equalsIgnoreCase("Unknown") ? 2 : 1;
124
					final int n2 = l2.equalsIgnoreCase("Open Access") ? 0 : l2.equalsIgnoreCase("Unknown") ? 2 : 1;
125 125
					return Integer.compare(n1, n2);
126 126
				})
127 127
				// .filter(u -> !u.getUrl().contains("puma.isti.cnr.it"))
......
190 190
		} else if (availables.contains("CLOSED ACCESS")) {
191 191
			doc.selectSingleNode("//*[local-name()='bestLicence']").setText("Closed Access");
192 192
		} else {
193
			doc.selectSingleNode("//*[local-name()='bestLicence']").setText("UNKNOWN");
193
			doc.selectSingleNode("//*[local-name()='bestLicence']").setText("Unknown");
194 194
		}
195 195
	}
196 196

  
modules/dnet-isti/trunk/src/main/resources/eu/dnetlib/bootstrap/profiles/TransformationRuleDSResources/people2dataciteTransform.xml
22 22

  
23 23
    <xsl:template match="/">
24 24
    		
25
    		<xsl:variable name="rights" select="'UNKNOWN'" />
25
    		<xsl:variable name="rights" select="'Unknown'" />
26 26
        
27 27
        <oai:record>
28 28
            <xsl:copy-of select="//*[local-name() = 'header']"/>
......
103 103
	                               <alternateIdentifier alternateIdentifierType="url" licence="{$rights}" hostedBy="CNR People"><xsl:value-of select="."/></alternateIdentifier>
104 104
	                           </xsl:if>
105 105
	                           <xsl:if test="starts-with(., 'http') and not(contains(., 'dx.doi.org')) and not(contains(., 'www.cnr.it'))">
106
	                               <alternateIdentifier alternateIdentifierType="url" licence="{$rights}" hostedBy="UNKNOWN"><xsl:value-of select="."/></alternateIdentifier>
106
	                               <alternateIdentifier alternateIdentifierType="url" licence="{$rights}" hostedBy="Unknown"><xsl:value-of select="."/></alternateIdentifier>
107 107
	                           </xsl:if>
108 108
	                           <xsl:if test="starts-with(., 'info:doi:')">
109 109
	                           	  <xsl:variable name="doi" select="istiFunction:cleanDoi(substring-after(., 'info:doi:'))" />
110
	                               <alternateIdentifier alternateIdentifierType="url" licence="{$rights}" hostedBy="UNKNOWN"><xsl:value-of select="concat('https://dx.doi.org/', $doi)"/></alternateIdentifier>
110
	                               <alternateIdentifier alternateIdentifierType="url" licence="{$rights}" hostedBy="Unknown"><xsl:value-of select="concat('https://dx.doi.org/', $doi)"/></alternateIdentifier>
111 111
	                               <alternateIdentifier alternateIdentifierType="doi"><xsl:value-of select="$doi"/></alternateIdentifier>
112 112
							  </xsl:if>
113 113
	                    </xsl:for-each>

Also available in: Unified diff