forked from D-Net/dnet-hadoop
Compare commits
584 Commits
master
...
usage-stat
Author | SHA1 | Date |
---|---|---|
dimitrispie | 22eaf211e8 | |
dimitrispie | 6b247524a8 | |
dimitrispie | 566e2459a8 | |
dimitrispie | 733abdffe3 | |
dimitrispie | 7a7eb30a3f | |
dimitrispie | 0654343479 | |
dimitrispie | fc40a4ddf7 | |
dimitrispie | 26f5a5209c | |
dimitrispie | dbb12314fe | |
Claudio Atzori | c1b6ae47cd | |
Claudio Atzori | cd9c51fd7a | |
dimitrispie | 195111119e | |
Claudio Atzori | 1de881b796 | |
Claudio Atzori | 014e872ae1 | |
Claudio Atzori | 5c6d328537 | |
Sandro La Bruzzo | bb7f556eff | |
Sandro La Bruzzo | 1e1f5e4fe0 | |
Miriam Baglioni | ac07ed8251 | |
Miriam Baglioni | 5fd0e610bf | |
Sandro La Bruzzo | feea154e89 | |
Sandro La Bruzzo | 028a8acad8 | |
Sandro La Bruzzo | 2164a2a889 | |
Miriam Baglioni | 3f9b2ba8ce | |
Sandro La Bruzzo | a7cf277d98 | |
Sandro La Bruzzo | 483d3039d1 | |
Sandro La Bruzzo | 93fe8ce8b2 | |
Sandro La Bruzzo | 35e20b0647 | |
Miriam Baglioni | fdb75b180e | |
Sandro La Bruzzo | 6110a2b984 | |
Sandro La Bruzzo | 65ebe1019b | |
Sandro La Bruzzo | 155d8bf83f | |
Sandro La Bruzzo | 3426451d3f | |
Sandro La Bruzzo | 75298ec442 | |
Sandro La Bruzzo | 4542a2338b | |
Claudio Atzori | 90c2a4987e | |
Claudio Atzori | e5a2c596b2 | |
Claudio Atzori | f4538f3c4c | |
Claudio Atzori | 2b46b87f56 | |
Sandro La Bruzzo | fc03c99805 | |
Sandro La Bruzzo | 8a7c7d36db | |
Sandro La Bruzzo | 0c0d561bc4 | |
Claudio Atzori | 62fa61f3cf | |
Claudio Atzori | bd9a43cefd | |
Claudio Atzori | a24b9f8268 | |
Claudio Atzori | c0750fb17c | |
Claudio Atzori | bb5dca7979 | |
Miriam Baglioni | 793b5a8e5f | |
Claudio Atzori | 10a32f287f | |
Antonis Lempesis | cb3adb90f4 | |
Antonis Lempesis | c283406829 | |
Claudio Atzori | e0395719d7 | |
Claudio Atzori | 82a4e4efae | |
Miriam Baglioni | 6d4a1c57ee | |
Sandro La Bruzzo | 9c82d670b8 | |
Sandro La Bruzzo | 1f5ee116ed | |
Sandro La Bruzzo | 2fd9ceac13 | |
Sandro La Bruzzo | 60ae874dcb | |
Sandro La Bruzzo | 2506d7a679 | |
Sandro La Bruzzo | cded363b55 | |
Miriam Baglioni | 4094f2bb9a | |
Miriam Baglioni | ec8b0219ff | |
Sandro La Bruzzo | 2d67020c59 | |
Claudio Atzori | 49f897ef29 | |
Sandro La Bruzzo | 18c1d70ef4 | |
Sandro La Bruzzo | a1cafaf2e3 | |
Claudio Atzori | 0a727d325d | |
Claudio Atzori | bafa2990f3 | |
Claudio Atzori | 668ac25224 | |
Claudio Atzori | 7d0a03f607 | |
Claudio Atzori | 941a50a2fc | |
Claudio Atzori | 7c804acda8 | |
Sandro La Bruzzo | efa09057db | |
Sandro La Bruzzo | 48923e46a1 | |
Claudio Atzori | d2c787d416 | |
Claudio Atzori | 975b10b711 | |
Claudio Atzori | 1ecceea788 | |
Miriam Baglioni | 4ec88c718c | |
Miriam Baglioni | 6f1a434e90 | |
Miriam Baglioni | 157d33ebf9 | |
Claudio Atzori | 7b81607035 | |
Miriam Baglioni | 92d0e18b55 | |
Miriam Baglioni | 881113743f | |
Miriam Baglioni | 47ccb53c4f | |
Miriam Baglioni | ffb0ce1d59 | |
Miriam Baglioni | 716021546e | |
Claudio Atzori | 1f2a3d1af0 | |
Sandro La Bruzzo | 3469cc2b1d | |
Sandro La Bruzzo | a7763d2492 | |
Miriam Baglioni | 935062edec | |
Antonis Lempesis | 26f086dd64 | |
Claudio Atzori | 8bdca3413f | |
Claudio Atzori | 148289150f | |
Sandro La Bruzzo | 2ca0a436ad | |
Sandro La Bruzzo | 9cb195314f | |
Miriam Baglioni | 6d3c4c4abe | |
Miriam Baglioni | c371b23077 | |
Alessia Bardi | fc8fceaac3 | |
Alessia Bardi | 6cd91004e3 | |
Miriam Baglioni | 9e214ce0eb | |
Alessia Bardi | b9d4f115cc | |
Sandro La Bruzzo | 6477a40670 | |
Miriam Baglioni | 6f7ca539c6 | |
Miriam Baglioni | a7d50c499b | |
Antonis Lempesis | 91354c6068 | |
Miriam Baglioni | df7ee77c7a | |
Miriam Baglioni | de63d29b6f | |
Miriam Baglioni | d50057b2d9 | |
Miriam Baglioni | edf55395e9 | |
Miriam Baglioni | d97ea82a29 | |
Miriam Baglioni | 96769b4481 | |
Miriam Baglioni | 683fe093cf | |
Miriam Baglioni | b2bb8d9d79 | |
Miriam Baglioni | 779318961c | |
Miriam Baglioni | 2480e590d1 | |
Sandro La Bruzzo | 7bd224f051 | |
Antonis Lempesis | b97b78f874 | |
Claudio Atzori | 7fa49f6956 | |
Antonis Lempesis | f78afb5ef9 | |
Claudio Atzori | 1225ba0b92 | |
Sandro La Bruzzo | d9cbca83f7 | |
Sandro La Bruzzo | 1be9aa0a5f | |
Sandro La Bruzzo | 4acfa8fa2e | |
Sandro La Bruzzo | aafdffa6b3 | |
Sandro La Bruzzo | 034304b33a | |
Claudio Atzori | 6b34ba737e | |
Claudio Atzori | d147295c2f | |
Claudio Atzori | 3702fe478d | |
Sandro La Bruzzo | ac36aa7d1c | |
Sandro La Bruzzo | aeeebd573b | |
Sandro La Bruzzo | ab3a99d3e9 | |
Sandro La Bruzzo | ae4e99a471 | |
Claudio Atzori | cece432adc | |
Antonis Lempesis | a7376907c2 | |
Antonis Lempesis | 43f4eb492b | |
Claudio Atzori | 4f8970f8ed | |
Claudio Atzori | 00b78b9c58 | |
Claudio Atzori | c01dd0c925 | |
Claudio Atzori | d0cf2963f0 | |
Claudio Atzori | 59f76b50d4 | |
Claudio Atzori | bc3372093e | |
Antonis Lempesis | 241dcf6df1 | |
Claudio Atzori | 515e068a78 | |
Claudio Atzori | 512e7b0170 | |
Michele Artini | c4fce785ab | |
Claudio Atzori | d517c71458 | |
Claudio Atzori | e9157c67aa | |
Claudio Atzori | 98f37c8d81 | |
Claudio Atzori | c8850456e9 | |
Claudio Atzori | 172363e7f1 | |
Claudio Atzori | bdffa86c2f | |
Sandro La Bruzzo | c9870c5122 | |
Sandro La Bruzzo | f8329bc110 | |
Claudio Atzori | e471f12d5e | |
Claudio Atzori | 7a73010acd | |
Miriam Baglioni | c7f6cd2591 | |
Sandro La Bruzzo | a894d7adf3 | |
miconis | 5f780a6ba1 | |
Miriam Baglioni | 1315952702 | |
Miriam Baglioni | 1cc09adfaa | |
Miriam Baglioni | 76d41602be | |
Miriam Baglioni | 46f82c7c8f | |
Sandro La Bruzzo | 7b15b88d4c | |
Antonis Lempesis | 41ecb1eb61 | |
Antonis Lempesis | 4b7c8dff2d | |
Claudio Atzori | e15a1969a5 | |
Sandro La Bruzzo | 51a03c0a50 | |
Claudio Atzori | dd568ec88b | |
Claudio Atzori | 14fbf92ad6 | |
Miriam Baglioni | 4b1920f008 | |
Miriam Baglioni | 8db39c86e2 | |
Claudio Atzori | b292e4a700 | |
miconis | 995c1eddaf | |
Miriam Baglioni | 5d9cc2452d | |
miconis | 326bf63775 | |
Miriam Baglioni | 16b28494a9 | |
Miriam Baglioni | 63933808d4 | |
Sandro La Bruzzo | f2c8356ccf | |
Sandro La Bruzzo | 7387416e90 | |
Claudio Atzori | 914b3e92cb | |
Sandro La Bruzzo | 511da98d0c | |
Miriam Baglioni | fec40bdd95 | |
Miriam Baglioni | 83f51f1812 | |
Sandro La Bruzzo | 5606014b17 | |
Claudio Atzori | 2f61054cd1 | |
Claudio Atzori | 83c90c7180 | |
Serafeim Chatzopoulos | 201ce71cc1 | |
Serafeim Chatzopoulos | e468a7b96b | |
Serafeim Chatzopoulos | de81007302 | |
Sandro La Bruzzo | 8f99d2af86 | |
Alessia Bardi | c48c43fa9e | |
Alessia Bardi | 8d3b60f446 | |
miconis | 611ca511db | |
miconis | 9646b9fd98 | |
Sandro La Bruzzo | 2557bb41f5 | |
Sandro La Bruzzo | b84e0cabeb | |
Michele Artini | d6e1f22408 | |
Michele Artini | 210d6c0e6d | |
Michele Artini | 69008e20c2 | |
Sandro La Bruzzo | f258bbb927 | |
Sandro La Bruzzo | 991b06bd0b | |
Claudio Atzori | cb7efe12ac | |
Michele Artini | 8bbaa17335 | |
Miriam Baglioni | e653756e3d | |
Michele Artini | 0a9ef34b56 | |
Michele Artini | 31a6ad1d79 | |
dimitrispie | 3f25d2efb2 | |
dimitrispie | 13687fd887 | |
Miriam Baglioni | 9814c3e700 | |
Miriam Baglioni | c4ccd7b32c | |
Miriam Baglioni | c8321ad31a | |
Claudio Atzori | b01cd521b0 | |
Claudio Atzori | ec94cc9b93 | |
Claudio Atzori | 60a6a9a583 | |
Sandro La Bruzzo | 66702b1973 | |
Sandro La Bruzzo | 477cb10715 | |
Sandro La Bruzzo | be79d74e3d | |
Claudio Atzori | 35619b93ee | |
Claudio Atzori | 474117c2e8 | |
Miriam Baglioni | 476a4708d6 | |
Miriam Baglioni | 5ec69889db | |
Claudio Atzori | a53acfbc06 | |
Alessia Bardi | b924276e18 | |
Antonis Lempesis | a1e1cf32d7 | |
Antonis Lempesis | f358cabb2b | |
Miriam Baglioni | eedf7c3310 | |
Miriam Baglioni | f2118d771a | |
Claudio Atzori | df15a4dc9f | |
Claudio Atzori | 7fa60e166e | |
Antonis Lempesis | 421d55265d | |
Enrico Ottonello | 92a63f78fe | |
Enrico Ottonello | 0c74f5667e | |
miconis | 853333bdde | |
Antonis Lempesis | 8b681dcf1b | |
Claudio Atzori | 71cfa386bc | |
Antonis Lempesis | 2943287d10 | |
Antonis Lempesis | dd2329849f | |
Claudio Atzori | 09c2eb7f62 | |
Claudio Atzori | 954a16c213 | |
Miriam Baglioni | e9ccdf853f | |
Claudio Atzori | 12766bf5f2 | |
Claudio Atzori | 663b1556d7 | |
Claudio Atzori | ebf53a1616 | |
Enrico Ottonello | 8b804e7fe1 | |
Enrico Ottonello | aefa36c54b | |
Antonis Lempesis | de9bf3a161 | |
Antonis Lempesis | 9b1936701c | |
Antonis Lempesis | 8fc89ae822 | |
Antonis Lempesis | 461bf90ca6 | |
Antonis Lempesis | 43852bac0e | |
Antonis Lempesis | f13cca7e83 | |
Antonis Lempesis | c6ada217a1 | |
Antonis Lempesis | 1250ae197f | |
Antonis Lempesis | ccee451dde | |
Sandro La Bruzzo | aed29156c7 | |
Sandro La Bruzzo | 370dddb2fa | |
Sandro La Bruzzo | 3c6fc2096c | |
Sandro La Bruzzo | d4dadf6d77 | |
Sandro La Bruzzo | 9f8a80deb7 | |
Alessia Bardi | 3762b17f7b | |
Sandro La Bruzzo | e8b3cb9147 | |
Alessia Bardi | ccf4103a25 | |
Sandro La Bruzzo | 45898c71ac | |
Alessia Bardi | 00a28c0080 | |
Alessia Bardi | f19b04d41b | |
Alessia Bardi | 412d2cb16a | |
Alessia Bardi | 3bcac7e88c | |
Alessia Bardi | 931f430129 | |
Alessia Bardi | 4c1474e693 | |
Miriam Baglioni | 5f8ccbc365 | |
Miriam Baglioni | 882abb40e4 | |
Miriam Baglioni | 45c62609af | |
Miriam Baglioni | 35880c0e7b | |
Miriam Baglioni | f3b6c392c1 | |
Miriam Baglioni | 65822400ce | |
Alessia Bardi | a053e1513c | |
Alessia Bardi | 812bd54c57 | |
Miriam Baglioni | a65d3caaea | |
Miriam Baglioni | e5cf11d088 | |
Claudio Atzori | 7c0c67bdd6 | |
Claudio Atzori | 82086f3422 | |
Claudio Atzori | bc7068106c | |
Claudio Atzori | 2c0a05f11a | |
Claudio Atzori | d43667d857 | |
Miriam Baglioni | 5856ca8a7b | |
Miriam Baglioni | 6fec71e8d2 | |
Miriam Baglioni | ed7e28490a | |
Claudio Atzori | 7743d0f919 | |
Miriam Baglioni | 6eb7508995 | |
Claudio Atzori | f74adc4752 | |
Claudio Atzori | 5f0903d50d | |
Claudio Atzori | 17cefe6a97 | |
Claudio Atzori | 7ee2757fcd | |
Claudio Atzori | c3ad4ab701 | |
Claudio Atzori | baed5e3337 | |
Claudio Atzori | 3359f73fcf | |
Claudio Atzori | 4e6575a428 | |
Miriam Baglioni | f4ec81c92c | |
Miriam Baglioni | dc8b05b39e | |
Miriam Baglioni | 32fd75691f | |
Miriam Baglioni | dfd1e53c69 | |
Miriam Baglioni | 01db1f8bc4 | |
Miriam Baglioni | 964a46ca21 | |
Miriam Baglioni | eaf077fc34 | |
Miriam Baglioni | 5f674efb0c | |
Miriam Baglioni | 5cd5714530 | |
Miriam Baglioni | 58f241f4a2 | |
Miriam Baglioni | f3d575f749 | |
Miriam Baglioni | a5f6edfa6c | |
Miriam Baglioni | ed183d878e | |
Miriam Baglioni | 8769dd8eef | |
Miriam Baglioni | 6b9e1bf2e3 | |
Miriam Baglioni | d57b2bb927 | |
Miriam Baglioni | 9da74b544a | |
Miriam Baglioni | ab8abd61bb | |
Miriam Baglioni | 335a824e34 | |
Miriam Baglioni | f0845e9865 | |
Miriam Baglioni | 7a789423aa | |
Miriam Baglioni | e9fc3ef3bc | |
Miriam Baglioni | 4317211a2b | |
Miriam Baglioni | b62cd656a7 | |
Miriam Baglioni | d36e925277 | |
Miriam Baglioni | 7402daf51a | |
Miriam Baglioni | 733bcaecf6 | |
Miriam Baglioni | bfe8f5335c | |
Miriam Baglioni | 6e84b3951f | |
Claudio Atzori | e91ffcd2f3 | |
Claudio Atzori | 9587d4aee8 | |
Claudio Atzori | 86d940044c | |
Claudio Atzori | 8cdce59e0e | |
Miriam Baglioni | 08dd2b2102 | |
Miriam Baglioni | ac417ca798 | |
Miriam Baglioni | e33daaeee8 | |
Miriam Baglioni | 9650eea497 | |
Miriam Baglioni | 785db1d5b2 | |
Miriam Baglioni | 95e5482bbb | |
Miriam Baglioni | cc3d72df0e | |
Miriam Baglioni | b966329833 | |
Miriam Baglioni | 8ad7c71417 | |
Miriam Baglioni | 0e1a6bec20 | |
Miriam Baglioni | c6a2a780a9 | |
Miriam Baglioni | b6b58bba28 | |
Miriam Baglioni | 804589eb30 | |
Miriam Baglioni | d688749ad9 | |
Miriam Baglioni | 524c06e028 | |
Miriam Baglioni | 7aa3260729 | |
Miriam Baglioni | 55fc500d8d | |
Miriam Baglioni | f9b6b45d85 | |
Miriam Baglioni | 8229632839 | |
Miriam Baglioni | b1c6140ebf | |
Miriam Baglioni | 52c18c2697 | |
Miriam Baglioni | 8da3a25cf6 | |
Claudio Atzori | 9f4db73f30 | |
Claudio Atzori | 61d811ba53 | |
Claudio Atzori | 2ee21da43b | |
Miriam Baglioni | b954fe9ba8 | |
Miriam Baglioni | b688567db5 | |
Miriam Baglioni | 9731a6144a | |
Miriam Baglioni | a90bac3bc9 | |
Miriam Baglioni | bd0d7bfba7 | |
Miriam Baglioni | 8daaa32e90 | |
Miriam Baglioni | bc9e3a06ba | |
Claudio Atzori | d64a942a76 | |
Miriam Baglioni | 2efa5abda5 | |
Claudio Atzori | 577f3b1ac8 | |
Miriam Baglioni | da20fceaf7 | |
Claudio Atzori | 964f97ed4d | |
Miriam Baglioni | 54a6cbb244 | |
Miriam Baglioni | b7079804cb | |
Miriam Baglioni | a5f82f442b | |
Miriam Baglioni | b6dcf89d22 | |
Miriam Baglioni | eff499af9f | |
Claudio Atzori | a45b95ccc1 | |
Miriam Baglioni | 5d70f842eb | |
Miriam Baglioni | c3931557e3 | |
Claudio Atzori | 66f398fe6f | |
Miriam Baglioni | 6bd1eca7e0 | |
Miriam Baglioni | 73dc082927 | |
Miriam Baglioni | ee13da9258 | |
Miriam Baglioni | bd096f5170 | |
Miriam Baglioni | 5faeefbda8 | |
Miriam Baglioni | 1965e4eece | |
Claudio Atzori | 83c04e5d28 | |
Miriam Baglioni | b4eb026c8b | |
Miriam Baglioni | c7b71647c6 | |
Miriam Baglioni | eb8c3f8594 | |
Miriam Baglioni | e94ae0b1de | |
Miriam Baglioni | 67ba4c40e0 | |
Miriam Baglioni | eccf3851b0 | |
Sandro La Bruzzo | 74afe43c3a | |
Miriam Baglioni | 1e952cccf6 | |
Miriam Baglioni | 8ba8c77f92 | |
Miriam Baglioni | 8f7623e77a | |
Sandro La Bruzzo | 3fc820203b | |
Miriam Baglioni | a7bf314fd2 | |
Miriam Baglioni | 9831725073 | |
Miriam Baglioni | 100e54e6c8 | |
Miriam Baglioni | 461b8a29a0 | |
Miriam Baglioni | 327cddde33 | |
Miriam Baglioni | 17292c6641 | |
Miriam Baglioni | ee7ccb98dc | |
Miriam Baglioni | 90e91486e2 | |
Miriam Baglioni | 1e859706a3 | |
Miriam Baglioni | 72df8f9232 | |
Miriam Baglioni | ff1ce75e33 | |
Claudio Atzori | e826aae848 | |
Claudio Atzori | fd55c77d97 | |
Antonis Lempesis | 117c3d5c67 | |
Miriam Baglioni | 1695d45bd4 | |
Miriam Baglioni | 7c6ea2f4c7 | |
Miriam Baglioni | d8b9b0553b | |
Miriam Baglioni | 613bd3bde0 | |
Miriam Baglioni | d1807781c0 | |
Miriam Baglioni | 1d6ac3715b | |
Claudio Atzori | e244f73165 | |
Claudio Atzori | 11e26c020a | |
Claudio Atzori | 19620eed46 | |
Claudio Atzori | 5219d56be5 | |
Claudio Atzori | 4f78565c04 | |
Claudio Atzori | a6a38cca9e | |
Miriam Baglioni | 9bc4fd3b69 | |
Miriam Baglioni | 2fc89fc9b5 | |
Claudio Atzori | 081fe92a21 | |
Claudio Atzori | 576693d782 | |
Claudio Atzori | 55e6470f44 | |
Sandro La Bruzzo | 6358f92c3a | |
Antonis Lempesis | 26af0320d0 | |
Claudio Atzori | 7b172e7cd9 | |
Claudio Atzori | c53d106e80 | |
Claudio Atzori | 6e3554a45e | |
Sandro La Bruzzo | b1b0cc3f15 | |
Miriam Baglioni | baad01cadc | |
Claudio Atzori | e725c88ebb | |
Claudio Atzori | 5d08ad86ae | |
Claudio Atzori | e87e1805c4 | |
Claudio Atzori | f83dd70e1c | |
Claudio Atzori | 5f7330d407 | |
Claudio Atzori | 1923c1ce21 | |
Claudio Atzori | dc55ed4acd | |
Claudio Atzori | 908f57a475 | |
Sandro La Bruzzo | 3721df7aa6 | |
Michele Artini | 6aef3e8f46 | |
Antonis Lempesis | 4afa5215a9 | |
Antonis Lempesis | 3d1580fa9b | |
Claudio Atzori | 4c5a71ba2f | |
Claudio Atzori | a9961a1835 | |
Claudio Atzori | e1797c0a42 | |
Claudio Atzori | 6dddad86ee | |
Sandro La Bruzzo | 3d8f0f629b | |
Antonis Lempesis | 9b181ffa73 | |
Alessia Bardi | df8715a1ec | |
Michele Artini | 3e2a2d6e71 | |
Alessia Bardi | c806387d4b | |
Alessia Bardi | 9594343725 | |
Claudio Atzori | 2fff24df55 | |
Michele Artini | 9f1c7b8e17 | |
Claudio Atzori | b346feed36 | |
Antonis Lempesis | 4a9741825d | |
Miriam Baglioni | 3d2bba3d5d | |
Miriam Baglioni | cc0d3d8a7b | |
Michele Artini | e6f1773d63 | |
Miriam Baglioni | 80d5b3b4de | |
Miriam Baglioni | 5fe016dcbc | |
Miriam Baglioni | 73ed7374a9 | |
Miriam Baglioni | 43e62fcae9 | |
Michele Artini | c72c960ffb | |
Michele Artini | 1fb572a33a | |
Miriam Baglioni | 708d0ade34 | |
Sandro La Bruzzo | 16c91203bd | |
Miriam Baglioni | 6c936943aa | |
Miriam Baglioni | 0424f47494 | |
Michele Artini | 52e2315ba2 | |
Claudio Atzori | d267dce520 | |
Sandro La Bruzzo | 825d9f0289 | |
Claudio Atzori | 5aa7d16d1b | |
Claudio Atzori | 998b66855a | |
Antonis Lempesis | 1a28a69cac | |
Miriam Baglioni | 74f801b689 | |
Miriam Baglioni | 35e395eae8 | |
Miriam Baglioni | eb07f7f40f | |
Antonis Lempesis | ed185fd7ed | |
Antonis Lempesis | f3b9570354 | |
Sandro La Bruzzo | 848aabbb6c | |
Sandro La Bruzzo | 8fac10c91e | |
Sandro La Bruzzo | 3920c69bc8 | |
Antonis Lempesis | f9fbb0f261 | |
dimitrispie | 2036f8247c | |
Claudio Atzori | a0393607a7 | |
Sandro La Bruzzo | d9e3b89937 | |
dimitrispie | 3d42652c44 | |
Sandro La Bruzzo | cfde63a7c3 | |
Sandro La Bruzzo | 4a439c3863 | |
dimitrispie | 264939a01a | |
dimitrispie | dd1098255e | |
Claudio Atzori | bc835d2024 | |
Sandro La Bruzzo | ca74e8dd02 | |
Sandro La Bruzzo | 43e9380cd3 | |
Sandro La Bruzzo | 058b636d4d | |
Sandro La Bruzzo | 62ae36a3d2 | |
Miriam Baglioni | 63553a76b3 | |
Miriam Baglioni | 1a5b114906 | |
Sandro La Bruzzo | d94565862a | |
Sandro La Bruzzo | 31d2d6d41e | |
dimitrispie | cdf11c8465 | |
Miriam Baglioni | b226ba4439 | |
Claudio Atzori | 10d7b4f0b4 | |
dimitrispie | 553880f3f1 | |
Miriam Baglioni | 83fe31c92e | |
Miriam Baglioni | dd81c36b60 | |
Miriam Baglioni | 54acc5373b | |
Miriam Baglioni | b420b11ed3 | |
Claudio Atzori | 65934888a1 | |
Claudio Atzori | 0977baf41d | |
Miriam Baglioni | 662c396354 | |
Miriam Baglioni | 59530a14fb | |
Miriam Baglioni | 199123b74b | |
Miriam Baglioni | c4b18e6ccb | |
Miriam Baglioni | acd6056330 | |
Miriam Baglioni | 3bc9a05bc9 | |
Miriam Baglioni | 34506df1b6 | |
Claudio Atzori | bf9e0d2d4f | |
Sandro La Bruzzo | 7e2caafe84 | |
Miriam Baglioni | 4da46bb62f | |
Miriam Baglioni | 09ad7b2a9e | |
Miriam Baglioni | f4f7c6f9d3 | |
Miriam Baglioni | 6222adf176 | |
Miriam Baglioni | 981b1018f6 | |
Sandro La Bruzzo | 3d8e2aa146 | |
Miriam Baglioni | 441701c85c | |
Sandro La Bruzzo | c35c117601 | |
Miriam Baglioni | 774cdb190e | |
Miriam Baglioni | 886617afd0 | |
Miriam Baglioni | 320cf02d96 | |
Miriam Baglioni | 52ce35d57b | |
Miriam Baglioni | 970b387b8d | |
Miriam Baglioni | eae10c5894 | |
Miriam Baglioni | c028feef4f | |
Miriam Baglioni | d70f8c96fd | |
Miriam Baglioni | 5e38c7f42d | |
Miriam Baglioni | d418c309f5 | |
Miriam Baglioni | 618d2de2da | |
Miriam Baglioni | 59615da65e | |
Miriam Baglioni | 084b4ef999 | |
Miriam Baglioni | 8f322a73cb | |
Miriam Baglioni | 72397ea1ba | |
Miriam Baglioni | 5295d10691 | |
Miriam Baglioni | e9a17ec899 | |
Miriam Baglioni | 8429aed6c6 | |
Miriam Baglioni | 39b1a6edf6 | |
Miriam Baglioni | 9a58f1b93d | |
Miriam Baglioni | 13c66e16be | |
Miriam Baglioni | 6410ab71d8 | |
Miriam Baglioni | 65a242646d | |
Miriam Baglioni | 4b432fbee8 | |
Miriam Baglioni | 87a6e2b967 | |
Miriam Baglioni | 69fd40fd30 | |
Miriam Baglioni | 86e50f7311 | |
Miriam Baglioni | da88c850c6 | |
Miriam Baglioni | 2f66fedfec | |
Claudio Atzori | bc4b86c27c | |
dimitrispie | bc40663b61 | |
dimitrispie | 6418208d57 | |
dimitrispie | 50cda834bd | |
dimitrispie | bb2ef1b74d | |
dimitrispie | 2cd0514397 | |
Miriam Baglioni | 59c36eb185 | |
Claudio Atzori | 6b8c357381 | |
Claudio Atzori | c0d2b62e46 | |
Claudio Atzori | a3948c1f6e | |
Claudio Atzori | fddbc8364e | |
Alessia Bardi | 6208b04f1d | |
Sandro La Bruzzo | 9ca438d9b1 | |
Sandro La Bruzzo | 42ff7a5665 | |
Sandro La Bruzzo | ebe6aa6d38 | |
dimitrispie | da1f123d7b | |
dimitrispie | c90dd653c2 | |
Dimitris | 6cb4cbb75e | |
Dimitris | 1e06815cdb | |
dimitrispie | 4125b71661 | |
dimitrispie | 533bde3228 | |
Dimitris | ac5b7f89b5 | |
Dimitris | b081e01dad | |
Claudio Atzori | a4cfabdbc6 | |
Claudio Atzori | 338327171d | |
Claudio Atzori | 6cbda49112 |
|
@ -25,6 +25,10 @@
|
|||
/build
|
||||
spark-warehouse
|
||||
/**/job-override.properties
|
||||
<<<<<<< HEAD
|
||||
/**/*.log
|
||||
=======
|
||||
/**/*.log
|
||||
/**/.factorypath
|
||||
|
||||
>>>>>>> upstream/master
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
# dnet-hadoop
|
||||
Dnet-hadoop is a tool for
|
||||
Dnet-hadoop is the project that defined all the OOZIE workflows for the OpenAIRE Graph construction, processing, provisioning.
|
0
dhp-build/dhp-build-assembly-resources/src/main/resources/assemblies/oozie-installer.xml
Normal file → Executable file
0
dhp-build/dhp-build-assembly-resources/src/main/resources/assemblies/oozie-installer.xml
Normal file → Executable file
0
dhp-build/dhp-build-assembly-resources/src/main/resources/assemblies/tests.xml
Normal file → Executable file
0
dhp-build/dhp-build-assembly-resources/src/main/resources/assemblies/tests.xml
Normal file → Executable file
0
dhp-build/dhp-build-assembly-resources/src/main/resources/commands/get_working_dir.sh
Normal file → Executable file
0
dhp-build/dhp-build-assembly-resources/src/main/resources/commands/get_working_dir.sh
Normal file → Executable file
0
dhp-build/dhp-build-assembly-resources/src/main/resources/commands/print_working_dir.sh
Normal file → Executable file
0
dhp-build/dhp-build-assembly-resources/src/main/resources/commands/print_working_dir.sh
Normal file → Executable file
0
dhp-build/dhp-build-assembly-resources/src/main/resources/commands/readme.markdown
Normal file → Executable file
0
dhp-build/dhp-build-assembly-resources/src/main/resources/commands/readme.markdown
Normal file → Executable file
0
dhp-build/dhp-build-assembly-resources/src/main/resources/commands/run_workflow.sh
Normal file → Executable file
0
dhp-build/dhp-build-assembly-resources/src/main/resources/commands/run_workflow.sh
Normal file → Executable file
0
dhp-build/dhp-build-assembly-resources/src/main/resources/commands/upload_workflow.sh
Normal file → Executable file
0
dhp-build/dhp-build-assembly-resources/src/main/resources/commands/upload_workflow.sh
Normal file → Executable file
0
dhp-build/dhp-build-assembly-resources/src/main/resources/project-default.properties
Normal file → Executable file
0
dhp-build/dhp-build-assembly-resources/src/main/resources/project-default.properties
Normal file → Executable file
12
dhp-build/dhp-build-properties-maven-plugin/src/main/java/eu/dnetlib/maven/plugin/properties/GenerateOoziePropertiesMojo.java
Normal file → Executable file
12
dhp-build/dhp-build-properties-maven-plugin/src/main/java/eu/dnetlib/maven/plugin/properties/GenerateOoziePropertiesMojo.java
Normal file → Executable file
|
@ -8,8 +8,6 @@ import java.util.List;
|
|||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugin.MojoFailureException;
|
||||
|
||||
/**
|
||||
* Generates oozie properties which were not provided from commandline.
|
||||
|
@ -27,7 +25,7 @@ public class GenerateOoziePropertiesMojo extends AbstractMojo {
|
|||
};
|
||||
|
||||
@Override
|
||||
public void execute() throws MojoExecutionException, MojoFailureException {
|
||||
public void execute() {
|
||||
if (System.getProperties().containsKey(PROPERTY_NAME_WF_SOURCE_DIR)
|
||||
&& !System.getProperties().containsKey(PROPERTY_NAME_SANDBOX_NAME)) {
|
||||
String generatedSandboxName = generateSandboxName(
|
||||
|
@ -46,24 +44,24 @@ public class GenerateOoziePropertiesMojo extends AbstractMojo {
|
|||
/**
|
||||
* Generates sandbox name from workflow source directory.
|
||||
*
|
||||
* @param wfSourceDir
|
||||
* @param wfSourceDir workflow source directory
|
||||
* @return generated sandbox name
|
||||
*/
|
||||
private String generateSandboxName(String wfSourceDir) {
|
||||
// utilize all dir names until finding one of the limiters
|
||||
List<String> sandboxNameParts = new ArrayList<String>();
|
||||
List<String> sandboxNameParts = new ArrayList<>();
|
||||
String[] tokens = StringUtils.split(wfSourceDir, File.separatorChar);
|
||||
ArrayUtils.reverse(tokens);
|
||||
if (tokens.length > 0) {
|
||||
for (String token : tokens) {
|
||||
for (String limiter : limiters) {
|
||||
if (limiter.equals(token)) {
|
||||
return sandboxNameParts.size() > 0
|
||||
return !sandboxNameParts.isEmpty()
|
||||
? StringUtils.join(sandboxNameParts.toArray())
|
||||
: null;
|
||||
}
|
||||
}
|
||||
if (sandboxNameParts.size() > 0) {
|
||||
if (!sandboxNameParts.isEmpty()) {
|
||||
sandboxNameParts.add(0, File.separator);
|
||||
}
|
||||
sandboxNameParts.add(0, token);
|
||||
|
|
11
dhp-build/dhp-build-properties-maven-plugin/src/main/java/eu/dnetlib/maven/plugin/properties/WritePredefinedProjectProperties.java
Normal file → Executable file
11
dhp-build/dhp-build-properties-maven-plugin/src/main/java/eu/dnetlib/maven/plugin/properties/WritePredefinedProjectProperties.java
Normal file → Executable file
|
@ -16,6 +16,7 @@ import java.io.File;
|
|||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
@ -289,7 +290,7 @@ public class WritePredefinedProjectProperties extends AbstractMojo {
|
|||
*/
|
||||
protected List<String> getEscapeChars(String escapeChars) {
|
||||
List<String> tokens = getListFromCSV(escapeChars);
|
||||
List<String> realTokens = new ArrayList<String>();
|
||||
List<String> realTokens = new ArrayList<>();
|
||||
for (String token : tokens) {
|
||||
String realToken = getRealToken(token);
|
||||
realTokens.add(realToken);
|
||||
|
@ -324,7 +325,7 @@ public class WritePredefinedProjectProperties extends AbstractMojo {
|
|||
* @return content
|
||||
*/
|
||||
protected String getContent(String comment, Properties properties, List<String> escapeTokens) {
|
||||
List<String> names = new ArrayList<String>(properties.stringPropertyNames());
|
||||
List<String> names = new ArrayList<>(properties.stringPropertyNames());
|
||||
Collections.sort(names);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (!StringUtils.isBlank(comment)) {
|
||||
|
@ -352,7 +353,7 @@ public class WritePredefinedProjectProperties extends AbstractMojo {
|
|||
throws MojoExecutionException {
|
||||
try {
|
||||
String content = getContent(comment, properties, escapeTokens);
|
||||
FileUtils.writeStringToFile(file, content, ENCODING_UTF8);
|
||||
FileUtils.writeStringToFile(file, content, StandardCharsets.UTF_8);
|
||||
} catch (IOException e) {
|
||||
throw new MojoExecutionException("Error creating properties file", e);
|
||||
}
|
||||
|
@ -399,9 +400,9 @@ public class WritePredefinedProjectProperties extends AbstractMojo {
|
|||
*/
|
||||
protected static final List<String> getListFromCSV(String csv) {
|
||||
if (StringUtils.isBlank(csv)) {
|
||||
return new ArrayList<String>();
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<String> list = new ArrayList<String>();
|
||||
List<String> list = new ArrayList<>();
|
||||
String[] tokens = StringUtils.split(csv, ",");
|
||||
for (String token : tokens) {
|
||||
list.add(token.trim());
|
||||
|
|
16
dhp-build/dhp-build-properties-maven-plugin/src/test/java/eu/dnetlib/maven/plugin/properties/GenerateOoziePropertiesMojoTest.java
Normal file → Executable file
16
dhp-build/dhp-build-properties-maven-plugin/src/test/java/eu/dnetlib/maven/plugin/properties/GenerateOoziePropertiesMojoTest.java
Normal file → Executable file
|
@ -9,18 +9,18 @@ import org.junit.jupiter.api.BeforeEach;
|
|||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/** @author mhorst, claudio.atzori */
|
||||
public class GenerateOoziePropertiesMojoTest {
|
||||
class GenerateOoziePropertiesMojoTest {
|
||||
|
||||
private final GenerateOoziePropertiesMojo mojo = new GenerateOoziePropertiesMojo();
|
||||
|
||||
@BeforeEach
|
||||
public void clearSystemProperties() {
|
||||
void clearSystemProperties() {
|
||||
System.clearProperty(PROPERTY_NAME_SANDBOX_NAME);
|
||||
System.clearProperty(PROPERTY_NAME_WF_SOURCE_DIR);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExecuteEmpty() throws Exception {
|
||||
void testExecuteEmpty() throws Exception {
|
||||
// execute
|
||||
mojo.execute();
|
||||
|
||||
|
@ -29,7 +29,7 @@ public class GenerateOoziePropertiesMojoTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testExecuteSandboxNameAlreadySet() throws Exception {
|
||||
void testExecuteSandboxNameAlreadySet() throws Exception {
|
||||
// given
|
||||
String workflowSourceDir = "eu/dnetlib/dhp/wf/transformers";
|
||||
String sandboxName = "originalSandboxName";
|
||||
|
@ -44,7 +44,7 @@ public class GenerateOoziePropertiesMojoTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testExecuteEmptyWorkflowSourceDir() throws Exception {
|
||||
void testExecuteEmptyWorkflowSourceDir() throws Exception {
|
||||
// given
|
||||
String workflowSourceDir = "";
|
||||
System.setProperty(PROPERTY_NAME_WF_SOURCE_DIR, workflowSourceDir);
|
||||
|
@ -57,7 +57,7 @@ public class GenerateOoziePropertiesMojoTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testExecuteNullSandboxNameGenerated() throws Exception {
|
||||
void testExecuteNullSandboxNameGenerated() throws Exception {
|
||||
// given
|
||||
String workflowSourceDir = "eu/dnetlib/dhp/";
|
||||
System.setProperty(PROPERTY_NAME_WF_SOURCE_DIR, workflowSourceDir);
|
||||
|
@ -70,7 +70,7 @@ public class GenerateOoziePropertiesMojoTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testExecute() throws Exception {
|
||||
void testExecute() throws Exception {
|
||||
// given
|
||||
String workflowSourceDir = "eu/dnetlib/dhp/wf/transformers";
|
||||
System.setProperty(PROPERTY_NAME_WF_SOURCE_DIR, workflowSourceDir);
|
||||
|
@ -83,7 +83,7 @@ public class GenerateOoziePropertiesMojoTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testExecuteWithoutRoot() throws Exception {
|
||||
void testExecuteWithoutRoot() throws Exception {
|
||||
// given
|
||||
String workflowSourceDir = "wf/transformers";
|
||||
System.setProperty(PROPERTY_NAME_WF_SOURCE_DIR, workflowSourceDir);
|
||||
|
|
|
@ -20,7 +20,7 @@ import org.mockito.junit.jupiter.MockitoExtension;
|
|||
|
||||
/** @author mhorst, claudio.atzori */
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
public class WritePredefinedProjectPropertiesTest {
|
||||
class WritePredefinedProjectPropertiesTest {
|
||||
|
||||
@Mock
|
||||
private MavenProject mavenProject;
|
||||
|
@ -39,7 +39,7 @@ public class WritePredefinedProjectPropertiesTest {
|
|||
// ----------------------------------- TESTS ---------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testExecuteEmpty() throws Exception {
|
||||
void testExecuteEmpty() throws Exception {
|
||||
// execute
|
||||
mojo.execute();
|
||||
|
||||
|
@ -50,7 +50,7 @@ public class WritePredefinedProjectPropertiesTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testExecuteWithProjectProperties() throws Exception {
|
||||
void testExecuteWithProjectProperties() throws Exception {
|
||||
// given
|
||||
String key = "projectPropertyKey";
|
||||
String value = "projectPropertyValue";
|
||||
|
@ -70,7 +70,7 @@ public class WritePredefinedProjectPropertiesTest {
|
|||
}
|
||||
|
||||
@Test()
|
||||
public void testExecuteWithProjectPropertiesAndInvalidOutputFile(@TempDir File testFolder) {
|
||||
void testExecuteWithProjectPropertiesAndInvalidOutputFile(@TempDir File testFolder) {
|
||||
// given
|
||||
String key = "projectPropertyKey";
|
||||
String value = "projectPropertyValue";
|
||||
|
@ -84,7 +84,7 @@ public class WritePredefinedProjectPropertiesTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testExecuteWithProjectPropertiesExclusion(@TempDir File testFolder) throws Exception {
|
||||
void testExecuteWithProjectPropertiesExclusion(@TempDir File testFolder) throws Exception {
|
||||
// given
|
||||
String key = "projectPropertyKey";
|
||||
String value = "projectPropertyValue";
|
||||
|
@ -108,7 +108,7 @@ public class WritePredefinedProjectPropertiesTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testExecuteWithProjectPropertiesInclusion(@TempDir File testFolder) throws Exception {
|
||||
void testExecuteWithProjectPropertiesInclusion(@TempDir File testFolder) throws Exception {
|
||||
// given
|
||||
String key = "projectPropertyKey";
|
||||
String value = "projectPropertyValue";
|
||||
|
@ -132,7 +132,7 @@ public class WritePredefinedProjectPropertiesTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testExecuteIncludingPropertyKeysFromFile(@TempDir File testFolder) throws Exception {
|
||||
void testExecuteIncludingPropertyKeysFromFile(@TempDir File testFolder) throws Exception {
|
||||
// given
|
||||
String key = "projectPropertyKey";
|
||||
String value = "projectPropertyValue";
|
||||
|
@ -164,7 +164,7 @@ public class WritePredefinedProjectPropertiesTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testExecuteIncludingPropertyKeysFromClasspathResource(@TempDir File testFolder)
|
||||
void testExecuteIncludingPropertyKeysFromClasspathResource(@TempDir File testFolder)
|
||||
throws Exception {
|
||||
// given
|
||||
String key = "projectPropertyKey";
|
||||
|
@ -194,7 +194,7 @@ public class WritePredefinedProjectPropertiesTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testExecuteIncludingPropertyKeysFromBlankLocation() {
|
||||
void testExecuteIncludingPropertyKeysFromBlankLocation() {
|
||||
// given
|
||||
String key = "projectPropertyKey";
|
||||
String value = "projectPropertyValue";
|
||||
|
@ -214,7 +214,7 @@ public class WritePredefinedProjectPropertiesTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testExecuteIncludingPropertyKeysFromXmlFile(@TempDir File testFolder)
|
||||
void testExecuteIncludingPropertyKeysFromXmlFile(@TempDir File testFolder)
|
||||
throws Exception {
|
||||
// given
|
||||
String key = "projectPropertyKey";
|
||||
|
@ -247,7 +247,7 @@ public class WritePredefinedProjectPropertiesTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testExecuteIncludingPropertyKeysFromInvalidXmlFile(@TempDir File testFolder)
|
||||
void testExecuteIncludingPropertyKeysFromInvalidXmlFile(@TempDir File testFolder)
|
||||
throws Exception {
|
||||
// given
|
||||
String key = "projectPropertyKey";
|
||||
|
@ -273,7 +273,7 @@ public class WritePredefinedProjectPropertiesTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testExecuteWithQuietModeOn(@TempDir File testFolder) throws Exception {
|
||||
void testExecuteWithQuietModeOn(@TempDir File testFolder) throws Exception {
|
||||
// given
|
||||
mojo.setQuiet(true);
|
||||
mojo.setIncludePropertyKeysFromFiles(new String[] {
|
||||
|
@ -290,7 +290,7 @@ public class WritePredefinedProjectPropertiesTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testExecuteIncludingPropertyKeysFromInvalidFile() {
|
||||
void testExecuteIncludingPropertyKeysFromInvalidFile() {
|
||||
// given
|
||||
mojo.setIncludePropertyKeysFromFiles(new String[] {
|
||||
"invalid location"
|
||||
|
@ -301,7 +301,7 @@ public class WritePredefinedProjectPropertiesTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testExecuteWithEnvironmentProperties(@TempDir File testFolder) throws Exception {
|
||||
void testExecuteWithEnvironmentProperties(@TempDir File testFolder) throws Exception {
|
||||
// given
|
||||
mojo.setIncludeEnvironmentVariables(true);
|
||||
|
||||
|
@ -318,7 +318,7 @@ public class WritePredefinedProjectPropertiesTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testExecuteWithSystemProperties(@TempDir File testFolder) throws Exception {
|
||||
void testExecuteWithSystemProperties(@TempDir File testFolder) throws Exception {
|
||||
// given
|
||||
String key = "systemPropertyKey";
|
||||
String value = "systemPropertyValue";
|
||||
|
@ -337,7 +337,7 @@ public class WritePredefinedProjectPropertiesTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testExecuteWithSystemPropertiesAndEscapeChars(@TempDir File testFolder)
|
||||
void testExecuteWithSystemPropertiesAndEscapeChars(@TempDir File testFolder)
|
||||
throws Exception {
|
||||
// given
|
||||
String key = "systemPropertyKey ";
|
||||
|
|
0
dhp-build/dhp-build-properties-maven-plugin/src/test/resources/eu/dnetlib/maven/plugin/properties/included.properties
Normal file → Executable file
0
dhp-build/dhp-build-properties-maven-plugin/src/test/resources/eu/dnetlib/maven/plugin/properties/included.properties
Normal file → Executable file
|
@ -22,9 +22,20 @@
|
|||
<id>dnet45-releases</id>
|
||||
<url>https://maven.d4science.org/nexus/content/repositories/dnet45-releases</url>
|
||||
</repository>
|
||||
<site>
|
||||
<id>DHPSite</id>
|
||||
<url>${dhp.site.stage.path}/dhp-build/dhp-code-style</url>
|
||||
</site>
|
||||
</distributionManagement>
|
||||
|
||||
<build>
|
||||
<extensions>
|
||||
<extension>
|
||||
<groupId>org.apache.maven.wagon</groupId>
|
||||
<artifactId>wagon-ssh</artifactId>
|
||||
<version>2.10</version>
|
||||
</extension>
|
||||
</extensions>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
@ -35,7 +46,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.7.1</version>
|
||||
<version>3.9.1</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
|
@ -43,6 +54,7 @@
|
|||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<dhp.site.stage.path>sftp://dnet-hadoop@static-web.d4science.org/dnet-hadoop</dhp.site.stage.path>
|
||||
</properties>
|
||||
|
||||
</project>
|
0
dhp-build/dhp-code-style/src/main/resources/eclipse/formatter_aosp.xml
Normal file → Executable file
0
dhp-build/dhp-code-style/src/main/resources/eclipse/formatter_aosp.xml
Normal file → Executable file
0
dhp-build/dhp-code-style/src/main/resources/eclipse/formatter_dnet.xml
Normal file → Executable file
0
dhp-build/dhp-code-style/src/main/resources/eclipse/formatter_dnet.xml
Normal file → Executable file
0
dhp-build/dhp-code-style/src/main/resources/eclipse/formatter_google.xml
Normal file → Executable file
0
dhp-build/dhp-code-style/src/main/resources/eclipse/formatter_google.xml
Normal file → Executable file
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<project xmlns="http://maven.apache.org/DECORATION/1.8.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.8.0 https://maven.apache.org/xsd/decoration-1.8.0.xsd"
|
||||
name="DHP-Aggregation">
|
||||
<skin>
|
||||
<groupId>org.apache.maven.skins</groupId>
|
||||
<artifactId>maven-fluido-skin</artifactId>
|
||||
<version>1.8</version>
|
||||
</skin>
|
||||
<poweredBy>
|
||||
<logo name="OpenAIRE Research Graph" href="https://graph.openaire.eu/"
|
||||
img="https://graph.openaire.eu/assets/common-assets/logo-large-graph.png"/>
|
||||
</poweredBy>
|
||||
<body>
|
||||
<links>
|
||||
<item name="Code" href="https://code-repo.d4science.org/" />
|
||||
</links>
|
||||
<menu ref="modules" />
|
||||
<menu ref="reports"/>
|
||||
</body>
|
||||
</project>
|
|
@ -10,6 +10,9 @@
|
|||
<packaging>pom</packaging>
|
||||
|
||||
<description>This module is a container for the build tools used in dnet-hadoop</description>
|
||||
<properties>
|
||||
<maven.javadoc.skip>true</maven.javadoc.skip>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
<module>dhp-code-style</module>
|
||||
|
@ -17,4 +20,12 @@
|
|||
<module>dhp-build-properties-maven-plugin</module>
|
||||
</modules>
|
||||
|
||||
|
||||
<distributionManagement>
|
||||
<site>
|
||||
<id>DHPSite</id>
|
||||
<url>${dhp.site.stage.path}/dhp-build/</url>
|
||||
</site>
|
||||
</distributionManagement>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<project xmlns="http://maven.apache.org/DECORATION/1.8.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.8.0 https://maven.apache.org/xsd/decoration-1.8.0.xsd"
|
||||
name="DHP-Aggregation">
|
||||
<skin>
|
||||
<groupId>org.apache.maven.skins</groupId>
|
||||
<artifactId>maven-fluido-skin</artifactId>
|
||||
<version>1.8</version>
|
||||
</skin>
|
||||
<poweredBy>
|
||||
<logo name="OpenAIRE Research Graph" href="https://graph.openaire.eu/"
|
||||
img="https://graph.openaire.eu/assets/common-assets/logo-large-graph.png"/>
|
||||
</poweredBy>
|
||||
<body>
|
||||
<links>
|
||||
<item name="Code" href="https://code-repo.d4science.org/" />
|
||||
</links>
|
||||
|
||||
<menu ref="modules" />
|
||||
<menu ref="reports"/>
|
||||
</body>
|
||||
</project>
|
|
@ -13,7 +13,51 @@
|
|||
<artifactId>dhp-common</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<distributionManagement>
|
||||
<site>
|
||||
<id>DHPSite</id>
|
||||
<url>${dhp.site.stage.path}/dhp-common</url>
|
||||
</site>
|
||||
</distributionManagement>
|
||||
|
||||
<description>This module contains common utilities meant to be used across the dnet-hadoop submodules</description>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>net.alchim31.maven</groupId>
|
||||
<artifactId>scala-maven-plugin</artifactId>
|
||||
<version>${net.alchim31.maven.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>scala-compile-first</id>
|
||||
<phase>initialize</phase>
|
||||
<goals>
|
||||
<goal>add-source</goal>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>scala-test-compile</id>
|
||||
<phase>process-test-resources</phase>
|
||||
<goals>
|
||||
<goal>testCompile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>scala-doc</id>
|
||||
<phase>process-resources</phase> <!-- or wherever -->
|
||||
<goals>
|
||||
<goal>doc</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<scalaVersion>${scala.version}</scalaVersion>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
|
||||
|
@ -25,6 +69,11 @@
|
|||
<groupId>com.github.sisyphsu</groupId>
|
||||
<artifactId>dateparser</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.xuender</groupId>
|
||||
<artifactId>unidecode</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.spark</groupId>
|
||||
<artifactId>spark-core_2.11</artifactId>
|
||||
|
@ -112,6 +161,11 @@
|
|||
<groupId>eu.dnetlib.dhp</groupId>
|
||||
<artifactId>dhp-schemas</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.opencsv</groupId>
|
||||
<artifactId>opencsv</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.application;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.apache.hadoop.conf.Configuration;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
public class ApplicationUtils {
|
||||
|
||||
}
|
8
dhp-common/src/main/java/eu/dnetlib/dhp/application/ArgumentApplicationParser.java
Normal file → Executable file
8
dhp-common/src/main/java/eu/dnetlib/dhp/application/ArgumentApplicationParser.java
Normal file → Executable file
|
@ -56,13 +56,13 @@ public class ArgumentApplicationParser implements Serializable {
|
|||
final StringWriter stringWriter = new StringWriter();
|
||||
IOUtils.copy(gis, stringWriter);
|
||||
return stringWriter.toString();
|
||||
} catch (Throwable e) {
|
||||
log.error("Wrong value to decompress:" + abstractCompressed);
|
||||
throw new RuntimeException(e);
|
||||
} catch (IOException e) {
|
||||
log.error("Wrong value to decompress: {}", abstractCompressed);
|
||||
throw new IllegalArgumentException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static String compressArgument(final String value) throws Exception {
|
||||
public static String compressArgument(final String value) throws IOException {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
GZIPOutputStream gzip = new GZIPOutputStream(out);
|
||||
gzip.write(value.getBytes());
|
||||
|
|
3
dhp-common/src/main/java/eu/dnetlib/dhp/application/OptionsParameter.java
Normal file → Executable file
3
dhp-common/src/main/java/eu/dnetlib/dhp/application/OptionsParameter.java
Normal file → Executable file
|
@ -9,9 +9,6 @@ public class OptionsParameter {
|
|||
private boolean paramRequired;
|
||||
private boolean compressed;
|
||||
|
||||
public OptionsParameter() {
|
||||
}
|
||||
|
||||
public String getParamName() {
|
||||
return paramName;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
package eu.dnetlib.dhp.application
|
||||
|
||||
import scala.io.Source
|
||||
|
||||
/**
|
||||
* This is the main Interface SparkApplication
|
||||
* where all the Spark Scala class should inherit
|
||||
*
|
||||
*/
|
||||
trait SparkScalaApplication {
|
||||
/**
|
||||
* This is the path in the classpath of the json
|
||||
* describes all the argument needed to run
|
||||
*/
|
||||
val propertyPath: String
|
||||
|
||||
/**
|
||||
* Utility to parse the arguments using the
|
||||
* property json in the classpath identified from
|
||||
* the variable propertyPath
|
||||
*
|
||||
* @param args the list of arguments
|
||||
*/
|
||||
def parseArguments(args: Array[String]): ArgumentApplicationParser = {
|
||||
val parser = new ArgumentApplicationParser(Source.fromInputStream(getClass.getResourceAsStream(propertyPath)).mkString)
|
||||
parser.parseArgument(args)
|
||||
parser
|
||||
}
|
||||
|
||||
/**
|
||||
* Here all the spark applications runs this method
|
||||
* where the whole logic of the spark node is defined
|
||||
*/
|
||||
def run(): Unit
|
||||
}
|
||||
|
||||
|
||||
import org.apache.spark.SparkConf
|
||||
import org.apache.spark.sql.SparkSession
|
||||
import org.slf4j.Logger
|
||||
|
||||
abstract class AbstractScalaApplication (val propertyPath:String, val args:Array[String], log:Logger) extends SparkScalaApplication {
|
||||
|
||||
var parser: ArgumentApplicationParser = null
|
||||
|
||||
var spark:SparkSession = null
|
||||
|
||||
|
||||
def initialize():SparkScalaApplication = {
|
||||
parser = parseArguments(args)
|
||||
spark = createSparkSession()
|
||||
this
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility for creating a spark session starting from parser
|
||||
*
|
||||
* @return a spark Session
|
||||
*/
|
||||
private def createSparkSession():SparkSession = {
|
||||
require(parser!= null)
|
||||
|
||||
val conf:SparkConf = new SparkConf()
|
||||
val master = parser.get("master")
|
||||
log.info(s"Creating Spark session: Master: $master")
|
||||
SparkSession.builder().config(conf)
|
||||
.appName(getClass.getSimpleName)
|
||||
.master(master)
|
||||
.getOrCreate()
|
||||
}
|
||||
|
||||
}
|
2
dhp-common/src/main/java/eu/dnetlib/dhp/collection/ApiDescriptor.java
Normal file → Executable file
2
dhp-common/src/main/java/eu/dnetlib/dhp/collection/ApiDescriptor.java
Normal file → Executable file
|
@ -34,7 +34,7 @@ public class ApiDescriptor {
|
|||
return params;
|
||||
}
|
||||
|
||||
public void setParams(final HashMap<String, String> params) {
|
||||
public void setParams(final Map<String, String> params) {
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@ public class Constants {
|
|||
|
||||
public static String COAR_ACCESS_RIGHT_SCHEMA = "http://vocabularies.coar-repositories.org/documentation/access_rights/";
|
||||
|
||||
private Constants() {
|
||||
}
|
||||
|
||||
static {
|
||||
accessRightsCoarMap.put("OPEN", "c_abf2");
|
||||
accessRightsCoarMap.put("RESTRICTED", "c_16ec");
|
||||
|
@ -49,4 +52,10 @@ public class Constants {
|
|||
public static final String CONTENT_INVALIDRECORDS = "InvalidRecords";
|
||||
public static final String CONTENT_TRANSFORMEDRECORDS = "transformedItems";
|
||||
|
||||
// IETF Draft and used by Repositories like ZENODO , not included in APACHE HTTP java packages
|
||||
// see https://ietf-wg-httpapi.github.io/ratelimit-headers/draft-ietf-httpapi-ratelimit-headers.html
|
||||
public static final String HTTPHEADER_IETF_DRAFT_RATELIMIT_LIMIT = "X-RateLimit-Limit";
|
||||
public static final String HTTPHEADER_IETF_DRAFT_RATELIMIT_REMAINING = "X-RateLimit-Remaining";
|
||||
public static final String HTTPHEADER_IETF_DRAFT_RATELIMIT_RESET = "X-RateLimit-Reset";
|
||||
|
||||
}
|
||||
|
|
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/FunctionalInterfaceSupport.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/FunctionalInterfaceSupport.java
Normal file → Executable file
17
dhp-common/src/main/java/eu/dnetlib/dhp/common/GraphResultMapper.java
Normal file → Executable file
17
dhp-common/src/main/java/eu/dnetlib/dhp/common/GraphResultMapper.java
Normal file → Executable file
|
@ -84,7 +84,7 @@ public class GraphResultMapper implements Serializable {
|
|||
.setDocumentationUrl(
|
||||
value
|
||||
.stream()
|
||||
.map(v -> v.getValue())
|
||||
.map(Field::getValue)
|
||||
.collect(Collectors.toList())));
|
||||
|
||||
Optional
|
||||
|
@ -100,20 +100,20 @@ public class GraphResultMapper implements Serializable {
|
|||
.setContactgroup(
|
||||
Optional
|
||||
.ofNullable(ir.getContactgroup())
|
||||
.map(value -> value.stream().map(cg -> cg.getValue()).collect(Collectors.toList()))
|
||||
.map(value -> value.stream().map(Field::getValue).collect(Collectors.toList()))
|
||||
.orElse(null));
|
||||
|
||||
out
|
||||
.setContactperson(
|
||||
Optional
|
||||
.ofNullable(ir.getContactperson())
|
||||
.map(value -> value.stream().map(cp -> cp.getValue()).collect(Collectors.toList()))
|
||||
.map(value -> value.stream().map(Field::getValue).collect(Collectors.toList()))
|
||||
.orElse(null));
|
||||
out
|
||||
.setTool(
|
||||
Optional
|
||||
.ofNullable(ir.getTool())
|
||||
.map(value -> value.stream().map(t -> t.getValue()).collect(Collectors.toList()))
|
||||
.map(value -> value.stream().map(Field::getValue).collect(Collectors.toList()))
|
||||
.orElse(null));
|
||||
|
||||
out.setType(ModelConstants.ORP_DEFAULT_RESULTTYPE.getClassname());
|
||||
|
@ -123,7 +123,8 @@ public class GraphResultMapper implements Serializable {
|
|||
|
||||
Optional
|
||||
.ofNullable(input.getAuthor())
|
||||
.ifPresent(ats -> out.setAuthor(ats.stream().map(at -> getAuthor(at)).collect(Collectors.toList())));
|
||||
.ifPresent(
|
||||
ats -> out.setAuthor(ats.stream().map(GraphResultMapper::getAuthor).collect(Collectors.toList())));
|
||||
|
||||
// I do not map Access Right UNKNOWN or OTHER
|
||||
|
||||
|
@ -210,7 +211,7 @@ public class GraphResultMapper implements Serializable {
|
|||
if (oInst.isPresent()) {
|
||||
out
|
||||
.setInstance(
|
||||
oInst.get().stream().map(i -> getInstance(i)).collect(Collectors.toList()));
|
||||
oInst.get().stream().map(GraphResultMapper::getInstance).collect(Collectors.toList()));
|
||||
|
||||
}
|
||||
|
||||
|
@ -230,7 +231,7 @@ public class GraphResultMapper implements Serializable {
|
|||
.stream()
|
||||
.filter(t -> t.getQualifier().getClassid().equalsIgnoreCase("main title"))
|
||||
.collect(Collectors.toList());
|
||||
if (iTitle.size() > 0) {
|
||||
if (!iTitle.isEmpty()) {
|
||||
out.setMaintitle(iTitle.get(0).getValue());
|
||||
}
|
||||
|
||||
|
@ -239,7 +240,7 @@ public class GraphResultMapper implements Serializable {
|
|||
.stream()
|
||||
.filter(t -> t.getQualifier().getClassid().equalsIgnoreCase("subtitle"))
|
||||
.collect(Collectors.toList());
|
||||
if (iTitle.size() > 0) {
|
||||
if (!iTitle.isEmpty()) {
|
||||
out.setSubtitle(iTitle.get(0).getValue());
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ public class HdfsSupport {
|
|||
* @param configuration Configuration of hadoop env
|
||||
*/
|
||||
public static boolean exists(String path, Configuration configuration) {
|
||||
logger.info("Removing path: {}", path);
|
||||
logger.info("Checking existence for path: {}", path);
|
||||
return rethrowAsRuntimeException(
|
||||
() -> {
|
||||
Path f = new Path(path);
|
||||
|
|
|
@ -14,38 +14,33 @@ public class MakeTarArchive implements Serializable {
|
|||
|
||||
private static TarArchiveOutputStream getTar(FileSystem fileSystem, String outputPath) throws IOException {
|
||||
Path hdfsWritePath = new Path(outputPath);
|
||||
FSDataOutputStream fsDataOutputStream = null;
|
||||
if (fileSystem.exists(hdfsWritePath)) {
|
||||
fileSystem.delete(hdfsWritePath, true);
|
||||
|
||||
}
|
||||
fsDataOutputStream = fileSystem.create(hdfsWritePath);
|
||||
|
||||
return new TarArchiveOutputStream(fsDataOutputStream.getWrappedStream());
|
||||
return new TarArchiveOutputStream(fileSystem.create(hdfsWritePath).getWrappedStream());
|
||||
}
|
||||
|
||||
private static void write(FileSystem fileSystem, String inputPath, String outputPath, String dir_name)
|
||||
throws IOException {
|
||||
|
||||
Path hdfsWritePath = new Path(outputPath);
|
||||
FSDataOutputStream fsDataOutputStream = null;
|
||||
if (fileSystem.exists(hdfsWritePath)) {
|
||||
fileSystem.delete(hdfsWritePath, true);
|
||||
|
||||
}
|
||||
fsDataOutputStream = fileSystem.create(hdfsWritePath);
|
||||
try (TarArchiveOutputStream ar = new TarArchiveOutputStream(
|
||||
fileSystem.create(hdfsWritePath).getWrappedStream())) {
|
||||
|
||||
TarArchiveOutputStream ar = new TarArchiveOutputStream(fsDataOutputStream.getWrappedStream());
|
||||
RemoteIterator<LocatedFileStatus> iterator = fileSystem
|
||||
.listFiles(
|
||||
new Path(inputPath), true);
|
||||
|
||||
RemoteIterator<LocatedFileStatus> fileStatusListIterator = fileSystem
|
||||
.listFiles(
|
||||
new Path(inputPath), true);
|
||||
while (iterator.hasNext()) {
|
||||
writeCurrentFile(fileSystem, dir_name, iterator, ar, 0);
|
||||
}
|
||||
|
||||
while (fileStatusListIterator.hasNext()) {
|
||||
writeCurrentFile(fileSystem, dir_name, fileStatusListIterator, ar, 0);
|
||||
}
|
||||
|
||||
ar.close();
|
||||
}
|
||||
|
||||
public static void tarMaxSize(FileSystem fileSystem, String inputPath, String outputPath, String dir_name,
|
||||
|
@ -90,6 +85,13 @@ public class MakeTarArchive implements Serializable {
|
|||
String p_string = p.toString();
|
||||
if (!p_string.endsWith("_SUCCESS")) {
|
||||
String name = p_string.substring(p_string.lastIndexOf("/") + 1);
|
||||
if (name.startsWith("part-") & name.length() > 10) {
|
||||
String tmp = name.substring(0, 10);
|
||||
if (name.contains(".")) {
|
||||
tmp += name.substring(name.indexOf("."));
|
||||
}
|
||||
name = tmp;
|
||||
}
|
||||
TarArchiveEntry entry = new TarArchiveEntry(dir_name + "/" + name);
|
||||
entry.setSize(fileStatus.getLen());
|
||||
current_size += fileStatus.getLen();
|
||||
|
|
|
@ -10,8 +10,6 @@ import java.util.Optional;
|
|||
import java.util.stream.StreamSupport;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.bson.Document;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -21,6 +19,7 @@ import com.mongodb.BasicDBObject;
|
|||
import com.mongodb.MongoClient;
|
||||
import com.mongodb.MongoClientURI;
|
||||
import com.mongodb.QueryBuilder;
|
||||
import com.mongodb.client.FindIterable;
|
||||
import com.mongodb.client.MongoCollection;
|
||||
import com.mongodb.client.MongoDatabase;
|
||||
|
||||
|
@ -46,7 +45,7 @@ public class MdstoreClient implements Closeable {
|
|||
|
||||
final String currentId = Optional
|
||||
.ofNullable(getColl(db, COLL_METADATA_MANAGER, true).find(query))
|
||||
.map(r -> r.first())
|
||||
.map(FindIterable::first)
|
||||
.map(d -> d.getString("currentId"))
|
||||
.orElseThrow(() -> new IllegalArgumentException("cannot find current mdstore id for: " + mdId));
|
||||
|
||||
|
@ -84,7 +83,7 @@ public class MdstoreClient implements Closeable {
|
|||
if (!Iterables.contains(client.listDatabaseNames(), dbName)) {
|
||||
final String err = String.format("Database '%s' not found in %s", dbName, client.getAddress());
|
||||
log.warn(err);
|
||||
throw new RuntimeException(err);
|
||||
throw new IllegalArgumentException(err);
|
||||
}
|
||||
return client.getDatabase(dbName);
|
||||
}
|
||||
|
@ -97,7 +96,7 @@ public class MdstoreClient implements Closeable {
|
|||
String.format("Missing collection '%s' in database '%s'", collName, db.getName()));
|
||||
log.warn(err);
|
||||
if (abortIfMissing) {
|
||||
throw new RuntimeException(err);
|
||||
throw new IllegalArgumentException(err);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ import com.google.common.hash.Hashing;
|
|||
*/
|
||||
public class PacePerson {
|
||||
|
||||
private static final String UTF8 = "UTF-8";
|
||||
private List<String> name = Lists.newArrayList();
|
||||
private List<String> surname = Lists.newArrayList();
|
||||
private List<String> fullname = Lists.newArrayList();
|
||||
|
|
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/SparkSessionSupport.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/SparkSessionSupport.java
Normal file → Executable file
|
@ -1,5 +1,5 @@
|
|||
|
||||
package eu.dnetlib.dhp.aggregation.common;
|
||||
package eu.dnetlib.dhp.common.aggregation;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
|
@ -11,8 +11,6 @@ import java.util.Objects;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import eu.dnetlib.dhp.message.MessageSender;
|
||||
import eu.dnetlib.dhp.utils.DHPUtils;
|
||||
|
||||
|
@ -20,12 +18,12 @@ public class AggregatorReport extends LinkedHashMap<String, String> implements C
|
|||
|
||||
private static final Logger log = LoggerFactory.getLogger(AggregatorReport.class);
|
||||
|
||||
private MessageSender messageSender;
|
||||
private transient MessageSender messageSender;
|
||||
|
||||
public AggregatorReport() {
|
||||
}
|
||||
|
||||
public AggregatorReport(MessageSender messageSender) throws IOException {
|
||||
public AggregatorReport(MessageSender messageSender) {
|
||||
this.messageSender = messageSender;
|
||||
}
|
||||
|
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/InputStreamRequestBody.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/InputStreamRequestBody.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/MissingConceptDoiException.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/MissingConceptDoiException.java
Normal file → Executable file
27
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/ZenodoAPIClient.java
Normal file → Executable file
27
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/ZenodoAPIClient.java
Normal file → Executable file
|
@ -5,6 +5,9 @@ import java.io.*;
|
|||
import java.io.IOException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.http.HttpHeaders;
|
||||
import org.apache.http.entity.ContentType;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import eu.dnetlib.dhp.common.api.zenodo.ZenodoModel;
|
||||
|
@ -43,7 +46,7 @@ public class ZenodoAPIClient implements Serializable {
|
|||
this.deposition_id = deposition_id;
|
||||
}
|
||||
|
||||
public ZenodoAPIClient(String urlString, String access_token) throws IOException {
|
||||
public ZenodoAPIClient(String urlString, String access_token) {
|
||||
|
||||
this.urlString = urlString;
|
||||
this.access_token = access_token;
|
||||
|
@ -63,8 +66,8 @@ public class ZenodoAPIClient implements Serializable {
|
|||
|
||||
Request request = new Request.Builder()
|
||||
.url(urlString)
|
||||
.addHeader("Content-Type", "application/json") // add request headers
|
||||
.addHeader("Authorization", "Bearer " + access_token)
|
||||
.addHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.toString()) // add request headers
|
||||
.addHeader(HttpHeaders.AUTHORIZATION, "Bearer " + access_token)
|
||||
.post(body)
|
||||
.build();
|
||||
|
||||
|
@ -103,8 +106,8 @@ public class ZenodoAPIClient implements Serializable {
|
|||
|
||||
Request request = new Request.Builder()
|
||||
.url(bucket + "/" + file_name)
|
||||
.addHeader("Content-Type", "application/zip") // add request headers
|
||||
.addHeader("Authorization", "Bearer " + access_token)
|
||||
.addHeader(HttpHeaders.CONTENT_TYPE, "application/zip") // add request headers
|
||||
.addHeader(HttpHeaders.AUTHORIZATION, "Bearer " + access_token)
|
||||
.put(InputStreamRequestBody.create(MEDIA_TYPE_ZIP, is, len))
|
||||
.build();
|
||||
|
||||
|
@ -130,8 +133,8 @@ public class ZenodoAPIClient implements Serializable {
|
|||
|
||||
Request request = new Request.Builder()
|
||||
.url(urlString + "/" + deposition_id)
|
||||
.addHeader("Content-Type", "application/json") // add request headers
|
||||
.addHeader("Authorization", "Bearer " + access_token)
|
||||
.addHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.toString()) // add request headers
|
||||
.addHeader(HttpHeaders.AUTHORIZATION, "Bearer " + access_token)
|
||||
.put(body)
|
||||
.build();
|
||||
|
||||
|
@ -197,7 +200,7 @@ public class ZenodoAPIClient implements Serializable {
|
|||
|
||||
Request request = new Request.Builder()
|
||||
.url(urlString + "/" + deposition_id + "/actions/newversion")
|
||||
.addHeader("Authorization", "Bearer " + access_token)
|
||||
.addHeader(HttpHeaders.AUTHORIZATION, "Bearer " + access_token)
|
||||
.post(body)
|
||||
.build();
|
||||
|
||||
|
@ -270,8 +273,8 @@ public class ZenodoAPIClient implements Serializable {
|
|||
|
||||
Request request = new Request.Builder()
|
||||
.url(urlString)
|
||||
.addHeader("Content-Type", "application/json") // add request headers
|
||||
.addHeader("Authorization", "Bearer " + access_token)
|
||||
.addHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.toString()) // add request headers
|
||||
.addHeader(HttpHeaders.AUTHORIZATION, "Bearer " + access_token)
|
||||
.get()
|
||||
.build();
|
||||
|
||||
|
@ -293,8 +296,8 @@ public class ZenodoAPIClient implements Serializable {
|
|||
|
||||
Request request = new Request.Builder()
|
||||
.url(url)
|
||||
.addHeader("Content-Type", "application/json") // add request headers
|
||||
.addHeader("Authorization", "Bearer " + access_token)
|
||||
.addHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.toString()) // add request headers
|
||||
.addHeader(HttpHeaders.AUTHORIZATION, "Bearer " + access_token)
|
||||
.get()
|
||||
.build();
|
||||
|
||||
|
|
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/zenodo/Community.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/zenodo/Community.java
Normal file → Executable file
6
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/zenodo/Creator.java
Normal file → Executable file
6
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/zenodo/Creator.java
Normal file → Executable file
|
@ -32,13 +32,13 @@ public class Creator {
|
|||
|
||||
public static Creator newInstance(String name, String affiliation, String orcid) {
|
||||
Creator c = new Creator();
|
||||
if (!(name == null)) {
|
||||
if (name != null) {
|
||||
c.name = name;
|
||||
}
|
||||
if (!(affiliation == null)) {
|
||||
if (affiliation != null) {
|
||||
c.affiliation = affiliation;
|
||||
}
|
||||
if (!(orcid == null)) {
|
||||
if (orcid != null) {
|
||||
c.orcid = orcid;
|
||||
}
|
||||
|
||||
|
|
14
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/zenodo/File.java
Normal file → Executable file
14
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/zenodo/File.java
Normal file → Executable file
|
@ -3,17 +3,12 @@ package eu.dnetlib.dhp.common.api.zenodo;
|
|||
|
||||
import java.io.Serializable;
|
||||
|
||||
import net.minidev.json.annotate.JsonIgnore;
|
||||
|
||||
public class File implements Serializable {
|
||||
private String checksum;
|
||||
private String filename;
|
||||
private long filesize;
|
||||
private String id;
|
||||
|
||||
@JsonIgnore
|
||||
// private Links links;
|
||||
|
||||
public String getChecksum() {
|
||||
return checksum;
|
||||
}
|
||||
|
@ -46,13 +41,4 @@ public class File implements Serializable {
|
|||
this.id = id;
|
||||
}
|
||||
|
||||
// @JsonIgnore
|
||||
// public Links getLinks() {
|
||||
// return links;
|
||||
// }
|
||||
//
|
||||
// @JsonIgnore
|
||||
// public void setLinks(Links links) {
|
||||
// this.links = links;
|
||||
// }
|
||||
}
|
||||
|
|
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/zenodo/Grant.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/zenodo/Grant.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/zenodo/Links.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/zenodo/Links.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/zenodo/Metadata.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/zenodo/Metadata.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/zenodo/PrereserveDoi.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/zenodo/PrereserveDoi.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/zenodo/RelatedIdentifier.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/zenodo/RelatedIdentifier.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/zenodo/ZenodoModel.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/zenodo/ZenodoModel.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/zenodo/ZenodoModelList.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/api/zenodo/ZenodoModelList.java
Normal file → Executable file
|
@ -1,5 +1,5 @@
|
|||
|
||||
package eu.dnetlib.dhp.collection;
|
||||
package eu.dnetlib.dhp.common.collection;
|
||||
|
||||
public class CollectorException extends Exception {
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
|
||||
package eu.dnetlib.dhp.common.collection;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.hadoop.fs.FSDataOutputStream;
|
||||
import org.apache.hadoop.fs.FileSystem;
|
||||
import org.apache.hadoop.fs.Path;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.opencsv.bean.CsvToBeanBuilder;
|
||||
|
||||
public class GetCSV {
|
||||
|
||||
public static final char DEFAULT_DELIMITER = ',';
|
||||
|
||||
private GetCSV() {
|
||||
}
|
||||
|
||||
public static void getCsv(FileSystem fileSystem, BufferedReader reader, String hdfsPath,
|
||||
String modelClass) throws IOException, ClassNotFoundException {
|
||||
getCsv(fileSystem, reader, hdfsPath, modelClass, DEFAULT_DELIMITER);
|
||||
}
|
||||
|
||||
public static void getCsv(FileSystem fileSystem, Reader reader, String hdfsPath,
|
||||
String modelClass, char delimiter) throws IOException, ClassNotFoundException {
|
||||
|
||||
Path hdfsWritePath = new Path(hdfsPath);
|
||||
FSDataOutputStream fsDataOutputStream = null;
|
||||
if (fileSystem.exists(hdfsWritePath)) {
|
||||
fileSystem.delete(hdfsWritePath, false);
|
||||
}
|
||||
fsDataOutputStream = fileSystem.create(hdfsWritePath);
|
||||
|
||||
try (BufferedWriter writer = new BufferedWriter(
|
||||
new OutputStreamWriter(fsDataOutputStream, StandardCharsets.UTF_8))) {
|
||||
|
||||
final ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
final List lines = new CsvToBeanBuilder(reader)
|
||||
.withType(Class.forName(modelClass))
|
||||
.withSeparator(delimiter)
|
||||
.build()
|
||||
.parse();
|
||||
|
||||
for (Object line : lines) {
|
||||
writer.write(mapper.writeValueAsString(line));
|
||||
writer.newLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
package eu.dnetlib.dhp.collection;
|
||||
package eu.dnetlib.dhp.common.collection;
|
||||
|
||||
/**
|
||||
* Bundles the http connection parameters driving the client behaviour.
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
package eu.dnetlib.dhp.collection;
|
||||
package eu.dnetlib.dhp.common.collection;
|
||||
|
||||
import static eu.dnetlib.dhp.utils.DHPUtils.*;
|
||||
|
||||
|
@ -15,12 +15,13 @@ import org.apache.http.HttpHeaders;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import eu.dnetlib.dhp.aggregation.common.AggregatorReport;
|
||||
import eu.dnetlib.dhp.common.Constants;
|
||||
import eu.dnetlib.dhp.common.aggregation.AggregatorReport;
|
||||
|
||||
/**
|
||||
* Migrated from https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-modular-collector-service/trunk/src/main/java/eu/dnetlib/data/collector/plugins/HttpConnector.java
|
||||
*
|
||||
* @author jochen, michele, andrea, alessia, claudio
|
||||
* @author jochen, michele, andrea, alessia, claudio, andreas
|
||||
*/
|
||||
public class HttpConnector2 {
|
||||
|
||||
|
@ -32,7 +33,7 @@ public class HttpConnector2 {
|
|||
|
||||
private String responseType = null;
|
||||
|
||||
private final String userAgent = "Mozilla/5.0 (compatible; OAI; +http://www.openaire.eu)";
|
||||
private static final String userAgent = "Mozilla/5.0 (compatible; OAI; +http://www.openaire.eu)";
|
||||
|
||||
public HttpConnector2() {
|
||||
this(new HttpClientParams());
|
||||
|
@ -112,6 +113,17 @@ public class HttpConnector2 {
|
|||
}
|
||||
|
||||
int retryAfter = obtainRetryAfter(urlConn.getHeaderFields());
|
||||
String rateLimit = urlConn.getHeaderField(Constants.HTTPHEADER_IETF_DRAFT_RATELIMIT_LIMIT);
|
||||
String rateRemaining = urlConn.getHeaderField(Constants.HTTPHEADER_IETF_DRAFT_RATELIMIT_REMAINING);
|
||||
|
||||
if ((rateLimit != null) && (rateRemaining != null) && (Integer.parseInt(rateRemaining) < 2)) {
|
||||
if (retryAfter > 0) {
|
||||
backoffAndSleep(retryAfter);
|
||||
} else {
|
||||
backoffAndSleep(1000);
|
||||
}
|
||||
}
|
||||
|
||||
if (is2xx(urlConn.getResponseCode())) {
|
||||
input = urlConn.getInputStream();
|
||||
responseType = urlConn.getContentType();
|
||||
|
@ -120,7 +132,7 @@ public class HttpConnector2 {
|
|||
if (is3xx(urlConn.getResponseCode())) {
|
||||
// REDIRECTS
|
||||
final String newUrl = obtainNewLocation(urlConn.getHeaderFields());
|
||||
log.info(String.format("The requested url has been moved to %s", newUrl));
|
||||
log.info("The requested url has been moved to {}", newUrl);
|
||||
report
|
||||
.put(
|
||||
REPORT_PREFIX + urlConn.getResponseCode(),
|
||||
|
@ -140,14 +152,14 @@ public class HttpConnector2 {
|
|||
if (retryAfter > 0) {
|
||||
log
|
||||
.warn(
|
||||
requestUrl + " - waiting and repeating request after suggested retry-after "
|
||||
+ retryAfter + " sec.");
|
||||
"{} - waiting and repeating request after suggested retry-after {} sec.",
|
||||
requestUrl, retryAfter);
|
||||
backoffAndSleep(retryAfter * 1000);
|
||||
} else {
|
||||
log
|
||||
.warn(
|
||||
requestUrl + " - waiting and repeating request after default delay of "
|
||||
+ getClientParams().getRetryDelay() + " sec.");
|
||||
"{} - waiting and repeating request after default delay of {} sec.",
|
||||
requestUrl, getClientParams().getRetryDelay());
|
||||
backoffAndSleep(retryNumber * getClientParams().getRetryDelay() * 1000);
|
||||
}
|
||||
report.put(REPORT_PREFIX + urlConn.getResponseCode(), requestUrl);
|
||||
|
@ -181,12 +193,12 @@ public class HttpConnector2 {
|
|||
}
|
||||
|
||||
private void logHeaderFields(final HttpURLConnection urlConn) throws IOException {
|
||||
log.debug("StatusCode: " + urlConn.getResponseMessage());
|
||||
log.debug("StatusCode: {}", urlConn.getResponseMessage());
|
||||
|
||||
for (Map.Entry<String, List<String>> e : urlConn.getHeaderFields().entrySet()) {
|
||||
if (e.getKey() != null) {
|
||||
for (String v : e.getValue()) {
|
||||
log.debug(" key: " + e.getKey() + " - value: " + v);
|
||||
log.debug(" key: {} - value: {}", e.getKey(), v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -204,7 +216,7 @@ public class HttpConnector2 {
|
|||
|
||||
private int obtainRetryAfter(final Map<String, List<String>> headerMap) {
|
||||
for (String key : headerMap.keySet()) {
|
||||
if ((key != null) && key.equalsIgnoreCase(HttpHeaders.RETRY_AFTER) && (headerMap.get(key).size() > 0)
|
||||
if ((key != null) && key.equalsIgnoreCase(HttpHeaders.RETRY_AFTER) && (!headerMap.get(key).isEmpty())
|
||||
&& NumberUtils.isCreatable(headerMap.get(key).get(0))) {
|
||||
return Integer.parseInt(headerMap.get(key).get(0)) + 10;
|
||||
}
|
37
dhp-common/src/main/java/eu/dnetlib/dhp/common/rest/DNetRestClient.java
Normal file → Executable file
37
dhp-common/src/main/java/eu/dnetlib/dhp/common/rest/DNetRestClient.java
Normal file → Executable file
|
@ -1,11 +1,11 @@
|
|||
|
||||
package eu.dnetlib.dhp.common.rest;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.client.methods.HttpUriRequest;
|
||||
|
@ -23,17 +23,20 @@ public class DNetRestClient {
|
|||
|
||||
private static final ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
private DNetRestClient() {
|
||||
}
|
||||
|
||||
public static <T> T doGET(final String url, Class<T> clazz) throws Exception {
|
||||
final HttpGet httpGet = new HttpGet(url);
|
||||
return doHTTPRequest(httpGet, clazz);
|
||||
}
|
||||
|
||||
public static String doGET(final String url) throws Exception {
|
||||
public static String doGET(final String url) throws IOException {
|
||||
final HttpGet httpGet = new HttpGet(url);
|
||||
return doHTTPRequest(httpGet);
|
||||
}
|
||||
|
||||
public static <V> String doPOST(final String url, V objParam) throws Exception {
|
||||
public static <V> String doPOST(final String url, V objParam) throws IOException {
|
||||
final HttpPost httpPost = new HttpPost(url);
|
||||
|
||||
if (objParam != null) {
|
||||
|
@ -45,25 +48,25 @@ public class DNetRestClient {
|
|||
return doHTTPRequest(httpPost);
|
||||
}
|
||||
|
||||
public static <T, V> T doPOST(final String url, V objParam, Class<T> clazz) throws Exception {
|
||||
public static <T, V> T doPOST(final String url, V objParam, Class<T> clazz) throws IOException {
|
||||
return mapper.readValue(doPOST(url, objParam), clazz);
|
||||
}
|
||||
|
||||
private static String doHTTPRequest(final HttpUriRequest r) throws Exception {
|
||||
CloseableHttpClient client = HttpClients.createDefault();
|
||||
private static String doHTTPRequest(final HttpUriRequest r) throws IOException {
|
||||
try (CloseableHttpClient client = HttpClients.createDefault()) {
|
||||
|
||||
log.info("performing HTTP request, method {} on URI {}", r.getMethod(), r.getURI().toString());
|
||||
log
|
||||
.info(
|
||||
"request headers: {}",
|
||||
Arrays
|
||||
.asList(r.getAllHeaders())
|
||||
.stream()
|
||||
.map(h -> h.getName() + ":" + h.getValue())
|
||||
.collect(Collectors.joining(",")));
|
||||
log.info("performing HTTP request, method {} on URI {}", r.getMethod(), r.getURI().toString());
|
||||
log
|
||||
.info(
|
||||
"request headers: {}",
|
||||
Arrays
|
||||
.asList(r.getAllHeaders())
|
||||
.stream()
|
||||
.map(h -> h.getName() + ":" + h.getValue())
|
||||
.collect(Collectors.joining(",")));
|
||||
|
||||
CloseableHttpResponse response = client.execute(r);
|
||||
return IOUtils.toString(response.getEntity().getContent());
|
||||
return IOUtils.toString(client.execute(r).getEntity().getContent());
|
||||
}
|
||||
}
|
||||
|
||||
private static <T> T doHTTPRequest(final HttpUriRequest r, Class<T> clazz) throws Exception {
|
||||
|
|
3
dhp-common/src/main/java/eu/dnetlib/dhp/common/vocabulary/Vocabulary.java
Normal file → Executable file
3
dhp-common/src/main/java/eu/dnetlib/dhp/common/vocabulary/Vocabulary.java
Normal file → Executable file
|
@ -46,7 +46,7 @@ public class Vocabulary implements Serializable {
|
|||
}
|
||||
|
||||
public VocabularyTerm getTerm(final String id) {
|
||||
return Optional.ofNullable(id).map(s -> s.toLowerCase()).map(s -> terms.get(s)).orElse(null);
|
||||
return Optional.ofNullable(id).map(String::toLowerCase).map(terms::get).orElse(null);
|
||||
}
|
||||
|
||||
protected void addTerm(final String id, final String name) {
|
||||
|
@ -81,7 +81,6 @@ public class Vocabulary implements Serializable {
|
|||
.ofNullable(getTermBySynonym(syn))
|
||||
.map(term -> getTermAsQualifier(term.getId()))
|
||||
.orElse(null);
|
||||
// .orElse(OafMapperUtils.unknown(getId(), getName()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
21
dhp-common/src/main/java/eu/dnetlib/dhp/common/vocabulary/VocabularyGroup.java
Normal file → Executable file
21
dhp-common/src/main/java/eu/dnetlib/dhp/common/vocabulary/VocabularyGroup.java
Normal file → Executable file
|
@ -46,7 +46,6 @@ public class VocabularyGroup implements Serializable {
|
|||
}
|
||||
|
||||
vocs.addTerm(vocId, termId, termName);
|
||||
// vocs.addSynonyms(vocId, termId, termId);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,10 +57,17 @@ public class VocabularyGroup implements Serializable {
|
|||
final String syn = arr[2].trim();
|
||||
|
||||
vocs.addSynonyms(vocId, termId, syn);
|
||||
// vocs.addSynonyms(vocId, termId, termId);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// add the term names as synonyms
|
||||
vocs.vocs.values().forEach(voc -> {
|
||||
voc.getTerms().values().forEach(term -> {
|
||||
voc.addSynonym(term.getName().toLowerCase(), term.getId());
|
||||
});
|
||||
});
|
||||
|
||||
return vocs;
|
||||
}
|
||||
|
||||
|
@ -98,7 +104,7 @@ public class VocabularyGroup implements Serializable {
|
|||
.getTerms()
|
||||
.values()
|
||||
.stream()
|
||||
.map(t -> t.getId())
|
||||
.map(VocabularyTerm::getId)
|
||||
.collect(Collectors.toCollection(HashSet::new));
|
||||
}
|
||||
|
||||
|
@ -154,16 +160,19 @@ public class VocabularyGroup implements Serializable {
|
|||
return Optional
|
||||
.ofNullable(vocId)
|
||||
.map(String::toLowerCase)
|
||||
.map(id -> vocs.containsKey(id))
|
||||
.map(vocs::containsKey)
|
||||
.orElse(false);
|
||||
}
|
||||
|
||||
private void addSynonyms(final String vocId, final String termId, final String syn) {
|
||||
String id = Optional
|
||||
.ofNullable(vocId)
|
||||
.map(s -> s.toLowerCase())
|
||||
.map(String::toLowerCase)
|
||||
.orElseThrow(
|
||||
() -> new IllegalArgumentException(String.format("empty vocabulary id for [term:%s, synonym:%s]")));
|
||||
() -> new IllegalArgumentException(
|
||||
String
|
||||
.format(
|
||||
"empty vocabulary id for [term:%s, synonym:%s]", termId, syn)));
|
||||
Optional
|
||||
.ofNullable(vocs.get(id))
|
||||
.orElseThrow(() -> new IllegalArgumentException("missing vocabulary id: " + vocId))
|
||||
|
|
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/vocabulary/VocabularyTerm.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/dhp/common/vocabulary/VocabularyTerm.java
Normal file → Executable file
|
@ -2,7 +2,6 @@
|
|||
package eu.dnetlib.dhp.message;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -10,8 +9,8 @@ public class Message implements Serializable {
|
|||
|
||||
private static final long serialVersionUID = 401753881204524893L;
|
||||
|
||||
public static String CURRENT_PARAM = "current";
|
||||
public static String TOTAL_PARAM = "total";
|
||||
public static final String CURRENT_PARAM = "current";
|
||||
public static final String TOTAL_PARAM = "total";
|
||||
|
||||
private MessageType messageType;
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ package eu.dnetlib.dhp.oa.merge;
|
|||
import java.text.Normalizer;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
|
@ -19,6 +18,9 @@ public class AuthorMerger {
|
|||
|
||||
private static final Double THRESHOLD = 0.95;
|
||||
|
||||
private AuthorMerger() {
|
||||
}
|
||||
|
||||
public static List<Author> merge(List<List<Author>> authors) {
|
||||
|
||||
authors.sort((o1, o2) -> -Integer.compare(countAuthorsPids(o1), countAuthorsPids(o2)));
|
||||
|
@ -36,7 +38,8 @@ public class AuthorMerger {
|
|||
public static List<Author> mergeAuthor(final List<Author> a, final List<Author> b, Double threshold) {
|
||||
int pa = countAuthorsPids(a);
|
||||
int pb = countAuthorsPids(b);
|
||||
List<Author> base, enrich;
|
||||
List<Author> base;
|
||||
List<Author> enrich;
|
||||
int sa = authorsSize(a);
|
||||
int sb = authorsSize(b);
|
||||
|
||||
|
@ -62,22 +65,24 @@ public class AuthorMerger {
|
|||
// <pidComparableString, Author> (if an Author has more than 1 pid, it appears 2 times in the list)
|
||||
final Map<String, Author> basePidAuthorMap = base
|
||||
.stream()
|
||||
.filter(a -> a.getPid() != null && a.getPid().size() > 0)
|
||||
.filter(a -> a.getPid() != null && !a.getPid().isEmpty())
|
||||
.flatMap(
|
||||
a -> a
|
||||
.getPid()
|
||||
.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.map(p -> new Tuple2<>(pidToComparableString(p), a)))
|
||||
.collect(Collectors.toMap(Tuple2::_1, Tuple2::_2, (x1, x2) -> x1));
|
||||
|
||||
// <pid, Author> (list of pid that are missing in the other list)
|
||||
final List<Tuple2<StructuredProperty, Author>> pidToEnrich = enrich
|
||||
.stream()
|
||||
.filter(a -> a.getPid() != null && a.getPid().size() > 0)
|
||||
.filter(a -> a.getPid() != null && !a.getPid().isEmpty())
|
||||
.flatMap(
|
||||
a -> a
|
||||
.getPid()
|
||||
.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.filter(p -> !basePidAuthorMap.containsKey(pidToComparableString(p)))
|
||||
.map(p -> new Tuple2<>(p, a)))
|
||||
.collect(Collectors.toList());
|
||||
|
@ -115,9 +120,17 @@ public class AuthorMerger {
|
|||
}
|
||||
|
||||
public static String pidToComparableString(StructuredProperty pid) {
|
||||
<<<<<<< HEAD
|
||||
if (pid == null)
|
||||
return "";
|
||||
return (pid.getQualifier() != null
|
||||
? pid.getQualifier().getClassid() != null ? pid.getQualifier().getClassid().toLowerCase() : ""
|
||||
: "")
|
||||
=======
|
||||
final String classid = pid.getQualifier().getClassid() != null ? pid.getQualifier().getClassid().toLowerCase()
|
||||
: "";
|
||||
return (pid.getQualifier() != null ? classid : "")
|
||||
>>>>>>> upstream/master
|
||||
+ (pid.getValue() != null ? pid.getValue().toLowerCase() : "");
|
||||
}
|
||||
|
||||
|
@ -150,7 +163,7 @@ public class AuthorMerger {
|
|||
}
|
||||
|
||||
private static boolean hasPid(Author a) {
|
||||
if (a == null || a.getPid() == null || a.getPid().size() == 0)
|
||||
if (a == null || a.getPid() == null || a.getPid().isEmpty())
|
||||
return false;
|
||||
return a.getPid().stream().anyMatch(p -> p != null && StringUtils.isNotBlank(p.getValue()));
|
||||
}
|
||||
|
@ -159,7 +172,10 @@ public class AuthorMerger {
|
|||
if (StringUtils.isNotBlank(author.getSurname())) {
|
||||
return new Person(author.getSurname() + ", " + author.getName(), false);
|
||||
} else {
|
||||
return new Person(author.getFullname(), false);
|
||||
if (StringUtils.isNotBlank(author.getFullname()))
|
||||
return new Person(author.getFullname(), false);
|
||||
else
|
||||
return new Person("", false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
0
dhp-common/src/main/java/eu/dnetlib/dhp/parser/utility/VtdException.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/dhp/parser/utility/VtdException.java
Normal file → Executable file
3
dhp-common/src/main/java/eu/dnetlib/dhp/parser/utility/VtdUtilityParser.java
Normal file → Executable file
3
dhp-common/src/main/java/eu/dnetlib/dhp/parser/utility/VtdUtilityParser.java
Normal file → Executable file
|
@ -12,6 +12,9 @@ import com.ximpleware.VTDNav;
|
|||
/** Created by sandro on 9/29/16. */
|
||||
public class VtdUtilityParser {
|
||||
|
||||
private VtdUtilityParser() {
|
||||
}
|
||||
|
||||
public static List<Node> getTextValuesWithAttributes(
|
||||
final AutoPilot ap, final VTDNav vn, final String xpath, final List<String> attributes)
|
||||
throws VtdException {
|
||||
|
|
70
dhp-common/src/main/java/eu/dnetlib/dhp/schema/oaf/utils/GraphCleaningFunctions.java
Normal file → Executable file
70
dhp-common/src/main/java/eu/dnetlib/dhp/schema/oaf/utils/GraphCleaningFunctions.java
Normal file → Executable file
|
@ -7,22 +7,21 @@ import java.time.format.DateTimeFormatter;
|
|||
import java.time.format.DateTimeParseException;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import com.github.sisyphsu.dateparser.DateParserUtils;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import eu.dnetlib.dhp.common.vocabulary.Vocabulary;
|
||||
import eu.dnetlib.dhp.common.vocabulary.VocabularyGroup;
|
||||
import eu.dnetlib.dhp.schema.common.ModelConstants;
|
||||
import eu.dnetlib.dhp.schema.common.ModelSupport;
|
||||
import eu.dnetlib.dhp.schema.oaf.*;
|
||||
import me.xuender.unidecode.Unidecode;
|
||||
|
||||
public class GraphCleaningFunctions extends CleaningFunctions {
|
||||
|
||||
|
@ -30,8 +29,11 @@ public class GraphCleaningFunctions extends CleaningFunctions {
|
|||
public static final int ORCID_LEN = 19;
|
||||
public static final String CLEANING_REGEX = "(?:\\n|\\r|\\t)";
|
||||
public static final String INVALID_AUTHOR_REGEX = ".*deactivated.*";
|
||||
public static final String TITLE_FILTER_REGEX = "[.*test.*\\W\\d]";
|
||||
public static final int TITLE_FILTER_RESIDUAL_LENGTH = 10;
|
||||
|
||||
public static final String TITLE_TEST = "test";
|
||||
public static final String TITLE_FILTER_REGEX = String.format("(%s)|\\W|\\d", TITLE_TEST);
|
||||
|
||||
public static final int TITLE_FILTER_RESIDUAL_LENGTH = 5;
|
||||
|
||||
public static <T extends Oaf> T fixVocabularyNames(T value) {
|
||||
if (value instanceof Datasource) {
|
||||
|
@ -115,7 +117,7 @@ public class GraphCleaningFunctions extends CleaningFunctions {
|
|||
return true;
|
||||
}
|
||||
|
||||
public static <T extends Oaf> T cleanup(T value) {
|
||||
public static <T extends Oaf> T cleanup(T value, VocabularyGroup vocs) {
|
||||
if (value instanceof Datasource) {
|
||||
// nothing to clean here
|
||||
} else if (value instanceof Project) {
|
||||
|
@ -194,11 +196,21 @@ public class GraphCleaningFunctions extends CleaningFunctions {
|
|||
.filter(Objects::nonNull)
|
||||
.filter(sp -> StringUtils.isNotBlank(sp.getValue()))
|
||||
.filter(
|
||||
sp -> sp
|
||||
.getValue()
|
||||
.toLowerCase()
|
||||
.replaceAll(TITLE_FILTER_REGEX, "")
|
||||
.length() > TITLE_FILTER_RESIDUAL_LENGTH)
|
||||
sp -> {
|
||||
final String title = sp
|
||||
.getValue()
|
||||
.toLowerCase();
|
||||
final String decoded = Unidecode.decode(title);
|
||||
|
||||
if (StringUtils.contains(decoded, TITLE_TEST)) {
|
||||
return decoded
|
||||
.replaceAll(TITLE_FILTER_REGEX, "")
|
||||
.length() > TITLE_FILTER_RESIDUAL_LENGTH;
|
||||
}
|
||||
return !decoded
|
||||
.replaceAll("\\W|\\d", "")
|
||||
.isEmpty();
|
||||
})
|
||||
.map(GraphCleaningFunctions::cleanValue)
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
|
@ -224,6 +236,38 @@ public class GraphCleaningFunctions extends CleaningFunctions {
|
|||
if (Objects.nonNull(r.getInstance())) {
|
||||
|
||||
for (Instance i : r.getInstance()) {
|
||||
if (!vocs.termExists(ModelConstants.DNET_PUBLICATION_RESOURCE, i.getInstancetype().getClassid())) {
|
||||
if (r instanceof Publication) {
|
||||
i
|
||||
.setInstancetype(
|
||||
OafMapperUtils
|
||||
.qualifier(
|
||||
"0038", "Other literature type", ModelConstants.DNET_PUBLICATION_RESOURCE,
|
||||
ModelConstants.DNET_PUBLICATION_RESOURCE));
|
||||
} else if (r instanceof Dataset) {
|
||||
i
|
||||
.setInstancetype(
|
||||
OafMapperUtils
|
||||
.qualifier(
|
||||
"0039", "Other dataset type", ModelConstants.DNET_PUBLICATION_RESOURCE,
|
||||
ModelConstants.DNET_PUBLICATION_RESOURCE));
|
||||
} else if (r instanceof Software) {
|
||||
i
|
||||
.setInstancetype(
|
||||
OafMapperUtils
|
||||
.qualifier(
|
||||
"0040", "Other software type", ModelConstants.DNET_PUBLICATION_RESOURCE,
|
||||
ModelConstants.DNET_PUBLICATION_RESOURCE));
|
||||
} else if (r instanceof OtherResearchProduct) {
|
||||
i
|
||||
.setInstancetype(
|
||||
OafMapperUtils
|
||||
.qualifier(
|
||||
"0020", "Other ORP type", ModelConstants.DNET_PUBLICATION_RESOURCE,
|
||||
ModelConstants.DNET_PUBLICATION_RESOURCE));
|
||||
}
|
||||
}
|
||||
|
||||
if (Objects.nonNull(i.getPid())) {
|
||||
i.setPid(processPidCleaning(i.getPid()));
|
||||
}
|
||||
|
@ -283,7 +327,7 @@ public class GraphCleaningFunctions extends CleaningFunctions {
|
|||
r
|
||||
.getAuthor()
|
||||
.stream()
|
||||
.filter(a -> Objects.nonNull(a))
|
||||
.filter(Objects::nonNull)
|
||||
.filter(a -> StringUtils.isNotBlank(a.getFullname()))
|
||||
.filter(a -> StringUtils.isNotBlank(a.getFullname().replaceAll("[\\W]", "")))
|
||||
.collect(Collectors.toList()));
|
||||
|
|
17
dhp-common/src/main/java/eu/dnetlib/dhp/schema/oaf/utils/OafMapperUtils.java
Normal file → Executable file
17
dhp-common/src/main/java/eu/dnetlib/dhp/schema/oaf/utils/OafMapperUtils.java
Normal file → Executable file
|
@ -17,13 +17,16 @@ import eu.dnetlib.dhp.schema.oaf.*;
|
|||
|
||||
public class OafMapperUtils {
|
||||
|
||||
private OafMapperUtils() {
|
||||
}
|
||||
|
||||
public static Oaf merge(final Oaf left, final Oaf right) {
|
||||
if (ModelSupport.isSubClass(left, OafEntity.class)) {
|
||||
return mergeEntities((OafEntity) left, (OafEntity) right);
|
||||
} else if (ModelSupport.isSubClass(left, Relation.class)) {
|
||||
((Relation) left).mergeFrom((Relation) right);
|
||||
} else {
|
||||
throw new RuntimeException("invalid Oaf type:" + left.getClass().getCanonicalName());
|
||||
throw new IllegalArgumentException("invalid Oaf type:" + left.getClass().getCanonicalName());
|
||||
}
|
||||
return left;
|
||||
}
|
||||
|
@ -38,7 +41,7 @@ public class OafMapperUtils {
|
|||
} else if (ModelSupport.isSubClass(left, Project.class)) {
|
||||
left.mergeFrom(right);
|
||||
} else {
|
||||
throw new RuntimeException("invalid OafEntity subtype:" + left.getClass().getCanonicalName());
|
||||
throw new IllegalArgumentException("invalid OafEntity subtype:" + left.getClass().getCanonicalName());
|
||||
}
|
||||
return left;
|
||||
}
|
||||
|
@ -62,7 +65,7 @@ public class OafMapperUtils {
|
|||
|
||||
public static List<KeyValue> listKeyValues(final String... s) {
|
||||
if (s.length % 2 > 0) {
|
||||
throw new RuntimeException("Invalid number of parameters (k,v,k,v,....)");
|
||||
throw new IllegalArgumentException("Invalid number of parameters (k,v,k,v,....)");
|
||||
}
|
||||
|
||||
final List<KeyValue> list = new ArrayList<>();
|
||||
|
@ -88,7 +91,7 @@ public class OafMapperUtils {
|
|||
.stream(values)
|
||||
.map(v -> field(v, info))
|
||||
.filter(Objects::nonNull)
|
||||
.filter(distinctByKey(f -> f.getValue()))
|
||||
.filter(distinctByKey(Field::getValue))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
@ -97,7 +100,7 @@ public class OafMapperUtils {
|
|||
.stream()
|
||||
.map(v -> field(v, info))
|
||||
.filter(Objects::nonNull)
|
||||
.filter(distinctByKey(f -> f.getValue()))
|
||||
.filter(distinctByKey(Field::getValue))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
@ -342,10 +345,10 @@ public class OafMapperUtils {
|
|||
if (instanceList != null) {
|
||||
final Optional<AccessRight> min = instanceList
|
||||
.stream()
|
||||
.map(i -> i.getAccessright())
|
||||
.map(Instance::getAccessright)
|
||||
.min(new AccessRightComparator<>());
|
||||
|
||||
final Qualifier rights = min.isPresent() ? qualifier(min.get()) : new Qualifier();
|
||||
final Qualifier rights = min.map(OafMapperUtils::qualifier).orElseGet(Qualifier::new);
|
||||
|
||||
if (StringUtils.isBlank(rights.getClassid())) {
|
||||
rights.setClassid(UNKNOWN);
|
||||
|
|
|
@ -4,19 +4,19 @@ package eu.dnetlib.dhp.utils;
|
|||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.codec.binary.Base64OutputStream;
|
||||
import org.apache.commons.codec.binary.Hex;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.hadoop.conf.Configuration;
|
||||
import org.apache.hadoop.fs.FileSystem;
|
||||
import org.apache.hadoop.fs.Path;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.spark.sql.Dataset;
|
||||
import org.apache.spark.sql.SaveMode;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -26,6 +26,8 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|||
import com.google.common.collect.Maps;
|
||||
import com.jayway.jsonpath.JsonPath;
|
||||
|
||||
import eu.dnetlib.dhp.schema.mdstore.MDStoreWithInfo;
|
||||
import eu.dnetlib.dhp.schema.oaf.utils.CleaningFunctions;
|
||||
import net.minidev.json.JSONArray;
|
||||
import scala.collection.JavaConverters;
|
||||
import scala.collection.Seq;
|
||||
|
@ -34,6 +36,9 @@ public class DHPUtils {
|
|||
|
||||
private static final Logger log = LoggerFactory.getLogger(DHPUtils.class);
|
||||
|
||||
private DHPUtils() {
|
||||
}
|
||||
|
||||
public static Seq<String> toSeq(List<String> list) {
|
||||
return JavaConverters.asScalaIteratorConverter(list.iterator()).asScala().toSeq();
|
||||
}
|
||||
|
@ -44,40 +49,59 @@ public class DHPUtils {
|
|||
md.update(s.getBytes(StandardCharsets.UTF_8));
|
||||
return new String(Hex.encodeHex(md.digest()));
|
||||
} catch (final Exception e) {
|
||||
System.err.println("Error creating id");
|
||||
log.error("Error creating id from {}", s);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves from the metadata store manager application the list of paths associated with mdstores characterized
|
||||
* by he given format, layout, interpretation
|
||||
* @param mdstoreManagerUrl the URL of the mdstore manager service
|
||||
* @param format the mdstore format
|
||||
* @param layout the mdstore layout
|
||||
* @param interpretation the mdstore interpretation
|
||||
* @param includeEmpty include Empty mdstores
|
||||
* @return the set of hdfs paths
|
||||
* @throws IOException in case of HTTP communication issues
|
||||
*/
|
||||
public static Set<String> mdstorePaths(final String mdstoreManagerUrl,
|
||||
final String format,
|
||||
final String layout,
|
||||
final String interpretation,
|
||||
boolean includeEmpty) throws IOException {
|
||||
final String url = mdstoreManagerUrl + "/mdstores/";
|
||||
final ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
final HttpGet req = new HttpGet(url);
|
||||
|
||||
try (final CloseableHttpClient client = HttpClients.createDefault()) {
|
||||
try (final CloseableHttpResponse response = client.execute(req)) {
|
||||
final String json = IOUtils.toString(response.getEntity().getContent());
|
||||
final MDStoreWithInfo[] mdstores = objectMapper.readValue(json, MDStoreWithInfo[].class);
|
||||
return Arrays
|
||||
.stream(mdstores)
|
||||
.filter(md -> md.getFormat().equalsIgnoreCase(format))
|
||||
.filter(md -> md.getLayout().equalsIgnoreCase(layout))
|
||||
.filter(md -> md.getInterpretation().equalsIgnoreCase(interpretation))
|
||||
.filter(md -> StringUtils.isNotBlank(md.getHdfsPath()))
|
||||
.filter(md -> StringUtils.isNotBlank(md.getCurrentVersion()))
|
||||
.filter(md -> includeEmpty || md.getSize() > 0)
|
||||
.map(md -> md.getHdfsPath() + "/" + md.getCurrentVersion() + "/store")
|
||||
.collect(Collectors.toSet());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static String generateIdentifier(final String originalId, final String nsPrefix) {
|
||||
return String.format("%s::%s", nsPrefix, DHPUtils.md5(originalId));
|
||||
}
|
||||
|
||||
public static String compressString(final String input) {
|
||||
try (ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
Base64OutputStream b64os = new Base64OutputStream(out)) {
|
||||
GZIPOutputStream gzip = new GZIPOutputStream(b64os);
|
||||
gzip.write(input.getBytes(StandardCharsets.UTF_8));
|
||||
gzip.close();
|
||||
return out.toString();
|
||||
} catch (Throwable e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public static String generateUnresolvedIdentifier(final String pid, final String pidType) {
|
||||
|
||||
public static String decompressString(final String input) {
|
||||
byte[] byteArray = Base64.decodeBase64(input.getBytes());
|
||||
int len;
|
||||
try (GZIPInputStream gis = new GZIPInputStream(new ByteArrayInputStream((byteArray)));
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream(byteArray.length)) {
|
||||
byte[] buffer = new byte[1024];
|
||||
while ((len = gis.read(buffer)) != -1) {
|
||||
bos.write(buffer, 0, len);
|
||||
}
|
||||
return bos.toString();
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
final String cleanedPid = CleaningFunctions.normalizePidValue(pidType, pid);
|
||||
|
||||
return String.format("unresolved::%s::%s", cleanedPid, pidType.toLowerCase().trim());
|
||||
}
|
||||
|
||||
public static String getJPathString(final String jsonPath, final String json) {
|
||||
|
|
15
dhp-common/src/main/java/eu/dnetlib/dhp/utils/ISLookupClientFactory.java
Normal file → Executable file
15
dhp-common/src/main/java/eu/dnetlib/dhp/utils/ISLookupClientFactory.java
Normal file → Executable file
|
@ -18,13 +18,16 @@ public class ISLookupClientFactory {
|
|||
private static final int requestTimeout = 60000 * 10;
|
||||
private static final int connectTimeout = 60000 * 10;
|
||||
|
||||
private ISLookupClientFactory() {
|
||||
}
|
||||
|
||||
public static ISLookUpService getLookUpService(final String isLookupUrl) {
|
||||
return getServiceStub(ISLookUpService.class, isLookupUrl);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private static <T> T getServiceStub(final Class<T> clazz, final String endpoint) {
|
||||
log.info(String.format("creating %s stub from %s", clazz.getName(), endpoint));
|
||||
log.info("creating {} stub from {}", clazz.getName(), endpoint);
|
||||
final JaxWsProxyFactoryBean jaxWsProxyFactory = new JaxWsProxyFactoryBean();
|
||||
jaxWsProxyFactory.setServiceClass(clazz);
|
||||
jaxWsProxyFactory.setAddress(endpoint);
|
||||
|
@ -38,12 +41,10 @@ public class ISLookupClientFactory {
|
|||
|
||||
log
|
||||
.info(
|
||||
String
|
||||
.format(
|
||||
"setting connectTimeout to %s, requestTimeout to %s for service %s",
|
||||
connectTimeout,
|
||||
requestTimeout,
|
||||
clazz.getCanonicalName()));
|
||||
"setting connectTimeout to {}, requestTimeout to {} for service {}",
|
||||
connectTimeout,
|
||||
requestTimeout,
|
||||
clazz.getCanonicalName());
|
||||
|
||||
policy.setConnectionTimeout(connectTimeout);
|
||||
policy.setReceiveTimeout(requestTimeout);
|
||||
|
|
2
dhp-common/src/main/java/eu/dnetlib/dhp/utils/saxon/AbstractExtensionFunction.java
Normal file → Executable file
2
dhp-common/src/main/java/eu/dnetlib/dhp/utils/saxon/AbstractExtensionFunction.java
Normal file → Executable file
|
@ -10,7 +10,7 @@ import net.sf.saxon.trans.XPathException;
|
|||
|
||||
public abstract class AbstractExtensionFunction extends ExtensionFunctionDefinition {
|
||||
|
||||
public static String DEFAULT_SAXON_EXT_NS_URI = "http://www.d-net.research-infrastructures.eu/saxon-extension";
|
||||
public static final String DEFAULT_SAXON_EXT_NS_URI = "http://www.d-net.research-infrastructures.eu/saxon-extension";
|
||||
|
||||
public abstract String getName();
|
||||
|
||||
|
|
5
dhp-common/src/main/java/eu/dnetlib/dhp/utils/saxon/ExtractYear.java
Normal file → Executable file
5
dhp-common/src/main/java/eu/dnetlib/dhp/utils/saxon/ExtractYear.java
Normal file → Executable file
|
@ -26,7 +26,7 @@ public class ExtractYear extends AbstractExtensionFunction {
|
|||
|
||||
@Override
|
||||
public Sequence doCall(XPathContext context, Sequence[] arguments) throws XPathException {
|
||||
if (arguments == null | arguments.length == 0) {
|
||||
if (arguments == null || arguments.length == 0) {
|
||||
return new StringValue("");
|
||||
}
|
||||
final Item item = arguments[0].head();
|
||||
|
@ -63,8 +63,7 @@ public class ExtractYear extends AbstractExtensionFunction {
|
|||
for (String format : dateFormats) {
|
||||
try {
|
||||
c.setTime(new SimpleDateFormat(format).parse(s));
|
||||
String year = String.valueOf(c.get(Calendar.YEAR));
|
||||
return year;
|
||||
return String.valueOf(c.get(Calendar.YEAR));
|
||||
} catch (ParseException e) {
|
||||
}
|
||||
}
|
||||
|
|
2
dhp-common/src/main/java/eu/dnetlib/dhp/utils/saxon/NormalizeDate.java
Normal file → Executable file
2
dhp-common/src/main/java/eu/dnetlib/dhp/utils/saxon/NormalizeDate.java
Normal file → Executable file
|
@ -30,7 +30,7 @@ public class NormalizeDate extends AbstractExtensionFunction {
|
|||
|
||||
@Override
|
||||
public Sequence doCall(XPathContext context, Sequence[] arguments) throws XPathException {
|
||||
if (arguments == null | arguments.length == 0) {
|
||||
if (arguments == null || arguments.length == 0) {
|
||||
return new StringValue(BLANK);
|
||||
}
|
||||
String s = arguments[0].head().getStringValue();
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
|
||||
package eu.dnetlib.dhp.utils.saxon;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import net.sf.saxon.expr.XPathContext;
|
||||
|
@ -26,7 +28,8 @@ public class PickFirst extends AbstractExtensionFunction {
|
|||
final String s1 = getValue(arguments[0]);
|
||||
final String s2 = getValue(arguments[1]);
|
||||
|
||||
return new StringValue(StringUtils.isNotBlank(s1) ? s1 : StringUtils.isNotBlank(s2) ? s2 : "");
|
||||
final String value = isNotBlank(s1) ? s1 : isNotBlank(s2) ? s2 : "";
|
||||
return new StringValue(value);
|
||||
}
|
||||
|
||||
private String getValue(final Sequence arg) throws XPathException {
|
||||
|
|
3
dhp-common/src/main/java/eu/dnetlib/dhp/utils/saxon/SaxonTransformerFactory.java
Normal file → Executable file
3
dhp-common/src/main/java/eu/dnetlib/dhp/utils/saxon/SaxonTransformerFactory.java
Normal file → Executable file
|
@ -12,6 +12,9 @@ import net.sf.saxon.TransformerFactoryImpl;
|
|||
|
||||
public class SaxonTransformerFactory {
|
||||
|
||||
private SaxonTransformerFactory() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the index record transformer from the given XSLT
|
||||
*
|
||||
|
|
0
dhp-common/src/main/java/eu/dnetlib/scholexplorer/relation/RelInfo.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/scholexplorer/relation/RelInfo.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/scholexplorer/relation/RelationMapper.java
Normal file → Executable file
0
dhp-common/src/main/java/eu/dnetlib/scholexplorer/relation/RelationMapper.java
Normal file → Executable file
0
dhp-common/src/main/resources/eu/dnetlib/dhp/schema/oaf/utils/pid_blacklist.json
Normal file → Executable file
0
dhp-common/src/main/resources/eu/dnetlib/dhp/schema/oaf/utils/pid_blacklist.json
Normal file → Executable file
0
dhp-common/src/main/resources/eu/dnetlib/scholexplorer/relation/relations.json
Normal file → Executable file
0
dhp-common/src/main/resources/eu/dnetlib/scholexplorer/relation/relations.json
Normal file → Executable file
4
dhp-common/src/test/java/eu/dnetlib/dhp/application/ArgumentApplicationParserTest.java
Normal file → Executable file
4
dhp-common/src/test/java/eu/dnetlib/dhp/application/ArgumentApplicationParserTest.java
Normal file → Executable file
|
@ -7,10 +7,10 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
|
|||
import org.apache.commons.io.IOUtils;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class ArgumentApplicationParserTest {
|
||||
class ArgumentApplicationParserTest {
|
||||
|
||||
@Test
|
||||
public void testParseParameter() throws Exception {
|
||||
void testParseParameter() throws Exception {
|
||||
final String jsonConfiguration = IOUtils
|
||||
.toString(
|
||||
this.getClass().getResourceAsStream("/eu/dnetlib/application/parameters.json"));
|
||||
|
|
10
dhp-common/src/test/java/eu/dnetlib/dhp/common/HdfsSupportTest.java
Normal file → Executable file
10
dhp-common/src/test/java/eu/dnetlib/dhp/common/HdfsSupportTest.java
Normal file → Executable file
|
@ -21,13 +21,13 @@ public class HdfsSupportTest {
|
|||
class Remove {
|
||||
|
||||
@Test
|
||||
public void shouldThrowARuntimeExceptionOnError() {
|
||||
void shouldThrowARuntimeExceptionOnError() {
|
||||
// when
|
||||
assertThrows(RuntimeException.class, () -> HdfsSupport.remove(null, new Configuration()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldRemoveADirFromHDFS(@TempDir Path tempDir) {
|
||||
void shouldRemoveADirFromHDFS(@TempDir Path tempDir) {
|
||||
// when
|
||||
HdfsSupport.remove(tempDir.toString(), new Configuration());
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class HdfsSupportTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void shouldRemoveAFileFromHDFS(@TempDir Path tempDir) throws IOException {
|
||||
void shouldRemoveAFileFromHDFS(@TempDir Path tempDir) throws IOException {
|
||||
// given
|
||||
Path file = Files.createTempFile(tempDir, "p", "s");
|
||||
|
||||
|
@ -52,13 +52,13 @@ public class HdfsSupportTest {
|
|||
class ListFiles {
|
||||
|
||||
@Test
|
||||
public void shouldThrowARuntimeExceptionOnError() {
|
||||
void shouldThrowARuntimeExceptionOnError() {
|
||||
// when
|
||||
assertThrows(RuntimeException.class, () -> HdfsSupport.listFiles(null, new Configuration()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldListFilesLocatedInPath(@TempDir Path tempDir) throws IOException {
|
||||
void shouldListFilesLocatedInPath(@TempDir Path tempDir) throws IOException {
|
||||
Path subDir1 = Files.createTempDirectory(tempDir, "list_me");
|
||||
Path subDir2 = Files.createTempDirectory(tempDir, "list_me");
|
||||
|
||||
|
|
|
@ -5,10 +5,10 @@ import static org.junit.jupiter.api.Assertions.*;
|
|||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class PacePersonTest {
|
||||
class PacePersonTest {
|
||||
|
||||
@Test
|
||||
public void pacePersonTest1() {
|
||||
void pacePersonTest1() {
|
||||
|
||||
PacePerson p = new PacePerson("Artini, Michele", false);
|
||||
assertEquals("Artini", p.getSurnameString());
|
||||
|
@ -17,7 +17,7 @@ public class PacePersonTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void pacePersonTest2() {
|
||||
void pacePersonTest2() {
|
||||
PacePerson p = new PacePerson("Michele G. Artini", false);
|
||||
assertEquals("Artini, Michele G.", p.getNormalisedFullname());
|
||||
assertEquals("Michele G", p.getNameString());
|
||||
|
|
6
dhp-common/src/test/java/eu/dnetlib/dhp/common/SparkSessionSupportTest.java
Normal file → Executable file
6
dhp-common/src/test/java/eu/dnetlib/dhp/common/SparkSessionSupportTest.java
Normal file → Executable file
|
@ -18,7 +18,8 @@ public class SparkSessionSupportTest {
|
|||
class RunWithSparkSession {
|
||||
|
||||
@Test
|
||||
public void shouldExecuteFunctionAndNotStopSparkSessionWhenSparkSessionIsNotManaged()
|
||||
@SuppressWarnings("unchecked")
|
||||
void shouldExecuteFunctionAndNotStopSparkSessionWhenSparkSessionIsNotManaged()
|
||||
throws Exception {
|
||||
// given
|
||||
SparkSession spark = mock(SparkSession.class);
|
||||
|
@ -37,7 +38,8 @@ public class SparkSessionSupportTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void shouldExecuteFunctionAndStopSparkSessionWhenSparkSessionIsManaged()
|
||||
@SuppressWarnings("unchecked")
|
||||
void shouldExecuteFunctionAndStopSparkSessionWhenSparkSessionIsManaged()
|
||||
throws Exception {
|
||||
// given
|
||||
SparkSession spark = mock(SparkSession.class);
|
||||
|
|
10
dhp-common/src/test/java/eu/dnetlib/dhp/common/api/ZenodoAPIClientTest.java
Normal file → Executable file
10
dhp-common/src/test/java/eu/dnetlib/dhp/common/api/ZenodoAPIClientTest.java
Normal file → Executable file
|
@ -12,7 +12,7 @@ import org.junit.jupiter.api.Disabled;
|
|||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@Disabled
|
||||
public class ZenodoAPIClientTest {
|
||||
class ZenodoAPIClientTest {
|
||||
|
||||
private final String URL_STRING = "https://sandbox.zenodo.org/api/deposit/depositions";
|
||||
private final String ACCESS_TOKEN = "";
|
||||
|
@ -22,7 +22,7 @@ public class ZenodoAPIClientTest {
|
|||
private final String depositionId = "674915";
|
||||
|
||||
@Test
|
||||
public void testUploadOldDeposition() throws IOException, MissingConceptDoiException {
|
||||
void testUploadOldDeposition() throws IOException, MissingConceptDoiException {
|
||||
ZenodoAPIClient client = new ZenodoAPIClient(URL_STRING,
|
||||
ACCESS_TOKEN);
|
||||
Assertions.assertEquals(200, client.uploadOpenDeposition(depositionId));
|
||||
|
@ -44,7 +44,7 @@ public class ZenodoAPIClientTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testNewDeposition() throws IOException {
|
||||
void testNewDeposition() throws IOException {
|
||||
|
||||
ZenodoAPIClient client = new ZenodoAPIClient(URL_STRING,
|
||||
ACCESS_TOKEN);
|
||||
|
@ -67,7 +67,7 @@ public class ZenodoAPIClientTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testNewVersionNewName() throws IOException, MissingConceptDoiException {
|
||||
void testNewVersionNewName() throws IOException, MissingConceptDoiException {
|
||||
|
||||
ZenodoAPIClient client = new ZenodoAPIClient(URL_STRING,
|
||||
ACCESS_TOKEN);
|
||||
|
@ -87,7 +87,7 @@ public class ZenodoAPIClientTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testNewVersionOldName() throws IOException, MissingConceptDoiException {
|
||||
void testNewVersionOldName() throws IOException, MissingConceptDoiException {
|
||||
|
||||
ZenodoAPIClient client = new ZenodoAPIClient(URL_STRING,
|
||||
ACCESS_TOKEN);
|
||||
|
|
4
dhp-common/src/test/java/eu/dnetlib/dhp/oa/merge/AuthorMergerTest.java
Normal file → Executable file
4
dhp-common/src/test/java/eu/dnetlib/dhp/oa/merge/AuthorMergerTest.java
Normal file → Executable file
|
@ -21,7 +21,7 @@ import eu.dnetlib.dhp.schema.oaf.StructuredProperty;
|
|||
import eu.dnetlib.pace.util.MapDocumentUtil;
|
||||
import scala.Tuple2;
|
||||
|
||||
public class AuthorMergerTest {
|
||||
class AuthorMergerTest {
|
||||
|
||||
private String publicationsBasePath;
|
||||
|
||||
|
@ -43,7 +43,7 @@ public class AuthorMergerTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void mergeTest() { // used in the dedup: threshold set to 0.95
|
||||
void mergeTest() { // used in the dedup: threshold set to 0.95
|
||||
|
||||
for (List<Author> authors1 : authors) {
|
||||
System.out.println("List " + (authors.indexOf(authors1) + 1));
|
||||
|
|
61
dhp-common/src/test/java/eu/dnetlib/dhp/schema/oaf/utils/OafMapperUtilsTest.java
Normal file → Executable file
61
dhp-common/src/test/java/eu/dnetlib/dhp/schema/oaf/utils/OafMapperUtilsTest.java
Normal file → Executable file
|
@ -4,12 +4,8 @@ package eu.dnetlib.dhp.schema.oaf.utils;
|
|||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
@ -19,15 +15,34 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
|
|||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import eu.dnetlib.dhp.schema.common.ModelConstants;
|
||||
import eu.dnetlib.dhp.schema.oaf.*;
|
||||
import eu.dnetlib.dhp.schema.oaf.Dataset;
|
||||
import eu.dnetlib.dhp.schema.oaf.KeyValue;
|
||||
import eu.dnetlib.dhp.schema.oaf.Publication;
|
||||
import eu.dnetlib.dhp.schema.oaf.Result;
|
||||
import me.xuender.unidecode.Unidecode;
|
||||
|
||||
public class OafMapperUtilsTest {
|
||||
class OafMapperUtilsTest {
|
||||
|
||||
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper()
|
||||
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
|
||||
@Test
|
||||
public void testDateValidation() {
|
||||
public void testUnidecode() {
|
||||
|
||||
assertEquals("Liu Ben Mu hiruzuSen tawa", Unidecode.decode("六本木ヒルズ森タワ"));
|
||||
assertEquals("Nan Wu A Mi Tuo Fo", Unidecode.decode("南无阿弥陀佛"));
|
||||
assertEquals("Yi Tiao Hui Zou Lu De Yu", Unidecode.decode("一条会走路的鱼"));
|
||||
assertEquals("amidaniyorai", Unidecode.decode("あみだにょらい"));
|
||||
assertEquals("T`owrk`iayi", Unidecode.decode("Թուրքիայի"));
|
||||
assertEquals("Obzor tematiki", Unidecode.decode("Обзор тематики"));
|
||||
assertEquals("GERMANSKIE IaZYKI", Unidecode.decode("ГЕРМАНСКИЕ ЯЗЫКИ"));
|
||||
assertEquals("Diereunese tes ikanopoieses", Unidecode.decode("Διερεύνηση της ικανοποίησης"));
|
||||
assertEquals("lqDy l'wly@", Unidecode.decode("القضايا الأولية"));
|
||||
assertEquals("abc def ghi", Unidecode.decode("abc def ghi"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testDateValidation() {
|
||||
|
||||
assertTrue(GraphCleaningFunctions.doCleanDate("2016-05-07T12:41:19.202Z ").isPresent());
|
||||
assertTrue(GraphCleaningFunctions.doCleanDate("2020-09-10 11:08:52 ").isPresent());
|
||||
|
@ -132,44 +147,46 @@ public class OafMapperUtilsTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testDate() {
|
||||
System.out.println(GraphCleaningFunctions.cleanDate("23-FEB-1998"));
|
||||
void testDate() {
|
||||
final String date = GraphCleaningFunctions.cleanDate("23-FEB-1998");
|
||||
assertNotNull(date);
|
||||
System.out.println(date);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMergePubs() throws IOException {
|
||||
void testMergePubs() throws IOException {
|
||||
Publication p1 = read("publication_1.json", Publication.class);
|
||||
Publication p2 = read("publication_2.json", Publication.class);
|
||||
Dataset d1 = read("dataset_1.json", Dataset.class);
|
||||
Dataset d2 = read("dataset_2.json", Dataset.class);
|
||||
|
||||
assertEquals(p1.getCollectedfrom().size(), 1);
|
||||
assertEquals(p1.getCollectedfrom().get(0).getKey(), ModelConstants.CROSSREF_ID);
|
||||
assertEquals(d2.getCollectedfrom().size(), 1);
|
||||
assertEquals(1, p1.getCollectedfrom().size());
|
||||
assertEquals(ModelConstants.CROSSREF_ID, p1.getCollectedfrom().get(0).getKey());
|
||||
assertEquals(1, d2.getCollectedfrom().size());
|
||||
assertFalse(cfId(d2.getCollectedfrom()).contains(ModelConstants.CROSSREF_ID));
|
||||
|
||||
assertTrue(
|
||||
assertEquals(
|
||||
ModelConstants.PUBLICATION_RESULTTYPE_CLASSID,
|
||||
OafMapperUtils
|
||||
.mergeResults(p1, d2)
|
||||
.getResulttype()
|
||||
.getClassid()
|
||||
.equals(ModelConstants.PUBLICATION_RESULTTYPE_CLASSID));
|
||||
.getClassid());
|
||||
|
||||
assertEquals(p2.getCollectedfrom().size(), 1);
|
||||
assertEquals(1, p2.getCollectedfrom().size());
|
||||
assertFalse(cfId(p2.getCollectedfrom()).contains(ModelConstants.CROSSREF_ID));
|
||||
assertEquals(d1.getCollectedfrom().size(), 1);
|
||||
assertEquals(1, d1.getCollectedfrom().size());
|
||||
assertTrue(cfId(d1.getCollectedfrom()).contains(ModelConstants.CROSSREF_ID));
|
||||
|
||||
assertTrue(
|
||||
assertEquals(
|
||||
ModelConstants.DATASET_RESULTTYPE_CLASSID,
|
||||
OafMapperUtils
|
||||
.mergeResults(p2, d1)
|
||||
.getResulttype()
|
||||
.getClassid()
|
||||
.equals(ModelConstants.DATASET_RESULTTYPE_CLASSID));
|
||||
.getClassid());
|
||||
}
|
||||
|
||||
protected HashSet<String> cfId(List<KeyValue> collectedfrom) {
|
||||
return collectedfrom.stream().map(c -> c.getKey()).collect(Collectors.toCollection(HashSet::new));
|
||||
return collectedfrom.stream().map(KeyValue::getKey).collect(Collectors.toCollection(HashSet::new));
|
||||
}
|
||||
|
||||
protected <T extends Result> T read(String filename, Class<T> clazz) throws IOException {
|
||||
|
|
4
dhp-common/src/test/java/eu/dnetlib/scholexplorer/relation/RelationMapperTest.java
Normal file → Executable file
4
dhp-common/src/test/java/eu/dnetlib/scholexplorer/relation/RelationMapperTest.java
Normal file → Executable file
|
@ -3,10 +3,10 @@ package eu.dnetlib.scholexplorer.relation;
|
|||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class RelationMapperTest {
|
||||
class RelationMapperTest {
|
||||
|
||||
@Test
|
||||
public void testLoadRels() throws Exception {
|
||||
void testLoadRels() throws Exception {
|
||||
|
||||
RelationMapper relationMapper = RelationMapper.load();
|
||||
relationMapper.keySet().forEach(System.out::println);
|
||||
|
|
0
dhp-common/src/test/resources/eu/dnetlib/application/parameters.json
Normal file → Executable file
0
dhp-common/src/test/resources/eu/dnetlib/application/parameters.json
Normal file → Executable file
0
dhp-common/src/test/resources/eu/dnetlib/dhp/common/api/metadata.json
Normal file → Executable file
0
dhp-common/src/test/resources/eu/dnetlib/dhp/common/api/metadata.json
Normal file → Executable file
0
dhp-common/src/test/resources/eu/dnetlib/dhp/common/api/newDeposition
Normal file → Executable file
0
dhp-common/src/test/resources/eu/dnetlib/dhp/common/api/newDeposition
Normal file → Executable file
0
dhp-common/src/test/resources/eu/dnetlib/dhp/oa/merge/publications_with_authors.json
Normal file → Executable file
0
dhp-common/src/test/resources/eu/dnetlib/dhp/oa/merge/publications_with_authors.json
Normal file → Executable file
0
dhp-common/src/test/resources/eu/dnetlib/dhp/schema/oaf/utils/dataset_1.json
Normal file → Executable file
0
dhp-common/src/test/resources/eu/dnetlib/dhp/schema/oaf/utils/dataset_1.json
Normal file → Executable file
0
dhp-common/src/test/resources/eu/dnetlib/dhp/schema/oaf/utils/dataset_2.json
Normal file → Executable file
0
dhp-common/src/test/resources/eu/dnetlib/dhp/schema/oaf/utils/dataset_2.json
Normal file → Executable file
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue