Project

General

Profile

« Previous | Next » 

Revision 56608

[maven-release-plugin] copy for tag uoa-search-3.5.1

View differences:

modules/uoa-search/tags/uoa-search-3.5.1/deploy.info
1
{
2
  "type_source": "SVN", 
3
  "goal": "package -U -T 4C source:jar", 
4
  "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet45/modules/uoa-search/trunk", 
5
  "deploy_repository": "dnet45-snapshots", 
6
  "version": "4", 
7
  "mail": "antleb@di.uoa.gr, kiatrop@di.uoa.gr", 
8
  "deploy_repository_url": "http://maven.research-infrastructures.eu/nexus/content/repositories/dnet45-snapshots", 
9
  "name": "uoa-search"
10
}
modules/uoa-search/tags/uoa-search-3.5.1/src/test/java/eu/dnetlib/data/search/app/plan/CollectionRewriteRuleTest.java
1
package eu.dnetlib.data.search.app.plan;
2

  
3
import eu.dnetlib.domain.functionality.Collection;
4
import eu.dnetlib.utils.cql.CqlException;
5
import gr.uoa.di.driver.enabling.ISLookUp;
6
import org.junit.After;
7
import org.junit.Before;
8
import org.junit.Test;
9

  
10
import static org.mockito.Mockito.mock;
11
import static org.mockito.Mockito.when;
12

  
13
public class CollectionRewriteRuleTest {
14

  
15
	final String field = "colid";
16
	final String value = "foo-col";
17
	final String retrieval = "f = v";
18
	CollectionRewriteRule rule = null;
19

  
20
	@SuppressWarnings("unchecked")
21
	@Before
22
	public void setUp() throws Exception {
23
		rule = new CollectionRewriteRule(null, field);
24
		ISLookUp<Collection> lookup = mock(ISLookUp.class);
25
		Collection collection = mock(Collection.class);
26
		rule.setCollectionLookUp(lookup);
27
		when(collection.getRetrievalCondition()).thenReturn(retrieval);
28
		when(lookup.getById(value)).thenReturn(collection);
29
	}
30

  
31
	@After
32
	public void tearDown() throws Exception {
33
		rule = null;
34
	}
35
	
36
	@Test
37
	public void testApply() throws CqlException {
38
	/*	CqlClause clause = rule.apply(new CqlRelation(field, "=", "\"" + value +  "\""));
39
		assertEquals(Cql.parse(retrieval).getRoot().toCqlString(),
40
				clause.toCqlString());*/
41
	}
42
}
43

  
modules/uoa-search/tags/uoa-search-3.5.1/src/test/java/eu/dnetlib/data/search/app/plan/PrefixRuleTest.java
1
package eu.dnetlib.data.search.app.plan;
2

  
3
import eu.dnetlib.utils.cql.CqlException;
4
import org.junit.After;
5
import org.junit.Before;
6
import org.junit.Test;
7

  
8
public class PrefixRuleTest {
9

  
10
	//Query query = null;
11
	final String text = "foo and bar"; 
12
	
13
	@Before
14
	public void setUp() throws Exception {
15
		//query = new Query(text);
16
	}
17

  
18
	@After
19
	public void tearDown() throws Exception {
20
		//query = null;
21
	}
22

  
23
	@Test
24
	public void testPrefixRule() throws CqlException {
25
		PrefixRule rule = new PrefixRule(null, "baz");
26
	//	query = rule.apply(query);
27
	//	assertEquals("baz AND (" + text + ")", query.getText());
28
	}
29

  
30
	@Test
31
	public void testBadPrefix() {
32
		/*PrefixRule rule = new PrefixRule(null, "a b");
33
		try {
34
			query = rule.apply(query);
35
			fail();
36
			
37
		} catch (CqlException cqle) {
38
			assertEquals(text, query.getText());
39
		}*/
40
	}
41
}
modules/uoa-search/tags/uoa-search-3.5.1/src/test/java/eu/dnetlib/data/search/app/plan/QueryTest.java
1
package eu.dnetlib.data.search.app.plan;
2

  
3
import eu.dnetlib.utils.cql.CqlException;
4
import org.junit.After;
5
import org.junit.Before;
6
import org.junit.Test;
7

  
8
import static org.junit.Assert.assertEquals;
9

  
10
public class QueryTest {
11

  
12
	@Before
13
	public void setUp() throws Exception {
14
	}
15

  
16
	@After
17
	public void tearDown() throws Exception {
18
	}
19

  
20
	@Test
21
	public void testQuery() throws CqlException {
22
		String text = "foo and bar";
23
		Query query = new Query(text);
24
		assertEquals(text, query.getText());
25
		
26
		//CqlQuery cql = query.getCqlQuery();
27
		//assertNotNull(cql);
28
		//assertEquals(cql.toString(), Cql.parse(text).toString());
29
	}
30

  
31
}
modules/uoa-search/tags/uoa-search-3.5.1/src/test/java/eu/dnetlib/data/search/app/plan/web/api/APIResponseFormatterTest.java
1
package eu.dnetlib.data.search.app.plan.web.api;
2

  
3
import eu.dnetlib.data.search.web.api.APIResponseFormatter;
4
import junit.framework.Assert;
5
import org.apache.commons.lang.StringEscapeUtils;
6
import org.apache.log4j.BasicConfigurator;
7
import org.junit.Before;
8
import org.junit.Test;
9
import org.mockito.Mockito;
10

  
11
import javax.servlet.http.HttpServletRequest;
12
import javax.ws.rs.core.MediaType;
13
import java.util.Arrays;
14

  
15
import static org.mockito.Mockito.when;
16

  
17

  
18
/**
19
 * Created by kiatrop on 22/11/2016.
20
 */
21
public class APIResponseFormatterTest {
22
    HttpServletRequest requestMock;
23

  
24
    @Before
25
    public  void before() {
26
        BasicConfigurator.configure();
27
        requestMock = Mockito.mock(HttpServletRequest.class);
28
        when(requestMock.getRequestURL()).thenReturn(new StringBuffer().append("http://demo.url/search"));
29
    }
30

  
31
    @Test
32
    public void createMetaTest() {
33
        //Meta only with query
34
        Assert.assertEquals("{\"status\": \"success\", \"code\":\"200\", \"query\":\"oaftype=result\", \"filters\":[], \"total\":\"0\", \"page\":\"0\", \"size\":\"0\", \"_links\": {\"self\": {\"href\":\"http://demo.url/search?page=0&size=0\"}}}",
35
                APIResponseFormatter.createMeta(requestMock, MediaType.APPLICATION_JSON, "oaftype=result", null, 0, 0, 0));
36

  
37
        Assert.assertEquals("<status>success</status><code>200</code><query>oaftype=result</query><filters></filters><total>0</total><page>0</page><size>0</size><links><self>"
38
                + StringEscapeUtils.escapeXml("http://demo.url/search?page=0&size=0") + "</self></links>",
39
                APIResponseFormatter.createMeta(requestMock, MediaType.APPLICATION_XML, "oaftype=result", null, 0, 0, 0));
40

  
41
        //Meta only with query and filters
42
        Assert.assertEquals("{\"status\": \"success\", \"code\":\"200\", \"query\":\"oaftype=result\", \"filters\":[\"(resultfunderid:ec____::EC)\",\"(resultfundinglevel1:1) (resultfundinglevel1:2)\"], \"total\":\"0\", \"page\":\"0\", \"size\":\"0\", \"_links\": {\"self\": {\"href\":\"http://demo.url/search?page=0&size=0\"}}}",
43
                APIResponseFormatter.createMeta(requestMock, MediaType.APPLICATION_JSON, "oaftype=result", Arrays.asList(new String[]{"(resultfunderid:ec____::EC)", "(resultfundinglevel1:1) (resultfundinglevel1:2)"}), 0, 0, 0));
44

  
45
        Assert.assertEquals("<status>success</status><code>200</code><query>oaftype=result</query><filters><filter>(resultfunderid:ec____::EC)</filter><filter>(resultfundinglevel1:1) (resultfundinglevel1:2)</filter></filters><total>0</total><page>0</page><size>0</size><links><self>" + StringEscapeUtils.escapeXml("http://demo.url/search?page=0&size=0") + "</self></links>",
46
                APIResponseFormatter.createMeta(requestMock, MediaType.APPLICATION_XML, "oaftype=result", Arrays.asList(new String[]{"(resultfunderid:ec____::EC)", "(resultfundinglevel1:1) (resultfundinglevel1:2)"}), 0, 0, 0));
47

  
48
        //Meta with query and paging
49
        Assert.assertEquals("{\"status\": \"success\", \"code\":\"200\", \"query\":\"oaftype=result\", \"filters\":[\"(resultfunderid:ec____::EC)\",\"(resultfundinglevel1:1) (resultfundinglevel1:2)\"], \"total\":\"10\", \"page\":\"1\", \"size\":\"5\", \"_links\": {\"first\": {\"href\":\"http://demo.url/search?page=0&size=5\"},  \"last\": {\"href\":\"http://demo.url/search?page=1&size=5\"},  \"previous\": {\"href\":\"http://demo.url/search?page=0&size=5\"},   \"next\": {\"href\":\"http://demo.url/search?page=1&size=5\"},   \"self\": {\"href\":\"http://demo.url/search?page=1&size=5\"}}}",
50
                APIResponseFormatter.createMeta(requestMock, MediaType.APPLICATION_JSON, "oaftype=result", Arrays.asList(new String[]{"(resultfunderid:ec____::EC)", "(resultfundinglevel1:1) (resultfundinglevel1:2)"}), 10, 1, 5));
51

  
52
        Assert.assertEquals("<status>success</status><code>200</code><query>oaftype=result</query><filters><filter>(resultfunderid:ec____::EC)</filter><filter>(resultfundinglevel1:1) (resultfundinglevel1:2)</filter></filters><total>10</total><page>1</page><size>5</size>" +
53
                "<links><first>" + StringEscapeUtils.escapeXml("http://demo.url/search?page=0&size=5") + "</first><last>" + StringEscapeUtils.escapeXml("http://demo.url/search?page=1&size=5") + "</last><previous>" +
54
                StringEscapeUtils.escapeXml("http://demo.url/search?page=0&size=5") +"</previous><next>" + StringEscapeUtils.escapeXml("http://demo.url/search?page=1&size=5") +
55
                "</next><self>" + StringEscapeUtils.escapeXml("http://demo.url/search?page=1&size=5") +"</self></links>",
56
                APIResponseFormatter.createMeta(requestMock, MediaType.APPLICATION_XML, "oaftype=result", Arrays.asList(new String[]{"(resultfunderid:ec____::EC)", "(resultfundinglevel1:1) (resultfundinglevel1:2)"}), 10, 1, 5));
57

  
58
    }
59

  
60
}
modules/uoa-search/tags/uoa-search-3.5.1/src/test/java/eu/dnetlib/data/search/utils/cql/QueryEnhancerTest.java
1
package eu.dnetlib.data.search.utils.cql;
2

  
3
import org.apache.log4j.BasicConfigurator;
4
import org.junit.Assert;
5
import org.junit.Before;
6
import org.junit.Test;
7

  
8
/**
9
 * Created by kiatrop on 30/11/2016.
10
 */
