Changes

Jump to navigation Jump to search
14,425 bytes added ,  13:38, 8 October 2019
no edit summary
[[Jeemin Sim]] [[Work Logs]] [[Jeemin Sim (WorkLog)|(log page)]] ===Spring 2018===2017-01-11:*Was briefed on [[Urban Start-up Agglomeration and Venture Capital Investment]]*Going forward - running regressions in R in PostgreSQL and with desired layers (instead of levels) ===Fall 2017===<onlyinclude> 2017-12-05:* Uploaded tables with KML files in TIF folder in bulk(E:) drive** Allegheny County** Atlanta** Chicago** Columbus, OH** Dublin, OH** Vermont** Washington, D.C. *Updated documentation for: ** http://www.edegan.com/wiki/TIF_Project#Uploading_TIF_Data_onto_database_.28tigertest.29 * shp2pgsql needs to be installed to upload Shapefiles to PostgreSQL database** applies for Houston, TX and Dallas, TX** DONE 2017-12-04:* To upload KML file into database with specified table name: researcher@McNairDBServ:/bulk/tigertest$ ogr2ogr -f PostgreSQL PG:"dbname=tigertest" chicagotif.kml -nln chicagotif* chicagotif table now resides in tigertest database 2017-11-30:* Displayed map with TIF districts and startups* Location: E:\McNair\Projects\Agglomeration\TIF\McNair_Color_Chicago_TIF_and_startups.png* Added information and steps to ArcMap/ArcGIS documentation page* Create a project page for 'Working with POSTGIS' and add instructions for uploading KML file onto POSTGIS** Command used : *** Logged in as : researcher@McNairDBServ /bulk/tigertest$ ogr2ogr -f PostgreSQL PG:"dbname=2tigertest" chicagotif.kml * chicago TIF kml file currently downloaded in tigertest with a table name of Layer0** Figure out how to change layer name while loading kml file** Instructions pulled from : http://wiki.wildsong.biz/index.php/Loading_data_into_PostGIS#Loading_data_from_KMZ_files 2017-11-28:* Created and edited [[ArcMap / ArcGIS Documentation]]* Plotted points for TIFS and Startups in Chicago in one map.** Location: E:\McNair\Projects\Agglomeration\TIF\Jeemin_Chicago_TIF_and_Startups_Attempt1* Used https://6mygeodata.cloud/result to convert from KML file to CSV (which was then saved as txt file to be uploaded onto ArcMap)* Text files located in Local Disk (C:) Drive 2017-11-27:*Download Chicago TIF data 2017-11-13:* 2017-11-09: * Notes on data downloaded:** Year 2010-2012 data are based on total population, not 25 yrs or over (case for all other tables)*** Record appears five times total, with same exact column name***For exmaple: 'Total; Estimate; High school graduate (includes equivalency)' appears five times, with different values.* TODO:** Make Projects page for ACS Data***[[American Community Survey (ACS) Data]] 2017 MONDAY -11-07:*Yesterday, narrowed down columns of interest from ACS_S1501_educationattain_2016 table.  Id Id2 Geography Total; Estimate; Population 25 years and over Total; Estimate; Population 25 years and over - High school graduate (includes equivalency) Total; Margin of Error; Population 25 years and over - High school graduate (includes equivalency) Total; Margin of Error; Population 25 years and over - High school graduate (includes equivalency) Percent; Margin of Error; Population 25 years and over - High school graduate (includes equivalency) Total; Estimate; Population 25 years and over - Associate's degree Total; Margin of Error; Population 25 years and over - Associate's degree Percent; Estimate; Population 25 years and over - Associate's degree Percent; Margin of Error; Population 25 years and over - Associate'2PMs degree Total; Estimate; Population 25 years and over -6PMBachelor's degree Total; Margin of Error; Population 25 years and over - Bachelor'==== s degree Percent; Estimate; Population 25 years and over - Bachelor's degree Percent; Margin of Error; Population 25 years and over - Bachelor's degree Total; Estimate; Population 25 years and over - Graduate or professional degree Total; Margin of Error; Population 25 years and over - Graduate or professional degree Percent; Estimate; Population 25 years and over - Graduate or professional degree Percent; Margin of Error; Population 25 years and over - Graduate or professional degree Percent; Estimate; Percent high school graduate or higher Percent; Margin of Error; Percent high school graduate or higher Percent; Estimate; Percent bachelor's degree or higher Percent; Margin of Error; Percent bachelor's degree or higher *Complications:* Set up wikiPage *For csv files corresponding to years 2015 & remote desktop2016, all of the above columns exist.**For csv files corresponding to years 2005 - 2014, no 'Percent' columns exist*** Instead their 'Total' columns are percentage values**For csv file corresponding to year 2005, columns regarding Graduate or professional degree are labeled differently.**2012 data doesn't correspond to Population 25 years and over. *Temporary Solution:**Since the above problems may be specific to this set of tables, will go through csv files and adjust columns. *Python script location: E:\McNair\Projects\Agglomeration\ACS_Downloaded_Data\pullCertainColumns.py 2017-10-31:* Finished doanloading files from ACS. * Started working loading tables into tigertest.* Commands run could be found in E:\McNair\Projects\Agglomeration\ACS_Downloaded_Data\DataLoading_SQL_Commands.txt 2017-10-30:* Downloaded data from ACS, to be continued* File path: E:\McNair\Projects\Agglomeration\ACS_Downloaded_Data* Fields of interest: S1401 SCHOOL ENROLLMENT S1501 EDUCATIONAL ATTAINMENT S2301 EMPLOYMENT STATUS B01003 TOTAL POPULATION B02001 RACE B07201 GEOGRAPHICAL MOBILITY B08303 TRAVEL TIME TO WORK B19013 MEDIAN HOUSEHOLD INCOME B19053 SELF-EMPLOYMENT INCOME IN THE PAST 12 MONTHS FOR HOUSEHOLDS B19083 GINI INDEX OF INCOME INEQUALITY B25003 TENURE B25105 MEDIAN MONTHLY HOUSING COSTS B28011 INTERNET SUBSCRIPTIONS IN HOUSEHOLD G001 GEOGRAPHIC IDENTIFIERS 2017-10-23:* Talked to Ed with Peter & Oliver about upcoming tasks & projects.* Loaded acs_place table 2017 (does not contain population) on python version tigertest.** SQL commands used:  DROP TABLE acs_place;  CREATE TABLE acs_place ( USPS varchar(5), GEOID varchar(30), ANSICODE varchar(30), NAME varchar(100), LSAD varchar(30), FUNCSTAT varchar(10), ALAND varchar(30), AWATER varchar(30), ALAND_SQMI varchar(30), AWATER_SQMI varchar(30), INTPTLAT varchar(30), INTPTLONG varchar(30) );  \COPY acs_place FROM '/bulk/2017_Gaz_place_national.txt'; --COPY 29578 * TODO:** Find acs place 2016 data for population** Find larger acs files, ideally at the place level** Provide more documentation on POSTGIS & geocoding 2017-10-16:* Exported maps of points from the Bay Area each year. ** Map used location: E:\McNair\Projects\Agglomeration\HarrisonPeterWorkArcGIS\Jeemin_Bay_Area Points_Every_Year\BayAreaEveryYearMap** Zoom scale: 1:650.000* Location of Bay Area Points png files: E:\McNair\Projects\Agglomeration\HarrisonPeterWorkArcGIS\Jeemin_Bay_Area Points_Every_Year 2017-10-10:*Discoveries/ Struggles regarding.gdb to .shp file conversion:** Esri Production Mapping (costly)*** License needs to be purchasesd: http://www.esri.com/software/arcgis/extensions/production-mapping/pricing** Use ogr2ogr from gdal package*** https://gis.stackexchange.com/questions/14432/migrating-geodatabase-data-into-postgis-without-esri-apps*** Command: ogr2ogr -f "ESRI Shapefile" [Destination of shapefile] [path to gdb file]*** Problem installing gdal 2017-10-09:* TODO'S:** Downloading data onto tigertest*** Road*** Railway*** Coastline*** Instructions: http://www.edegan.com/wiki/PostGIS_Installation#Bulk_Download_TIGER_Shapefiles** Configure census data from American Community Survey (ACS)*** 1) Work out what data is of web crawlerour interest (confirm ACS)*** 2) Determine appropriate shape file unit: **** census block vs. census block group vs. census track*** 3) Load into tigertest * Done:** Downloaded data from https://www.census. So far gov/cgi-bin/geo/shapefiles/index.php tl_2017_us_coastline -- 4209 tl_2017_us_primaryroads -- 11574 tl_2017_us_rails -- 176237** Link found to potentially download ACS data: https://www.census.gov/geo/maps-data/data/tiger-data.html*** But most files on it successfully prints out come with .gdb extension and not .shp 2017-10-03:* Installed PostGIS & is now visible on pgAdmin III * ArcGIS (connect to postgis database):** 1) Open ArcMap** 2) Either open blank or open existing file/project** 3) Click on 'Add Data' button with a cross and a catchphrase/ description for yellow diamond (under Selection toolbar)** 4) Go to the top-most directory by pressing on the arrow that points left-then-up (on the left of home button)** 5) Click on 'Database Connections'** 6) Click on 'Add Database Connection' (if Connection to localhost.sde) does not exist already)** 7) Fill in the following fields:*** Database Platform: PostgreSQL*** Instance: localhost*** User name: postgres*** Password: *** Database: tigertest** 8) Press 'OK'** 9) Now you'll have 'Connection to localhost.sde' in your Database Connections** 10) Double click on 'Connection to localhost.sde'** 11) Double click on the table of interest** 12) Click 'Finish'** 13) You'll see information populated on map, as one websiteof the 'Layers'*** Tested with: tigertest. To be worked onpublic. The copointplacescontains * On running & altering Oliver's script: ** Location: E:\McNair\Projects\OliverLovesCircles\src\python \vc_circles.py** Ed manipulated file can names so that underscores would replace dots (St.Louis --> St_Louis)** Takes in instances and sweep times as part of the argument, but not impactful as those variables are hardcoded in the script** Ran vc_circles.py with the following variables with changed values:*** SWEEP_CYCLE_SECONDS = 10 (used to be 30)*** NUMBER_INSTANCES = 16 (used to be 8)** New output to be found in: E:\McNair\Projects\AcceleratorsOliverLovesCircles\out 2017-10-02:* Talked to Harrison & Peter regarding ArcGIS** Currently have points plotted on Houston** Trouble interpreting geometry type, as currently reads in from text file** Documents located in : E:\McNair\Python WebCrawlerProjects\Agglomeration\webcrawlerpythonHarrisonPeterWorkArcGIS* Attempted to install PostGIS spatial extention from PostgreSQL but getting 'spatial database creation failed' error message.** Referenced instructions: *** https://www.gpsfiledepot.com/tutorials/installing-and-setting-up-postgresql-with-postgis/*** http://www.bostongis.com/PrinterFriendly.aspx?content_name=postgis_tut01 2017-09-26:* Created a table that maps a state to the database name.** http://www.edegan.com/wiki/PostGIS_Installation#Translating_Table_names_to_corresponding_States* Added more GIS-information (functions, realm & outliers to consider)** http://www.edegan.com/wiki/Urban_Start-up_Agglomeration#GIS_Resources* Visualization in PostGIS or connecting to ArcGIS for visualization (import/export data)* Spatial indexing:** http://revenant.ca/www/postgis/workshop/indexing.html 2017-09-25:* Talked to Ed about GIS, Census data, and going about determining the correctness of reported 'place.' Currently script makes a cross product of each reported place and an existing place, outputting a column of boolean value to indicate whether the reported place's coordinates fell within a place's geometric boundaries. One other way of going about this which we discussed is to first check if the reported place does fall within that place's boundaries. If it isn't, we'll go about the cross product method.py
====2* To add documentation : ** http://www.edegan.com/8wiki/2017 WEDNESDAY''9AM-11AM''==== PostGIS_Installation* Attempted to come up with possible cases for locating the description of accelerators * http://www.edegan.com/wiki/Urban_Start- pick up from extracting bodies of text from the about page (given that it exists)up_Agglomeration
====2/13/2017 MONDAY ''2PM-6PM''====* Goals (for trials): 1) Build ER Diagram 2) For each entity, get XML snippet 3) Build a parser/ripper for single file; Discussed the python parser can be found at: E:\McNair\Projects\FDA Trials\Jeemin_Project* [[Trial Data Project]]need to maintain venture capital database.
====2/15/2017 WEDNESDAY ''9AM-11AM''====*Relevant File paths:* Discussed with Catherine what to do with FDA Trial data and decided to have a dictionary with zip-codes as keys and number of trials occurred in that zipcode as values*E:\McNair\Projects\Agglomeration\TestGIS. Was still attempting to loop through the files without the code having to exist in the same directory as the XML filessql**Z:\VentureCapitalData\SDCVCData\vcdb2\ProecssingCoLevelSimple. Plan to write to excel via tsv, with zip-code as one column and # of occurrence as the othersql**Z:\VentureCapitalData\SDCVCData\vcdb2\CitiesWithGT10Active.txt
====2/17/2017 FRIDAY -09-21:* Functions for Linear Referencing: '''2PM-6PMST_LineInterpolatePoint(geometry A, double measure)'''====: Returns a point interpolated along a line.* Completed code for counting '''ST_LineLocatePoint(geometry A, geometry B)''': Returns a float between 0 and 1 representing the number location of occurrences for each unique zipcodethe closest point on LineString to the given Point. '''ST_Line_Substring(currently titled & locatedgeometry A, double from, double to)''': E:\McNair\Projects\FDA Trials\Jeemin_Project\Jeemin_Running_FileReturn a linestring being a substring of the input one starting and ending at the given fractions of total 2d length.py '''ST_Locate_Along_Measure(geometry A, double measure). It has been running for 20+min because of ''': Return a derived geometry collection value with elements that match the comprehensive XML data filesspecified measure. Meanwhile started coding '''ST_Locate_Between_Measures(geometry A, double from, double to create )''': Return a dictionary derived geometry collection value with elements that match the keys corresponding to each unique trial ID, mapped to every other information specified range of measures inclusively. '''ST_AddMeasure(locationgeometry A, sponsorsdouble from, phase, drugs ...etc.double to) (currently titled & located''': E:\McNair\Projects\FDA Trials\Jeemin_Project\Jeemin_FDATrial_as_key_data_rippingReturn a derived geometry with measure elements linearly interpolated between the start and end points.py)If the geometry has no measure dimension, one is added.
====2/20/2017 MONDAY *3-D Functions: ''2PM'ST_3DClosestPoint''' — Returns the 3-4:30PMdimensional point on g1 that is closest to g2. This is the first point of the 3D shortest line. '''ST_3DDistance'''====* Continued working — For geometry type Returns the 3-dimensional cartesian minimum distance (based on Jeemin_FDATrial_as_key_data_rippingspatial ref) between two geometries in projected units.py to find tags and place all '''ST_3DDWithin''' — For 3d (z) geometry type Returns true if two geometries 3d distance is within number of those information in a listunits. The other zipcode file did not finish executing after 2+ hours '''ST_3DDFullyWithin''' — Returns true if all of running it - considering the possibility 3D geometries are within the specified distance of splitting one another. '''ST_3DIntersects''' — Returns TRUE if the record file into smaller bits, or running Geometries “spatially intersect” in 3d - only for points and linestrings '''ST_3DLongestLine''' — Returns the processing 3-dimensional longest line between two geometries '''ST_3DMaxDistance''' — For geometry type Returns the 3-dimensional cartesian maximum distance (based on a faster machinespatial ref) between two geometries in projected units. '''ST_3DShortestLine''' — Returns the 3-dimensional shortest line between two geometries
====2/22/2017 WEDNESDAY *Relevant PostgreSQL Commands: ''9AM-12:30PM'\dt *.*'''====Show all tables* Finished Jeemin_FDATrial_as_key_data_ripping.py (E: '''\McNair\Projects\FDA Trials\Jeemin_Project\Jeemin_FDATrial_as_key_data_ripping.py), which outputs to E:\McNair\Projects\FDA Trials\Jeemin_Project\general_data_ripping_output.txt; TODO: output four different tables & replace the write in the same for-loop as going through each fileq''' Exit table
====2/24*Specifities/2017 FRIDAY ''2Outliers to consider:30PM-6:30PM''====* Continued working on producing multiple tables - first two are done. Was working on location New York (decompose) Princeton area (keep Princeton unique) Reston, as there are multiple location tags per location.Virginia (keep) San Diego (include La Jolla) Silicon Valley (all distinct)
====2/27/2017 MONDAY ''2PM-6PM''====* Finished producing tables Continue reading from Jeemin_FDATrial_as_key_data_ripping.py* Talked to Julia about LinkedIn data extracting - to be discussed further with Julia & Peter.* Started web crawler for Wikipedia - currently pulls Endowment, Academic staff, students, undergraduates, and postgraduates info found on Rice Wikipedia page. Can be found in : Ehttps:\McNair\Projects\University Patents\Jeemin_University_wikipedia_crawler//postgis.net/docs/postgis_installation.pyhtml
====3/1/2017 WEDNESDAY ''9AM-12PM''====09-20:* Attended first intro to GIS course yesterday* Started re-running Jeemin_FDATrial_as_key_data_ripping.pyUpdated above notes on GIS
====3/3/2017 FRIDAY ''2PM-5PM''====
* Attempted to output sql tables
====3/6/017 MONDAY ''2PM2017-6PM''====* [[Installing python in a database]]* Added building Python function section to [[Working with PostgreSQL]] at the bottom of the page.* Ran FDA Trial data ripping again, as the text output files were wiped. * Plan on discussing with Julia and Meghana again about pulling universities and other relevant institutions from the Assignee List USA. 09-19:* Talked to Sonia about pulling city, state, zipcode information, hence python was installed in a database. Will work with Sonia on Wednesday afternoon and see how best a regex function could be implementedUseful functions for spatial joins:
====3/8/2017 WEDNESDAY '''sum(expression)''': aggregate to return a sum for a set of records '''count(expression)''': aggregate to return the size of a set of records '''ST_Area(geometry)''' returns the area of the polygons '''ST_AsText(geometry)''' returns WKT text '''ST_Buffer(geometry, distance)''': For geometry: Returns a geometry that represents all points whose distance from this Geometry is less than or equal to distance. Calculations are in the Spatial Reference System of this Geometry. For geography: Uses a planar transform wrapper. '''ST_Contains(geometry A, geometry B)''' returns the true if geometry A contains geometry B '''ST_Distance(geometry A, geometry B)'9AM-12PM''====returns the minimum distance between geometry A and geometry B* Output sql tables '''ST_DWithin(geometry A, geometry B, radius)''' returns the true if geometry A is radius distance or less from finished run geometry B '''ST_GeomFromText(text)''' returns geometry '''ST_Intersection(geometry A, geometry B)''': Returns a geometry that represents the shared portion of geomA and geomB. The geography implementation does a transform to geometry to do the intersection and then transform back to WGS84 '''ST_Intersects(geometry A, geometry B)''' returns the true if geometry A intersects geometry B '''ST_Length(linestring)''' returns the length of the linestring '''ST_Touches(geometry A, geometry B)''' returns the true if the boundary of Jeemin_FDATrial_as_key_data_rippinggeometry A touches geometry B '''ST_Within(geometry A, geometry B)''' returns the true if geometry A is within geometry B geometry_a '''&&''' geometry_b: Returns TRUE if A’s bounding box overlaps B’s.py * Ran through assigneelist_USA geometry_a '''=''' geometry_b: Returns TRUE if A’s bounding box is the same as B’s.txt '''ST_SetSRID(geometry, srid)''': Sets the SRID on a geometry to see how many different ways UNIVERSITY could be spelled wronga particular integer value. There were many '''ST_SRID(geometry)''': Returns the spatial reference identifier for the ST_Geometry as defined in spatial_ref_sys table.* Tried '''ST_Transform(geometry, srid)''': Returns a new geometry with its coordinates transformed to logic through creating the SRID referenced by the integer parameter. '''ST_Union()''': Returns a pattern geometry that could catch all different versions represents the point set union of UNIVERSITYthe Geometries. '''substring(string [from int] [for int])''': PostgreSQL string function to extract substring matching SQL regular expression. Discuss further on whether UNIVERSITIES and those that include UNIVERSITIES but include '''ST_Relate(geometry A, geometry B)''': Returns a text string representing the DE9IM relationship between the geometries. INC in '''ST_GeoHash(geometry A)''': Returns a text string representing the GeoHash of the bounds of the end should be pulled as relevant informationobject.
====3/8/2017 WEDNESDAY *Native functions for geogrphy: '''ST_AsText(geography)''' returns text '''ST_GeographyFromText(text)''' returns geography '''ST_AsBinary(geography)''' returns bytea '''ST_GeogFromWKB(bytea)''' returns geography '''ST_AsSVG(geography)''' returns text '''ST_AsGML(geography)''' returns text '''ST_AsKML(geography)''' returns text '''ST_AsGeoJson(geography)''' returns text '''ST_Distance(geography, geography)''' returns double '''ST_DWithin(geography, geography, float8)''' returns boolean '''ST_Area(geography)''' returns double '''ST_Length(geography)''' returns double '''ST_Covers(geography, geography)''' returns boolean '''ST_CoveredBy(geography, geography)''' returns boolean '''ST_Intersects(geography, geography)''' returns boolean '''ST_Buffer(geography, float8)''' returns geography [1] '''ST_Intersection(geography, geography)'2PM-5PM ''====returns geography [1]* Wrote regex pattern that identifies all "university" matchings - can be found in EContinue reading from: http:\McNair\Projects\University Patents\university_pulled_from_assignee_list_USA //workshops.boundlessgeo.com/postgis-- is an output file* Talked to Sonia, but didn't come to solid conclusion on identifying whether key words associate with city or country by running a python functionintro/geography.html
====3/13/2017 MONDAY ''12PM-2PM''====
* For University Patent Data Matching - matched SCHOOL (output: E:\McNair\Projects\University Patents\school_pulled_from_assignee_list_USA) and matched INSTITUTE(output: E:\McNair\Projects\University Patents\institute_pulled_from_assignee_list_USA).
* [[University Patent Matching]]
* To be worked on later: Grant XML parsing & general name matcher
====3/14/2017 TUESDAY ''12PM-2PM''====09-18:* Started pulling academy cases but there are too many cases to worry about, in terms of institution of interest. A document is located in E:\McNair\Projects\University Patents\academies_verify_cases.txtRead documentation on PostGIS and tiger geocoder* Need JuliaContinue reading from: http:/Meghana to look through the hits and see which are relevant & extract pattern from there/workshops. * Having trouble outputting txt file without double quotes around every lineboundlessgeo. * Thinking that one text file should be output for all keywords instead of having one each, to avoid overlap (ex) COLLEGE and UNIVERSITY are both keywords; ALBERT EINSTEIN COLLEGE OF YESHIVA UNIVERSITY will be hit twice if it were counted as two separate instances, one accounting for COLLEGE and the other for UNIVERSITY) com/postgis- either in the form of if-elseif statements or one big regex checkintro/joins.html
====3/15/2017 WEDNESDAY ''9AM-1PM''====09-12:* Todo: write a wikipage on possible input/Clarified University Matching output info on string matcherfile.* Wrote part of XML parserHelped Christy with pdf-reader, extracted yearly data into E:\McNair\Projects\Federal Grant Data\NSF\NSF Extracted Data (up to year 2010)capturing keywords in readable format.
====3/16/2017 THURSDAY ''12PM-2PM''====* Further documented [[University Patent Matching]]09-11:* Finished writing XML ParserEnsured that documentation exists for the projects worked on last semester.
====3</20/2017 MONDAY ''2PM-6PM''====* Talked to Julia about universal matcher, want to combine all University of California's to University of California, The Regents of* Converted crunchbase2013 data from mySQL to PostgreSQL, but having trouble with the last table - cb_relationships, complains about syntax error at or near some places - but generally all tables exist in database called crunchbase* Federal Grant Data XML Parser was run - the three output textfiles can be found in E:\McNair\Projects\Federal Grant Data\NSFonlyinclude>
====3/22/Spring 2017 WEDNESDAY ''9AM-12PM''====* Read string matching & calculating distance, below are relevant links* [http://www.cs.cmu.edu/~wcohen/postscript/ijcai-ws-2003.pdf]* [http://web.archive.org/web/20081224234350/http://www.dcs.shef.ac.uk/~sam/stringmetrics.html]
====3/24/2017 FRIDAY ''2PM-5PM''====04-17:* Discussed with Julia & Meghana about university keys to use to count # of occurrences, including aliases and misspellingsTo pull accelerators: Wrote simple python regex-based script that ran on organizations data.* Thoughts Code: E: to use a scoring metric with a key of UNIVERSITY OF CALIFORNIA SYSTEM, it should have a 'better' score when compared to MATHEMATICAL SCIENCES PUBLISHERS C/O UNIVERSITY OF CALIFORNIA BERKELEY or CALIFORNIA AT LOS ANGELES, UNVIERSITY OF than when compared to UNIVERSITY OF SOUTHERN CALIFORNIA, which may pose a challenge when attempting to implement this in a more general sense\McNair\Projects\Accelerators\Crunchbase Snapshot\accelerator keywords. In normalizing a string, strip "THE", "," and split words by spaces and compare each keyword from the two strings. Deciding on which strings to compare will be another issue - length py Matched output (within some range maybe885 mathces) could be an option. * Federal Grant Data XML Parser was rerun - same output textfiles: E:\McNair\Projects\Accelerators\Crunchbase Snapshot\Jeemin_885_accel_matches
====3/27/2017 MONDAY ''2PM-6PM''====04-14:* Writing code for university matches - decided to go through keys instead of each dataitem. Use keywords in each key to go through the dataitem - misspellings are currently unaccounted for.Loaded Federal Grants Data into database
====3/29/2017 WEDNESDAY''2PM-5PM''====* Troubled by the variety of cases 04- separating keys by keywords will not work favorably when it hits University of California vs. University of Southern California case - find a way to match University of Southern California first (more specific ones first) - but how to generalize...====4/12/2017 WEDNESDAY''9AM-12PM''====:
* Finishing up cleaning the columns for Federal Grant Data - NIH. The output excel files can be accessed at:
E:\McNair\Projects\Federal Grant Data\NIH\Grants
\COPY all_grants FROM 'Jeemin_combined_files 1986-2001.csv' WITH DELIMITER AS E'\t' HEADER NULL AS ''CSV
====42017-03-29:* Troubled by the variety of cases - separating keys by keywords will not work favorably when it hits University of California vs. University of Southern California case - find a way to match University of Southern California first (more specific ones first) - but how to generalize 2017-03-27:* Writing code for university matches - decided to go through keys instead of each dataitem. Use keywords in each key to go through the dataitem - misspellings are currently unaccounted for. 2017-03-24:* Discussed with Julia & Meghana about university keys to use to count # of occurrences, including aliases and misspellings* Thoughts: to use a scoring metric with a key of UNIVERSITY OF CALIFORNIA SYSTEM, it should have a 'better' score when compared to MATHEMATICAL SCIENCES PUBLISHERS C/O UNIVERSITY OF CALIFORNIA BERKELEY or CALIFORNIA AT LOS ANGELES, UNVIERSITY OF than when compared to UNIVERSITY OF SOUTHERN CALIFORNIA, which may pose a challenge when attempting to implement this in a more general sense. In normalizing a string, strip "THE", "," and split words by spaces and compare each keyword from the two strings. Deciding on which strings to compare will be another issue - length (within some range maybe) could be an option. * Federal Grant Data XML Parser was rerun - same output textfiles 2017-03-22:* Read string matching & calculating distance, below are relevant links* [http://www.cs.cmu.edu/~wcohen/postscript/ijcai-ws-2003.pdf]* [http://web.archive.org/web/20081224234350/http://www.dcs.shef.ac.uk/14~sam/stringmetrics.html] 2017 FRIDAY-03-22:* Talked to Julia about universal matcher, want to combine all University of California''2PMs to University of California, The Regents of* Converted crunchbase2013 data from mySQL to PostgreSQL, but having trouble with the last table - cb_relationships, complains about syntax error at or near some places -5PM''====but generally all tables exist in database called crunchbase* Loaded Federal Grants Grant Data XML Parser was run - the three output textfiles can be found in E:\McNair\Projects\Federal Grant Data \NSF 2017-03-16:* Further documented [[University Patent Matching]]* Finished writing XML Parser 2017-03-15:* Todo: write a wikipage on possible input/output info on string matcher* Wrote part of XML parser, extracted yearly data into E:\McNair\Projects\Federal Grant Data\NSF\NSF Extracted Data (up to year 2010) 2017-03-14:* Started pulling academy cases but there are too many cases to worry about, in terms of institution of interest. A document is located in E:\McNair\Projects\University Patents\academies_verify_cases.txt* Need Julia/Meghana to look through the hits and see which are relevant & extract pattern from there. * Having trouble outputting txt file without double quotes around every line. * Thinking that one text file should be output for all keywords instead of having one each, to avoid overlap (ex) COLLEGE and UNIVERSITY are both keywords; ALBERT EINSTEIN COLLEGE OF YESHIVA UNIVERSITY will be hit twice if it were counted as two separate instances, one accounting for COLLEGE and the other for UNIVERSITY) - either in the form of if-elseif statements or one big regex check. 2017-03-13:* For University Patent Data Matching - matched SCHOOL (output: E:\McNair\Projects\University Patents\school_pulled_from_assignee_list_USA) and matched INSTITUTE(output: E:\McNair\Projects\University Patents\institute_pulled_from_assignee_list_USA). * [[University Patent Matching]] * To be worked on later: Grant XML parsing & general name matcher 2017-03-08:* Wrote regex pattern that identifies all "university" matchings - can be found in E:\McNair\Projects\University Patents\university_pulled_from_assignee_list_USA -- is an output file* Talked to Sonia, but didn't come to solid conclusion on identifying whether key words associate with city or country by running a python function* Output sql tables from finished run of Jeemin_FDATrial_as_key_data_ripping.py * Ran through assigneelist_USA.txt to see how many different ways UNIVERSITY could be spelled wrong. There were many.* Tried to logic through creating a pattern that could catch all different versions of UNIVERSITY. Discuss further on whether UNIVERSITIES and those that include UNIVERSITIES but include INC in the end should be pulled as relevant information 2017-03-06:* [[Installing python in a database]]* Added building Python function section to [[Working with PostgreSQL]] at the bottom of the page.* Ran FDA Trial data ripping again, as the text output files were wiped. * Plan on discussing with Julia and Meghana again about pulling universities and other relevant institutions from the Assignee List USA. * Talked to Sonia about pulling city, state, zipcode information, hence python was installed in a database. Will work with Sonia on Wednesday afternoon and see how best a regex function could be implemented 2017-03-03:* Attempted to output sql tables 2017-03-01:* Started re-running Jeemin_FDATrial_as_key_data_ripping.py 2017-02-27:* Finished producing tables from Jeemin_FDATrial_as_key_data_ripping.py* Talked to Julia about LinkedIn data extracting - to be discussed further with Julia & Peter.* Started web crawler for Wikipedia - currently pulls Endowment, Academic staff, students, undergraduates, and postgraduates info found on Rice Wikipedia page. Can be found in : E:\McNair\Projects\University Patents\Jeemin_University_wikipedia_crawler.py
====4/17/2017 MONDAY''2PM-4PM''====02-24:* Continued working on producing multiple tables - first two are done. Was working on location, as there are multiple location tags per location.
====4/17/2017 WEDNESDAY''9AM-12PM''====02-22:* To pull accelerators: Wrote simple python regex-based script that ran on organizations dataFinished Jeemin_FDATrial_as_key_data_ripping. Code: py (E:\McNair\Projects\AcceleratorsFDA Trials\Crunchbase SnapshotJeemin_Project\accelerator keywordsJeemin_FDATrial_as_key_data_ripping.py Matched output (885 mathces) : , which outputs to E:\McNair\Projects\AcceleratorsFDA Trials\Crunchbase SnapshotJeemin_Project\Jeemin_885_accel_matchesgeneral_data_ripping_output.txt; TODO: output four different tables & replace the write in the same for-loop as going through each file
====9/11/2017 MONDAY''4PM-6PM''====02-20:* Ensured that documentation exists for Continued working on Jeemin_FDATrial_as_key_data_ripping.py to find tags and place all of those information in a list. The other zipcode file did not finish executing after 2+ hours of running it - considering the possibility of splitting the record file into smaller bits, or running the projects worked processing on last semestera faster machine.
====9/12/2017 TUESDAY''9AM-1002-17:40AM * Completed code for counting the number of occurrences for each unique zipcode. (currently titled & 1PM-2located:20PM & 4PM-5E:30PM''====* Clarified University Matching output file\McNair\Projects\FDA Trials\Jeemin_Project\Jeemin_Running_File.py). It has been running for 20+min because of the comprehensive XML data files.* Helped Christy Meanwhile started coding to create a dictionary with pdf-readerthe keys corresponding to each unique trial ID, mapped to every other information (location, sponsors, phase, capturing keywords in readable formatdrugs ...etc.) (currently titled & located: E:\McNair\Projects\FDA Trials\Jeemin_Project\Jeemin_FDATrial_as_key_data_ripping.py).
2017-02-15:* Discussed with Catherine what to do with FDA Trial data and decided to have a dictionary with zip-codes as keys and number of trials occurred in that zipcode as values.Was still attempting to loop through the files without the code having to exist in the same directory as the XML files. Plan to write to excel via tsv, with zip-code as one column and # of occurrence as the other.
====9/18/2017 MONDAY''4PM-6PM''====02-13:* Read documentation on PostGIS and tiger geocoder* Continue reading fromGoals (for trials): 1) Build ER Diagram 2) For each entity, get XML snippet 3) Build a parser/ripper for single file; the python parser can be found at: httpE://workshops.boundlessgeo.com/postgis-intro/joins.html\McNair\Projects\FDA Trials\Jeemin_Project
====9/19/2017 TUESDAY''9AM-10:40AM & 1PM02-208:20PM''====* Useful functions Attempted to come up with possible cases for spatial joins:locating the description of accelerators - pick up from extracting bodies of text from the about page (given that it exists)* [[Trial Data Project]]
'''sum(expression)'''2017-02-06: aggregate to return a sum for a set of records '''count(expression)''': aggregate to return the size of a set of records* Set up wikiPage & remote desktop. '''ST_Area(geometry)''' returns the area * Started working on python version of the polygons '''ST_AsText(geometry)''' returns WKT text '''ST_Contains(geometry A, geometry B)''' returns the true if geometry A contains geometry B '''ST_Distance(geometry A, geometry B)''' returns the minimum distance between geometry A and geometry B '''ST_DWithin(geometry A, geometry B, radius)''' returns the true if geometry A is radius distance or less from geometry B '''ST_GeomFromText(text)''' returns geometry '''ST_Intersects(geometry A, geometry B)''' returns the true if geometry A intersects geometry B '''ST_Length(linestring)''' returns the length of the linestring '''ST_Touches(geometry A, geometry B)''' returns the true if the boundary of geometry A touches geometry B '''ST_Within(geometry A, geometry B)''' returns the true if geometry A is within geometry B geometry_a '''&&''' geometry_b: Returns TRUE if A’s bounding box overlaps B’sweb crawler. geometry_a '''=''' geometry_b: Returns TRUE if A’s bounding box is the same as B’sSo far it successfully prints out a catchphrase/ description for one website. '''ST_SetSRID(geometry, srid)''': Sets the SRID To be worked on a geometry to a particular integer value. '''ST_SRID(geometry)'''The python file can be found in: Returns the spatial reference identifier for the ST_Geometry as defined in spatial_ref_sys table. '''ST_Transform(geometry, srid)'''E: Returns a new geometry with its coordinates transformed to the SRID referenced by the integer parameter\McNair\Projects\Accelerators\Python WebCrawler\webcrawlerpython.py
*Native functions for geogrphy:
'''ST_AsText(geography)''' returns text
'''ST_GeographyFromText(text)''' returns geography
'''ST_AsBinary(geography)''' returns bytea
'''ST_GeogFromWKB(bytea)''' returns geography
'''ST_AsSVG(geography)''' returns text
'''ST_AsGML(geography)''' returns text
'''ST_AsKML(geography)''' returns text
'''ST_AsGeoJson(geography)''' returns text
'''ST_Distance(geography, geography)''' returns double
'''ST_DWithin(geography, geography, float8)''' returns boolean
'''ST_Area(geography)''' returns double
'''ST_Length(geography)''' returns double
'''ST_Covers(geography, geography)''' returns boolean
'''ST_CoveredBy(geography, geography)''' returns boolean
'''ST_Intersects(geography, geography)''' returns boolean
'''ST_Buffer(geography, float8)''' returns geography [1]
'''ST_Intersection(geography, geography)''' returns geography [1]
* Continue reading from: http://workshops.boundlessgeo.com/postgis-intro/geography.html
[[Category:Work Log]]

Navigation menu