Changes

Jump to navigation Jump to search
516 bytes added ,  13:46, 21 September 2020
no edit summary
{{Project
|Has project output=Data,Tool,How-to
|Has sponsor=Kauffman Incubator Project
|Has title=Crunchbase Database
|Has owner=Hiep Nguyen
data\people_descriptions.csv
The sql script get_data.sql from last year is copied to the current Crunchbase3 directory. However, two databases are very different now and adjustments are necessary. To keep track of the data type from each csv file used to copy to sql tablesthe SQL database, a file get_type.py is included in E:\projects\crunchbase3. This python script will print the first 5 rows of every data frame in the current directory.
All the crunchbase3 data from drive E are now also in drive Z:/crunchbase3
A version of crunchbase3 database is live on the postgresql in Z:/crunchbase3. However, a few csv files have not been copied to the SQL database because of data type errors, which is a small problem but Hiep will need to spend some time to fix that. Hiep will work on it next week (March 28th).
Right now, a modification of load_crunchbase.sql is in both Z:/crunchbase3 and E:/projects/crunchbase3. Changes in dataset, datatype, and data columns have been made a lot compared to the previous version. The columns that are not yet added to the postgresql db are noted inside two lines of ################'s in the sql script. Since the data has changed will be changing a lot compared to last yearprevious years, using \i load_crunchbase.sql was might not very useful, and one may need to copy one table at a time by pasting the sql script into the terminal.
Files that All the dataset (17 of them) from the API have not yet been copied to the postgresql PostgreSQL server are degreesin drive Z under /bulk/crunchbase3.csvTo make date-time format in postgres work properly, all the empty string with quotes ("") in CSV files have been replaced by NULL with the command line eventssed 's/""//g' file.csv funding_round>file_clean.csv fundsThe script that I used to do that is in the file clean_data.csv investorssh in E:/projects/crunchbase3.csv iposA shorter script to do that for all the files in the directory is possible but might not be necessary and not all files require such edit.csv jobs.csv organizations.csv people.csv 03/28/2019 UPDATE
All the dataset (17 of them) from the API has been copied to the PostgreSQL server in drive Z under /bulk/crunchbase3. To make date-time format in postgres works properly, all the empty string with quotes ("") in CSV files have been replaced by NULL ==Working with the command line sed 's/""//g' file_clean.csv >file_clean.csvThe script that I used to do that is in the file clean_data.sh in E:/projects/crunchbase3. A shorter script to do that for all the files in the directory is possible but might not be necessary and not all files require such edit.database==
All the scripts in load_crunchbase.sql have been updated. It now works perfectly with the current data (as of 03/29/2019) crawled from crunchbaseAPI and includes the correct number of rows copied from the csv files at the end of each \COPY command. I have also double-checked each table by comparing the postgres version of the data and the pandas version of the data.
To see and use the data in the postgres severserver:
1) Connect to reseacher@199.188.177.215. A password is required ( ask Prof Egan for details)
\dt
4) Perform regular SQL queries
 
==Incubators in Crunchbase==
 
\COPY (SELECT uuid, company_name, short_description FROM Organizations WHERE country_code='USA' AND short_description LIKE '%incubat%') TO
'CrunchbaseShortOrgDescsUSAIncubat.txt' WITH DELIMITER AS E'\t' HEADER NULL AS CSV
--466
\COPY (SELECT A.uuid, A.company_name, B.description FROM Organizations AS A JOIN organization_descriptions AS B on A.uuid=B.uuid WHERE
country_code='USA' AND description LIKE '%incubat%') TO 'CrunchbaseLongOrgDescsUSAIncubat.txt' WITH DELIMITER AS E'\t' HEADER NULL AS CSV
--933
 
The two queries above were run against the Crunchbase database (see [[Ecosystem Organization Classifier]]), then their results were manually reviewed in two xlsx files (CrunchbaseLongOrgDescsUSAIncubat_IncubatorScore and CrunchbaseShortOrgDescsUSAIncubat_IncubatorScore), stored in E:\projects\crunchbase3
 
These files were then combined into IncubatorsFromCrunchbase.xlsx providing they scored 1 in the Long file or were marked keep and did not score 0 (social impact or virtual) in the Short file. The file has 564 (not necessarily unique) records and the following columns:
uuid company_name description Score Notes Source
 
RetrievingIncubators.sql was then modified to load this data, locate distinct UUIDs and output Organizational records. The resulting file is CrunchbaseIncubators.txt (456 unique records, all USA), which has the following fields:
company_name uuid address city state_code region status domain category_list short_description

Navigation menu