11
public class QueryEnhancerTest {
12
    String indexfieldName = "indexfieldName";
13
    String fieldvalue = "fieldvalue";
14

  
15
    @Before
16
    public  void before() {
17
        BasicConfigurator.configure();
18
    }
19

  
20
    @Test
21
    public void testExact(){
22
        StringBuilder queryBuilder1 = new StringBuilder();
23
        StringBuilder queryBuilder = new StringBuilder();
24

  
25
        ParameterQueryEnhancer.addExactQueryTerm(indexfieldName, fieldvalue, queryBuilder1);
26
        CQLQueryBuilder.appendFieldQuotedTerm(queryBuilder, CQLQueryBuilder.Operator.AND, indexfieldName, CQLQueryBuilder.Operator.EXACT, fieldvalue);
27

  
28
        Assert.assertEquals(queryBuilder1.toString(), queryBuilder.toString());
29
    }
30

  
31
    @Test
32
    public void testEqual(){
33
        StringBuilder queryBuilder1 = new StringBuilder();
34
        StringBuilder queryBuilder2 = new StringBuilder();
35

  
36
        ParameterQueryEnhancer.addEqualQueryTerm(indexfieldName, fieldvalue, queryBuilder1);
37
        CQLQueryBuilder.appendFieldQuotedTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, indexfieldName, CQLQueryBuilder.Operator.EQUAL, fieldvalue);
38

  
39
        Assert.assertEquals(queryBuilder1.toString(), queryBuilder2.toString());
40
    }
41

  
42
    @Test
43
    public void testNotEqual(){
44
        StringBuilder queryBuilder1 = new StringBuilder();
45
        StringBuilder queryBuilder2 = new StringBuilder();
46

  
47
        ParameterQueryEnhancer.addNotEqualQueryTerm(indexfieldName, fieldvalue, queryBuilder1);
48
        CQLQueryBuilder.appendFieldQuotedTerm(queryBuilder2, CQLQueryBuilder.Operator.NOT, indexfieldName, CQLQueryBuilder.Operator.EQUAL, fieldvalue);
49

  
50
        Assert.assertEquals(queryBuilder1.toString(), queryBuilder2.toString());
51
    }
52

  
53
    @Test
54
    public void testDifferentEqual(){
55
        StringBuilder queryBuilder1 = new StringBuilder();
56
        StringBuilder queryBuilder2 = new StringBuilder();
57

  
58
        ParameterQueryEnhancer.addDifferentQueryTerm(indexfieldName, fieldvalue, queryBuilder1);
59
        CQLQueryBuilder.appendFieldQuotedTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, indexfieldName, CQLQueryBuilder.Operator.NOTEQUAL, fieldvalue);
60

  
61
        Assert.assertEquals(queryBuilder1.toString(), queryBuilder2.toString());
62
    }
63

  
64
    @Test
65
    public void testKeywords() {
66
        StringBuilder queryBuilder1 = new StringBuilder();
67
        StringBuilder queryBuilder2 = new StringBuilder();
68

  
69
        CQLQueryBuilder.appendKeywords(queryBuilder1, "keywords");
70
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "keywords");
71

  
72
        Assert.assertEquals(queryBuilder1.toString(), queryBuilder2.toString());
73
    }
74

  
75
    @Test
76
    public void appendKeywordsTest() {
77
        StringBuilder queryBuilder1 = new StringBuilder();
78
        StringBuilder queryBuilder2 = new StringBuilder();
79

  
80
        //keyword1 and (__all exact "quoted term")
81
        CQLQueryBuilder.appendKeywords(queryBuilder1, "keyword1 \"quoted term\"");
82
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.NONE, "keyword1");
83
        CQLQueryBuilder.appendSimpleQuotedTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "\"quoted term\"");
84
        Assert.assertEquals(queryBuilder2.toString(), queryBuilder1.toString());
85

  
86
        //keyword1 and wrong and quoted and term
87
        queryBuilder1 = new StringBuilder();
88
        queryBuilder2 = new StringBuilder();
89
        CQLQueryBuilder.appendKeywords(queryBuilder1, "keyword1 \"wrong quoted term");
90
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.NONE, "keyword1");
91
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "wrong");
92
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "quoted");
93
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "term");
94
        Assert.assertEquals(queryBuilder2.toString(), queryBuilder1.toString());
95

  
96
        //keyword1 and wrong and quoted and term
97
        queryBuilder1 = new StringBuilder();
98
        queryBuilder2 = new StringBuilder();
99
        CQLQueryBuilder.appendKeywords(queryBuilder1, "keyword1 wrong quoted term\"");
100
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.NONE, "keyword1");
101
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "wrong");
102
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "quoted");
103
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "term");
104
        Assert.assertEquals(queryBuilder2.toString(), queryBuilder1.toString());
105

  
106
        //(__all exact "quoted term")
107
        queryBuilder1 = new StringBuilder();
108
        queryBuilder2 = new StringBuilder();
109
        CQLQueryBuilder.appendKeywords(queryBuilder1, "\"quoted term\"");
110
        CQLQueryBuilder.appendSimpleQuotedTerm(queryBuilder2, CQLQueryBuilder.Operator.NONE, "\"quoted term\"");
111
        Assert.assertEquals(queryBuilder2.toString(), queryBuilder1.toString());
112

  
113
        //
114
        queryBuilder1 = new StringBuilder();
115
        queryBuilder2 = new StringBuilder();
116
        CQLQueryBuilder.appendKeywords(queryBuilder1, "");
117
        Assert.assertEquals(queryBuilder2.toString(), queryBuilder1.toString());
118

  
119
        //
120
        queryBuilder1 = new StringBuilder();
121
        queryBuilder2 = new StringBuilder();
122
        CQLQueryBuilder.appendKeywords(queryBuilder1, null);
123
        Assert.assertEquals(queryBuilder2.toString(), queryBuilder1.toString());
124

  
125

  
126
        //existing_query and keyword1 and wrong and quoted and term
127
        queryBuilder1 = new StringBuilder();
128
        queryBuilder2 = new StringBuilder();
129
        queryBuilder1.append("existing_query");
130
        queryBuilder2.append("existing_query");
131
        CQLQueryBuilder.appendKeywords(queryBuilder1, "keyword1 \"wrong quoted term");
132
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "keyword1");
133
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "wrong");
134
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "quoted");
135
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "term");
136
        Assert.assertEquals(queryBuilder2.toString(), queryBuilder1.toString());
137

  
138
        queryBuilder2 = new StringBuilder();
139

  
140
        //existing_query and keyword1 and (__all exact "quoted term")
141
        queryBuilder1 = new StringBuilder();
142
        queryBuilder1.append("existing_query");
143
        CQLQueryBuilder.appendKeywords(queryBuilder1, "keyword1 \"quoted term\"");
144
        Assert.assertEquals(queryBuilder1.toString(), "existing_query and (keyword1) and (__all exact \"quoted term\")" );
145

  
146
        //existing_query and (__all exact "quoted term")
147
        queryBuilder1 = new StringBuilder();
148
        queryBuilder1.append("existing_query");
149
        CQLQueryBuilder.appendKeywords(queryBuilder1, "keyword1 \"quoted term\"");
150
        Assert.assertEquals(queryBuilder1.toString(), "existing_query and (keyword1) and (__all exact \"quoted term\")");
151

  
152
        //existing query
153
        queryBuilder1 = new StringBuilder();
154
        queryBuilder1.append("existing_query");
155
        CQLQueryBuilder.appendKeywords(queryBuilder1, "");
156
        Assert.assertEquals(queryBuilder1.toString(), "existing_query");
157

  
158
        //existing query
159
        queryBuilder1 = new StringBuilder();
160
        queryBuilder1.append("existing_query");
161
        CQLQueryBuilder.appendKeywords(queryBuilder1, null);
162
        Assert.assertEquals(queryBuilder1.toString(), "existing_query");
163

  
164
    }
165
}
modules/uoa-search/tags/uoa-search-3.5.1/src/test/java/eu/dnetlib/data/search/utils/solr/SolrUtilsTest.java
1
package eu.dnetlib.data.search.utils.solr;
2

  
3
import eu.dnetlib.data.search.app.SearchServiceImpl;
4
import eu.dnetlib.data.search.solr.SolrResultSet;
5
import eu.dnetlib.data.search.web.api.SearchApiService;
6
import eu.dnetlib.data.search.web.utils.RequestResponseHandler;
7
import eu.dnetlib.functionality.cql.CqlTranslator;
8
import eu.dnetlib.functionality.cql.CqlTranslatorImpl;
9
import org.apache.log4j.BasicConfigurator;
10
import org.apache.solr.client.solrj.impl.CloudSolrClient;
11
import org.apache.solr.common.util.NamedList;
12
import org.junit.Assert;
13
import org.junit.Before;
14
import org.junit.Test;
15
import org.mockito.Mockito;
16
import org.z3950.zing.cql.CQLParseException;
17

  
18
import javax.servlet.http.HttpServletRequest;
19
import java.io.IOException;
20
import java.util.ArrayList;
21
import java.util.Arrays;
22
import java.util.List;
23

  
24
import static org.mockito.Matchers.anyString;
25
import static org.mockito.Mockito.doNothing;
26

  
27

  
28
/**
29
 * Created by kiatrop on 9/11/2016.
30
 */
31
public class SolrUtilsTest {
32

  
33
    private org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(SearchApiService.class);
34

  
35
    HttpServletRequest requestMock;
36
    RequestResponseHandler.Entity entity;
37
    List<String> refineFields = new ArrayList<String>();
38
    List<String> fieldQueries = new ArrayList<String>();
39
    List<String> fieldQueriesWithComma = new ArrayList<String>();
40
    CloudSolrClient mockSolrClient;
41
    SolrResultSet mockRS;
42

  
43
    @Before
44
    public  void before() {
45
        BasicConfigurator.configure();
46
        mockSolrClient = Mockito.mock(CloudSolrClient.class);
47
        doNothing().when(mockSolrClient).setDefaultCollection(anyString());
48

  
49
        mockRS = Mockito.mock(SolrResultSet.class);
50

  
51
        refineFields = Arrays.asList(new String[]{"relfunderid", "relfundinglevel0_id", "relfundinglevel1_id", "relfundinglevel2_id"});
52

  
53
        fieldQueries = Arrays.asList(new String[]{"(relfunderid exact ec___::EC) and (relfunderid exact wt___::WT)",
54
                "relfundinglevel0_id exact ec___::EC::SP1" , "(relfundinglevel1_id exact ec___::EC::SP1::VALUE1) or (relfundinglevel1_id exact ec___::EC::SP1::VALUE2)"});
55

  
56
        fieldQueriesWithComma = Arrays.asList(new String[]{"(relfunderid exact ec___::EC) and (relfunderid exact wt___::WT)",
57
                "relfundinglevel0_id exact \"ec___::EC::SP1,ec___::EC::SP2\"" });
58

  
59
    }
60

  
61

  
62
    @Test
63
    public void createEprQuery() {
64
        String query = SearchServiceImpl.createEprQuery("(oaftype=result)", refineFields, fieldQueries);
65
        Assert.assertEquals("query=(oaftype=result)" +
66
                "&groupby=relfunderid,relfundinglevel0_id,relfundinglevel1_id,relfundinglevel2_id" +
67
                "&fq=(relfunderid exact ec___::EC) and (relfunderid exact wt___::WT),relfundinglevel0_id exact ec___::EC::SP1," +
68
                        "(relfundinglevel1_id exact ec___::EC::SP1::VALUE1) or (relfundinglevel1_id exact ec___::EC::SP1::VALUE2)", query);
69

  
70

  
71
        //empty refine, empty fq
72
        query = SearchServiceImpl.createEprQuery("(oaftype=result)", new ArrayList<String>(), new ArrayList<String>());
73
        Assert.assertEquals("query=(oaftype=result)" +
74
                "&groupby=" +
75
                "&fq=", query);
76

  
77
        //empty fq
78
        query = SearchServiceImpl.createEprQuery("(oaftype=result)", refineFields, new ArrayList<String>());
79
        Assert.assertEquals("query=(oaftype=result)" +
80
                "&groupby=relfunderid,relfundinglevel0_id,relfundinglevel1_id,relfundinglevel2_id" +
81
                "&fq=", query);
82

  
83
        //empty refine
84
        query = SearchServiceImpl.createEprQuery("(oaftype=result)", new ArrayList<String>(), fieldQueries);
85
        Assert.assertEquals("query=(oaftype=result)" +
86
                "&groupby=" +
87
                "&fq=(relfunderid exact ec___::EC) and (relfunderid exact wt___::WT),relfundinglevel0_id exact ec___::EC::SP1," +
88
                "(relfundinglevel1_id exact ec___::EC::SP1::VALUE1) or (relfundinglevel1_id exact ec___::EC::SP1::VALUE2)", query);
89

  
90
        //empty query
91
        query = SearchServiceImpl.createEprQuery("", new ArrayList<String>(), new ArrayList<String>());
92
        Assert.assertEquals("query=" +
93
                "&groupby=" +
94
                "&fq=", query);
95

  
96
        //null values
97
        query = SearchServiceImpl.createEprQuery(null, null, null);
98
        Assert.assertEquals("query=" +
99
                "&groupby=" +
100
                "&fq=", query);
101

  
102
    }
103

  
104
    @Test
105
    public void extractQueryOptions() throws IOException, CQLParseException {
106
        CqlTranslator cqlTranslator = new CqlTranslatorImpl();
107

  
108
        NamedList<String> actual = SolrResultSetOptionsUtil.extractQueryOptions(SearchServiceImpl.createEprQuery("(oaftype=result)", refineFields, fieldQueries));
109
        Assert.assertEquals(cqlTranslator.toLucene("(oaftype=result)"), actual.get("q"));
110
        Assert.assertEquals("__result", actual.get("fl"));
111
        Assert.assertEquals("true", actual.get("shards.tolerant"));
112
        Assert.assertEquals("true", actual.get("facet"));
113
        Assert.assertEquals("1", actual.get("facet.mincount"));
114
        Assert.assertEquals(refineFields.size() + "", actual.get("facet.threads"));
115
        Assert.assertEquals(refineFields.size(), actual.getAll("facet.field").size());
116
        Assert.assertTrue(actual.getAll("facet.field").contains("relfunderid"));
117
        Assert.assertTrue(actual.getAll("facet.field").contains("relfundinglevel1_id"));
118
        Assert.assertTrue(actual.getAll("facet.field").contains("relfundinglevel2_id"));
119
        Assert.assertFalse(actual.getAll("facet.field").contains("relfundinglevel3_id"));
120
        Assert.assertEquals(fieldQueries.size(), actual.getAll("fq").size());
121
        Assert.assertTrue(actual.getAll("fq").contains(cqlTranslator.toLucene("(relfunderid exact ec___::EC) and (relfunderid exact wt___::WT)")));
122
        Assert.assertTrue(actual.getAll("fq").contains(cqlTranslator.toLucene("relfundinglevel0_id exact ec___::EC::SP1")));
123
        Assert.assertTrue(actual.getAll("fq").contains(cqlTranslator.toLucene("(relfundinglevel1_id exact ec___::EC::SP1::VALUE1) or (relfundinglevel1_id exact ec___::EC::SP1::VALUE2)")));
124

  
125
        actual = SolrResultSetOptionsUtil.extractQueryOptions(SearchServiceImpl.createEprQuery("(oaftype=result)", refineFields, fieldQueriesWithComma));
126
        Assert.assertTrue(actual.getAll("fq").contains(cqlTranslator.toLucene("(relfunderid exact ec___::EC) and (relfunderid exact wt___::WT)")));
127
        Assert.assertTrue(actual.getAll("fq").contains(cqlTranslator.toLucene("relfundinglevel0_id exact \"ec___::EC::SP1,ec___::EC::SP2\"")));
128

  
129
        //empty refine, empty fq
130
        actual = SolrResultSetOptionsUtil.extractQueryOptions(SearchServiceImpl.createEprQuery("(oaftype=result)", new ArrayList<String>(), new ArrayList<String>()));
131
        Assert.assertEquals(cqlTranslator.toLucene("(oaftype=result)"), actual.get("q"));
132
        Assert.assertEquals("__result", actual.get("fl"));
133
        Assert.assertNull(actual.get("q.op"));
134
        Assert.assertEquals("true", actual.get("shards.tolerant"));
135
        Assert.assertNull(actual.get("facet"));
136
        Assert.assertNull(actual.get("facet.mincount"));
137
        Assert.assertNull(actual.get("facet.threads"));
138
        Assert.assertNull(actual.get("facet.field"));
139
        Assert.assertTrue(actual.getAll("facet.field").isEmpty());
140
        Assert.assertNull(actual.get("fq"));
141
        Assert.assertTrue(actual.getAll("fq").isEmpty());
142

  
143
        //empty fq
144
        actual = SolrResultSetOptionsUtil.extractQueryOptions(SearchServiceImpl.createEprQuery("(oaftype=result)", refineFields, new ArrayList<String>()));
145
        Assert.assertEquals(cqlTranslator.toLucene("(oaftype=result)"), actual.get("q"));
146
        Assert.assertEquals("__result", actual.get("fl"));
147
        Assert.assertNull(actual.get("q.op"));
148
        Assert.assertEquals("true", actual.get("shards.tolerant"));
149
        Assert.assertEquals("true", actual.get("facet"));
150
        Assert.assertEquals("1", actual.get("facet.mincount"));
151
        Assert.assertEquals(refineFields.size() + "", actual.get("facet.threads"));
152
        Assert.assertEquals(refineFields.size(), actual.getAll("facet.field").size());
153
        Assert.assertTrue(actual.getAll("facet.field").contains("relfunderid"));
154
        Assert.assertTrue(actual.getAll("facet.field").contains("relfundinglevel1_id"));
155
        Assert.assertTrue(actual.getAll("facet.field").contains("relfundinglevel2_id"));
156
        Assert.assertFalse(actual.getAll("facet.field").contains("relfundinglevel3_id"));
157
        Assert.assertNull(actual.get("fq"));
158
        Assert.assertTrue(actual.getAll("fq").isEmpty());
159

  
160
        //null fq
161
        actual = SolrResultSetOptionsUtil.extractQueryOptions(SearchServiceImpl.createEprQuery("(oaftype=result)", refineFields, null));
162
        Assert.assertEquals(cqlTranslator.toLucene("(oaftype=result)"), actual.get("q"));
163
        Assert.assertEquals("__result", actual.get("fl"));
164
        Assert.assertNull(actual.get("q.op"));
165
        Assert.assertEquals("true", actual.get("shards.tolerant"));
166
        Assert.assertEquals("true", actual.get("facet"));
167
        Assert.assertEquals("1", actual.get("facet.mincount"));
168
        Assert.assertEquals(refineFields.size() + "", actual.get("facet.threads"));
169
        Assert.assertEquals(refineFields.size(), actual.getAll("facet.field").size());
170
        Assert.assertTrue(actual.getAll("facet.field").contains("relfunderid"));
171
        Assert.assertTrue(actual.getAll("facet.field").contains("relfundinglevel1_id"));
172
        Assert.assertTrue(actual.getAll("facet.field").contains("relfundinglevel2_id"));
173
        Assert.assertFalse(actual.getAll("facet.field").contains("relfundinglevel3_id"));
174
        Assert.assertNull(actual.get("fq"));
175
        Assert.assertTrue(actual.getAll("fq").isEmpty());
176

  
177
        //empty refine
178
        actual = SolrResultSetOptionsUtil.extractQueryOptions(SearchServiceImpl.createEprQuery("(oaftype=result)", new ArrayList<String>(), fieldQueries));
179
        Assert.assertEquals(cqlTranslator.toLucene("(oaftype=result)"), actual.get("q"));
180
        Assert.assertEquals("__result", actual.get("fl"));
181
//        Assert.assertEquals("AND", actual.get("q.op"));
182
        Assert.assertEquals("true", actual.get("shards.tolerant"));
183
        Assert.assertNull(actual.get("facet"));
184
        Assert.assertNull(actual.get("facet.mincount"));
185
        Assert.assertNull(actual.get("facet.threads"));
186
        Assert.assertNull(actual.get("facet.field"));
187
        Assert.assertTrue(actual.getAll("facet.field").isEmpty());
188
        Assert.assertEquals(fieldQueries.size(), actual.getAll("fq").size());
189
        Assert.assertTrue(actual.getAll("fq").contains(cqlTranslator.toLucene("(relfunderid exact ec___::EC) and (relfunderid exact wt___::WT)")));
190
        Assert.assertTrue(actual.getAll("fq").contains(cqlTranslator.toLucene("relfundinglevel0_id exact ec___::EC::SP1")));
191
        Assert.assertTrue(actual.getAll("fq").contains(cqlTranslator.toLucene("(relfundinglevel1_id exact ec___::EC::SP1::VALUE1) or (relfundinglevel1_id exact ec___::EC::SP1::VALUE2)")));
192

  
193
        //null refine
194
        actual = SolrResultSetOptionsUtil.extractQueryOptions(SearchServiceImpl.createEprQuery("(oaftype=result)", null, fieldQueries));
195
        Assert.assertEquals(cqlTranslator.toLucene("(oaftype=result)"), actual.get("q"));
196
        Assert.assertEquals("__result", actual.get("fl"));
197
  //      Assert.assertEquals("AND", actual.get("q.op"));
198
        Assert.assertEquals("true", actual.get("shards.tolerant"));
199
        Assert.assertNull(actual.get("facet"));
200
        Assert.assertNull(actual.get("facet.mincount"));
201
        Assert.assertNull(actual.get("facet.threads"));
202
        Assert.assertNull(actual.get("facet.field"));
203
        Assert.assertTrue(actual.getAll("facet.field").isEmpty());
204
        Assert.assertEquals(fieldQueries.size(), actual.getAll("fq").size());
205
        Assert.assertTrue(actual.getAll("fq").contains(cqlTranslator.toLucene(("(relfunderid exact ec___::EC) and (relfunderid exact wt___::WT)"))));
206
        Assert.assertTrue(actual.getAll("fq").contains(cqlTranslator.toLucene("relfundinglevel0_id exact ec___::EC::SP1")));
207
        Assert.assertTrue(actual.getAll("fq").contains(cqlTranslator.toLucene("(relfundinglevel1_id exact ec___::EC::SP1::VALUE1) or (relfundinglevel1_id exact ec___::EC::SP1::VALUE2)")));
208

  
209
        //null refine, null fq
210
        actual = SolrResultSetOptionsUtil.extractQueryOptions(SearchServiceImpl.createEprQuery("(oaftype=result)", null, null));
211
        Assert.assertEquals(cqlTranslator.toLucene("(oaftype=result)"), actual.get("q"));
212
        Assert.assertEquals("__result", actual.get("fl"));
213
        Assert.assertNull(actual.get("q.op"));
214
        Assert.assertEquals("true", actual.get("shards.tolerant"));
215
        Assert.assertNull(actual.get("facet"));
216
        Assert.assertNull(actual.get("facet.mincount"));
217
        Assert.assertNull(actual.get("facet.threads"));
218
        Assert.assertNull(actual.get("facet.field"));
219
        Assert.assertTrue(actual.getAll("facet.field").isEmpty());
220
        Assert.assertNull(actual.get("fq"));
221
        Assert.assertTrue(actual.getAll("fq").isEmpty());
222
    }
223

  
224
    @Test(expected=CQLParseException.class)
225
    public void extractQueryOptionsEmptyQuery() throws IOException, CQLParseException {
226
        NamedList<String> actual  = SolrResultSetOptionsUtil.extractQueryOptions(SearchServiceImpl.createEprQuery(null, null, null));
227
    }
228

  
229
}
modules/uoa-search/tags/uoa-search-3.5.1/src/test/java/eu/dnetlib/data/search/SSTest.java
1
package eu.dnetlib.data.search;
2

  
3
/**
4
 * Created by kiatrop on 2/12/2016.
5
 */
6
public class SSTest {
7

  
8
/*    SearchServiceImpl ss = new SearchServiceImpl();
9
    ServiceLocator<IndexService> mockIndexServiceServiceLocator = mock(ServiceLocator.class);
10
    SolrIndexClient mockIndexService = mock(SolrIndexClient.class);
11

  
12
    @Before
13
    public void setup() {
14
        BasicConfigurator.configure();
15

  
16
        System.out.println(ss.getIndexLocator());
17
        //when(ss.getIndexLocator()).thenReturn(mockIndexServiceServiceLocator);
18
        when(mockIndexServiceServiceLocator.getService()).thenReturn(mockIndexService);
19
        ss.setIndexLocator(mockIndexServiceServiceLocator);
20
        //doNothing().when(((SearchServiceImpl) ss).getIndexLocator().getService());
21

  
22
    }
23

  
24
    @Test
25
    public void test() throws SearchServiceException {
26
        ss.search("oaftype=result", null, "", 1,1);
27
    }
28
*/
29
}
modules/uoa-search/tags/uoa-search-3.5.1/src/test/java/eu/dnetlib/data/search/transform/FormatterTest.java
1
package eu.dnetlib.data.search.transform;
2

  
3
import eu.dnetlib.data.search.transform.formatter.SimpleFormatter;
4
import org.apache.log4j.BasicConfigurator;
5
import org.junit.Before;
6
import org.junit.Test;
7

  
8
import java.io.IOException;
9
import java.util.ArrayList;
10
import java.util.Locale;
11

  
12
public class FormatterTest {
13
	@Before
14
	public void setup() throws IOException {
15
		BasicConfigurator.configure();
16
	}
17
	@Test
18
	public void TestFormatter() throws Exception{
19
		
20
		String per1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <record xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\" xmlns:oaf=\"http://namespace.openaire.eu/oaf\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" type=\"person\">    <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_E._Egecioglu\" label=\"personId\" indexId=\"dri:objIdentifier\"/>    <field name=\"fullname\" multiplicity=\"false\" value=\"E. Egecioglu\" label=\"Fullname\" indexId=\"\"/>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_K._P._Skibicka\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"K. P. Skibicka\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_E._Hrabovszky\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"E. Hrabovszky\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_Z._Liposits\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"Z. Liposits\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_J._A._Engel\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"J. A. Engel\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_E._Jerlhag\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"E. Jerlhag\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_C._S._Molnar\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"C. S. Molnar\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_S._L._Dickson\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"S. L. Dickson\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_M._Alvarez-Crespo\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"M. Alvarez-Crespo\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_C._Hansson\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"C. Hansson\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"result\">       <field name=\"resultId\" multiplicity=\"false\" value=\"WOS:000285231000019\" label=\"resultId\" indexId=\"\"/>       <field name=\"title\" multiplicity=\"true\" value=\"BLOCKADE OF CENTRAL NICOTINE ACETYLCHOLINE RECEPTOR SIGNALING ATTENUATE GHRELIN-INDUCED FOOD INTAKE IN RODENTS\" label=\"Title\" indexId=\"\"/>       <field name=\"publicationYear\" multiplicity=\"false\" value=\"2010\" label=\"Publication Year\" indexId=\"\"/>    </field> </record>";
21
		
22
		String per2 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <record xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\" xmlns:oaf=\"http://namespace.openaire.eu/oaf\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" type=\"person\">    <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_E._Egecioglu\" label=\"personId\" indexId=\"dri:objIdentifier\"/>    <field name=\"fullname\" multiplicity=\"false\" value=\"E. Egecioglu\" label=\"Fullname\" indexId=\"\"/>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_K._P._Skibicka\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"K. P. Skibicka\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_E._Hrabovszky\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"E. Hrabovszky\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_Z._Liposits\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"Z. Liposits\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_J._A._Engel\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"J. A. Engel\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_E._Jerlhag\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"E. Jerlhag\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_C._S._Molnar\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"C. S. Molnar\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_S._L._Dickson\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"S. L. Dickson\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_M._Alvarez-Crespo\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"M. Alvarez-Crespo\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_C._Hansson\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"C. Hansson\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"result\">       <field name=\"resultId\" multiplicity=\"false\" value=\"WOS:000285231000019\" label=\"resultId\" indexId=\"\"/>       <field name=\"title\" multiplicity=\"true\" value=\"BLOCKADE OF CENTRAL NICOTINE ACETYLCHOLINE RECEPTOR SIGNALING ATTENUATE GHRELIN-INDUCED FOOD INTAKE IN RODENTS\" label=\"Title\" indexId=\"\"/>       <field name=\"publicationYear\" multiplicity=\"false\" value=\"2010\" label=\"Publication Year\" indexId=\"\"/>    </field> </record>";
23
		
24
		String per3 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <record xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\" xmlns:oaf=\"http://namespace.openaire.eu/oaf\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" type=\"person\">    <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_E._Egecioglu\" label=\"personId\" indexId=\"dri:objIdentifier\"/>    <field name=\"fullname\" multiplicity=\"false\" value=\"E. Egecioglu\" label=\"Fullname\" indexId=\"\"/>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_K._P._Skibicka\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"K. P. Skibicka\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_E._Hrabovszky\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"E. Hrabovszky\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_Z._Liposits\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"Z. Liposits\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_J._A._Engel\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"J. A. Engel\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_E._Jerlhag\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"E. Jerlhag\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_C._S._Molnar\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"C. S. Molnar\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_S._L._Dickson\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"S. L. Dickson\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_M._Alvarez-Crespo\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"M. Alvarez-Crespo\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_C._Hansson\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"C. Hansson\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"result\">       <field name=\"resultId\" multiplicity=\"false\" value=\"WOS:000285231000019\" label=\"resultId\" indexId=\"\"/>       <field name=\"title\" multiplicity=\"true\" value=\"BLOCKADE OF CENTRAL NICOTINE ACETYLCHOLINE RECEPTOR SIGNALING ATTENUATE GHRELIN-INDUCED FOOD INTAKE IN RODENTS\" label=\"Title\" indexId=\"\"/>       <field name=\"publicationYear\" multiplicity=\"false\" value=\"2010\" label=\"Publication Year\" indexId=\"\"/>    </field> </record>";
25
		
26
		String output = null;
27
		Locale locale = new Locale("en");
28
		
29
		ArrayList<String> initResults = new ArrayList<String>();
30
		ArrayList<String> cleanResults = new ArrayList<String>();
31
		
32
		initResults.add(per1);
33
		initResults.add(per2);
34
		initResults.add(per3);
35
		
36
		SimpleFormatter formatter = new SimpleFormatter(); 
37

  
38
		cleanResults = (ArrayList<String>) formatter.clearDeclarations(initResults);
39
		System.out.println(initResults.toString());
40
		
41
	}
42
}
modules/uoa-search/tags/uoa-search-3.5.1/src/test/java/eu/dnetlib/data/search/transform/ConfigurationTest.java
1
package eu.dnetlib.data.search.transform;
2

  
3
import eu.dnetlib.data.search.transform.config.ConfigurationFactoryException;
4
import org.junit.Before;
5
import org.junit.Test;
6

  
7
import javax.xml.xpath.XPathExpressionException;
8
import java.io.IOException;
9

  
10

  
11

  
12
public class ConfigurationTest {
13
	
14
	@Before
15
	public void setup() throws IOException {
16
		
17
	}
18
	
19
	@Test
20
	public void testParse() throws XPathExpressionException, IOException, ConfigurationFactoryException {
21
//		ConfigurationFactory factory = new ConfigurationFactory();
22
//		factory.setConfigurationName("configuration.xml");
23
//		factory.createConfiguration("config");
24
//		
25
//		Configuration configuration = factory.createConfiguration("testConfig");
26
//		assertEquals("testConfig", configuration.getConfigurationName());
27
//		
28
//		assertEquals(new Locale("en","US"), configuration.getDefaultLocale());
29
//		
30
//		assertEquals(3, configuration.getVocabulariesMap().keySet().size());
31
//		assertNotNull(configuration.getVocabulariesMap().get("languages"));
32
//		
33
//		assertEquals(configuration.getLocales().size(), configuration.getVocabulariesMap().get("languages").keySet().size());
34
//		
35
//		for (Locale locale: configuration.getLocales()) {
36
//			assertEquals("src/main/eu/dnetlib/data/search/transform/xmls/"+"languages"+"_"+locale+".xml", 
37
//					configuration.getVocabulariesMap().get("languages").get(locale));
38
//		}
39
	}
40
}
modules/uoa-search/tags/uoa-search-3.5.1/src/test/java/eu/dnetlib/data/search/transform/VocabularyTest.java
1
package eu.dnetlib.data.search.transform;
2

  
3
import eu.dnetlib.api.data.SearchService;
4
import eu.dnetlib.api.data.SearchServiceException;
5
import gr.uoa.di.driver.enabling.vocabulary.ISVocabularyLoader;
6
import gr.uoa.di.driver.util.StaticServiceLocator;
7
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
8
import org.junit.Before;
9
import org.junit.Ignore;
10
import org.junit.Test;
11

  
12
import javax.xml.bind.JAXBException;
13
import javax.xml.transform.TransformerException;
14
import javax.xml.transform.TransformerFactoryConfigurationError;
15
import java.io.IOException;
16

  
17
public class VocabularyTest {
18

  
19
	private static String registryAddress = "http://node1.t.openaire.research-infrastructures.eu:8280/is/services/isRegistry";
20
	private static String lookupAddress = "http://node1.t.openaire.research-infrastructures.eu:8280/is/services/isLookUp";
21

  
22
    private static String searchAddress = "http://services.openaire.eu:8380/search/services/searchWebService/search";
23

  
24
	private ISVocabularyLoader loader;
25
	
26
	@Before
27
	public void setup() throws JAXBException, SearchServiceException {
28
		JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
29
        factory.setServiceClass(SearchService.class);
30
        factory.setAddress(searchAddress);
31
        SearchService searchService  = (SearchService) factory.create();
32

  
33
        StaticServiceLocator<SearchService> searchServiceStaticServiceLocator = new StaticServiceLocator<eu.dnetlib.api.data.SearchService>();
34
        searchServiceStaticServiceLocator.setService(searchService);
35

  
36

  
37
    //    searchServiceStaticServiceLocator.getService().search("1", "", "", 1, 1);
38

  
39
    //    searchServiceStaticServiceLocator.getService().search("1", "", "", "", 1, 1);
40
/*		factory.setServiceClass(ISRegistryService.class);
41
		factory.setAddress(registryAddress);
42
		ISRegistryService registryEndpoint = (ISRegistryService) factory
43
				.create();
44

  
45
		factory = new JaxWsProxyFactoryBean();
46
		factory.setServiceClass(ISLookUpService.class);
47
		factory.setAddress(lookupAddress);
48
		ISLookUpService lookupEndpoint = (ISLookUpService) factory.create();
49

  
50
		ISRegistryClient registryClient = new ISRegistryClient();
51
		registryClient.setIsRegistry(registryEndpoint);
52

  
53
		ISLookUpClient lookupClient = new ISLookUpClient();
54
		lookupClient.setIsLookUp(lookupClient);
55
		StaticServiceLocator<eu.dnetlib.api.enabling.ISLookUpService> lookupLocator = new StaticServiceLocator<eu.dnetlib.api.enabling.ISLookUpService>();
56
		lookupLocator.setService(lookupClient);
57

  
58
		ISLookUpImpl<Vocabulary> islookup = new ISLookUpImpl<Vocabulary>();*/
59
//		islookup.setConverter(new VocabularyXmlConverter());
60
//		islookup.setLookupLocator(lookupLocator);
61
//		loader = new ISVocabularyLoader();
62
//		loader.setLookUp(islookup);
63
	}
64

  
65
    @Test
66
    public void testaki(){
67

  
68
    }
69

  
70
	public static String donothing(){
71
		return registryAddress;
72
	}
73
	
74
	@Ignore
75
	@Test
76
	public void test() throws IOException, TransformerFactoryConfigurationError, TransformerException {
77
//		
78
//		Vocabulary v = loader.getVocabulary("Names of languages", new Locale("en") ,Locale.ROOT);
79
//		//System.out.println(v.getEnglishNames());
80
//		HashMap hm = new HashMap<String, Vocabulary>();
81
//		hm.put("languages", v);
82
//		TestVocabRegistry vr = new TestVocabRegistry(hm);
83
//		//Vocabulary vl = vr.getVocabulary("languages");
84
//		//System.out.println(vl.getEnglishName("eng"));
85
//		
86
//		//System.out.println(vr.getValue("languages", "eng"));
87
//		
88
//		//VocabularyManager vocabularyManager = new VocabularyManagerImpl();
89
//		
90
//		//Katerina krina = new Katerina();
91
//		//krina.setVocabularyManager(vocabularyManager);
92
//		
93
//		File xmlf = new File("/home/dimitra/saxon6-5-5/katerinatest/lang.xml");
94
//		String xml= FileUtils.readFileToString(xmlf);
95
//		System.out.println("read xml");
96
//		//first xsl		
97
//		File sxslf = new File("/home/dimitra/saxon6-5-5/katerinatest/browse.xsl");
98
//		String sxsl = FileUtils.readFileToString(sxslf);
99
//		javax.xml.transform.Transformer sTransformer = TransformerFactory.newInstance().newTransformer(new StreamSource(new StringReader(sxsl)));
100
//		System.out.println("read sxsl");
101
//		//second xsl
102
//		File jxslf = new File("/home/dimitra/saxon6-5-5/katerinatest/fromvel.xsl");
103
//		String jxsl = FileUtils.readFileToString(jxslf);
104
//		javax.xml.transform.Transformer jTransformer = TransformerFactory.newInstance().newTransformer(new StreamSource(new StringReader(jxsl)));
105
//		System.out.println("read jxsl");
106
//		//are they working?
107
//		StringWriter xmlResultResource = new StringWriter();
108
//		//simple
109
//		StreamResult sts = new StreamResult(xmlResultResource);
110
//	    //xmlResultResource.getBuffer().setLength(0);		
111
//	    //sTransformer.transform(new StreamSource(new StringReader(xml)), sts);
112
//	    //System.out.println("transformed xml: "+xmlResultResource.getBuffer().toString());
113
//	    //System.out.println("first transform: ok");
114
//	    //java
115
//	    StreamResult stj = new StreamResult(xmlResultResource);
116
//	    //xmlResultResource.getBuffer().setLength(0);		
117
//	    //jTransformer.transform(new StreamSource(new StringReader(xml)), stj);
118
//	    //System.out.println("transformed xml: "+xmlResultResource.getBuffer().toString());
119
//	    //System.out.println("second transform: ok");
120
//	    
121
//		
122
//	    long startTime = System.currentTimeMillis();
123
//	    //make 1000 translations with the first way and measure the time
124
//		/*for(int i=0;i<1000;i++){
125
//			xmlResultResource.getBuffer().setLength(0);		
126
//		    sTransformer.transform(new StreamSource(new StringReader(xml)), sts);
127
//		}*/	    
128
//	    long stopTime = System.currentTimeMillis();
129
//	    long elapsedTime = stopTime - startTime;
130
//	    //System.out.println("simple way: "+elapsedTime);		
131
//		//make 1000 translations with the second way and measure the time
132
//	    startTime = System.currentTimeMillis();
133
//	    for(int i=0;i<1000;i++){
134
//			xmlResultResource.getBuffer().setLength(0);		
135
//			jTransformer.transform(new StreamSource(new StringReader(xml)), stj);
136
//	    }
137
//	    stopTime = System.currentTimeMillis();
138
//	    elapsedTime = stopTime - startTime;
139
//	    System.out.println("java way: "+elapsedTime);
140
//	    //Assert.assertEquals("eu.dnetlib.data.search.utils.vοcabulary.VocabularyManagerImpl", "eu.dnetlib.data.search.utils.vocabulary.VocabularyManagerImpl");
141
	}
142
}
modules/uoa-search/tags/uoa-search-3.5.1/src/test/java/eu/dnetlib/data/search/transform/TransformerFactoryTest.java
1
package eu.dnetlib.data.search.transform;
2

  
3
import eu.dnetlib.data.search.transform.config.ConfigurationFactory;
4
import org.apache.log4j.BasicConfigurator;
5
import org.junit.BeforeClass;
6
import org.junit.Test;
7

  
8
import java.io.IOException;
9

  
10

  
11
public class TransformerFactoryTest {
12

  
13
	private static String registryAddress = "http://node1.t.openaire.research-infrastructures.eu:8280/is/services/isRegistry";
14
	private static String lookupAdress = "http://node1.t.openaire.research-infrastructures.eu:8280/is/services/isLookUp";
15
	
16
	@BeforeClass
17
	public static void setup() throws IOException {
18
		BasicConfigurator.configure();
19
		
20
	}
21
	@Test
22
	public void TestTransformerFactory() throws Exception{
23
		ConfigurationFactory factory = new ConfigurationFactory();
24
		/*factory.setConfigurationName("/home/dimitra/projects/uoa-trunk/uoa-search/test/junit/eu/dnetlib/data/search/transform/configuration.xml");
25
		factory.init();
26
		factory.setVocabulariesPath("/home/dimitra/vocabularies/");
27
		Configuration config = factory.createConfiguration("");
28
		SearchRegistry sr = new SearchRegistry();
29
		sr.setConfig(config);*/
30
		
31
		/*LocalVocabularyLoader lvl = new LocalVocabularyLoader();
32
		
33
		
34
		IndexVocabularyLoader ivl = new IndexVocabularyLoader();
35
		ivl.setSearchServiceLocator(new ServiceLocator<SearchService>());
36
		
37
		
38
		VocabularyManagerImpl vocman = new VocabularyManagerImpl();
39
		vocman.setConfig(config);
40
		vocman.setIndexVocabularyLoader(new IndexVocabularyLoader());
41
		
42
		vocman.init();*/
43
		
44
		//ChainTransformer ct = (ChainTransformer)sr.getTransformer("results_openaire", config.getLocales().get(0));
45
		//List<Transformer> all = ct.getTransformers();
46
		
47
		//XsltTransformer tr = (XsltTransformer)all.get(1);
48
		//System.out.println(tr.getXslt());
49
	
50
	}
51
}
modules/uoa-search/tags/uoa-search-3.5.1/src/test/java/eu/dnetlib/data/search/transform/XsltTransformerTest.java
1
package eu.dnetlib.data.search.transform;
2

  
3
import org.apache.log4j.BasicConfigurator;
4
import org.junit.Before;
5
import org.junit.Test;
6

  
7
import java.io.IOException;
8

  
9
public class XsltTransformerTest {
10
	@Before
11
	public void setup() throws IOException {
12
		BasicConfigurator.configure();
13
	}
14
	@Test
15
	public void TestTransformer() throws Exception{
16
		String xslt = "<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"><xsl:output method=\"xml\" indent=\"yes\" encoding=\"UTF-8\"/><xsl:template match=\"/\"><xsl:apply-templates/></xsl:template>";
17
		xslt += "<xsl:template match=\"@*|node()\"><xsl:copy><xsl:apply-templates select=\"@*|node()\"/></xsl:copy></xsl:template></xsl:stylesheet>";
18
		
19
		String input = "<record type=\"result\"><field name=\"resultId\" value=\"WOS:000285231000019\" label=\"resultId\" indexId=\"\"/>";
20
		input += "<field name=\"title\" label=\"Title\" indexId=\"\" value=\"BLOCKADE OF CENTRAL NICOTINE ACETYLCHOLINE RECEPTOR \"/>";
21
		input += "<field name=\"description\" label=\"Description\" indexId=\"\" value=\"Here we sought ...\"/>";
22
		input += "</record>";
23
		
24
		String cur = "";
25
		String prev = "";
26
		
27
		XsltTransformer TR = new XsltTransformer(xslt); 
28

  
29
		long start = System.nanoTime();
30
		
31
		prev = TR.transform(input);
32
		for(int i =2; i<10000;i++) {
33
			cur = TR.transform(input);
34
			if(!cur.equals(prev)) {
35
				System.out.println("Error in "+i+" time");
36
				System.out.println(prev);
37
				System.out.println(cur);
38
				break;
39
			}
40
			prev = cur;				
41
		}
42
		long end = System.nanoTime();
43
		System.out.println(end-start);
44
	}
45
}
modules/uoa-search/tags/uoa-search-3.5.1/src/test/resources/eu/dnetlib/data/search/transform/bibtexConfig.xml
1
<bibTexConfig name="type">
2
	<case value="article" bibTexType="article">
