From cadd0a5de8ccb90be8b7351bd2fb86eb499f1626 Mon Sep 17 00:00:00 2001 From: miconis Date: Tue, 20 Apr 2021 12:06:56 +0200 Subject: [PATCH] modification of the queries for openorgs: they now consider also pending orgs --- .../graph/sql/queryOpenOrgsForProvision.sql | 2 +- .../queryOpenOrgsSimilarityForOrgsDedup.sql | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/dhp-workflows/dhp-graph-mapper/src/main/resources/eu/dnetlib/dhp/oa/graph/sql/queryOpenOrgsForProvision.sql b/dhp-workflows/dhp-graph-mapper/src/main/resources/eu/dnetlib/dhp/oa/graph/sql/queryOpenOrgsForProvision.sql index fb421f9581..9588480ce1 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/resources/eu/dnetlib/dhp/oa/graph/sql/queryOpenOrgsForProvision.sql +++ b/dhp-workflows/dhp-graph-mapper/src/main/resources/eu/dnetlib/dhp/oa/graph/sql/queryOpenOrgsForProvision.sql @@ -35,7 +35,7 @@ FROM organizations o LEFT OUTER JOIN organizations od ON (d.oa_original_id = od.id) LEFT OUTER JOIN other_ids idup ON (od.id = idup.id) WHERE - o.status = 'approved' + o.status = 'approved' OR o.status = 'suggested' GROUP BY o.id, o.name, diff --git a/dhp-workflows/dhp-graph-mapper/src/main/resources/eu/dnetlib/dhp/oa/graph/sql/queryOpenOrgsSimilarityForOrgsDedup.sql b/dhp-workflows/dhp-graph-mapper/src/main/resources/eu/dnetlib/dhp/oa/graph/sql/queryOpenOrgsSimilarityForOrgsDedup.sql index 7ae5eb43f5..01eaaeb245 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/resources/eu/dnetlib/dhp/oa/graph/sql/queryOpenOrgsSimilarityForOrgsDedup.sql +++ b/dhp-workflows/dhp-graph-mapper/src/main/resources/eu/dnetlib/dhp/oa/graph/sql/queryOpenOrgsSimilarityForOrgsDedup.sql @@ -1,7 +1,7 @@ -- relations approved by the user SELECT - local_id AS id1, - oa_original_id AS id2, + d.local_id AS id1, + d.oa_original_id AS id2, 'openaire____::openorgs' AS collectedfromid, 'OpenOrgs Database' AS collectedfromname, false AS inferred, @@ -9,7 +9,9 @@ SELECT 0.99 AS trust, '' AS inferenceprovenance, 'isSimilarTo' AS relclass -FROM oa_duplicates WHERE reltype = 'is_similar' +FROM oa_duplicates d +LEFT OUTER JOIN organizations o ON (d.local_id=o.id) +WHERE d.reltype = 'is_similar' AND o.status = 'approved' UNION ALL @@ -25,14 +27,15 @@ SELECT '' AS inferenceprovenance, 'isSimilarTo' AS relclass FROM other_names n - LEFT OUTER JOIN organizations o ON (n.id = o.id) +LEFT OUTER JOIN organizations o ON (n.id = o.id) +WHERE o.status = 'approved' UNION ALL -- diff relations approved by the user SELECT - local_id AS id1, - oa_original_id AS id2, + d.local_id AS id1, + d.oa_original_id AS id2, 'openaire____::openorgs' AS collectedfromid, 'OpenOrgs Database' AS collectedfromname, false AS inferred, @@ -40,4 +43,6 @@ SELECT 0.99 AS trust, '' AS inferenceprovenance, 'isDifferentFrom' AS relclass -FROM oa_duplicates WHERE reltype = 'is_different'; \ No newline at end of file +FROM oa_duplicates d +LEFT OUTER JOIN organizations o ON (d.local_id=o.id) +WHERE d.reltype = 'is_different' AND o.status = 'approved'; \ No newline at end of file