diff --git a/.gitignore b/.gitignore index b47e688a..091c2073 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ *.iml *.ipr *.iws +*.java-version *~ /**/*.sh /**/my_application.properties diff --git a/apps/dhp-broker-application/pom.xml b/apps/dhp-broker-application/pom.xml index 101e0277..2889f4d8 100644 --- a/apps/dhp-broker-application/pom.xml +++ b/apps/dhp-broker-application/pom.xml @@ -4,8 +4,8 @@ eu.dnetlib.dhp apps - 3.2.3-SNAPSHOT - ../ + 3.2.5-SNAPSHOT + ../pom.xml 4.0.0 diff --git a/apps/dhp-broker-public-application/pom.xml b/apps/dhp-broker-public-application/pom.xml index 5fee3452..c4b20001 100644 --- a/apps/dhp-broker-public-application/pom.xml +++ b/apps/dhp-broker-public-application/pom.xml @@ -4,8 +4,8 @@ eu.dnetlib.dhp apps - 3.2.3-SNAPSHOT - ../ + 3.2.5-SNAPSHOT + ../pom.xml 4.0.0 diff --git a/apps/dhp-mdstore-manager/pom.xml b/apps/dhp-mdstore-manager/pom.xml index 31f3531e..7eb15c21 100644 --- a/apps/dhp-mdstore-manager/pom.xml +++ b/apps/dhp-mdstore-manager/pom.xml @@ -4,8 +4,8 @@ eu.dnetlib.dhp apps - 3.2.3-SNAPSHOT - ../ + 3.2.5-SNAPSHOT + ../pom.xml 4.0.0 diff --git a/apps/dnet-orgs-database-application/pom.xml b/apps/dnet-orgs-database-application/pom.xml index 4714e6d8..e13839d2 100644 --- a/apps/dnet-orgs-database-application/pom.xml +++ b/apps/dnet-orgs-database-application/pom.xml @@ -4,7 +4,7 @@ eu.dnetlib.dhp apps - 3.2.3-SNAPSHOT + 3.2.5-SNAPSHOT ../ diff --git a/apps/dnet-orgs-database-application/import_certificates.sh b/apps/dnet-orgs-database-application/scripts/import_certificates.sh similarity index 100% rename from apps/dnet-orgs-database-application/import_certificates.sh rename to apps/dnet-orgs-database-application/scripts/import_certificates.sh diff --git a/apps/dnet-orgs-database-application/src/main/resources/sql/importDedupEvents.sql b/apps/dnet-orgs-database-application/src/main/resources/sql/importDedupEvents.sql index 3be235ce..08ce3fef 100644 --- a/apps/dnet-orgs-database-application/src/main/resources/sql/importDedupEvents.sql +++ b/apps/dnet-orgs-database-application/src/main/resources/sql/importDedupEvents.sql @@ -14,11 +14,19 @@ UPDATE tmp_dedup_events SET local_id = oa_original_id WHERE local_id = '' OR lo UPDATE tmp_dedup_events SET oa_country = 'UNKNOWN' WHERE oa_country = '' OR oa_country IS NULL; UPDATE tmp_dedup_events SET oa_name = oa_acronym WHERE oa_name = '' OR oa_name IS NULL; DELETE FROM tmp_dedup_events WHERE oa_name = '' OR oa_name IS NULL; + +-- delete invalid relations (a raw org can not be suggested as duplicate and as new org) +DELETE FROM tmp_dedup_events WHERE oa_original_id IN ( + SELECT oa_original_id + FROM tmp_dedup_events + GROUP BY oa_original_id HAVING count(oa_original_id) > 1) +AND (local_id = '' OR local_id is NULL); + -- delete invalid relations (a raw org can not be suggested to multiple orgs) DELETE FROM tmp_dedup_events WHERE oa_original_id IN ( SELECT oa_original_id FROM tmp_dedup_events - GROUP BY oa_original_id HAVING count(*) > 1) + GROUP BY oa_original_id HAVING count(oa_original_id) > 1) AND local_id NOT LIKE 'openorgs____::%'; -- IMPORT MISSING TERMS @@ -137,14 +145,4 @@ DELETE FROM oa_duplicates d USING oa_duplicates d1 WHERE d.oa_original_id = d1.oa_original_id AND d.reltype = 'suggested' AND d1.reltype = 'is_similar'; - - - - - - - - - - COMMIT; diff --git a/apps/dnet-orgs-database-application/src/main/resources/sql/schema.sql b/apps/dnet-orgs-database-application/src/main/resources/sql/schema.sql index 72e0f710..d2d9f9c2 100644 --- a/apps/dnet-orgs-database-application/src/main/resources/sql/schema.sql +++ b/apps/dnet-orgs-database-application/src/main/resources/sql/schema.sql @@ -648,7 +648,6 @@ GROUP BY o.id, o.name, o.city, o.country ORDER BY o.name; CREATE TABLE org_index_search(id text PRIMARY KEY, txt tsvector); -CREATE INDEX org_index_search_txt_idx ON org_index_search(txt); CREATE INDEX org_index_search_txt_gin_idx ON org_index_search USING gin(txt); CREATE OR REPLACE FUNCTION refresh_index_search() RETURNS bigint AS $$ @@ -656,9 +655,10 @@ CREATE OR REPLACE FUNCTION refresh_index_search() RETURNS bigint AS $$ WITH d as ( INSERT INTO org_index_search(id, txt) SELECT o.id, - to_tsvector(o.id||' '||o.name||' '||array_to_string(array_agg(DISTINCT n.name), ' ','')||' '||array_to_string(array_agg(DISTINCT a.acronym), ' ','')||' '||array_to_string(array_agg(DISTINCT u.url), ' ','')) + to_tsvector(o.id||' '||o.name||' '||array_to_string(array_agg(DISTINCT n.name), ' ','')||' '||array_to_string(array_agg(DISTINCT i.otherid), ' ','')||' '||array_to_string(array_agg(DISTINCT a.acronym), ' ','')||' '||array_to_string(array_agg(DISTINCT u.url), ' ','')) FROM organizations o LEFT OUTER JOIN other_names n on (o.id = n.id) + LEFT OUTER JOIN other_ids i on (o.id = i.id) LEFT OUTER JOIN acronyms a on (o.id = a.id) LEFT OUTER JOIN urls u on (o.id = u.id) GROUP BY o.id, o.name RETURNING * @@ -680,9 +680,10 @@ CREATE OR REPLACE FUNCTION insert_or_update_index_search_trigger() RETURNS trigg BEGIN INSERT INTO org_index_search(id, txt) (SELECT o.id, - to_tsvector(o.id||' '||o.name||' '||array_to_string(array_agg(DISTINCT n.name), ' ','')||' '||array_to_string(array_agg(DISTINCT a.acronym), ' ','')||' '||array_to_string(array_agg(DISTINCT u.url), ' ','')) + to_tsvector(o.id||' '||o.name||' '||array_to_string(array_agg(DISTINCT n.name), ' ','')||' '||array_to_string(array_agg(DISTINCT i.otherid), ' ','')||' '||array_to_string(array_agg(DISTINCT a.acronym), ' ','')||' '||array_to_string(array_agg(DISTINCT u.url), ' ','')) FROM organizations o LEFT OUTER JOIN other_names n on (o.id = n.id) + LEFT OUTER JOIN other_ids i on (o.id = i.id) LEFT OUTER JOIN acronyms a on (o.id = a.id) LEFT OUTER JOIN urls u on (o.id = u.id) WHERE o.id = new.id diff --git a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/parts/org_metadata.form.html b/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/parts/org_metadata.form.html index e5616710..0a8fbcdb 100644 --- a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/parts/org_metadata.form.html +++ b/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/parts/org_metadata.form.html @@ -59,7 +59,7 @@ required="required" ng-class="{'is-invalid' : organizationForm.org_cntr.$error.required}"> - +
lat
@@ -252,7 +252,7 @@ No relations - + This organizazion diff --git a/apps/dnet-orgs-database-application/src/main/resources/static/resources/js/organizations.js b/apps/dnet-orgs-database-application/src/main/resources/static/resources/js/organizations.js index d3d749c5..cb1a8df0 100644 --- a/apps/dnet-orgs-database-application/src/main/resources/static/resources/js/organizations.js +++ b/apps/dnet-orgs-database-application/src/main/resources/static/resources/js/organizations.js @@ -513,7 +513,7 @@ orgsModule.controller('byTypeCtrl', function ($scope, $http, $routeParams, $loca }); -orgsModule.controller('showEditCtrl', function ($scope, $http, $routeParams, $route, $location, $timeout, $window, vocabulariesService) { +orgsModule.controller('showEditCtrl', function ($scope, $http, $routeParams, $route, $location, $timeout, $window, $filter, vocabulariesService) { $scope.orgId = $routeParams.id; $scope.org = {}; $scope.duplicates = []; @@ -529,7 +529,10 @@ orgsModule.controller('showEditCtrl', function ($scope, $http, $routeParams, $ro $scope.gotoTab = function(tab) { $scope.org = {}; - call_http_get($http, 'api/organizations/get?id=' + $scope.orgId, function(res) { $scope.org = res.data; }); + call_http_get($http, 'api/organizations/get?id=' + $scope.orgId, function(res) { + res.data.relations = $filter('orderBy')(res.data.relations, ['type','relatedOrgName'], false); + $scope.org = res.data; + }); if (tab == 2) { $scope.duplicates = []; diff --git a/apps/pom.xml b/apps/pom.xml index 877813fe..91e965ec 100644 --- a/apps/pom.xml +++ b/apps/pom.xml @@ -3,7 +3,7 @@ eu.dnetlib.dhp dnet-applications - 3.2.3-SNAPSHOT + 3.2.5-SNAPSHOT ../pom.xml diff --git a/apps/scholexplorer-api/pom.xml b/apps/scholexplorer-api/pom.xml index 687a6c1e..7907665c 100644 --- a/apps/scholexplorer-api/pom.xml +++ b/apps/scholexplorer-api/pom.xml @@ -5,7 +5,7 @@ eu.dnetlib.dhp apps - 3.2.3-SNAPSHOT + 3.2.5-SNAPSHOT ../pom.xml diff --git a/cmd-line-apps/dhp-broker-client/pom.xml b/cmd-line-apps/dhp-broker-client/pom.xml index ced3c2f8..1648cc22 100644 --- a/cmd-line-apps/dhp-broker-client/pom.xml +++ b/cmd-line-apps/dhp-broker-client/pom.xml @@ -4,7 +4,7 @@ eu.dnetlib.dhp cmd-line-apps - 3.2.3-SNAPSHOT + 3.2.5-SNAPSHOT ../ diff --git a/cmd-line-apps/pom.xml b/cmd-line-apps/pom.xml index e5942195..60a3166a 100644 --- a/cmd-line-apps/pom.xml +++ b/cmd-line-apps/pom.xml @@ -3,7 +3,7 @@ eu.dnetlib.dhp dnet-applications - 3.2.3-SNAPSHOT + 3.2.5-SNAPSHOT ../ diff --git a/libs/dnet-apps-common/pom.xml b/libs/dnet-apps-common/pom.xml index 8a47e655..e65a0a3b 100644 --- a/libs/dnet-apps-common/pom.xml +++ b/libs/dnet-apps-common/pom.xml @@ -4,7 +4,7 @@ eu.dnetlib.dhp libs - 3.2.3-SNAPSHOT + 3.2.5-SNAPSHOT ../ diff --git a/libs/dnet-broker-apps-common/pom.xml b/libs/dnet-broker-apps-common/pom.xml index 6507abe0..213977bd 100644 --- a/libs/dnet-broker-apps-common/pom.xml +++ b/libs/dnet-broker-apps-common/pom.xml @@ -4,7 +4,7 @@ eu.dnetlib.dhp libs - 3.2.3-SNAPSHOT + 3.2.5-SNAPSHOT ../ diff --git a/libs/dnet-openaire-broker-common/pom.xml b/libs/dnet-openaire-broker-common/pom.xml index c492c079..c5816021 100644 --- a/libs/dnet-openaire-broker-common/pom.xml +++ b/libs/dnet-openaire-broker-common/pom.xml @@ -3,7 +3,7 @@ eu.dnetlib.dhp libs - 3.2.3-SNAPSHOT + 3.2.5-SNAPSHOT ../ diff --git a/libs/pom.xml b/libs/pom.xml index 3e324550..dac61c6a 100644 --- a/libs/pom.xml +++ b/libs/pom.xml @@ -4,7 +4,7 @@ eu.dnetlib.dhp dnet-applications - 3.2.3-SNAPSHOT + 3.2.5-SNAPSHOT ../ diff --git a/pom.xml b/pom.xml index 92837a02..de9dae2f 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ 4.0.0 eu.dnetlib.dhp dnet-applications - 3.2.3-SNAPSHOT + 3.2.5-SNAPSHOT pom @@ -398,7 +398,7 @@ UTF-8 3.6.0 1.8 - 2.10.30-SCHOLEXPLORER-SNAPSHOT + 2.11.33 7.1.0 3.4.2 2.8.0