3
		<term bibtexname="author" indexname="dc:creator"/>
4
		<term bibtexname="title" indexname="title"/>
5
		<term bibtexname="journal" indexname="dc:source"/>
6
		<term bibtexname="year" indexname="publicationyear"/>
7
	</case>
8
	<case value="book" bibTexType="book">
9
		<term bibtexname="editor" indexname="dc:creator"/>
10
		<term bibtexname="title" indexname="title"/>
11
		<term bibtexname="publisher" indexname="publisher"/>
12
		<term bibtexname="year" indexname="publicationyear"/>
13
	</case>
14
	<case value="bookPart" bibTexType="incollection">
15
		<term bibtexname="author" indexname="dc:creator"/>
16
		<term bibtexname="title indexname="title"/">
17
		<term bibtexname="booktitle" indexname="source or dc:relation"/>
18
		<term bibtexname="year" indexname="publicationyear"/>
19
	</case>
20
	<case value="conferenceObject" bibTexType="inproceedings">
21
		<term bibtexname="author" indexname="dc:creator"/>
22
		<term bibtexname="title" indexname="title"/>
23
		<term bibtexname="booktitle" indexname="source or dc:relation"/>
24
		<term bibtexname="year" indexname="publicationyear"/>
25
	</case>
26
	<case value="masterThesis" bibTexType="masterthesis">
