forked from D-Net/dnet-hadoop
code formatting
This commit is contained in:
parent
cd1b58483e
commit
1b8488976b
|
@ -26,9 +26,9 @@ public class QueryInformationSystem {
|
|||
+ " return "
|
||||
+ " <community> "
|
||||
+ " { $x//CONFIGURATION/context/@id} "
|
||||
+ " <advancedConstraints>" +
|
||||
"{$x//CONFIGURATION/context/param[./@name='advancedConstraints']/text() }" +
|
||||
"</advancedConstraints>"
|
||||
+ " <advancedConstraints>" +
|
||||
"{$x//CONFIGURATION/context/param[./@name='advancedConstraints']/text() }" +
|
||||
"</advancedConstraints>"
|
||||
+ " <subjects> "
|
||||
+ " {for $y in tokenize($subj,',') "
|
||||
+ " return "
|
||||
|
|
|
@ -9,16 +9,16 @@ import java.util.*;
|
|||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import eu.dnetlib.dhp.schema.common.ModelConstants;
|
||||
import eu.dnetlib.dhp.schema.common.ModelSupport;
|
||||
import eu.dnetlib.dhp.schema.oaf.utils.OafMapperUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.jayway.jsonpath.DocumentContext;
|
||||
import com.jayway.jsonpath.JsonPath;
|
||||
|
||||
import eu.dnetlib.dhp.schema.common.ModelConstants;
|
||||
import eu.dnetlib.dhp.schema.common.ModelSupport;
|
||||
import eu.dnetlib.dhp.schema.oaf.*;
|
||||
import eu.dnetlib.dhp.schema.oaf.utils.OafMapperUtils;
|
||||
|
||||
/** Created by miriam on 02/08/2018. */
|
||||
public class ResultTagger implements Serializable {
|
||||
|
|
|
@ -48,7 +48,7 @@ public class BulkTagJobTest {
|
|||
+ " \"description\" : \"$['description'][*]['value']\", "
|
||||
+ " \"subject\" :\"$['subject'][*]['value']\" , " +
|
||||
|
||||
"\"fos\" : \"$['subject'][?(@['qualifier']['classid']=='subject:fos')].value\"} ";
|
||||
"\"fos\" : \"$['subject'][?(@['qualifier']['classid']=='subject:fos')].value\"} ";
|
||||
|
||||
private static SparkSession spark;
|
||||
|
||||
|
|
|
@ -86,32 +86,32 @@ class CommunityConfigurationFactoryTest {
|
|||
@Test
|
||||
void loadSelCriteriaTest2() throws DocumentException, IOException, SAXException {
|
||||
String xml = IOUtils
|
||||
.toString(
|
||||
getClass()
|
||||
.getResourceAsStream(
|
||||
"/eu/dnetlib/dhp/bulktag/communityconfiguration/community_configuration_selcrit2.xml"));
|
||||
.toString(
|
||||
getClass()
|
||||
.getResourceAsStream(
|
||||
"/eu/dnetlib/dhp/bulktag/communityconfiguration/community_configuration_selcrit2.xml"));
|
||||
final CommunityConfiguration cc = CommunityConfigurationFactory.newInstance(xml);
|
||||
Map<String, List<String>> param = new HashMap<>();
|
||||
param.put("author", new ArrayList<>(Collections.singletonList("Pippo Pippi")));
|
||||
param
|
||||
.put(
|
||||
"description",
|
||||
new ArrayList<>(
|
||||
Collections
|
||||
.singletonList(
|
||||
"This work has been partially supported by DARIAH-EU infrastructure")));
|
||||
.put(
|
||||
"description",
|
||||
new ArrayList<>(
|
||||
Collections
|
||||
.singletonList(
|
||||
"This work has been partially supported by DARIAH-EU infrastructure")));
|
||||
param
|
||||
.put(
|
||||
"contributor",
|
||||
new ArrayList<>(
|
||||
Collections
|
||||
.singletonList(
|
||||
"Author X helped to write the paper. X works for DARIAH")));
|
||||
.put(
|
||||
"contributor",
|
||||
new ArrayList<>(
|
||||
Collections
|
||||
.singletonList(
|
||||
"Author X helped to write the paper. X works for DARIAH")));
|
||||
List<String> comm = cc
|
||||
.getCommunityForDatasource(
|
||||
"openaire____::1cfdb2e14977f31a98e0118283401f32", param);
|
||||
.getCommunityForDatasource(
|
||||
"openaire____::1cfdb2e14977f31a98e0118283401f32", param);
|
||||
|
||||
//TODO add more assertions
|
||||
// TODO add more assertions
|
||||
Assertions.assertEquals(0, comm.size());
|
||||
}
|
||||
|
||||
|
|
|
@ -131,37 +131,38 @@ public class IndexRecordTransformerTest {
|
|||
@Test
|
||||
public void testForEOSCFutureSoftwareNotebook() throws IOException, TransformerException {
|
||||
final String record = IOUtils
|
||||
.toString(getClass().getResourceAsStream("eosc-future/software-justthink.xml"));
|
||||
.toString(getClass().getResourceAsStream("eosc-future/software-justthink.xml"));
|
||||
testRecordTransformation(record);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testForEOSCFutureSoftwareNotebookClaim() throws IOException, TransformerException {
|
||||
final String record = IOUtils
|
||||
.toString(getClass().getResourceAsStream("eosc-future/software-justthink-claim.xml"));
|
||||
.toString(getClass().getResourceAsStream("eosc-future/software-justthink-claim.xml"));
|
||||
testRecordTransformation(record);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testForEOSCFutureZenodo7353841() throws IOException, TransformerException {
|
||||
final String record = IOUtils
|
||||
.toString(getClass().getResourceAsStream("eosc-future/zenodo7353841.xml"));
|
||||
.toString(getClass().getResourceAsStream("eosc-future/zenodo7353841.xml"));
|
||||
testRecordTransformation(record);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testForEOSCFutureZenodo7351393() throws IOException, TransformerException {
|
||||
final String record = IOUtils
|
||||
.toString(getClass().getResourceAsStream("eosc-future/zenodo7351393.xml"));
|
||||
.toString(getClass().getResourceAsStream("eosc-future/zenodo7351393.xml"));
|
||||
testRecordTransformation(record);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testForEOSCFutureZenodo7351221() throws IOException, TransformerException {
|
||||
final String record = IOUtils
|
||||
.toString(getClass().getResourceAsStream("eosc-future/zenodo7351221.xml"));
|
||||
.toString(getClass().getResourceAsStream("eosc-future/zenodo7351221.xml"));
|
||||
testRecordTransformation(record);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testDoiUrlNormalization() throws MalformedURLException {
|
||||
|
||||
|
|
Loading…
Reference in New Issue