|Has title=Redesigning Patent Database
|Has owner=Shelby Bice
|Has keywords=Database, Patent
|Has notes= |Is dependent on= |Depends upon it=|Has project status= Active
Documentation on the process and eventual designs for the new patent database. Not to be confused with "Patent Data Restructure", which deals with condensing and cleaning USPTO assignees data.
Deliverables by end of semester :Design and build new patent database with core tables from data , add tables from Patent Data Restructure and Small Inventors Project, write thorough documentation on schema of new patent database and instructions on what documentation should be written when it is altered
TODO on 4/13/2017
Keep working on updating patent data
* How to parse patent data
* How to parse assignment data
* Also update documentation as I go
== '''Redesigning Patent Database''' ==
*[[Patent Data Restructure]]
*[[Small Inventors Project]] - uses Fee Status and Citations
*[[Medical Centers and Grants]] - uses patent assignees, specifically their zipcodes and organizations
'''Previous documentation on the patent database:'''
'''As of 3/21/2017 the most up-to-date database containing patent data is "patent" not "allpatent" or "allpatent_clone" and "patent" is the database that the the other patent data redesign project, Restructuring Patent Data (link above) is working with. '''
http://mcnair.bakerinstitute.org/wiki/Patent_Data_(Wiki_Page) Patent Data] - overview of what the data is and where it came from, probably starting point for changing documentation
http://mcnair.bakerinstitute.org/wiki/Patent Patent Database] - overview of schema of database (specifically, the database patent, which includes data from Harvard dataverse (originally stored in patentdata) and USPTO (patent_2015)
http://mcnair.bakerinstitute.org/wiki/USPTOAssigneesData USPTO Assignees Database] - enhances assignee info in patent database, also being redesigned
http://mcnair.bakerinstitute.org/wiki/Patent_Data_Issues Problems with Patent Database] - lists issues with current schema
http://mcnair.bakerinstitute.org/wiki/Data_Model Previous ER Diagram] - does not match up with schema described in [ http://mcnair.bakerinstitute.org/wiki/Patent Patent Database] and contains outdated list of what we want to pull from XML files
http://mcnair.bakerinstitute.org/wiki/Patent_Data_Processing_-_SQL_Steps Processing Patent Data] - states that allpatent is the newest database and an amalgamation of patentdata or patent_2015
== Description ==
== Development ==
Design will be built upon a relational database model. I will be referencing this article on database design as I develop the design (http://en.tekstenuitleg.net/articles/software/database-design-tutorial/one-to-many.html), and I will be creating an ER diagram using [https://erdplus.com/#/standalone ERDPlus] or [https://creately.com/app/?tempID=hqdgwjki1&login_type=demo# Creately].
== Current Design and Scripts Documentation ==
The following pages are relevant to how previous databases are built/how to build tables in the database:
http://mcnair.bakerinstitute.org/wiki/Harvard_Dataverse_Data Harvard Dataverse Data] - explains how to make tables from Harvard Dataverse data, where to find scripts, etc.
http://mcnair.bakerinstitute.org/wiki/USPTO_Bulk_Data_Processing USPTO Data] - explains how to make tables from USPTO data, where to find scripts, etc, specifically for assignment data.
http://mcnair.bakerinstitute.org/wiki/Patent_Data_Extraction_Scripts_(Tool) Patent Data Extraction] - explains locations of XML files and lists (at the bottom) where the Perl scripts can be found
http://mcnair.bakerinstitute.org/wiki/Patent_Data_Cleanup_ -_June_2016 Patent Data Cleanup] - explains changes that were made to clean up problems in the database allpatent as a result of merging the Harvard Dataverse data and the USPTO data
http://mcnair.bakerinstitute.org/wiki/Patent_Data_Processing_-_SQL_Steps Patent Data Processing - SQL Steps] - explains SQL needed to merge two existing databases, one that contained the Harvard Dataverse data and one that contained the USPTO data
Here at the instructions I'm developing for downloading, parsing, and hopefully adding new data to the database since the documentation is very sparse (can also be found under McNair/Projects/Redesigning Patent Database/Instructions on how to download patent data form USPTO bulk data.
*Change line 26 of script to reflect the year (name of the directory that you want to put the split files into the appropriate directory)
this will go ahead and put the files in the directory so you don't have to copy them.
perl xmlparser_4.5_4.4_4.3.pl E:\McNair\PatentData\Processed\2016
This will load the data into the database.
To use this parser, you will have to move all the files you would like into a directory (ex. 2016, for the files from year 2016). Then pass the path to the directory to the parser and it will parse the data and load it.
*The parser will open a connection to a database on the RDP's installation of postgres. It will then put the data directly into this database. Once complete. we manually move the tables to the dbase server's database (i.e. patent).
We now need to:
#Retrieve the data out of PatentUpdate and reprocess it so that it will fit into ''patent'' on the main db server
===For the USPTO Assignment Data===
Downloading the data ====
For USPTO Assignment Data, there is a script, under McNair/usptoAssignment, called USPTO_Assignee_Download, which lets a user pass it a text file (file ending in.txt) which contains the url(s) of the assignment data that needs to be downloaded. The script then downloads all the zip files available at that URL. An example called BaseUrls.txt (containing the url that you will probably be using to download the assignment data, unless you're downloading the data from this currrent year, which is in a different link) can be found in McNair/usptoAssignment It then places the downloaded zip files in "E:/McNair/usptoAssigneeData/name", where "name" is the name of the file. If you want to check which files have already been processed, check "McNair/usptoAssigneeData/Finished" to see the finished zip files. (In the future, this should be updated, if possible to specify which years to download, since all assignment data that is not from this current year is under one url, and we've already downloaded most of it.)
===For the USPTO Maintenance Fee Data===
Download the file manually from https://bulkdata.uspto.gov/data2/patent/maintenancefee/and
replace existing file in McNair/Patent Data/Maintenance Fee Data.
== Specifications of USPTO Data To Extract ==
Go to https://bulkdata.uspto.gov/ to bulk data from USPTO.
* Some tables that will later be deleted were included on the spreadsheet because their are currently being tables built to replace them
* May try to just move all the (twenty-something) "pto-" tables that have been created due to the "Restructuring Patent Data" project from "patent" to the new database
* Will work on understanding SQL for filling new database from this link next week
http://mcnair.bakerinstitute.org/wiki/Patent_Data_Processing_-_SQL_Steps and http://mcnair.bakerinstitute.org/wiki/Patent_Data_Cleanup_ -_June_2016
'''4/4/2017''' - Found all the pages on extracting data and making tables and databases
* Do not need to pull Harvard Dataverse data again, it's saved in CSV files on the bulk drive
* Started looking through DTDs for USPTO patent and assignment data to determine if there is extra information that we should extract from USPTO data.