27
		<term bibtexname="author" indexname="dc:creator"/>
28
		<term bibtexname="title" indexname="title"/>
29
		<term bibtexname="school" indexname="affiliationname"/>
30
		<term bibtexname="year" indexname="publicationyear"/>
31
	</case>
32
	<case value="doctoralThesis" bibTexType="phdthesis">
33
		<term bibtexname="author" indexname="dc:creator"/>
34
		<term bibtexname="title" indexname="title"/>
35
		<term bibtexname="school" indexname="affiliationname"/>
36
		<term bibtexname="year" indexname="publicationyear"/>
37
	</case>
38
	<case value="report" bibTexType="techreport">
39
		<term bibtexname="author" indexname="dc:creator"/>
40
		<term bibtexname="title" indexname="title"/>
41
		<term bibtexname="institution" indexname="affiliationname"/>	
42
	</case>
43
	<defaultcase bibTexType="misc">
44
		<term bibtexname="author" indexname="dc:creator"/>
45
		<term bibtexname="title" indexname="title"/>
46
		<term bibtexname="year" indexname="publicationyear"/>
47
	</case>
48
</bibTexConfig>
49

  
modules/uoa-search/tags/uoa-search-3.5.1/src/test/resources/eu/dnetlib/data/search/transform/configuration.xml
1
<?xml version="1.0" encoding="UTF-8"?> 
2
<configuration>
3
	<locales>
4
		<locale name="en_US" default="true" />
5
		<locale name="fr_FR" default="false" />
6
		<locale name="gr_GR" default="false" />
7
	</locales>
8

  
9
	<vocabularies>
10
	 	<is_vocabulary name="languages" xml_name="Names of Languages" />
11
		<is_vocabulary name="countries" xml_name="Names of Countries" />
12
		<is_vocabulary name="labels" xml_name="Short list of language names" />
13

  
14
		<index_vocabulary name="datasources" query="oaftype=datasource" transformer="datasourceVocabularyTransformer"/>
15
		<index_vocabulary name="projects" query="oaftype=project" transformer="projectVocabularyTransformer"/>
16

  
17
		<local_vocabulary name="funders" file="funders.xml" />
18
		<local_vocabulary name="programmes" file="programmes.xml" />  
19
		<local_vocabulary name="areas" file="areas.xml" />
20
		<local_vocabulary name="compatibility" file="compatibility.xml" />
21
		<local_vocabulary name="accessModes" file="accessmode.xml" />
22
	</vocabularies>
23

  
24
	<transformers>
25
		<transformer name="datasourceVocabularyTransformer">
26
			<transformation xslt="datasource_mini.xsl" />
27
		</transformer>
28

  
29
		<transformer name="projectVocabularyTransformer">
30
			<transformation xslt="project_mini.xsl" />
31
		</transformer>
32

  
33
		<transformer name="results_openaire">
34
			<transformation xslt="result.xsl" />
35
	 		<transformation match="language" change="value" vocabulary="languages" />
36
			<transformation match="funding.funding_level_0" change="value" vocabulary="funders" />
37
			<transformation match="funding.funding_level_1" change="value" vocabulary="programmes" />
38
			<transformation match="funding.funding_level_2" change="value" vocabulary="areas" />
39
			<transformation match="datasource.hostedby" change="value" vocabulary="datasources" />
40
			<transformation match="datasource.licenceid" change="value" vocabulary="accessModes" />
41
		</transformer>
42

  
43
		<transformer name="projects_openaire">
