Skip to content

Commit

Permalink
Merge pull request #398 from georgetown-cset/348-normalize-yearly-cou…
Browse files Browse the repository at this point in the history
…nt-column-names

Standardize yearly count column names
  • Loading branch information
rggelles authored Jun 6, 2024
2 parents a3cafce + c56b2d9 commit a279b8d
Show file tree
Hide file tree
Showing 12 changed files with 1,110 additions and 1,110 deletions.
6 changes: 3 additions & 3 deletions company_linkage/sql/all_paper_counts.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
WITH year_counts AS (
SELECT
CSET_id,
COUNT(DISTINCT(merged_id)) as year_count,
COUNT(DISTINCT(merged_id)) as num_papers,
year
FROM
staging_ai_companies_visualization.all_company_papers
Expand All @@ -10,8 +10,8 @@ WITH year_counts AS (

SELECT
CSET_id,
SUM(year_count) as all_pubs,
ARRAY_AGG(STRUCT(year, year_count)) AS all_pubs_by_year
SUM(num_papers) as all_pubs,
ARRAY_AGG(STRUCT(year, num_papers)) AS all_pubs_by_year
FROM
year_counts
GROUP BY
Expand Down
6 changes: 3 additions & 3 deletions company_linkage/sql/highly_cited_paper_counts.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
WITH year_counts AS (
SELECT
CSET_id,
COUNT(DISTINCT(merged_id)) as year_count,
COUNT(DISTINCT(merged_id)) as num_papers,
year
FROM
staging_ai_companies_visualization.highly_cited_ai_publications
Expand All @@ -10,8 +10,8 @@ WITH year_counts AS (

SELECT
CSET_id,
SUM(year_count) as highly_cited_ai_pubs,
ARRAY_AGG(STRUCT(year, year_count)) AS highly_cited_ai_pubs_by_year
SUM(num_papers) as highly_cited_ai_pubs,
ARRAY_AGG(STRUCT(year, num_papers)) AS highly_cited_ai_pubs_by_year
FROM
year_counts
GROUP BY
Expand Down
8 changes: 4 additions & 4 deletions company_linkage/sql/initial_paper_visualization_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ all_cited as
(SELECT
CSET_id,
ARRAY_AGG(STRUCT(year,
ai_citation_count)
ai_citation_count as num_papers)
ORDER BY
year) AS ai_citation_count_by_year,
ARRAY_AGG(STRUCT(year,
cv_citation_count)
cv_citation_count as num_papers)
ORDER BY
year) AS cv_citation_count_by_year,
ARRAY_AGG(STRUCT(year,
nlp_citation_count)
nlp_citation_count as num_papers)
ORDER BY
year) AS nlp_citation_count_by_year,
ARRAY_AGG(STRUCT(year,
robotics_citation_count)
robotics_citation_count as num_papers)
ORDER BY
year) AS robotics_citation_count_by_year
FROM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ WITH
SELECT
CSET_id,
ARRAY_AGG(STRUCT(year,
all_patents)
all_patents as num_patents)
ORDER BY
year) AS all_patents_by_year,
FROM
Expand Down
73 changes: 36 additions & 37 deletions company_linkage/sql/patent_visualization_data_with_by_year.sql
Original file line number Diff line number Diff line change
Expand Up @@ -55,150 +55,149 @@ WITH
SELECT
CSET_id,
ARRAY_AGG(STRUCT(priority_year,
ai_patents)
ai_patents as num_patents)
ORDER BY
priority_year) AS ai_patents_by_year,
ARRAY_AGG(STRUCT(priority_year,
Physical_Sciences_and_Engineering_pats)
Physical_Sciences_and_Engineering_pats as num_patents)
ORDER BY
priority_year) AS Physical_Sciences_and_Engineering_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Life_Sciences_pats)
Life_Sciences_pats as num_patents)
ORDER BY
priority_year) AS Life_Sciences_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Security__eg_cybersecurity_pats)
Security__eg_cybersecurity_pats as num_patents)
ORDER BY
priority_year) AS Security__eg_cybersecurity_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Transportation_pats)
Transportation_pats as num_patents)
ORDER BY
priority_year) AS Transportation_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Industrial_and_Manufacturing_pats)
Industrial_and_Manufacturing_pats as num_patents)
ORDER BY
priority_year) AS Industrial_and_Manufacturing_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Education_pats)
Education_pats as num_patents)
ORDER BY
priority_year) AS Education_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Document_Mgt_and_Publishing_pats)
Document_Mgt_and_Publishing_pats as num_patents)
ORDER BY
priority_year) AS Document_Mgt_and_Publishing_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Military_pats)
Military_pats as num_patents)
ORDER BY
priority_year) AS Military_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Agricultural_pats)
Agricultural_pats as num_patents)
ORDER BY
priority_year) AS Agricultural_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Computing_in_Government_pats)
Computing_in_Government_pats as num_patents)
ORDER BY
priority_year) AS Computing_in_Government_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Personal_Devices_and_Computing_pats)
Personal_Devices_and_Computing_pats as num_patents)
ORDER BY
priority_year) AS Personal_Devices_and_Computing_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Banking_and_Finance_pats)
Banking_and_Finance_pats as num_patents)
ORDER BY
priority_year) AS Banking_and_Finance_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Telecommunications_pats)
Telecommunications_pats as num_patents)
ORDER BY
priority_year) AS Telecommunications_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Networks__eg_social_IOT_etc_pats)
Networks__eg_social_IOT_etc_pats as num_patents)
ORDER BY
priority_year) AS Networks__eg_social_IOT_etc_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Business_pats)
Business_pats as num_patents)
ORDER BY
priority_year) AS Business_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Energy_Management_pats)
Energy_Management_pats as num_patents)
ORDER BY
priority_year) AS Energy_Management_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Entertainment_pats)
Entertainment_pats as num_patents)
ORDER BY
priority_year) AS Entertainment_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Nanotechnology_pats)
Nanotechnology_pats as num_patents)
ORDER BY
priority_year) AS Nanotechnology_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Semiconductors_pats)
Semiconductors_pats as num_patents)
ORDER BY
priority_year) AS Semiconductors_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Language_Processing_pats)
Language_Processing_pats as num_patents)
ORDER BY
priority_year) AS Language_Processing_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Speech_Processing_pats)
Speech_Processing_pats as num_patents)
ORDER BY
priority_year) AS Speech_Processing_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Knowledge_Representation_pats)
Knowledge_Representation_pats as num_patents)
ORDER BY
priority_year) AS Knowledge_Representation_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Planning_and_Scheduling_pats)
Planning_and_Scheduling_pats as num_patents)
ORDER BY
priority_year) AS Planning_and_Scheduling_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Control_pats)
Control_pats as num_patents)
ORDER BY
priority_year) AS Control_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Distributed_AI_pats)
Distributed_AI_pats as num_patents)
ORDER BY
priority_year) AS Distributed_AI_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Robotics_pats)
Robotics_pats as num_patents)
ORDER BY
priority_year) AS Robotics_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Computer_Vision_pats)
Computer_Vision_pats as num_patents)
ORDER BY
priority_year) AS Computer_Vision_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Analytics_and_Algorithms_pats)
Analytics_and_Algorithms_pats as num_patents)
ORDER BY
priority_year) AS Analytics_and_Algorithms_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Measuring_and_Testing_pats)
Measuring_and_Testing_pats as num_patents)
ORDER BY
priority_year) AS Measuring_and_Testing_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Logic_Programming_pats)
Logic_Programming_pats as num_patents)
ORDER BY
priority_year) AS Logic_Programming_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Fuzzy_Logic_pats)
Fuzzy_Logic_pats as num_patents)
ORDER BY
priority_year) AS Fuzzy_Logic_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Probabilistic_Reasoning_pats)
Probabilistic_Reasoning_pats as num_patents)
ORDER BY
priority_year) AS Probabilistic_Reasoning_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Ontology_Engineering_pats)
Ontology_Engineering_pats as num_patents)
ORDER BY
priority_year) AS Ontology_Engineering_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Machine_Learning_pats)
Machine_Learning_pats as num_patents)
ORDER BY
priority_year) AS Machine_Learning_pats_by_year,
ARRAY_AGG(STRUCT(priority_year,
Search_Methods_pats)
Search_Methods_pats as num_patents)
ORDER BY
priority_year) AS Search_Methods_pats_by_year,

FROM
high_resolution_entities.aggregated_organizations
LEFT JOIN
Expand Down
Loading

0 comments on commit a279b8d

Please sign in to comment.