additional XSLT transformation scripts, enhance methods #97
|
@ -1,3 +1,4 @@
|
|||
|
||||
package eu.dnetlib.dhp.common.vocabulary;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
@ -143,7 +144,7 @@ public class VocabularyGroup implements Serializable {
|
|||
}
|
||||
|
||||
public boolean termExists(final String vocId, final String id, final Boolean caseSensitive) {
|
||||
if(Boolean.TRUE.equals(caseSensitive)) {
|
||||
if (Boolean.TRUE.equals(caseSensitive)) {
|
||||
return vocabularyExists(vocId) && vocs.get(vocId).termExists(id);
|
||||
}
|
||||
return vocabularyExists(vocId) && vocs.get(vocId.toLowerCase()).termExists(id);
|
||||
|
|
|
@ -5,13 +5,12 @@ import java.util.LinkedList;
|
|||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
|
||||
import eu.dnetlib.dhp.common.vocabulary.VocabularyGroup;
|
||||
import eu.dnetlib.dhp.schema.oaf.Qualifier;
|
||||
import net.sf.saxon.s9api.*;
|
||||
import scala.Serializable;
|
||||
|
||||
//import eu.dnetlib.data.collective.transformation.engine.functions.ProcessingException;
|
||||
// import eu.dnetlib.data.collective.transformation.engine.functions.ProcessingException;
|
||||
|
||||
// import org.apache.kafka.clients.producer.KafkaProducer;
|
||||
// import org.apache.kafka.clients.producer.Producer;
|
||||
|
@ -77,12 +76,12 @@ public class TransformationFunctionProxy implements ExtensionFunction, Serializa
|
|||
}
|
||||
|
||||
/**
|
||||
* normalize values given as an input value by using a vocabulary
|
||||
* normalize values given as an input value by using a vocabulary
|
||||
* @param aInput - the value as a String
|
||||
* @param aVocabularyName - the name of the vocabulary, which must be known for the vocabulary registry
|
||||
* @return
|
||||
*/
|
||||
public synchronized String convertString(String aInput, String aVocabularyName){
|
||||
public synchronized String convertString(String aInput, String aVocabularyName) {
|
||||
List<String> values = new LinkedList<>();
|
||||
|
||||
// Producer<String, String> producer = new KafkaProducer<>(props);
|
||||
|
@ -105,15 +104,12 @@ public class TransformationFunctionProxy implements ExtensionFunction, Serializa
|
|||
// producer.send(new ProducerRecord<String, String>("transformation-vocab", "convert failed", aVocabularyName));
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
/* catch (KafkaException e) {
|
||||
// For all other exceptions, just abort the transaction and try again.
|
||||
producer.abortTransaction();
|
||||
}
|
||||
*/
|
||||
/*
|
||||
* catch (KafkaException e) { // For all other exceptions, just abort the transaction and try again.
|
||||
* producer.abortTransaction(); }
|
||||
*/
|
||||
// producer.close();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@ public class TransformationJobTest extends AbstractVocabularyTest {
|
|||
|
||||
// We Load the XSLT transformation Rule from the classpath
|
||||
XSLTTransformationFunction tr = loadTransformationRule("/eu/dnetlib/dhp/transform/zenodo_tr.xslt");
|
||||
// XSLTTransformationFunction tr = loadTransformationRule("/eu/dnetlib/dhp/transform/scripts/xslt_cleaning_datarepo_datacite.xsl");
|
||||
|
||||
MetadataRecord result = tr.call(mr);
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<xsl:param name="varMESTD" select="'mestd_______::'" />
|
||||
<xsl:param name="varMZOS" select="'irb_hr______::'" />
|
||||
<xsl:param name="varNHMRC" select="'nhmrc_______::'" />
|
||||
<xsl:pasram name="varNIH" select="'nih_________::'" />
|
||||
<xsl:param name="varNIH" select="'nih_________::'" />
|
||||
<xsl:param name="varNSF" select="'nsf_________::'" />
|
||||
<xsl:param name="varNWO" select="'nwo_________::'" />
|
||||
<xsl:param name="varRCUK" select="'rcuk________::'" />
|
||||
|
|
Loading…
Reference in New Issue