44
			<transformation xslt="project.xsl" />
45
		</transformer>
46

  
47
		<transformer name="datasources_openaire">
48
			<transformation xslt="datasource.xsl" />
49
		</transformer>
50

  
51
		<!-- valid for every browse result of every entity type -->
52
		<transformer name="results_openaire_browse">
53
			<transformation xslt="browse.xsl" />
54
			<transformation match="resultlanguageid.value" change="value" vocabulary="languages" />
55
			<transformation match="organizationcountryid.value" change="value" vocabulary="countries" />
56

  
57
			<transformation match="relfundinglevel0_id.value" change="value" vocabulary="funders" />
58
			<transformation match="relfundinglevel1_id.value" change="value" vocabulary="programmes" />
59
			<transformation match="relfundinglevel2_id.value" change="value" vocabulary="areas" />
60
			<transformation match="resulthostingdatasourceid.value" change="value" vocabulary="datasources" />
61

  
62
			<transformation match="datasourcecompatibilityid.value" change="value" vocabulary="compatibility"/>
63
			<transformation match="resultrightsid.value" change="value" vocabulary="accessModes" />
64
			<transformation match="relprojectid.value" change="value" vocabulary="projects" />
65
		</transformer>
66

  
67
		<transformer name="persons_openaire">
68
			<transformation xslt="person.xsl" />
69
		</transformer>
70

  
71
		<transformer name="organizations_openaire">
72
			<transformation xslt="organization.xsl" />
73
		</transformer>
74
		
75
	</transformers>
76

  
77
	<formatters>
78
		<formatter name="json" xslt="json.xsl"/> 
79
		<formatter name="xml" xslt="simple.xsl"/>
80
		<formatter name="vocabulary" xslt="vocabulary.xsl"/>
81
	</formatters>
82
</configuration>
83
	
modules/uoa-search/tags/uoa-search-3.5.1/src/vocabularies/Namesof TextObjectTypologies_es_ES.xml
1
<RESOURCE_PROFILE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
2
    <HEADER>
3
        <RESOURCE_IDENTIFIER value="10a89de8-8f16-4e8c-824c-f76646438fa6_Vm9jYWJ1bGFyeURTUmVzb3VyY2VzL1ZvY2FidWxhcnlEU1Jlc291cmNlVHlwZQ=="/>
4
        <RESOURCE_TYPE value="VocabularyDSResourceType"/>
5
        <RESOURCE_KIND value="VocabularyDSResources"/>
6
        <RESOURCE_URI value="String"/>
7
        <DATE_OF_CREATION value="2010-12-23T19:05:23+01:00"/>
8
    </HEADER>
9
    <BODY>
10
        <CONFIGURATION>
11
            <VOCABULARY_NAME>Names of Text Object Typologies_es_ES</VOCABULARY_NAME>
12
            <VOCABULARY_DESCRIPTION>List of typology types provided by the DRIVER Guidelines for Repository content</VOCABULARY_DESCRIPTION>
13
            <TERMS>
14
                <TERM encoding="0000" english_name="Desconocido" native_name="">
15
                    <SYNONYMS/>
16
                </TERM>
17
                <TERM encoding="0001" english_name="Artículo" native_name="">
18
                    <SYNONYMS>
19
                        <SYNONYM encoding="DRIVER" term="Article in monograph or in proceedings"/>
20
                        <SYNONYM encoding="DRIVER" term="Article/Letter to editor"/>
21
                        <SYNONYM encoding="DRIVER" term="Article / Letter to the editor"/>
22
                        <SYNONYM encoding="DRIVER" term="Article / Letter to editor"/>
23
                        <SYNONYM encoding="DRIVER" term="Article-letter to the editor"/>
24
                        <SYNONYM encoding="DRIVER" term="Article - letter to the editor"/>
25
                        <SYNONYM encoding="DRIVER" term="Journal article"/>
26
                        <SYNONYM encoding="DRIVER" term="Journal article (on-line or printed)"/>
27
                        <SYNONYM encoding="DRIVER" term="Peer-reviewed Article"/>
28
                        <SYNONYM encoding="DRIVER" term="Article / Newspaper"/>
29
                        <SYNONYM encoding="DRIVER" term="Aufsatz"/>
30
                    </SYNONYMS>
31
                </TERM>
32
                <TERM encoding="0002" english_name="Libro" native_name="">
33
                    <SYNONYMS>
34
                        <SYNONYM encoding="DRIVER" term="Book (monograph)"/>
35
                        <SYNONYM encoding="DRIVER" term="Book - monograph - editorial book"/>
36
                        <SYNONYM encoding="DRIVER" term="Book Section"/>
37
                        <SYNONYM encoding="DRIVER" term="Monograph"/>
38
                    </SYNONYMS>
39
                </TERM>
40
                <TERM encoding="0003" english_name="Lectura de Conferencia" native_name="">
41
                    <SYNONYMS/>
42
                </TERM>
43
                <TERM encoding="0004" english_name="Informe de Conferencia" native_name="">
44
                    <SYNONYMS>
45
                        <SYNONYM encoding="DRIVER" term="Conference or Workshop Item"/>
46
                        <SYNONYM encoding="DRIVER" term="Conference Paper"/>
47
                        <SYNONYM encoding="DRIVER" term="Conference contribution"/>
48
                        <SYNONYM encoding="DRIVER" term="Conference Paper"/>
49
                    </SYNONYMS>
50
                </TERM>
51
                <TERM encoding="0005" english_name="Contribución a periódico o pulicación semanal" native_name="">
52
                    <SYNONYMS/>
53
                </TERM>
54
                <TERM encoding="0006" english_name="Tesis doctoral" native_name="">
55
                    <SYNONYMS>
56
                        <SYNONYM encoding="DINI" term="Text.Thesis.Doctoral"/>
57
                        <SYNONYM encoding="DRIVER" term="Thesis.Doctoral"/>
58
                        <SYNONYM encoding="DRIVER" term="Dissertation"/>
59
                        <SYNONYM encoding="DRIVER" term="Diss"/>
60
                        <SYNONYM encoding="DRIVER" term="DoctoralThesis"/>
61
                    </SYNONYMS>
62
                </TERM>
63
                <TERM encoding="0007" english_name="Tesis de Master" native_name="">
64
                    <SYNONYMS>
65
                        <SYNONYM encoding="DINI" term="Masters-Thesis.Magister"/>
66
                        <SYNONYM encoding="DRIVER" term="Thesis.Master"/>
67
                        <SYNONYM encoding="DRIVER" term="Masters thesis"/>
68
                    </SYNONYMS>
69
                </TERM>
70
                <TERM encoding="0008" english_name="Proyecto fin de carrera" native_name="">
71
                    <SYNONYMS/>
72
                </TERM>
73
                <TERM encoding="0009" english_name="Informe de Investigación Externo" native_name="">
74
                    <SYNONYMS>
75
                        <SYNONYM encoding="DINI" term="Tech-Report"/>
76
                    </SYNONYMS>
77
                </TERM>
78
                <TERM encoding="0010" english_name="Lectura" native_name="">
79
                    <SYNONYMS>
80
                        <SYNONYM encoding="DINI" term="Public-Lecture"/>
81
                        <SYNONYM encoding="DRIVER" term="Inaugural lecture"/>
82
                    </SYNONYMS>
83
                </TERM>
84
                <TERM encoding="0011" english_name="Informe Interno" native_name="">
85
                    <SYNONYMS/>
86
                </TERM>
87
                <TERM encoding="0012" english_name="Noticia" native_name="">
88
                    <SYNONYMS/>
89
                </TERM>
90
                <TERM encoding="0013" english_name="Parte de Libro o Capítulo de Libro" native_name="">
91
                    <SYNONYMS>
92
                        <SYNONYM encoding="DRIVER" term="Part of book - chapter"/>
93
                        <SYNONYM encoding="DRIVER" term="Book editorial"/>
94
                        <SYNONYM encoding="DRIVER" term="Book section"/>
95
                    </SYNONYMS>
96
                </TERM>
97
                <TERM encoding="0014" english_name="Trabajo de Investigación" native_name="">
98
                    <SYNONYMS>
99
                        <SYNONYM encoding="DINI" term="Research-Paper"/>
100
                        <SYNONYM encoding="DINI" term="Paper"/>
101
                        <SYNONYM encoding="DINI" term="ResearchPaper"/>
102
                    </SYNONYMS>
103
                </TERM>
104
            </TERMS>
105
        </CONFIGURATION>
106
        <STATUS>
107
            <LAST_UPDATE value="2007-05-06T23:02:07+02:00"/>
108
        </STATUS>
109
        <SECURITY_PARAMETERS/>
110
    </BODY>
111
</RESOURCE_PROFILE>
112

  
modules/uoa-search/tags/uoa-search-3.5.1/src/vocabularies/NamesofCountries_es_ES.xml
1
<RESOURCE_PROFILE>
2
    <HEADER>
3
        <RESOURCE_IDENTIFIER value="e540db9e-768a-4c75-8f37-5d0f8d0f3115_Vm9jYWJ1bGFyeURTUmVzb3VyY2VzL1ZvY2FidWxhcnlEU1Jlc291cmNlVHlwZQ=="/>
4
        <RESOURCE_TYPE value="VocabularyDSResourceType"/>
5
        <RESOURCE_KIND value="VocabularyDSResources"/>
6
        <RESOURCE_URI value="String"/>
7
        <DATE_OF_CREATION value="2010-12-23T19:12:24+01:00"/>
8
    </HEADER>
9
    <BODY>
10
        <CONFIGURATION>
11
            <VOCABULARY_NAME>Names of Countries_es_ES</VOCABULARY_NAME>
12
            <VOCABULARY_DESCRIPTION>OASIS list of country codes Country Code List: ISO 3166-1993 (E). No mappings provided.</VOCABULARY_DESCRIPTION>
13
            <TERMS>
14
                <TERM encoding="AD" english_name="Andorra" native_name="">
15
                    <SYNONYMS/>
16
                </TERM>
17
                <TERM encoding="AE" english_name="Emiratos Árabes Unidos" native_name="">
18
                    <SYNONYMS/>
19
                </TERM>
