|
|
|
@ -38,20 +38,20 @@ SELECT substr(s.id, 4) as id,
|
|
|
|
|
CASE WHEN SIZE(s.description) > 0 THEN TRUE ELSE FALSE END AS abstract,
|
|
|
|
|
'software' as type
|
|
|
|
|
from ${openaire_db_name}.software s
|
|
|
|
|
where s.datainfo.deletedbyinference = false;
|
|
|
|
|
where s.datainfo.deletedbyinference = false and s.datainfo.invisible=false;
|
|
|
|
|
|
|
|
|
|
CREATE TABLE ${stats_db_name}.software_citations AS
|
|
|
|
|
SELECT substr(s.id, 4) as id, xpath_string(citation.value, "//citation/id[@type='openaire']/@value") AS cites
|
|
|
|
|
FROM ${openaire_db_name}.software s
|
|
|
|
|
LATERAL VIEW explode(s.extrainfo) citations as citation
|
|
|
|
|
where xpath_string(citation.value, "//citation/id[@type='openaire']/@value") != ""
|
|
|
|
|
and s.datainfo.deletedbyinference = false;
|
|
|
|
|
and s.datainfo.deletedbyinference = false and s.datainfo.invisible=false;
|
|
|
|
|
|
|
|
|
|
CREATE TABLE ${stats_db_name}.software_classifications AS
|
|
|
|
|
SELECT substr(p.id, 4) AS id, instancetype.classname AS type
|
|
|
|
|
FROM ${openaire_db_name}.software p
|
|
|
|
|
LATERAL VIEW explode(p.instance.instancetype) instances AS instancetype
|
|
|
|
|
where p.datainfo.deletedbyinference = false;
|
|
|
|
|
where p.datainfo.deletedbyinference = false and p.datainfo.invisible=false;
|
|
|
|
|
|
|
|
|
|
CREATE TABLE ${stats_db_name}.software_concepts AS
|
|
|
|
|
SELECT substr(p.id, 4) as id, case
|
|
|
|
@ -60,7 +60,7 @@ SELECT substr(p.id, 4) as id, case
|
|
|
|
|
when contexts.context.id RLIKE '^[^::]+$' then concat(contexts.context.id, '::other::other') END as concept
|
|
|
|
|
FROM ${openaire_db_name}.software p
|
|
|
|
|
LATERAL VIEW explode(p.context) contexts AS context
|
|
|
|
|
where p.datainfo.deletedbyinference = false;
|
|
|
|
|
where p.datainfo.deletedbyinference = false and p.datainfo.invisible=false;
|
|
|
|
|
|
|
|
|
|
CREATE TABLE ${stats_db_name}.software_datasources AS
|
|
|
|
|
SELECT p.id, CASE WHEN d.id IS NULL THEN 'other' ELSE p.datasource end as datasource
|
|
|
|
@ -68,31 +68,31 @@ FROM (
|
|
|
|
|
SELECT substr(p.id, 4) AS id, substr(instances.instance.hostedby.key, 4) AS datasource
|
|
|
|
|
FROM ${openaire_db_name}.software p
|
|
|
|
|
LATERAL VIEW explode(p.instance) instances AS instance
|
|
|
|
|
where p.datainfo.deletedbyinference = false) p
|
|
|
|
|
where p.datainfo.deletedbyinference = false and p.datainfo.invisible=false) p
|
|
|
|
|
LEFT OUTER JOIN (
|
|
|
|
|
SELECT substr(d.id, 4) id
|
|
|
|
|
FROM ${openaire_db_name}.datasource d
|
|
|
|
|
WHERE d.datainfo.deletedbyinference = false) d ON p.datasource = d.id;
|
|
|
|
|
WHERE d.datainfo.deletedbyinference = false and d.datainfo.invisible=false) d ON p.datasource = d.id;
|
|
|
|
|
|
|
|
|
|
CREATE TABLE ${stats_db_name}.software_languages AS
|
|
|
|
|
select substr(p.id, 4) AS id, p.language.classname AS language
|
|
|
|
|
FROM ${openaire_db_name}.software p
|
|
|
|
|
where p.datainfo.deletedbyinference = false;
|
|
|
|
|
where p.datainfo.deletedbyinference = false and p.datainfo.invisible=false;
|
|
|
|
|
|
|
|
|
|
CREATE TABLE ${stats_db_name}.software_oids AS
|
|
|
|
|
SELECT substr(p.id, 4) AS id, oids.ids AS oid
|
|
|
|
|
FROM ${openaire_db_name}.software p
|
|
|
|
|
LATERAL VIEW explode(p.originalid) oids AS ids
|
|
|
|
|
where p.datainfo.deletedbyinference = false;
|
|
|
|
|
where p.datainfo.deletedbyinference = false and p.datainfo.invisible=false;
|
|
|
|
|
|
|
|
|
|
CREATE TABLE ${stats_db_name}.software_pids AS
|
|
|
|
|
SELECT substr(p.id, 4) AS id, ppid.qualifier.classname AS type, ppid.value AS pid
|
|
|
|
|
FROM ${openaire_db_name}.software p
|
|
|
|
|
LATERAL VIEW explode(p.pid) pids AS ppid
|
|
|
|
|
where p.datainfo.deletedbyinference = false;
|
|
|
|
|
where p.datainfo.deletedbyinference = false and p.datainfo.invisible=false;
|
|
|
|
|
|
|
|
|
|
CREATE TABLE ${stats_db_name}.software_topics AS
|
|
|
|
|
SELECT substr(p.id, 4) AS id, subjects.subject.qualifier.classname AS type, subjects.subject.value AS topic
|
|
|
|
|
FROM ${openaire_db_name}.software p
|
|
|
|
|
LATERAL VIEW explode(p.subject) subjects AS subject
|
|
|
|
|
where p.datainfo.deletedbyinference = false;
|
|
|
|
|
where p.datainfo.deletedbyinference = false and p.datainfo.invisible=false;
|