Revision 47508
Added by Katerina Iatropoulou almost 7 years ago
modules/uoa-claims/claims-demo/src/test/java/eu/dnetlib/data/claims/migration/parser/ExternalParserTest.java | ||
---|---|---|
1 |
package eu.dnetlib.data.claims.migration.parser; |
|
2 |
|
|
3 |
import eu.dnetlib.data.claims.migration.entity.Result; |
|
4 |
import eu.dnetlib.data.claimsDemo.ClaimUtils; |
|
5 |
import org.apache.log4j.BasicConfigurator; |
|
6 |
import org.junit.Assert; |
|
7 |
import org.junit.Before; |
|
8 |
import org.junit.Test; |
|
9 |
|
|
10 |
/** |
|
11 |
* Created by kiatrop on 23/2/2016. |
|
12 |
*/ |
|
13 |
public class ExternalParserTest { |
|
14 |
|
|
15 |
|
|
16 |
@Before |
|
17 |
public void init() throws Exception { |
|
18 |
BasicConfigurator.configure(); |
|
19 |
} |
|
20 |
private String crossrefJson = "{\"status\":\"ok\",\"message-type\":\"work-list\",\"message-version\":\"1.0.0\",\"message\":" + |
|
21 |
"{\"query\":{\"search-terms\":null,\"start-index\":0},\"items-per-page\":20,\"items\":[{\"indexed\":" + |
|
22 |
"{\"date-parts\":[[2015,12,28]], \"date-time\":\"2015-12-28T17:45:59Z\",\"timestamp\":1451324759779}," + |
|
23 |
"\"reference-count\":0,\"publisher\":\"Society for Neuroscience\", \"issue\":\"17\"," + |
|
24 |
"\"published-print\":{\"date-parts\":[[2012,4,25]]},\"DOI\":\"10.1523\\/jneurosci.2900-11.2012\"," + |
|
25 |
"\"type\":\"journal-article\",\"created\": {\"date-parts\":[[2012,4,25]]," + |
|
26 |
"\"date-time\":\"2012-04-25T16:38:54Z\",\"timestamp\":1335371934000},\"page\":\"5728-5736\"," + |
|
27 |
"\"source\":\"CrossRef\",\"title\":[\"Imaging Microglial\\/Macrophage Activation in Spinal Cords of " + |
|
28 |
"Experimental Autoimmune Encephalomyelitis Rats by Positron Emission Tomography Using the Mitochondrial " + |
|
29 |
"18 kDa Translocator Protein Radioligand [18F]DPA-714\"]," + |
|
30 |
"\"prefix\":\"http:\\/\\/id.crossref.org\\/prefix\\/10.1523\",\"volume\":\"32\",\"author\":" + |
|
31 |
"[{\"affiliation\":[],\"family\":\"Abourbeh\",\"given\":\"G.\"},{\"affiliation\":[],\"family\":\"Theze\"," + |
|
32 |
"\"given\":\"B.\"},{\"affiliation\":[],\"family\":\"Maroy\",\"given\":\"R.\"},{\"affiliation\":[],\"family\":" + |
|
33 |
"\"Dubois\",\"given\":\"A.\"},{\"affiliation\":[],\"family\":\"Brulon\",\"given\":\"V.\"}," + |
|
34 |
"{\"affiliation\":[],\"family\":\"Fontyn\",\"given\":\"Y.\"},{\"affiliation\":[],\"family\":\"Dolle\"," + |
|
35 |
"\"given\":\"F.\"},{\"affiliation\":[],\"family\":\"Tavitian\",\"given\":\"B.\"},{\"affiliation\":[]," + |
|
36 |
"\"family\":\"Boisgard\",\"given\":\"R.\"}],\"member\":\"http:\\/\\/id.crossref.org\\/member\\/393\"," + |
|
37 |
"\"published-online\":{\"date-parts\":[[2012,4,25]]},\"container-title\":[\"Journal of Neuroscience\"]," + |
|
38 |
"\"deposited\":{\"date-parts\":[[2014,2,27]],\"date-time\":\"2014-02-27T06:42:02Z\",\"timestamp\":1393483322000}," + |
|
39 |
"\"score\":1.0,\"subtitle\":[],\"issued\":{\"date-parts\":[[2012,4,25]]}," + |
|
40 |
"\"URL\":\"http:\\/\\/dx.doi.org\\/10.1523\\/jneurosci.2900-11.2012\",\"ISSN\":[\"0270-6474\",\"1529-2401\"]," + |
|
41 |
"\"subject\":[\"Neuroscience(all)\"]}],\"total-results\":1,\"facets\":{}}}" + |
|
42 |
""; |
|
43 |
|
|
44 |
|
|
45 |
@Test |
|
46 |
public void crossref2ResultTest(){ |
|
47 |
Result result = ExternalRecordParser.crossref2Result(crossrefJson); |
|
48 |
|
|
49 |
Assert.assertNull(result.getAccessRights()); |
|
50 |
Assert.assertNull(result.getBestLicense()); |
|
51 |
Assert.assertEquals("openaire____::crossref", result.getCollectedFrom()); |
|
52 |
Assert.assertEquals("10.1523/jneurosci.2900-11.2012", result.getDoi()); |
|
53 |
Assert.assertNull(result.getOai()); |
|
54 |
Assert.assertNotNull(result.getOpenaireId());// Assert.assertNull(result.getOpenaireId()); |
|
55 |
Assert.assertNull(result.getPmcid()); |
|
56 |
Assert.assertEquals(ClaimUtils.PUBLICATION, result.getResultType()); |
|
57 |
Assert.assertEquals("Imaging Microglial/Macrophage Activation in Spinal Cords of Experimental Autoimmune Encephalomyelitis Rats by Positron Emission Tomography Using the Mitochondrial 18 kDa Translocator Protein Radioligand [18F]DPA-714", result.getTitle()); |
|
58 |
Assert.assertEquals("json", result.getRecordFormat()); |
|
59 |
Assert.assertEquals("https://dx.doi.org/10.1523/jneurosci.2900-11.2012", result.getExternalUrl()); |
|
60 |
Assert.assertNull(result.getEmbargoEndDate()); |
|
61 |
Assert.assertNull(result.getOrcidworkid()); |
|
62 |
|
|
63 |
Assert.assertEquals(9, result.getAuthors().size()); |
|
64 |
Assert.assertEquals("G. Abourbeh", result.getAuthors().get(0+"")); |
|
65 |
Assert.assertEquals("Y. Fontyn", result.getAuthors().get(5+"")); |
|
66 |
} |
|
67 |
|
|
68 |
private String orcidXml = "<orcid-message xmlns=\"http://www.orcid.org/ns/orcid\">\n" + |
|
69 |
" <message-version>1.1</message-version>\n" + |
|
70 |
" <orcid-profile type=\"user\">\n" + |
|
71 |
" <orcid-identifier>\n" + |
|
72 |
" <uri>http://orcid.org/0000-0002-9414-646X</uri>\n" + |
|
73 |
" <path>0000-0002-9414-646X</path>\n" + |
|
74 |
" <host>orcid.org</host>\n" + |
|
75 |
" </orcid-identifier>\n" + |
|
76 |
" <orcid-preferences>\n" + |
|
77 |
" <locale>es</locale>\n" + |
|
78 |
" </orcid-preferences>\n" + |
|
79 |
" <orcid-history>\n" + |
|
80 |
" <creation-method>website</creation-method>\n" + |
|
81 |
" <completion-date>2013-01-11T14:07:54.194Z</completion-date>\n" + |
|
82 |
" <submission-date>2013-01-11T13:27:46.558Z</submission-date>\n" + |
|
83 |
" <last-modified-date>2016-01-27T16:06:13.543Z</last-modified-date>\n" + |
|
84 |
" <claimed>true</claimed>\n" + |
|
85 |
" </orcid-history>\n" + |
|
86 |
" <orcid-activities>\n" + |
|
87 |
" <orcid-works>\n" + |
|
88 |
" <orcid-work put-code=\"21755327\" visibility=\"public\">\n" + |
|
89 |
" <work-title>\n" + |
|
90 |
" <title>Providing Ubiquitous Positioning in Outdoor Environments</title>\n" + |
|
91 |
" </work-title>\n" + |
|
92 |
" <journal-title>2015 IEEE International Conference on Systems, Man, and Cybernetics</journal-title>\n" + |
|
93 |
" <work-citation>\n" + |
|
94 |
" <work-citation-type>bibtex</work-citation-type>\n" + |
|
95 |
" <citation>@inproceedings{Moreno_2015,doi = {10.1109/smc.2015.229},url = {http://dx.doi.org/10.1109/smc.2015.229},year = 2015,month = {oct},publisher = {Institute of Electrical {\\&} Electronics Engineers ({IEEE})},author = {Daniel Moreno and Sergio F. Ochoa and Roc Meseguer},title = {Providing Ubiquitous Positioning in Outdoor Environments},booktitle = {2015 {IEEE} International Conference on Systems, Man, and Cybernetics}}</citation>\n" + |
|
96 |
" </work-citation>\n" + |
|
97 |
" <work-type>conference-paper</work-type>\n" + |
|
98 |
" <publication-date>\n" + |
|
99 |
" <year>2015</year>\n" + |
|
100 |
" <month>10</month>\n" + |
|
101 |
" </publication-date>\n" + |
|
102 |
" <work-external-identifiers>\n" + |
|
103 |
" <work-external-identifier>\n" + |
|
104 |
" <work-external-identifier-type>doi</work-external-identifier-type>\n" + |
|
105 |
" <work-external-identifier-id>10.1109/smc.2015.229</work-external-identifier-id>\n" + |
|
106 |
" </work-external-identifier>\n" + |
|
107 |
" </work-external-identifiers>\n" + |
|
108 |
" <work-contributors>\n" + |
|
109 |
" <contributor>\n" + |
|
110 |
" <credit-name visibility=\"public\">Daniel Moreno</credit-name>\n" + |
|
111 |
" <contributor-attributes>\n" + |
|
112 |
" <contributor-role>author</contributor-role>\n" + |
|
113 |
" </contributor-attributes>\n" + |
|
114 |
" </contributor>\n" + |
|
115 |
" <contributor>\n" + |
|
116 |
" <credit-name visibility=\"public\">Sergio F. Ochoa</credit-name>\n" + |
|
117 |
" <contributor-attributes>\n" + |
|
118 |
" <contributor-role>author</contributor-role>\n" + |
|
119 |
" </contributor-attributes>\n" + |
|
120 |
" </contributor>\n" + |
|
121 |
" <contributor>\n" + |
|
122 |
" <credit-name visibility=\"public\">Roc Meseguer</credit-name>\n" + |
|
123 |
" <contributor-attributes>\n" + |
|
124 |
" <contributor-role>author</contributor-role>\n" + |
|
125 |
" </contributor-attributes>\n" + |
|
126 |
" </contributor>\n" + |
|
127 |
" </work-contributors>\n" + |
|
128 |
" <work-source>\n" + |
|
129 |
" <uri>http://orcid.org/0000-0002-3054-1567</uri>\n" + |
|
130 |
" <path>0000-0002-3054-1567</path>\n" + |
|
131 |
" <host>orcid.org</host>\n" + |
|
132 |
" </work-source>\n" + |
|
133 |
" </orcid-work>\n" + |
|
134 |
" <orcid-work put-code=\"19191618\" visibility=\"public\">\n" + |
|
135 |
" <work-title>\n" + |
|
136 |
" <title>A Context-Aware Model to Provide Positioning in Disaster Relief Scenarios</title>\n" + |
|
137 |
" </work-title>\n" + |
|
138 |
" <journal-title>Sensors</journal-title>\n" + |
|
139 |
" <work-citation>\n" + |
|
140 |
" <work-citation-type>bibtex</work-citation-type>\n" + |
|
141 |
" <citation>@article{Moreno_2015,doi = {10.3390/s151025176},url = {http://dx.doi.org/10.3390/s151025176},year = 2015,month = {sep},publisher = {{MDPI} {AG}},volume = {15},number = {10},pages = {25176--25207},author = {Daniel Moreno and Sergio Ochoa and Roc Meseguer},title = {A Context-Aware Model to Provide Positioning in Disaster Relief Scenarios},journal = {Sensors}}</citation>\n" + |
|
142 |
" </work-citation>\n" + |
|
143 |
" <work-type>journal-article</work-type>\n" + |
|
144 |
" <publication-date>\n" + |
|
145 |
" <year>2015</year>\n" + |
|
146 |
" <month>09</month>\n" + |
|
147 |
" </publication-date>\n" + |
|
148 |
" <work-external-identifiers>\n" + |
|
149 |
" <work-external-identifier>\n" + |
|
150 |
" <work-external-identifier-type>doi</work-external-identifier-type>\n" + |
|
151 |
" <work-external-identifier-id>10.3390/s151025176</work-external-identifier-id>\n" + |
|
152 |
" </work-external-identifier>\n" + |
|
153 |
" </work-external-identifiers>\n" + |
|
154 |
" <work-contributors>\n" + |
|
155 |
" <contributor>\n" + |
|
156 |
" <credit-name visibility=\"public\">Daniel Moreno</credit-name>\n" + |
|
157 |
" <contributor-attributes>\n" + |
|
158 |
" <contributor-role>author</contributor-role>\n" + |
|
159 |
" </contributor-attributes>\n" + |
|
160 |
" </contributor>\n" + |
|
161 |
" <contributor>\n" + |
|
162 |
" <credit-name visibility=\"public\">Sergio Ochoa</credit-name>\n" + |
|
163 |
" <contributor-attributes>\n" + |
|
164 |
" <contributor-role>author</contributor-role>\n" + |
|
165 |
" </contributor-attributes>\n" + |
|
166 |
" </contributor>\n" + |
|
167 |
" <contributor>\n" + |
|
168 |
" <credit-name visibility=\"public\">Roc Meseguer</credit-name>\n" + |
|
169 |
" <contributor-attributes>\n" + |
|
170 |
" <contributor-role>author</contributor-role>\n" + |
|
171 |
" </contributor-attributes>\n" + |
|
172 |
" </contributor>\n" + |
|
173 |
" </work-contributors>\n" + |
|
174 |
" <work-source>\n" + |
|
175 |
" <uri>http://orcid.org/0000-0002-3054-1567</uri>\n" + |
|
176 |
" <path>0000-0002-3054-1567</path>\n" + |
|
177 |
" <host>orcid.org</host>\n" + |
|
178 |
" </work-source>\n" + |
|
179 |
" </orcid-work>" + |
|
180 |
"</orcid-works></orcid-activities></orcid-profile></orcid-message>"; |
|
181 |
|
|
182 |
@Test |
|
183 |
public void orcid2ResultTest() { |
|
184 |
Result result = ExternalRecordParser.orcid2Result(orcidXml, "0000-0002-9414-646X-21755327"); |
|
185 |
|
|
186 |
Assert.assertNull(result.getAccessRights()); |
|
187 |
Assert.assertNull(result.getBestLicense()); |
|
188 |
Assert.assertEquals("openaire____::orcid", result.getCollectedFrom()); |
|
189 |
Assert.assertEquals("10.1109/smc.2015.229", result.getDoi()); |
|
190 |
Assert.assertEquals("0000-0002-9414-646X-21755327", result.getOrcidworkid()); |
|
191 |
Assert.assertNull(result.getOai()); |
|
192 |
Assert.assertNotNull(result.getOpenaireId());// Assert.assertNull(result.getOpenaireId()); |
|
193 |
Assert.assertNull(result.getPmcid()); |
|
194 |
Assert.assertEquals(ClaimUtils.PUBLICATION, result.getResultType()); |
|
195 |
Assert.assertEquals("Providing Ubiquitous Positioning in Outdoor Environments", result.getTitle()); |
|
196 |
Assert.assertEquals("xml", result.getRecordFormat()); |
|
197 |
Assert.assertEquals("https://dx.doi.org/10.1109/smc.2015.229", result.getExternalUrl()); |
|
198 |
Assert.assertNull(result.getEmbargoEndDate()); |
|
199 |
|
|
200 |
} |
|
201 |
|
|
202 |
|
|
203 |
private String dataciteXml = "<rdf:RDF\n" + |
|
204 |
" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n" + |
|
205 |
" xmlns:owl=\"http://www.w3.org/2002/07/owl#\"\n" + |
|
206 |
" xmlns:j.0=\"http://purl.org/dc/terms/\" > \n" + |
|
207 |
" <rdf:Description rdf:about=\"http://dx.doi.org/10.5060/D4RN35SD/USGS85K1_041\">\n" + |
|
208 |
" <j.0:creator>Krimmel, Robert</j.0:creator>\n" + |
|
209 |
" <j.0:publisher>National Snow and Ice Data Center/World Data Center for Glaciology, Boulder</j.0:publisher>\n" + |
|
210 |
" <j.0:title>Chocolate Glacier</j.0:title>\n" + |
|
211 |
" <j.0:date>2008</j.0:date>\n" + |
|
212 |
" <owl:sameAs>doi:10.5060/D4RN35SD/USGS85K1_041</owl:sameAs>\n" + |
|
213 |
" <owl:sameAs>info:doi/10.5060/D4RN35SD/USGS85K1_041</owl:sameAs>\n" + |
|
214 |
" <j.0:identifier>10.5060/D4RN35SD/USGS85K1_041</j.0:identifier>\n" + |
|
215 |
" </rdf:Description>\n" + |
|
216 |
"</rdf:RDF>\n"; |
|
217 |
|
|
218 |
private String dataciteJson = "{\"data\":{\"id\":\"https://doi.org/10.5281/ZENODO.54730\",\"type\":\"works\",\"attributes\":{\"doi\":\"10.5281/ZENODO.54730\",\"url\":null,\"author\":[{\"family\":\"Manola\",\"given\":\"Natalia\"}],\"title\":\"From Open Access to Open Science\",\"container-title\":\"Zenodo\",\"description\":\"Presentation given at the PASTEUR4OA conference - Green Light for Open Access: Aligning Europe’s OA Policies, Amsterdam, 17th-18th May 2016.\",\"resource-type-subtype\":\"Presentation\",\"data-center-id\":\"cern.zenodo\",\"member-id\":\"cern\",\"resource-type-id\":\"text\",\"version\":null,\"license\":\"https://creativecommons.org/licenses/by/4.0/\",\"schema-version\":\"3\",\"results\":[],\"related-identifiers\":[],\"published\":\"2016\",\"deposited\":\"2016-06-03T17:03:51Z\",\"updated\":\"2016-06-03T17:03:51Z\",\"media\":null,\"xml\":\"PHJlc291cmNlIHhtbG5zPSJodHRwOi8vZGF0YWNpdGUub3JnL3NjaGVtYS9rZXJuZWwtMyIgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSIgeHNpOnNjaGVtYUxvY2F0aW9uPSJodHRwOi8vZGF0YWNpdGUub3JnL3NjaGVtYS9rZXJuZWwtMyBodHRwOi8vc2NoZW1hLmRhdGFjaXRlLm9yZy9tZXRhL2tlcm5lbC0zL21ldGFkYXRhLnhzZCI+CiAgPGlkZW50aWZpZXIgaWRlbnRpZmllclR5cGU9IkRPSSI+MTAuNTI4MS96ZW5vZG8uNTQ3MzA8L2lkZW50aWZpZXI+CiAgPGNyZWF0b3JzPgogICAgPGNyZWF0b3I+CiAgICAgIDxjcmVhdG9yTmFtZT5NYW5vbGEsIE5hdGFsaWEgPC9jcmVhdG9yTmFtZT4KICAgICAgPGFmZmlsaWF0aW9uPk9wZW5BSVJFPC9hZmZpbGlhdGlvbj4KICAgIDwvY3JlYXRvcj4KICA8L2NyZWF0b3JzPgogIDx0aXRsZXM+CiAgICA8dGl0bGU+RnJvbSBPcGVuIEFjY2VzcyB0byBPcGVuIFNjaWVuY2U8L3RpdGxlPgogIDwvdGl0bGVzPgogIDxwdWJsaXNoZXI+WmVub2RvPC9wdWJsaXNoZXI+CiAgPHB1YmxpY2F0aW9uWWVhcj4yMDE2PC9wdWJsaWNhdGlvblllYXI+CiAgPHN1YmplY3RzPgogICAgPHN1YmplY3Q+UEFTVEVVUjRPQTwvc3ViamVjdD4KICAgIDxzdWJqZWN0Pk9wZW4gQWNjZXNzPC9zdWJqZWN0PgogICAgPHN1YmplY3Q+UHJlc2VudGF0aW9uPC9zdWJqZWN0PgogIDwvc3ViamVjdHM+CiAgPGNvbnRyaWJ1dG9ycz4KICAgIDxjb250cmlidXRvciBjb250cmlidXRvclR5cGU9IkZ1bmRlciI+CiAgICAgIDxjb250cmlidXRvck5hbWU+RXVyb3BlYW4gQ29tbWlzc2lvbjwvY29udHJpYnV0b3JOYW1lPgogICAgICA8bmFtZUlkZW50aWZpZXIgbmFtZUlkZW50aWZpZXJTY2hlbWU9ImluZm8iPmluZm86ZXUtcmVwby9ncmFudEFncmVlbWVudC9FQy9GUDcvNjExNzQyPC9uYW1lSWRlbnRpZmllcj4KICAgIDwvY29udHJpYnV0b3I+CiAgPC9jb250cmlidXRvcnM+CiAgPGRhdGVzPgogICAgPGRhdGUgZGF0ZVR5cGU9Iklzc3VlZCI+MjAxNi0wNS0xODwvZGF0ZT4KICA8L2RhdGVzPgogIDxyZXNvdXJjZVR5cGUgcmVzb3VyY2VUeXBlR2VuZXJhbD0iVGV4dCI+UHJlc2VudGF0aW9uPC9yZXNvdXJjZVR5cGU+CiAgPGFsdGVybmF0ZUlkZW50aWZpZXJzPgogICAgPGFsdGVybmF0ZUlkZW50aWZpZXIgYWx0ZXJuYXRlSWRlbnRpZmllclR5cGU9IlVSTCI+aHR0cDovL3plbm9kby5vcmcvcmVjb3JkLzU0NzMwPC9hbHRlcm5hdGVJZGVudGlmaWVyPgogICAgPGFsdGVybmF0ZUlkZW50aWZpZXIgYWx0ZXJuYXRlSWRlbnRpZmllclR5cGU9IlVSTCI+aHR0cDovL3d3dy5wYXN0ZXVyNG9hLmV1L3NpdGVzL3Bhc3RldXI0b2EvZmlsZXMvZ2VuZXJpYy9OYXRhbGlhJTIwTWFub2xhJTIwUERGLnBkZjwvYWx0ZXJuYXRlSWRlbnRpZmllcj4KICA8L2FsdGVybmF0ZUlkZW50aWZpZXJzPgogIDxyZWxhdGVkSWRlbnRpZmllcnM+CiAgICA8cmVsYXRlZElkZW50aWZpZXIgcmVsYXRpb25UeXBlPSJIYXNQYXJ0IiByZWxhdGVkSWRlbnRpZmllclR5cGU9IlVSTCI+aHR0cHM6Ly96ZW5vZG8ub3JnL3JlY29yZC81NDczMC9maWxlcy8xOF9OYXRhbGlhX01hbm9sYV9QREYucGRmPC9yZWxhdGVkSWRlbnRpZmllcj4KICA8L3JlbGF0ZWRJZGVudGlmaWVycz4KICA8cmlnaHRzTGlzdD4KICAgIDxyaWdodHMgcmlnaHRzVVJJPSJpbmZvOmV1LXJlcG8vc2VtYW50aWNzL29wZW5BY2Nlc3MiPk9wZW4gQWNjZXNzPC9yaWdodHM+CiAgICA8cmlnaHRzIHJpZ2h0c1VSST0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbGljZW5zZXMvYnkvNC4wLyI+Q3JlYXRpdmUgQ29tbW9ucyBBdHRyaWJ1dGlvbiA0LjAgSW50ZXJuYXRpb25hbDwvcmlnaHRzPgogIDwvcmlnaHRzTGlzdD4KICA8ZGVzY3JpcHRpb25zPgogICAgPGRlc2NyaXB0aW9uIGRlc2NyaXB0aW9uVHlwZT0iQWJzdHJhY3QiPiZsdDtwJmd0O1ByZXNlbnRhdGlvbiBnaXZlbiBhdCB0aGUgUEFTVEVVUjRPQSBjb25mZXJlbmNlIC0mYW1wO25ic3A7R3JlZW4gTGlnaHQgZm9yIE9wZW4gQWNjZXNzOiBBbGlnbmluZyBFdXJvcGUmYW1wO3JzcXVvO3MgT0EgUG9saWNpZXMsIEFtc3RlcmRhbSwgMTd0aC0xOHRoIE1heSAyMDE2LiZsdDsvcCZndDs8L2Rlc2NyaXB0aW9uPgogIDwvZGVzY3JpcHRpb25zPgo8L3Jlc291cmNlPgo=\"},\"relationships\":{\"data-center\":{\"meta\":{}},\"member\":{\"meta\":{}},\"resource-type\":{\"meta\":{}}}}}"; |
|
219 |
|
|
220 |
@Test |
|
221 |
public void datacite2ResultTest() { |
|
222 |
Result result = ExternalRecordParser.datacite2Result(dataciteXml); |
|
223 |
|
|
224 |
Assert.assertNull(result.getAccessRights()); |
|
225 |
Assert.assertNull(result.getBestLicense()); |
|
226 |
Assert.assertEquals("openaire____::datacite", result.getCollectedFrom()); |
|
227 |
Assert.assertEquals("10.5060/D4RN35SD/USGS85K1_041", result.getDoi()); |
|
228 |
Assert.assertNull(result.getOrcidworkid()); |
|
229 |
Assert.assertNull(result.getOai()); |
|
230 |
Assert.assertNotNull(result.getOpenaireId());// Assert.assertNull(result.getOpenaireId()); |
|
231 |
Assert.assertNull(result.getPmcid()); |
|
232 |
Assert.assertEquals(ClaimUtils.DATASET, result.getResultType()); |
|
233 |
Assert.assertEquals("Chocolate Glacier", result.getTitle()); |
|
234 |
Assert.assertEquals("xml", result.getRecordFormat()); |
|
235 |
Assert.assertEquals("http://dx.doi.org/10.5060/D4RN35SD/USGS85K1_041", result.getExternalUrl()); |
|
236 |
Assert.assertNull(result.getEmbargoEndDate()); |
|
237 |
|
|
238 |
} |
|
239 |
|
|
240 |
@Test |
|
241 |
public void dataciteJsonResultTest() { |
|
242 |
Result result = ExternalRecordParser.dataciteJson2Result(dataciteJson); |
|
243 |
|
|
244 |
Assert.assertNull(result.getAccessRights()); |
|
245 |
Assert.assertNull(result.getBestLicense()); |
|
246 |
Assert.assertEquals("openaire____::datacite", result.getCollectedFrom()); |
|
247 |
Assert.assertEquals("10.5281/ZENODO.54730", result.getDoi()); |
|
248 |
Assert.assertNull(result.getOrcidworkid()); |
|
249 |
Assert.assertNull(result.getOai()); |
|
250 |
Assert.assertNotNull(result.getOpenaireId());// Assert.assertNull(result.getOpenaireId()); |
|
251 |
Assert.assertNull(result.getPmcid()); |
|
252 |
Assert.assertEquals(ClaimUtils.DATASET, result.getResultType()); |
|
253 |
Assert.assertEquals("From Open Access to Open Science", result.getTitle()); |
|
254 |
Assert.assertEquals("json", result.getRecordFormat()); |
|
255 |
Assert.assertEquals("https://dx.doi.org/10.5281/ZENODO.54730", result.getExternalUrl()); |
|
256 |
Assert.assertNull(result.getEmbargoEndDate()); |
|
257 |
|
|
258 |
} |
|
259 |
} |
modules/uoa-claims/claims-demo/src/test/java/eu/dnetlib/data/claims/migration/parser/OafParserTest.java | ||
---|---|---|
1 |
package eu.dnetlib.data.claims.migration.parser; |
|
2 |
|
|
3 |
import eu.dnetlib.data.claims.migration.entity.Result; |
|
4 |
import eu.dnetlib.data.claimsDemo.ClaimUtils; |
|
5 |
import eu.dnetlib.data.claims.migration.entity.Project; |
|
6 |
import org.apache.log4j.BasicConfigurator; |
|
7 |
import org.junit.Assert; |
|
8 |
import org.junit.Before; |
|
9 |
import org.junit.Test; |
|
10 |
import org.xml.sax.SAXException; |
|
11 |
|
|
12 |
import javax.xml.parsers.ParserConfigurationException; |
|
13 |
import javax.xml.transform.TransformerException; |
|
14 |
import javax.xml.xpath.XPathExpressionException; |
|
15 |
import java.io.IOException; |
|
16 |
|
|
17 |
/** |
|
18 |
* Created by kiatrop on 22/2/2016. |
|
19 |
*/ |
|
20 |
public class OafParserTest { |
|
21 |
|
|
22 |
@Before() |
|
23 |
public void init(){ |
|
24 |
BasicConfigurator.configure(); |
|
25 |
} |
|
26 |
|
|
27 |
private String publicationOaf = "<response>\n" + |
|
28 |
"\t <header>\n" + |
|
29 |
"\t\t <query>(((deletedbyinference = false) AND (oaftype exact result)) and (resulttypeid exact publication)) and (objidentifier exact od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46)</query>\n" + |
|
30 |
"\t\t\t\t <locale>en_GB</locale>\t\n" + |
|
31 |
"\t\t\t\t\t<size>10</size>\n" + |
|
32 |
"\t\t\t <page>1</page>\n" + |
|
33 |
"\t\t\t <total>1</total>\n" + |
|
34 |
"\t\t\t\t\t</header>\n" + |
|
35 |
"\t <results>\n" + |
|
36 |
"\t\t\t\t\t\t\t\t\t<result xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + |
|
37 |
" xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\"\n" + |
|
38 |
" xmlns:oaf=\"http://namespace.openaire.eu/oaf\">\n" + |
|
39 |
" <header>\n" + |
|
40 |
" <dri:objIdentifier>od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46</dri:objIdentifier>\n" + |
|
41 |
" <dri:dateOfCollection>2016-02-02T08:07:14Z</dri:dateOfCollection>\n" + |
|
42 |
" </header>\n" + |
|
43 |
" <metadata>\n" + |
|
44 |
" <oaf:entity xsi:schemaLocation=\"http://namespace.openaire.eu/oaf https://www.openaire.eu/schema/0.3/oaf-0.3.xsd\">\n" + |
|
45 |
"\t\t <oaf:result>\n" + |
|
46 |
" <title classid=\"main title\" classname=\"main title\" schemeid=\"dnet:dataCite_title\"\n" + |
|
47 |
" schemename=\"dnet:dataCite_title\">ПОСТКОНВЕРСИОННАЯ АСИСТОЛИЯ ЖЕЛУДОЧКОВ СЕРДЦА У БОЛЬНЫХ ИНФАРКТОМ МИОКАРДА И ВОЗМОЖНОСТИ ЕЕ ПРОФИЛАКТИКИ</title>\n" + |
|
48 |
" <dateofacceptance>2010-01-01</dateofacceptance>\n" + |
|
49 |
" <resulttype classid=\"publication\" classname=\"publication\" schemeid=\"dnet:result_typologies\"\n" + |
|
50 |
" schemename=\"dnet:result_typologies\"/>\n" + |
|
51 |
" <country classid=\"\" classname=\"\" schemeid=\"\" schemename=\"\"/>\n" + |
|
52 |
" <relevantdate classid=\"\" classname=\"\" schemeid=\"\" schemename=\"\"/>\n" + |
|
53 |
" <embargoenddate>2099-12-31</embargoenddate>\n" + |
|
54 |
" <originalId>oai:cyberleninka.ru:article/5969541</originalId>\n" + |
|
55 |
" <collectedfrom name=\"CyberLeninka - Russian open access scientific library\"\n" + |
|
56 |
" id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\"/>\n" + |
|
57 |
" <pid classid=\"oai\" classname=\"oai\" schemeid=\"dnet:pid_types\"\n" + |
|
58 |
" schemename=\"dnet:pid_types\">oai:cyberleninka.ru:article/5969541</pid>\n" + |
|
59 |
" <pid classid=\"pmc\" classname=\"pmc\" schemeid=\"dnet:pid_types\"\n" + |
|
60 |
" schemename=\"dnet:pid_types\">pmc_test</pid>\n" + |
|
61 |
" <pid classid=\"orcidworkid\" classname=\"orcidworkid\" schemeid=\"dnet:pid_types\"\n" + |
|
62 |
" schemename=\"dnet:pid_types\">orcidworkid_test</pid>\n" + |
|
63 |
" <bestlicense classid=\"EMBARGO\" classname=\"Open Access\" schemeid=\"dnet:access_modes\"\n" + |
|
64 |
" schemename=\"dnet:access_modes\"/>\n" + |
|
65 |
"\t\t <children>\n" + |
|
66 |
"\t\t\t <instance id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\">\n" + |
|
67 |
"\t\t\t <licence classid=\"EMBARGO\" classname=\"Open Access\" schemeid=\"dnet:access_modes\"\n" + |
|
68 |
" schemename=\"dnet:access_modes\"/>\n" + |
|
69 |
" <instancetype classid=\"0001\" classname=\"Article\" schemeid=\"dnet:publication_resource\"\n" + |
|
70 |
" schemename=\"dnet:publication_resource\"/>\n" + |
|
71 |
" <hostedby name=\"CyberLeninka - Russian open access scientific library\"\n" + |
|
72 |
" id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\"/>\n" + |
|
73 |
"\t\t\t\t <webresource>\n" + |
|
74 |
"\t\t\t\t <url>http://cyberleninka.ru/article/n/postkonversionnaya-asistoliya-zheludochkov-serdtsa-u-bolnyh-infarktom-miokarda-i-vozmozhnosti-ee-profilaktiki</url>\n" + |
|
75 |
"\t\t\t\t </webresource>\n" + |
|
76 |
"\t\t\t\t <webresource>\n" + |
|
77 |
"\t\t\t\t <url>http://cyberleninka.ru/article_covers/5969541.png</url>\n" + |
|
78 |
"\t\t\t\t </webresource>\n" + |
|
79 |
"\t\t\t </instance>\n" + |
|
80 |
"\t\t </children>\n" + |
|
81 |
"\t\t </oaf:result>\n" + |
|
82 |
" </oaf:entity>\n" + |
|
83 |
" </metadata>\n" + |
|
84 |
" </result>\n" + |
|
85 |
"\t\t\t\t\t\t</results>\n" + |
|
86 |
"\t <browseResults>\n" + |
|
87 |
"\t\t\t</browseResults>\n" + |
|
88 |
"</response>"; |
|
89 |
|
|
90 |
|
|
91 |
|
|
92 |
/* |
|
93 |
"\t\t <children>\n" + |
|
94 |
"\t\t\t <instance id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\">\n" + |
|
95 |
"\t\t\t <licence classid=\"CLOSED\" classname=\"Open Access\" schemeid=\"dnet:access_modes\"\n" + |
|
96 |
" schemename=\"dnet:access_modes\"/>\n" + |
|
97 |
" <instancetype classid=\"0001\" classname=\"Article\" schemeid=\"dnet:publication_resource\"\n" + |
|
98 |
" schemename=\"dnet:publication_resource\"/>\n" + |
|
99 |
" <hostedby name=\"CyberLeninka - Russian open access scientific library\"\n" + |
|
100 |
" id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\"/>\n" + |
|
101 |
"\t\t\t\t <webresource>\n" + |
|
102 |
"\t\t\t\t <url>h CLOSED_ACCESS_URL</url>\n" + |
|
103 |
"\t\t\t\t </webresource>\n" + |
|
104 |
"\t\t\t\t <webresource>\n" + |
|
105 |
"\t\t\t\t <url>http://cyberleninka.ru/article_covers/5969541.png</url>\n" + |
|
106 |
"\t\t\t\t </webresource>\n" + |
|
107 |
"\t\t\t </instance>\n" + |
|
108 |
"\t\t </children>\n" + |
|
109 |
*/ |
|
110 |
@Test |
|
111 |
public void oaf2PublicationTest() throws Exception, ParserConfigurationException, SAXException, XPathExpressionException, IOException, TransformerException { |
|
112 |
Result result = OafParser.oaf2Result(publicationOaf); |
|
113 |
System.out.println(result.getExternalUrl()); |
|
114 |
Assert.assertNull(result.getAccessRights()); |
|
115 |
Assert.assertEquals("EMBARGO",result.getBestLicense()); |
|
116 |
Assert.assertEquals("infrastruct_::openaire", result.getCollectedFrom()); |
|
117 |
Assert.assertNull(result.getDoi()); |
|
118 |
Assert.assertEquals("oai:cyberleninka.ru:article/5969541",result.getOai()); |
|
119 |
Assert.assertEquals("od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46",result.getOpenaireId()); |
|
120 |
Assert.assertEquals("pmc_test",result.getPmcid()); |
|
121 |
Assert.assertEquals(ClaimUtils.PUBLICATION, result.getResultType()); |
|
122 |
Assert.assertEquals("ПОСТКОНВЕРСИОННАЯ АСИСТОЛИЯ ЖЕЛУДОЧКОВ СЕРДЦА У БОЛЬНЫХ ИНФАРКТОМ МИОКАРДА И ВОЗМОЖНОСТИ ЕЕ ПРОФИЛАКТИКИ",result.getTitle()); |
|
123 |
Assert.assertEquals("xml", result.getRecordFormat()); |
|
124 |
|
|
125 |
Assert.assertEquals("http://cyberleninka.ru/article/n/postkonversionnaya-asistoliya-zheludochkov-serdtsa-u-bolnyh-infarktom-miokarda-i-vozmozhnosti-ee-profilaktiki", result.getExternalUrl()); |
|
126 |
Assert.assertEquals("2099-12-31",result.getEmbargoEndDate()); |
|
127 |
Assert.assertEquals("orcidworkid_test", result.getOrcidworkid()); |
|
128 |
|
|
129 |
} |
|
130 |
private String publicationOpenAccessUrl = "<response>\n" + |
|
131 |
"\t <header>\n" + |
|
132 |
"\t\t <query>(((deletedbyinference = false) AND (oaftype exact result)) and (resulttypeid exact publication)) and (objidentifier exact od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46)</query>\n" + |
|
133 |
"\t\t\t\t <locale>en_GB</locale>\t\n" + |
|
134 |
"\t\t\t\t\t<size>10</size>\n" + |
|
135 |
"\t\t\t <page>1</page>\n" + |
|
136 |
"\t\t\t <total>1</total>\n" + |
|
137 |
"\t\t\t\t\t</header>\n" + |
|
138 |
"\t <results>\n" + |
|
139 |
"\t\t\t\t\t\t\t\t\t<result xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + |
|
140 |
" xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\"\n" + |
|
141 |
" xmlns:oaf=\"http://namespace.openaire.eu/oaf\">\n" + |
|
142 |
" <header>\n" + |
|
143 |
" <dri:objIdentifier>od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46</dri:objIdentifier>\n" + |
|
144 |
" <dri:dateOfCollection>2016-02-02T08:07:14Z</dri:dateOfCollection>\n" + |
|
145 |
" </header>\n" + |
|
146 |
" <metadata>\n" + |
|
147 |
" <oaf:entity xsi:schemaLocation=\"http://namespace.openaire.eu/oaf https://www.openaire.eu/schema/0.3/oaf-0.3.xsd\">\n" + |
|
148 |
"\t\t <oaf:result>\n" + |
|
149 |
" <title classid=\"main title\" classname=\"main title\" schemeid=\"dnet:dataCite_title\"\n" + |
|
150 |
" schemename=\"dnet:dataCite_title\">ПОСТКОНВЕРСИОННАЯ АСИСТОЛИЯ ЖЕЛУДОЧКОВ СЕРДЦА У БОЛЬНЫХ ИНФАРКТОМ МИОКАРДА И ВОЗМОЖНОСТИ ЕЕ ПРОФИЛАКТИКИ</title>\n" + |
|
151 |
" <dateofacceptance>2010-01-01</dateofacceptance>\n" + |
|
152 |
" <resulttype classid=\"publication\" classname=\"publication\" schemeid=\"dnet:result_typologies\"\n" + |
|
153 |
" schemename=\"dnet:result_typologies\"/>\n" + |
|
154 |
" <country classid=\"\" classname=\"\" schemeid=\"\" schemename=\"\"/>\n" + |
|
155 |
" <relevantdate classid=\"\" classname=\"\" schemeid=\"\" schemename=\"\"/>\n" + |
|
156 |
" <embargoenddate>2099-12-31</embargoenddate>\n" + |
|
157 |
" <originalId>oai:cyberleninka.ru:article/5969541</originalId>\n" + |
|
158 |
" <collectedfrom name=\"CyberLeninka - Russian open access scientific library\"\n" + |
|
159 |
" id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\"/>\n" + |
|
160 |
" <pid classid=\"oai\" classname=\"oai\" schemeid=\"dnet:pid_types\"\n" + |
|
161 |
" schemename=\"dnet:pid_types\">oai:cyberleninka.ru:article/5969541</pid>\n" + |
|
162 |
" <pid classid=\"pmc\" classname=\"pmc\" schemeid=\"dnet:pid_types\"\n" + |
|
163 |
" schemename=\"dnet:pid_types\">pmc_test</pid>\n" + |
|
164 |
" <pid classid=\"orcidworkid\" classname=\"orcidworkid\" schemeid=\"dnet:pid_types\"\n" + |
|
165 |
" schemename=\"dnet:pid_types\">orcidworkid_test</pid>\n" + |
|
166 |
" <bestlicense classid=\"EMBARGO\" classname=\"Open Access\" schemeid=\"dnet:access_modes\"\n" + |
|
167 |
" schemename=\"dnet:access_modes\"/>\n" + |
|
168 |
"\t\t <children>\n" + |
|
169 |
"\t\t\t <instance id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\">\n" + |
|
170 |
"\t\t\t <licence classid=\"CLOSED\" classname=\"Open Access\" schemeid=\"dnet:access_modes\"\n" + |
|
171 |
" schemename=\"dnet:access_modes\"/>\n" + |
|
172 |
" <instancetype classid=\"0001\" classname=\"Article\" schemeid=\"dnet:publication_resource\"\n" + |
|
173 |
" schemename=\"dnet:publication_resource\"/>\n" + |
|
174 |
" <hostedby name=\"CyberLeninka - Russian open access scientific library\"\n" + |
|
175 |
" id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\"/>\n" + |
|
176 |
"\t\t\t\t <webresource>\n" + |
|
177 |
"\t\t\t\t <url>http://CLOSED_ACCESS_URL</url>\n" + |
|
178 |
"\t\t\t\t </webresource>\n" + |
|
179 |
"\t\t\t\t <webresource>\n" + |
|
180 |
"\t\t\t\t <url>http://cyberleninka.ru/article_covers/5969541.png</url>\n" + |
|
181 |
"\t\t\t\t </webresource>\n" + |
|
182 |
"\t\t\t </instance>\n" + |
|
183 |
"\t\t </children>\n" + |
|
184 |
"\t\t <children>\n" + |
|
185 |
"\t\t\t <instance id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\">\n" + |
|
186 |
"\t\t\t <licence classid=\"EMBARGO\" classname=\"Open Access\" schemeid=\"dnet:access_modes\"\n" + |
|
187 |
" schemename=\"dnet:access_modes\"/>\n" + |
|
188 |
" <instancetype classid=\"0001\" classname=\"Article\" schemeid=\"dnet:publication_resource\"\n" + |
|
189 |
" schemename=\"dnet:publication_resource\"/>\n" + |
|
190 |
" <hostedby name=\"CyberLeninka - Russian open access scientific library\"\n" + |
|
191 |
" id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\"/>\n" + |
|
192 |
"\t\t\t\t <webresource>\n" + |
|
193 |
"\t\t\t\t <url>http://cyberleninka.ru/article/n/postkonversionnaya-asistoliya-zheludochkov-serdtsa-u-bolnyh-infarktom-miokarda-i-vozmozhnosti-ee-profilaktiki</url>\n" + |
|
194 |
"\t\t\t\t </webresource>\n" + |
|
195 |
"\t\t\t\t <webresource>\n" + |
|
196 |
"\t\t\t\t <url>http://cyberleninka.ru/article_covers/5969541.png</url>\n" + |
|
197 |
"\t\t\t\t </webresource>\n" + |
|
198 |
"\t\t\t </instance>\n" + |
|
199 |
"\t\t </children>\n" + |
|
200 |
|
|
201 |
|
|
202 |
|
|
203 |
"\t\t </oaf:result>\n" + |
|
204 |
" </oaf:entity>\n" + |
|
205 |
" </metadata>\n" + |
|
206 |
" </result>\n" + |
|
207 |
"\t\t\t\t\t\t</results>\n" + |
|
208 |
"\t <browseResults>\n" + |
|
209 |
"\t\t\t</browseResults>\n" + |
|
210 |
"</response>"; |
|
211 |
/* |
|
212 |
In this test, the oaf xml has multiple urls. The method should get the first "more" open Access with the following order (Open Access,Embargo, Closed ) |
|
213 |
*/ |
|
214 |
@Test |
|
215 |
public void oaf2PublicationOpenAccessUrlTest() throws Exception, ParserConfigurationException, SAXException, XPathExpressionException, IOException, TransformerException { |
|
216 |
Result result = OafParser.oaf2Result(publicationOpenAccessUrl); |
|
217 |
System.out.println(result.getExternalUrl()); |
|
218 |
Assert.assertNull(result.getAccessRights()); |
|
219 |
Assert.assertEquals("EMBARGO",result.getBestLicense()); |
|
220 |
Assert.assertEquals("infrastruct_::openaire", result.getCollectedFrom()); |
|
221 |
Assert.assertNull(result.getDoi()); |
|
222 |
Assert.assertEquals("oai:cyberleninka.ru:article/5969541",result.getOai()); |
|
223 |
Assert.assertEquals("od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46",result.getOpenaireId()); |
|
224 |
Assert.assertEquals("pmc_test",result.getPmcid()); |
|
225 |
Assert.assertEquals(ClaimUtils.PUBLICATION, result.getResultType()); |
|
226 |
Assert.assertEquals("ПОСТКОНВЕРСИОННАЯ АСИСТОЛИЯ ЖЕЛУДОЧКОВ СЕРДЦА У БОЛЬНЫХ ИНФАРКТОМ МИОКАРДА И ВОЗМОЖНОСТИ ЕЕ ПРОФИЛАКТИКИ",result.getTitle()); |
|
227 |
Assert.assertEquals("xml", result.getRecordFormat()); |
|
228 |
|
|
229 |
Assert.assertEquals("http://cyberleninka.ru/article/n/postkonversionnaya-asistoliya-zheludochkov-serdtsa-u-bolnyh-infarktom-miokarda-i-vozmozhnosti-ee-profilaktiki", result.getExternalUrl()); |
|
230 |
Assert.assertEquals("2099-12-31",result.getEmbargoEndDate()); |
|
231 |
Assert.assertEquals("orcidworkid_test", result.getOrcidworkid()); |
|
232 |
|
|
233 |
} |
|
234 |
private String publicationWithDoiOaf = "<response>\n" + |
|
235 |
"\t <header>\n" + |
|
236 |
"\t\t <query>(((deletedbyinference = false) AND (oaftype exact result)) and (resulttypeid exact publication)) and (objidentifier exact od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46)</query>\n" + |
|
237 |
"\t\t\t\t <locale>en_GB</locale>\t\n" + |
|
238 |
"\t\t\t\t\t<size>10</size>\n" + |
|
239 |
"\t\t\t <page>1</page>\n" + |
|
240 |
"\t\t\t <total>1</total>\n" + |
|
241 |
"\t\t\t\t\t</header>\n" + |
|
242 |
"\t <results>\n" + |
|
243 |
"\t\t\t\t\t\t\t\t\t<result xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + |
|
244 |
" xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\"\n" + |
|
245 |
" xmlns:oaf=\"http://namespace.openaire.eu/oaf\">\n" + |
|
246 |
" <header>\n" + |
|
247 |
" <dri:objIdentifier>od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46</dri:objIdentifier>\n" + |
|
248 |
" <dri:dateOfCollection>2016-02-02T08:07:14Z</dri:dateOfCollection>\n" + |
|
249 |
" </header>\n" + |
|
250 |
" <metadata>\n" + |
|
251 |
" <oaf:entity xsi:schemaLocation=\"http://namespace.openaire.eu/oaf https://www.openaire.eu/schema/0.3/oaf-0.3.xsd\">\n" + |
|
252 |
"\t\t <oaf:result>\n" + |
|
253 |
" <title classid=\"main title\" classname=\"main title\" schemeid=\"dnet:dataCite_title\"\n" + |
|
254 |
" schemename=\"dnet:dataCite_title\">ПОСТКОНВЕРСИОННАЯ АСИСТОЛИЯ ЖЕЛУДОЧКОВ СЕРДЦА У БОЛЬНЫХ ИНФАРКТОМ МИОКАРДА И ВОЗМОЖНОСТИ ЕЕ ПРОФИЛАКТИКИ</title>\n" + |
|
255 |
" <dateofacceptance>2010-01-01</dateofacceptance>\n" + |
|
256 |
" <resulttype classid=\"publication\" classname=\"publication\" schemeid=\"dnet:result_typologies\"\n" + |
|
257 |
" schemename=\"dnet:result_typologies\"/>\n" + |
|
258 |
" <country classid=\"\" classname=\"\" schemeid=\"\" schemename=\"\"/>\n" + |
|
259 |
" <relevantdate classid=\"\" classname=\"\" schemeid=\"\" schemename=\"\"/>\n" + |
|
260 |
" <embargoenddate>2099-12-31</embargoenddate>\n" + |
|
261 |
" <originalId>oai:cyberleninka.ru:article/5969541</originalId>\n" + |
|
262 |
" <collectedfrom name=\"CyberLeninka - Russian open access scientific library\"\n" + |
|
263 |
" id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\"/>\n" + |
|
264 |
" <pid classid=\"doi\" classname=\"doi\" schemeid=\"dnet:pid_types\"\n" + |
|
265 |
" schemename=\"dnet:pid_types\">doi_test</pid>\n" + |
|
266 |
" <pid classid=\"oai\" classname=\"oai\" schemeid=\"dnet:pid_types\"\n" + |
|
267 |
" schemename=\"dnet:pid_types\">oai:cyberleninka.ru:article/5969541</pid>\n" + |
|
268 |
" <pid classid=\"pmc\" classname=\"pmc\" schemeid=\"dnet:pid_types\"\n" + |
|
269 |
" schemename=\"dnet:pid_types\">pmc_test</pid>\n" + |
|
270 |
" <pid classid=\"orcidworkid\" classname=\"orcidworkid\" schemeid=\"dnet:pid_types\"\n" + |
|
271 |
" schemename=\"dnet:pid_types\">orcidworkid_test</pid>\n" + |
|
272 |
" <bestlicense classid=\"EMBARGO\" classname=\"Open Access\" schemeid=\"dnet:access_modes\"\n" + |
|
273 |
" schemename=\"dnet:access_modes\"/>\n" + |
|
274 |
"\t\t <children>\n" + |
|
275 |
"\t\t\t <instance id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\">\n" + |
|
276 |
"\t\t\t <licence classid=\"EMBARGO\" classname=\"Open Access\" schemeid=\"dnet:access_modes\"\n" + |
|
277 |
" schemename=\"dnet:access_modes\"/>\n" + |
|
278 |
" <instancetype classid=\"0001\" classname=\"Article\" schemeid=\"dnet:publication_resource\"\n" + |
|
279 |
" schemename=\"dnet:publication_resource\"/>\n" + |
|
280 |
" <hostedby name=\"CyberLeninka - Russian open access scientific library\"\n" + |
|
281 |
" id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\"/>\n" + |
|
282 |
"\t\t\t\t <webresource>\n" + |
|
283 |
"\t\t\t\t <url>http://cyberleninka.ru/article/n/postkonversionnaya-asistoliya-zheludochkov-serdtsa-u-bolnyh-infarktom-miokarda-i-vozmozhnosti-ee-profilaktiki</url>\n" + |
|
284 |
"\t\t\t\t </webresource>\n" + |
|
285 |
"\t\t\t\t <webresource>\n" + |
|
286 |
"\t\t\t\t <url>http://cyberleninka.ru/article_covers/5969541.png</url>\n" + |
|
287 |
"\t\t\t\t </webresource>\n" + |
|
288 |
"\t\t\t </instance>\n" + |
|
289 |
"\t\t </children>\n" + |
|
290 |
"\t\t </oaf:result>\n" + |
|
291 |
" </oaf:entity>\n" + |
|
292 |
" </metadata>\n" + |
|
293 |
" </result>\n" + |
|
294 |
"\t\t\t\t\t\t</results>\n" + |
|
295 |
"\t <browseResults>\n" + |
|
296 |
"\t\t\t</browseResults>\n" + |
|
297 |
"</response>"; |
|
298 |
@Test |
|
299 |
public void oafWithDoi2PublicationTest() throws Exception, ParserConfigurationException, SAXException, XPathExpressionException, IOException, TransformerException { |
|
300 |
Result result = OafParser.oaf2Result(publicationWithDoiOaf); |
|
301 |
Assert.assertNull(result.getAccessRights()); |
|
302 |
Assert.assertEquals("EMBARGO",result.getBestLicense()); |
|
303 |
Assert.assertEquals("infrastruct_::openaire", result.getCollectedFrom()); |
|
304 |
Assert.assertNotNull(result.getDoi()); |
|
305 |
Assert.assertEquals("oai:cyberleninka.ru:article/5969541",result.getOai()); |
|
306 |
Assert.assertEquals("od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46",result.getOpenaireId()); |
|
307 |
Assert.assertEquals("pmc_test",result.getPmcid()); |
|
308 |
Assert.assertEquals(ClaimUtils.PUBLICATION, result.getResultType()); |
|
309 |
Assert.assertEquals("ПОСТКОНВЕРСИОННАЯ АСИСТОЛИЯ ЖЕЛУДОЧКОВ СЕРДЦА У БОЛЬНЫХ ИНФАРКТОМ МИОКАРДА И ВОЗМОЖНОСТИ ЕЕ ПРОФИЛАКТИКИ",result.getTitle()); |
|
310 |
|
|
311 |
Assert.assertEquals("http://dx.doi.org/doi_test", result.getExternalUrl()); |
|
312 |
Assert.assertEquals("2099-12-31",result.getEmbargoEndDate()); |
|
313 |
Assert.assertEquals("orcidworkid_test", result.getOrcidworkid()); |
|
314 |
Assert.assertEquals("doi_test", result.getDoi()); |
|
315 |
|
|
316 |
|
|
317 |
} |
|
318 |
private String datasetOaf = "<response>\n" + |
|
319 |
"\t <header>\n" + |
|
320 |
"\t\t <query>(((deletedbyinference = false) AND (oaftype exact result)) and (resulttypeid exact publication)) and (objidentifier exact od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46)</query>\n" + |
|
321 |
"\t\t\t\t <locale>en_GB</locale>\t\n" + |
|
322 |
"\t\t\t\t\t<size>10</size>\n" + |
|
323 |
"\t\t\t <page>1</page>\n" + |
|
324 |
"\t\t\t <total>1</total>\n" + |
|
325 |
"\t\t\t\t\t</header>\n" + |
|
326 |
"\t <results>\n" + |
|
327 |
"\t\t\t\t\t\t\t\t\t<result xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + |
|
328 |
" xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\"\n" + |
|
329 |
" xmlns:oaf=\"http://namespace.openaire.eu/oaf\">\n" + |
|
330 |
" <header>\n" + |
|
331 |
" <dri:objIdentifier>od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46</dri:objIdentifier>\n" + |
|
332 |
" <dri:dateOfCollection>2016-02-02T08:07:14Z</dri:dateOfCollection>\n" + |
|
333 |
" </header>\n" + |
|
334 |
" <metadata>\n" + |
|
335 |
" <oaf:entity xsi:schemaLocation=\"http://namespace.openaire.eu/oaf https://www.openaire.eu/schema/0.3/oaf-0.3.xsd\">\n" + |
|
336 |
"\t\t <oaf:result>\n" + |
|
337 |
" <title classid=\"main title\" classname=\"main title\" schemeid=\"dnet:dataCite_title\"\n" + |
|
338 |
" schemename=\"dnet:dataCite_title\">ПОСТКОНВЕРСИОННАЯ АСИСТОЛИЯ ЖЕЛУДОЧКОВ СЕРДЦА У БОЛЬНЫХ ИНФАРКТОМ МИОКАРДА И ВОЗМОЖНОСТИ ЕЕ ПРОФИЛАКТИКИ</title>\n" + |
|
339 |
" <dateofacceptance>2010-01-01</dateofacceptance>\n" + |
|
340 |
" <resulttype classid=\"dataset\" classname=\"dataset\" schemeid=\"dnet:result_typologies\"\n" + |
|
341 |
" schemename=\"dnet:result_typologies\"/>\n" + |
|
342 |
" <country classid=\"\" classname=\"\" schemeid=\"\" schemename=\"\"/>\n" + |
|
343 |
" <relevantdate classid=\"\" classname=\"\" schemeid=\"\" schemename=\"\"/>\n" + |
|
344 |
" <embargoenddate>2099-12-31</embargoenddate>\n" + |
|
345 |
" <originalId>oai:cyberleninka.ru:article/5969541</originalId>\n" + |
|
346 |
" <collectedfrom name=\"CyberLeninka - Russian open access scientific library\"\n" + |
|
347 |
" id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\"/>\n" + |
|
348 |
" <pid classid=\"oai\" classname=\"oai\" schemeid=\"dnet:pid_types\"\n" + |
|
349 |
" schemename=\"dnet:pid_types\">oai:cyberleninka.ru:article/5969541</pid>\n" + |
|
350 |
" <pid classid=\"doi\" classname=\"doi\" schemeid=\"dnet:pid_types\"\n" + |
|
351 |
" schemename=\"dnet:pid_types\">doi_test</pid>\n" + |
|
352 |
" <pid classid=\"pmc\" classname=\"pmc\" schemeid=\"dnet:pid_types\"\n" + |
|
353 |
" schemename=\"dnet:pid_types\">pmc_test</pid>\n" + |
|
354 |
" <pid classid=\"orcidworkid\" classname=\"orcidworkid\" schemeid=\"dnet:pid_types\"\n" + |
|
355 |
" schemename=\"dnet:pid_types\">orcidworkid_test</pid>\n" + |
|
356 |
" <bestlicense classid=\"EMBARGO\" classname=\"Open Access\" schemeid=\"dnet:access_modes\"\n" + |
|
357 |
" schemename=\"dnet:access_modes\"/>\n" + |
|
358 |
"\t\t <children>\n" + |
|
359 |
"\t\t\t <instance id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\">\n" + |
|
360 |
"\t\t\t <licence classid=\"OPEN\" classname=\"Open Access\" schemeid=\"dnet:access_modes\"\n" + |
|
361 |
" schemename=\"dnet:access_modes\"/>\n" + |
|
362 |
" <instancetype classid=\"0001\" classname=\"Article\" schemeid=\"dnet:publication_resource\"\n" + |
|
363 |
" schemename=\"dnet:publication_resource\"/>\n" + |
|
364 |
" <hostedby name=\"CyberLeninka - Russian open access scientific library\"\n" + |
|
365 |
" id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\"/>\n" + |
|
366 |
"\t\t\t\t <webresource>\n" + |
|
367 |
"\t\t\t\t <url>http://cyberleninka.ru/article/n/postkonversionnaya-asistoliya-zheludochkov-serdtsa-u-bolnyh-infarktom-miokarda-i-vozmozhnosti-ee-profilaktiki</url>\n" + |
|
368 |
"\t\t\t\t </webresource>\n" + |
|
369 |
"\t\t\t\t <webresource>\n" + |
|
370 |
"\t\t\t\t <url>http://cyberleninka.ru/article_covers/5969541.png</url>\n" + |
|
371 |
"\t\t\t\t </webresource>\n" + |
|
372 |
"\t\t\t </instance>\n" + |
|
373 |
"\t\t </children>\n" + |
|
374 |
"\t\t </oaf:result>\n" + |
|
375 |
" </oaf:entity>\n" + |
|
376 |
" </metadata>\n" + |
|
377 |
" </result>\n" + |
|
378 |
"\t\t\t\t\t\t</results>\n" + |
|
379 |
"\t <browseResults>\n" + |
|
380 |
"\t\t\t</browseResults>\n" + |
|
381 |
"</response>"; |
|
382 |
|
|
383 |
|
|
384 |
@Test |
|
385 |
public void oaf2DatasetTest() throws Exception, ParserConfigurationException, SAXException, XPathExpressionException, IOException, TransformerException { |
|
386 |
Result result = OafParser.oaf2Result(datasetOaf); |
|
387 |
|
|
388 |
Assert.assertNull(result.getAccessRights()); |
|
389 |
Assert.assertEquals("EMBARGO",result.getBestLicense()); |
|
390 |
Assert.assertEquals("infrastruct_::openaire", result.getCollectedFrom()); |
|
391 |
Assert.assertEquals("oai:cyberleninka.ru:article/5969541",result.getOai()); |
|
392 |
Assert.assertEquals("od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46",result.getOpenaireId()); |
|
393 |
Assert.assertEquals("pmc_test",result.getPmcid()); |
|
394 |
Assert.assertEquals(ClaimUtils.DATASET, result.getResultType()); |
|
395 |
Assert.assertEquals("ПОСТКОНВЕРСИОННАЯ АСИСТОЛИЯ ЖЕЛУДОЧКОВ СЕРДЦА У БОЛЬНЫХ ИНФАРКТОМ МИОКАРДА И ВОЗМОЖНОСТИ ЕЕ ПРОФИЛАКТИКИ",result.getTitle()); |
|
396 |
Assert.assertEquals("xml", result.getRecordFormat()); |
|
397 |
|
|
398 |
Assert.assertEquals("http://dx.doi.org/doi_test", result.getExternalUrl()); |
|
399 |
Assert.assertEquals("2099-12-31",result.getEmbargoEndDate()); |
|
400 |
Assert.assertEquals("orcidworkid_test", result.getOrcidworkid()); |
|
401 |
Assert.assertEquals("doi_test", result.getDoi()); |
|
402 |
|
|
403 |
} |
|
404 |
|
|
405 |
|
|
406 |
|
|
407 |
private String projectOaf = "<response>\n" + |
|
408 |
"\t <header>\n" + |
|
409 |
"\t\t <query>((deletedbyinference = false) AND (oaftype exact project)) and (projectcode exact 314867)</query>\n" + |
|
410 |
"\t\t\t\t <locale>en_GB</locale>\t\n" + |
|
411 |
"\t\t\t\t\t<size>10</size>\n" + |
|
412 |
"\t\t\t <page>1</page>\n" + |
|
413 |
"\t\t\t <total>1</total>\n" + |
|
414 |
"\t\t\t\t\t</header>\n" + |
|
415 |
"\t <results>\n" + |
|
416 |
"\t\t\t\t\t\t\t\t\t<result xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + |
|
417 |
" xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\"\n" + |
|
418 |
" xmlns:oaf=\"http://namespace.openaire.eu/oaf\">\n" + |
|
419 |
" <header>\n" + |
|
420 |
" <dri:objIdentifier>corda_______::073d0a668885f9e7292a5d9c323e4a20</dri:objIdentifier>\n" + |
|
421 |
" <dri:dateOfCollection>2015-08-24</dri:dateOfCollection>\n" + |
|
422 |
" <counters>\n" + |
|
423 |
"\t <counter_participation value=\"8\"/>\n" + |
|
424 |
" <counter_contactPerson value=\"1\"/>\n" + |
|
425 |
"\t </counters>\n" + |
|
426 |
" </header>\n" + |
|
427 |
" <metadata>\n" + |
|
428 |
" <oaf:entity xsi:schemaLocation=\"http://namespace.openaire.eu/oaf https://www.openaire.eu/schema/0.3/oaf-0.3.xsd\">\n" + |
|
429 |
"\t\t <oaf:project>\n" + |
|
430 |
"\t\t\t <code>314867</code>\n" + |
|
431 |
" <acronym>ADAW</acronym>\n" + |
|
432 |
" <title>Saponification pre-treatment and biosensors based control system for slaughterhouse waste anaerobic digestion improvement</title>\n" + |
|
433 |
" <startdate>2013-03-01</startdate>\n" + |
|
434 |
" <enddate>2015-02-28</enddate>\n" + |
|
435 |
" <callidentifier>FP7-SME-2012</callidentifier>\n" + |
|
436 |
" <ecsc39>false</ecsc39>\n" + |
|
437 |
" <oamandatepublications>false</oamandatepublications>\n" + |
|
438 |
" <contracttype classid=\"BSG\" classname=\"Research for the benefit of specific groups\"\n" + |
|
439 |
" schemeid=\"ec:FP7contractTypes\"\n" + |
|
440 |
" schemename=\"ec:FP7contractTypes\"/>\n" + |
|
441 |
" <fundingtree>\n" + |
|
442 |
" <funder>\n" + |
|
443 |
" <id>ec__________::EC</id>\n" + |
|
444 |
" <shortname>EC</shortname>\n" + |
|
445 |
" <name>European Commission</name>\n" + |
|
446 |
" <jurisdiction>EU</jurisdiction>\n" + |
|
447 |
" </funder>\n" + |
|
448 |
" <funding_level_2>\n" + |
|
449 |
" <id>ec__________::EC::FP7::SP4::SME</id>\n" + |
|
450 |
" <description>Research for the benefit of SMEs</description>\n" + |
|
451 |
" <name>SME</name>\n" + |
|
452 |
" <class>ec:program</class>\n" + |
|
453 |
" <parent>\n" + |
|
454 |
" <funding_level_1>\n" + |
|
455 |
" <id>ec__________::EC::FP7::SP4</id>\n" + |
|
456 |
" <description>SP4-Capacities</description>\n" + |
|
457 |
" <name>SP4</name>\n" + |
|
458 |
" <class>ec:specificprogram</class>\n" + |
|
459 |
" <parent>\n" + |
|
460 |
" <funding_level_0>\n" + |
|
461 |
" <id>ec__________::EC::FP7</id>\n" + |
|
462 |
" <description>SEVENTH FRAMEWORK PROGRAMME</description>\n" + |
|
463 |
" <name>FP7</name>\n" + |
|
464 |
" <parent/>\n" + |
|
465 |
" <class>ec:frameworkprogram</class>\n" + |
|
466 |
" </funding_level_0>\n" + |
|
467 |
" </parent>\n" + |
|
468 |
" </funding_level_1>\n" + |
|
469 |
" </parent>\n" + |
|
470 |
" </funding_level_2>\n" + |
|
471 |
" </fundingtree>\n" + |
|
472 |
" <websiteurl/>\n" + |
|
473 |
" <keywords/>\n" + |
|
474 |
" <duration/>\n" + |
|
475 |
" <ecarticle29_3/>\n" + |
|
476 |
" <subjects classid=\"\" classname=\"\" schemeid=\"\" schemename=\"\"/>\n" + |
|
477 |
" <originalId>corda_______::314867</originalId>\n" + |
|
478 |
" <collectedfrom name=\"CORDA - COmmon Research DAta Warehouse\"\n" + |
|
479 |
" id=\"openaire____::b30dac7baac631f3da7c2bb18dd9891f\"/>\n" + |
|
480 |
" <pid classid=\"\" classname=\"\" schemeid=\"\" schemename=\"\"/>\n" + |
|
481 |
" <datainfo>\n" + |
|
482 |
" <inferred>false</inferred>\n" + |
|
483 |
" <deletedbyinference>false</deletedbyinference>\n" + |
|
484 |
" <trust>0.9</trust>\n" + |
|
485 |
" <inferenceprovenance/>\n" + |
|
486 |
" <provenanceaction classid=\"sysimport:crosswalk:entityregistry\"\n" + |
|
487 |
" classname=\"sysimport:crosswalk:entityregistry\"\n" + |
|
488 |
" schemeid=\"dnet:provenanceActions\"\n" + |
|
489 |
" schemename=\"dnet:provenanceActions\"/>\n" + |
|
490 |
" </datainfo>\n" + |
|
491 |
"\t\t <rels>\n" + |
|
492 |
"<rel inferred=\"true\" trust=\"0.9\" inferenceprovenance=\"\" provenanceaction=\"UNKNOWN\"><to class=\"hasContact\" scheme=\"dnet:project_person_relations\" type=\"person\">dedup_wf_001::2b56ecf626015b620e97915cb0686ca1</to><fax> </fax><email>email@gmail.com</email><phone> </phone><fullname>Contact, Name</fullname></rel>" + |
|
493 |
"\t\t </rels>\n" + |
|
494 |
"\t\t <children>\n" + |
|
495 |
"\t\t </children>\n" + |
|
496 |
"\t\t </oaf:project>\n" + |
|
497 |
"\n" + |
|
498 |
" </oaf:entity>\n" + |
|
499 |
" </metadata>\n" + |
|
500 |
" </result>\n" + |
|
501 |
"\t\t\t\t\t\t</results>\n" + |
|
502 |
"\t <browseResults>\n" + |
|
503 |
"\t\t\t</browseResults>\n" + |
|
504 |
"</response>"; |
|
505 |
|
|
506 |
|
|
507 |
|
|
508 |
@Test |
|
509 |
public void oaf2ProjectTest() throws Exception { |
|
510 |
Project project = OafParser.oaf2Project(projectOaf); |
|
511 |
|
|
512 |
Assert.assertEquals("corda_______::073d0a668885f9e7292a5d9c323e4a20", project.getOpenaireId()); |
|
513 |
Assert.assertEquals("ADAW", project.getAcronym()); |
|
514 |
Assert.assertEquals("ec__________::EC", project.getFunderId()); |
|
515 |
Assert.assertEquals("EC", project.getFunderShortName()); |
|
516 |
Assert.assertEquals("European Commission", project.getFunderName()); |
|
517 |
Assert.assertEquals("Saponification pre-treatment and biosensors based control system for slaughterhouse waste anaerobic digestion improvement", project.getName()); |
|
518 |
Assert.assertEquals(1, project.getContactEmails().size()); |
|
519 |
Assert.assertEquals("email@gmail.com", project.getContactEmails().get(0)); |
|
520 |
} |
|
521 |
|
|
522 |
|
|
523 |
} |
modules/uoa-claims/claims-demo/src/test/java/eu/dnetlib/data/claims/migration/parser/DMFParserTest.java | ||
---|---|---|
1 |
package eu.dnetlib.data.claims.migration.parser; |
|
2 |
|
|
3 |
import eu.dnetlib.data.claims.migration.entity.Context; |
|
4 |
import eu.dnetlib.data.claims.migration.entity.Result; |
|
5 |
import eu.dnetlib.data.claims.migration.handler.DMFContextHandler; |
|
6 |
import org.junit.Assert; |
|
7 |
import org.junit.Test; |
|
8 |
import org.xml.sax.SAXException; |
|
9 |
|
|
10 |
import javax.xml.parsers.ParserConfigurationException; |
|
11 |
import javax.xml.xpath.XPathExpressionException; |
|
12 |
import java.io.IOException; |
|
13 |
|
|
14 |
/** |
|
15 |
* Created by kiatrop on 23/2/2016. |
|
16 |
*/ |
|
17 |
public class DMFParserTest { |
|
18 |
|
|
19 |
private String publicationDmf= "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + |
|
20 |
"<record xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:prov=\"http://www.openarchives.org/OAI/2.0/provenance\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\" xmlns:dr=\"http://www.driver-repository.eu/namespace/dr\" xmlns:oaf=\"http://namespace.openaire.eu/oaf\">\n" + |
|
21 |
" <header xmlns=\"http://namespace.openaire.eu/\">\n" + |
|
22 |
" <dri:objIdentifier>crossref____::47593e13b24bcdd0f3d5573499f1d3a9</dri:objIdentifier>\n" + |
|
23 |
" <dri:recordIdentifier>10.1088/0004-637X/761/1/34</dri:recordIdentifier>\n" + |
|
24 |
" <dri:dateOfCollection></dri:dateOfCollection>\n" + |
|
25 |
" <dri:mdFormat></dri:mdFormat>\n" + |
|
26 |
" <dri:mdFormatInterpretation></dri:mdFormatInterpretation>\n" + |
|
27 |
" <dri:repositoryId></dri:repositoryId>\n" + |
|
28 |
" <dr:objectIdentifier></dr:objectIdentifier>\n" + |
|
29 |
" <dr:dateOfCollection>2014-10-10T14:59:49+00:00</dr:dateOfCollection>\n" + |
|
30 |
" <oaf:datasourceprefix>crossref____</oaf:datasourceprefix>\n" + |
|
31 |
" </header>\n" + |
|
32 |
" <metadata xmlns=\"http://namespace.openaire.eu/\">\n" + |
|
33 |
" <dc:dateAccepted>2012-01-01T00:00:00Z</dc:dateAccepted>\n" + |
|
34 |
" <dc:identifier>http://stacks.iop.org/0004-637X/761/i=1/a=34?key=crossref.d14dae8ac205453af63561a69c108e13</dc:identifier>\n" + |
|
35 |
" <dc:title>A THREE-DIMENSIONAL VIEW OF THE REMNANT OF NOVA PERSEI 1901 (GK Per)</dc:title>\n" + |
|
36 |
" <oaf:collectedDatasourceid>openaire____::crossref</oaf:collectedDatasourceid>\n" + |
|
37 |
" <oaf:accessrights></oaf:accessrights>\n" + |
|
38 |
" <oaf:hostedBy name=\"Unknown Repository\" id=\"openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18\"/>\n" + |
|
39 |
" <oaf:collectedFrom name=\"Crossref\" id=\"openaire____::crossref\" />\n" + |
|
40 |
" \n" + |
|
41 |
" <dc:creator>Liimets, T.</dc:creator>\n" + |
|
42 |
" <dc:creator>Corradi, R. L. M.</dc:creator>\n" + |
|
43 |
" <dc:creator>Santander-García, M.</dc:creator>\n" + |
|
44 |
" <dc:creator>Villaver, E.</dc:creator>\n" + |
|
45 |
" <dc:creator>Rodríguez-Gil, P.</dc:creator>\n" + |
|
46 |
" <dc:creator>Verro, K.</dc:creator>\n" + |
|
47 |
" <dc:creator>Kolka, I.</dc:creator>\n" + |
|
48 |
" \n" + |
|
49 |
" <dc:identifier identifierType=\"doi\">10.1088/0004-637X/761/1/34</dc:identifier>\n" + |
|
50 |
//" <dr:CobjIdentifier>10.1088/0004-637X/761/1/34</dr:CobjIdentifier>\n" + |
|
51 |
" <dc:identifier identifierType=\"orcidworkid\">0000-0002-1112-1292-12694010</dc:identifier>\n" + |
|
52 |
//" <dr:CobjIdentifier>0000-0002-1112-1292-12694010</dr:CobjIdentifier>" + |
|
53 |
" </metadata>\n" + |
|
54 |
"</record>"; |
|
55 |
|
|
56 |
@Test |
|
57 |
public void dmf2PublicationTest() throws IOException, SAXException, ParserConfigurationException { |
|
58 |
Result result = DMFParser.dmf2Result(publicationDmf); |
|
59 |
|
|
60 |
Assert.assertNull(result.getAccessRights()); |
|
61 |
Assert.assertNull(result.getBestLicense()); |
|
62 |
Assert.assertEquals("openaire____::crossref", result.getCollectedFrom()); |
|
63 |
Assert.assertEquals("10.1088/0004-637X/761/1/34", result.getDoi()); |
|
64 |
Assert.assertEquals("0000-0002-1112-1292-12694010", result.getOrcidworkid()); |
|
65 |
Assert.assertNull(result.getOai()); |
|
66 |
Assert.assertEquals("crossref____::47593e13b24bcdd0f3d5573499f1d3a9", result.getOpenaireId()); |
|
67 |
Assert.assertNull(result.getPmcid()); |
|
68 |
Assert.assertEquals("A THREE-DIMENSIONAL VIEW OF THE REMNANT OF NOVA PERSEI 1901 (GK Per)", result.getTitle()); |
|
69 |
Assert.assertEquals("xml", result.getRecordFormat()); |
|
70 |
Assert.assertEquals("http://dx.doi.org/10.1088/0004-637X/761/1/34", result.getExternalUrl()); |
|
71 |
Assert.assertNull(result.getEmbargoEndDate()); |
|
72 |
|
|
73 |
} |
|
74 |
|
|
75 |
private String contextDmf = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + |
|
76 |
"<record xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:prov=\"http://www.openarchives.org/OAI/2.0/provenance\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\" xmlns:dr=\"http://www.driver-repository.eu/namespace/dr\" xmlns:oaf=\"http://namespace.openaire.eu/oaf\">\n" + |
|
77 |
" <header xmlns=\"http://namespace.openaire.eu/\">\n" + |
|
78 |
" <dri:objIdentifier>od______1031::ec6940963d90d1e275970ed2a0ac2508</dri:objIdentifier>\n" + |
|
79 |
" <dri:recordIdentifier>od______1031::ec6940963d90d1e275970ed2a0ac2508</dri:recordIdentifier>\n" + |
|
80 |
" <dri:dateOfCollection></dri:dateOfCollection>\n" + |
|
81 |
" <dri:mdFormat></dri:mdFormat>\n" + |
|
82 |
" <dri:mdFormatInterpretation></dri:mdFormatInterpretation>\n" + |
|
83 |
" <dri:repositoryId></dri:repositoryId>\n" + |
|
84 |
" <dr:objectIdentifier></dr:objectIdentifier>\n" + |
|
85 |
" <dr:dateOfCollection>2015-01-22T11:40:51+00:00</dr:dateOfCollection>\n" + |
|
86 |
" <oaf:datasourceprefix>openaire____</oaf:datasourceprefix>\n" + |
|
87 |
" </header>\n" + |
|
88 |
" <metadata xmlns=\"http://namespace.openaire.eu/\">\n" + |
|
89 |
" <oaf:collectedDatasourceid></oaf:collectedDatasourceid>\n" + |
|
90 |
" <oaf:hostedBy name=\"\" id=\"\"/>\n" + |
|
91 |
" <oaf:collectedFrom name=\"\" id=\"\" />\n" + |
|
92 |
" \n" + |
|
93 |
" <oaf:concept id=\"egi::country::gr\" />\n" + |
|
94 |
"\n" + |
|
95 |
"\n" + |
|
96 |
"\n" + |
|
97 |
" </metadata>\n" + |
|
98 |
"</record>"; |
|
99 |
|
|
100 |
@Test |
|
101 |
public void dmf2ContextTest() throws IOException, SAXException, ParserConfigurationException, XPathExpressionException { |
|
102 |
DMFParser dmfParser= new DMFParser(); |
|
103 |
DMFContextHandler dmfContextHandler = new DMFContextHandler(); |
|
104 |
Context context = dmfContextHandler.extractContextFromDMF(contextDmf); |
|
105 |
|
|
106 |
Assert.assertEquals("egi::country::gr", context.getOpenaireId()); |
|
107 |
Assert.assertEquals("EGI> EGI Countries> Greece", context.getTitle()); |
|
108 |
} |
|
109 |
|
|
110 |
} |
modules/uoa-claims/claims-demo/src/test/java/eu/dnetlib/data/claims/migration/parser/RelationParserTest.java | ||
---|---|---|
1 |
package eu.dnetlib.data.claims.migration.parser; |
|
2 |
|
|
3 |
import eu.dnetlib.data.claims.migration.entity.Relation; |
|
4 |
import eu.dnetlib.data.claimsDemo.ClaimUtils; |
|
5 |
import org.junit.Assert; |
|
6 |
import org.junit.Test; |
|
7 |
|
|
8 |
/** |
|
9 |
* Created by kiatrop on 9/2/2016. |
|
10 |
*/ |
|
11 |
public class RelationParserTest { |
|
12 |
|
|
13 |
private final String projectResultXml = |
|
14 |
"<RELATIONS>" + |
|
15 |
"<RELATION type='resultProject' source='50|od______2367::63368dc45b69d3eac6bf94b0181b4e64' target='40|corda_______::fe4cbcc8f465c016c034a4f93965074c' />" + |
|
16 |
"</RELATIONS>"; |
|
17 |
|
|
18 |
private final String publicationDatasetXml = |
|
19 |
"<RELATIONS>" + |
|
20 |
"<RELATION type='resultResult_publicationdataset_isRelatedTo' source='50|dedup_wf_001::f81ff2795647ddd5756b046c026e22ec' target='50|datacite____::6302a4307468b410343413c04b11453b' />" + |
|
21 |
"</RELATIONS>"; |
|
22 |
|
|
23 |
private final String datasetPublicationXml = |
|
24 |
"<RELATIONS>" + |
|
25 |
"<RELATION type='resultResult_datasetpublication_isRelatedTo' source='50|r37b0ad08687::f016cea0f48814bea455804017883872' target='50|crossref____::68178723a3e54b2ab18acb8e2859ddaf' />" + |
|
26 |
"</RELATIONS>"; |
|
27 |
|
|
28 |
|
|
29 |
@Test |
|
30 |
public void xml2Relation_projectResult_test() { |
|
31 |
Relation relation = RelationParser.xml2Relation(projectResultXml); |
|
32 |
Assert.assertEquals(relation.getSourceId(), "corda_______::fe4cbcc8f465c016c034a4f93965074c"); |
|
33 |
Assert.assertEquals(relation.getSourceType(), ClaimUtils.PROJECT); |
|
34 |
Assert.assertEquals(relation.getTargetId(), "od______2367::63368dc45b69d3eac6bf94b0181b4e64"); |
|
35 |
Assert.assertEquals(relation.getTargetType(), ClaimUtils.PUBLICATION); |
|
36 |
} |
|
37 |
|
|
38 |
@Test |
|
39 |
public void xml2Relation_publicationDataset_test() { |
|
40 |
Relation relation = RelationParser.xml2Relation(publicationDatasetXml); |
|
41 |
Assert.assertEquals(relation.getSourceId(), "datacite____::6302a4307468b410343413c04b11453b"); |
|
42 |
Assert.assertEquals(relation.getSourceType(), ClaimUtils.DATASET); |
|
43 |
Assert.assertEquals(relation.getTargetId(), "dedup_wf_001::f81ff2795647ddd5756b046c026e22ec"); |
|
44 |
Assert.assertEquals(relation.getTargetType(), ClaimUtils.PUBLICATION); |
|
45 |
} |
|
46 |
|
|
47 |
@Test |
|
48 |
public void xml2Relation_datasetPublication_test() { |
|
49 |
Relation relation = RelationParser.xml2Relation(datasetPublicationXml); |
|
50 |
Assert.assertEquals(relation.getSourceId(), "crossref____::68178723a3e54b2ab18acb8e2859ddaf"); |
|
51 |
Assert.assertEquals(relation.getSourceType(), ClaimUtils.PUBLICATION); |
|
52 |
Assert.assertEquals(relation.getTargetId(), "r37b0ad08687::f016cea0f48814bea455804017883872"); |
|
53 |
Assert.assertEquals(relation.getTargetType(), ClaimUtils.DATASET); |
|
54 |
} |
|
55 |
|
|
56 |
} |
modules/uoa-claims/claims-demo/src/main/resources/eu/dnetlib/data/claims/migration/springContext-claimsDemo.properties | ||
---|---|---|
1 |
|
|
2 |
services.claimsDemo.db.driverClassName = org.postgresql.Driver |
|
3 |
services.claimsDemo.db.url = jdbc:postgresql://scoobydoo.di.uoa.gr:5432/claimsnewschema |
|
4 |
services.claimsDemo.db.username = invalid_username |
|
5 |
services.claimsDemo.db.password = invalid_password |
|
6 |
services.claimsDemo.directClaim.APIURL = http://beta.services.openaire.eu:8280/is/mvc/api/publications |
|
7 |
|
|
8 |
#email properties |
|
9 |
## EMAIL SETTINGS |
|
10 |
services.claims.mail.host = smtp.gmail.com |
|
11 |
services.claims.mail.port = 587 |
|
12 |
services.claims.mail.from = invalid_email@email.com |
|
13 |
services.claims.mail.password = invalid_password |
|
14 |
services.claims.mail.angularUrl = http://duffy.di.uoa.gr:3000/claims-project-manager?token= |
|
15 |
services.claims.mail.specialRecipients = invalid_recipient@email.com |
|
16 |
|
|
17 |
services.claimsDemo.results.pathToSaveRecord = /home/argirok/claims/records/ |
|
18 |
services.claimsDemo.reports.pathToSaveReport = /home/argirok/claims/reports/ |
modules/uoa-claims/claims-demo/src/main/resources/eu/dnetlib/data/claims/migration/springContext-claimsDemo.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<beans xmlns="http://www.springframework.org/schema/beans" |
|
3 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
4 |
xmlns:context="http://www.springframework.org/schema/context" |
|
5 |
xmlns:cxf="http://cxf.apache.org/core" |
|
6 |
xmlns:jaxws="http://cxf.apache.org/jaxws" |
|
7 |
xmlns:p="http://http://www.springframework.org/schema/p" |
|
8 |
xmlns:template="http://dnetlib.eu/springbeans/template" |
|
9 |
xmlns:t="http://dnetlib.eu/springbeans/t" |
|
10 |
|
|
11 |
xsi:schemaLocation=" |
|
12 |
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd |
|
13 |
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd |
|
14 |
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd |
|
15 |
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd |
|
16 |
http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd" |
|
17 |
default-autowire="byName"> |
|
18 |
<!--Un comment in order to run the tests / Comment to deploy--> |
|
19 |
<!--<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">--> |
|
20 |
<!--<property name="locations" value="classpath:eu/dnetlib/data/claims/migration/springContext-claimsDemo.properties"/>--> |
|
21 |
<!--</bean>--> |
|
22 |
<bean id="directIndexHandler" class="eu.dnetlib.data.claims.migration.handler.DirectIndexHandler"> |
|
23 |
<property name="directClaimAPIUrl" value="http://beta.services.openaire.eu:8280/is/mvc/api/publications"/> |
|
24 |
</bean> |
|
25 |
<bean id="fetchClaimHandler" class="eu.dnetlib.data.claims.migration.handler.FetchClaimHandler"> |
|
26 |
<property name="sqlDAO" ref="sqlDao"/> |
|
27 |
<property name="queryGenerator" ref="queryGenerator"/> |
|
28 |
|
|
29 |
</bean> |
|
30 |
<bean id="claimHandler" class="eu.dnetlib.data.claims.migration.handler.ClaimHandler"> |
|
31 |
<property name="sqlDAO" ref="sqlDao"/> |
|
32 |
<property name="queryGenerator" ref="queryGenerator"/> |
|
33 |
<property name="dmfContextHandler" ref="dmfContextHandler"/> |
|
34 |
<property name="projectHandler" ref="projectHandler"/> |
|
35 |
<property name="resultHandler" ref="resultHandler"/> |
|
36 |
<property name="claimValidation" ref="claimValidation"/> |
|
37 |
</bean> |
|
38 |
<bean id="externalRecordHandler" class="eu.dnetlib.data.claims.migration.handler.ExternalRecordHandler"> |
|
39 |
<property name="searchUtils" ref="searchUtils"/> |
|
40 |
<property name="externalRecordParser" ref="externalRecordParser"/> |
|
41 |
</bean> |
|
42 |
<bean id="dmfResultHandler" class="eu.dnetlib.data.claims.migration.handler.DMFResultHandler"> |
|
43 |
<property name="sqlDAO" ref="sqlDao"/> |
|
44 |
<property name="queryGenerator" ref="queryGenerator"/> |
|
45 |
<property name="dmfParser" ref="dmfParser"/> |
|
46 |
</bean> |
|
47 |
<bean id="dmfContextHandler" class="eu.dnetlib.data.claims.migration.handler.DMFContextHandler"> |
|
48 |
<property name="sqlDAO" ref="sqlDao"/> |
|
49 |
<property name="queryGenerator" ref="queryGenerator"/> |
|
50 |
<property name="dmfParser" ref="dmfParser"/> |
|
51 |
</bean> |
|
52 |
<bean id="fetchProjectHandler" class="eu.dnetlib.data.claims.migration.handler.FetchProjectHandler"> |
|
53 |
<property name="sqlDAO" ref="sqlDao"/> |
|
54 |
<property name="queryGenerator" ref="queryGenerator"/> |
|
55 |
|
|
56 |
</bean> |
|
57 |
|
|
58 |
<bean id="projectHandler" class="eu.dnetlib.data.claims.migration.handler.ProjectHandler"> |
|
59 |
<property name="searchUtils" ref="searchUtils"/> |
|
60 |
<property name="oafParser" ref="oafParser"/> |
|
61 |
<property name="queryGenerator" ref="queryGenerator"/> |
|
62 |
<property name="sqlDAO" ref="sqlDao"/> |
|
63 |
</bean> |
|
64 |
|
|
65 |
<bean id="contextRelationHandler" class="eu.dnetlib.data.claims.migration.handler.ContextRelationHandler"> |
|
66 |
<property name="sqlDAO" ref="sqlDao"/> |
|
67 |
<property name="queryGenerator" ref="queryGenerator"/> |
|
68 |
<property name="dmfParser" ref="dmfParser"/> |
|
69 |
</bean> |
|
70 |
<bean id="relationHandler" class="eu.dnetlib.data.claims.migration.handler.RelationHandler"> |
|
71 |
<property name="sqlDAO" ref="sqlDao"/> |
|
72 |
<property name="queryGenerator" ref="queryGenerator"/> |
|
73 |
<property name="relationParser" ref="relationParser"/> |
|
74 |
</bean> |
|
75 |
<bean id="indexResultHandler" class="eu.dnetlib.data.claims.migration.handler.IndexResultHandler"> |
|
76 |
<property name="searchUtils" ref="searchUtils"/> |
|
77 |
</bean> |
|
78 |
<bean id="resultHandler" class="eu.dnetlib.data.claims.migration.handler.ResultHandler"> |
|
79 |
<property name="sqlDAO" ref="sqlDao"/> |
|
80 |
<property name="queryGenerator" ref="queryGenerator"/> |
|
81 |
<!--<property name="pathToSaveRecord" value="/home/argirok/claims_beta/"/>--> |
|
82 |
<property name="pathToSaveRecord" value="${services.claimsDemo.results.pathToSaveRecord}"/> |
|
83 |
|
|
84 |
</bean> |
|
85 |
<!-- End of Handlers --> |
|
86 |
<!--Parsers --> |
|
87 |
<bean id="oafParser" class="eu.dnetlib.data.claims.migration.parser.OafParser"></bean> |
|
88 |
<bean id="dmfParser" class="eu.dnetlib.data.claims.migration.parser.DMFParser"></bean> |
|
89 |
<bean id="relationParser" class="eu.dnetlib.data.claims.migration.parser.RelationParser"></bean> |
|
90 |
<bean id="externalRecordParser" class="eu.dnetlib.data.claims.migration.parser.ExternalRecordParser"></bean> |
|
91 |
<!-- end of Parsers --> |
|
92 |
<bean id="searchUtils" class="eu.dnetlib.data.claimsDemo.SearchUtils"></bean> |
|
93 |
|
|
94 |
<bean id="claimValidation" class="eu.dnetlib.data.claims.migration.ClaimValidation"> |
|
95 |
<property name="pathToSaveReport" value="${services.claimsDemo.reports.pathToSaveReport}"/> |
|
96 |
</bean> |
|
97 |
|
|
98 |
<bean id="emailSender" class="eu.dnetlib.data.emailSender.EmailSender"> |
|
99 |
<property name="fetchClaimHandler" ref="fetchClaimHandler"/> |
|
100 |
<property name="projectHandler" ref="projectHandler"/> |
|
101 |
<property name="openaireClaimsPage" value="${services.claims.mail.angularUrl}"/> |
|
102 |
<property name="username" value="${services.claims.mail.from}"/> |
|
103 |
<property name="password" value="${services.claims.mail.password}"/> |
|
104 |
<property name="host" value="${services.claims.mail.host}"/> |
|
105 |
<property name="port" value="${services.claims.mail.port}"/> |
|
106 |
<property name="from" value="${services.claims.mail.from}"/> |
|
107 |
<property name="specialRecipients" value="${services.claims.mail.specialRecipients}"/> |
|
108 |
</bean> |
|
109 |
|
|
110 |
<bean id="sqlStore" class="eu.dnetlib.data.claimsDemo.SqlStore" init-method="init" destroy-method="destroy"> |
|
111 |
<property name="dbUser" value="${services.claimsDemo.db.username}"/> |
|
112 |
<property name="dbPassword" value="${services.claimsDemo.db.password}"/> |
|
113 |
<property name="dbDriver" value="${services.claimsDemo.db.driverClassName}"/> |
|
114 |
<property name="dbUrl" value="${services.claimsDemo.db.url}"/> |
|
115 |
</bean> |
|
116 |
|
|
117 |
<bean id="sqlDao" class="eu.dnetlib.data.claimsDemo.SqlDAO"> |
|
118 |
<property name="sqlStore" ref="sqlStore"/> |
|
119 |
</bean> |
|
120 |
|
|
121 |
|
|
122 |
<bean id="queryGenerator" class="eu.dnetlib.data.claimsDemo.QueryGenerator"> |
|
123 |
<property name="updateOnInsert" value="true"/> |
|
124 |
</bean> |
|
125 |
|
|
126 |
<bean id="beautySleep" class="java.lang.String"> |
|
127 |
<constructor-arg type="String" value="86400"/> |
|
128 |
</bean> |
|
129 |
|
|
130 |
<bean id="targetHour" class="java.lang.String"> |
|
131 |
<constructor-arg type="String" value="12"/> |
|
132 |
</bean> |
|
133 |
|
|
134 |
<bean id="targetMinute" class="java.lang.String"> |
|
135 |
<constructor-arg type="String" value="00"/> |
|
136 |
</bean> |
|
137 |
|
|
138 |
<bean id="targetSecond" class="java.lang.String"> |
|
139 |
<constructor-arg type="String" value="00"/> |
|
140 |
</bean> |
|
141 |
</beans> |
modules/uoa-claims/claims-demo/src/main/resources/eu/dnetlib/data/claimsDemo/egi.xml | ||
---|---|---|
1 |
<RESOURCE_PROFILE> |
|
2 |
<HEADER> |
|
3 |
<RESOURCE_IDENTIFIER value="1284f828-6c12-4905-a9c9-43f143b36e08_Q29udGV4dERTUmVzb3VyY2VzL0NvbnRleHREU1Jlc291cmNlVHlwZQ=="/> |
|
4 |
<RESOURCE_TYPE value="ContextDSResourceType"/> |
|
5 |
<RESOURCE_KIND value="ContextDSResources"/> |
|
6 |
<RESOURCE_URI value=""/> |
|
7 |
<DATE_OF_CREATION value=""/> |
|
8 |
</HEADER> |
|
9 |
<BODY> |
|
10 |
<CONFIGURATION> |
|
11 |
<context id="egi" label="EGI" type="community"> |
|
12 |
<category claim="true" id="egi::classification" label="EGI classification scheme"> |
|
13 |
<concept claim="true" id="egi::classification::natsc" label="Natural Sciences"> |
|
14 |
<param name="originalID">1</param> |
|
15 |
<concept claim="true" id="egi::classification::natsc::math" label="Mathematics"> |
|
16 |
<param name="originalID">1.1</param> |
|
17 |
<concept claim="true" id="egi::classification::natsc::math::applied" label="Applied Mathematics"> |
|
18 |
<param name="originalID">1.1.1</param> |
|
19 |
</concept> |
|
20 |
<concept claim="true" id="egi::classification::natsc::math::pure" label="Pure Mathematics"> |
|
21 |
<param name="originalID">1.1.2</param> |
|
22 |
</concept> |
|
23 |
<concept claim="true" id="egi::classification::natsc::math::stats" label="Statistics and Probability"> |
|
24 |
<param name="originalID">1.1.3</param> |
|
25 |
</concept> |
|
26 |
<concept claim="true" id="egi::classification::natsc::math::other" label="Other"> |
|
27 |
<param name="originalID">1.1.99</param> |
|
28 |
</concept> |
|
29 |
</concept> |
|
30 |
<concept claim="true" id="egi::classification::natsc::cosc" label="Computer sciences"> |
|
31 |
<param name="originalID">1.2</param> |
|
32 |
<concept claim="true" id="egi::classification::natsc::cosc::algo" label="Algorithms"> |
|
33 |
<param name="originalID">1.2.1</param> |
|
34 |
</concept> |
|
35 |
<concept claim="true" id="egi::classification::natsc::cosc::artii" label="Artificial Intelligence"> |
|
36 |
<param name="originalID">1.2.2</param> |
|
37 |
</concept> |
|
38 |
<concept claim="true" id="egi::classification::natsc::cosc::carc" label="Computer architecture"> |
|
39 |
<param name="originalID">1.2.3</param> |
|
40 |
</concept> |
|
41 |
<concept claim="true" id="egi::classification::natsc::cosc::ccomm" label="Computer communications"> |
|
42 |
<param name="originalID">1.2.4</param> |
|
43 |
</concept> |
|
44 |
<concept claim="true" id="egi::classification::natsc::cosc::cgraph" label="Computer graphics"> |
|
45 |
<param name="originalID">1.2.5</param> |
|
46 |
</concept> |
|
47 |
<concept claim="true" id="egi::classification::natsc::cosc::csecr" label="Computer security and reliability"> |
|
48 |
<param name="originalID">1.2.6</param> |
|
49 |
</concept> |
|
50 |
<concept claim="true" id="egi::classification::natsc::cosc::dstr" label="Data structures"> |
|
51 |
<param name="originalID">1.2.7</param> |
|
52 |
</concept> |
|
53 |
<concept claim="true" id="egi::classification::natsc::cosc::disc" label="Distributed computing"> |
|
54 |
<param name="originalID">1.2.8</param> |
|
55 |
</concept> |
|
56 |
<concept claim="true" id="egi::classification::natsc::cosc::hci" label="Human-computer interaction"> |
|
57 |
<param name="originalID">1.2.9</param> |
|
58 |
</concept> |
|
59 |
<concept claim="true" id="egi::classification::natsc::cosc::opes" label="Operating systems"> |
|
60 |
<param name="originalID">1.2.10</param> |
|
61 |
</concept> |
|
62 |
<concept claim="true" id="egi::classification::natsc::cosc::parc" label="Parallel computing"> |
|
63 |
<param name="originalID">1.2.11</param> |
|
64 |
</concept> |
|
65 |
<concept claim="true" id="egi::classification::natsc::cosc::plan" label="Programming languages"> |
|
66 |
<param name="originalID">1.2.12</param> |
|
67 |
</concept> |
|
68 |
<concept claim="true" id="egi::classification::natsc::cosc::qcom" label="Quantum computing"> |
|
69 |
<param name="originalID">1.2.13</param> |
|
70 |
</concept> |
|
71 |
<concept claim="true" id="egi::classification::natsc::cosc::softe" label="software engineering"> |
|
72 |
<param name="originalID">1.2.14</param> |
|
73 |
</concept> |
|
74 |
<concept claim="true" id="egi::classification::natsc::cosc::theo" label="Theory of computation"> |
|
75 |
<param name="originalID">1.2.15</param> |
|
76 |
</concept> |
|
77 |
<concept claim="true" id="egi::classification::natsc::cosc::other" label="Other"> |
|
78 |
<param name="originalID">1.2.99</param> |
|
79 |
</concept> |
|
80 |
</concept> |
|
81 |
<concept claim="true" id="egi::classification::natsc::infos" label="Information sciences"> |
|
82 |
<param name="originalID">1.3</param> |
|
83 |
<concept claim="true" id="egi::classification::natsc::infos::dman" label="Data management"> |
|
84 |
<param name="originalID">1.3.1</param> |
|
85 |
</concept> |
|
86 |
<concept claim="true" id="egi::classification::natsc::infos::dmin" label="Data mining"> |
|
87 |
<param name="originalID">1.3.2</param> |
|
88 |
</concept> |
|
89 |
<concept claim="true" id="egi::classification::natsc::infos::iret" label="Information retrieval"> |
|
90 |
<param name="originalID">1.3.3</param> |
|
91 |
</concept> |
|
92 |
<concept claim="true" id="egi::classification::natsc::infos::iman" label="Information management"> |
|
93 |
<param name="originalID">1.3.4</param> |
|
94 |
</concept> |
|
95 |
<concept claim="true" id="egi::classification::natsc::infos::kman" label="Knowledge management"> |
|
96 |
<param name="originalID">1.3.5</param> |
|
97 |
</concept> |
|
98 |
<concept claim="true" id="egi::classification::natsc::infos::mult" label="Multimedia, hypermedia"> |
|
99 |
<param name="originalID">1.3.6</param> |
|
100 |
</concept> |
|
101 |
<concept claim="true" id="egi::classification::natsc::infos::other" label="Other"> |
|
102 |
<param name="originalID">1.3.99</param> |
|
103 |
</concept> |
|
104 |
</concept> |
|
105 |
<concept claim="true" id="egi::classification::natsc::earths" label="Earth sciences"> |
|
106 |
<param name="originalID">1.4</param> |
|
107 |
<concept claim="true" id="egi::classification::natsc::earths::atms" label="Atmospheric science"> |
|
108 |
<param name="originalID">1.4.1</param> |
|
109 |
</concept> |
|
110 |
<concept claim="true" id="egi::classification::natsc::earths::clim" label="Climate research"> |
|
111 |
<param name="originalID">1.4.2</param> |
|
112 |
</concept> |
|
113 |
<concept claim="true" id="egi::classification::natsc::earths::geoc" label="Geochemistry"> |
|
114 |
<param name="originalID">1.4.3</param> |
|
115 |
</concept> |
|
116 |
<concept claim="true" id="egi::classification::natsc::earths::geol" label="Geology"> |
|
117 |
<param name="originalID">1.4.4</param> |
|
118 |
</concept> |
|
119 |
<concept claim="true" id="egi::classification::natsc::earths::geop" label="Geophysics"> |
|
120 |
<param name="originalID">1.4.5</param> |
|
121 |
</concept> |
|
122 |
<concept claim="true" id="egi::classification::natsc::earths::hydr" label="Hydrology"> |
|
123 |
<param name="originalID">1.4.6</param> |
|
124 |
</concept> |
|
125 |
<concept claim="true" id="egi::classification::natsc::earths::mine" label="Mineralogy"> |
|
126 |
<param name="originalID">1.4.7</param> |
|
127 |
</concept> |
|
128 |
<concept claim="true" id="egi::classification::natsc::earths::ocea" label="Oceanography"> |
|
129 |
<param name="originalID">1.4.8</param> |
|
130 |
</concept> |
|
131 |
<concept claim="true" id="egi::classification::natsc::earths::pala" label="palaeontology"> |
|
132 |
<param name="originalID">1.4.9</param> |
|
133 |
</concept> |
|
134 |
<concept claim="true" id="egi::classification::natsc::earths::pgeo" label="Physical geography"> |
|
135 |
<param name="originalID">1.4.10</param> |
|
136 |
</concept> |
|
137 |
<concept claim="true" id="egi::classification::natsc::earths::seis" label="Seismology"> |
|
138 |
<param name="originalID">1.4.11</param> |
|
139 |
</concept> |
|
140 |
<concept claim="true" id="egi::classification::natsc::earths::volc" label="Volcanology"> |
|
141 |
<param name="originalID">1.4.12</param> |
|
142 |
</concept> |
|
143 |
<concept claim="true" id="egi::classification::natsc::earths::other" label="Other"> |
|
144 |
<param name="originalID">1.4.99</param> |
|
145 |
</concept> |
|
146 |
</concept> |
|
147 |
<concept claim="true" id="egi::classification::natsc::biosc" label="Biological sciences"> |
|
148 |
<param name="originalID">1.5</param> |
|
149 |
<concept claim="true" id="egi::classification::natsc::biosc::aerob" label="Aerobiology"> |
|
150 |
<param name="originalID">1.5.1</param> |
|
151 |
</concept> |
|
152 |
<concept claim="true" id="egi::classification::natsc::biosc::bact" label="Bacteriology"> |
|
153 |
<param name="originalID">1.5.2</param> |
|
154 |
</concept> |
|
155 |
<concept claim="true" id="egi::classification::natsc::biosc::behav" label="Behavioural biology"> |
|
156 |
<param name="originalID">1.5.3</param> |
|
157 |
</concept> |
|
158 |
<concept claim="true" id="egi::classification::natsc::biosc::bimol" label="Biochemistry and molecular biology"> |
|
159 |
<param name="originalID">1.5.4</param> |
|
160 |
</concept> |
|
161 |
<concept claim="true" id="egi::classification::natsc::biosc::bcons" label="Biodiversity conservation"> |
|
162 |
<param name="originalID">1.5.5</param> |
|
163 |
</concept> |
|
164 |
<concept claim="true" id="egi::classification::natsc::biosc::binfo" label="Bioinformatics"> |
|
165 |
<param name="originalID">1.5.6</param> |
|
166 |
</concept> |
|
167 |
<concept claim="true" id="egi::classification::natsc::biosc::brhy" label="Biological rhythm"> |
|
168 |
<param name="originalID">1.5.7</param> |
|
169 |
</concept> |
|
170 |
<concept claim="true" id="egi::classification::natsc::biosc::biol" label="Biology"> |
|
171 |
<param name="originalID">1.5.8</param> |
|
172 |
</concept> |
|
173 |
<concept claim="true" id="egi::classification::natsc::biosc::bioph" label="Biophysics"> |
|
174 |
<param name="originalID">1.5.9</param> |
|
175 |
</concept> |
|
176 |
<concept claim="true" id="egi::classification::natsc::biosc::bota" label="Botany"> |
|
177 |
<param name="originalID">1.5.10</param> |
|
178 |
</concept> |
|
179 |
<concept claim="true" id="egi::classification::natsc::biosc::cellb" label="Cell biology"> |
|
180 |
<param name="originalID">1.5.11</param> |
|
181 |
</concept> |
|
182 |
<concept claim="true" id="egi::classification::natsc::biosc::cobio" label="Computational biology"> |
|
183 |
<param name="originalID">1.5.12</param> |
|
184 |
</concept> |
|
185 |
<concept claim="true" id="egi::classification::natsc::biosc::cryo" label="Cryobiology"> |
|
186 |
<param name="originalID">1.5.13</param> |
|
187 |
</concept> |
|
188 |
<concept claim="true" id="egi::classification::natsc::biosc::devb" label="Developmental biology"> |
|
189 |
<param name="originalID">1.5.14</param> |
|
190 |
</concept> |
|
191 |
<concept claim="true" id="egi::classification::natsc::biosc::ecol" label="Ecology"> |
|
192 |
<param name="originalID">1.5.15</param> |
|
193 |
</concept> |
|
194 |
<concept claim="true" id="egi::classification::natsc::biosc::evolb" label="Evolutionary biology"> |
|
195 |
<param name="originalID">1.5.16</param> |
|
196 |
</concept> |
|
197 |
<concept claim="true" id="egi::classification::natsc::biosc::gehe" label="Genetics and heredity"> |
|
198 |
<param name="originalID">1.5.17</param> |
|
199 |
</concept> |
|
200 |
<concept claim="true" id="egi::classification::natsc::biosc::marin" label="Marine and Freshwater biology"> |
|
201 |
<param name="originalID">1.5.18</param> |
|
202 |
</concept> |
|
203 |
<concept claim="true" id="egi::classification::natsc::biosc::mbio" label="Mathematical biology"> |
|
204 |
<param name="originalID">1.5.19</param> |
|
205 |
</concept> |
|
206 |
<concept claim="true" id="egi::classification::natsc::biosc::mibio" label="Microbiology"> |
|
207 |
<param name="originalID">1.5.20</param> |
|
208 |
</concept> |
|
209 |
<concept claim="true" id="egi::classification::natsc::biosc::myco" label="Mycology"> |
|
210 |
<param name="originalID">1.5.21</param> |
|
211 |
</concept> |
|
212 |
<concept claim="true" id="egi::classification::natsc::biosc::plant" label="Plant science"> |
|
213 |
<param name="originalID">1.5.22</param> |
|
214 |
</concept> |
|
215 |
<concept claim="true" id="egi::classification::natsc::biosc::repr" label="Reproductive biology"> |
|
216 |
<param name="originalID">1.5.23</param> |
|
217 |
</concept> |
|
218 |
<concept claim="true" id="egi::classification::natsc::biosc::strub" label="Structural biology"> |
|
219 |
<param name="originalID">1.5.24</param> |
|
220 |
</concept> |
|
221 |
<concept claim="true" id="egi::classification::natsc::biosc::taxo" label="Taxonomy"> |
|
222 |
<param name="originalID">1.5.25</param> |
|
223 |
</concept> |
|
224 |
<concept claim="true" id="egi::classification::natsc::biosc::theob" label="Theoretical biology"> |
|
225 |
<param name="originalID">1.5.26</param> |
|
226 |
</concept> |
|
227 |
<concept claim="true" id="egi::classification::natsc::biosc::therm" label="Thermal biology"> |
|
228 |
<param name="originalID">1.5.27</param> |
|
229 |
</concept> |
|
230 |
<concept claim="true" id="egi::classification::natsc::biosc::viro" label="Virology"> |
|
231 |
<param name="originalID">1.5.28</param> |
|
232 |
</concept> |
|
233 |
<concept claim="true" id="egi::classification::natsc::biosc::zool" label="Zoology"> |
|
234 |
<param name="originalID">1.5.29</param> |
|
235 |
</concept> |
|
236 |
<concept claim="true" id="egi::classification::natsc::biosc::other" label="Other"> |
|
237 |
<param name="originalID">1.5.99</param> |
|
238 |
</concept> |
|
239 |
</concept> |
|
240 |
<concept claim="true" id="egi::classification::natsc::physc" label="Physical sciences"> |
|
241 |
<param name="originalID">1.6</param> |
|
242 |
<concept claim="true" id="egi::classification::natsc::physc::acce" label="Acceleration physics"> |
|
243 |
<param name="originalID">1.6.1</param> |
|
244 |
</concept> |
|
245 |
<concept claim="true" id="egi::classification::natsc::physc::acou" label="Acoustics"> |
|
246 |
<param name="originalID">1.6.2</param> |
|
247 |
</concept> |
|
248 |
<concept claim="true" id="egi::classification::natsc::physc::aero" label="Aerosol physics"> |
|
249 |
<param name="originalID">1.6.3</param> |
|
250 |
</concept> |
|
251 |
<concept claim="true" id="egi::classification::natsc::physc::astrb" label="Astrobiology"> |
|
252 |
<param name="originalID">1.6.4</param> |
|
253 |
</concept> |
|
254 |
<concept claim="true" id="egi::classification::natsc::physc::astrn" label="Astronomy"> |
|
255 |
<param name="originalID">1.6.5</param> |
|
256 |
</concept> |
|
257 |
<concept claim="true" id="egi::classification::natsc::physc::astrp" label="Astroparticle physics"> |
|
258 |
<param name="originalID">1.6.6</param> |
|
259 |
</concept> |
|
260 |
<concept claim="true" id="egi::classification::natsc::physc::astrph" label="Astrophysics"> |
|
261 |
<param name="originalID">1.6.7</param> |
|
262 |
</concept> |
|
263 |
<concept claim="true" id="egi::classification::natsc::physc::atmc" label="Atomic"> |
|
264 |
<param name="originalID">1.6.8</param> |
|
265 |
</concept> |
|
266 |
<concept claim="true" id="egi::classification::natsc::physc::chph" label="Chemical physics"> |
|
267 |
<param name="originalID">1.6.9</param> |
|
268 |
</concept> |
|
269 |
<concept claim="true" id="egi::classification::natsc::physc::comph" label="Computational physics"> |
|
270 |
<param name="originalID">1.6.10</param> |
|
271 |
</concept> |
|
272 |
<concept claim="true" id="egi::classification::natsc::physc::conds" label="Condensed matter physics"> |
|
273 |
<param name="originalID">1.6.11</param> |
|
274 |
</concept> |
|
275 |
<concept claim="true" id="egi::classification::natsc::physc::cryog" label="Cryogenics"> |
|
276 |
<param name="originalID">1.6.12</param> |
|
277 |
</concept> |
|
278 |
<concept claim="true" id="egi::classification::natsc::physc::fluid" label="Fluid mechanics"> |
|
279 |
<param name="originalID">1.6.13</param> |
|
280 |
</concept> |
|
281 |
<concept claim="true" id="egi::classification::natsc::physc::fusi" label="Fusion"> |
|
282 |
<param name="originalID">1.6.14</param> |
|
283 |
</concept> |
|
284 |
<concept claim="true" id="egi::classification::natsc::physc::hene" label="High energy physics"> |
|
285 |
<param name="originalID">1.6.15</param> |
|
286 |
</concept> |
|
287 |
<concept claim="true" id="egi::classification::natsc::physc::mathp" label="Mathematical physics"> |
|
288 |
<param name="originalID">1.6.16</param> |
|
289 |
</concept> |
|
290 |
<concept claim="true" id="egi::classification::natsc::physc::medip" label="Medical physics"> |
|
291 |
<param name="originalID">1.6.17</param> |
|
292 |
</concept> |
|
293 |
<concept claim="true" id="egi::classification::natsc::physc::molep" label="Molecular physics"> |
|
294 |
<param name="originalID">1.6.18</param> |
|
295 |
</concept> |
|
296 |
<concept claim="true" id="egi::classification::natsc::physc::nuclp" label="Nuclear physics"> |
|
297 |
<param name="originalID">1.6.19</param> |
|
298 |
</concept> |
|
299 |
<concept claim="true" id="egi::classification::natsc::physc::optc" label="Optics"> |
|
300 |
<param name="originalID">1.6.20</param> |
|
301 |
</concept> |
|
302 |
<concept claim="true" id="egi::classification::natsc::physc::partp" label="Particle physics"> |
|
303 |
<param name="originalID">1.6.21</param> |
|
304 |
</concept> |
|
305 |
<concept claim="true" id="egi::classification::natsc::physc::phys" label="Physics"> |
|
306 |
<param name="originalID">1.6.22</param> |
|
307 |
</concept> |
|
308 |
<concept claim="true" id="egi::classification::natsc::physc::plans" label="Planetary science"> |
|
309 |
<param name="originalID">1.6.23</param> |
|
310 |
</concept> |
|
311 |
<concept claim="true" id="egi::classification::natsc::physc::plsm" label="Plasma physics"> |
|
312 |
<param name="originalID">1.6.24</param> |
|
313 |
</concept> |
|
314 |
<concept claim="true" id="egi::classification::natsc::physc::spac" label="Space physics"> |
|
315 |
<param name="originalID">1.6.25</param> |
|
316 |
</concept> |
|
317 |
<concept claim="true" id="egi::classification::natsc::physc::quant" label="Quantum physics"> |
|
318 |
<param name="originalID">1.6.26</param> |
|
319 |
</concept> |
|
320 |
<concept claim="true" id="egi::classification::natsc::physc::other" label="Other"> |
|
321 |
<param name="originalID">1.6.99</param> |
|
322 |
</concept> |
|
323 |
</concept> |
|
324 |
<concept claim="true" id="egi::classification::natsc::chesc" label="Chemical sciences"> |
|
325 |
<param name="originalID">1.7</param> |
|
326 |
<concept claim="true" id="egi::classification::natsc::chesc::analc" label="Analytical chemistry"> |
|
327 |
<param name="originalID">1.7.1</param> |
|
328 |
</concept> |
|
329 |
<concept claim="true" id="egi::classification::natsc::chesc::chem" label="Chemistry"> |
|
330 |
<param name="originalID">1.7.2</param> |
|
331 |
</concept> |
|
332 |
<concept claim="true" id="egi::classification::natsc::chesc::collc" label="Colloid chemistry"> |
|
333 |
<param name="originalID">1.7.3</param> |
|
334 |
</concept> |
|
335 |
<concept claim="true" id="egi::classification::natsc::chesc::compc" label="Computational chemistry"> |
|
336 |
<param name="originalID">1.7.4</param> |
|
337 |
</concept> |
|
338 |
<concept claim="true" id="egi::classification::natsc::chesc::elecc" label="Electrochemistry"> |
|
339 |
<param name="originalID">1.7.5</param> |
|
340 |
</concept> |
|
341 |
<concept claim="true" id="egi::classification::natsc::chesc::innuc" label="Inorganic and nuclear chemistry"> |
|
342 |
<param name="originalID">1.7.6</param> |
|
343 |
</concept> |
|
344 |
<concept claim="true" id="egi::classification::natsc::chesc::mathc" label="Mathematical chemistry"> |
|
345 |
<param name="originalID">1.7.7</param> |
|
346 |
</concept> |
|
347 |
<concept claim="true" id="egi::classification::natsc::chesc::orgc" label="Organic chemistry"> |
|
348 |
<param name="originalID">1.7.8</param> |
|
349 |
</concept> |
|
350 |
<concept claim="true" id="egi::classification::natsc::chesc::phyc" label="Physical chemistry"> |
|
351 |
<param name="originalID">1.7.9</param> |
|
352 |
</concept> |
|
353 |
<concept claim="true" id="egi::classification::natsc::chesc::polc" label="Polymer chemistry"> |
|
354 |
<param name="originalID">1.7.10</param> |
|
355 |
</concept> |
|
356 |
<concept claim="true" id="egi::classification::natsc::chesc::other" label="Other"> |
|
357 |
<param name="originalID">1.7.99</param> |
Also available in: Unified diff
claims-demo folder renamed to trunk