20
                <TERM encoding="AF" english_name="Afganistán" native_name="">
21
                    <SYNONYMS/>
22
                </TERM>
23
                <TERM encoding="AG" english_name="Antigua y Barbuda" native_name="">
24
                    <SYNONYMS/>
25
                </TERM>
26
                <TERM encoding="AI" english_name="Anguila" native_name="">
27
                    <SYNONYMS/>
28
                </TERM>
29
                <TERM encoding="AL" english_name="Albania" native_name="">
30
                    <SYNONYMS/>
31
                </TERM>
32
                <TERM encoding="AM" english_name="Armenia" native_name="">
33
                    <SYNONYMS/>
34
                </TERM>
35
                <TERM encoding="AN" english_name="Antillas Holandesas" native_name="">
36
                    <SYNONYMS/>
37
                </TERM>
38
                <TERM encoding="AO" english_name="Angola" native_name="">
39
                    <SYNONYMS/>
40
                </TERM>
41
                <TERM encoding="AQ" english_name="Antartida" native_name="">
42
                    <SYNONYMS/>
43
                </TERM>
44
                <TERM encoding="AR" english_name="Argentina" native_name="">
45
                    <SYNONYMS/>
46
                </TERM>
47
                <TERM encoding="AS" english_name="Samoa Americana" native_name="">
48
                    <SYNONYMS/>
49
                </TERM>
50
                <TERM encoding="AT" english_name="Austria" native_name="">
51
                    <SYNONYMS/>
52
                </TERM>
53
                <TERM encoding="AU" english_name="Australia" native_name="">
54
                    <SYNONYMS/>
55
                </TERM>
56
                <TERM encoding="AW" english_name="Aruba" native_name="">
57
                    <SYNONYMS/>
58
                </TERM>
59
                <TERM encoding="AZ" english_name="Azerbaiyán" native_name="">
60
                    <SYNONYMS/>
61
                </TERM>
62
                <TERM encoding="BA" english_name="Bosnia y Herzegovina" native_name="">
63
                    <SYNONYMS/>
64
                </TERM>
65
                <TERM encoding="BB" english_name="Barbados" native_name="">
66
                    <SYNONYMS/>
67
                </TERM>
68
                <TERM encoding="BD" english_name="Bangladesh" native_name="">
69
                    <SYNONYMS/>
70
                </TERM>
71
                <TERM encoding="BE" english_name="Bélgica" native_name="">
72
                    <SYNONYMS/>
73
                </TERM>
74
                <TERM encoding="BF" english_name="Burkina Faso" native_name="">
75
                    <SYNONYMS/>
76
                </TERM>
77
                <TERM encoding="BG" english_name="Bulgaria" native_name="">
78
                    <SYNONYMS/>
79
                </TERM>
80
                <TERM encoding="BH" english_name="Bahréin" native_name="">
81
                    <SYNONYMS/>
82
                </TERM>
83
                <TERM encoding="BI" english_name="Burundi" native_name="">
84
                    <SYNONYMS/>
85
                </TERM>
86
                <TERM encoding="BJ" english_name="Benín" native_name="">
87
                    <SYNONYMS/>
88
                </TERM>
89
                <TERM encoding="BM" english_name="Bermudas" native_name="">
90
                    <SYNONYMS/>
91
                </TERM>
92
                <TERM encoding="BN" english_name="Brunéi" native_name="">
93
                    <SYNONYMS/>
94
                </TERM>
95
                <TERM encoding="BO" english_name="Bolivia" native_name="">
96
                    <SYNONYMS/>
97
                </TERM>
98
                <TERM encoding="BR" english_name="Brasil" native_name="">
99
                    <SYNONYMS/>
100
                </TERM>
101
                <TERM encoding="BS" english_name="Bahamas" native_name="">
102
                    <SYNONYMS/>
103
                </TERM>
104
                <TERM encoding="BT" english_name="Bután" native_name="">
105
                    <SYNONYMS/>
106
                </TERM>
107
                <TERM encoding="BU" english_name="Birmania (ya no existe)" native_name="">
108
                    <SYNONYMS/>
109
                </TERM>
110
                <TERM encoding="BV" english_name="Isla Bouvet" native_name="">
111
                    <SYNONYMS/>
112
                </TERM>
113
                <TERM encoding="BW" english_name="Botsuana" native_name="">
114
                    <SYNONYMS/>
115
                </TERM>
116
                <TERM encoding="BY" english_name="Bielorrusia" native_name="">
117
                    <SYNONYMS/>
118
                </TERM>
119
                <TERM encoding="BZ" english_name="Belice" native_name="">
120
                    <SYNONYMS/>
121
                </TERM>
122
                <TERM encoding="CA" english_name="Canada" native_name="">
123
                    <SYNONYMS/>
124
                </TERM>
125
                <TERM encoding="CC" english_name="Islas Cocos (Keeling)" native_name="">
126
                    <SYNONYMS/>
127
                </TERM>
128
                <TERM encoding="CF" english_name="República Centroafricana" native_name="">
129
                    <SYNONYMS/>
130
                </TERM>
131
                <TERM encoding="CG" english_name="República del Congo" native_name="">
132
                    <SYNONYMS/>
133
                </TERM>
134
                <TERM encoding="CH" english_name="Suiza" native_name="">
135
                    <SYNONYMS/>
136
                </TERM>
137
                <TERM encoding="CI" english_name="Costa de Marfil" native_name="">
138
                    <SYNONYMS/>
139
                </TERM>
140
                <TERM encoding="CK" english_name="Islas Cook" native_name="">
141
                    <SYNONYMS/>
142
                </TERM>
143
                <TERM encoding="CL" english_name="Chile" native_name="">
144
                    <SYNONYMS/>
145
                </TERM>
146
                <TERM encoding="CM" english_name="Camerún" native_name="">
147
                    <SYNONYMS/>
148
                </TERM>
149
                <TERM encoding="CN" english_name="China" native_name="">
150
                    <SYNONYMS/>
151
                </TERM>
152
                <TERM encoding="CO" english_name="Colombia" native_name="">
153
                    <SYNONYMS/>
154
                </TERM>
155
                <TERM encoding="CR" english_name="Costa Rica" native_name="">
156
                    <SYNONYMS/>
157
                </TERM>
158
                <TERM encoding="CS" english_name="Checoslovaquia (ya no existe)" native_name="">
159
                    <SYNONYMS/>
160
                </TERM>
161
                <TERM encoding="CU" english_name="Cuba" native_name="">
162
                    <SYNONYMS/>
163
                </TERM>
164
                <TERM encoding="CV" english_name="Cabo Verde" native_name="">
165
                    <SYNONYMS/>
166
                </TERM>
167
                <TERM encoding="CX" english_name="Isla de Navidad" native_name="">
168
                    <SYNONYMS/>
169
                </TERM>
170
                <TERM encoding="CY" english_name="Chipre" native_name="">
171
                    <SYNONYMS/>
172
                </TERM>
173
                <TERM encoding="CZ" english_name="República Checa" native_name="">
174
                    <SYNONYMS/>
175
                </TERM>
176
                <TERM encoding="DD" english_name="República Democrática Alemana (ya no existe)" native_name="">
177
                    <SYNONYMS/>
178
                </TERM>
179
                <TERM encoding="DE" english_name="Alemania" native_name="">
180
                    <SYNONYMS/>
181
                </TERM>
182
                <TERM encoding="DJ" english_name="Yibuti" native_name="">
183
                    <SYNONYMS/>
184
                </TERM>
185
                <TERM encoding="DK" english_name="Dinamarca" native_name="">
186
                    <SYNONYMS/>
187
                </TERM>
188
                <TERM encoding="DM" english_name="Dominica" native_name="">
189
                    <SYNONYMS/>
190
                </TERM>
191
                <TERM encoding="DO" english_name="República Dominicana" native_name="">
192
                    <SYNONYMS/>
193
                </TERM>
194
                <TERM encoding="DZ" english_name="Argelia" native_name="">
195
                    <SYNONYMS/>
196
                </TERM>
197
                <TERM encoding="EC" english_name="Ecuador" native_name="">
198
                    <SYNONYMS/>
199
                </TERM>
200
                <TERM encoding="EE" english_name="Estonia" native_name="">
201
                    <SYNONYMS/>
202
                </TERM>
203
                <TERM encoding="EG" english_name="Egipto" native_name="">
204
                    <SYNONYMS/>
205
                </TERM>
206
                <TERM encoding="EH" english_name="Sahara Occidental" native_name="">
207
                    <SYNONYMS/>
208
                </TERM>
209
                <TERM encoding="ER" english_name="Eritrea" native_name="">
210
                    <SYNONYMS/>
211
                </TERM>
212
                <TERM encoding="ES" english_name="España" native_name="">
213
                    <SYNONYMS/>
214
                </TERM>
215
                <TERM encoding="ET" english_name="Etiopía" native_name="">
216
                    <SYNONYMS/>
217
                </TERM>
218
                <TERM encoding="FI" english_name="Finlandia" native_name="">
219
                    <SYNONYMS/>
220
                </TERM>
221
                <TERM encoding="FJ" english_name="Fiyi" native_name="">
222
                    <SYNONYMS/>
223
                </TERM>
224
                <TERM encoding="FK" english_name="Islas Malvinas" native_name="">
225
                    <SYNONYMS/>
226
                </TERM>
227
                <TERM encoding="FM" english_name="Estados Federados de Micronesia" native_name="">
228
                    <SYNONYMS/>
229
                </TERM>
230
                <TERM encoding="FO" english_name="Islas Feroe" native_name="">
231
                    <SYNONYMS/>
232
                </TERM>
233
                <TERM encoding="FR" english_name="Francia" native_name="">
234
                    <SYNONYMS/>
235
                </TERM>
236
                <TERM encoding="FX" english_name="Francia, Metropolitana" native_name="">
237
                    <SYNONYMS/>
238
                </TERM>
239
                <TERM encoding="GA" english_name="Gabón" native_name="">
240
                    <SYNONYMS/>
241
                </TERM>
242
                <TERM encoding="UK" english_name="Reino Unido" native_name="">
243
                    <SYNONYMS/>
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff