1
0
Fork 0

modification of the queries for openorgs: they now consider also pending orgs

This commit is contained in:
miconis 2021-04-20 12:06:56 +02:00
parent e06c7f32f6
commit cadd0a5de8
2 changed files with 13 additions and 8 deletions

View File

@ -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,

View File

@ -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';
FROM oa_duplicates d
LEFT OUTER JOIN organizations o ON (d.local_id=o.id)
WHERE d.reltype = 'is_different' AND o.status = 'approved';