<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://www.edegan.com/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=OliverC</id>
	<title>edegan.com - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://www.edegan.com/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=OliverC"/>
	<link rel="alternate" type="text/html" href="http://www.edegan.com/wiki/Special:Contributions/OliverC"/>
	<updated>2026-06-08T19:39:50Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Reproducible_Patent_Data&amp;diff=22277</id>
		<title>Reproducible Patent Data</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Reproducible_Patent_Data&amp;diff=22277"/>
		<updated>2017-12-05T05:34:30Z</updated>

		<summary type="html">&lt;p&gt;OliverC: Remove dead link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{McNair Projects&lt;br /&gt;
|Has Image=Uspto web logo.jpg&lt;br /&gt;
|Has title=Reproducible Patent Data&lt;br /&gt;
|Has owner=Oliver Chang&lt;br /&gt;
|Has start date=May 17&lt;br /&gt;
|Has project status=Active&lt;br /&gt;
|Does subsume=Redesigning Patent Database, Patent Assignment Data Restructure,&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A continuation of [[Redesigning Patent Database]] that aims to write faster, more centralized code to deal with data from the United States Patent and Trademark Office (USPTO). By having an end-to-end pipeline we can easily reproduce or update data without worrying about unintentional side effects or missing data.&lt;br /&gt;
&lt;br /&gt;
== Quickstart ==&lt;br /&gt;
&lt;br /&gt;
To get up and running with the code, do the following:&lt;br /&gt;
&lt;br /&gt;
# Clone the git project (link at end of page) to your user directory&lt;br /&gt;
# Launch IntelliJ with &amp;gt;= Java 8 and Maven configured (default version installed on the RDP is setup to do this)&lt;br /&gt;
# Open project in IntelliJ&lt;br /&gt;
# Create an empty database (see [[#Database]])&lt;br /&gt;
# Run the table creation scripts in &amp;lt;code&amp;gt;src/db/schemas/&amp;lt;/code&amp;gt; in your new database&lt;br /&gt;
# Modify the constant &amp;lt;code&amp;gt;DATABASE_NAME&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\postgres\DatabaseHelper.java&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run the Driver scripts in IntelliJ with the correct value for &amp;lt;code&amp;gt;DATA_DIRECTORY&amp;lt;/code&amp;gt; (or run &amp;lt;code&amp;gt;RunInitialImport.java&amp;lt;/code&amp;gt; which will do all of the data directories for that patent item type)&lt;br /&gt;
# [Take a really, really long lunch...in total should take no more than five hours to load data on RDP]&lt;br /&gt;
# Run scripts in &amp;lt;code&amp;gt;src/db/constraints&amp;lt;/code&amp;gt; to check data assumptions&lt;br /&gt;
# That's it!&lt;br /&gt;
&lt;br /&gt;
== Directory Layout ==&lt;br /&gt;
&lt;br /&gt;
=== Where is the Data? ===&lt;br /&gt;
&lt;br /&gt;
==== Directories ====&lt;br /&gt;
&lt;br /&gt;
All of the information for this project is located at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are several interesting directories:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;data/downloads/&amp;lt;/code&amp;gt; is USPTO bulkdata, unmodified straight from the scraper&lt;br /&gt;
* &amp;lt;code&amp;gt;data/extracts/&amp;lt;/code&amp;gt; is a directory of a strict subset of the information stored in &amp;lt;code&amp;gt;data/downloads/&amp;lt;/code&amp;gt;. It is the result of running a bulk 7-zip job on that directory to get everything unzipped in a flat data structure. Note that these files have the USPTO modified-by time since that metadata is stored in the zipfiles. To extract files in this nice format, select all of the zipfiles and setup an extraction job like in this [[media:7zip-params.png|screenshot]]&lt;br /&gt;
* &amp;lt;code&amp;gt;data/backups/&amp;lt;/code&amp;gt; is a 7zip'd backup of the corresponding directory in extracts&lt;br /&gt;
* &amp;lt;code&amp;gt;src/&amp;lt;/code&amp;gt; is the main code repository for the java project&lt;br /&gt;
&lt;br /&gt;
==== Input Files ====&lt;br /&gt;
&lt;br /&gt;
All of the text-only Red Book files for '''granted patents''' from 1976 to 2016, inclusive. To find a specific year's XML file, find it in&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\granted\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find application data''' from 2001 to 2016, inclusive, look in&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\applications\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find assignment data''', look in &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\granted\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find maintenance fee data''', look in &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\downloads\maintenance\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Where is the Code? ===&lt;br /&gt;
&lt;br /&gt;
The code has the same parent directory as the data, so it is at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src&amp;lt;/code&amp;gt;. You might notice a lot of single-entry directories; this is an idiomatic Java pattern that is used for package separation. If using IntelliJ or some other IDE, these directories are a bit less annoying.&lt;br /&gt;
&lt;br /&gt;
The development environment is Java 8 JDK, IntelliJ Ultimate IDE, Maven build tools, and git VCS.&lt;br /&gt;
&lt;br /&gt;
The git repository can be found at http://rdp.mcnaircenter.org/codebase/Repository/ReproduciblePatent&lt;br /&gt;
&lt;br /&gt;
==== Prior Art ====&lt;br /&gt;
&lt;br /&gt;
This tool is not so concerned with adding new functionality; rather, it aims to take a bunch of spread out Perl scripts and create a faster system that is easier to work with. As such, its functionality is largely stolen from those scripts:&lt;br /&gt;
&lt;br /&gt;
* Downloader: &amp;lt;code&amp;gt;E:\McNair\Software\Scripts\Patent\USPTO_Parser.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
* XML Splitter: &amp;lt;code&amp;gt;E:\McNair\PatentData\splitter.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
* XML Parsing: &amp;lt;code&amp;gt;E:\McNair\PatentData\Processed\xmlparser_4.5_4.4_4.3.pl&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;E:\McNair\PatentData\Processed\*.pm&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, I used several non-standard Java libraries listed below:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/mashape/unirest-java/ Unirest] for easy HTTP requests (MIT License)&lt;br /&gt;
* [https://github.com/google/guava Google Guava] for immutable collections and Stream utilities (Apache v2.0 License)&lt;br /&gt;
* [https://github.com/jhy/jsoup/ jsoup] for HTML parsing (MIT License)&lt;br /&gt;
* [http://commons.apache.org/proper/commons-codec/ Apache Commons Codec] (Apache v2.0 License)&lt;br /&gt;
* [http://commons.apache.org/proper/commons-lang/ Apache Commons Lang v3] (Apache v2.0 License)&lt;br /&gt;
* [https://mvnrepository.com/artifact/org.jetbrains/annotations/15.0 Jetbrains Annotations] for enhanced null checks (Apache v2.0 License)&lt;br /&gt;
* [http://search.maven.org/#artifactdetails%7Corg.postgresql%7Cpostgresql%7C42.1.1.jre7%7Cbundle PostgreSQL JDBC] (BSD 3-clause per https://github.com/pgjdbc/pgjdbc-jre7/blob/master/LICENSE)&lt;br /&gt;
&lt;br /&gt;
If using maven, these dependencies are listed and should automatically be setup.&lt;br /&gt;
&lt;br /&gt;
==== Using Code ====&lt;br /&gt;
&lt;br /&gt;
Any file with a line that says &amp;lt;code&amp;gt;public static void main(String[] args) {&amp;lt;/code&amp;gt; can be run as a standalone file. The easiest way to do this is to load the project and then the file in IntelliJ and click the little green play arrow next to this bit of code.&lt;br /&gt;
&lt;br /&gt;
The code can also be run via the standard &amp;lt;code&amp;gt;javac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;java&amp;lt;/code&amp;gt; commands but since this project has a complicated structure you end up having to run commands like &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;C:\Program Files\Java\jdk1.8.0_131\bin\java&amp;quot; &amp;quot;-javaagent:C:\Users\OliverC\IntelliJ IDEA 2017.1.3\lib\idea_rt.jar=62364:C:\Users\OliverC\IntelliJ IDEA 2017.1.3\bin&amp;quot; -Dfile.encoding=UTF-8 -classpath &amp;quot;[...contents truncated...];C:\Users\OliverC\.m2\repository\org\postgresql\postgresql\42.1.1\postgresql-42.1.1.jar&amp;quot; org.bakerinstitute.mcnair.uspto_assignments.XmlDriver&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to include all of the runtime dependencies and it's just not worth it.&lt;br /&gt;
&lt;br /&gt;
==== Altering Code ====&lt;br /&gt;
&lt;br /&gt;
* Use the IntelliJ command Reformat code (found in the menus at &amp;lt;code&amp;gt;Code &amp;gt; Reformat Code&amp;lt;/code&amp;gt;&lt;br /&gt;
* Use the optimize imports function found under the same menu&lt;br /&gt;
* Use spaces for indentation&lt;br /&gt;
* Loosely try to keep lines below 120 characters&lt;br /&gt;
* Commit changes to the Git remote repository &amp;quot;bonobo&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Schema Reconciliation ==&lt;br /&gt;
&lt;br /&gt;
For the work by Joe, see the [[Patent Schema Reconciliation]] page &lt;br /&gt;
&lt;br /&gt;
=== Patents (Granted) ===&lt;br /&gt;
&lt;br /&gt;
See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\examples\granted&amp;lt;/code&amp;gt; for extracted examples of what specific data is available for a sample of the data.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Granted Patent Data Formats&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Dates Used !! scope=&amp;quot;col&amp;quot; | Format !! scope=&amp;quot;col&amp;quot; | Location !! scope=&amp;quot;col&amp;quot; | Supported? !! scope=&amp;quot;col&amp;quot; | Utility !! scope=&amp;quot;col&amp;quot; | Reissue !! scope=&amp;quot;col&amp;quot; | Design !! scope=&amp;quot;col&amp;quot; | Plant&lt;br /&gt;
|-&lt;br /&gt;
|January 1976 to December 2001&lt;br /&gt;
|APS&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;del&amp;gt;January 2001 to December 2001&amp;lt;/del&amp;gt;&lt;br /&gt;
|&amp;lt;del&amp;gt;SGML&amp;lt;/del&amp;gt;&lt;br /&gt;
|Ignored; use concurrently recorded APS data&lt;br /&gt;
|No&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|-&lt;br /&gt;
|January 2002 to December 2004&lt;br /&gt;
|XML Version 2.5&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/blunderyears&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2005 to December 2005&lt;br /&gt;
|XML Version 4.0 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2006 to December 2006&lt;br /&gt;
|XML Version 4.1 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2007 to December 2012&lt;br /&gt;
|XML Version 4.2 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2013 to September 24, 2013&lt;br /&gt;
|XML Version 4.3 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|October 8, 2013 to December 2014&lt;br /&gt;
|XML Version 4.4 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2015 to December 2016&lt;br /&gt;
|XML Version 4.5 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== APS Rosetta Stone ===&lt;br /&gt;
&lt;br /&gt;
The Advanced Patent System (APS) is a fixed-width text format used to store historical patent grant data. The documentation for this sucks; there are pages missing at random. Luckily, we only care about the content contained here: [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]].&lt;br /&gt;
&lt;br /&gt;
It's worth mentioning that the APS contains an advanced text markup system for chemical formulae, basic text markup, tables, etc. that can lead to seemingly garbled text that is perfectly well-formed.&lt;br /&gt;
&lt;br /&gt;
==== APS Gotchas ====&lt;br /&gt;
&lt;br /&gt;
* PATN.WKU is the granted patent number. It is 7 digits while the spec promises 6 digits. The rightmost digit is a check digit modulus 11. See [[File:Aps-wku-modulus11.pdf]] for the words from the horse's mouth.&lt;br /&gt;
&lt;br /&gt;
=== Patents (Applications) ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Patent Application Data Formats&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Dates Used !! scope=&amp;quot;col&amp;quot; | Format !! scope=&amp;quot;col&amp;quot; | Location !! scope=&amp;quot;col&amp;quot; | Supported by Parser?&lt;br /&gt;
|-&lt;br /&gt;
|March 15, 2001 to December 2001&lt;br /&gt;
|XML Version 1.5&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Yes, for basic information, inventors, and correspondents&lt;br /&gt;
|-&lt;br /&gt;
|January 2002 to December 2004&lt;br /&gt;
|XML Version 1.6&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2005 to December 2005&lt;br /&gt;
|XML Version 4.0 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2006 to December 2006&lt;br /&gt;
|XML Version 4.1 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2007 to December 2012&lt;br /&gt;
|XML Version 4.2 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2013 to December 2014&lt;br /&gt;
|XML Version 4.3 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2015 to ''Present''&lt;br /&gt;
|XML Version 4.4 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Database ==&lt;br /&gt;
&lt;br /&gt;
Because there isn't a compelling reason not to, I used the existing PostgreSQL infrastructure on the RDP.&lt;br /&gt;
The &amp;quot;Java Way&amp;quot; of interacting with databases is the Java Database Connectivity API (JDBC), an implementation-agnostic API for interacting with databases.&lt;br /&gt;
This project uses the stock [https://jdbc.postgresql.org/ Postgres JDBC], version 42.1.1&lt;br /&gt;
&lt;br /&gt;
=== Create an empty database on RDP ===&lt;br /&gt;
&lt;br /&gt;
To create an empty database, run this command: &amp;lt;code&amp;gt;$ createdb --username=postgres database-name-goes-here # password is tabspaceenter&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstraction Layer ===&lt;br /&gt;
&lt;br /&gt;
Since writing raw SQL is a bit cumbersome and error-prone, I have added some abstraction layers that make it much easier to quickly add bulk data. By using Postgres's &amp;lt;code&amp;gt;CopyManager&amp;lt;/code&amp;gt; class, we buffer SQL copy commands in memory (as many as possible) and then flush these rows. To understand how the abstraction layers work, see the code in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\postgres&amp;lt;/code&amp;gt;. See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\models\GrantedPatent.java&amp;lt;/code&amp;gt; for '''an example of how to extend''' the abstraction layer to deal with more complex scenarios.&lt;br /&gt;
&lt;br /&gt;
=== New Table Checklist ===&lt;br /&gt;
&lt;br /&gt;
* Create schema DDL SQL code for the new table in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\db&amp;lt;/code&amp;gt;&lt;br /&gt;
* Run the schema creation&lt;br /&gt;
* Create an enum with the same names for attributes as in the DDL (case-insensitive! prefer all-caps screaming snake case)&lt;br /&gt;
* Create a class which subclasses &amp;lt;code&amp;gt;AbstractInsertableData&amp;lt;/code&amp;gt;&lt;br /&gt;
* Inside that class, create a static class which subclasses &amp;lt;code&amp;gt;AbstractTableMetadata&amp;lt;/code&amp;gt; and has the proper values for getTableName(), getStringColumns(), getIntColumns()&lt;br /&gt;
* (Optional) Implement builder pattern&lt;br /&gt;
* (Optional) Create a custom databasehelper for complex extras (see PatentApplication and GrantedPatent for examples)&lt;br /&gt;
* Write the data to the table (see DatabaseHelper for the pattern I use)&lt;br /&gt;
&lt;br /&gt;
== Address Data ==&lt;br /&gt;
&lt;br /&gt;
To get the most granular address data (street level, or at least postcode level) about who owns patents, the path is not so straightforward because off the complicated mapping of ownership to a granted patent.&lt;br /&gt;
This is the final part of this project that I am working on and it is all at the level of SQL.&lt;br /&gt;
See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\db\joins&amp;lt;/code&amp;gt; for my attempts to create a clean mapping.&lt;br /&gt;
Optimistically speaking, the data generated here should be superset of the data present in the Patent Assignment Data Restructure project.&lt;br /&gt;
&lt;br /&gt;
Note that as of the beginning of August 2017, this part '''has not been completed.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Intuition ===&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;assignments_longform.last_update_date&amp;lt;/code&amp;gt; to find current/latest (or first/earliest) date of assignment. Then match with &amp;lt;code&amp;gt;properties.docid&amp;lt;/code&amp;gt; on &amp;lt;code&amp;gt;reelno, frameno&amp;lt;/code&amp;gt; to find patent application id. With this mapping to granted patents, we can discover the details of the original granted patent. And with the right date and reelno and frameno, we can match to the &amp;lt;code&amp;gt;assignees&amp;lt;/code&amp;gt; table and get fine granularity addresses.&lt;br /&gt;
&lt;br /&gt;
== Related Pages ==&lt;br /&gt;
&lt;br /&gt;
* [[Redesign_Assignment_and_Patent_Database|Redesign Assignment and Patent Database, Fall 2017 by Shelby]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries, Summer 2017 by Oliver &amp;amp; Joe]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification, Summer 2017 based on tables from Assignment Data Restructure]]&lt;br /&gt;
* [[Patent_Assignment_Data_Restructure|Assignment Data Restructure, Spring 2017 by Marcela and Sonia]]&lt;br /&gt;
* [[Redesigning_Patent_Database|Redesigning Patent Database, Spring 2017 by Shelby]]&lt;br /&gt;
* [[Patent_Data_Cleanup_(June_2016)|Patent Data Cleanup, June 2016 by Marcela]]&lt;br /&gt;
* [[Patent_Data|Patent Data, Spring 2016 by Marcela]] &lt;br /&gt;
* [[Lex_Machina|Lex Machina]]&lt;br /&gt;
* [[USPTO_Patent_Litigation_Data|USPTO Patent Litigation Research Dataset by Ed]]&lt;br /&gt;
* [[Patent_Litigation_and_Review|Patent Litigation and Review by Marcela]]* [[Patent|Existing Database Schema]]&lt;br /&gt;
* [[Oliver_Chang_(Work_Log)|My Work Log]]&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&lt;br /&gt;
* Understanding Assignment Data: [https://www.uspto.gov/sites/default/files/documents/USPTO_Patents_Assignment_Dataset_WP.pdf USPTO Documentation on their cleanup of this data]&lt;br /&gt;
* [https://bulkdata.uspto.gov/data2/patent/grant/redbook/fulltext/1976/PatentFullTextAPSDoc_GreenBook.pdf USPTO Green Book (APS) Documentation]&lt;br /&gt;
* [https://bulkdata.uspto.gov/ USPTO Bulk Data Storage System (BDSS)]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Builder_pattern Builder Pattern in Object-Oriented Programming]&lt;br /&gt;
* [http://rdp.mcnaircenter.org/codebase/Repository/ReproduciblePatent Git Repository]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=22269</id>
		<title>Oliver Chang (Work Log)</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=22269"/>
		<updated>2017-12-03T03:19:15Z</updated>

		<summary type="html">&lt;p&gt;OliverC: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Projects'':&lt;br /&gt;
&lt;br /&gt;
* [[PostGIS_Installation|PostGIS Installation]]&lt;br /&gt;
* [[Reproducible_Patent_Data|Reproducible Patent Data]]&lt;br /&gt;
* [[Patent_Validity_Ideas_for_ML|Predictive Patent Validity Machine Learning Ideas]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification]]&lt;br /&gt;
* [[GPU_Build|GPU Computer Build]]&lt;br /&gt;
* [[Parallel_Enclosing_Circle_Algorithm|Parallel Enclosing Circle Algorithm]]&lt;br /&gt;
* [[Python_on_the_RDP|Python on the RDP]]&lt;br /&gt;
* [[Hierarchical_Clustering|Hierarchical Clustering]]&lt;br /&gt;
&lt;br /&gt;
''Uploads'':&lt;br /&gt;
&lt;br /&gt;
* [http://mcnair.bakerinstitute.org/wiki/File:Path-example.PNG File:Path-example.PNG]&lt;br /&gt;
** Screenshot of how to set the path environment variable&lt;br /&gt;
* [[File:PADX-File-Description-v2_Hague.pdf]]&lt;br /&gt;
** Describes patent kind codes (notably, what the hell X0 represents)&lt;br /&gt;
* [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]]&lt;br /&gt;
** Describes the fields in APS, their supposed character lengths, and if they are required/optional&lt;br /&gt;
* [[File:Aps-wku-modulus11.pdf]]&lt;br /&gt;
** Describes the layout of the check digit on magnetic tape&lt;br /&gt;
* [[File:Mod-11-algorithm.pdf]]&lt;br /&gt;
** Describes the algorithm used to calculate the check digit&lt;br /&gt;
&lt;br /&gt;
===Fall 2017=== &lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Oliver Chang]] [[Work Logs]] [[Oliver Chang (Work Log)|(log page)]]&lt;br /&gt;
&lt;br /&gt;
2017-12-02: communicated results of running ECA on 2 stddev table (not the error source); update db and web server software; check if scipy elision is ECA bug (it is not)&lt;br /&gt;
&lt;br /&gt;
2017-12-01: re-tasked Kyran with the hierarchical clustering algorithm implementation; create 2 standard deviations tables; freed up DB space&lt;br /&gt;
&lt;br /&gt;
2017-11-30: stub out implementation, add parsing code and mapping code...just need the meat of the algorithm now&lt;br /&gt;
&lt;br /&gt;
2017-11-27: documentation &amp;amp; bug finding on the parallel enclosing circle project; research hierarchical linkage approach&lt;br /&gt;
&lt;br /&gt;
2017-11-14: hand off work on xpathing to Shelby; walked through some program design decisions&lt;br /&gt;
&lt;br /&gt;
2017-11-13: finish javadoc of common/ and some trickier parts about downloading; added descriptions, results to one-off java/python scripts so that they actually make sense in context&lt;br /&gt;
&lt;br /&gt;
2017-11-10: add javadoc documentation to patent reproducibility project after forgetting half of the stuff myself&lt;br /&gt;
&lt;br /&gt;
2017-10-25: start ingestion of application xml files and deal with all the bugs which accompany that&lt;br /&gt;
&lt;br /&gt;
2017-10-21: create xml explorer script to mass-inspect xpaths (can be found at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\xml_schema_explorer&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
2017-10-20: re-run assignment import, review xpaths&lt;br /&gt;
&lt;br /&gt;
2017-10-19: repopulate patents database and create spreadsheet of assignment equivalencies&lt;br /&gt;
&lt;br /&gt;
2017-10-11: add issues to work on to the PECA wiki page; cleanup PECA git repo; start patent application code from granted patent code and start customizing to new domain&lt;br /&gt;
&lt;br /&gt;
2017-10-03: troubleshoot vc_circles.py and make command line interface a little nicer&lt;br /&gt;
&lt;br /&gt;
2017-10-02: discuss mapping strategies &amp;amp; investigate missing eca data&lt;br /&gt;
&lt;br /&gt;
2017-09-23: make Project/OliverLovesCircles usable and add initial splitting ability&lt;br /&gt;
&lt;br /&gt;
2017-09-22: goal setting &amp;amp; server debugging &amp;amp; meet with Yang&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Summer 2017=== &lt;br /&gt;
&lt;br /&gt;
2017-08-04: setup parallel instance python framework for job reporting; begin test run&lt;br /&gt;
&lt;br /&gt;
2017-08-02: finish up some documentation of the code and for the wiki&lt;br /&gt;
&lt;br /&gt;
2017-08-01: discuss with Abhi &amp;amp; Ed about alternatives to Java port because of algorithmic constants that would be hard to port; run test batches on python with addition of equality operators and convergence early stopping&lt;br /&gt;
&lt;br /&gt;
2017-07-31: sketch out parallel enclosing circle algorithm&lt;br /&gt;
&lt;br /&gt;
2017-07-18: field questions and data cleanup questions from Kerda &amp;amp; Joe &amp;amp; Adrian&lt;br /&gt;
&lt;br /&gt;
2017-07-19: try to remove duplicated records (esp. those with empty titles) which are preventing the addition of a unique constraint&lt;br /&gt;
&lt;br /&gt;
2017-07-18: run correspondent join on properties and correspondents table to match previous project; sync with Adrian and Abhi&lt;br /&gt;
&lt;br /&gt;
2017-07-17: redo db operations after cleaning up granted patent number bugs&lt;br /&gt;
&lt;br /&gt;
2017-07-13: powwow about parallelizing Enclosing Circle Algorithm; sketch out what to do for the rest of the summer; work more on joins&lt;br /&gt;
&lt;br /&gt;
2017-07-12: generate some example data illustrating the difficulty of joining different tables&lt;br /&gt;
&lt;br /&gt;
2017-07-11: track down some bugs that happen very rarely and were missed in the initial qa phase&lt;br /&gt;
&lt;br /&gt;
2017-07-07: catch up on documentation&lt;br /&gt;
&lt;br /&gt;
2017-07-06: try (unsuccessfully) to understand docid mapping...create exploration scripts&lt;br /&gt;
&lt;br /&gt;
2017-07-05: add invention title to proper grouping of assignment properties; optimize XML parsing&lt;br /&gt;
&lt;br /&gt;
2017-06-30: powwow with James, Abhi, Ed about optimization issues; discuss document ids, X0 etc with Ed; pinpoint issues with APS doc numbers (see Repro Pat Dat#Gotchas) for more info&lt;br /&gt;
&lt;br /&gt;
2017-06-29: add logging of copy commands, more chattiness to scripts, debug assignment data failure&lt;br /&gt;
&lt;br /&gt;
2017-06-28: create examples for expansion to plant, reissue, design patent collection; start optimizing xml&lt;br /&gt;
&lt;br /&gt;
2017-06-27: write SQL to replicate assignees, extract postcodes for ongoing projects&lt;br /&gt;
&lt;br /&gt;
2017-06-26: speedup code, abstract in-memory file splitters to avoid repetition and some weird edge cases&lt;br /&gt;
&lt;br /&gt;
2017-06-25: create mappings for APS, assignment properties, XML 2.5 for data import; run data imports for granted data&lt;br /&gt;
&lt;br /&gt;
2017-06-23: cleanup hacky models with a better set of abstractions; cleanup IDE warnings; redefine patent-address mapping&lt;br /&gt;
&lt;br /&gt;
2017-06-22: create postcode&amp;lt;-&amp;gt;patent table&lt;br /&gt;
&lt;br /&gt;
2017-06-29: document granted patent queries and equivalencies&lt;br /&gt;
&lt;br /&gt;
2017-06-20: sketch out APS driver; discuss patent id problem; further document with evidence the zipcode data validity&lt;br /&gt;
&lt;br /&gt;
2017-06-19: skim address regular expressions; cursory investigation of patent table&lt;br /&gt;
&lt;br /&gt;
2017-06-16: create method of getting all data into the database, whether it likes it or not; copy over assignments, granted data using new scheme&lt;br /&gt;
&lt;br /&gt;
2017-06-15: add more robust error reporting, fix race conditions; build out assignment driver; build out fee event driver; add error logging&lt;br /&gt;
&lt;br /&gt;
2017-06-14: migrate bulk inserts to copy command; refresh on address data and start in on that; convert processor to multi-threaded application&lt;br /&gt;
&lt;br /&gt;
2017-06-13: spot check SQL tables; fix broken final case endlessly looping; investigate smarter insert methods&lt;br /&gt;
&lt;br /&gt;
2017-06-12: add XML printer, use it to inspect applications; extend BaseScraper to fetch patent application data; add applications documentation to my project page; add CREATE of other tables&lt;br /&gt;
&lt;br /&gt;
2017-06-08: add foreign key inserts; create pretty printer for XML analysis&lt;br /&gt;
&lt;br /&gt;
2017-06-07: finalize DB abstraction layer; migrate code to bulk inserts; upgrade webserver software and do optimization on RDP postgres with Ed&lt;br /&gt;
&lt;br /&gt;
2017-06-06: add jdbc; create basic schema; add db interaction; schedule meeting for later in the week&lt;br /&gt;
&lt;br /&gt;
2017-06-05: look into postgresql; refersh on postgis; add some notes to the Enclosing Circle Algorithm page&lt;br /&gt;
&lt;br /&gt;
2017-06-01: add RDP git remote; add more documentation to wiki page; refactor downloader scripts; start creation of tooling for interacting with data&lt;br /&gt;
&lt;br /&gt;
2017-05-31: finish copy-pasting attributes into the wiki page; retroactively fill out work log; meet with Ed to discuss next steps&lt;br /&gt;
&lt;br /&gt;
2017-05-30: update documentation on wiki, restructure large binary files to have more hierarchy instead of a flat listing at the root&lt;br /&gt;
&lt;br /&gt;
2017-05-29: expand to APS; expand to raw assignment data&lt;br /&gt;
&lt;br /&gt;
2017-05-27: expand to maintenance fee data&lt;br /&gt;
&lt;br /&gt;
2017-05-26: create models, translate &amp;lt;code&amp;gt;xmlparser*.pl&amp;lt;/code&amp;gt; file into Java; start using builder pattern&lt;br /&gt;
&lt;br /&gt;
2017-05-25: sketch out OO design of project; download bulk data&lt;br /&gt;
&lt;br /&gt;
2017-05-24: move wiki pages around; start git repository for project&lt;br /&gt;
&lt;br /&gt;
2017-05-21: discuss technical details of previous work with Ed&lt;br /&gt;
&lt;br /&gt;
2017-05-08: cleanup dead links on wiki and start reading about previous work; discuss current project status with Ed&lt;br /&gt;
&lt;br /&gt;
2017-05-04: setup wiki account, rdp account, database training&lt;br /&gt;
&lt;br /&gt;
[[Category:Work Log]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=22255</id>
		<title>Oliver Chang (Work Log)</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=22255"/>
		<updated>2017-12-01T18:40:18Z</updated>

		<summary type="html">&lt;p&gt;OliverC: /* Fall 2017 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Projects'':&lt;br /&gt;
&lt;br /&gt;
* [[PostGIS_Installation|PostGIS Installation]]&lt;br /&gt;
* [[Reproducible_Patent_Data|Reproducible Patent Data]]&lt;br /&gt;
* [[Patent_Validity_Ideas_for_ML|Predictive Patent Validity Machine Learning Ideas]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification]]&lt;br /&gt;
* [[GPU_Build|GPU Computer Build]]&lt;br /&gt;
* [[Parallel_Enclosing_Circle_Algorithm|Parallel Enclosing Circle Algorithm]]&lt;br /&gt;
* [[Python_on_the_RDP|Python on the RDP]]&lt;br /&gt;
&lt;br /&gt;
''Uploads'':&lt;br /&gt;
&lt;br /&gt;
* [http://mcnair.bakerinstitute.org/wiki/File:Path-example.PNG File:Path-example.PNG]&lt;br /&gt;
** Screenshot of how to set the path environment variable&lt;br /&gt;
* [[File:PADX-File-Description-v2_Hague.pdf]]&lt;br /&gt;
** Describes patent kind codes (notably, what the hell X0 represents)&lt;br /&gt;
* [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]]&lt;br /&gt;
** Describes the fields in APS, their supposed character lengths, and if they are required/optional&lt;br /&gt;
* [[File:Aps-wku-modulus11.pdf]]&lt;br /&gt;
** Describes the layout of the check digit on magnetic tape&lt;br /&gt;
* [[File:Mod-11-algorithm.pdf]]&lt;br /&gt;
** Describes the algorithm used to calculate the check digit&lt;br /&gt;
&lt;br /&gt;
===Fall 2017=== &lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Oliver Chang]] [[Work Logs]] [[Oliver Chang (Work Log)|(log page)]]&lt;br /&gt;
&lt;br /&gt;
2017-12-01: TBD&lt;br /&gt;
&lt;br /&gt;
2017-11-30: stub out implementation, add parsing code and mapping code...just need the meat of the algorithm now&lt;br /&gt;
&lt;br /&gt;
2017-11-27: documentation &amp;amp; bug finding on the parallel enclosing circle project; research hierarchical linkage approach&lt;br /&gt;
&lt;br /&gt;
2017-11-14: hand off work on xpathing to Shelby; walked through some program design decisions&lt;br /&gt;
&lt;br /&gt;
2017-11-13: finish javadoc of common/ and some trickier parts about downloading; added descriptions, results to one-off java/python scripts so that they actually make sense in context&lt;br /&gt;
&lt;br /&gt;
2017-11-10: add javadoc documentation to patent reproducibility project after forgetting half of the stuff myself&lt;br /&gt;
&lt;br /&gt;
2017-10-25: start ingestion of application xml files and deal with all the bugs which accompany that&lt;br /&gt;
&lt;br /&gt;
2017-10-21: create xml explorer script to mass-inspect xpaths (can be found at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\xml_schema_explorer&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
2017-10-20: re-run assignment import, review xpaths&lt;br /&gt;
&lt;br /&gt;
2017-10-19: repopulate patents database and create spreadsheet of assignment equivalencies&lt;br /&gt;
&lt;br /&gt;
2017-10-11: add issues to work on to the PECA wiki page; cleanup PECA git repo; start patent application code from granted patent code and start customizing to new domain&lt;br /&gt;
&lt;br /&gt;
2017-10-03: troubleshoot vc_circles.py and make command line interface a little nicer&lt;br /&gt;
&lt;br /&gt;
2017-10-02: discuss mapping strategies &amp;amp; investigate missing eca data&lt;br /&gt;
&lt;br /&gt;
2017-09-23: make Project/OliverLovesCircles usable and add initial splitting ability&lt;br /&gt;
&lt;br /&gt;
2017-09-22: goal setting &amp;amp; server debugging &amp;amp; meet with Yang&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Summer 2017=== &lt;br /&gt;
&lt;br /&gt;
2017-08-04: setup parallel instance python framework for job reporting; begin test run&lt;br /&gt;
&lt;br /&gt;
2017-08-02: finish up some documentation of the code and for the wiki&lt;br /&gt;
&lt;br /&gt;
2017-08-01: discuss with Abhi &amp;amp; Ed about alternatives to Java port because of algorithmic constants that would be hard to port; run test batches on python with addition of equality operators and convergence early stopping&lt;br /&gt;
&lt;br /&gt;
2017-07-31: sketch out parallel enclosing circle algorithm&lt;br /&gt;
&lt;br /&gt;
2017-07-18: field questions and data cleanup questions from Kerda &amp;amp; Joe &amp;amp; Adrian&lt;br /&gt;
&lt;br /&gt;
2017-07-19: try to remove duplicated records (esp. those with empty titles) which are preventing the addition of a unique constraint&lt;br /&gt;
&lt;br /&gt;
2017-07-18: run correspondent join on properties and correspondents table to match previous project; sync with Adrian and Abhi&lt;br /&gt;
&lt;br /&gt;
2017-07-17: redo db operations after cleaning up granted patent number bugs&lt;br /&gt;
&lt;br /&gt;
2017-07-13: powwow about parallelizing Enclosing Circle Algorithm; sketch out what to do for the rest of the summer; work more on joins&lt;br /&gt;
&lt;br /&gt;
2017-07-12: generate some example data illustrating the difficulty of joining different tables&lt;br /&gt;
&lt;br /&gt;
2017-07-11: track down some bugs that happen very rarely and were missed in the initial qa phase&lt;br /&gt;
&lt;br /&gt;
2017-07-07: catch up on documentation&lt;br /&gt;
&lt;br /&gt;
2017-07-06: try (unsuccessfully) to understand docid mapping...create exploration scripts&lt;br /&gt;
&lt;br /&gt;
2017-07-05: add invention title to proper grouping of assignment properties; optimize XML parsing&lt;br /&gt;
&lt;br /&gt;
2017-06-30: powwow with James, Abhi, Ed about optimization issues; discuss document ids, X0 etc with Ed; pinpoint issues with APS doc numbers (see Repro Pat Dat#Gotchas) for more info&lt;br /&gt;
&lt;br /&gt;
2017-06-29: add logging of copy commands, more chattiness to scripts, debug assignment data failure&lt;br /&gt;
&lt;br /&gt;
2017-06-28: create examples for expansion to plant, reissue, design patent collection; start optimizing xml&lt;br /&gt;
&lt;br /&gt;
2017-06-27: write SQL to replicate assignees, extract postcodes for ongoing projects&lt;br /&gt;
&lt;br /&gt;
2017-06-26: speedup code, abstract in-memory file splitters to avoid repetition and some weird edge cases&lt;br /&gt;
&lt;br /&gt;
2017-06-25: create mappings for APS, assignment properties, XML 2.5 for data import; run data imports for granted data&lt;br /&gt;
&lt;br /&gt;
2017-06-23: cleanup hacky models with a better set of abstractions; cleanup IDE warnings; redefine patent-address mapping&lt;br /&gt;
&lt;br /&gt;
2017-06-22: create postcode&amp;lt;-&amp;gt;patent table&lt;br /&gt;
&lt;br /&gt;
2017-06-29: document granted patent queries and equivalencies&lt;br /&gt;
&lt;br /&gt;
2017-06-20: sketch out APS driver; discuss patent id problem; further document with evidence the zipcode data validity&lt;br /&gt;
&lt;br /&gt;
2017-06-19: skim address regular expressions; cursory investigation of patent table&lt;br /&gt;
&lt;br /&gt;
2017-06-16: create method of getting all data into the database, whether it likes it or not; copy over assignments, granted data using new scheme&lt;br /&gt;
&lt;br /&gt;
2017-06-15: add more robust error reporting, fix race conditions; build out assignment driver; build out fee event driver; add error logging&lt;br /&gt;
&lt;br /&gt;
2017-06-14: migrate bulk inserts to copy command; refresh on address data and start in on that; convert processor to multi-threaded application&lt;br /&gt;
&lt;br /&gt;
2017-06-13: spot check SQL tables; fix broken final case endlessly looping; investigate smarter insert methods&lt;br /&gt;
&lt;br /&gt;
2017-06-12: add XML printer, use it to inspect applications; extend BaseScraper to fetch patent application data; add applications documentation to my project page; add CREATE of other tables&lt;br /&gt;
&lt;br /&gt;
2017-06-08: add foreign key inserts; create pretty printer for XML analysis&lt;br /&gt;
&lt;br /&gt;
2017-06-07: finalize DB abstraction layer; migrate code to bulk inserts; upgrade webserver software and do optimization on RDP postgres with Ed&lt;br /&gt;
&lt;br /&gt;
2017-06-06: add jdbc; create basic schema; add db interaction; schedule meeting for later in the week&lt;br /&gt;
&lt;br /&gt;
2017-06-05: look into postgresql; refersh on postgis; add some notes to the Enclosing Circle Algorithm page&lt;br /&gt;
&lt;br /&gt;
2017-06-01: add RDP git remote; add more documentation to wiki page; refactor downloader scripts; start creation of tooling for interacting with data&lt;br /&gt;
&lt;br /&gt;
2017-05-31: finish copy-pasting attributes into the wiki page; retroactively fill out work log; meet with Ed to discuss next steps&lt;br /&gt;
&lt;br /&gt;
2017-05-30: update documentation on wiki, restructure large binary files to have more hierarchy instead of a flat listing at the root&lt;br /&gt;
&lt;br /&gt;
2017-05-29: expand to APS; expand to raw assignment data&lt;br /&gt;
&lt;br /&gt;
2017-05-27: expand to maintenance fee data&lt;br /&gt;
&lt;br /&gt;
2017-05-26: create models, translate &amp;lt;code&amp;gt;xmlparser*.pl&amp;lt;/code&amp;gt; file into Java; start using builder pattern&lt;br /&gt;
&lt;br /&gt;
2017-05-25: sketch out OO design of project; download bulk data&lt;br /&gt;
&lt;br /&gt;
2017-05-24: move wiki pages around; start git repository for project&lt;br /&gt;
&lt;br /&gt;
2017-05-21: discuss technical details of previous work with Ed&lt;br /&gt;
&lt;br /&gt;
2017-05-08: cleanup dead links on wiki and start reading about previous work; discuss current project status with Ed&lt;br /&gt;
&lt;br /&gt;
2017-05-04: setup wiki account, rdp account, database training&lt;br /&gt;
&lt;br /&gt;
[[Category:Work Log]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Installing_TensorFlow&amp;diff=22030</id>
		<title>Installing TensorFlow</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Installing_TensorFlow&amp;diff=22030"/>
		<updated>2017-11-22T00:40:25Z</updated>

		<summary type="html">&lt;p&gt;OliverC: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Currently installed with Anaconda Python 3.&lt;br /&gt;
&lt;br /&gt;
https://stackoverflow.com/questions/36355073/upgrading-numpy-fails-with-permission-denied-error&lt;br /&gt;
&lt;br /&gt;
https://www.tensorflow.org/install/install_windows&lt;br /&gt;
&lt;br /&gt;
with cpu support only&lt;br /&gt;
&lt;br /&gt;
https://www.tensorflow.org/install/install_linux&lt;br /&gt;
&lt;br /&gt;
need to logoff other users via server manager&lt;br /&gt;
&lt;br /&gt;
https://stackoverflow.com/questions/46499808/pip-throws-typeerror-parse-got-an-unexpected-keyword-argument-transport-enco#_=_&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Installing_TensorFlow&amp;diff=22029</id>
		<title>Installing TensorFlow</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Installing_TensorFlow&amp;diff=22029"/>
		<updated>2017-11-22T00:39:32Z</updated>

		<summary type="html">&lt;p&gt;OliverC: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;https://stackoverflow.com/questions/36355073/upgrading-numpy-fails-with-permission-denied-error&lt;br /&gt;
&lt;br /&gt;
https://www.tensorflow.org/install/install_windows&lt;br /&gt;
&lt;br /&gt;
with cpu support only&lt;br /&gt;
&lt;br /&gt;
https://www.tensorflow.org/install/install_linux&lt;br /&gt;
&lt;br /&gt;
https://stackoverflow.com/questions/46499808/pip-throws-typeerror-parse-got-an-unexpected-keyword-argument-transport-enco#_=_&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Installing_TensorFlow&amp;diff=22016</id>
		<title>Installing TensorFlow</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Installing_TensorFlow&amp;diff=22016"/>
		<updated>2017-11-21T20:21:22Z</updated>

		<summary type="html">&lt;p&gt;OliverC: Created page with &amp;quot;https://stackoverflow.com/questions/36355073/upgrading-numpy-fails-with-permission-denied-error  https://www.tensorflow.org/install/install_windows  with cpu support only  htt...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;https://stackoverflow.com/questions/36355073/upgrading-numpy-fails-with-permission-denied-error&lt;br /&gt;
&lt;br /&gt;
https://www.tensorflow.org/install/install_windows&lt;br /&gt;
&lt;br /&gt;
with cpu support only&lt;br /&gt;
&lt;br /&gt;
https://www.tensorflow.org/install/install_linux&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=22013</id>
		<title>Oliver Chang (Work Log)</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=22013"/>
		<updated>2017-11-21T19:08:58Z</updated>

		<summary type="html">&lt;p&gt;OliverC: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Projects'':&lt;br /&gt;
&lt;br /&gt;
* [[PostGIS_Installation|PostGIS Installation]]&lt;br /&gt;
* [[Reproducible_Patent_Data|Reproducible Patent Data]]&lt;br /&gt;
* [[Patent_Validity_Ideas_for_ML|Predictive Patent Validity Machine Learning Ideas]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification]]&lt;br /&gt;
* [[GPU_Build|GPU Computer Build]]&lt;br /&gt;
* [[Parallel_Enclosing_Circle_Algorithm|Parallel Enclosing Circle Algorithm]]&lt;br /&gt;
* [[Python_on_the_RDP|Python on the RDP]]&lt;br /&gt;
&lt;br /&gt;
''Uploads'':&lt;br /&gt;
&lt;br /&gt;
* [http://mcnair.bakerinstitute.org/wiki/File:Path-example.PNG File:Path-example.PNG]&lt;br /&gt;
** Screenshot of how to set the path environment variable&lt;br /&gt;
* [[File:PADX-File-Description-v2_Hague.pdf]]&lt;br /&gt;
** Describes patent kind codes (notably, what the hell X0 represents)&lt;br /&gt;
* [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]]&lt;br /&gt;
** Describes the fields in APS, their supposed character lengths, and if they are required/optional&lt;br /&gt;
* [[File:Aps-wku-modulus11.pdf]]&lt;br /&gt;
** Describes the layout of the check digit on magnetic tape&lt;br /&gt;
* [[File:Mod-11-algorithm.pdf]]&lt;br /&gt;
** Describes the algorithm used to calculate the check digit&lt;br /&gt;
&lt;br /&gt;
===Fall 2017=== &lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Oliver Chang]] [[Work Logs]] [[Oliver Chang (Work Log)|(log page)]]&lt;br /&gt;
&lt;br /&gt;
2017-11-14: hand off work on xpathing to Shelby; walked through some program design decisions&lt;br /&gt;
&lt;br /&gt;
2017-11-13: finish javadoc of common/ and some trickier parts about downloading; added descriptions, results to one-off java/python scripts so that they actually make sense in context&lt;br /&gt;
&lt;br /&gt;
2017-11-10: add javadoc documentation to patent reproducibility project after forgetting half of the stuff myself&lt;br /&gt;
&lt;br /&gt;
2017-10-25: start ingestion of application xml files and deal with all the bugs which accompany that&lt;br /&gt;
&lt;br /&gt;
2017-10-21: create xml explorer script to mass-inspect xpaths (can be found at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\xml_schema_explorer&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
2017-10-20: re-run assignment import, review xpaths&lt;br /&gt;
&lt;br /&gt;
2017-10-19: repopulate patents database and create spreadsheet of assignment equivalencies&lt;br /&gt;
&lt;br /&gt;
2017-10-11: add issues to work on to the PECA wiki page; cleanup PECA git repo; start patent application code from granted patent code and start customizing to new domain&lt;br /&gt;
&lt;br /&gt;
2017-10-03: troubleshoot vc_circles.py and make command line interface a little nicer&lt;br /&gt;
&lt;br /&gt;
2017-10-02: discuss mapping strategies &amp;amp; investigate missing eca data&lt;br /&gt;
&lt;br /&gt;
2017-09-23: make Project/OliverLovesCircles usable and add initial splitting ability&lt;br /&gt;
&lt;br /&gt;
2017-09-22: goal setting &amp;amp; server debugging &amp;amp; meet with Yang&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Summer 2017=== &lt;br /&gt;
&lt;br /&gt;
2017-08-04: setup parallel instance python framework for job reporting; begin test run&lt;br /&gt;
&lt;br /&gt;
2017-08-02: finish up some documentation of the code and for the wiki&lt;br /&gt;
&lt;br /&gt;
2017-08-01: discuss with Abhi &amp;amp; Ed about alternatives to Java port because of algorithmic constants that would be hard to port; run test batches on python with addition of equality operators and convergence early stopping&lt;br /&gt;
&lt;br /&gt;
2017-07-31: sketch out parallel enclosing circle algorithm&lt;br /&gt;
&lt;br /&gt;
2017-07-18: field questions and data cleanup questions from Kerda &amp;amp; Joe &amp;amp; Adrian&lt;br /&gt;
&lt;br /&gt;
2017-07-19: try to remove duplicated records (esp. those with empty titles) which are preventing the addition of a unique constraint&lt;br /&gt;
&lt;br /&gt;
2017-07-18: run correspondent join on properties and correspondents table to match previous project; sync with Adrian and Abhi&lt;br /&gt;
&lt;br /&gt;
2017-07-17: redo db operations after cleaning up granted patent number bugs&lt;br /&gt;
&lt;br /&gt;
2017-07-13: powwow about parallelizing Enclosing Circle Algorithm; sketch out what to do for the rest of the summer; work more on joins&lt;br /&gt;
&lt;br /&gt;
2017-07-12: generate some example data illustrating the difficulty of joining different tables&lt;br /&gt;
&lt;br /&gt;
2017-07-11: track down some bugs that happen very rarely and were missed in the initial qa phase&lt;br /&gt;
&lt;br /&gt;
2017-07-07: catch up on documentation&lt;br /&gt;
&lt;br /&gt;
2017-07-06: try (unsuccessfully) to understand docid mapping...create exploration scripts&lt;br /&gt;
&lt;br /&gt;
2017-07-05: add invention title to proper grouping of assignment properties; optimize XML parsing&lt;br /&gt;
&lt;br /&gt;
2017-06-30: powwow with James, Abhi, Ed about optimization issues; discuss document ids, X0 etc with Ed; pinpoint issues with APS doc numbers (see Repro Pat Dat#Gotchas) for more info&lt;br /&gt;
&lt;br /&gt;
2017-06-29: add logging of copy commands, more chattiness to scripts, debug assignment data failure&lt;br /&gt;
&lt;br /&gt;
2017-06-28: create examples for expansion to plant, reissue, design patent collection; start optimizing xml&lt;br /&gt;
&lt;br /&gt;
2017-06-27: write SQL to replicate assignees, extract postcodes for ongoing projects&lt;br /&gt;
&lt;br /&gt;
2017-06-26: speedup code, abstract in-memory file splitters to avoid repetition and some weird edge cases&lt;br /&gt;
&lt;br /&gt;
2017-06-25: create mappings for APS, assignment properties, XML 2.5 for data import; run data imports for granted data&lt;br /&gt;
&lt;br /&gt;
2017-06-23: cleanup hacky models with a better set of abstractions; cleanup IDE warnings; redefine patent-address mapping&lt;br /&gt;
&lt;br /&gt;
2017-06-22: create postcode&amp;lt;-&amp;gt;patent table&lt;br /&gt;
&lt;br /&gt;
2017-06-29: document granted patent queries and equivalencies&lt;br /&gt;
&lt;br /&gt;
2017-06-20: sketch out APS driver; discuss patent id problem; further document with evidence the zipcode data validity&lt;br /&gt;
&lt;br /&gt;
2017-06-19: skim address regular expressions; cursory investigation of patent table&lt;br /&gt;
&lt;br /&gt;
2017-06-16: create method of getting all data into the database, whether it likes it or not; copy over assignments, granted data using new scheme&lt;br /&gt;
&lt;br /&gt;
2017-06-15: add more robust error reporting, fix race conditions; build out assignment driver; build out fee event driver; add error logging&lt;br /&gt;
&lt;br /&gt;
2017-06-14: migrate bulk inserts to copy command; refresh on address data and start in on that; convert processor to multi-threaded application&lt;br /&gt;
&lt;br /&gt;
2017-06-13: spot check SQL tables; fix broken final case endlessly looping; investigate smarter insert methods&lt;br /&gt;
&lt;br /&gt;
2017-06-12: add XML printer, use it to inspect applications; extend BaseScraper to fetch patent application data; add applications documentation to my project page; add CREATE of other tables&lt;br /&gt;
&lt;br /&gt;
2017-06-08: add foreign key inserts; create pretty printer for XML analysis&lt;br /&gt;
&lt;br /&gt;
2017-06-07: finalize DB abstraction layer; migrate code to bulk inserts; upgrade webserver software and do optimization on RDP postgres with Ed&lt;br /&gt;
&lt;br /&gt;
2017-06-06: add jdbc; create basic schema; add db interaction; schedule meeting for later in the week&lt;br /&gt;
&lt;br /&gt;
2017-06-05: look into postgresql; refersh on postgis; add some notes to the Enclosing Circle Algorithm page&lt;br /&gt;
&lt;br /&gt;
2017-06-01: add RDP git remote; add more documentation to wiki page; refactor downloader scripts; start creation of tooling for interacting with data&lt;br /&gt;
&lt;br /&gt;
2017-05-31: finish copy-pasting attributes into the wiki page; retroactively fill out work log; meet with Ed to discuss next steps&lt;br /&gt;
&lt;br /&gt;
2017-05-30: update documentation on wiki, restructure large binary files to have more hierarchy instead of a flat listing at the root&lt;br /&gt;
&lt;br /&gt;
2017-05-29: expand to APS; expand to raw assignment data&lt;br /&gt;
&lt;br /&gt;
2017-05-27: expand to maintenance fee data&lt;br /&gt;
&lt;br /&gt;
2017-05-26: create models, translate &amp;lt;code&amp;gt;xmlparser*.pl&amp;lt;/code&amp;gt; file into Java; start using builder pattern&lt;br /&gt;
&lt;br /&gt;
2017-05-25: sketch out OO design of project; download bulk data&lt;br /&gt;
&lt;br /&gt;
2017-05-24: move wiki pages around; start git repository for project&lt;br /&gt;
&lt;br /&gt;
2017-05-21: discuss technical details of previous work with Ed&lt;br /&gt;
&lt;br /&gt;
2017-05-08: cleanup dead links on wiki and start reading about previous work; discuss current project status with Ed&lt;br /&gt;
&lt;br /&gt;
2017-05-04: setup wiki account, rdp account, database training&lt;br /&gt;
&lt;br /&gt;
[[Category:Work Log]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=22012</id>
		<title>Oliver Chang (Work Log)</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=22012"/>
		<updated>2017-11-21T19:07:46Z</updated>

		<summary type="html">&lt;p&gt;OliverC: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Projects'':&lt;br /&gt;
&lt;br /&gt;
* [[PostGIS_Installation|PostGIS Installation]]&lt;br /&gt;
* [[Reproducible_Patent_Data|Reproducible Patent Data]]&lt;br /&gt;
* [[Patent_Validity_Ideas_for_ML|Predictive Patent Validity Machine Learning Ideas]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification]]&lt;br /&gt;
* [[GPU_Build|GPU Computer Build]]&lt;br /&gt;
* [[Parallel_Enclosing_Circle_Algorithm|Parallel Enclosing Circle Algorithm]]&lt;br /&gt;
&lt;br /&gt;
''Uploads'':&lt;br /&gt;
&lt;br /&gt;
* [http://mcnair.bakerinstitute.org/wiki/File:Path-example.PNG File:Path-example.PNG]&lt;br /&gt;
** Screenshot of how to set the path environment variable&lt;br /&gt;
* [[File:PADX-File-Description-v2_Hague.pdf]]&lt;br /&gt;
** Describes patent kind codes (notably, what the hell X0 represents)&lt;br /&gt;
* [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]]&lt;br /&gt;
** Describes the fields in APS, their supposed character lengths, and if they are required/optional&lt;br /&gt;
* [[File:Aps-wku-modulus11.pdf]]&lt;br /&gt;
** Describes the layout of the check digit on magnetic tape&lt;br /&gt;
* [[File:Mod-11-algorithm.pdf]]&lt;br /&gt;
** Describes the algorithm used to calculate the check digit&lt;br /&gt;
&lt;br /&gt;
===Fall 2017=== &lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Oliver Chang]] [[Work Logs]] [[Oliver Chang (Work Log)|(log page)]]&lt;br /&gt;
&lt;br /&gt;
2017-11-14: hand off work on xpathing to Shelby; walked through some program design decisions&lt;br /&gt;
&lt;br /&gt;
2017-11-13: finish javadoc of common/ and some trickier parts about downloading; added descriptions, results to one-off java/python scripts so that they actually make sense in context&lt;br /&gt;
&lt;br /&gt;
2017-11-10: add javadoc documentation to patent reproducibility project after forgetting half of the stuff myself&lt;br /&gt;
&lt;br /&gt;
2017-10-25: start ingestion of application xml files and deal with all the bugs which accompany that&lt;br /&gt;
&lt;br /&gt;
2017-10-21: create xml explorer script to mass-inspect xpaths (can be found at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\xml_schema_explorer&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
2017-10-20: re-run assignment import, review xpaths&lt;br /&gt;
&lt;br /&gt;
2017-10-19: repopulate patents database and create spreadsheet of assignment equivalencies&lt;br /&gt;
&lt;br /&gt;
2017-10-11: add issues to work on to the PECA wiki page; cleanup PECA git repo; start patent application code from granted patent code and start customizing to new domain&lt;br /&gt;
&lt;br /&gt;
2017-10-03: troubleshoot vc_circles.py and make command line interface a little nicer&lt;br /&gt;
&lt;br /&gt;
2017-10-02: discuss mapping strategies &amp;amp; investigate missing eca data&lt;br /&gt;
&lt;br /&gt;
2017-09-23: make Project/OliverLovesCircles usable and add initial splitting ability&lt;br /&gt;
&lt;br /&gt;
2017-09-22: goal setting &amp;amp; server debugging &amp;amp; meet with Yang&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Summer 2017=== &lt;br /&gt;
&lt;br /&gt;
2017-08-04: setup parallel instance python framework for job reporting; begin test run&lt;br /&gt;
&lt;br /&gt;
2017-08-02: finish up some documentation of the code and for the wiki&lt;br /&gt;
&lt;br /&gt;
2017-08-01: discuss with Abhi &amp;amp; Ed about alternatives to Java port because of algorithmic constants that would be hard to port; run test batches on python with addition of equality operators and convergence early stopping&lt;br /&gt;
&lt;br /&gt;
2017-07-31: sketch out parallel enclosing circle algorithm&lt;br /&gt;
&lt;br /&gt;
2017-07-18: field questions and data cleanup questions from Kerda &amp;amp; Joe &amp;amp; Adrian&lt;br /&gt;
&lt;br /&gt;
2017-07-19: try to remove duplicated records (esp. those with empty titles) which are preventing the addition of a unique constraint&lt;br /&gt;
&lt;br /&gt;
2017-07-18: run correspondent join on properties and correspondents table to match previous project; sync with Adrian and Abhi&lt;br /&gt;
&lt;br /&gt;
2017-07-17: redo db operations after cleaning up granted patent number bugs&lt;br /&gt;
&lt;br /&gt;
2017-07-13: powwow about parallelizing Enclosing Circle Algorithm; sketch out what to do for the rest of the summer; work more on joins&lt;br /&gt;
&lt;br /&gt;
2017-07-12: generate some example data illustrating the difficulty of joining different tables&lt;br /&gt;
&lt;br /&gt;
2017-07-11: track down some bugs that happen very rarely and were missed in the initial qa phase&lt;br /&gt;
&lt;br /&gt;
2017-07-07: catch up on documentation&lt;br /&gt;
&lt;br /&gt;
2017-07-06: try (unsuccessfully) to understand docid mapping...create exploration scripts&lt;br /&gt;
&lt;br /&gt;
2017-07-05: add invention title to proper grouping of assignment properties; optimize XML parsing&lt;br /&gt;
&lt;br /&gt;
2017-06-30: powwow with James, Abhi, Ed about optimization issues; discuss document ids, X0 etc with Ed; pinpoint issues with APS doc numbers (see Repro Pat Dat#Gotchas) for more info&lt;br /&gt;
&lt;br /&gt;
2017-06-29: add logging of copy commands, more chattiness to scripts, debug assignment data failure&lt;br /&gt;
&lt;br /&gt;
2017-06-28: create examples for expansion to plant, reissue, design patent collection; start optimizing xml&lt;br /&gt;
&lt;br /&gt;
2017-06-27: write SQL to replicate assignees, extract postcodes for ongoing projects&lt;br /&gt;
&lt;br /&gt;
2017-06-26: speedup code, abstract in-memory file splitters to avoid repetition and some weird edge cases&lt;br /&gt;
&lt;br /&gt;
2017-06-25: create mappings for APS, assignment properties, XML 2.5 for data import; run data imports for granted data&lt;br /&gt;
&lt;br /&gt;
2017-06-23: cleanup hacky models with a better set of abstractions; cleanup IDE warnings; redefine patent-address mapping&lt;br /&gt;
&lt;br /&gt;
2017-06-22: create postcode&amp;lt;-&amp;gt;patent table&lt;br /&gt;
&lt;br /&gt;
2017-06-29: document granted patent queries and equivalencies&lt;br /&gt;
&lt;br /&gt;
2017-06-20: sketch out APS driver; discuss patent id problem; further document with evidence the zipcode data validity&lt;br /&gt;
&lt;br /&gt;
2017-06-19: skim address regular expressions; cursory investigation of patent table&lt;br /&gt;
&lt;br /&gt;
2017-06-16: create method of getting all data into the database, whether it likes it or not; copy over assignments, granted data using new scheme&lt;br /&gt;
&lt;br /&gt;
2017-06-15: add more robust error reporting, fix race conditions; build out assignment driver; build out fee event driver; add error logging&lt;br /&gt;
&lt;br /&gt;
2017-06-14: migrate bulk inserts to copy command; refresh on address data and start in on that; convert processor to multi-threaded application&lt;br /&gt;
&lt;br /&gt;
2017-06-13: spot check SQL tables; fix broken final case endlessly looping; investigate smarter insert methods&lt;br /&gt;
&lt;br /&gt;
2017-06-12: add XML printer, use it to inspect applications; extend BaseScraper to fetch patent application data; add applications documentation to my project page; add CREATE of other tables&lt;br /&gt;
&lt;br /&gt;
2017-06-08: add foreign key inserts; create pretty printer for XML analysis&lt;br /&gt;
&lt;br /&gt;
2017-06-07: finalize DB abstraction layer; migrate code to bulk inserts; upgrade webserver software and do optimization on RDP postgres with Ed&lt;br /&gt;
&lt;br /&gt;
2017-06-06: add jdbc; create basic schema; add db interaction; schedule meeting for later in the week&lt;br /&gt;
&lt;br /&gt;
2017-06-05: look into postgresql; refersh on postgis; add some notes to the Enclosing Circle Algorithm page&lt;br /&gt;
&lt;br /&gt;
2017-06-01: add RDP git remote; add more documentation to wiki page; refactor downloader scripts; start creation of tooling for interacting with data&lt;br /&gt;
&lt;br /&gt;
2017-05-31: finish copy-pasting attributes into the wiki page; retroactively fill out work log; meet with Ed to discuss next steps&lt;br /&gt;
&lt;br /&gt;
2017-05-30: update documentation on wiki, restructure large binary files to have more hierarchy instead of a flat listing at the root&lt;br /&gt;
&lt;br /&gt;
2017-05-29: expand to APS; expand to raw assignment data&lt;br /&gt;
&lt;br /&gt;
2017-05-27: expand to maintenance fee data&lt;br /&gt;
&lt;br /&gt;
2017-05-26: create models, translate &amp;lt;code&amp;gt;xmlparser*.pl&amp;lt;/code&amp;gt; file into Java; start using builder pattern&lt;br /&gt;
&lt;br /&gt;
2017-05-25: sketch out OO design of project; download bulk data&lt;br /&gt;
&lt;br /&gt;
2017-05-24: move wiki pages around; start git repository for project&lt;br /&gt;
&lt;br /&gt;
2017-05-21: discuss technical details of previous work with Ed&lt;br /&gt;
&lt;br /&gt;
2017-05-08: cleanup dead links on wiki and start reading about previous work; discuss current project status with Ed&lt;br /&gt;
&lt;br /&gt;
2017-05-04: setup wiki account, rdp account, database training&lt;br /&gt;
&lt;br /&gt;
[[Category:Work Log]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Python_on_the_RDP&amp;diff=22011</id>
		<title>Python on the RDP</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Python_on_the_RDP&amp;diff=22011"/>
		<updated>2017-11-21T19:07:21Z</updated>

		<summary type="html">&lt;p&gt;OliverC: /* Simultaneously Registering Python 2 and 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are two production versions of Python: Python 2 and Python 3.&lt;br /&gt;
&lt;br /&gt;
* You can run scripts written for 3 with 2 if you import the special package [https://docs.python.org/2/library/__future__.html &amp;lt;code&amp;gt;__future__&amp;lt;/code&amp;gt;]&lt;br /&gt;
* You can run scripts written for 2 with 3 if you run the script [https://docs.python.org/3.1/library/2to3.html &amp;lt;code&amp;gt;2to3&amp;lt;/code&amp;gt;]&lt;br /&gt;
* '''All new code should be written in Python 3''' for library support and maintainability reasons. If for no other reason know that it uses UTF-8 as the default encoding and so it makes your life easier in every possible way.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Many Python modules are actually 90% low-level C code with the remaining 10% a python wrapper.&lt;br /&gt;
That means to install these modules (e.g. numpy, scipy, hdf) you need to have all of the development libraries and compiler tools to compile the C stuff.&lt;br /&gt;
Enter [https://anaconda.org/ Anaconda], a widely used repackaging of Python for Windows that comes with most of the libraries you'll ever need.&lt;br /&gt;
In addition, they've made it easy to have two installs of Python running at once.&lt;br /&gt;
&lt;br /&gt;
* Python2&lt;br /&gt;
** Python 2.7.14 via Anaconda2 5.0.1 for 64-bit&lt;br /&gt;
** Located at &amp;lt;code&amp;gt;C:\ProgramData\Anaconda2&amp;lt;/code&amp;gt;*&lt;br /&gt;
&lt;br /&gt;
* Python3&lt;br /&gt;
** Python 3.6.3 via Anaconda3 5.0.1 for 64-bit&lt;br /&gt;
** Located at &amp;lt;code&amp;gt;C:\ProgramData\Anaconda3&amp;lt;/code&amp;gt;*&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; Note that Anaconda is not installed in &amp;lt;code&amp;gt;C:\Program Files\AnacondaN&amp;lt;/code&amp;gt; intentionally. Spaces in the path lead to a bunch of unpredictable errors.&lt;br /&gt;
&lt;br /&gt;
=== Manually Defining Explicit Python Binary Executables ===&lt;br /&gt;
&lt;br /&gt;
A common practice is to have a bunch of specific Python commands to force explicit behavior. For example on Ubuntu, you can choose from running python, python2, python 2.6, python2.7, python3, python3.5, etc in the shell. To emulate this behavior, copy and paste the &amp;lt;code&amp;gt;python.exe&amp;lt;/code&amp;gt; and rename it to &amp;lt;code&amp;gt;pythonN.exe&amp;lt;/code&amp;gt; where N is whatever specific version you copied. The same applies to scripts you want to use like &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt;: copy-and-paste the file to a more explicit name.&lt;br /&gt;
&lt;br /&gt;
Path is evaluated with the first entries taking precedence. Thus, whichever version of Python you want to be the default should be listed at the leftmost position on the string. You can also just delete the unregistered python.exe to achieve the same result.&lt;br /&gt;
&lt;br /&gt;
=== ArcMap Aside ===&lt;br /&gt;
&lt;br /&gt;
Note that by default, ESRI ArcMap maintains a separate Python 2 installation at &amp;lt;code&amp;gt;C:\Python27&amp;lt;/code&amp;gt;. Just ignore this...it is not to be used for development or as the environment for running programs other than ArcMap.&lt;br /&gt;
&lt;br /&gt;
== Simultaneously Registering Python 2 and 3 ==&lt;br /&gt;
&lt;br /&gt;
Anaconda automatically &amp;quot;registers&amp;quot; the separate installations for use with some development environments. It does not (by default) add executables to the Path system environment. We will add the base &amp;lt;code&amp;gt;AnacondaN/*&amp;lt;/code&amp;gt; files and &amp;lt;code&amp;gt;AnacondaN/Scripts/*&amp;lt;/code&amp;gt; to the path as so:&lt;br /&gt;
&lt;br /&gt;
# Right-click on the Windows icon in the bottom left&lt;br /&gt;
# Select System&lt;br /&gt;
# Select Advanced System Settings (must be administrator)&lt;br /&gt;
# Select the Advanced Tab&lt;br /&gt;
# Select &amp;quot;Environment Variables...&amp;quot; at the bottom right&lt;br /&gt;
# Add semicolon-separated directories to Path in the lower box labeled System Variables&lt;br /&gt;
&lt;br /&gt;
See [http://mcnair.bakerinstitute.org/wiki/File:Path-example.PNG File:Path-example.PNG] for an example.&lt;br /&gt;
&lt;br /&gt;
== Explicitly Running a Specific Python Version ==&lt;br /&gt;
&lt;br /&gt;
All of these are valid ways to run Python on the RDP:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;python&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;python2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;python3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, running &amp;lt;code&amp;gt;python&amp;lt;/code&amp;gt; will run Python 2. '''This behavior should not be relied on.''' On most other systems, Python 3 is the default instead.&lt;br /&gt;
&lt;br /&gt;
It is the same case with &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; which can be run via &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pip2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pip3&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=22010</id>
		<title>Oliver Chang (Work Log)</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=22010"/>
		<updated>2017-11-21T19:02:13Z</updated>

		<summary type="html">&lt;p&gt;OliverC: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Projects'':&lt;br /&gt;
&lt;br /&gt;
* [[PostGIS_Installation|PostGIS Installation]]&lt;br /&gt;
* [[Reproducible_Patent_Data|Reproducible Patent Data]]&lt;br /&gt;
* [[Patent_Validity_Ideas_for_ML|Predictive Patent Validity Machine Learning Ideas]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification]]&lt;br /&gt;
* [[GPU_Build|GPU Computer Build]]&lt;br /&gt;
* [[Parallel_Enclosing_Circle_Algorithm|Parallel Enclosing Circle Algorithm]]&lt;br /&gt;
&lt;br /&gt;
''Uploads'':&lt;br /&gt;
&lt;br /&gt;
* [[File:Path-example.PNG]]&lt;br /&gt;
** Screenshot of how to set the path environment variable&lt;br /&gt;
* [[File:PADX-File-Description-v2_Hague.pdf]]&lt;br /&gt;
** Describes patent kind codes (notably, what the hell X0 represents)&lt;br /&gt;
* [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]]&lt;br /&gt;
** Describes the fields in APS, their supposed character lengths, and if they are required/optional&lt;br /&gt;
* [[File:Aps-wku-modulus11.pdf]]&lt;br /&gt;
** Describes the layout of the check digit on magnetic tape&lt;br /&gt;
* [[File:Mod-11-algorithm.pdf]]&lt;br /&gt;
** Describes the algorithm used to calculate the check digit&lt;br /&gt;
&lt;br /&gt;
===Fall 2017=== &lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Oliver Chang]] [[Work Logs]] [[Oliver Chang (Work Log)|(log page)]]&lt;br /&gt;
&lt;br /&gt;
2017-11-14: hand off work on xpathing to Shelby; walked through some program design decisions&lt;br /&gt;
&lt;br /&gt;
2017-11-13: finish javadoc of common/ and some trickier parts about downloading; added descriptions, results to one-off java/python scripts so that they actually make sense in context&lt;br /&gt;
&lt;br /&gt;
2017-11-10: add javadoc documentation to patent reproducibility project after forgetting half of the stuff myself&lt;br /&gt;
&lt;br /&gt;
2017-10-25: start ingestion of application xml files and deal with all the bugs which accompany that&lt;br /&gt;
&lt;br /&gt;
2017-10-21: create xml explorer script to mass-inspect xpaths (can be found at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\xml_schema_explorer&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
2017-10-20: re-run assignment import, review xpaths&lt;br /&gt;
&lt;br /&gt;
2017-10-19: repopulate patents database and create spreadsheet of assignment equivalencies&lt;br /&gt;
&lt;br /&gt;
2017-10-11: add issues to work on to the PECA wiki page; cleanup PECA git repo; start patent application code from granted patent code and start customizing to new domain&lt;br /&gt;
&lt;br /&gt;
2017-10-03: troubleshoot vc_circles.py and make command line interface a little nicer&lt;br /&gt;
&lt;br /&gt;
2017-10-02: discuss mapping strategies &amp;amp; investigate missing eca data&lt;br /&gt;
&lt;br /&gt;
2017-09-23: make Project/OliverLovesCircles usable and add initial splitting ability&lt;br /&gt;
&lt;br /&gt;
2017-09-22: goal setting &amp;amp; server debugging &amp;amp; meet with Yang&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Summer 2017=== &lt;br /&gt;
&lt;br /&gt;
2017-08-04: setup parallel instance python framework for job reporting; begin test run&lt;br /&gt;
&lt;br /&gt;
2017-08-02: finish up some documentation of the code and for the wiki&lt;br /&gt;
&lt;br /&gt;
2017-08-01: discuss with Abhi &amp;amp; Ed about alternatives to Java port because of algorithmic constants that would be hard to port; run test batches on python with addition of equality operators and convergence early stopping&lt;br /&gt;
&lt;br /&gt;
2017-07-31: sketch out parallel enclosing circle algorithm&lt;br /&gt;
&lt;br /&gt;
2017-07-18: field questions and data cleanup questions from Kerda &amp;amp; Joe &amp;amp; Adrian&lt;br /&gt;
&lt;br /&gt;
2017-07-19: try to remove duplicated records (esp. those with empty titles) which are preventing the addition of a unique constraint&lt;br /&gt;
&lt;br /&gt;
2017-07-18: run correspondent join on properties and correspondents table to match previous project; sync with Adrian and Abhi&lt;br /&gt;
&lt;br /&gt;
2017-07-17: redo db operations after cleaning up granted patent number bugs&lt;br /&gt;
&lt;br /&gt;
2017-07-13: powwow about parallelizing Enclosing Circle Algorithm; sketch out what to do for the rest of the summer; work more on joins&lt;br /&gt;
&lt;br /&gt;
2017-07-12: generate some example data illustrating the difficulty of joining different tables&lt;br /&gt;
&lt;br /&gt;
2017-07-11: track down some bugs that happen very rarely and were missed in the initial qa phase&lt;br /&gt;
&lt;br /&gt;
2017-07-07: catch up on documentation&lt;br /&gt;
&lt;br /&gt;
2017-07-06: try (unsuccessfully) to understand docid mapping...create exploration scripts&lt;br /&gt;
&lt;br /&gt;
2017-07-05: add invention title to proper grouping of assignment properties; optimize XML parsing&lt;br /&gt;
&lt;br /&gt;
2017-06-30: powwow with James, Abhi, Ed about optimization issues; discuss document ids, X0 etc with Ed; pinpoint issues with APS doc numbers (see Repro Pat Dat#Gotchas) for more info&lt;br /&gt;
&lt;br /&gt;
2017-06-29: add logging of copy commands, more chattiness to scripts, debug assignment data failure&lt;br /&gt;
&lt;br /&gt;
2017-06-28: create examples for expansion to plant, reissue, design patent collection; start optimizing xml&lt;br /&gt;
&lt;br /&gt;
2017-06-27: write SQL to replicate assignees, extract postcodes for ongoing projects&lt;br /&gt;
&lt;br /&gt;
2017-06-26: speedup code, abstract in-memory file splitters to avoid repetition and some weird edge cases&lt;br /&gt;
&lt;br /&gt;
2017-06-25: create mappings for APS, assignment properties, XML 2.5 for data import; run data imports for granted data&lt;br /&gt;
&lt;br /&gt;
2017-06-23: cleanup hacky models with a better set of abstractions; cleanup IDE warnings; redefine patent-address mapping&lt;br /&gt;
&lt;br /&gt;
2017-06-22: create postcode&amp;lt;-&amp;gt;patent table&lt;br /&gt;
&lt;br /&gt;
2017-06-29: document granted patent queries and equivalencies&lt;br /&gt;
&lt;br /&gt;
2017-06-20: sketch out APS driver; discuss patent id problem; further document with evidence the zipcode data validity&lt;br /&gt;
&lt;br /&gt;
2017-06-19: skim address regular expressions; cursory investigation of patent table&lt;br /&gt;
&lt;br /&gt;
2017-06-16: create method of getting all data into the database, whether it likes it or not; copy over assignments, granted data using new scheme&lt;br /&gt;
&lt;br /&gt;
2017-06-15: add more robust error reporting, fix race conditions; build out assignment driver; build out fee event driver; add error logging&lt;br /&gt;
&lt;br /&gt;
2017-06-14: migrate bulk inserts to copy command; refresh on address data and start in on that; convert processor to multi-threaded application&lt;br /&gt;
&lt;br /&gt;
2017-06-13: spot check SQL tables; fix broken final case endlessly looping; investigate smarter insert methods&lt;br /&gt;
&lt;br /&gt;
2017-06-12: add XML printer, use it to inspect applications; extend BaseScraper to fetch patent application data; add applications documentation to my project page; add CREATE of other tables&lt;br /&gt;
&lt;br /&gt;
2017-06-08: add foreign key inserts; create pretty printer for XML analysis&lt;br /&gt;
&lt;br /&gt;
2017-06-07: finalize DB abstraction layer; migrate code to bulk inserts; upgrade webserver software and do optimization on RDP postgres with Ed&lt;br /&gt;
&lt;br /&gt;
2017-06-06: add jdbc; create basic schema; add db interaction; schedule meeting for later in the week&lt;br /&gt;
&lt;br /&gt;
2017-06-05: look into postgresql; refersh on postgis; add some notes to the Enclosing Circle Algorithm page&lt;br /&gt;
&lt;br /&gt;
2017-06-01: add RDP git remote; add more documentation to wiki page; refactor downloader scripts; start creation of tooling for interacting with data&lt;br /&gt;
&lt;br /&gt;
2017-05-31: finish copy-pasting attributes into the wiki page; retroactively fill out work log; meet with Ed to discuss next steps&lt;br /&gt;
&lt;br /&gt;
2017-05-30: update documentation on wiki, restructure large binary files to have more hierarchy instead of a flat listing at the root&lt;br /&gt;
&lt;br /&gt;
2017-05-29: expand to APS; expand to raw assignment data&lt;br /&gt;
&lt;br /&gt;
2017-05-27: expand to maintenance fee data&lt;br /&gt;
&lt;br /&gt;
2017-05-26: create models, translate &amp;lt;code&amp;gt;xmlparser*.pl&amp;lt;/code&amp;gt; file into Java; start using builder pattern&lt;br /&gt;
&lt;br /&gt;
2017-05-25: sketch out OO design of project; download bulk data&lt;br /&gt;
&lt;br /&gt;
2017-05-24: move wiki pages around; start git repository for project&lt;br /&gt;
&lt;br /&gt;
2017-05-21: discuss technical details of previous work with Ed&lt;br /&gt;
&lt;br /&gt;
2017-05-08: cleanup dead links on wiki and start reading about previous work; discuss current project status with Ed&lt;br /&gt;
&lt;br /&gt;
2017-05-04: setup wiki account, rdp account, database training&lt;br /&gt;
&lt;br /&gt;
[[Category:Work Log]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Python_on_the_RDP&amp;diff=22009</id>
		<title>Python on the RDP</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Python_on_the_RDP&amp;diff=22009"/>
		<updated>2017-11-21T19:01:18Z</updated>

		<summary type="html">&lt;p&gt;OliverC: /* Simultaneously Registering Python 2 and 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are two production versions of Python: Python 2 and Python 3.&lt;br /&gt;
&lt;br /&gt;
* You can run scripts written for 3 with 2 if you import the special package [https://docs.python.org/2/library/__future__.html &amp;lt;code&amp;gt;__future__&amp;lt;/code&amp;gt;]&lt;br /&gt;
* You can run scripts written for 2 with 3 if you run the script [https://docs.python.org/3.1/library/2to3.html &amp;lt;code&amp;gt;2to3&amp;lt;/code&amp;gt;]&lt;br /&gt;
* '''All new code should be written in Python 3''' for library support and maintainability reasons. If for no other reason know that it uses UTF-8 as the default encoding and so it makes your life easier in every possible way.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Many Python modules are actually 90% low-level C code with the remaining 10% a python wrapper.&lt;br /&gt;
That means to install these modules (e.g. numpy, scipy, hdf) you need to have all of the development libraries and compiler tools to compile the C stuff.&lt;br /&gt;
Enter [https://anaconda.org/ Anaconda], a widely used repackaging of Python for Windows that comes with most of the libraries you'll ever need.&lt;br /&gt;
In addition, they've made it easy to have two installs of Python running at once.&lt;br /&gt;
&lt;br /&gt;
* Python2&lt;br /&gt;
** Python 2.7.14 via Anaconda2 5.0.1 for 64-bit&lt;br /&gt;
** Located at &amp;lt;code&amp;gt;C:\ProgramData\Anaconda2&amp;lt;/code&amp;gt;*&lt;br /&gt;
&lt;br /&gt;
* Python3&lt;br /&gt;
** Python 3.6.3 via Anaconda3 5.0.1 for 64-bit&lt;br /&gt;
** Located at &amp;lt;code&amp;gt;C:\ProgramData\Anaconda3&amp;lt;/code&amp;gt;*&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; Note that Anaconda is not installed in &amp;lt;code&amp;gt;C:\Program Files\AnacondaN&amp;lt;/code&amp;gt; intentionally. Spaces in the path lead to a bunch of unpredictable errors.&lt;br /&gt;
&lt;br /&gt;
=== Manually Defining Explicit Python Binary Executables ===&lt;br /&gt;
&lt;br /&gt;
A common practice is to have a bunch of specific Python commands to force explicit behavior. For example on Ubuntu, you can choose from running python, python2, python 2.6, python2.7, python3, python3.5, etc in the shell. To emulate this behavior, copy and paste the &amp;lt;code&amp;gt;python.exe&amp;lt;/code&amp;gt; and rename it to &amp;lt;code&amp;gt;pythonN.exe&amp;lt;/code&amp;gt; where N is whatever specific version you copied. The same applies to scripts you want to use like &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt;: copy-and-paste the file to a more explicit name.&lt;br /&gt;
&lt;br /&gt;
Path is evaluated with the first entries taking precedence. Thus, whichever version of Python you want to be the default should be listed at the leftmost position on the string. You can also just delete the unregistered python.exe to achieve the same result.&lt;br /&gt;
&lt;br /&gt;
=== ArcMap Aside ===&lt;br /&gt;
&lt;br /&gt;
Note that by default, ESRI ArcMap maintains a separate Python 2 installation at &amp;lt;code&amp;gt;C:\Python27&amp;lt;/code&amp;gt;. Just ignore this...it is not to be used for development or as the environment for running programs other than ArcMap.&lt;br /&gt;
&lt;br /&gt;
== Simultaneously Registering Python 2 and 3 ==&lt;br /&gt;
&lt;br /&gt;
Anaconda automatically &amp;quot;registers&amp;quot; the separate installations for use with some development environments. It does not (by default) add executables to the Path system environment. We will add the base &amp;lt;code&amp;gt;AnacondaN/*&amp;lt;/code&amp;gt; files and &amp;lt;code&amp;gt;AnacondaN/Scripts/*&amp;lt;/code&amp;gt; to the path as so:&lt;br /&gt;
&lt;br /&gt;
# Right-click on the Windows icon in the bottom left&lt;br /&gt;
# Select System&lt;br /&gt;
# Select Advanced System Settings (must be administrator)&lt;br /&gt;
# Select the Advanced Tab&lt;br /&gt;
# Select &amp;quot;Environment Variables...&amp;quot; at the bottom right&lt;br /&gt;
# Add semicolon-separated directories to Path in the lower box labeled System Variables&lt;br /&gt;
&lt;br /&gt;
[[File:Path-example.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Explicitly Running a Specific Python Version ==&lt;br /&gt;
&lt;br /&gt;
All of these are valid ways to run Python on the RDP:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;python&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;python2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;python3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, running &amp;lt;code&amp;gt;python&amp;lt;/code&amp;gt; will run Python 2. '''This behavior should not be relied on.''' On most other systems, Python 3 is the default instead.&lt;br /&gt;
&lt;br /&gt;
It is the same case with &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; which can be run via &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pip2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pip3&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=File:Path-example.PNG&amp;diff=22008</id>
		<title>File:Path-example.PNG</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=File:Path-example.PNG&amp;diff=22008"/>
		<updated>2017-11-21T19:00:06Z</updated>

		<summary type="html">&lt;p&gt;OliverC: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Python_on_the_RDP&amp;diff=22007</id>
		<title>Python on the RDP</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Python_on_the_RDP&amp;diff=22007"/>
		<updated>2017-11-21T18:59:40Z</updated>

		<summary type="html">&lt;p&gt;OliverC: /* Manually Defining Explicit Python Binary Executables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are two production versions of Python: Python 2 and Python 3.&lt;br /&gt;
&lt;br /&gt;
* You can run scripts written for 3 with 2 if you import the special package [https://docs.python.org/2/library/__future__.html &amp;lt;code&amp;gt;__future__&amp;lt;/code&amp;gt;]&lt;br /&gt;
* You can run scripts written for 2 with 3 if you run the script [https://docs.python.org/3.1/library/2to3.html &amp;lt;code&amp;gt;2to3&amp;lt;/code&amp;gt;]&lt;br /&gt;
* '''All new code should be written in Python 3''' for library support and maintainability reasons. If for no other reason know that it uses UTF-8 as the default encoding and so it makes your life easier in every possible way.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Many Python modules are actually 90% low-level C code with the remaining 10% a python wrapper.&lt;br /&gt;
That means to install these modules (e.g. numpy, scipy, hdf) you need to have all of the development libraries and compiler tools to compile the C stuff.&lt;br /&gt;
Enter [https://anaconda.org/ Anaconda], a widely used repackaging of Python for Windows that comes with most of the libraries you'll ever need.&lt;br /&gt;
In addition, they've made it easy to have two installs of Python running at once.&lt;br /&gt;
&lt;br /&gt;
* Python2&lt;br /&gt;
** Python 2.7.14 via Anaconda2 5.0.1 for 64-bit&lt;br /&gt;
** Located at &amp;lt;code&amp;gt;C:\ProgramData\Anaconda2&amp;lt;/code&amp;gt;*&lt;br /&gt;
&lt;br /&gt;
* Python3&lt;br /&gt;
** Python 3.6.3 via Anaconda3 5.0.1 for 64-bit&lt;br /&gt;
** Located at &amp;lt;code&amp;gt;C:\ProgramData\Anaconda3&amp;lt;/code&amp;gt;*&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; Note that Anaconda is not installed in &amp;lt;code&amp;gt;C:\Program Files\AnacondaN&amp;lt;/code&amp;gt; intentionally. Spaces in the path lead to a bunch of unpredictable errors.&lt;br /&gt;
&lt;br /&gt;
=== Manually Defining Explicit Python Binary Executables ===&lt;br /&gt;
&lt;br /&gt;
A common practice is to have a bunch of specific Python commands to force explicit behavior. For example on Ubuntu, you can choose from running python, python2, python 2.6, python2.7, python3, python3.5, etc in the shell. To emulate this behavior, copy and paste the &amp;lt;code&amp;gt;python.exe&amp;lt;/code&amp;gt; and rename it to &amp;lt;code&amp;gt;pythonN.exe&amp;lt;/code&amp;gt; where N is whatever specific version you copied. The same applies to scripts you want to use like &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt;: copy-and-paste the file to a more explicit name.&lt;br /&gt;
&lt;br /&gt;
Path is evaluated with the first entries taking precedence. Thus, whichever version of Python you want to be the default should be listed at the leftmost position on the string. You can also just delete the unregistered python.exe to achieve the same result.&lt;br /&gt;
&lt;br /&gt;
=== ArcMap Aside ===&lt;br /&gt;
&lt;br /&gt;
Note that by default, ESRI ArcMap maintains a separate Python 2 installation at &amp;lt;code&amp;gt;C:\Python27&amp;lt;/code&amp;gt;. Just ignore this...it is not to be used for development or as the environment for running programs other than ArcMap.&lt;br /&gt;
&lt;br /&gt;
== Simultaneously Registering Python 2 and 3 ==&lt;br /&gt;
&lt;br /&gt;
Anaconda automatically &amp;quot;registers&amp;quot; the separate installations for use with some development environments. It does not (by default) add executables to the Path system environment. We will add the base &amp;lt;code&amp;gt;AnacondaN/*&amp;lt;/code&amp;gt; files and &amp;lt;code&amp;gt;AnacondaN/Scripts/*&amp;lt;/code&amp;gt; to the path as so:&lt;br /&gt;
&lt;br /&gt;
# Right-click on the Windows icon in the bottom left&lt;br /&gt;
# Select System&lt;br /&gt;
# Select Advanced System Settings (must be administrator)&lt;br /&gt;
# Select the Advanced Tab&lt;br /&gt;
# Select &amp;quot;Environment Variables...&amp;quot; at the bottom right&lt;br /&gt;
# Add semicolon-separated directories to Path in the lower box labeled System Variables &lt;br /&gt;
&lt;br /&gt;
== Explicitly Running a Specific Python Version ==&lt;br /&gt;
&lt;br /&gt;
All of these are valid ways to run Python on the RDP:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;python&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;python2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;python3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, running &amp;lt;code&amp;gt;python&amp;lt;/code&amp;gt; will run Python 2. '''This behavior should not be relied on.''' On most other systems, Python 3 is the default instead.&lt;br /&gt;
&lt;br /&gt;
It is the same case with &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; which can be run via &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pip2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pip3&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Python_on_the_RDP&amp;diff=22006</id>
		<title>Python on the RDP</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Python_on_the_RDP&amp;diff=22006"/>
		<updated>2017-11-21T18:58:47Z</updated>

		<summary type="html">&lt;p&gt;OliverC: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are two production versions of Python: Python 2 and Python 3.&lt;br /&gt;
&lt;br /&gt;
* You can run scripts written for 3 with 2 if you import the special package [https://docs.python.org/2/library/__future__.html &amp;lt;code&amp;gt;__future__&amp;lt;/code&amp;gt;]&lt;br /&gt;
* You can run scripts written for 2 with 3 if you run the script [https://docs.python.org/3.1/library/2to3.html &amp;lt;code&amp;gt;2to3&amp;lt;/code&amp;gt;]&lt;br /&gt;
* '''All new code should be written in Python 3''' for library support and maintainability reasons. If for no other reason know that it uses UTF-8 as the default encoding and so it makes your life easier in every possible way.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Many Python modules are actually 90% low-level C code with the remaining 10% a python wrapper.&lt;br /&gt;
That means to install these modules (e.g. numpy, scipy, hdf) you need to have all of the development libraries and compiler tools to compile the C stuff.&lt;br /&gt;
Enter [https://anaconda.org/ Anaconda], a widely used repackaging of Python for Windows that comes with most of the libraries you'll ever need.&lt;br /&gt;
In addition, they've made it easy to have two installs of Python running at once.&lt;br /&gt;
&lt;br /&gt;
* Python2&lt;br /&gt;
** Python 2.7.14 via Anaconda2 5.0.1 for 64-bit&lt;br /&gt;
** Located at &amp;lt;code&amp;gt;C:\ProgramData\Anaconda2&amp;lt;/code&amp;gt;*&lt;br /&gt;
&lt;br /&gt;
* Python3&lt;br /&gt;
** Python 3.6.3 via Anaconda3 5.0.1 for 64-bit&lt;br /&gt;
** Located at &amp;lt;code&amp;gt;C:\ProgramData\Anaconda3&amp;lt;/code&amp;gt;*&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; Note that Anaconda is not installed in &amp;lt;code&amp;gt;C:\Program Files\AnacondaN&amp;lt;/code&amp;gt; intentionally. Spaces in the path lead to a bunch of unpredictable errors.&lt;br /&gt;
&lt;br /&gt;
=== Manually Defining Explicit Python Binary Executables ===&lt;br /&gt;
&lt;br /&gt;
A common practice is to have a bunch of specific Python commands to force explicit behavior. For example on Ubuntu, you can choose from running python, python2, python 2.6, python2.7, python3, python3.5, etc in the shell. To emulate this behavior, copy and paste the &amp;lt;code&amp;gt;python.exe&amp;lt;/code&amp;gt; and rename it to &amp;lt;code&amp;gt;pythonN.exe&amp;lt;/code&amp;gt; where N is whatever specific version you copied.&lt;br /&gt;
&lt;br /&gt;
Path is evaluated with the first entries taking precedence. Thus, whichever version of Python you want to be the default should be listed at the leftmost position on the string. You can also just delete the unregistered python.exe to achieve the same result.&lt;br /&gt;
&lt;br /&gt;
=== ArcMap Aside ===&lt;br /&gt;
&lt;br /&gt;
Note that by default, ESRI ArcMap maintains a separate Python 2 installation at &amp;lt;code&amp;gt;C:\Python27&amp;lt;/code&amp;gt;. Just ignore this...it is not to be used for development or as the environment for running programs other than ArcMap.&lt;br /&gt;
&lt;br /&gt;
== Simultaneously Registering Python 2 and 3 ==&lt;br /&gt;
&lt;br /&gt;
Anaconda automatically &amp;quot;registers&amp;quot; the separate installations for use with some development environments. It does not (by default) add executables to the Path system environment. We will add the base &amp;lt;code&amp;gt;AnacondaN/*&amp;lt;/code&amp;gt; files and &amp;lt;code&amp;gt;AnacondaN/Scripts/*&amp;lt;/code&amp;gt; to the path as so:&lt;br /&gt;
&lt;br /&gt;
# Right-click on the Windows icon in the bottom left&lt;br /&gt;
# Select System&lt;br /&gt;
# Select Advanced System Settings (must be administrator)&lt;br /&gt;
# Select the Advanced Tab&lt;br /&gt;
# Select &amp;quot;Environment Variables...&amp;quot; at the bottom right&lt;br /&gt;
# Add semicolon-separated directories to Path in the lower box labeled System Variables &lt;br /&gt;
&lt;br /&gt;
== Explicitly Running a Specific Python Version ==&lt;br /&gt;
&lt;br /&gt;
All of these are valid ways to run Python on the RDP:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;python&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;python2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;python3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, running &amp;lt;code&amp;gt;python&amp;lt;/code&amp;gt; will run Python 2. '''This behavior should not be relied on.''' On most other systems, Python 3 is the default instead.&lt;br /&gt;
&lt;br /&gt;
It is the same case with &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; which can be run via &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pip2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pip3&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Python_on_the_RDP&amp;diff=22005</id>
		<title>Python on the RDP</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Python_on_the_RDP&amp;diff=22005"/>
		<updated>2017-11-21T18:42:57Z</updated>

		<summary type="html">&lt;p&gt;OliverC: Created page with &amp;quot;There are two production versions of Python: Python 2 and Python 3.  * You can run scripts written for 3 with 2 if you import the special package [https://docs.python.org/2/li...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are two production versions of Python: Python 2 and Python 3.&lt;br /&gt;
&lt;br /&gt;
* You can run scripts written for 3 with 2 if you import the special package [https://docs.python.org/2/library/__future__.html &amp;lt;code&amp;gt;__future__&amp;lt;/code&amp;gt;]&lt;br /&gt;
* You can run scripts written for 2 with 3 if you run the script [https://docs.python.org/3.1/library/2to3.html &amp;lt;code&amp;gt;2to3&amp;lt;/code&amp;gt;]&lt;br /&gt;
* '''All new code should be written in Python 3''' for library support and maintainability reasons. If for no other reason know that it uses UTF-8 as the default encoding and so it makes your life easier in every possible way.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Many Python modules are actually 90% low-level C code with the remaining 10% a python wrapper.&lt;br /&gt;
That means to install these modules (e.g. numpy, scipy, hdf) you need to have all of the development libraries and compiler tools to compile the C stuff.&lt;br /&gt;
Enter [https://anaconda.org/ Anaconda], a widely used repackaging of Python for Windows that comes with most of the libraries you'll ever need.&lt;br /&gt;
In addition, they've made it easy to have two installs of Python running at once.&lt;br /&gt;
&lt;br /&gt;
* Python2&lt;br /&gt;
** Python 2.7.14 via Anaconda2 5.0.1 for 64-bit&lt;br /&gt;
** Located at &amp;lt;code&amp;gt;C:\ProgramData\Anaconda2&amp;lt;/code&amp;gt;*&lt;br /&gt;
&lt;br /&gt;
* Python3&lt;br /&gt;
** Python 3.6.3 via Anaconda3 5.0.1 for 64-bit&lt;br /&gt;
** Located at &amp;lt;code&amp;gt;C:\ProgramData\Anaconda3&amp;lt;/code&amp;gt;*&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; Note that Anaconda is not installed in &amp;lt;code&amp;gt;C:\Program Files\AnacondaN&amp;lt;/code&amp;gt; intentionally. Spaces in the path lead to a bunch of unpredictable errors.&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=21884</id>
		<title>Oliver Chang (Work Log)</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=21884"/>
		<updated>2017-11-15T03:24:19Z</updated>

		<summary type="html">&lt;p&gt;OliverC: /* Fall 2017 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Projects'':&lt;br /&gt;
&lt;br /&gt;
* [[PostGIS_Installation|PostGIS Installation]]&lt;br /&gt;
* [[Reproducible_Patent_Data|Reproducible Patent Data]]&lt;br /&gt;
* [[Patent_Validity_Ideas_for_ML|Predictive Patent Validity Machine Learning Ideas]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification]]&lt;br /&gt;
* [[GPU_Build|GPU Computer Build]]&lt;br /&gt;
* [[Parallel_Enclosing_Circle_Algorithm|Parallel Enclosing Circle Algorithm]]&lt;br /&gt;
&lt;br /&gt;
''Uploads'':&lt;br /&gt;
&lt;br /&gt;
* [[File:PADX-File-Description-v2_Hague.pdf]]&lt;br /&gt;
** Describes patent kind codes (notably, what the hell X0 represents)&lt;br /&gt;
* [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]]&lt;br /&gt;
** Describes the fields in APS, their supposed character lengths, and if they are required/optional&lt;br /&gt;
* [[File:Aps-wku-modulus11.pdf]]&lt;br /&gt;
** Describes the layout of the check digit on magnetic tape&lt;br /&gt;
* [[File:Mod-11-algorithm.pdf]]&lt;br /&gt;
** Describes the algorithm used to calculate the check digit&lt;br /&gt;
&lt;br /&gt;
===Fall 2017=== &lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Oliver Chang]] [[Work Logs]] [[Oliver Chang (Work Log)|(log page)]]&lt;br /&gt;
&lt;br /&gt;
2017-11-14: hand off work on xpathing to Shelby; walked through some program design decisions&lt;br /&gt;
&lt;br /&gt;
2017-11-13: finish javadoc of common/ and some trickier parts about downloading; added descriptions, results to one-off java/python scripts so that they actually make sense in context&lt;br /&gt;
&lt;br /&gt;
2017-11-10: add javadoc documentation to patent reproducibility project after forgetting half of the stuff myself&lt;br /&gt;
&lt;br /&gt;
2017-10-25: start ingestion of application xml files and deal with all the bugs which accompany that&lt;br /&gt;
&lt;br /&gt;
2017-10-21: create xml explorer script to mass-inspect xpaths (can be found at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\xml_schema_explorer&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
2017-10-20: re-run assignment import, review xpaths&lt;br /&gt;
&lt;br /&gt;
2017-10-19: repopulate patents database and create spreadsheet of assignment equivalencies&lt;br /&gt;
&lt;br /&gt;
2017-10-11: add issues to work on to the PECA wiki page; cleanup PECA git repo; start patent application code from granted patent code and start customizing to new domain&lt;br /&gt;
&lt;br /&gt;
2017-10-03: troubleshoot vc_circles.py and make command line interface a little nicer&lt;br /&gt;
&lt;br /&gt;
2017-10-02: discuss mapping strategies &amp;amp; investigate missing eca data&lt;br /&gt;
&lt;br /&gt;
2017-09-23: make Project/OliverLovesCircles usable and add initial splitting ability&lt;br /&gt;
&lt;br /&gt;
2017-09-22: goal setting &amp;amp; server debugging &amp;amp; meet with Yang&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Summer 2017=== &lt;br /&gt;
&lt;br /&gt;
2017-08-04: setup parallel instance python framework for job reporting; begin test run&lt;br /&gt;
&lt;br /&gt;
2017-08-02: finish up some documentation of the code and for the wiki&lt;br /&gt;
&lt;br /&gt;
2017-08-01: discuss with Abhi &amp;amp; Ed about alternatives to Java port because of algorithmic constants that would be hard to port; run test batches on python with addition of equality operators and convergence early stopping&lt;br /&gt;
&lt;br /&gt;
2017-07-31: sketch out parallel enclosing circle algorithm&lt;br /&gt;
&lt;br /&gt;
2017-07-18: field questions and data cleanup questions from Kerda &amp;amp; Joe &amp;amp; Adrian&lt;br /&gt;
&lt;br /&gt;
2017-07-19: try to remove duplicated records (esp. those with empty titles) which are preventing the addition of a unique constraint&lt;br /&gt;
&lt;br /&gt;
2017-07-18: run correspondent join on properties and correspondents table to match previous project; sync with Adrian and Abhi&lt;br /&gt;
&lt;br /&gt;
2017-07-17: redo db operations after cleaning up granted patent number bugs&lt;br /&gt;
&lt;br /&gt;
2017-07-13: powwow about parallelizing Enclosing Circle Algorithm; sketch out what to do for the rest of the summer; work more on joins&lt;br /&gt;
&lt;br /&gt;
2017-07-12: generate some example data illustrating the difficulty of joining different tables&lt;br /&gt;
&lt;br /&gt;
2017-07-11: track down some bugs that happen very rarely and were missed in the initial qa phase&lt;br /&gt;
&lt;br /&gt;
2017-07-07: catch up on documentation&lt;br /&gt;
&lt;br /&gt;
2017-07-06: try (unsuccessfully) to understand docid mapping...create exploration scripts&lt;br /&gt;
&lt;br /&gt;
2017-07-05: add invention title to proper grouping of assignment properties; optimize XML parsing&lt;br /&gt;
&lt;br /&gt;
2017-06-30: powwow with James, Abhi, Ed about optimization issues; discuss document ids, X0 etc with Ed; pinpoint issues with APS doc numbers (see Repro Pat Dat#Gotchas) for more info&lt;br /&gt;
&lt;br /&gt;
2017-06-29: add logging of copy commands, more chattiness to scripts, debug assignment data failure&lt;br /&gt;
&lt;br /&gt;
2017-06-28: create examples for expansion to plant, reissue, design patent collection; start optimizing xml&lt;br /&gt;
&lt;br /&gt;
2017-06-27: write SQL to replicate assignees, extract postcodes for ongoing projects&lt;br /&gt;
&lt;br /&gt;
2017-06-26: speedup code, abstract in-memory file splitters to avoid repetition and some weird edge cases&lt;br /&gt;
&lt;br /&gt;
2017-06-25: create mappings for APS, assignment properties, XML 2.5 for data import; run data imports for granted data&lt;br /&gt;
&lt;br /&gt;
2017-06-23: cleanup hacky models with a better set of abstractions; cleanup IDE warnings; redefine patent-address mapping&lt;br /&gt;
&lt;br /&gt;
2017-06-22: create postcode&amp;lt;-&amp;gt;patent table&lt;br /&gt;
&lt;br /&gt;
2017-06-29: document granted patent queries and equivalencies&lt;br /&gt;
&lt;br /&gt;
2017-06-20: sketch out APS driver; discuss patent id problem; further document with evidence the zipcode data validity&lt;br /&gt;
&lt;br /&gt;
2017-06-19: skim address regular expressions; cursory investigation of patent table&lt;br /&gt;
&lt;br /&gt;
2017-06-16: create method of getting all data into the database, whether it likes it or not; copy over assignments, granted data using new scheme&lt;br /&gt;
&lt;br /&gt;
2017-06-15: add more robust error reporting, fix race conditions; build out assignment driver; build out fee event driver; add error logging&lt;br /&gt;
&lt;br /&gt;
2017-06-14: migrate bulk inserts to copy command; refresh on address data and start in on that; convert processor to multi-threaded application&lt;br /&gt;
&lt;br /&gt;
2017-06-13: spot check SQL tables; fix broken final case endlessly looping; investigate smarter insert methods&lt;br /&gt;
&lt;br /&gt;
2017-06-12: add XML printer, use it to inspect applications; extend BaseScraper to fetch patent application data; add applications documentation to my project page; add CREATE of other tables&lt;br /&gt;
&lt;br /&gt;
2017-06-08: add foreign key inserts; create pretty printer for XML analysis&lt;br /&gt;
&lt;br /&gt;
2017-06-07: finalize DB abstraction layer; migrate code to bulk inserts; upgrade webserver software and do optimization on RDP postgres with Ed&lt;br /&gt;
&lt;br /&gt;
2017-06-06: add jdbc; create basic schema; add db interaction; schedule meeting for later in the week&lt;br /&gt;
&lt;br /&gt;
2017-06-05: look into postgresql; refersh on postgis; add some notes to the Enclosing Circle Algorithm page&lt;br /&gt;
&lt;br /&gt;
2017-06-01: add RDP git remote; add more documentation to wiki page; refactor downloader scripts; start creation of tooling for interacting with data&lt;br /&gt;
&lt;br /&gt;
2017-05-31: finish copy-pasting attributes into the wiki page; retroactively fill out work log; meet with Ed to discuss next steps&lt;br /&gt;
&lt;br /&gt;
2017-05-30: update documentation on wiki, restructure large binary files to have more hierarchy instead of a flat listing at the root&lt;br /&gt;
&lt;br /&gt;
2017-05-29: expand to APS; expand to raw assignment data&lt;br /&gt;
&lt;br /&gt;
2017-05-27: expand to maintenance fee data&lt;br /&gt;
&lt;br /&gt;
2017-05-26: create models, translate &amp;lt;code&amp;gt;xmlparser*.pl&amp;lt;/code&amp;gt; file into Java; start using builder pattern&lt;br /&gt;
&lt;br /&gt;
2017-05-25: sketch out OO design of project; download bulk data&lt;br /&gt;
&lt;br /&gt;
2017-05-24: move wiki pages around; start git repository for project&lt;br /&gt;
&lt;br /&gt;
2017-05-21: discuss technical details of previous work with Ed&lt;br /&gt;
&lt;br /&gt;
2017-05-08: cleanup dead links on wiki and start reading about previous work; discuss current project status with Ed&lt;br /&gt;
&lt;br /&gt;
2017-05-04: setup wiki account, rdp account, database training&lt;br /&gt;
&lt;br /&gt;
[[Category:Work Log]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Reproducible_Patent_Data&amp;diff=21832</id>
		<title>Reproducible Patent Data</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Reproducible_Patent_Data&amp;diff=21832"/>
		<updated>2017-11-14T16:47:20Z</updated>

		<summary type="html">&lt;p&gt;OliverC: /* New Table Checklist */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{McNair Projects&lt;br /&gt;
|Has Image=Uspto web logo.jpg&lt;br /&gt;
|Has title=Reproducible Patent Data&lt;br /&gt;
|Has owner=Oliver Chang&lt;br /&gt;
|Has start date=May 17&lt;br /&gt;
|Has project status=Active&lt;br /&gt;
|Does subsume=Redesigning Patent Database, Patent Assignment Data Restructure,&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A continuation of [[Redesigning Patent Database]] that aims to write faster, more centralized code to deal with data from the United States Patent and Trademark Office (USPTO). By having an end-to-end pipeline we can easily reproduce or update data without worrying about unintentional side effects or missing data.&lt;br /&gt;
&lt;br /&gt;
== Quickstart ==&lt;br /&gt;
&lt;br /&gt;
To get up and running with the code, do the following:&lt;br /&gt;
&lt;br /&gt;
# Clone the git project (link at end of page) to your user directory&lt;br /&gt;
# Launch IntelliJ with &amp;gt;= Java 8 and Maven configured (default version installed on the RDP is setup to do this)&lt;br /&gt;
# Open project in IntelliJ&lt;br /&gt;
# Create an empty database (see [[#Database]])&lt;br /&gt;
# Run the table creation scripts in &amp;lt;code&amp;gt;src/db/schemas/&amp;lt;/code&amp;gt; in your new database&lt;br /&gt;
# Modify the constant &amp;lt;code&amp;gt;DATABASE_NAME&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\postgres\DatabaseHelper.java&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run the Driver scripts in IntelliJ with the correct value for &amp;lt;code&amp;gt;DATA_DIRECTORY&amp;lt;/code&amp;gt; (or run &amp;lt;code&amp;gt;RunInitialImport.java&amp;lt;/code&amp;gt; which will do all of the data directories for that patent item type)&lt;br /&gt;
# [Take a really, really long lunch...in total should take no more than five hours to load data on RDP]&lt;br /&gt;
# Run scripts in &amp;lt;code&amp;gt;src/db/constraints&amp;lt;/code&amp;gt; to check data assumptions&lt;br /&gt;
# That's it!&lt;br /&gt;
&lt;br /&gt;
== Directory Layout ==&lt;br /&gt;
&lt;br /&gt;
=== Where is the Data? ===&lt;br /&gt;
&lt;br /&gt;
==== Directories ====&lt;br /&gt;
&lt;br /&gt;
All of the information for this project is located at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are several interesting directories:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;data/downloads/&amp;lt;/code&amp;gt; is USPTO bulkdata, unmodified straight from the scraper&lt;br /&gt;
* &amp;lt;code&amp;gt;data/extracts/&amp;lt;/code&amp;gt; is a directory of a strict subset of the information stored in &amp;lt;code&amp;gt;data/downloads/&amp;lt;/code&amp;gt;. It is the result of running a bulk 7-zip job on that directory to get everything unzipped in a flat data structure. Note that these files have the USPTO modified-by time since that metadata is stored in the zipfiles. To extract files in this nice format, select all of the zipfiles and setup an extraction job like in this [[media:7zip-params.png|screenshot]]&lt;br /&gt;
* &amp;lt;code&amp;gt;data/backups/&amp;lt;/code&amp;gt; is a 7zip'd backup of the corresponding directory in extracts&lt;br /&gt;
* &amp;lt;code&amp;gt;src/&amp;lt;/code&amp;gt; is the main code repository for the java project&lt;br /&gt;
&lt;br /&gt;
==== Input Files ====&lt;br /&gt;
&lt;br /&gt;
All of the text-only Red Book files for '''granted patents''' from 1976 to 2016, inclusive. To find a specific year's XML file, find it in&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\granted\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find application data''' from 2001 to 2016, inclusive, look in&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\applications\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find assignment data''', look in &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\granted\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find maintenance fee data''', look in &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\downloads\maintenance\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Where is the Code? ===&lt;br /&gt;
&lt;br /&gt;
The code has the same parent directory as the data, so it is at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src&amp;lt;/code&amp;gt;. You might notice a lot of single-entry directories; this is an idiomatic Java pattern that is used for package separation. If using IntelliJ or some other IDE, these directories are a bit less annoying.&lt;br /&gt;
&lt;br /&gt;
The development environment is Java 8 JDK, IntelliJ Ultimate IDE, Maven build tools, and git VCS.&lt;br /&gt;
&lt;br /&gt;
The git repository can be found at http://rdp.mcnaircenter.org/codebase/Repository/ReproduciblePatent&lt;br /&gt;
&lt;br /&gt;
==== Prior Art ====&lt;br /&gt;
&lt;br /&gt;
This tool is not so concerned with adding new functionality; rather, it aims to take a bunch of spread out Perl scripts and create a faster system that is easier to work with. As such, its functionality is largely stolen from those scripts:&lt;br /&gt;
&lt;br /&gt;
* Downloader: &amp;lt;code&amp;gt;E:\McNair\Software\Scripts\Patent\USPTO_Parser.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
* XML Splitter: &amp;lt;code&amp;gt;E:\McNair\PatentData\splitter.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
* XML Parsing: &amp;lt;code&amp;gt;E:\McNair\PatentData\Processed\xmlparser_4.5_4.4_4.3.pl&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;E:\McNair\PatentData\Processed\*.pm&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, I used several non-standard Java libraries listed below:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/mashape/unirest-java/ Unirest] for easy HTTP requests (MIT License)&lt;br /&gt;
* [https://github.com/google/guava Google Guava] for immutable collections and Stream utilities (Apache v2.0 License)&lt;br /&gt;
* [https://github.com/jhy/jsoup/ jsoup] for HTML parsing (MIT License)&lt;br /&gt;
* [http://commons.apache.org/proper/commons-codec/ Apache Commons Codec] (Apache v2.0 License)&lt;br /&gt;
* [http://commons.apache.org/proper/commons-lang/ Apache Commons Lang v3] (Apache v2.0 License)&lt;br /&gt;
* [https://mvnrepository.com/artifact/org.jetbrains/annotations/15.0 Jetbrains Annotations] for enhanced null checks (Apache v2.0 License)&lt;br /&gt;
* [http://search.maven.org/#artifactdetails%7Corg.postgresql%7Cpostgresql%7C42.1.1.jre7%7Cbundle PostgreSQL JDBC] (BSD 3-clause per https://github.com/pgjdbc/pgjdbc-jre7/blob/master/LICENSE)&lt;br /&gt;
&lt;br /&gt;
If using maven, these dependencies are listed and should automatically be setup.&lt;br /&gt;
&lt;br /&gt;
==== Using Code ====&lt;br /&gt;
&lt;br /&gt;
Any file with a line that says &amp;lt;code&amp;gt;public static void main(String[] args) {&amp;lt;/code&amp;gt; can be run as a standalone file. The easiest way to do this is to load the project and then the file in IntelliJ and click the little green play arrow next to this bit of code.&lt;br /&gt;
&lt;br /&gt;
The code can also be run via the standard &amp;lt;code&amp;gt;javac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;java&amp;lt;/code&amp;gt; commands but since this project has a complicated structure you end up having to run commands like &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;C:\Program Files\Java\jdk1.8.0_131\bin\java&amp;quot; &amp;quot;-javaagent:C:\Users\OliverC\IntelliJ IDEA 2017.1.3\lib\idea_rt.jar=62364:C:\Users\OliverC\IntelliJ IDEA 2017.1.3\bin&amp;quot; -Dfile.encoding=UTF-8 -classpath &amp;quot;[...contents truncated...];C:\Users\OliverC\.m2\repository\org\postgresql\postgresql\42.1.1\postgresql-42.1.1.jar&amp;quot; org.bakerinstitute.mcnair.uspto_assignments.XmlDriver&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to include all of the runtime dependencies and it's just not worth it.&lt;br /&gt;
&lt;br /&gt;
==== Altering Code ====&lt;br /&gt;
&lt;br /&gt;
* Use the IntelliJ command Reformat code (found in the menus at &amp;lt;code&amp;gt;Code &amp;gt; Reformat Code&amp;lt;/code&amp;gt;&lt;br /&gt;
* Use the optimize imports function found under the same menu&lt;br /&gt;
* Use spaces for indentation&lt;br /&gt;
* Loosely try to keep lines below 120 characters&lt;br /&gt;
* Commit changes to the Git remote repository &amp;quot;bonobo&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Schema Reconciliation ==&lt;br /&gt;
&lt;br /&gt;
For the work by Joe, see the [[Patent Schema Reconciliation]] page &lt;br /&gt;
&lt;br /&gt;
=== Patents (Granted) ===&lt;br /&gt;
&lt;br /&gt;
See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\examples\granted&amp;lt;/code&amp;gt; for extracted examples of what specific data is available for a sample of the data.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Granted Patent Data Formats&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Dates Used !! scope=&amp;quot;col&amp;quot; | Format !! scope=&amp;quot;col&amp;quot; | Location !! scope=&amp;quot;col&amp;quot; | Supported? !! scope=&amp;quot;col&amp;quot; | Utility !! scope=&amp;quot;col&amp;quot; | Reissue !! scope=&amp;quot;col&amp;quot; | Design !! scope=&amp;quot;col&amp;quot; | Plant&lt;br /&gt;
|-&lt;br /&gt;
|January 1976 to December 2001&lt;br /&gt;
|APS&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;del&amp;gt;January 2001 to December 2001&amp;lt;/del&amp;gt;&lt;br /&gt;
|&amp;lt;del&amp;gt;SGML&amp;lt;/del&amp;gt;&lt;br /&gt;
|Ignored; use concurrently recorded APS data&lt;br /&gt;
|No&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|-&lt;br /&gt;
|January 2002 to December 2004&lt;br /&gt;
|XML Version 2.5&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/blunderyears&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2005 to December 2005&lt;br /&gt;
|XML Version 4.0 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2006 to December 2006&lt;br /&gt;
|XML Version 4.1 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2007 to December 2012&lt;br /&gt;
|XML Version 4.2 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2013 to September 24, 2013&lt;br /&gt;
|XML Version 4.3 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|October 8, 2013 to December 2014&lt;br /&gt;
|XML Version 4.4 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2015 to December 2016&lt;br /&gt;
|XML Version 4.5 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== APS Rosetta Stone ===&lt;br /&gt;
&lt;br /&gt;
The Advanced Patent System (APS) is a fixed-width text format used to store historical patent grant data. The documentation for this sucks; there are pages missing at random. Luckily, we only care about the content contained here: [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]].&lt;br /&gt;
&lt;br /&gt;
It's worth mentioning that the APS contains an advanced text markup system for chemical formulae, basic text markup, tables, etc. that can lead to seemingly garbled text that is perfectly well-formed.&lt;br /&gt;
&lt;br /&gt;
==== APS Gotchas ====&lt;br /&gt;
&lt;br /&gt;
* PATN.WKU is the granted patent number. It is 7 digits while the spec promises 6 digits. The rightmost digit is a check digit modulus 11. See [[File:Aps-wku-modulus11.pdf]] for the words from the horse's mouth.&lt;br /&gt;
&lt;br /&gt;
=== Patents (Applications) ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Patent Application Data Formats&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Dates Used !! scope=&amp;quot;col&amp;quot; | Format !! scope=&amp;quot;col&amp;quot; | Location !! scope=&amp;quot;col&amp;quot; | Supported by Parser?&lt;br /&gt;
|-&lt;br /&gt;
|March 15, 2001 to December 2001&lt;br /&gt;
|XML Version 1.5&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Yes, for basic information, inventors, and correspondents&lt;br /&gt;
|-&lt;br /&gt;
|January 2002 to December 2004&lt;br /&gt;
|XML Version 1.6&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2005 to December 2005&lt;br /&gt;
|XML Version 4.0 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2006 to December 2006&lt;br /&gt;
|XML Version 4.1 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2007 to December 2012&lt;br /&gt;
|XML Version 4.2 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2013 to December 2014&lt;br /&gt;
|XML Version 4.3 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2015 to ''Present''&lt;br /&gt;
|XML Version 4.4 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Database ==&lt;br /&gt;
&lt;br /&gt;
Because there isn't a compelling reason not to, I used the existing PostgreSQL infrastructure on the RDP.&lt;br /&gt;
The &amp;quot;Java Way&amp;quot; of interacting with databases is the Java Database Connectivity API (JDBC), an implementation-agnostic API for interacting with databases.&lt;br /&gt;
This project uses the stock [https://jdbc.postgresql.org/ Postgres JDBC], version 42.1.1&lt;br /&gt;
&lt;br /&gt;
=== Create an empty database on RDP ===&lt;br /&gt;
&lt;br /&gt;
To create an empty database, run this command: &amp;lt;code&amp;gt;$ createdb --username=postgres database-name-goes-here # password is tabspaceenter&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstraction Layer ===&lt;br /&gt;
&lt;br /&gt;
Since writing raw SQL is a bit cumbersome and error-prone, I have added some abstraction layers that make it much easier to quickly add bulk data. By using Postgres's &amp;lt;code&amp;gt;CopyManager&amp;lt;/code&amp;gt; class, we buffer SQL copy commands in memory (as many as possible) and then flush these rows. To understand how the abstraction layers work, see the code in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\postgres&amp;lt;/code&amp;gt;. See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\models\GrantedPatent.java&amp;lt;/code&amp;gt; for '''an example of how to extend''' the abstraction layer to deal with more complex scenarios.&lt;br /&gt;
&lt;br /&gt;
=== New Table Checklist ===&lt;br /&gt;
&lt;br /&gt;
* Create schema DDL SQL code for the new table in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\db&amp;lt;/code&amp;gt;&lt;br /&gt;
* Run the schema creation&lt;br /&gt;
* Create an enum with the same names for attributes as in the DDL (case-insensitive! prefer all-caps screaming snake case)&lt;br /&gt;
* Create a class which subclasses &amp;lt;code&amp;gt;AbstractInsertableData&amp;lt;/code&amp;gt;&lt;br /&gt;
* Inside that class, create a static class which subclasses &amp;lt;code&amp;gt;AbstractTableMetadata&amp;lt;/code&amp;gt; and has the proper values for getTableName(), getStringColumns(), getIntColumns()&lt;br /&gt;
* (Optional) Implement builder pattern&lt;br /&gt;
* (Optional) Create a custom databasehelper for complex extras (see PatentApplication and GrantedPatent for examples)&lt;br /&gt;
* Write the data to the table (see DatabaseHelper for the pattern I use)&lt;br /&gt;
&lt;br /&gt;
== Address Data ==&lt;br /&gt;
&lt;br /&gt;
To get the most granular address data (street level, or at least postcode level) about who owns patents, the path is not so straightforward because off the complicated mapping of ownership to a granted patent.&lt;br /&gt;
This is the final part of this project that I am working on and it is all at the level of SQL.&lt;br /&gt;
See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\db\joins&amp;lt;/code&amp;gt; for my attempts to create a clean mapping.&lt;br /&gt;
Optimistically speaking, the data generated here should be superset of the data present in the Patent Assignment Data Restructure project.&lt;br /&gt;
&lt;br /&gt;
Note that as of the beginning of August 2017, this part '''has not been completed.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Intuition ===&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;assignments_longform.last_update_date&amp;lt;/code&amp;gt; to find current/latest (or first/earliest) date of assignment. Then match with &amp;lt;code&amp;gt;properties.docid&amp;lt;/code&amp;gt; on &amp;lt;code&amp;gt;reelno, frameno&amp;lt;/code&amp;gt; to find patent application id. With this mapping to granted patents, we can discover the details of the original granted patent. And with the right date and reelno and frameno, we can match to the &amp;lt;code&amp;gt;assignees&amp;lt;/code&amp;gt; table and get fine granularity addresses.&lt;br /&gt;
&lt;br /&gt;
== Related Pages ==&lt;br /&gt;
&lt;br /&gt;
* [[Redesign_Assignment_and_Patent_Database|Redesign Assignment and Patent Database, Fall 2017 by Shelby]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries, Summer 2017 by Oliver &amp;amp; Joe]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification, Summer 2017 based on tables from Assignment Data Restructure]]&lt;br /&gt;
* [[Patent_Assignment_Data_Restructure|Assignment Data Restructure, Spring 2017 by Marcela and Sonia]]&lt;br /&gt;
* [[Redesigning_Patent_Database|Redesigning Patent Database, Spring 2017 by Shelby]]&lt;br /&gt;
* [[Patent_Data_Cleanup_(June_2016)|Patent Data Cleanup, June 2016 by Marcela]]&lt;br /&gt;
* [[Patent_Data|Patent Data, Spring 2016 by Marcela]] &lt;br /&gt;
* [[Lex_Machina|Lex Machina]]&lt;br /&gt;
* [[USPTO_Patent_Litigation_Data|USPTO Patent Litigation Research Dataset by Ed]]&lt;br /&gt;
* [[Patent_Litigation_and_Review|Patent Litigation and Review by Marcela]]&lt;br /&gt;
* [[Bag_of_Words_Analysis_of_Patent_Data|Bag of Words Analysis]]&lt;br /&gt;
* [[Patent|Existing Database Schema]]&lt;br /&gt;
* [[Oliver_Chang_(Work_Log)|My Work Log]]&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&lt;br /&gt;
* Understanding Assignment Data: [https://www.uspto.gov/sites/default/files/documents/USPTO_Patents_Assignment_Dataset_WP.pdf USPTO Documentation on their cleanup of this data]&lt;br /&gt;
* [https://bulkdata.uspto.gov/data2/patent/grant/redbook/fulltext/1976/PatentFullTextAPSDoc_GreenBook.pdf USPTO Green Book (APS) Documentation]&lt;br /&gt;
* [https://bulkdata.uspto.gov/ USPTO Bulk Data Storage System (BDSS)]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Builder_pattern Builder Pattern in Object-Oriented Programming]&lt;br /&gt;
* [http://rdp.mcnaircenter.org/codebase/Repository/ReproduciblePatent Git Repository]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Reproducible_Patent_Data&amp;diff=21830</id>
		<title>Reproducible Patent Data</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Reproducible_Patent_Data&amp;diff=21830"/>
		<updated>2017-11-14T16:44:35Z</updated>

		<summary type="html">&lt;p&gt;OliverC: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{McNair Projects&lt;br /&gt;
|Has Image=Uspto web logo.jpg&lt;br /&gt;
|Has title=Reproducible Patent Data&lt;br /&gt;
|Has owner=Oliver Chang&lt;br /&gt;
|Has start date=May 17&lt;br /&gt;
|Has project status=Active&lt;br /&gt;
|Does subsume=Redesigning Patent Database, Patent Assignment Data Restructure,&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A continuation of [[Redesigning Patent Database]] that aims to write faster, more centralized code to deal with data from the United States Patent and Trademark Office (USPTO). By having an end-to-end pipeline we can easily reproduce or update data without worrying about unintentional side effects or missing data.&lt;br /&gt;
&lt;br /&gt;
== Quickstart ==&lt;br /&gt;
&lt;br /&gt;
To get up and running with the code, do the following:&lt;br /&gt;
&lt;br /&gt;
# Clone the git project (link at end of page) to your user directory&lt;br /&gt;
# Launch IntelliJ with &amp;gt;= Java 8 and Maven configured (default version installed on the RDP is setup to do this)&lt;br /&gt;
# Open project in IntelliJ&lt;br /&gt;
# Create an empty database (see [[#Database]])&lt;br /&gt;
# Run the table creation scripts in &amp;lt;code&amp;gt;src/db/schemas/&amp;lt;/code&amp;gt; in your new database&lt;br /&gt;
# Modify the constant &amp;lt;code&amp;gt;DATABASE_NAME&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\postgres\DatabaseHelper.java&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run the Driver scripts in IntelliJ with the correct value for &amp;lt;code&amp;gt;DATA_DIRECTORY&amp;lt;/code&amp;gt; (or run &amp;lt;code&amp;gt;RunInitialImport.java&amp;lt;/code&amp;gt; which will do all of the data directories for that patent item type)&lt;br /&gt;
# [Take a really, really long lunch...in total should take no more than five hours to load data on RDP]&lt;br /&gt;
# Run scripts in &amp;lt;code&amp;gt;src/db/constraints&amp;lt;/code&amp;gt; to check data assumptions&lt;br /&gt;
# That's it!&lt;br /&gt;
&lt;br /&gt;
== Directory Layout ==&lt;br /&gt;
&lt;br /&gt;
=== Where is the Data? ===&lt;br /&gt;
&lt;br /&gt;
==== Directories ====&lt;br /&gt;
&lt;br /&gt;
All of the information for this project is located at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are several interesting directories:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;data/downloads/&amp;lt;/code&amp;gt; is USPTO bulkdata, unmodified straight from the scraper&lt;br /&gt;
* &amp;lt;code&amp;gt;data/extracts/&amp;lt;/code&amp;gt; is a directory of a strict subset of the information stored in &amp;lt;code&amp;gt;data/downloads/&amp;lt;/code&amp;gt;. It is the result of running a bulk 7-zip job on that directory to get everything unzipped in a flat data structure. Note that these files have the USPTO modified-by time since that metadata is stored in the zipfiles. To extract files in this nice format, select all of the zipfiles and setup an extraction job like in this [[media:7zip-params.png|screenshot]]&lt;br /&gt;
* &amp;lt;code&amp;gt;data/backups/&amp;lt;/code&amp;gt; is a 7zip'd backup of the corresponding directory in extracts&lt;br /&gt;
* &amp;lt;code&amp;gt;src/&amp;lt;/code&amp;gt; is the main code repository for the java project&lt;br /&gt;
&lt;br /&gt;
==== Input Files ====&lt;br /&gt;
&lt;br /&gt;
All of the text-only Red Book files for '''granted patents''' from 1976 to 2016, inclusive. To find a specific year's XML file, find it in&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\granted\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find application data''' from 2001 to 2016, inclusive, look in&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\applications\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find assignment data''', look in &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\granted\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find maintenance fee data''', look in &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\downloads\maintenance\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Where is the Code? ===&lt;br /&gt;
&lt;br /&gt;
The code has the same parent directory as the data, so it is at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src&amp;lt;/code&amp;gt;. You might notice a lot of single-entry directories; this is an idiomatic Java pattern that is used for package separation. If using IntelliJ or some other IDE, these directories are a bit less annoying.&lt;br /&gt;
&lt;br /&gt;
The development environment is Java 8 JDK, IntelliJ Ultimate IDE, Maven build tools, and git VCS.&lt;br /&gt;
&lt;br /&gt;
The git repository can be found at http://rdp.mcnaircenter.org/codebase/Repository/ReproduciblePatent&lt;br /&gt;
&lt;br /&gt;
==== Prior Art ====&lt;br /&gt;
&lt;br /&gt;
This tool is not so concerned with adding new functionality; rather, it aims to take a bunch of spread out Perl scripts and create a faster system that is easier to work with. As such, its functionality is largely stolen from those scripts:&lt;br /&gt;
&lt;br /&gt;
* Downloader: &amp;lt;code&amp;gt;E:\McNair\Software\Scripts\Patent\USPTO_Parser.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
* XML Splitter: &amp;lt;code&amp;gt;E:\McNair\PatentData\splitter.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
* XML Parsing: &amp;lt;code&amp;gt;E:\McNair\PatentData\Processed\xmlparser_4.5_4.4_4.3.pl&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;E:\McNair\PatentData\Processed\*.pm&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, I used several non-standard Java libraries listed below:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/mashape/unirest-java/ Unirest] for easy HTTP requests (MIT License)&lt;br /&gt;
* [https://github.com/google/guava Google Guava] for immutable collections and Stream utilities (Apache v2.0 License)&lt;br /&gt;
* [https://github.com/jhy/jsoup/ jsoup] for HTML parsing (MIT License)&lt;br /&gt;
* [http://commons.apache.org/proper/commons-codec/ Apache Commons Codec] (Apache v2.0 License)&lt;br /&gt;
* [http://commons.apache.org/proper/commons-lang/ Apache Commons Lang v3] (Apache v2.0 License)&lt;br /&gt;
* [https://mvnrepository.com/artifact/org.jetbrains/annotations/15.0 Jetbrains Annotations] for enhanced null checks (Apache v2.0 License)&lt;br /&gt;
* [http://search.maven.org/#artifactdetails%7Corg.postgresql%7Cpostgresql%7C42.1.1.jre7%7Cbundle PostgreSQL JDBC] (BSD 3-clause per https://github.com/pgjdbc/pgjdbc-jre7/blob/master/LICENSE)&lt;br /&gt;
&lt;br /&gt;
If using maven, these dependencies are listed and should automatically be setup.&lt;br /&gt;
&lt;br /&gt;
==== Using Code ====&lt;br /&gt;
&lt;br /&gt;
Any file with a line that says &amp;lt;code&amp;gt;public static void main(String[] args) {&amp;lt;/code&amp;gt; can be run as a standalone file. The easiest way to do this is to load the project and then the file in IntelliJ and click the little green play arrow next to this bit of code.&lt;br /&gt;
&lt;br /&gt;
The code can also be run via the standard &amp;lt;code&amp;gt;javac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;java&amp;lt;/code&amp;gt; commands but since this project has a complicated structure you end up having to run commands like &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;C:\Program Files\Java\jdk1.8.0_131\bin\java&amp;quot; &amp;quot;-javaagent:C:\Users\OliverC\IntelliJ IDEA 2017.1.3\lib\idea_rt.jar=62364:C:\Users\OliverC\IntelliJ IDEA 2017.1.3\bin&amp;quot; -Dfile.encoding=UTF-8 -classpath &amp;quot;[...contents truncated...];C:\Users\OliverC\.m2\repository\org\postgresql\postgresql\42.1.1\postgresql-42.1.1.jar&amp;quot; org.bakerinstitute.mcnair.uspto_assignments.XmlDriver&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to include all of the runtime dependencies and it's just not worth it.&lt;br /&gt;
&lt;br /&gt;
==== Altering Code ====&lt;br /&gt;
&lt;br /&gt;
* Use the IntelliJ command Reformat code (found in the menus at &amp;lt;code&amp;gt;Code &amp;gt; Reformat Code&amp;lt;/code&amp;gt;&lt;br /&gt;
* Use the optimize imports function found under the same menu&lt;br /&gt;
* Use spaces for indentation&lt;br /&gt;
* Loosely try to keep lines below 120 characters&lt;br /&gt;
* Commit changes to the Git remote repository &amp;quot;bonobo&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Schema Reconciliation ==&lt;br /&gt;
&lt;br /&gt;
For the work by Joe, see the [[Patent Schema Reconciliation]] page &lt;br /&gt;
&lt;br /&gt;
=== Patents (Granted) ===&lt;br /&gt;
&lt;br /&gt;
See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\examples\granted&amp;lt;/code&amp;gt; for extracted examples of what specific data is available for a sample of the data.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Granted Patent Data Formats&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Dates Used !! scope=&amp;quot;col&amp;quot; | Format !! scope=&amp;quot;col&amp;quot; | Location !! scope=&amp;quot;col&amp;quot; | Supported? !! scope=&amp;quot;col&amp;quot; | Utility !! scope=&amp;quot;col&amp;quot; | Reissue !! scope=&amp;quot;col&amp;quot; | Design !! scope=&amp;quot;col&amp;quot; | Plant&lt;br /&gt;
|-&lt;br /&gt;
|January 1976 to December 2001&lt;br /&gt;
|APS&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;del&amp;gt;January 2001 to December 2001&amp;lt;/del&amp;gt;&lt;br /&gt;
|&amp;lt;del&amp;gt;SGML&amp;lt;/del&amp;gt;&lt;br /&gt;
|Ignored; use concurrently recorded APS data&lt;br /&gt;
|No&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|-&lt;br /&gt;
|January 2002 to December 2004&lt;br /&gt;
|XML Version 2.5&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/blunderyears&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2005 to December 2005&lt;br /&gt;
|XML Version 4.0 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2006 to December 2006&lt;br /&gt;
|XML Version 4.1 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2007 to December 2012&lt;br /&gt;
|XML Version 4.2 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2013 to September 24, 2013&lt;br /&gt;
|XML Version 4.3 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|October 8, 2013 to December 2014&lt;br /&gt;
|XML Version 4.4 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2015 to December 2016&lt;br /&gt;
|XML Version 4.5 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== APS Rosetta Stone ===&lt;br /&gt;
&lt;br /&gt;
The Advanced Patent System (APS) is a fixed-width text format used to store historical patent grant data. The documentation for this sucks; there are pages missing at random. Luckily, we only care about the content contained here: [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]].&lt;br /&gt;
&lt;br /&gt;
It's worth mentioning that the APS contains an advanced text markup system for chemical formulae, basic text markup, tables, etc. that can lead to seemingly garbled text that is perfectly well-formed.&lt;br /&gt;
&lt;br /&gt;
==== APS Gotchas ====&lt;br /&gt;
&lt;br /&gt;
* PATN.WKU is the granted patent number. It is 7 digits while the spec promises 6 digits. The rightmost digit is a check digit modulus 11. See [[File:Aps-wku-modulus11.pdf]] for the words from the horse's mouth.&lt;br /&gt;
&lt;br /&gt;
=== Patents (Applications) ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Patent Application Data Formats&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Dates Used !! scope=&amp;quot;col&amp;quot; | Format !! scope=&amp;quot;col&amp;quot; | Location !! scope=&amp;quot;col&amp;quot; | Supported by Parser?&lt;br /&gt;
|-&lt;br /&gt;
|March 15, 2001 to December 2001&lt;br /&gt;
|XML Version 1.5&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Yes, for basic information, inventors, and correspondents&lt;br /&gt;
|-&lt;br /&gt;
|January 2002 to December 2004&lt;br /&gt;
|XML Version 1.6&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2005 to December 2005&lt;br /&gt;
|XML Version 4.0 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2006 to December 2006&lt;br /&gt;
|XML Version 4.1 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2007 to December 2012&lt;br /&gt;
|XML Version 4.2 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2013 to December 2014&lt;br /&gt;
|XML Version 4.3 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2015 to ''Present''&lt;br /&gt;
|XML Version 4.4 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Database ==&lt;br /&gt;
&lt;br /&gt;
Because there isn't a compelling reason not to, I used the existing PostgreSQL infrastructure on the RDP.&lt;br /&gt;
The &amp;quot;Java Way&amp;quot; of interacting with databases is the Java Database Connectivity API (JDBC), an implementation-agnostic API for interacting with databases.&lt;br /&gt;
This project uses the stock [https://jdbc.postgresql.org/ Postgres JDBC], version 42.1.1&lt;br /&gt;
&lt;br /&gt;
=== Create an empty database on RDP ===&lt;br /&gt;
&lt;br /&gt;
To create an empty database, run this command: &amp;lt;code&amp;gt;$ createdb --username=postgres database-name-goes-here # password is tabspaceenter&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstraction Layer ===&lt;br /&gt;
&lt;br /&gt;
Since writing raw SQL is a bit cumbersome and error-prone, I have added some abstraction layers that make it much easier to quickly add bulk data. By using Postgres's &amp;lt;code&amp;gt;CopyManager&amp;lt;/code&amp;gt; class, we buffer SQL copy commands in memory (as many as possible) and then flush these rows. To understand how the abstraction layers work, see the code in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\postgres&amp;lt;/code&amp;gt;. See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\models\GrantedPatent.java&amp;lt;/code&amp;gt; for '''an example of how to extend''' the abstraction layer to deal with more complex scenarios.&lt;br /&gt;
&lt;br /&gt;
=== New Table Checklist ===&lt;br /&gt;
&lt;br /&gt;
* Create schema DDL SQL code for the new table in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\db&amp;lt;/code&amp;gt;&lt;br /&gt;
* Run the schema creation&lt;br /&gt;
* Create an enum with the same names for attributes as in the DDL (case-insensitive! prefer all-caps screaming snake case)&lt;br /&gt;
* Create a class which subclasses &amp;lt;code&amp;gt;AbstractIntertableData&amp;lt;/code&amp;gt;&lt;br /&gt;
* Inside that class, create a static class which subclasses &amp;lt;code&amp;gt;AbstractTableMetadata&amp;lt;/code&amp;gt; and has the proper values for getTableName(), getStringColumns(), getIntColumns()&lt;br /&gt;
* (Optional) Implement builder pattern&lt;br /&gt;
* (Optional) Create a custom databasehelper for complex extras (see PatentApplication and GrantedPatent for examples)&lt;br /&gt;
* Write the data to the table (see DatabaseHelper for the pattern I use)&lt;br /&gt;
&lt;br /&gt;
== Address Data ==&lt;br /&gt;
&lt;br /&gt;
To get the most granular address data (street level, or at least postcode level) about who owns patents, the path is not so straightforward because off the complicated mapping of ownership to a granted patent.&lt;br /&gt;
This is the final part of this project that I am working on and it is all at the level of SQL.&lt;br /&gt;
See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\db\joins&amp;lt;/code&amp;gt; for my attempts to create a clean mapping.&lt;br /&gt;
Optimistically speaking, the data generated here should be superset of the data present in the Patent Assignment Data Restructure project.&lt;br /&gt;
&lt;br /&gt;
Note that as of the beginning of August 2017, this part '''has not been completed.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Intuition ===&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;assignments_longform.last_update_date&amp;lt;/code&amp;gt; to find current/latest (or first/earliest) date of assignment. Then match with &amp;lt;code&amp;gt;properties.docid&amp;lt;/code&amp;gt; on &amp;lt;code&amp;gt;reelno, frameno&amp;lt;/code&amp;gt; to find patent application id. With this mapping to granted patents, we can discover the details of the original granted patent. And with the right date and reelno and frameno, we can match to the &amp;lt;code&amp;gt;assignees&amp;lt;/code&amp;gt; table and get fine granularity addresses.&lt;br /&gt;
&lt;br /&gt;
== Related Pages ==&lt;br /&gt;
&lt;br /&gt;
* [[Redesign_Assignment_and_Patent_Database|Redesign Assignment and Patent Database, Fall 2017 by Shelby]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries, Summer 2017 by Oliver &amp;amp; Joe]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification, Summer 2017 based on tables from Assignment Data Restructure]]&lt;br /&gt;
* [[Patent_Assignment_Data_Restructure|Assignment Data Restructure, Spring 2017 by Marcela and Sonia]]&lt;br /&gt;
* [[Redesigning_Patent_Database|Redesigning Patent Database, Spring 2017 by Shelby]]&lt;br /&gt;
* [[Patent_Data_Cleanup_(June_2016)|Patent Data Cleanup, June 2016 by Marcela]]&lt;br /&gt;
* [[Patent_Data|Patent Data, Spring 2016 by Marcela]] &lt;br /&gt;
* [[Lex_Machina|Lex Machina]]&lt;br /&gt;
* [[USPTO_Patent_Litigation_Data|USPTO Patent Litigation Research Dataset by Ed]]&lt;br /&gt;
* [[Patent_Litigation_and_Review|Patent Litigation and Review by Marcela]]&lt;br /&gt;
* [[Bag_of_Words_Analysis_of_Patent_Data|Bag of Words Analysis]]&lt;br /&gt;
* [[Patent|Existing Database Schema]]&lt;br /&gt;
* [[Oliver_Chang_(Work_Log)|My Work Log]]&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&lt;br /&gt;
* Understanding Assignment Data: [https://www.uspto.gov/sites/default/files/documents/USPTO_Patents_Assignment_Dataset_WP.pdf USPTO Documentation on their cleanup of this data]&lt;br /&gt;
* [https://bulkdata.uspto.gov/data2/patent/grant/redbook/fulltext/1976/PatentFullTextAPSDoc_GreenBook.pdf USPTO Green Book (APS) Documentation]&lt;br /&gt;
* [https://bulkdata.uspto.gov/ USPTO Bulk Data Storage System (BDSS)]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Builder_pattern Builder Pattern in Object-Oriented Programming]&lt;br /&gt;
* [http://rdp.mcnaircenter.org/codebase/Repository/ReproduciblePatent Git Repository]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=21814</id>
		<title>Oliver Chang (Work Log)</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=21814"/>
		<updated>2017-11-14T04:23:28Z</updated>

		<summary type="html">&lt;p&gt;OliverC: /* Fall 2017 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Projects'':&lt;br /&gt;
&lt;br /&gt;
* [[PostGIS_Installation|PostGIS Installation]]&lt;br /&gt;
* [[Reproducible_Patent_Data|Reproducible Patent Data]]&lt;br /&gt;
* [[Patent_Validity_Ideas_for_ML|Predictive Patent Validity Machine Learning Ideas]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification]]&lt;br /&gt;
* [[GPU_Build|GPU Computer Build]]&lt;br /&gt;
* [[Parallel_Enclosing_Circle_Algorithm|Parallel Enclosing Circle Algorithm]]&lt;br /&gt;
&lt;br /&gt;
''Uploads'':&lt;br /&gt;
&lt;br /&gt;
* [[File:PADX-File-Description-v2_Hague.pdf]]&lt;br /&gt;
** Describes patent kind codes (notably, what the hell X0 represents)&lt;br /&gt;
* [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]]&lt;br /&gt;
** Describes the fields in APS, their supposed character lengths, and if they are required/optional&lt;br /&gt;
* [[File:Aps-wku-modulus11.pdf]]&lt;br /&gt;
** Describes the layout of the check digit on magnetic tape&lt;br /&gt;
* [[File:Mod-11-algorithm.pdf]]&lt;br /&gt;
** Describes the algorithm used to calculate the check digit&lt;br /&gt;
&lt;br /&gt;
===Fall 2017=== &lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Oliver Chang]] [[Work Logs]] [[Oliver Chang (Work Log)|(log page)]]&lt;br /&gt;
&lt;br /&gt;
2017-11-13: finish javadoc of common/ and some trickier parts about downloading; added descriptions, results to one-off java/python scripts so that they actually make sense in context&lt;br /&gt;
&lt;br /&gt;
2017-11-10: add javadoc documentation to patent reproducibility project after forgetting half of the stuff myself&lt;br /&gt;
&lt;br /&gt;
2017-10-25: start ingestion of application xml files and deal with all the bugs which accompany that&lt;br /&gt;
&lt;br /&gt;
2017-10-21: create xml explorer script to mass-inspect xpaths (can be found at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\xml_schema_explorer&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
2017-10-20: re-run assignment import, review xpaths&lt;br /&gt;
&lt;br /&gt;
2017-10-19: repopulate patents database and create spreadsheet of assignment equivalencies&lt;br /&gt;
&lt;br /&gt;
2017-10-11: add issues to work on to the PECA wiki page; cleanup PECA git repo; start patent application code from granted patent code and start customizing to new domain&lt;br /&gt;
&lt;br /&gt;
2017-10-03: troubleshoot vc_circles.py and make command line interface a little nicer&lt;br /&gt;
&lt;br /&gt;
2017-10-02: discuss mapping strategies &amp;amp; investigate missing eca data&lt;br /&gt;
&lt;br /&gt;
2017-09-23: make Project/OliverLovesCircles usable and add initial splitting ability&lt;br /&gt;
&lt;br /&gt;
2017-09-22: goal setting &amp;amp; server debugging &amp;amp; meet with Yang&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Summer 2017=== &lt;br /&gt;
&lt;br /&gt;
2017-08-04: setup parallel instance python framework for job reporting; begin test run&lt;br /&gt;
&lt;br /&gt;
2017-08-02: finish up some documentation of the code and for the wiki&lt;br /&gt;
&lt;br /&gt;
2017-08-01: discuss with Abhi &amp;amp; Ed about alternatives to Java port because of algorithmic constants that would be hard to port; run test batches on python with addition of equality operators and convergence early stopping&lt;br /&gt;
&lt;br /&gt;
2017-07-31: sketch out parallel enclosing circle algorithm&lt;br /&gt;
&lt;br /&gt;
2017-07-18: field questions and data cleanup questions from Kerda &amp;amp; Joe &amp;amp; Adrian&lt;br /&gt;
&lt;br /&gt;
2017-07-19: try to remove duplicated records (esp. those with empty titles) which are preventing the addition of a unique constraint&lt;br /&gt;
&lt;br /&gt;
2017-07-18: run correspondent join on properties and correspondents table to match previous project; sync with Adrian and Abhi&lt;br /&gt;
&lt;br /&gt;
2017-07-17: redo db operations after cleaning up granted patent number bugs&lt;br /&gt;
&lt;br /&gt;
2017-07-13: powwow about parallelizing Enclosing Circle Algorithm; sketch out what to do for the rest of the summer; work more on joins&lt;br /&gt;
&lt;br /&gt;
2017-07-12: generate some example data illustrating the difficulty of joining different tables&lt;br /&gt;
&lt;br /&gt;
2017-07-11: track down some bugs that happen very rarely and were missed in the initial qa phase&lt;br /&gt;
&lt;br /&gt;
2017-07-07: catch up on documentation&lt;br /&gt;
&lt;br /&gt;
2017-07-06: try (unsuccessfully) to understand docid mapping...create exploration scripts&lt;br /&gt;
&lt;br /&gt;
2017-07-05: add invention title to proper grouping of assignment properties; optimize XML parsing&lt;br /&gt;
&lt;br /&gt;
2017-06-30: powwow with James, Abhi, Ed about optimization issues; discuss document ids, X0 etc with Ed; pinpoint issues with APS doc numbers (see Repro Pat Dat#Gotchas) for more info&lt;br /&gt;
&lt;br /&gt;
2017-06-29: add logging of copy commands, more chattiness to scripts, debug assignment data failure&lt;br /&gt;
&lt;br /&gt;
2017-06-28: create examples for expansion to plant, reissue, design patent collection; start optimizing xml&lt;br /&gt;
&lt;br /&gt;
2017-06-27: write SQL to replicate assignees, extract postcodes for ongoing projects&lt;br /&gt;
&lt;br /&gt;
2017-06-26: speedup code, abstract in-memory file splitters to avoid repetition and some weird edge cases&lt;br /&gt;
&lt;br /&gt;
2017-06-25: create mappings for APS, assignment properties, XML 2.5 for data import; run data imports for granted data&lt;br /&gt;
&lt;br /&gt;
2017-06-23: cleanup hacky models with a better set of abstractions; cleanup IDE warnings; redefine patent-address mapping&lt;br /&gt;
&lt;br /&gt;
2017-06-22: create postcode&amp;lt;-&amp;gt;patent table&lt;br /&gt;
&lt;br /&gt;
2017-06-29: document granted patent queries and equivalencies&lt;br /&gt;
&lt;br /&gt;
2017-06-20: sketch out APS driver; discuss patent id problem; further document with evidence the zipcode data validity&lt;br /&gt;
&lt;br /&gt;
2017-06-19: skim address regular expressions; cursory investigation of patent table&lt;br /&gt;
&lt;br /&gt;
2017-06-16: create method of getting all data into the database, whether it likes it or not; copy over assignments, granted data using new scheme&lt;br /&gt;
&lt;br /&gt;
2017-06-15: add more robust error reporting, fix race conditions; build out assignment driver; build out fee event driver; add error logging&lt;br /&gt;
&lt;br /&gt;
2017-06-14: migrate bulk inserts to copy command; refresh on address data and start in on that; convert processor to multi-threaded application&lt;br /&gt;
&lt;br /&gt;
2017-06-13: spot check SQL tables; fix broken final case endlessly looping; investigate smarter insert methods&lt;br /&gt;
&lt;br /&gt;
2017-06-12: add XML printer, use it to inspect applications; extend BaseScraper to fetch patent application data; add applications documentation to my project page; add CREATE of other tables&lt;br /&gt;
&lt;br /&gt;
2017-06-08: add foreign key inserts; create pretty printer for XML analysis&lt;br /&gt;
&lt;br /&gt;
2017-06-07: finalize DB abstraction layer; migrate code to bulk inserts; upgrade webserver software and do optimization on RDP postgres with Ed&lt;br /&gt;
&lt;br /&gt;
2017-06-06: add jdbc; create basic schema; add db interaction; schedule meeting for later in the week&lt;br /&gt;
&lt;br /&gt;
2017-06-05: look into postgresql; refersh on postgis; add some notes to the Enclosing Circle Algorithm page&lt;br /&gt;
&lt;br /&gt;
2017-06-01: add RDP git remote; add more documentation to wiki page; refactor downloader scripts; start creation of tooling for interacting with data&lt;br /&gt;
&lt;br /&gt;
2017-05-31: finish copy-pasting attributes into the wiki page; retroactively fill out work log; meet with Ed to discuss next steps&lt;br /&gt;
&lt;br /&gt;
2017-05-30: update documentation on wiki, restructure large binary files to have more hierarchy instead of a flat listing at the root&lt;br /&gt;
&lt;br /&gt;
2017-05-29: expand to APS; expand to raw assignment data&lt;br /&gt;
&lt;br /&gt;
2017-05-27: expand to maintenance fee data&lt;br /&gt;
&lt;br /&gt;
2017-05-26: create models, translate &amp;lt;code&amp;gt;xmlparser*.pl&amp;lt;/code&amp;gt; file into Java; start using builder pattern&lt;br /&gt;
&lt;br /&gt;
2017-05-25: sketch out OO design of project; download bulk data&lt;br /&gt;
&lt;br /&gt;
2017-05-24: move wiki pages around; start git repository for project&lt;br /&gt;
&lt;br /&gt;
2017-05-21: discuss technical details of previous work with Ed&lt;br /&gt;
&lt;br /&gt;
2017-05-08: cleanup dead links on wiki and start reading about previous work; discuss current project status with Ed&lt;br /&gt;
&lt;br /&gt;
2017-05-04: setup wiki account, rdp account, database training&lt;br /&gt;
&lt;br /&gt;
[[Category:Work Log]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang&amp;diff=21813</id>
		<title>Oliver Chang</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang&amp;diff=21813"/>
		<updated>2017-11-14T04:22:21Z</updated>

		<summary type="html">&lt;p&gt;OliverC: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{McNair Staff&lt;br /&gt;
|position=Tech Team&lt;br /&gt;
|name=Oliver Chang,&lt;br /&gt;
|user_image=Oliver-face.jpg&lt;br /&gt;
|degree=Ph.D&lt;br /&gt;
|major=Computer Science&lt;br /&gt;
|class=2020&lt;br /&gt;
|join_date=05/04/2017&lt;br /&gt;
|skills=Coding,&lt;br /&gt;
|interests=Cooking, Crosswords, Bicycling, Music, Sustainability, Trivia,&lt;br /&gt;
|fun_fact=I own a tandem bicycle,&lt;br /&gt;
|email=oyc@rice.edu&lt;br /&gt;
|skype_name=oychang1&lt;br /&gt;
|status=Active&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Second-year computer science PhD Student working on deep learning and program synthesis by examples. Advised by Swarat Chaudhuri. I have an office at Duncan Hall 3006.&lt;br /&gt;
&lt;br /&gt;
==Time at McNair==&lt;br /&gt;
&lt;br /&gt;
[[Oliver_Chang_(Work_Log)|Oliver Chang (Work Log)]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=21784</id>
		<title>Oliver Chang (Work Log)</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=21784"/>
		<updated>2017-11-10T22:26:53Z</updated>

		<summary type="html">&lt;p&gt;OliverC: /* Fall 2017 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Projects'':&lt;br /&gt;
&lt;br /&gt;
* [[PostGIS_Installation|PostGIS Installation]]&lt;br /&gt;
* [[Reproducible_Patent_Data|Reproducible Patent Data]]&lt;br /&gt;
* [[Patent_Validity_Ideas_for_ML|Predictive Patent Validity Machine Learning Ideas]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification]]&lt;br /&gt;
* [[GPU_Build|GPU Computer Build]]&lt;br /&gt;
* [[Parallel_Enclosing_Circle_Algorithm|Parallel Enclosing Circle Algorithm]]&lt;br /&gt;
&lt;br /&gt;
''Uploads'':&lt;br /&gt;
&lt;br /&gt;
* [[File:PADX-File-Description-v2_Hague.pdf]]&lt;br /&gt;
** Describes patent kind codes (notably, what the hell X0 represents)&lt;br /&gt;
* [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]]&lt;br /&gt;
** Describes the fields in APS, their supposed character lengths, and if they are required/optional&lt;br /&gt;
* [[File:Aps-wku-modulus11.pdf]]&lt;br /&gt;
** Describes the layout of the check digit on magnetic tape&lt;br /&gt;
* [[File:Mod-11-algorithm.pdf]]&lt;br /&gt;
** Describes the algorithm used to calculate the check digit&lt;br /&gt;
&lt;br /&gt;
===Fall 2017=== &lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Oliver Chang]] [[Work Logs]] [[Oliver Chang (Work Log)|(log page)]]&lt;br /&gt;
&lt;br /&gt;
2017-11-10: add javadoc documentation to patent reproducibility project after forgetting half of the stuff myself&lt;br /&gt;
&lt;br /&gt;
2017-10-25: start ingestion of application xml files and deal with all the bugs which accompany that&lt;br /&gt;
&lt;br /&gt;
2017-10-21: create xml explorer script to mass-inspect xpaths (can be found at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\xml_schema_explorer&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
2017-10-20: re-run assignment import, review xpaths&lt;br /&gt;
&lt;br /&gt;
2017-10-19: repopulate patents database and create spreadsheet of assignment equivalencies&lt;br /&gt;
&lt;br /&gt;
2017-10-11: add issues to work on to the PECA wiki page; cleanup PECA git repo; start patent application code from granted patent code and start customizing to new domain&lt;br /&gt;
&lt;br /&gt;
2017-10-03: troubleshoot vc_circles.py and make command line interface a little nicer&lt;br /&gt;
&lt;br /&gt;
2017-10-02: discuss mapping strategies &amp;amp; investigate missing eca data&lt;br /&gt;
&lt;br /&gt;
2017-09-23: make Project/OliverLovesCircles usable and add initial splitting ability&lt;br /&gt;
&lt;br /&gt;
2017-09-22: goal setting &amp;amp; server debugging &amp;amp; meet with Yang&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Summer 2017=== &lt;br /&gt;
&lt;br /&gt;
2017-08-04: setup parallel instance python framework for job reporting; begin test run&lt;br /&gt;
&lt;br /&gt;
2017-08-02: finish up some documentation of the code and for the wiki&lt;br /&gt;
&lt;br /&gt;
2017-08-01: discuss with Abhi &amp;amp; Ed about alternatives to Java port because of algorithmic constants that would be hard to port; run test batches on python with addition of equality operators and convergence early stopping&lt;br /&gt;
&lt;br /&gt;
2017-07-31: sketch out parallel enclosing circle algorithm&lt;br /&gt;
&lt;br /&gt;
2017-07-18: field questions and data cleanup questions from Kerda &amp;amp; Joe &amp;amp; Adrian&lt;br /&gt;
&lt;br /&gt;
2017-07-19: try to remove duplicated records (esp. those with empty titles) which are preventing the addition of a unique constraint&lt;br /&gt;
&lt;br /&gt;
2017-07-18: run correspondent join on properties and correspondents table to match previous project; sync with Adrian and Abhi&lt;br /&gt;
&lt;br /&gt;
2017-07-17: redo db operations after cleaning up granted patent number bugs&lt;br /&gt;
&lt;br /&gt;
2017-07-13: powwow about parallelizing Enclosing Circle Algorithm; sketch out what to do for the rest of the summer; work more on joins&lt;br /&gt;
&lt;br /&gt;
2017-07-12: generate some example data illustrating the difficulty of joining different tables&lt;br /&gt;
&lt;br /&gt;
2017-07-11: track down some bugs that happen very rarely and were missed in the initial qa phase&lt;br /&gt;
&lt;br /&gt;
2017-07-07: catch up on documentation&lt;br /&gt;
&lt;br /&gt;
2017-07-06: try (unsuccessfully) to understand docid mapping...create exploration scripts&lt;br /&gt;
&lt;br /&gt;
2017-07-05: add invention title to proper grouping of assignment properties; optimize XML parsing&lt;br /&gt;
&lt;br /&gt;
2017-06-30: powwow with James, Abhi, Ed about optimization issues; discuss document ids, X0 etc with Ed; pinpoint issues with APS doc numbers (see Repro Pat Dat#Gotchas) for more info&lt;br /&gt;
&lt;br /&gt;
2017-06-29: add logging of copy commands, more chattiness to scripts, debug assignment data failure&lt;br /&gt;
&lt;br /&gt;
2017-06-28: create examples for expansion to plant, reissue, design patent collection; start optimizing xml&lt;br /&gt;
&lt;br /&gt;
2017-06-27: write SQL to replicate assignees, extract postcodes for ongoing projects&lt;br /&gt;
&lt;br /&gt;
2017-06-26: speedup code, abstract in-memory file splitters to avoid repetition and some weird edge cases&lt;br /&gt;
&lt;br /&gt;
2017-06-25: create mappings for APS, assignment properties, XML 2.5 for data import; run data imports for granted data&lt;br /&gt;
&lt;br /&gt;
2017-06-23: cleanup hacky models with a better set of abstractions; cleanup IDE warnings; redefine patent-address mapping&lt;br /&gt;
&lt;br /&gt;
2017-06-22: create postcode&amp;lt;-&amp;gt;patent table&lt;br /&gt;
&lt;br /&gt;
2017-06-29: document granted patent queries and equivalencies&lt;br /&gt;
&lt;br /&gt;
2017-06-20: sketch out APS driver; discuss patent id problem; further document with evidence the zipcode data validity&lt;br /&gt;
&lt;br /&gt;
2017-06-19: skim address regular expressions; cursory investigation of patent table&lt;br /&gt;
&lt;br /&gt;
2017-06-16: create method of getting all data into the database, whether it likes it or not; copy over assignments, granted data using new scheme&lt;br /&gt;
&lt;br /&gt;
2017-06-15: add more robust error reporting, fix race conditions; build out assignment driver; build out fee event driver; add error logging&lt;br /&gt;
&lt;br /&gt;
2017-06-14: migrate bulk inserts to copy command; refresh on address data and start in on that; convert processor to multi-threaded application&lt;br /&gt;
&lt;br /&gt;
2017-06-13: spot check SQL tables; fix broken final case endlessly looping; investigate smarter insert methods&lt;br /&gt;
&lt;br /&gt;
2017-06-12: add XML printer, use it to inspect applications; extend BaseScraper to fetch patent application data; add applications documentation to my project page; add CREATE of other tables&lt;br /&gt;
&lt;br /&gt;
2017-06-08: add foreign key inserts; create pretty printer for XML analysis&lt;br /&gt;
&lt;br /&gt;
2017-06-07: finalize DB abstraction layer; migrate code to bulk inserts; upgrade webserver software and do optimization on RDP postgres with Ed&lt;br /&gt;
&lt;br /&gt;
2017-06-06: add jdbc; create basic schema; add db interaction; schedule meeting for later in the week&lt;br /&gt;
&lt;br /&gt;
2017-06-05: look into postgresql; refersh on postgis; add some notes to the Enclosing Circle Algorithm page&lt;br /&gt;
&lt;br /&gt;
2017-06-01: add RDP git remote; add more documentation to wiki page; refactor downloader scripts; start creation of tooling for interacting with data&lt;br /&gt;
&lt;br /&gt;
2017-05-31: finish copy-pasting attributes into the wiki page; retroactively fill out work log; meet with Ed to discuss next steps&lt;br /&gt;
&lt;br /&gt;
2017-05-30: update documentation on wiki, restructure large binary files to have more hierarchy instead of a flat listing at the root&lt;br /&gt;
&lt;br /&gt;
2017-05-29: expand to APS; expand to raw assignment data&lt;br /&gt;
&lt;br /&gt;
2017-05-27: expand to maintenance fee data&lt;br /&gt;
&lt;br /&gt;
2017-05-26: create models, translate &amp;lt;code&amp;gt;xmlparser*.pl&amp;lt;/code&amp;gt; file into Java; start using builder pattern&lt;br /&gt;
&lt;br /&gt;
2017-05-25: sketch out OO design of project; download bulk data&lt;br /&gt;
&lt;br /&gt;
2017-05-24: move wiki pages around; start git repository for project&lt;br /&gt;
&lt;br /&gt;
2017-05-21: discuss technical details of previous work with Ed&lt;br /&gt;
&lt;br /&gt;
2017-05-08: cleanup dead links on wiki and start reading about previous work; discuss current project status with Ed&lt;br /&gt;
&lt;br /&gt;
2017-05-04: setup wiki account, rdp account, database training&lt;br /&gt;
&lt;br /&gt;
[[Category:Work Log]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang&amp;diff=21715</id>
		<title>Oliver Chang</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang&amp;diff=21715"/>
		<updated>2017-11-09T18:35:15Z</updated>

		<summary type="html">&lt;p&gt;OliverC: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{McNair Staff&lt;br /&gt;
|position=Tech Team&lt;br /&gt;
|name=Oliver Chang,&lt;br /&gt;
|user_image=Oliver-face.jpg&lt;br /&gt;
|degree=Ph.D&lt;br /&gt;
|major=Computer Science&lt;br /&gt;
|class=2020,&lt;br /&gt;
|join_date=05/04/2017,&lt;br /&gt;
|skills=Coding,&lt;br /&gt;
|interests=Cooking, Crosswords, Bicycling, Music, Sustainability, Trivia,&lt;br /&gt;
|fun_fact=I own a tandem bicycle,&lt;br /&gt;
|email=oyc@rice.edu&lt;br /&gt;
|skype_name=oychang1,&lt;br /&gt;
|status=Active&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
First-year computer science PhD Student working on deep learning and program synthesis by examples. Advised by Swarat Chaudhuri. I have an office at Duncan Hall 3006.&lt;br /&gt;
&lt;br /&gt;
==Time at McNair==&lt;br /&gt;
&lt;br /&gt;
[[Oliver_Chang_(Work_Log)|Oliver Chang (Work Log)]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=21714</id>
		<title>Oliver Chang (Work Log)</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=21714"/>
		<updated>2017-11-09T18:33:14Z</updated>

		<summary type="html">&lt;p&gt;OliverC: /* Summer 2017 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Projects'':&lt;br /&gt;
&lt;br /&gt;
* [[PostGIS_Installation|PostGIS Installation]]&lt;br /&gt;
* [[Reproducible_Patent_Data|Reproducible Patent Data]]&lt;br /&gt;
* [[Patent_Validity_Ideas_for_ML|Predictive Patent Validity Machine Learning Ideas]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification]]&lt;br /&gt;
* [[GPU_Build|GPU Computer Build]]&lt;br /&gt;
* [[Parallel_Enclosing_Circle_Algorithm|Parallel Enclosing Circle Algorithm]]&lt;br /&gt;
&lt;br /&gt;
''Uploads'':&lt;br /&gt;
&lt;br /&gt;
* [[File:PADX-File-Description-v2_Hague.pdf]]&lt;br /&gt;
** Describes patent kind codes (notably, what the hell X0 represents)&lt;br /&gt;
* [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]]&lt;br /&gt;
** Describes the fields in APS, their supposed character lengths, and if they are required/optional&lt;br /&gt;
* [[File:Aps-wku-modulus11.pdf]]&lt;br /&gt;
** Describes the layout of the check digit on magnetic tape&lt;br /&gt;
* [[File:Mod-11-algorithm.pdf]]&lt;br /&gt;
** Describes the algorithm used to calculate the check digit&lt;br /&gt;
&lt;br /&gt;
===Fall 2017=== &lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Oliver Chang]] [[Work Logs]] [[Oliver Chang (Work Log)|(log page)]]&lt;br /&gt;
&lt;br /&gt;
2017-10-25: start ingestion of application xml files and deal with all the bugs which accompany that&lt;br /&gt;
&lt;br /&gt;
2017-10-21: create xml explorer script to mass-inspect xpaths (can be found at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\xml_schema_explorer&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
2017-10-20: re-run assignment import, review xpaths&lt;br /&gt;
&lt;br /&gt;
2017-10-19: repopulate patents database and create spreadsheet of assignment equivalencies&lt;br /&gt;
&lt;br /&gt;
2017-10-11: add issues to work on to the PECA wiki page; cleanup PECA git repo; start patent application code from granted patent code and start customizing to new domain&lt;br /&gt;
&lt;br /&gt;
2017-10-03: troubleshoot vc_circles.py and make command line interface a little nicer&lt;br /&gt;
&lt;br /&gt;
2017-10-02: discuss mapping strategies &amp;amp; investigate missing eca data&lt;br /&gt;
&lt;br /&gt;
2017-09-23: make Project/OliverLovesCircles usable and add initial splitting ability&lt;br /&gt;
&lt;br /&gt;
2017-09-22: goal setting &amp;amp; server debugging &amp;amp; meet with Yang&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Summer 2017=== &lt;br /&gt;
&lt;br /&gt;
2017-08-04: setup parallel instance python framework for job reporting; begin test run&lt;br /&gt;
&lt;br /&gt;
2017-08-02: finish up some documentation of the code and for the wiki&lt;br /&gt;
&lt;br /&gt;
2017-08-01: discuss with Abhi &amp;amp; Ed about alternatives to Java port because of algorithmic constants that would be hard to port; run test batches on python with addition of equality operators and convergence early stopping&lt;br /&gt;
&lt;br /&gt;
2017-07-31: sketch out parallel enclosing circle algorithm&lt;br /&gt;
&lt;br /&gt;
2017-07-18: field questions and data cleanup questions from Kerda &amp;amp; Joe &amp;amp; Adrian&lt;br /&gt;
&lt;br /&gt;
2017-07-19: try to remove duplicated records (esp. those with empty titles) which are preventing the addition of a unique constraint&lt;br /&gt;
&lt;br /&gt;
2017-07-18: run correspondent join on properties and correspondents table to match previous project; sync with Adrian and Abhi&lt;br /&gt;
&lt;br /&gt;
2017-07-17: redo db operations after cleaning up granted patent number bugs&lt;br /&gt;
&lt;br /&gt;
2017-07-13: powwow about parallelizing Enclosing Circle Algorithm; sketch out what to do for the rest of the summer; work more on joins&lt;br /&gt;
&lt;br /&gt;
2017-07-12: generate some example data illustrating the difficulty of joining different tables&lt;br /&gt;
&lt;br /&gt;
2017-07-11: track down some bugs that happen very rarely and were missed in the initial qa phase&lt;br /&gt;
&lt;br /&gt;
2017-07-07: catch up on documentation&lt;br /&gt;
&lt;br /&gt;
2017-07-06: try (unsuccessfully) to understand docid mapping...create exploration scripts&lt;br /&gt;
&lt;br /&gt;
2017-07-05: add invention title to proper grouping of assignment properties; optimize XML parsing&lt;br /&gt;
&lt;br /&gt;
2017-06-30: powwow with James, Abhi, Ed about optimization issues; discuss document ids, X0 etc with Ed; pinpoint issues with APS doc numbers (see Repro Pat Dat#Gotchas) for more info&lt;br /&gt;
&lt;br /&gt;
2017-06-29: add logging of copy commands, more chattiness to scripts, debug assignment data failure&lt;br /&gt;
&lt;br /&gt;
2017-06-28: create examples for expansion to plant, reissue, design patent collection; start optimizing xml&lt;br /&gt;
&lt;br /&gt;
2017-06-27: write SQL to replicate assignees, extract postcodes for ongoing projects&lt;br /&gt;
&lt;br /&gt;
2017-06-26: speedup code, abstract in-memory file splitters to avoid repetition and some weird edge cases&lt;br /&gt;
&lt;br /&gt;
2017-06-25: create mappings for APS, assignment properties, XML 2.5 for data import; run data imports for granted data&lt;br /&gt;
&lt;br /&gt;
2017-06-23: cleanup hacky models with a better set of abstractions; cleanup IDE warnings; redefine patent-address mapping&lt;br /&gt;
&lt;br /&gt;
2017-06-22: create postcode&amp;lt;-&amp;gt;patent table&lt;br /&gt;
&lt;br /&gt;
2017-06-29: document granted patent queries and equivalencies&lt;br /&gt;
&lt;br /&gt;
2017-06-20: sketch out APS driver; discuss patent id problem; further document with evidence the zipcode data validity&lt;br /&gt;
&lt;br /&gt;
2017-06-19: skim address regular expressions; cursory investigation of patent table&lt;br /&gt;
&lt;br /&gt;
2017-06-16: create method of getting all data into the database, whether it likes it or not; copy over assignments, granted data using new scheme&lt;br /&gt;
&lt;br /&gt;
2017-06-15: add more robust error reporting, fix race conditions; build out assignment driver; build out fee event driver; add error logging&lt;br /&gt;
&lt;br /&gt;
2017-06-14: migrate bulk inserts to copy command; refresh on address data and start in on that; convert processor to multi-threaded application&lt;br /&gt;
&lt;br /&gt;
2017-06-13: spot check SQL tables; fix broken final case endlessly looping; investigate smarter insert methods&lt;br /&gt;
&lt;br /&gt;
2017-06-12: add XML printer, use it to inspect applications; extend BaseScraper to fetch patent application data; add applications documentation to my project page; add CREATE of other tables&lt;br /&gt;
&lt;br /&gt;
2017-06-08: add foreign key inserts; create pretty printer for XML analysis&lt;br /&gt;
&lt;br /&gt;
2017-06-07: finalize DB abstraction layer; migrate code to bulk inserts; upgrade webserver software and do optimization on RDP postgres with Ed&lt;br /&gt;
&lt;br /&gt;
2017-06-06: add jdbc; create basic schema; add db interaction; schedule meeting for later in the week&lt;br /&gt;
&lt;br /&gt;
2017-06-05: look into postgresql; refersh on postgis; add some notes to the Enclosing Circle Algorithm page&lt;br /&gt;
&lt;br /&gt;
2017-06-01: add RDP git remote; add more documentation to wiki page; refactor downloader scripts; start creation of tooling for interacting with data&lt;br /&gt;
&lt;br /&gt;
2017-05-31: finish copy-pasting attributes into the wiki page; retroactively fill out work log; meet with Ed to discuss next steps&lt;br /&gt;
&lt;br /&gt;
2017-05-30: update documentation on wiki, restructure large binary files to have more hierarchy instead of a flat listing at the root&lt;br /&gt;
&lt;br /&gt;
2017-05-29: expand to APS; expand to raw assignment data&lt;br /&gt;
&lt;br /&gt;
2017-05-27: expand to maintenance fee data&lt;br /&gt;
&lt;br /&gt;
2017-05-26: create models, translate &amp;lt;code&amp;gt;xmlparser*.pl&amp;lt;/code&amp;gt; file into Java; start using builder pattern&lt;br /&gt;
&lt;br /&gt;
2017-05-25: sketch out OO design of project; download bulk data&lt;br /&gt;
&lt;br /&gt;
2017-05-24: move wiki pages around; start git repository for project&lt;br /&gt;
&lt;br /&gt;
2017-05-21: discuss technical details of previous work with Ed&lt;br /&gt;
&lt;br /&gt;
2017-05-08: cleanup dead links on wiki and start reading about previous work; discuss current project status with Ed&lt;br /&gt;
&lt;br /&gt;
2017-05-04: setup wiki account, rdp account, database training&lt;br /&gt;
&lt;br /&gt;
[[Category:Work Log]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=21713</id>
		<title>Oliver Chang (Work Log)</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=21713"/>
		<updated>2017-11-09T18:32:55Z</updated>

		<summary type="html">&lt;p&gt;OliverC: transition to new format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Projects'':&lt;br /&gt;
&lt;br /&gt;
* [[PostGIS_Installation|PostGIS Installation]]&lt;br /&gt;
* [[Reproducible_Patent_Data|Reproducible Patent Data]]&lt;br /&gt;
* [[Patent_Validity_Ideas_for_ML|Predictive Patent Validity Machine Learning Ideas]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification]]&lt;br /&gt;
* [[GPU_Build|GPU Computer Build]]&lt;br /&gt;
* [[Parallel_Enclosing_Circle_Algorithm|Parallel Enclosing Circle Algorithm]]&lt;br /&gt;
&lt;br /&gt;
''Uploads'':&lt;br /&gt;
&lt;br /&gt;
* [[File:PADX-File-Description-v2_Hague.pdf]]&lt;br /&gt;
** Describes patent kind codes (notably, what the hell X0 represents)&lt;br /&gt;
* [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]]&lt;br /&gt;
** Describes the fields in APS, their supposed character lengths, and if they are required/optional&lt;br /&gt;
* [[File:Aps-wku-modulus11.pdf]]&lt;br /&gt;
** Describes the layout of the check digit on magnetic tape&lt;br /&gt;
* [[File:Mod-11-algorithm.pdf]]&lt;br /&gt;
** Describes the algorithm used to calculate the check digit&lt;br /&gt;
&lt;br /&gt;
===Fall 2017=== &lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Oliver Chang]] [[Work Logs]] [[Oliver Chang (Work Log)|(log page)]]&lt;br /&gt;
&lt;br /&gt;
2017-10-25: start ingestion of application xml files and deal with all the bugs which accompany that&lt;br /&gt;
&lt;br /&gt;
2017-10-21: create xml explorer script to mass-inspect xpaths (can be found at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\xml_schema_explorer&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
2017-10-20: re-run assignment import, review xpaths&lt;br /&gt;
&lt;br /&gt;
2017-10-19: repopulate patents database and create spreadsheet of assignment equivalencies&lt;br /&gt;
&lt;br /&gt;
2017-10-11: add issues to work on to the PECA wiki page; cleanup PECA git repo; start patent application code from granted patent code and start customizing to new domain&lt;br /&gt;
&lt;br /&gt;
2017-10-03: troubleshoot vc_circles.py and make command line interface a little nicer&lt;br /&gt;
&lt;br /&gt;
2017-10-02: discuss mapping strategies &amp;amp; investigate missing eca data&lt;br /&gt;
&lt;br /&gt;
2017-09-23: make Project/OliverLovesCircles usable and add initial splitting ability&lt;br /&gt;
&lt;br /&gt;
2017-09-22: goal setting &amp;amp; server debugging &amp;amp; meet with Yang&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Summer 2017=== &lt;br /&gt;
&lt;br /&gt;
2017-08-04: setup parallel instance python framework for job reporting; begin test run&lt;br /&gt;
&lt;br /&gt;
2017-08-02: finish up some documentation of the code and for the wiki&lt;br /&gt;
&lt;br /&gt;
2017-08-01: discuss with Abhi &amp;amp; Ed about alternatives to Java port because of algorithmic constants that would be hard to port; run test batches on python with addition of equality operators and convergence early stopping&lt;br /&gt;
&lt;br /&gt;
2017-07-31: sketch out parallel enclosing circle algorithm&lt;br /&gt;
&lt;br /&gt;
2017-07-18: field questions and data cleanup questions from Kerda &amp;amp; Joe &amp;amp; Adrian&lt;br /&gt;
&lt;br /&gt;
2017-07-19: try to remove duplicated records (esp. those with empty titles) which are preventing the addition of a unique constraint&lt;br /&gt;
&lt;br /&gt;
2017-07-18: run correspondent join on properties and correspondents table to match previous project; sync with Adrian and Abhi&lt;br /&gt;
&lt;br /&gt;
2017-07-17: redo db operations after cleaning up granted patent number bugs&lt;br /&gt;
&lt;br /&gt;
2017-07-13: powwow about parallelizing Enclosing Circle Algorithm; sketch out what to do for the rest of the summer; work more on joins&lt;br /&gt;
&lt;br /&gt;
2017-07-12: generate some example data illustrating the difficulty of joining different tables&lt;br /&gt;
&lt;br /&gt;
2017-07-11: track down some bugs that happen very rarely and were missed in the initial qa phase&lt;br /&gt;
&lt;br /&gt;
2017-07-07: catch up on documentation&lt;br /&gt;
&lt;br /&gt;
2017-07-06: try (unsuccessfully) to understand docid mapping...create exploration scripts&lt;br /&gt;
&lt;br /&gt;
2017-07-05: add invention title to proper grouping of assignment properties; optimize XML parsing&lt;br /&gt;
&lt;br /&gt;
2017-06-30: powwow with James, Abhi, Ed about optimization issues; discuss document ids, X0 etc with Ed; pinpoint issues with APS doc numbers (see Repro Pat Dat#Gotchas) for more info&lt;br /&gt;
&lt;br /&gt;
2017-06-29: add logging of copy commands, more chattiness to scripts, debug assignment data failure&lt;br /&gt;
&lt;br /&gt;
2017-06-28: create examples for expansion to plant, reissue, design patent collection; start optimizing xml&lt;br /&gt;
&lt;br /&gt;
2017-06-27: write SQL to replicate assignees, extract postcodes for ongoing projects&lt;br /&gt;
&lt;br /&gt;
2017-06-26: speedup code, abstract in-memory file splitters to avoid repetition and some weird edge cases&lt;br /&gt;
&lt;br /&gt;
2017-06-25: create mappings for APS, assignment properties, XML 2.5 for data import; run data imports for granted data&lt;br /&gt;
&lt;br /&gt;
2017-06-23: cleanup hacky models with a better set of abstractions; cleanup IDE warnings; redefine patent-address mapping&lt;br /&gt;
&lt;br /&gt;
2017-06-22: create postcode&amp;lt;-&amp;gt;patent table&lt;br /&gt;
&lt;br /&gt;
2017-06-29: document granted patent queries and equivalencies&lt;br /&gt;
&lt;br /&gt;
2017-06-20: sketch out APS driver; discuss patent id problem; further document with evidence the zipcode data validity&lt;br /&gt;
&lt;br /&gt;
2017-06-19: skim address regular expressions; cursory investigation of patent table&lt;br /&gt;
&lt;br /&gt;
2017-06-16: create method of getting all data into the database, whether it likes it or not; copy over assignments, granted data using new scheme&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2017-06-15: add more robust error reporting, fix race conditions; build out assignment driver; build out fee event driver; add error logging&lt;br /&gt;
&lt;br /&gt;
2017-06-14: migrate bulk inserts to copy command; refresh on address data and start in on that; convert processor to multi-threaded application&lt;br /&gt;
&lt;br /&gt;
2017-06-13: spot check SQL tables; fix broken final case endlessly looping; investigate smarter insert methods&lt;br /&gt;
&lt;br /&gt;
2017-06-12: add XML printer, use it to inspect applications; extend BaseScraper to fetch patent application data; add applications documentation to my project page; add CREATE of other tables&lt;br /&gt;
&lt;br /&gt;
2017-06-08: add foreign key inserts; create pretty printer for XML analysis&lt;br /&gt;
&lt;br /&gt;
2017-06-07: finalize DB abstraction layer; migrate code to bulk inserts; upgrade webserver software and do optimization on RDP postgres with Ed&lt;br /&gt;
&lt;br /&gt;
2017-06-06: add jdbc; create basic schema; add db interaction; schedule meeting for later in the week&lt;br /&gt;
&lt;br /&gt;
2017-06-05: look into postgresql; refersh on postgis; add some notes to the Enclosing Circle Algorithm page&lt;br /&gt;
&lt;br /&gt;
2017-06-01: add RDP git remote; add more documentation to wiki page; refactor downloader scripts; start creation of tooling for interacting with data&lt;br /&gt;
&lt;br /&gt;
2017-05-31: finish copy-pasting attributes into the wiki page; retroactively fill out work log; meet with Ed to discuss next steps&lt;br /&gt;
&lt;br /&gt;
2017-05-30: update documentation on wiki, restructure large binary files to have more hierarchy instead of a flat listing at the root&lt;br /&gt;
&lt;br /&gt;
2017-05-29: expand to APS; expand to raw assignment data&lt;br /&gt;
&lt;br /&gt;
2017-05-27: expand to maintenance fee data&lt;br /&gt;
&lt;br /&gt;
2017-05-26: create models, translate &amp;lt;code&amp;gt;xmlparser*.pl&amp;lt;/code&amp;gt; file into Java; start using builder pattern&lt;br /&gt;
&lt;br /&gt;
2017-05-25: sketch out OO design of project; download bulk data&lt;br /&gt;
&lt;br /&gt;
2017-05-24: move wiki pages around; start git repository for project&lt;br /&gt;
&lt;br /&gt;
2017-05-21: discuss technical details of previous work with Ed&lt;br /&gt;
&lt;br /&gt;
2017-05-08: cleanup dead links on wiki and start reading about previous work; discuss current project status with Ed&lt;br /&gt;
&lt;br /&gt;
2017-05-04: setup wiki account, rdp account, database training&lt;br /&gt;
&lt;br /&gt;
[[Category:Work Log]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=21712</id>
		<title>Oliver Chang (Work Log)</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=21712"/>
		<updated>2017-11-09T18:26:22Z</updated>

		<summary type="html">&lt;p&gt;OliverC: remove old todo list&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Projects'':&lt;br /&gt;
&lt;br /&gt;
* [[PostGIS_Installation|PostGIS Installation]]&lt;br /&gt;
* [[Reproducible_Patent_Data|Reproducible Patent Data]]&lt;br /&gt;
* [[Patent_Validity_Ideas_for_ML|Predictive Patent Validity Machine Learning Ideas]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification]]&lt;br /&gt;
* [[GPU_Build|GPU Computer Build]]&lt;br /&gt;
* [[Parallel_Enclosing_Circle_Algorithm|Parallel Enclosing Circle Algorithm]]&lt;br /&gt;
&lt;br /&gt;
''Uploads'':&lt;br /&gt;
&lt;br /&gt;
* [[File:PADX-File-Description-v2_Hague.pdf]]&lt;br /&gt;
** Describes patent kind codes (notably, what the hell X0 represents)&lt;br /&gt;
* [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]]&lt;br /&gt;
** Describes the fields in APS, their supposed character lengths, and if they are required/optional&lt;br /&gt;
* [[File:Aps-wku-modulus11.pdf]]&lt;br /&gt;
** Describes the layout of the check digit on magnetic tape&lt;br /&gt;
* [[File:Mod-11-algorithm.pdf]]&lt;br /&gt;
** Describes the algorithm used to calculate the check digit&lt;br /&gt;
&lt;br /&gt;
===Fall 2017=== &lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Oliver Chang]] [[Work Logs]] [[Oliver Chang (Work Log)|(log page)]]&lt;br /&gt;
&lt;br /&gt;
2017-10-25: start ingestion of application xml files and deal with all the bugs which accompany that&lt;br /&gt;
&lt;br /&gt;
2017-10-21: create xml explorer script to mass-inspect xpaths (can be found at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\xml_schema_explorer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2017-10-20: re-run assignment import, review xpaths&lt;br /&gt;
&lt;br /&gt;
2017-10-19: repopulate patents database and create spreadsheet of assignment equivalencies&lt;br /&gt;
&lt;br /&gt;
2017-10-11: add issues to work on to the PECA wiki page; cleanup PECA git repo; start patent application code from granted patent code and start customizing to new domain&lt;br /&gt;
&lt;br /&gt;
2017-10-03: troubleshoot vc_circles.py and make command line interface a little nicer&lt;br /&gt;
&lt;br /&gt;
2017-10-02: discuss mapping strategies &amp;amp; investigate missing eca data&lt;br /&gt;
&lt;br /&gt;
2017-09-23: make Project/OliverLovesCircles usable and add initial splitting ability&lt;br /&gt;
&lt;br /&gt;
2017-09-22: goal setting &amp;amp; server debugging &amp;amp; meet with Yang&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Summer 2017=== &lt;br /&gt;
&lt;br /&gt;
* Aug 4: setup parallel instance python framework for job reporting; begin test run&lt;br /&gt;
* Aug 2: finish up some documentation of the code and for the wiki&lt;br /&gt;
* Aug 1: discuss with Abhi &amp;amp; Ed about alternatives to Java port because of algorithmic constants that would be hard to port; run test batches on python with addition of equality operators and convergence early stopping&lt;br /&gt;
* July 31: sketch out parallel enclosing circle algorithm&lt;br /&gt;
* July 28: field questions and data cleanup questions from Kerda &amp;amp; Joe &amp;amp; Adrian&lt;br /&gt;
* ''travelling''&lt;br /&gt;
* July 19: try to remove duplicated records (esp. those with empty titles) which are preventing the addition of a unique constraint&lt;br /&gt;
* July 18: run correspondent join on properties and correspondents table to match previous project; sync with Adrian and Abhi&lt;br /&gt;
* July 17: redo db operations after cleaning up granted patent number bugs&lt;br /&gt;
* July 13: powwow about parallelizing Enclosing Circle Algorithm; sketch out what to do for the rest of the summer; work more on joins&lt;br /&gt;
* July 12: generate some example data illustrating the difficulty of joining different tables&lt;br /&gt;
* July 11: track down some bugs that happen very rarely and were missed in the initial qa phase&lt;br /&gt;
* July 7: catch up on documentation&lt;br /&gt;
* July 6: try (unsuccessfully) to understand docid mapping...create exploration scripts&lt;br /&gt;
* July 5: add invention title to proper grouping of assignment properties; optimize XML parsing&lt;br /&gt;
* June 30: powwow with James, Abhi, Ed about optimization issues; discuss document ids, X0 etc with Ed; pinpoint issues with APS doc numbers (see Repro Pat Dat#Gotchas) for more info&lt;br /&gt;
* June 29: add logging of copy commands, more chattiness to scripts, debug assignment data failure&lt;br /&gt;
* June 28: create examples for expansion to plant, reissue, design patent collection; start optimizing xml&lt;br /&gt;
* June 27: write SQL to replicate assignees, extract postcodes for ongoing projects&lt;br /&gt;
* June 26: speedup code, abstract in-memory file splitters to avoid repetition and some weird edge cases&lt;br /&gt;
* June 25: create mappings for APS, assignment properties, XML 2.5 for data import; run data imports for granted data&lt;br /&gt;
* June 23: cleanup hacky models with a better set of abstractions; cleanup IDE warnings; redefine patent-address mapping&lt;br /&gt;
* June 22: create postcode&amp;lt;-&amp;gt;patent table&lt;br /&gt;
* June 21: document granted patent queries and equivalencies&lt;br /&gt;
* June 20: sketch out APS driver; discuss patent id problem; further document with evidence the zipcode data validity&lt;br /&gt;
* June 19: skim address regular expressions; cursory investigation of patent table&lt;br /&gt;
* June 16: create method of getting all data into the database, whether it likes it or not; copy over assignments, granted data using new scheme&lt;br /&gt;
* June 15: add more robust error reporting, fix race conditions; build out assignment driver; build out fee event driver; add error logging&lt;br /&gt;
* June 14: migrate bulk inserts to copy command; refresh on address data and start in on that; convert processor to multi-threaded application&lt;br /&gt;
* June 13: spot check SQL tables; fix broken final case endlessly looping; investigate smarter insert methods&lt;br /&gt;
* June 12: add XML printer, use it to inspect applications; extend BaseScraper to fetch patent application data; add applications documentation to my project page; add CREATE of other tables&lt;br /&gt;
* June 8: add foreign key inserts; create pretty printer for XML analysis&lt;br /&gt;
* June 7: finalize DB abstraction layer; migrate code to bulk inserts; upgrade webserver software and do optimization on RDP postgres with Ed&lt;br /&gt;
* June 6: add jdbc; create basic schema; add db interaction; schedule meeting for later in the week&lt;br /&gt;
* June 5: look into postgresql; refersh on postgis; add some notes to the Enclosing Circle Algorithm page&lt;br /&gt;
* June 1: add RDP git remote; add more documentation to wiki page; refactor downloader scripts; start creation of tooling for interacting with data&lt;br /&gt;
* May 31: finish copy-pasting attributes into the wiki page; retroactively fill out work log; meet with Ed to discuss next steps&lt;br /&gt;
* May 30: update documentation on wiki, restructure large binary files to have more hierarchy instead of a flat listing at the root&lt;br /&gt;
* May 29: expand to APS; expand to raw assignment data&lt;br /&gt;
* May 27: expand to maintenance fee data&lt;br /&gt;
* May 26: create models, translate &amp;lt;code&amp;gt;xmlparser*.pl&amp;lt;/code&amp;gt; file into Java; start using builder pattern&lt;br /&gt;
* May 25: sketch out OO design of project; download bulk data&lt;br /&gt;
* May 24: move wiki pages around; start git repository for project&lt;br /&gt;
* May 21: discuss technical details of previous work with Ed&lt;br /&gt;
* May 8: cleanup dead links on wiki and start reading about previous work; discuss current project status with Ed&lt;br /&gt;
* May 4: setup wiki account, rdp account, database training&lt;br /&gt;
&lt;br /&gt;
[[Category:Work Log]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Reproducible_Patent_Data&amp;diff=21421</id>
		<title>Reproducible Patent Data</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Reproducible_Patent_Data&amp;diff=21421"/>
		<updated>2017-10-31T22:51:15Z</updated>

		<summary type="html">&lt;p&gt;OliverC: /* Related Pages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{McNair Projects&lt;br /&gt;
|Has Image=Uspto web logo.jpg&lt;br /&gt;
|Has title=Reproducible Patent Data&lt;br /&gt;
|Has owner=Oliver Chang&lt;br /&gt;
|Has start date=May 17&lt;br /&gt;
|Has project status=Active&lt;br /&gt;
|Does subsume=Redesigning Patent Database, Patent Assignment Data Restructure,&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A continuation of [[Redesigning Patent Database]] that aims to write faster, more centralized code to deal with data from the United States Patent and Trademark Office (USPTO). By having an end-to-end pipeline we can easily reproduce or update data without worrying about unintentional side effects or missing data.&lt;br /&gt;
&lt;br /&gt;
== Quickstart ==&lt;br /&gt;
&lt;br /&gt;
To get up and running with the code, do the following:&lt;br /&gt;
&lt;br /&gt;
# Clone the git project (link at end of page) to your user directory&lt;br /&gt;
# Launch IntelliJ with &amp;gt;= Java 8 and Maven configured (default version installed on the RDP is setup to do this)&lt;br /&gt;
# Open project in IntelliJ&lt;br /&gt;
# Create an empty database (see [[#Database]])&lt;br /&gt;
# Run the table creation scripts in &amp;lt;code&amp;gt;src/db/schemas/&amp;lt;/code&amp;gt; in your new database&lt;br /&gt;
# Modify the constant &amp;lt;code&amp;gt;DATABASE_NAME&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\postgres\DatabaseHelper.java&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run the Driver scripts in IntelliJ with the correct value for &amp;lt;code&amp;gt;DATA_DIRECTORY&amp;lt;/code&amp;gt; (or run &amp;lt;code&amp;gt;RunInitialImport.java&amp;lt;/code&amp;gt; which will do all of the data directories for that patent item type)&lt;br /&gt;
# [Take a really, really long lunch...in total should take no more than five hours to load data on RDP]&lt;br /&gt;
# Run scripts in &amp;lt;code&amp;gt;src/db/constraints&amp;lt;/code&amp;gt; to check data assumptions&lt;br /&gt;
# That's it!&lt;br /&gt;
&lt;br /&gt;
== Directory Layout ==&lt;br /&gt;
&lt;br /&gt;
=== Where is the Data? ===&lt;br /&gt;
&lt;br /&gt;
==== Directories ====&lt;br /&gt;
&lt;br /&gt;
All of the information for this project is located at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are several interesting directories:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;data/downloads/&amp;lt;/code&amp;gt; is USPTO bulkdata, unmodified straight from the scraper&lt;br /&gt;
* &amp;lt;code&amp;gt;data/extracts/&amp;lt;/code&amp;gt; is a directory of a strict subset of the information stored in &amp;lt;code&amp;gt;data/downloads/&amp;lt;/code&amp;gt;. It is the result of running a bulk 7-zip job on that directory to get everything unzipped in a flat data structure. Note that these files have the USPTO modified-by time since that metadata is stored in the zipfiles. To extract files in this nice format, select all of the zipfiles and setup an extraction job like in this [[media:7zip-params.png|screenshot]]&lt;br /&gt;
* &amp;lt;code&amp;gt;data/backups/&amp;lt;/code&amp;gt; is a 7zip'd backup of the corresponding directory in extracts&lt;br /&gt;
* &amp;lt;code&amp;gt;src/&amp;lt;/code&amp;gt; is the main code repository for the java project&lt;br /&gt;
&lt;br /&gt;
==== Input Files ====&lt;br /&gt;
&lt;br /&gt;
All of the text-only Red Book files for '''granted patents''' from 1976 to 2016, inclusive. To find a specific year's XML file, find it in&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\granted\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find application data''' from 2001 to 2016, inclusive, look in&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\applications\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find assignment data''', look in &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\granted\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find maintenance fee data''', look in &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\downloads\maintenance\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Where is the Code? ===&lt;br /&gt;
&lt;br /&gt;
The code has the same parent directory as the data, so it is at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src&amp;lt;/code&amp;gt;. You might notice a lot of single-entry directories; this is an idiomatic Java pattern that is used for package separation. If using IntelliJ or some other IDE, these directories are a bit less annoying.&lt;br /&gt;
&lt;br /&gt;
The development environment is Java 8 JDK, IntelliJ Ultimate IDE, Maven build tools, and git VCS.&lt;br /&gt;
&lt;br /&gt;
The git repository can be found at https://rdp.mcnaircenter.org/codebase/Repository/ReproduciblePatent&lt;br /&gt;
&lt;br /&gt;
==== Prior Art ====&lt;br /&gt;
&lt;br /&gt;
This tool is not so concerned with adding new functionality; rather, it aims to take a bunch of spread out Perl scripts and create a faster system that is easier to work with. As such, its functionality is largely stolen from those scripts:&lt;br /&gt;
&lt;br /&gt;
* Downloader: &amp;lt;code&amp;gt;E:\McNair\Software\Scripts\Patent\USPTO_Parser.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
* XML Splitter: &amp;lt;code&amp;gt;E:\McNair\PatentData\splitter.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
* XML Parsing: &amp;lt;code&amp;gt;E:\McNair\PatentData\Processed\xmlparser_4.5_4.4_4.3.pl&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;E:\McNair\PatentData\Processed\*.pm&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, I used several non-standard Java libraries listed below:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/mashape/unirest-java/ Unirest] for easy HTTP requests (MIT License)&lt;br /&gt;
* [https://github.com/google/guava Google Guava] for immutable collections and Stream utilities (Apache v2.0 License)&lt;br /&gt;
* [https://github.com/jhy/jsoup/ jsoup] for HTML parsing (MIT License)&lt;br /&gt;
* [http://commons.apache.org/proper/commons-codec/ Apache Commons Codec] (Apache v2.0 License)&lt;br /&gt;
* [http://commons.apache.org/proper/commons-lang/ Apache Commons Lang v3] (Apache v2.0 License)&lt;br /&gt;
* [https://mvnrepository.com/artifact/org.jetbrains/annotations/15.0 Jetbrains Annotations] for enhanced null checks (Apache v2.0 License)&lt;br /&gt;
* [http://search.maven.org/#artifactdetails%7Corg.postgresql%7Cpostgresql%7C42.1.1.jre7%7Cbundle PostgreSQL JDBC] (BSD 3-clause per https://github.com/pgjdbc/pgjdbc-jre7/blob/master/LICENSE)&lt;br /&gt;
&lt;br /&gt;
If using maven, these dependencies are listed and should automatically be setup.&lt;br /&gt;
&lt;br /&gt;
==== Using Code ====&lt;br /&gt;
&lt;br /&gt;
Any file with a line that says &amp;lt;code&amp;gt;public static void main(String[] args) {&amp;lt;/code&amp;gt; can be run as a standalone file. The easiest way to do this is to load the project and then the file in IntelliJ and click the little green play arrow next to this bit of code.&lt;br /&gt;
&lt;br /&gt;
The code can also be run via the standard &amp;lt;code&amp;gt;javac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;java&amp;lt;/code&amp;gt; commands but since this project has a complicated structure you end up having to run commands like &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;C:\Program Files\Java\jdk1.8.0_131\bin\java&amp;quot; &amp;quot;-javaagent:C:\Users\OliverC\IntelliJ IDEA 2017.1.3\lib\idea_rt.jar=62364:C:\Users\OliverC\IntelliJ IDEA 2017.1.3\bin&amp;quot; -Dfile.encoding=UTF-8 -classpath &amp;quot;[...contents truncated...];C:\Users\OliverC\.m2\repository\org\postgresql\postgresql\42.1.1\postgresql-42.1.1.jar&amp;quot; org.bakerinstitute.mcnair.uspto_assignments.XmlDriver&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to include all of the runtime dependencies and it's just not worth it.&lt;br /&gt;
&lt;br /&gt;
==== Altering Code ====&lt;br /&gt;
&lt;br /&gt;
* Use the IntelliJ command Reformat code (found in the menus at &amp;lt;code&amp;gt;Code &amp;gt; Reformat Code&amp;lt;/code&amp;gt;&lt;br /&gt;
* Use the optimize imports function found under the same menu&lt;br /&gt;
* Use spaces for indentation&lt;br /&gt;
* Loosely try to keep lines below 120 characters&lt;br /&gt;
* Commit changes to the Git remote repository &amp;quot;bonobo&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Schema Reconciliation ==&lt;br /&gt;
&lt;br /&gt;
For the work by Joe, see the [[Patent Schema Reconciliation]] page &lt;br /&gt;
&lt;br /&gt;
=== Patents (Granted) ===&lt;br /&gt;
&lt;br /&gt;
See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\examples\granted&amp;lt;/code&amp;gt; for extracted examples of what specific data is available for a sample of the data.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Granted Patent Data Formats&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Dates Used !! scope=&amp;quot;col&amp;quot; | Format !! scope=&amp;quot;col&amp;quot; | Location !! scope=&amp;quot;col&amp;quot; | Supported? !! scope=&amp;quot;col&amp;quot; | Utility !! scope=&amp;quot;col&amp;quot; | Reissue !! scope=&amp;quot;col&amp;quot; | Design !! scope=&amp;quot;col&amp;quot; | Plant&lt;br /&gt;
|-&lt;br /&gt;
|January 1976 to December 2001&lt;br /&gt;
|APS&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;del&amp;gt;January 2001 to December 2001&amp;lt;/del&amp;gt;&lt;br /&gt;
|&amp;lt;del&amp;gt;SGML&amp;lt;/del&amp;gt;&lt;br /&gt;
|Ignored; use concurrently recorded APS data&lt;br /&gt;
|No&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|-&lt;br /&gt;
|January 2002 to December 2004&lt;br /&gt;
|XML Version 2.5&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/blunderyears&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2005 to December 2005&lt;br /&gt;
|XML Version 4.0 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2006 to December 2006&lt;br /&gt;
|XML Version 4.1 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2007 to December 2012&lt;br /&gt;
|XML Version 4.2 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2013 to September 24, 2013&lt;br /&gt;
|XML Version 4.3 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|October 8, 2013 to December 2014&lt;br /&gt;
|XML Version 4.4 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2015 to December 2016&lt;br /&gt;
|XML Version 4.5 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== APS Rosetta Stone ===&lt;br /&gt;
&lt;br /&gt;
The Advanced Patent System (APS) is a fixed-width text format used to store historical patent grant data. The documentation for this sucks; there are pages missing at random. Luckily, we only care about the content contained here: [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]].&lt;br /&gt;
&lt;br /&gt;
It's worth mentioning that the APS contains an advanced text markup system for chemical formulae, basic text markup, tables, etc. that can lead to seemingly garbled text that is perfectly well-formed.&lt;br /&gt;
&lt;br /&gt;
==== APS Gotchas ====&lt;br /&gt;
&lt;br /&gt;
* PATN.WKU is the granted patent number. It is 7 digits while the spec promises 6 digits. The rightmost digit is a check digit modulus 11. See [[File:Aps-wku-modulus11.pdf]] for the words from the horse's mouth.&lt;br /&gt;
&lt;br /&gt;
=== Patents (Applications) ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Patent Application Data Formats&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Dates Used !! scope=&amp;quot;col&amp;quot; | Format !! scope=&amp;quot;col&amp;quot; | Location !! scope=&amp;quot;col&amp;quot; | Supported by Parser?&lt;br /&gt;
|-&lt;br /&gt;
|March 15, 2001 to December 2001&lt;br /&gt;
|XML Version 1.5&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Yes, for basic information, inventors, and correspondents&lt;br /&gt;
|-&lt;br /&gt;
|January 2002 to December 2004&lt;br /&gt;
|XML Version 1.6&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2005 to December 2005&lt;br /&gt;
|XML Version 4.0 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2006 to December 2006&lt;br /&gt;
|XML Version 4.1 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2007 to December 2012&lt;br /&gt;
|XML Version 4.2 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2013 to December 2014&lt;br /&gt;
|XML Version 4.3 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2015 to ''Present''&lt;br /&gt;
|XML Version 4.4 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Database ==&lt;br /&gt;
&lt;br /&gt;
Because there isn't a compelling reason not to, I used the existing PostgreSQL infrastructure on the RDP.&lt;br /&gt;
The &amp;quot;Java Way&amp;quot; of interacting with databases is the Java Database Connectivity API (JDBC), an implementation-agnostic API for interacting with databases.&lt;br /&gt;
This project uses the stock [https://jdbc.postgresql.org/ Postgres JDBC], version 42.1.1&lt;br /&gt;
&lt;br /&gt;
=== Create an empty database on RDP ===&lt;br /&gt;
&lt;br /&gt;
To create an empty database, run this command: &amp;lt;code&amp;gt;$ createdb --username=postgres database-name-goes-here # password is tabspaceenter&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstraction Layer ===&lt;br /&gt;
&lt;br /&gt;
Since writing raw SQL is a bit cumbersome and error-prone, I have added some abstraction layers that make it much easier to quickly add bulk data. By using Postgres's &amp;lt;code&amp;gt;CopyManager&amp;lt;/code&amp;gt; class, we buffer SQL copy commands in memory (as many as possible) and then flush these rows. To understand how the abstraction layers work, see the code in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\postgres&amp;lt;/code&amp;gt;. See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\models\GrantedPatent.java&amp;lt;/code&amp;gt; for '''an example of how to extend''' the abstraction layer to deal with more complex scenarios.&lt;br /&gt;
&lt;br /&gt;
=== New Table Checklist ===&lt;br /&gt;
&lt;br /&gt;
* Create schema DDL SQL code for the new table in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\db&amp;lt;/code&amp;gt;&lt;br /&gt;
* Run the schema creation&lt;br /&gt;
* Create an enum with the same names for attributes as in the DDL (case-insensitive! prefer all-caps screaming snake case)&lt;br /&gt;
* Create a class which subclasses &amp;lt;code&amp;gt;AbstractIntertableData&amp;lt;/code&amp;gt;&lt;br /&gt;
* Inside that class, create a static class which subclasses &amp;lt;code&amp;gt;AbstractTableMetadata&amp;lt;/code&amp;gt; and has the proper values for getTableName(), getStringColumns(), getIntColumns()&lt;br /&gt;
* (Optional) Implement builder pattern&lt;br /&gt;
* (Optional) Create a custom databasehelper for complex extras (see PatentApplication and GrantedPatent for examples)&lt;br /&gt;
* Write the data to the table (see DatabaseHelper for the pattern I use)&lt;br /&gt;
&lt;br /&gt;
== Address Data ==&lt;br /&gt;
&lt;br /&gt;
To get the most granular address data (street level, or at least postcode level) about who owns patents, the path is not so straightforward because off the complicated mapping of ownership to a granted patent.&lt;br /&gt;
This is the final part of this project that I am working on and it is all at the level of SQL.&lt;br /&gt;
See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\db\joins&amp;lt;/code&amp;gt; for my attempts to create a clean mapping.&lt;br /&gt;
Optimistically speaking, the data generated here should be superset of the data present in the Patent Assignment Data Restructure project.&lt;br /&gt;
&lt;br /&gt;
Note that as of the beginning of August 2017, this part '''has not been completed.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Intuition ===&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;assignments_longform.last_update_date&amp;lt;/code&amp;gt; to find current/latest (or first/earliest) date of assignment. Then match with &amp;lt;code&amp;gt;properties.docid&amp;lt;/code&amp;gt; on &amp;lt;code&amp;gt;reelno, frameno&amp;lt;/code&amp;gt; to find patent application id. With this mapping to granted patents, we can discover the details of the original granted patent. And with the right date and reelno and frameno, we can match to the &amp;lt;code&amp;gt;assignees&amp;lt;/code&amp;gt; table and get fine granularity addresses.&lt;br /&gt;
&lt;br /&gt;
== Related Pages ==&lt;br /&gt;
&lt;br /&gt;
* [[Redesign_Assignment_and_Patent_Database|Redesign Assignment and Patent Database, Fall 2017 by Shelby]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries, Summer 2017 by Oliver &amp;amp; Joe]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification, Summer 2017 based on tables from Assignment Data Restructure]]&lt;br /&gt;
* [[Patent_Assignment_Data_Restructure|Assignment Data Restructure, Spring 2017 by Marcela and Sonia]]&lt;br /&gt;
* [[Redesigning_Patent_Database|Redesigning Patent Database, Spring 2017 by Shelby]]&lt;br /&gt;
* [[Patent_Data_Cleanup_(June_2016)|Patent Data Cleanup, June 2016 by Marcela]]&lt;br /&gt;
* [[Patent_Data|Patent Data, Spring 2016 by Marcela]] &lt;br /&gt;
* [[Lex_Machina|Lex Machina]]&lt;br /&gt;
* [[USPTO_Patent_Litigation_Data|USPTO Patent Litigation Research Dataset by Ed]]&lt;br /&gt;
* [[Patent_Litigation_and_Review|Patent Litigation and Review by Marcela]]&lt;br /&gt;
* [[Bag_of_Words_Analysis_of_Patent_Data|Bag of Words Analysis]]&lt;br /&gt;
* [[Patent|Existing Database Schema]]&lt;br /&gt;
* [[Oliver_Chang_(Work_Log)|My Work Log]]&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&lt;br /&gt;
* Understanding Assignment Data: [https://www.uspto.gov/sites/default/files/documents/USPTO_Patents_Assignment_Dataset_WP.pdf USPTO Documentation on their cleanup of this data]&lt;br /&gt;
* [https://bulkdata.uspto.gov/data2/patent/grant/redbook/fulltext/1976/PatentFullTextAPSDoc_GreenBook.pdf USPTO Green Book (APS) Documentation]&lt;br /&gt;
* [https://bulkdata.uspto.gov/ USPTO Bulk Data Storage System (BDSS)]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Builder_pattern Builder Pattern in Object-Oriented Programming]&lt;br /&gt;
* [https://rdp.mcnaircenter.org/codebase/Repository/ReproduciblePatent Git Repository]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Reproducible_Patent_Data&amp;diff=21420</id>
		<title>Reproducible Patent Data</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Reproducible_Patent_Data&amp;diff=21420"/>
		<updated>2017-10-31T22:43:38Z</updated>

		<summary type="html">&lt;p&gt;OliverC: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{McNair Projects&lt;br /&gt;
|Has Image=Uspto web logo.jpg&lt;br /&gt;
|Has title=Reproducible Patent Data&lt;br /&gt;
|Has owner=Oliver Chang&lt;br /&gt;
|Has start date=May 17&lt;br /&gt;
|Has project status=Active&lt;br /&gt;
|Does subsume=Redesigning Patent Database, Patent Assignment Data Restructure,&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A continuation of [[Redesigning Patent Database]] that aims to write faster, more centralized code to deal with data from the United States Patent and Trademark Office (USPTO). By having an end-to-end pipeline we can easily reproduce or update data without worrying about unintentional side effects or missing data.&lt;br /&gt;
&lt;br /&gt;
== Quickstart ==&lt;br /&gt;
&lt;br /&gt;
To get up and running with the code, do the following:&lt;br /&gt;
&lt;br /&gt;
# Clone the git project (link at end of page) to your user directory&lt;br /&gt;
# Launch IntelliJ with &amp;gt;= Java 8 and Maven configured (default version installed on the RDP is setup to do this)&lt;br /&gt;
# Open project in IntelliJ&lt;br /&gt;
# Create an empty database (see [[#Database]])&lt;br /&gt;
# Run the table creation scripts in &amp;lt;code&amp;gt;src/db/schemas/&amp;lt;/code&amp;gt; in your new database&lt;br /&gt;
# Modify the constant &amp;lt;code&amp;gt;DATABASE_NAME&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\postgres\DatabaseHelper.java&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run the Driver scripts in IntelliJ with the correct value for &amp;lt;code&amp;gt;DATA_DIRECTORY&amp;lt;/code&amp;gt; (or run &amp;lt;code&amp;gt;RunInitialImport.java&amp;lt;/code&amp;gt; which will do all of the data directories for that patent item type)&lt;br /&gt;
# [Take a really, really long lunch...in total should take no more than five hours to load data on RDP]&lt;br /&gt;
# Run scripts in &amp;lt;code&amp;gt;src/db/constraints&amp;lt;/code&amp;gt; to check data assumptions&lt;br /&gt;
# That's it!&lt;br /&gt;
&lt;br /&gt;
== Directory Layout ==&lt;br /&gt;
&lt;br /&gt;
=== Where is the Data? ===&lt;br /&gt;
&lt;br /&gt;
==== Directories ====&lt;br /&gt;
&lt;br /&gt;
All of the information for this project is located at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are several interesting directories:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;data/downloads/&amp;lt;/code&amp;gt; is USPTO bulkdata, unmodified straight from the scraper&lt;br /&gt;
* &amp;lt;code&amp;gt;data/extracts/&amp;lt;/code&amp;gt; is a directory of a strict subset of the information stored in &amp;lt;code&amp;gt;data/downloads/&amp;lt;/code&amp;gt;. It is the result of running a bulk 7-zip job on that directory to get everything unzipped in a flat data structure. Note that these files have the USPTO modified-by time since that metadata is stored in the zipfiles. To extract files in this nice format, select all of the zipfiles and setup an extraction job like in this [[media:7zip-params.png|screenshot]]&lt;br /&gt;
* &amp;lt;code&amp;gt;data/backups/&amp;lt;/code&amp;gt; is a 7zip'd backup of the corresponding directory in extracts&lt;br /&gt;
* &amp;lt;code&amp;gt;src/&amp;lt;/code&amp;gt; is the main code repository for the java project&lt;br /&gt;
&lt;br /&gt;
==== Input Files ====&lt;br /&gt;
&lt;br /&gt;
All of the text-only Red Book files for '''granted patents''' from 1976 to 2016, inclusive. To find a specific year's XML file, find it in&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\granted\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find application data''' from 2001 to 2016, inclusive, look in&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\applications\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find assignment data''', look in &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\granted\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find maintenance fee data''', look in &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\downloads\maintenance\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Where is the Code? ===&lt;br /&gt;
&lt;br /&gt;
The code has the same parent directory as the data, so it is at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src&amp;lt;/code&amp;gt;. You might notice a lot of single-entry directories; this is an idiomatic Java pattern that is used for package separation. If using IntelliJ or some other IDE, these directories are a bit less annoying.&lt;br /&gt;
&lt;br /&gt;
The development environment is Java 8 JDK, IntelliJ Ultimate IDE, Maven build tools, and git VCS.&lt;br /&gt;
&lt;br /&gt;
The git repository can be found at https://rdp.mcnaircenter.org/codebase/Repository/ReproduciblePatent&lt;br /&gt;
&lt;br /&gt;
==== Prior Art ====&lt;br /&gt;
&lt;br /&gt;
This tool is not so concerned with adding new functionality; rather, it aims to take a bunch of spread out Perl scripts and create a faster system that is easier to work with. As such, its functionality is largely stolen from those scripts:&lt;br /&gt;
&lt;br /&gt;
* Downloader: &amp;lt;code&amp;gt;E:\McNair\Software\Scripts\Patent\USPTO_Parser.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
* XML Splitter: &amp;lt;code&amp;gt;E:\McNair\PatentData\splitter.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
* XML Parsing: &amp;lt;code&amp;gt;E:\McNair\PatentData\Processed\xmlparser_4.5_4.4_4.3.pl&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;E:\McNair\PatentData\Processed\*.pm&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, I used several non-standard Java libraries listed below:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/mashape/unirest-java/ Unirest] for easy HTTP requests (MIT License)&lt;br /&gt;
* [https://github.com/google/guava Google Guava] for immutable collections and Stream utilities (Apache v2.0 License)&lt;br /&gt;
* [https://github.com/jhy/jsoup/ jsoup] for HTML parsing (MIT License)&lt;br /&gt;
* [http://commons.apache.org/proper/commons-codec/ Apache Commons Codec] (Apache v2.0 License)&lt;br /&gt;
* [http://commons.apache.org/proper/commons-lang/ Apache Commons Lang v3] (Apache v2.0 License)&lt;br /&gt;
* [https://mvnrepository.com/artifact/org.jetbrains/annotations/15.0 Jetbrains Annotations] for enhanced null checks (Apache v2.0 License)&lt;br /&gt;
* [http://search.maven.org/#artifactdetails%7Corg.postgresql%7Cpostgresql%7C42.1.1.jre7%7Cbundle PostgreSQL JDBC] (BSD 3-clause per https://github.com/pgjdbc/pgjdbc-jre7/blob/master/LICENSE)&lt;br /&gt;
&lt;br /&gt;
If using maven, these dependencies are listed and should automatically be setup.&lt;br /&gt;
&lt;br /&gt;
==== Using Code ====&lt;br /&gt;
&lt;br /&gt;
Any file with a line that says &amp;lt;code&amp;gt;public static void main(String[] args) {&amp;lt;/code&amp;gt; can be run as a standalone file. The easiest way to do this is to load the project and then the file in IntelliJ and click the little green play arrow next to this bit of code.&lt;br /&gt;
&lt;br /&gt;
The code can also be run via the standard &amp;lt;code&amp;gt;javac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;java&amp;lt;/code&amp;gt; commands but since this project has a complicated structure you end up having to run commands like &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;C:\Program Files\Java\jdk1.8.0_131\bin\java&amp;quot; &amp;quot;-javaagent:C:\Users\OliverC\IntelliJ IDEA 2017.1.3\lib\idea_rt.jar=62364:C:\Users\OliverC\IntelliJ IDEA 2017.1.3\bin&amp;quot; -Dfile.encoding=UTF-8 -classpath &amp;quot;[...contents truncated...];C:\Users\OliverC\.m2\repository\org\postgresql\postgresql\42.1.1\postgresql-42.1.1.jar&amp;quot; org.bakerinstitute.mcnair.uspto_assignments.XmlDriver&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to include all of the runtime dependencies and it's just not worth it.&lt;br /&gt;
&lt;br /&gt;
==== Altering Code ====&lt;br /&gt;
&lt;br /&gt;
* Use the IntelliJ command Reformat code (found in the menus at &amp;lt;code&amp;gt;Code &amp;gt; Reformat Code&amp;lt;/code&amp;gt;&lt;br /&gt;
* Use the optimize imports function found under the same menu&lt;br /&gt;
* Use spaces for indentation&lt;br /&gt;
* Loosely try to keep lines below 120 characters&lt;br /&gt;
* Commit changes to the Git remote repository &amp;quot;bonobo&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Schema Reconciliation ==&lt;br /&gt;
&lt;br /&gt;
For the work by Joe, see the [[Patent Schema Reconciliation]] page &lt;br /&gt;
&lt;br /&gt;
=== Patents (Granted) ===&lt;br /&gt;
&lt;br /&gt;
See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\examples\granted&amp;lt;/code&amp;gt; for extracted examples of what specific data is available for a sample of the data.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Granted Patent Data Formats&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Dates Used !! scope=&amp;quot;col&amp;quot; | Format !! scope=&amp;quot;col&amp;quot; | Location !! scope=&amp;quot;col&amp;quot; | Supported? !! scope=&amp;quot;col&amp;quot; | Utility !! scope=&amp;quot;col&amp;quot; | Reissue !! scope=&amp;quot;col&amp;quot; | Design !! scope=&amp;quot;col&amp;quot; | Plant&lt;br /&gt;
|-&lt;br /&gt;
|January 1976 to December 2001&lt;br /&gt;
|APS&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;del&amp;gt;January 2001 to December 2001&amp;lt;/del&amp;gt;&lt;br /&gt;
|&amp;lt;del&amp;gt;SGML&amp;lt;/del&amp;gt;&lt;br /&gt;
|Ignored; use concurrently recorded APS data&lt;br /&gt;
|No&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|-&lt;br /&gt;
|January 2002 to December 2004&lt;br /&gt;
|XML Version 2.5&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/blunderyears&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2005 to December 2005&lt;br /&gt;
|XML Version 4.0 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2006 to December 2006&lt;br /&gt;
|XML Version 4.1 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2007 to December 2012&lt;br /&gt;
|XML Version 4.2 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2013 to September 24, 2013&lt;br /&gt;
|XML Version 4.3 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|October 8, 2013 to December 2014&lt;br /&gt;
|XML Version 4.4 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2015 to December 2016&lt;br /&gt;
|XML Version 4.5 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== APS Rosetta Stone ===&lt;br /&gt;
&lt;br /&gt;
The Advanced Patent System (APS) is a fixed-width text format used to store historical patent grant data. The documentation for this sucks; there are pages missing at random. Luckily, we only care about the content contained here: [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]].&lt;br /&gt;
&lt;br /&gt;
It's worth mentioning that the APS contains an advanced text markup system for chemical formulae, basic text markup, tables, etc. that can lead to seemingly garbled text that is perfectly well-formed.&lt;br /&gt;
&lt;br /&gt;
==== APS Gotchas ====&lt;br /&gt;
&lt;br /&gt;
* PATN.WKU is the granted patent number. It is 7 digits while the spec promises 6 digits. The rightmost digit is a check digit modulus 11. See [[File:Aps-wku-modulus11.pdf]] for the words from the horse's mouth.&lt;br /&gt;
&lt;br /&gt;
=== Patents (Applications) ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Patent Application Data Formats&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Dates Used !! scope=&amp;quot;col&amp;quot; | Format !! scope=&amp;quot;col&amp;quot; | Location !! scope=&amp;quot;col&amp;quot; | Supported by Parser?&lt;br /&gt;
|-&lt;br /&gt;
|March 15, 2001 to December 2001&lt;br /&gt;
|XML Version 1.5&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Yes, for basic information, inventors, and correspondents&lt;br /&gt;
|-&lt;br /&gt;
|January 2002 to December 2004&lt;br /&gt;
|XML Version 1.6&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2005 to December 2005&lt;br /&gt;
|XML Version 4.0 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2006 to December 2006&lt;br /&gt;
|XML Version 4.1 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2007 to December 2012&lt;br /&gt;
|XML Version 4.2 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2013 to December 2014&lt;br /&gt;
|XML Version 4.3 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2015 to ''Present''&lt;br /&gt;
|XML Version 4.4 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Database ==&lt;br /&gt;
&lt;br /&gt;
Because there isn't a compelling reason not to, I used the existing PostgreSQL infrastructure on the RDP.&lt;br /&gt;
The &amp;quot;Java Way&amp;quot; of interacting with databases is the Java Database Connectivity API (JDBC), an implementation-agnostic API for interacting with databases.&lt;br /&gt;
This project uses the stock [https://jdbc.postgresql.org/ Postgres JDBC], version 42.1.1&lt;br /&gt;
&lt;br /&gt;
=== Create an empty database on RDP ===&lt;br /&gt;
&lt;br /&gt;
To create an empty database, run this command: &amp;lt;code&amp;gt;$ createdb --username=postgres database-name-goes-here # password is tabspaceenter&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstraction Layer ===&lt;br /&gt;
&lt;br /&gt;
Since writing raw SQL is a bit cumbersome and error-prone, I have added some abstraction layers that make it much easier to quickly add bulk data. By using Postgres's &amp;lt;code&amp;gt;CopyManager&amp;lt;/code&amp;gt; class, we buffer SQL copy commands in memory (as many as possible) and then flush these rows. To understand how the abstraction layers work, see the code in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\postgres&amp;lt;/code&amp;gt;. See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\models\GrantedPatent.java&amp;lt;/code&amp;gt; for '''an example of how to extend''' the abstraction layer to deal with more complex scenarios.&lt;br /&gt;
&lt;br /&gt;
=== New Table Checklist ===&lt;br /&gt;
&lt;br /&gt;
* Create schema DDL SQL code for the new table in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\db&amp;lt;/code&amp;gt;&lt;br /&gt;
* Run the schema creation&lt;br /&gt;
* Create an enum with the same names for attributes as in the DDL (case-insensitive! prefer all-caps screaming snake case)&lt;br /&gt;
* Create a class which subclasses &amp;lt;code&amp;gt;AbstractIntertableData&amp;lt;/code&amp;gt;&lt;br /&gt;
* Inside that class, create a static class which subclasses &amp;lt;code&amp;gt;AbstractTableMetadata&amp;lt;/code&amp;gt; and has the proper values for getTableName(), getStringColumns(), getIntColumns()&lt;br /&gt;
* (Optional) Implement builder pattern&lt;br /&gt;
* (Optional) Create a custom databasehelper for complex extras (see PatentApplication and GrantedPatent for examples)&lt;br /&gt;
* Write the data to the table (see DatabaseHelper for the pattern I use)&lt;br /&gt;
&lt;br /&gt;
== Address Data ==&lt;br /&gt;
&lt;br /&gt;
To get the most granular address data (street level, or at least postcode level) about who owns patents, the path is not so straightforward because off the complicated mapping of ownership to a granted patent.&lt;br /&gt;
This is the final part of this project that I am working on and it is all at the level of SQL.&lt;br /&gt;
See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\db\joins&amp;lt;/code&amp;gt; for my attempts to create a clean mapping.&lt;br /&gt;
Optimistically speaking, the data generated here should be superset of the data present in the Patent Assignment Data Restructure project.&lt;br /&gt;
&lt;br /&gt;
Note that as of the beginning of August 2017, this part '''has not been completed.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Intuition ===&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;assignments_longform.last_update_date&amp;lt;/code&amp;gt; to find current/latest (or first/earliest) date of assignment. Then match with &amp;lt;code&amp;gt;properties.docid&amp;lt;/code&amp;gt; on &amp;lt;code&amp;gt;reelno, frameno&amp;lt;/code&amp;gt; to find patent application id. With this mapping to granted patents, we can discover the details of the original granted patent. And with the right date and reelno and frameno, we can match to the &amp;lt;code&amp;gt;assignees&amp;lt;/code&amp;gt; table and get fine granularity addresses.&lt;br /&gt;
&lt;br /&gt;
== Related Pages ==&lt;br /&gt;
&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries, Summer 2017 by this guy]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification, Summer 2017 based on tables from Assignment Data Restructure]]&lt;br /&gt;
* [[Patent_Assignment_Data_Restructure|Assignment Data Restructure, Spring 2017 by Marcela and Sonia]]&lt;br /&gt;
* [[Redesigning_Patent_Database|Redesigning Patent Database, Spring 2017 by Shelby]]&lt;br /&gt;
* [[Patent_Data_Cleanup_(June_2016)|Patent Data Cleanup, June 2016 by Marcela]]&lt;br /&gt;
* [[Patent_Data|Patent Data, Spring 2016 by Marcela]] &lt;br /&gt;
* [[Lex_Machina|Lex Machina]]&lt;br /&gt;
* [[USPTO_Patent_Litigation_Data|USPTO Patent Litigation Research Dataset by Ed]]&lt;br /&gt;
* [[Patent_Litigation_and_Review|Patent Litigation and Review by Marcela]]&lt;br /&gt;
* [[Bag_of_Words_Analysis_of_Patent_Data|Bag of Words Analysis]]&lt;br /&gt;
* [[Patent|Existing Database Schema]]&lt;br /&gt;
* [[Oliver_Chang_(Work_Log)|My Work Log]]&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&lt;br /&gt;
* Understanding Assignment Data: [https://www.uspto.gov/sites/default/files/documents/USPTO_Patents_Assignment_Dataset_WP.pdf USPTO Documentation on their cleanup of this data]&lt;br /&gt;
* [https://bulkdata.uspto.gov/data2/patent/grant/redbook/fulltext/1976/PatentFullTextAPSDoc_GreenBook.pdf USPTO Green Book (APS) Documentation]&lt;br /&gt;
* [https://bulkdata.uspto.gov/ USPTO Bulk Data Storage System (BDSS)]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Builder_pattern Builder Pattern in Object-Oriented Programming]&lt;br /&gt;
* [https://rdp.mcnaircenter.org/codebase/Repository/ReproduciblePatent Git Repository]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Reproducible_Patent_Data&amp;diff=21419</id>
		<title>Reproducible Patent Data</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Reproducible_Patent_Data&amp;diff=21419"/>
		<updated>2017-10-31T22:43:00Z</updated>

		<summary type="html">&lt;p&gt;OliverC: /* Database */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{McNair Projects&lt;br /&gt;
|Has Image=Uspto web logo.jpg&lt;br /&gt;
|Has title=Reproducible Patent Data&lt;br /&gt;
|Has owner=Oliver Chang&lt;br /&gt;
|Has start date=May 17&lt;br /&gt;
|Has project status=Active&lt;br /&gt;
|Does subsume=Redesigning Patent Database, Patent Assignment Data Restructure,&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A continuation of [[Redesigning Patent Database]] that aims to write faster, more centralized code to deal with data from the United States Patent and Trademark Office (USPTO). By having an end-to-end pipeline we can easily reproduce or update data without worrying about unintentional side effects or missing data.&lt;br /&gt;
&lt;br /&gt;
== Quickstart ==&lt;br /&gt;
&lt;br /&gt;
To get up and running with the code, do the following:&lt;br /&gt;
&lt;br /&gt;
# Clone the git project (link at end of page) to your user directory&lt;br /&gt;
# Launch IntelliJ with &amp;gt;= Java 8 and Maven configured (default version installed on the RDP is setup to do this)&lt;br /&gt;
# Open project in IntelliJ&lt;br /&gt;
# Create an empty database (see [[#Database]])&lt;br /&gt;
# Run the table creation scripts in &amp;lt;code&amp;gt;src/db/schemas/&amp;lt;/code&amp;gt; in your new database&lt;br /&gt;
# Modify the constant &amp;lt;code&amp;gt;DATABASE_NAME&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\postgres\DatabaseHelper.java&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run the Driver scripts in IntelliJ with the correct value for &amp;lt;code&amp;gt;DATA_DIRECTORY&amp;lt;/code&amp;gt; (or run &amp;lt;code&amp;gt;RunInitialImport.java&amp;lt;/code&amp;gt; which will do all of the data directories for that patent item type)&lt;br /&gt;
# [Take a really, really long lunch...in total should take no more than five hours to load data on RDP]&lt;br /&gt;
# Run scripts in &amp;lt;code&amp;gt;src/db/constraints&amp;lt;/code&amp;gt; to check data assumptions&lt;br /&gt;
# That's it!&lt;br /&gt;
&lt;br /&gt;
== Directory Layout ==&lt;br /&gt;
&lt;br /&gt;
=== Where is the Data? ===&lt;br /&gt;
&lt;br /&gt;
==== Directories ====&lt;br /&gt;
&lt;br /&gt;
All of the information for this project is located at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are several interesting directories:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;data/downloads/&amp;lt;/code&amp;gt; is USPTO bulkdata, unmodified straight from the scraper&lt;br /&gt;
* &amp;lt;code&amp;gt;data/extracts/&amp;lt;/code&amp;gt; is a directory of a strict subset of the information stored in &amp;lt;code&amp;gt;data/downloads/&amp;lt;/code&amp;gt;. It is the result of running a bulk 7-zip job on that directory to get everything unzipped in a flat data structure. Note that these files have the USPTO modified-by time since that metadata is stored in the zipfiles. To extract files in this nice format, select all of the zipfiles and setup an extraction job like in this [[media:7zip-params.png|screenshot]]&lt;br /&gt;
* &amp;lt;code&amp;gt;data/backups/&amp;lt;/code&amp;gt; is a 7zip'd backup of the corresponding directory in extracts&lt;br /&gt;
* &amp;lt;code&amp;gt;src/&amp;lt;/code&amp;gt; is the main code repository for the java project&lt;br /&gt;
&lt;br /&gt;
==== Input Files ====&lt;br /&gt;
&lt;br /&gt;
All of the text-only Red Book files for '''granted patents''' from 1976 to 2016, inclusive. To find a specific year's XML file, find it in&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\granted\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find application data''' from 2001 to 2016, inclusive, look in&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\applications\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find assignment data''', look in &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\granted\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find maintenance fee data''', look in &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\downloads\maintenance\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Where is the Code? ===&lt;br /&gt;
&lt;br /&gt;
The code has the same parent directory as the data, so it is at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src&amp;lt;/code&amp;gt;. You might notice a lot of single-entry directories; this is an idiomatic Java pattern that is used for package separation. If using IntelliJ or some other IDE, these directories are a bit less annoying.&lt;br /&gt;
&lt;br /&gt;
The development environment is Java 8 JDK, IntelliJ Ultimate IDE, Maven build tools, and git VCS.&lt;br /&gt;
&lt;br /&gt;
The git repository can be found at https://rdp.mcnaircenter.org/codebase/Repository/ReproduciblePatent&lt;br /&gt;
&lt;br /&gt;
==== Prior Art ====&lt;br /&gt;
&lt;br /&gt;
This tool is not so concerned with adding new functionality; rather, it aims to take a bunch of spread out Perl scripts and create a faster system that is easier to work with. As such, its functionality is largely stolen from those scripts:&lt;br /&gt;
&lt;br /&gt;
* Downloader: &amp;lt;code&amp;gt;E:\McNair\Software\Scripts\Patent\USPTO_Parser.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
* XML Splitter: &amp;lt;code&amp;gt;E:\McNair\PatentData\splitter.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
* XML Parsing: &amp;lt;code&amp;gt;E:\McNair\PatentData\Processed\xmlparser_4.5_4.4_4.3.pl&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;E:\McNair\PatentData\Processed\*.pm&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, I used several non-standard Java libraries listed below:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/mashape/unirest-java/ Unirest] for easy HTTP requests (MIT License)&lt;br /&gt;
* [https://github.com/google/guava Google Guava] for immutable collections and Stream utilities (Apache v2.0 License)&lt;br /&gt;
* [https://github.com/jhy/jsoup/ jsoup] for HTML parsing (MIT License)&lt;br /&gt;
* [http://commons.apache.org/proper/commons-codec/ Apache Commons Codec] (Apache v2.0 License)&lt;br /&gt;
* [http://commons.apache.org/proper/commons-lang/ Apache Commons Lang v3] (Apache v2.0 License)&lt;br /&gt;
* [https://mvnrepository.com/artifact/org.jetbrains/annotations/15.0 Jetbrains Annotations] for enhanced null checks (Apache v2.0 License)&lt;br /&gt;
* [http://search.maven.org/#artifactdetails%7Corg.postgresql%7Cpostgresql%7C42.1.1.jre7%7Cbundle PostgreSQL JDBC] (BSD 3-clause per https://github.com/pgjdbc/pgjdbc-jre7/blob/master/LICENSE)&lt;br /&gt;
&lt;br /&gt;
If using maven, these dependencies are listed and should automatically be setup.&lt;br /&gt;
&lt;br /&gt;
==== Using Code ====&lt;br /&gt;
&lt;br /&gt;
Any file with a line that says &amp;lt;code&amp;gt;public static void main(String[] args) {&amp;lt;/code&amp;gt; can be run as a standalone file. The easiest way to do this is to load the project and then the file in IntelliJ and click the little green play arrow next to this bit of code.&lt;br /&gt;
&lt;br /&gt;
The code can also be run via the standard &amp;lt;code&amp;gt;javac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;java&amp;lt;/code&amp;gt; commands but since this project has a complicated structure you end up having to run commands like &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;C:\Program Files\Java\jdk1.8.0_131\bin\java&amp;quot; &amp;quot;-javaagent:C:\Users\OliverC\IntelliJ IDEA 2017.1.3\lib\idea_rt.jar=62364:C:\Users\OliverC\IntelliJ IDEA 2017.1.3\bin&amp;quot; -Dfile.encoding=UTF-8 -classpath &amp;quot;[...contents truncated...];C:\Users\OliverC\.m2\repository\org\postgresql\postgresql\42.1.1\postgresql-42.1.1.jar&amp;quot; org.bakerinstitute.mcnair.uspto_assignments.XmlDriver&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to include all of the runtime dependencies and it's just not worth it.&lt;br /&gt;
&lt;br /&gt;
==== Altering Code ====&lt;br /&gt;
&lt;br /&gt;
* Use the IntelliJ command Reformat code (found in the menus at &amp;lt;code&amp;gt;Code &amp;gt; Reformat Code&amp;lt;/code&amp;gt;&lt;br /&gt;
* Use the optimize imports function found under the same menu&lt;br /&gt;
* Use spaces for indentation&lt;br /&gt;
* Loosely try to keep lines below 120 characters&lt;br /&gt;
* Commit changes to the Git remote repository &amp;quot;bonobo&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Schema Reconciliation ==&lt;br /&gt;
&lt;br /&gt;
For the work by Joe, see the [[Patent Schema Reconciliation]] page &lt;br /&gt;
&lt;br /&gt;
=== Patents (Granted) ===&lt;br /&gt;
&lt;br /&gt;
See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\examples\granted&amp;lt;/code&amp;gt; for extracted examples of what specific data is available for a sample of the data.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Granted Patent Data Formats&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Dates Used !! scope=&amp;quot;col&amp;quot; | Format !! scope=&amp;quot;col&amp;quot; | Location !! scope=&amp;quot;col&amp;quot; | Supported? !! scope=&amp;quot;col&amp;quot; | Utility !! scope=&amp;quot;col&amp;quot; | Reissue !! scope=&amp;quot;col&amp;quot; | Design !! scope=&amp;quot;col&amp;quot; | Plant&lt;br /&gt;
|-&lt;br /&gt;
|January 1976 to December 2001&lt;br /&gt;
|APS&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;del&amp;gt;January 2001 to December 2001&amp;lt;/del&amp;gt;&lt;br /&gt;
|&amp;lt;del&amp;gt;SGML&amp;lt;/del&amp;gt;&lt;br /&gt;
|Ignored; use concurrently recorded APS data&lt;br /&gt;
|No&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|-&lt;br /&gt;
|January 2002 to December 2004&lt;br /&gt;
|XML Version 2.5&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/blunderyears&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2005 to December 2005&lt;br /&gt;
|XML Version 4.0 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2006 to December 2006&lt;br /&gt;
|XML Version 4.1 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2007 to December 2012&lt;br /&gt;
|XML Version 4.2 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2013 to September 24, 2013&lt;br /&gt;
|XML Version 4.3 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|October 8, 2013 to December 2014&lt;br /&gt;
|XML Version 4.4 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2015 to December 2016&lt;br /&gt;
|XML Version 4.5 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== APS Rosetta Stone ===&lt;br /&gt;
&lt;br /&gt;
The Advanced Patent System (APS) is a fixed-width text format used to store historical patent grant data. The documentation for this sucks; there are pages missing at random. Luckily, we only care about the content contained here: [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]].&lt;br /&gt;
&lt;br /&gt;
It's worth mentioning that the APS contains an advanced text markup system for chemical formulae, basic text markup, tables, etc. that can lead to seemingly garbled text that is perfectly well-formed.&lt;br /&gt;
&lt;br /&gt;
==== APS Gotchas ====&lt;br /&gt;
&lt;br /&gt;
* PATN.WKU is the granted patent number. It is 7 digits while the spec promises 6 digits. The rightmost digit is a check digit modulus 11. See [[File:Aps-wku-modulus11.pdf]] for the words from the horse's mouth.&lt;br /&gt;
&lt;br /&gt;
=== Patents (Applications) ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Patent Application Data Formats&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Dates Used !! scope=&amp;quot;col&amp;quot; | Format !! scope=&amp;quot;col&amp;quot; | Location !! scope=&amp;quot;col&amp;quot; | Supported by Parser?&lt;br /&gt;
|-&lt;br /&gt;
|March 15, 2001 to December 2001&lt;br /&gt;
|XML Version 1.5&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Yes, for basic information, inventors, and correspondents&lt;br /&gt;
|-&lt;br /&gt;
|January 2002 to December 2004&lt;br /&gt;
|XML Version 1.6&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2005 to December 2005&lt;br /&gt;
|XML Version 4.0 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2006 to December 2006&lt;br /&gt;
|XML Version 4.1 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2007 to December 2012&lt;br /&gt;
|XML Version 4.2 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2013 to December 2014&lt;br /&gt;
|XML Version 4.3 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2015 to ''Present''&lt;br /&gt;
|XML Version 4.4 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Database ==&lt;br /&gt;
&lt;br /&gt;
Because there isn't a compelling reason not to, I used the existing PostgreSQL infrastructure on the RDP.&lt;br /&gt;
The &amp;quot;Java Way&amp;quot; of interacting with databases is the Java Database Connectivity API (JDBC), an implementation-agnostic API for interacting with databases.&lt;br /&gt;
This project uses the stock [https://jdbc.postgresql.org/ Postgres JDBC], version 42.1.1&lt;br /&gt;
&lt;br /&gt;
=== Create an empty database on RDP ===&lt;br /&gt;
&lt;br /&gt;
To create an empty database, run this command: &amp;lt;code&amp;gt;$ createdb --username=postgres database-name-goes-here # password is tabspaceenter&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstraction Layer ===&lt;br /&gt;
&lt;br /&gt;
Since writing raw SQL is a bit cumbersome and error-prone, I have added some abstraction layers that make it much easier to quickly add bulk data. By using Postgres's &amp;lt;code&amp;gt;CopyManager&amp;lt;/code&amp;gt; class, we buffer SQL copy commands in memory (as many as possible) and then flush these rows. To understand how the abstraction layers work, see the code in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\postgres&amp;lt;/code&amp;gt;. See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\models\GrantedPatent.java&amp;lt;/code&amp;gt; for '''an example of how to extend''' the abstraction layer to deal with more complex scenarios.&lt;br /&gt;
&lt;br /&gt;
=== New Table Checklist ==&lt;br /&gt;
&lt;br /&gt;
* Create schema DDL SQL code for the new table in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\db&amp;lt;/code&amp;gt;&lt;br /&gt;
* Run the schema creation&lt;br /&gt;
* Create an enum with the same names for attributes as in the DDL (case-insensitive! prefer all-caps screaming snake case)&lt;br /&gt;
* Create a class which subclasses &amp;lt;code&amp;gt;AbstractIntertableData&amp;lt;/code&amp;gt;&lt;br /&gt;
* Inside that class, create a static class which subclasses &amp;lt;code&amp;gt;AbstractTableMetadata&amp;lt;/code&amp;gt; and has the proper values for getTableName(), getStringColumns(), getIntColumns()&lt;br /&gt;
* (Optional) Implement builder pattern&lt;br /&gt;
* (Optional) Create a custom databasehelper for complex extras (see PatentApplication and GrantedPatent for examples)&lt;br /&gt;
* Write the data to the table (see DatabaseHelper for the pattern I use)&lt;br /&gt;
&lt;br /&gt;
== Address Data ==&lt;br /&gt;
&lt;br /&gt;
To get the most granular address data (street level, or at least postcode level) about who owns patents, the path is not so straightforward because off the complicated mapping of ownership to a granted patent.&lt;br /&gt;
This is the final part of this project that I am working on and it is all at the level of SQL.&lt;br /&gt;
See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\db\joins&amp;lt;/code&amp;gt; for my attempts to create a clean mapping.&lt;br /&gt;
Optimistically speaking, the data generated here should be superset of the data present in the Patent Assignment Data Restructure project.&lt;br /&gt;
&lt;br /&gt;
Note that as of the beginning of August 2017, this part '''has not been completed.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Intuition ===&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;assignments_longform.last_update_date&amp;lt;/code&amp;gt; to find current/latest (or first/earliest) date of assignment. Then match with &amp;lt;code&amp;gt;properties.docid&amp;lt;/code&amp;gt; on &amp;lt;code&amp;gt;reelno, frameno&amp;lt;/code&amp;gt; to find patent application id. With this mapping to granted patents, we can discover the details of the original granted patent. And with the right date and reelno and frameno, we can match to the &amp;lt;code&amp;gt;assignees&amp;lt;/code&amp;gt; table and get fine granularity addresses.&lt;br /&gt;
&lt;br /&gt;
== Related Pages ==&lt;br /&gt;
&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries, Summer 2017 by this guy]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification, Summer 2017 based on tables from Assignment Data Restructure]]&lt;br /&gt;
* [[Patent_Assignment_Data_Restructure|Assignment Data Restructure, Spring 2017 by Marcela and Sonia]]&lt;br /&gt;
* [[Redesigning_Patent_Database|Redesigning Patent Database, Spring 2017 by Shelby]]&lt;br /&gt;
* [[Patent_Data_Cleanup_(June_2016)|Patent Data Cleanup, June 2016 by Marcela]]&lt;br /&gt;
* [[Patent_Data|Patent Data, Spring 2016 by Marcela]] &lt;br /&gt;
* [[Lex_Machina|Lex Machina]]&lt;br /&gt;
* [[USPTO_Patent_Litigation_Data|USPTO Patent Litigation Research Dataset by Ed]]&lt;br /&gt;
* [[Patent_Litigation_and_Review|Patent Litigation and Review by Marcela]]&lt;br /&gt;
* [[Bag_of_Words_Analysis_of_Patent_Data|Bag of Words Analysis]]&lt;br /&gt;
* [[Patent|Existing Database Schema]]&lt;br /&gt;
* [[Oliver_Chang_(Work_Log)|My Work Log]]&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&lt;br /&gt;
* Understanding Assignment Data: [https://www.uspto.gov/sites/default/files/documents/USPTO_Patents_Assignment_Dataset_WP.pdf USPTO Documentation on their cleanup of this data]&lt;br /&gt;
* [https://bulkdata.uspto.gov/data2/patent/grant/redbook/fulltext/1976/PatentFullTextAPSDoc_GreenBook.pdf USPTO Green Book (APS) Documentation]&lt;br /&gt;
* [https://bulkdata.uspto.gov/ USPTO Bulk Data Storage System (BDSS)]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Builder_pattern Builder Pattern in Object-Oriented Programming]&lt;br /&gt;
* [https://rdp.mcnaircenter.org/codebase/Repository/ReproduciblePatent Git Repository]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Reproducible_Patent_Data&amp;diff=21418</id>
		<title>Reproducible Patent Data</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Reproducible_Patent_Data&amp;diff=21418"/>
		<updated>2017-10-31T22:33:45Z</updated>

		<summary type="html">&lt;p&gt;OliverC: /* Patents (Applications) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{McNair Projects&lt;br /&gt;
|Has Image=Uspto web logo.jpg&lt;br /&gt;
|Has title=Reproducible Patent Data&lt;br /&gt;
|Has owner=Oliver Chang&lt;br /&gt;
|Has start date=May 17&lt;br /&gt;
|Has project status=Active&lt;br /&gt;
|Does subsume=Redesigning Patent Database, Patent Assignment Data Restructure,&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A continuation of [[Redesigning Patent Database]] that aims to write faster, more centralized code to deal with data from the United States Patent and Trademark Office (USPTO). By having an end-to-end pipeline we can easily reproduce or update data without worrying about unintentional side effects or missing data.&lt;br /&gt;
&lt;br /&gt;
== Quickstart ==&lt;br /&gt;
&lt;br /&gt;
To get up and running with the code, do the following:&lt;br /&gt;
&lt;br /&gt;
# Clone the git project (link at end of page) to your user directory&lt;br /&gt;
# Launch IntelliJ with &amp;gt;= Java 8 and Maven configured (default version installed on the RDP is setup to do this)&lt;br /&gt;
# Open project in IntelliJ&lt;br /&gt;
# Create an empty database (see [[#Database]])&lt;br /&gt;
# Run the table creation scripts in &amp;lt;code&amp;gt;src/db/schemas/&amp;lt;/code&amp;gt; in your new database&lt;br /&gt;
# Modify the constant &amp;lt;code&amp;gt;DATABASE_NAME&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\postgres\DatabaseHelper.java&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run the Driver scripts in IntelliJ with the correct value for &amp;lt;code&amp;gt;DATA_DIRECTORY&amp;lt;/code&amp;gt; (or run &amp;lt;code&amp;gt;RunInitialImport.java&amp;lt;/code&amp;gt; which will do all of the data directories for that patent item type)&lt;br /&gt;
# [Take a really, really long lunch...in total should take no more than five hours to load data on RDP]&lt;br /&gt;
# Run scripts in &amp;lt;code&amp;gt;src/db/constraints&amp;lt;/code&amp;gt; to check data assumptions&lt;br /&gt;
# That's it!&lt;br /&gt;
&lt;br /&gt;
== Directory Layout ==&lt;br /&gt;
&lt;br /&gt;
=== Where is the Data? ===&lt;br /&gt;
&lt;br /&gt;
==== Directories ====&lt;br /&gt;
&lt;br /&gt;
All of the information for this project is located at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are several interesting directories:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;data/downloads/&amp;lt;/code&amp;gt; is USPTO bulkdata, unmodified straight from the scraper&lt;br /&gt;
* &amp;lt;code&amp;gt;data/extracts/&amp;lt;/code&amp;gt; is a directory of a strict subset of the information stored in &amp;lt;code&amp;gt;data/downloads/&amp;lt;/code&amp;gt;. It is the result of running a bulk 7-zip job on that directory to get everything unzipped in a flat data structure. Note that these files have the USPTO modified-by time since that metadata is stored in the zipfiles. To extract files in this nice format, select all of the zipfiles and setup an extraction job like in this [[media:7zip-params.png|screenshot]]&lt;br /&gt;
* &amp;lt;code&amp;gt;data/backups/&amp;lt;/code&amp;gt; is a 7zip'd backup of the corresponding directory in extracts&lt;br /&gt;
* &amp;lt;code&amp;gt;src/&amp;lt;/code&amp;gt; is the main code repository for the java project&lt;br /&gt;
&lt;br /&gt;
==== Input Files ====&lt;br /&gt;
&lt;br /&gt;
All of the text-only Red Book files for '''granted patents''' from 1976 to 2016, inclusive. To find a specific year's XML file, find it in&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\granted\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find application data''' from 2001 to 2016, inclusive, look in&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\applications\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find assignment data''', look in &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\granted\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find maintenance fee data''', look in &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\downloads\maintenance\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Where is the Code? ===&lt;br /&gt;
&lt;br /&gt;
The code has the same parent directory as the data, so it is at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src&amp;lt;/code&amp;gt;. You might notice a lot of single-entry directories; this is an idiomatic Java pattern that is used for package separation. If using IntelliJ or some other IDE, these directories are a bit less annoying.&lt;br /&gt;
&lt;br /&gt;
The development environment is Java 8 JDK, IntelliJ Ultimate IDE, Maven build tools, and git VCS.&lt;br /&gt;
&lt;br /&gt;
The git repository can be found at https://rdp.mcnaircenter.org/codebase/Repository/ReproduciblePatent&lt;br /&gt;
&lt;br /&gt;
==== Prior Art ====&lt;br /&gt;
&lt;br /&gt;
This tool is not so concerned with adding new functionality; rather, it aims to take a bunch of spread out Perl scripts and create a faster system that is easier to work with. As such, its functionality is largely stolen from those scripts:&lt;br /&gt;
&lt;br /&gt;
* Downloader: &amp;lt;code&amp;gt;E:\McNair\Software\Scripts\Patent\USPTO_Parser.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
* XML Splitter: &amp;lt;code&amp;gt;E:\McNair\PatentData\splitter.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
* XML Parsing: &amp;lt;code&amp;gt;E:\McNair\PatentData\Processed\xmlparser_4.5_4.4_4.3.pl&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;E:\McNair\PatentData\Processed\*.pm&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, I used several non-standard Java libraries listed below:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/mashape/unirest-java/ Unirest] for easy HTTP requests (MIT License)&lt;br /&gt;
* [https://github.com/google/guava Google Guava] for immutable collections and Stream utilities (Apache v2.0 License)&lt;br /&gt;
* [https://github.com/jhy/jsoup/ jsoup] for HTML parsing (MIT License)&lt;br /&gt;
* [http://commons.apache.org/proper/commons-codec/ Apache Commons Codec] (Apache v2.0 License)&lt;br /&gt;
* [http://commons.apache.org/proper/commons-lang/ Apache Commons Lang v3] (Apache v2.0 License)&lt;br /&gt;
* [https://mvnrepository.com/artifact/org.jetbrains/annotations/15.0 Jetbrains Annotations] for enhanced null checks (Apache v2.0 License)&lt;br /&gt;
* [http://search.maven.org/#artifactdetails%7Corg.postgresql%7Cpostgresql%7C42.1.1.jre7%7Cbundle PostgreSQL JDBC] (BSD 3-clause per https://github.com/pgjdbc/pgjdbc-jre7/blob/master/LICENSE)&lt;br /&gt;
&lt;br /&gt;
If using maven, these dependencies are listed and should automatically be setup.&lt;br /&gt;
&lt;br /&gt;
==== Using Code ====&lt;br /&gt;
&lt;br /&gt;
Any file with a line that says &amp;lt;code&amp;gt;public static void main(String[] args) {&amp;lt;/code&amp;gt; can be run as a standalone file. The easiest way to do this is to load the project and then the file in IntelliJ and click the little green play arrow next to this bit of code.&lt;br /&gt;
&lt;br /&gt;
The code can also be run via the standard &amp;lt;code&amp;gt;javac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;java&amp;lt;/code&amp;gt; commands but since this project has a complicated structure you end up having to run commands like &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;C:\Program Files\Java\jdk1.8.0_131\bin\java&amp;quot; &amp;quot;-javaagent:C:\Users\OliverC\IntelliJ IDEA 2017.1.3\lib\idea_rt.jar=62364:C:\Users\OliverC\IntelliJ IDEA 2017.1.3\bin&amp;quot; -Dfile.encoding=UTF-8 -classpath &amp;quot;[...contents truncated...];C:\Users\OliverC\.m2\repository\org\postgresql\postgresql\42.1.1\postgresql-42.1.1.jar&amp;quot; org.bakerinstitute.mcnair.uspto_assignments.XmlDriver&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to include all of the runtime dependencies and it's just not worth it.&lt;br /&gt;
&lt;br /&gt;
==== Altering Code ====&lt;br /&gt;
&lt;br /&gt;
* Use the IntelliJ command Reformat code (found in the menus at &amp;lt;code&amp;gt;Code &amp;gt; Reformat Code&amp;lt;/code&amp;gt;&lt;br /&gt;
* Use the optimize imports function found under the same menu&lt;br /&gt;
* Use spaces for indentation&lt;br /&gt;
* Loosely try to keep lines below 120 characters&lt;br /&gt;
* Commit changes to the Git remote repository &amp;quot;bonobo&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Schema Reconciliation ==&lt;br /&gt;
&lt;br /&gt;
For the work by Joe, see the [[Patent Schema Reconciliation]] page &lt;br /&gt;
&lt;br /&gt;
=== Patents (Granted) ===&lt;br /&gt;
&lt;br /&gt;
See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\examples\granted&amp;lt;/code&amp;gt; for extracted examples of what specific data is available for a sample of the data.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Granted Patent Data Formats&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Dates Used !! scope=&amp;quot;col&amp;quot; | Format !! scope=&amp;quot;col&amp;quot; | Location !! scope=&amp;quot;col&amp;quot; | Supported? !! scope=&amp;quot;col&amp;quot; | Utility !! scope=&amp;quot;col&amp;quot; | Reissue !! scope=&amp;quot;col&amp;quot; | Design !! scope=&amp;quot;col&amp;quot; | Plant&lt;br /&gt;
|-&lt;br /&gt;
|January 1976 to December 2001&lt;br /&gt;
|APS&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;del&amp;gt;January 2001 to December 2001&amp;lt;/del&amp;gt;&lt;br /&gt;
|&amp;lt;del&amp;gt;SGML&amp;lt;/del&amp;gt;&lt;br /&gt;
|Ignored; use concurrently recorded APS data&lt;br /&gt;
|No&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|-&lt;br /&gt;
|January 2002 to December 2004&lt;br /&gt;
|XML Version 2.5&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/blunderyears&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2005 to December 2005&lt;br /&gt;
|XML Version 4.0 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2006 to December 2006&lt;br /&gt;
|XML Version 4.1 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2007 to December 2012&lt;br /&gt;
|XML Version 4.2 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2013 to September 24, 2013&lt;br /&gt;
|XML Version 4.3 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|October 8, 2013 to December 2014&lt;br /&gt;
|XML Version 4.4 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2015 to December 2016&lt;br /&gt;
|XML Version 4.5 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== APS Rosetta Stone ===&lt;br /&gt;
&lt;br /&gt;
The Advanced Patent System (APS) is a fixed-width text format used to store historical patent grant data. The documentation for this sucks; there are pages missing at random. Luckily, we only care about the content contained here: [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]].&lt;br /&gt;
&lt;br /&gt;
It's worth mentioning that the APS contains an advanced text markup system for chemical formulae, basic text markup, tables, etc. that can lead to seemingly garbled text that is perfectly well-formed.&lt;br /&gt;
&lt;br /&gt;
==== APS Gotchas ====&lt;br /&gt;
&lt;br /&gt;
* PATN.WKU is the granted patent number. It is 7 digits while the spec promises 6 digits. The rightmost digit is a check digit modulus 11. See [[File:Aps-wku-modulus11.pdf]] for the words from the horse's mouth.&lt;br /&gt;
&lt;br /&gt;
=== Patents (Applications) ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Patent Application Data Formats&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Dates Used !! scope=&amp;quot;col&amp;quot; | Format !! scope=&amp;quot;col&amp;quot; | Location !! scope=&amp;quot;col&amp;quot; | Supported by Parser?&lt;br /&gt;
|-&lt;br /&gt;
|March 15, 2001 to December 2001&lt;br /&gt;
|XML Version 1.5&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Yes, for basic information, inventors, and correspondents&lt;br /&gt;
|-&lt;br /&gt;
|January 2002 to December 2004&lt;br /&gt;
|XML Version 1.6&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2005 to December 2005&lt;br /&gt;
|XML Version 4.0 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2006 to December 2006&lt;br /&gt;
|XML Version 4.1 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2007 to December 2012&lt;br /&gt;
|XML Version 4.2 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2013 to December 2014&lt;br /&gt;
|XML Version 4.3 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|-&lt;br /&gt;
|January 2015 to ''Present''&lt;br /&gt;
|XML Version 4.4 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Ditto&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Database ==&lt;br /&gt;
&lt;br /&gt;
Because there isn't a compelling reason not to, I used the existing PostgreSQL infrastructure on the RDP.&lt;br /&gt;
The &amp;quot;Java Way&amp;quot; of interacting with databases is the Java Database Connectivity API (JDBC), an implementation-agnostic API for interacting with databases.&lt;br /&gt;
This project uses the stock [https://jdbc.postgresql.org/ Postgres JDBC], version 42.1.1&lt;br /&gt;
&lt;br /&gt;
=== Create an empty database on RDP ===&lt;br /&gt;
&lt;br /&gt;
To create an empty database, run this command: &amp;lt;code&amp;gt;$ createdb --username=postgres database-name-goes-here # password is tabspaceenter&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstraction Layer ===&lt;br /&gt;
&lt;br /&gt;
Since writing raw SQL is a bit cumbersome and error-prone, I have added some abstraction layers that make it much easier to quickly add bulk data. By using Postgres's &amp;lt;code&amp;gt;CopyManager&amp;lt;/code&amp;gt; class, we buffer SQL copy commands in memory (as many as possible) and then flush these rows. To understand how the abstraction layers work, see the code in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\postgres&amp;lt;/code&amp;gt;. See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\models\GrantedPatent.java&amp;lt;/code&amp;gt; for '''an example of how to extend''' the abstraction layer to deal with more complex scenarios.&lt;br /&gt;
&lt;br /&gt;
== Address Data ==&lt;br /&gt;
&lt;br /&gt;
To get the most granular address data (street level, or at least postcode level) about who owns patents, the path is not so straightforward because off the complicated mapping of ownership to a granted patent.&lt;br /&gt;
This is the final part of this project that I am working on and it is all at the level of SQL.&lt;br /&gt;
See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\db\joins&amp;lt;/code&amp;gt; for my attempts to create a clean mapping.&lt;br /&gt;
Optimistically speaking, the data generated here should be superset of the data present in the Patent Assignment Data Restructure project.&lt;br /&gt;
&lt;br /&gt;
Note that as of the beginning of August 2017, this part '''has not been completed.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Intuition ===&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;assignments_longform.last_update_date&amp;lt;/code&amp;gt; to find current/latest (or first/earliest) date of assignment. Then match with &amp;lt;code&amp;gt;properties.docid&amp;lt;/code&amp;gt; on &amp;lt;code&amp;gt;reelno, frameno&amp;lt;/code&amp;gt; to find patent application id. With this mapping to granted patents, we can discover the details of the original granted patent. And with the right date and reelno and frameno, we can match to the &amp;lt;code&amp;gt;assignees&amp;lt;/code&amp;gt; table and get fine granularity addresses.&lt;br /&gt;
&lt;br /&gt;
== Related Pages ==&lt;br /&gt;
&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries, Summer 2017 by this guy]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification, Summer 2017 based on tables from Assignment Data Restructure]]&lt;br /&gt;
* [[Patent_Assignment_Data_Restructure|Assignment Data Restructure, Spring 2017 by Marcela and Sonia]]&lt;br /&gt;
* [[Redesigning_Patent_Database|Redesigning Patent Database, Spring 2017 by Shelby]]&lt;br /&gt;
* [[Patent_Data_Cleanup_(June_2016)|Patent Data Cleanup, June 2016 by Marcela]]&lt;br /&gt;
* [[Patent_Data|Patent Data, Spring 2016 by Marcela]] &lt;br /&gt;
* [[Lex_Machina|Lex Machina]]&lt;br /&gt;
* [[USPTO_Patent_Litigation_Data|USPTO Patent Litigation Research Dataset by Ed]]&lt;br /&gt;
* [[Patent_Litigation_and_Review|Patent Litigation and Review by Marcela]]&lt;br /&gt;
* [[Bag_of_Words_Analysis_of_Patent_Data|Bag of Words Analysis]]&lt;br /&gt;
* [[Patent|Existing Database Schema]]&lt;br /&gt;
* [[Oliver_Chang_(Work_Log)|My Work Log]]&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&lt;br /&gt;
* Understanding Assignment Data: [https://www.uspto.gov/sites/default/files/documents/USPTO_Patents_Assignment_Dataset_WP.pdf USPTO Documentation on their cleanup of this data]&lt;br /&gt;
* [https://bulkdata.uspto.gov/data2/patent/grant/redbook/fulltext/1976/PatentFullTextAPSDoc_GreenBook.pdf USPTO Green Book (APS) Documentation]&lt;br /&gt;
* [https://bulkdata.uspto.gov/ USPTO Bulk Data Storage System (BDSS)]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Builder_pattern Builder Pattern in Object-Oriented Programming]&lt;br /&gt;
* [https://rdp.mcnaircenter.org/codebase/Repository/ReproduciblePatent Git Repository]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Reproducible_Patent_Data&amp;diff=21417</id>
		<title>Reproducible Patent Data</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Reproducible_Patent_Data&amp;diff=21417"/>
		<updated>2017-10-31T22:31:08Z</updated>

		<summary type="html">&lt;p&gt;OliverC: /* Quickstart */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{McNair Projects&lt;br /&gt;
|Has Image=Uspto web logo.jpg&lt;br /&gt;
|Has title=Reproducible Patent Data&lt;br /&gt;
|Has owner=Oliver Chang&lt;br /&gt;
|Has start date=May 17&lt;br /&gt;
|Has project status=Active&lt;br /&gt;
|Does subsume=Redesigning Patent Database, Patent Assignment Data Restructure,&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A continuation of [[Redesigning Patent Database]] that aims to write faster, more centralized code to deal with data from the United States Patent and Trademark Office (USPTO). By having an end-to-end pipeline we can easily reproduce or update data without worrying about unintentional side effects or missing data.&lt;br /&gt;
&lt;br /&gt;
== Quickstart ==&lt;br /&gt;
&lt;br /&gt;
To get up and running with the code, do the following:&lt;br /&gt;
&lt;br /&gt;
# Clone the git project (link at end of page) to your user directory&lt;br /&gt;
# Launch IntelliJ with &amp;gt;= Java 8 and Maven configured (default version installed on the RDP is setup to do this)&lt;br /&gt;
# Open project in IntelliJ&lt;br /&gt;
# Create an empty database (see [[#Database]])&lt;br /&gt;
# Run the table creation scripts in &amp;lt;code&amp;gt;src/db/schemas/&amp;lt;/code&amp;gt; in your new database&lt;br /&gt;
# Modify the constant &amp;lt;code&amp;gt;DATABASE_NAME&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\postgres\DatabaseHelper.java&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run the Driver scripts in IntelliJ with the correct value for &amp;lt;code&amp;gt;DATA_DIRECTORY&amp;lt;/code&amp;gt; (or run &amp;lt;code&amp;gt;RunInitialImport.java&amp;lt;/code&amp;gt; which will do all of the data directories for that patent item type)&lt;br /&gt;
# [Take a really, really long lunch...in total should take no more than five hours to load data on RDP]&lt;br /&gt;
# Run scripts in &amp;lt;code&amp;gt;src/db/constraints&amp;lt;/code&amp;gt; to check data assumptions&lt;br /&gt;
# That's it!&lt;br /&gt;
&lt;br /&gt;
== Directory Layout ==&lt;br /&gt;
&lt;br /&gt;
=== Where is the Data? ===&lt;br /&gt;
&lt;br /&gt;
==== Directories ====&lt;br /&gt;
&lt;br /&gt;
All of the information for this project is located at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are several interesting directories:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;data/downloads/&amp;lt;/code&amp;gt; is USPTO bulkdata, unmodified straight from the scraper&lt;br /&gt;
* &amp;lt;code&amp;gt;data/extracts/&amp;lt;/code&amp;gt; is a directory of a strict subset of the information stored in &amp;lt;code&amp;gt;data/downloads/&amp;lt;/code&amp;gt;. It is the result of running a bulk 7-zip job on that directory to get everything unzipped in a flat data structure. Note that these files have the USPTO modified-by time since that metadata is stored in the zipfiles. To extract files in this nice format, select all of the zipfiles and setup an extraction job like in this [[media:7zip-params.png|screenshot]]&lt;br /&gt;
* &amp;lt;code&amp;gt;data/backups/&amp;lt;/code&amp;gt; is a 7zip'd backup of the corresponding directory in extracts&lt;br /&gt;
* &amp;lt;code&amp;gt;src/&amp;lt;/code&amp;gt; is the main code repository for the java project&lt;br /&gt;
&lt;br /&gt;
==== Input Files ====&lt;br /&gt;
&lt;br /&gt;
All of the text-only Red Book files for '''granted patents''' from 1976 to 2016, inclusive. To find a specific year's XML file, find it in&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\granted\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find application data''' from 2001 to 2016, inclusive, look in&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\applications\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find assignment data''', look in &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\granted\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find maintenance fee data''', look in &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\downloads\maintenance\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Where is the Code? ===&lt;br /&gt;
&lt;br /&gt;
The code has the same parent directory as the data, so it is at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src&amp;lt;/code&amp;gt;. You might notice a lot of single-entry directories; this is an idiomatic Java pattern that is used for package separation. If using IntelliJ or some other IDE, these directories are a bit less annoying.&lt;br /&gt;
&lt;br /&gt;
The development environment is Java 8 JDK, IntelliJ Ultimate IDE, Maven build tools, and git VCS.&lt;br /&gt;
&lt;br /&gt;
The git repository can be found at https://rdp.mcnaircenter.org/codebase/Repository/ReproduciblePatent&lt;br /&gt;
&lt;br /&gt;
==== Prior Art ====&lt;br /&gt;
&lt;br /&gt;
This tool is not so concerned with adding new functionality; rather, it aims to take a bunch of spread out Perl scripts and create a faster system that is easier to work with. As such, its functionality is largely stolen from those scripts:&lt;br /&gt;
&lt;br /&gt;
* Downloader: &amp;lt;code&amp;gt;E:\McNair\Software\Scripts\Patent\USPTO_Parser.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
* XML Splitter: &amp;lt;code&amp;gt;E:\McNair\PatentData\splitter.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
* XML Parsing: &amp;lt;code&amp;gt;E:\McNair\PatentData\Processed\xmlparser_4.5_4.4_4.3.pl&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;E:\McNair\PatentData\Processed\*.pm&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, I used several non-standard Java libraries listed below:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/mashape/unirest-java/ Unirest] for easy HTTP requests (MIT License)&lt;br /&gt;
* [https://github.com/google/guava Google Guava] for immutable collections and Stream utilities (Apache v2.0 License)&lt;br /&gt;
* [https://github.com/jhy/jsoup/ jsoup] for HTML parsing (MIT License)&lt;br /&gt;
* [http://commons.apache.org/proper/commons-codec/ Apache Commons Codec] (Apache v2.0 License)&lt;br /&gt;
* [http://commons.apache.org/proper/commons-lang/ Apache Commons Lang v3] (Apache v2.0 License)&lt;br /&gt;
* [https://mvnrepository.com/artifact/org.jetbrains/annotations/15.0 Jetbrains Annotations] for enhanced null checks (Apache v2.0 License)&lt;br /&gt;
* [http://search.maven.org/#artifactdetails%7Corg.postgresql%7Cpostgresql%7C42.1.1.jre7%7Cbundle PostgreSQL JDBC] (BSD 3-clause per https://github.com/pgjdbc/pgjdbc-jre7/blob/master/LICENSE)&lt;br /&gt;
&lt;br /&gt;
If using maven, these dependencies are listed and should automatically be setup.&lt;br /&gt;
&lt;br /&gt;
==== Using Code ====&lt;br /&gt;
&lt;br /&gt;
Any file with a line that says &amp;lt;code&amp;gt;public static void main(String[] args) {&amp;lt;/code&amp;gt; can be run as a standalone file. The easiest way to do this is to load the project and then the file in IntelliJ and click the little green play arrow next to this bit of code.&lt;br /&gt;
&lt;br /&gt;
The code can also be run via the standard &amp;lt;code&amp;gt;javac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;java&amp;lt;/code&amp;gt; commands but since this project has a complicated structure you end up having to run commands like &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;C:\Program Files\Java\jdk1.8.0_131\bin\java&amp;quot; &amp;quot;-javaagent:C:\Users\OliverC\IntelliJ IDEA 2017.1.3\lib\idea_rt.jar=62364:C:\Users\OliverC\IntelliJ IDEA 2017.1.3\bin&amp;quot; -Dfile.encoding=UTF-8 -classpath &amp;quot;[...contents truncated...];C:\Users\OliverC\.m2\repository\org\postgresql\postgresql\42.1.1\postgresql-42.1.1.jar&amp;quot; org.bakerinstitute.mcnair.uspto_assignments.XmlDriver&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to include all of the runtime dependencies and it's just not worth it.&lt;br /&gt;
&lt;br /&gt;
==== Altering Code ====&lt;br /&gt;
&lt;br /&gt;
* Use the IntelliJ command Reformat code (found in the menus at &amp;lt;code&amp;gt;Code &amp;gt; Reformat Code&amp;lt;/code&amp;gt;&lt;br /&gt;
* Use the optimize imports function found under the same menu&lt;br /&gt;
* Use spaces for indentation&lt;br /&gt;
* Loosely try to keep lines below 120 characters&lt;br /&gt;
* Commit changes to the Git remote repository &amp;quot;bonobo&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Schema Reconciliation ==&lt;br /&gt;
&lt;br /&gt;
For the work by Joe, see the [[Patent Schema Reconciliation]] page &lt;br /&gt;
&lt;br /&gt;
=== Patents (Granted) ===&lt;br /&gt;
&lt;br /&gt;
See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\examples\granted&amp;lt;/code&amp;gt; for extracted examples of what specific data is available for a sample of the data.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Granted Patent Data Formats&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Dates Used !! scope=&amp;quot;col&amp;quot; | Format !! scope=&amp;quot;col&amp;quot; | Location !! scope=&amp;quot;col&amp;quot; | Supported? !! scope=&amp;quot;col&amp;quot; | Utility !! scope=&amp;quot;col&amp;quot; | Reissue !! scope=&amp;quot;col&amp;quot; | Design !! scope=&amp;quot;col&amp;quot; | Plant&lt;br /&gt;
|-&lt;br /&gt;
|January 1976 to December 2001&lt;br /&gt;
|APS&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;del&amp;gt;January 2001 to December 2001&amp;lt;/del&amp;gt;&lt;br /&gt;
|&amp;lt;del&amp;gt;SGML&amp;lt;/del&amp;gt;&lt;br /&gt;
|Ignored; use concurrently recorded APS data&lt;br /&gt;
|No&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|-&lt;br /&gt;
|January 2002 to December 2004&lt;br /&gt;
|XML Version 2.5&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/blunderyears&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2005 to December 2005&lt;br /&gt;
|XML Version 4.0 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2006 to December 2006&lt;br /&gt;
|XML Version 4.1 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2007 to December 2012&lt;br /&gt;
|XML Version 4.2 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2013 to September 24, 2013&lt;br /&gt;
|XML Version 4.3 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|October 8, 2013 to December 2014&lt;br /&gt;
|XML Version 4.4 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2015 to December 2016&lt;br /&gt;
|XML Version 4.5 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== APS Rosetta Stone ===&lt;br /&gt;
&lt;br /&gt;
The Advanced Patent System (APS) is a fixed-width text format used to store historical patent grant data. The documentation for this sucks; there are pages missing at random. Luckily, we only care about the content contained here: [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]].&lt;br /&gt;
&lt;br /&gt;
It's worth mentioning that the APS contains an advanced text markup system for chemical formulae, basic text markup, tables, etc. that can lead to seemingly garbled text that is perfectly well-formed.&lt;br /&gt;
&lt;br /&gt;
==== APS Gotchas ====&lt;br /&gt;
&lt;br /&gt;
* PATN.WKU is the granted patent number. It is 7 digits while the spec promises 6 digits. The rightmost digit is a check digit modulus 11. See [[File:Aps-wku-modulus11.pdf]] for the words from the horse's mouth.&lt;br /&gt;
&lt;br /&gt;
=== Patents (Applications) ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Patent Application Data Formats&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Dates Used !! scope=&amp;quot;col&amp;quot; | Format !! scope=&amp;quot;col&amp;quot; | Location !! scope=&amp;quot;col&amp;quot; | Supported by Parser?&lt;br /&gt;
|-&lt;br /&gt;
|March 15, 2001 to December 2001&lt;br /&gt;
|XML Version 1.5&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: red; color: white;&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
|January 2002 to December 2004&lt;br /&gt;
|XML Version 1.6&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: red; color: white;&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
|January 2005 to December 2005&lt;br /&gt;
|XML Version 4.0 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Maybe&lt;br /&gt;
|-&lt;br /&gt;
|January 2006 to December 2006&lt;br /&gt;
|XML Version 4.1 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Maybe&lt;br /&gt;
|-&lt;br /&gt;
|January 2007 to December 2012&lt;br /&gt;
|XML Version 4.2 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Maybe&lt;br /&gt;
|-&lt;br /&gt;
|January 2013 to December 2014&lt;br /&gt;
|XML Version 4.3 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Maybe&lt;br /&gt;
|-&lt;br /&gt;
|January 2015 to ''Present''&lt;br /&gt;
|XML Version 4.4 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Maybe&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Database ==&lt;br /&gt;
&lt;br /&gt;
Because there isn't a compelling reason not to, I used the existing PostgreSQL infrastructure on the RDP.&lt;br /&gt;
The &amp;quot;Java Way&amp;quot; of interacting with databases is the Java Database Connectivity API (JDBC), an implementation-agnostic API for interacting with databases.&lt;br /&gt;
This project uses the stock [https://jdbc.postgresql.org/ Postgres JDBC], version 42.1.1&lt;br /&gt;
&lt;br /&gt;
=== Create an empty database on RDP ===&lt;br /&gt;
&lt;br /&gt;
To create an empty database, run this command: &amp;lt;code&amp;gt;$ createdb --username=postgres database-name-goes-here # password is tabspaceenter&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstraction Layer ===&lt;br /&gt;
&lt;br /&gt;
Since writing raw SQL is a bit cumbersome and error-prone, I have added some abstraction layers that make it much easier to quickly add bulk data. By using Postgres's &amp;lt;code&amp;gt;CopyManager&amp;lt;/code&amp;gt; class, we buffer SQL copy commands in memory (as many as possible) and then flush these rows. To understand how the abstraction layers work, see the code in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\postgres&amp;lt;/code&amp;gt;. See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\models\GrantedPatent.java&amp;lt;/code&amp;gt; for '''an example of how to extend''' the abstraction layer to deal with more complex scenarios.&lt;br /&gt;
&lt;br /&gt;
== Address Data ==&lt;br /&gt;
&lt;br /&gt;
To get the most granular address data (street level, or at least postcode level) about who owns patents, the path is not so straightforward because off the complicated mapping of ownership to a granted patent.&lt;br /&gt;
This is the final part of this project that I am working on and it is all at the level of SQL.&lt;br /&gt;
See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\db\joins&amp;lt;/code&amp;gt; for my attempts to create a clean mapping.&lt;br /&gt;
Optimistically speaking, the data generated here should be superset of the data present in the Patent Assignment Data Restructure project.&lt;br /&gt;
&lt;br /&gt;
Note that as of the beginning of August 2017, this part '''has not been completed.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Intuition ===&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;assignments_longform.last_update_date&amp;lt;/code&amp;gt; to find current/latest (or first/earliest) date of assignment. Then match with &amp;lt;code&amp;gt;properties.docid&amp;lt;/code&amp;gt; on &amp;lt;code&amp;gt;reelno, frameno&amp;lt;/code&amp;gt; to find patent application id. With this mapping to granted patents, we can discover the details of the original granted patent. And with the right date and reelno and frameno, we can match to the &amp;lt;code&amp;gt;assignees&amp;lt;/code&amp;gt; table and get fine granularity addresses.&lt;br /&gt;
&lt;br /&gt;
== Related Pages ==&lt;br /&gt;
&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries, Summer 2017 by this guy]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification, Summer 2017 based on tables from Assignment Data Restructure]]&lt;br /&gt;
* [[Patent_Assignment_Data_Restructure|Assignment Data Restructure, Spring 2017 by Marcela and Sonia]]&lt;br /&gt;
* [[Redesigning_Patent_Database|Redesigning Patent Database, Spring 2017 by Shelby]]&lt;br /&gt;
* [[Patent_Data_Cleanup_(June_2016)|Patent Data Cleanup, June 2016 by Marcela]]&lt;br /&gt;
* [[Patent_Data|Patent Data, Spring 2016 by Marcela]] &lt;br /&gt;
* [[Lex_Machina|Lex Machina]]&lt;br /&gt;
* [[USPTO_Patent_Litigation_Data|USPTO Patent Litigation Research Dataset by Ed]]&lt;br /&gt;
* [[Patent_Litigation_and_Review|Patent Litigation and Review by Marcela]]&lt;br /&gt;
* [[Bag_of_Words_Analysis_of_Patent_Data|Bag of Words Analysis]]&lt;br /&gt;
* [[Patent|Existing Database Schema]]&lt;br /&gt;
* [[Oliver_Chang_(Work_Log)|My Work Log]]&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&lt;br /&gt;
* Understanding Assignment Data: [https://www.uspto.gov/sites/default/files/documents/USPTO_Patents_Assignment_Dataset_WP.pdf USPTO Documentation on their cleanup of this data]&lt;br /&gt;
* [https://bulkdata.uspto.gov/data2/patent/grant/redbook/fulltext/1976/PatentFullTextAPSDoc_GreenBook.pdf USPTO Green Book (APS) Documentation]&lt;br /&gt;
* [https://bulkdata.uspto.gov/ USPTO Bulk Data Storage System (BDSS)]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Builder_pattern Builder Pattern in Object-Oriented Programming]&lt;br /&gt;
* [https://rdp.mcnaircenter.org/codebase/Repository/ReproduciblePatent Git Repository]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=PostGIS_Installation&amp;diff=21124</id>
		<title>PostGIS Installation</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=PostGIS_Installation&amp;diff=21124"/>
		<updated>2017-10-25T21:59:32Z</updated>

		<summary type="html">&lt;p&gt;OliverC: /* Installation Commands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://postgis.net/install/ PostGIS] is a spatial database extender for PostgreSQL object-relational database. It adds support for geographic objects allowing location queries to be run in SQL.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation Commands ==&lt;br /&gt;
&lt;br /&gt;
Going off of http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS23UbuntuPGSQL96Apt&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ lsb_release --codename&lt;br /&gt;
Codename:       trusty&lt;br /&gt;
$ sudo sh -c 'echo &amp;quot;deb http://apt.postgresql.org/pub/repos/apt trusty-pgdg main&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list'&lt;br /&gt;
$ wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -&lt;br /&gt;
$ sudo apt-get update&lt;br /&gt;
$ psql -V&lt;br /&gt;
psql (PostgreSQL) 9.5.4&lt;br /&gt;
$ sudo apt install postgresql-9.5-postgis-2.3&lt;br /&gt;
$ sudo apt-get install --no-install-recommends postgis&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note the last line. Without the &amp;lt;code&amp;gt;--no-install-recommends&amp;lt;/code&amp;gt; line postgres assumes you're using the default configuration (in this case, postgis for postgresql 9.6). Since we're using a different flavor of postgresql, we do not want this.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;postgis&amp;lt;/code&amp;gt; apt package is not the extension to postgres. It is a collection of command line utilities for importing and exporting data to a postgis db.&lt;br /&gt;
&lt;br /&gt;
== Creating a Postgis DB ==&lt;br /&gt;
&lt;br /&gt;
=== Initial Setup ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ createdb --username researcher tigertest&lt;br /&gt;
$ psql --username researcher --dbname tigertest&lt;br /&gt;
&amp;gt; create extension postgis;&lt;br /&gt;
&amp;gt; select postgis_full_version(); -- sanity test and make sure installed and enabled&lt;br /&gt;
&amp;gt; \q&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bulk Download TIGER Shapefiles ===&lt;br /&gt;
&lt;br /&gt;
For example, say we want all of the state-level place data. The first step is to find a programmatic URL that we can use. You can inspect the HTML on the HTML interface to place data to get the correct mapping of states/territories to two digit integer. Note that they are not necessarily sequential and there is not strictly fifty.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ for i in $(seq -f &amp;quot;%02g&amp;quot; 1 80); do&lt;br /&gt;
    wget &amp;quot;https://www2.census.gov/geo/tiger/TIGER2016/PLACE/tl_2016_${i}_place.zip&amp;quot;;&lt;br /&gt;
    sleep 3 # not necessary but a good guy scraper move&lt;br /&gt;
done;&lt;br /&gt;
$ for f in *.zip; do unzip &amp;quot;$f&amp;quot;; done&lt;br /&gt;
$ for f in *.shp; do shp2pgsql -I &amp;quot;$f&amp;quot; | psql -U researcher -d tigertest; done&lt;br /&gt;
$ psql --username researcher --dbname tigertest&lt;br /&gt;
&amp;gt; select count(*) from tl_2016_01_place; -- 585&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also say we want to separate New York City, New York into a more granular by-borough set of polygons. Using [https://geo.nyu.edu/catalog/nyu_2451_34505 City University of New York data], we will import this shapefile.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ curl --insecure https://archive.nyu.edu/retrieve/74704/nyu_2451_34505.zip &amp;gt; /tmp/boroughs.zip&lt;br /&gt;
$ cd /tmp&lt;br /&gt;
$ unzip boroughs.zip&lt;br /&gt;
$ shp2pgsql -I nyu_2451_34505/nyu_2451_34505.shp | psql -U researcher -d tigertest&lt;br /&gt;
$ psql --username researcher --dbname tigertest&lt;br /&gt;
&amp;gt; select count(*) from nyu_2451_34505;&lt;br /&gt;
&amp;gt; \q&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== To get into tigertest database ==&lt;br /&gt;
 ssh researcher@128.42.44.181&lt;br /&gt;
 cd /bulk&lt;br /&gt;
 psql tigertest&lt;br /&gt;
&lt;br /&gt;
== Translating Table names to corresponding States ==&lt;br /&gt;
&lt;br /&gt;
See: https://www.census.gov/geo/reference/ansi_statetables.html&lt;br /&gt;
(note that the numbers are FIPS state numeric codes)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Table Name&lt;br /&gt;
! Corresponding State&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_01_place&lt;br /&gt;
| Alabama&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_02_place&lt;br /&gt;
| Alaska&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_03_place&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_04_place&lt;br /&gt;
| Arizona&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_05_place&lt;br /&gt;
| Arkansas&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_06_place&lt;br /&gt;
| California&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_07_place&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_08_place&lt;br /&gt;
| Colorado&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_09_place&lt;br /&gt;
| Missouri&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_10_place&lt;br /&gt;
| Delaware&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_11_place&lt;br /&gt;
| District of Columbia&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_12_place&lt;br /&gt;
| Florida&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_13_place&lt;br /&gt;
| Georgia&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_14_place&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_15_place&lt;br /&gt;
| Hawaii&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_16_place&lt;br /&gt;
| Idaho&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_17_place&lt;br /&gt;
| Illinois&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_18_place&lt;br /&gt;
| Indiana&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_19_place&lt;br /&gt;
| Iowa&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_20_place&lt;br /&gt;
| Kansas&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_21_place&lt;br /&gt;
| Kentucky&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_22_place&lt;br /&gt;
| Louisiana&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_23_place&lt;br /&gt;
| Maine&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_24_place&lt;br /&gt;
| Maryland&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_25_place&lt;br /&gt;
| Massachusetts&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_26_place&lt;br /&gt;
| Michigan&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_27_place&lt;br /&gt;
| Minnesota&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_28_place&lt;br /&gt;
| Mississippi&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_29_place&lt;br /&gt;
| Missouri&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_30_place&lt;br /&gt;
| Motana&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_31_place&lt;br /&gt;
| Nebraska&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_32_place&lt;br /&gt;
| Nevada&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_33_place&lt;br /&gt;
| New Hampshire&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_34_place&lt;br /&gt;
| New Jersey&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_35_place&lt;br /&gt;
| New Mexico&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_36_place&lt;br /&gt;
| New York&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_37_place&lt;br /&gt;
| North Carolina&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_38_place&lt;br /&gt;
| North Dakota&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_39_place&lt;br /&gt;
| Ohio&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_40_place&lt;br /&gt;
| Oklahoma&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_41_place&lt;br /&gt;
| Oregon&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_42_place&lt;br /&gt;
| Pennsylvania&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_43_place&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_44_place&lt;br /&gt;
| Rhode Island&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_45_place&lt;br /&gt;
| South Carolina&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_46_place&lt;br /&gt;
| South Dakota&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_47_place&lt;br /&gt;
| Tennessee&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_48_place&lt;br /&gt;
| Texas&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_49_place&lt;br /&gt;
| Utah&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_50_place&lt;br /&gt;
| Vermont&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_51_place&lt;br /&gt;
| Virginia&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_52_place&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_53_place&lt;br /&gt;
| Washington&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_54_place&lt;br /&gt;
| West Virginia&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_55_place&lt;br /&gt;
| Wisconsin&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_56_place&lt;br /&gt;
| Wyoming&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_57_place&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_58_place&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_59_place&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_60_place&lt;br /&gt;
| American Samoa&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_61_place&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_62_place&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_63_place&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_64_place&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_65_place&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_66_place&lt;br /&gt;
| Guam&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_67_place&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_68_place&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_69_place&lt;br /&gt;
| Northern Marinas Islands&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_70_place&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_71_place&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_72_place&lt;br /&gt;
| Puerto Rico&lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_73_place&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_74_place&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_75_place&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_76_place&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_77_place&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| tl_2016_78_place&lt;br /&gt;
| Virgin Islands&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Tiger Geocoder Extension==&lt;br /&gt;
This section details the process to install and use the Tiger Geocoder Extension of PostGIS. The official docmentation can be found [https://postgis.net/docs/Extras.html here].&lt;br /&gt;
&lt;br /&gt;
[https://postgis.net/docs/postgis_installation.html#install_tiger_geocoder_extension This link] outlines the process to enable our Postgres Database to support Tiger functionality.&lt;br /&gt;
&lt;br /&gt;
I began by adding the extension listed above. First, enter into Postgres by using the psql command. Then:&lt;br /&gt;
 --Add Extensions to database&lt;br /&gt;
 CREATE EXTENSION postgis;&lt;br /&gt;
 CREATE EXTENSION fuzzystrmatch;&lt;br /&gt;
 CREATE EXTENSION postgis_tiger_geocoder;&lt;br /&gt;
 CREATE EXTENSION address_standardizer;&lt;br /&gt;
&lt;br /&gt;
You can test that the installation worked by running the following query: &lt;br /&gt;
 SELECT na.address, na.streetname,na.streettypeabbrev, na.zip&lt;br /&gt;
 	FROM normalize_address('1 Devonshire Place, Boston, MA 02109') AS na;&lt;br /&gt;
&lt;br /&gt;
This should return the following:&lt;br /&gt;
  address | streetname | streettypeabbrev |  zip&lt;br /&gt;
 ---------+------------+------------------+-------&lt;br /&gt;
 	   1 | Devonshire | Pl               | 02109&lt;br /&gt;
&lt;br /&gt;
Next, a new profile needs to be created by using the following command.&lt;br /&gt;
 INSERT INTO tiger.loader_platform(os, declare_sect, pgbin, wget, unzip_command, psql, path_sep, &lt;br /&gt;
 		   loader, environ_set_command, county_process_command)&lt;br /&gt;
 SELECT 'newuser', declare_sect, pgbin, wget, unzip_command, psql, path_sep,&lt;br /&gt;
 	   loader, environ_set_command, county_process_command&lt;br /&gt;
   FROM tiger.loader_platform&lt;br /&gt;
   WHERE os = 'sh';&lt;br /&gt;
&lt;br /&gt;
The installation instructions also provide the following note:&lt;br /&gt;
&lt;br /&gt;
As of PostGIS 2.4.1 the Zip code-5 digit tabulation area zcta5 load step was revised to load current zcta5 data and is part of the Loader_Generate_Nation_Script when enabled. It is turned off by default because it takes quite a bit of time to load (20 to 60 minutes), takes up quite a bit of disk space, and is not used that often.&lt;br /&gt;
&lt;br /&gt;
If you would like this feature, you can enable it by using the following command. This should be done before loading the script.&lt;br /&gt;
&lt;br /&gt;
 UPDATE tiger.loader_lookuptables SET load = true WHERE table_name = 'zcta510';&lt;br /&gt;
&lt;br /&gt;
The paths in declare_sect need to be edited so they match our server locations. One option is to edit the declare_sect column in the tiger.loader_platform table. If so, the declare_sect looks like the following:&lt;br /&gt;
 export PGHOST=localhost                       +&lt;br /&gt;
 export PGUSER=postgres                        +&lt;br /&gt;
 export PGPASSWORD=yourpasswordhere            +&lt;br /&gt;
 export PGDATABASE=geocoder                    +&lt;br /&gt;
 PSQL=${PGBIN}/psql                            +&lt;br /&gt;
 SHP2PGSQL=shp2pgsql                           +&lt;br /&gt;
 cd ${staging_fold}                            +&lt;br /&gt;
 &lt;br /&gt;
 TMPDIR=&amp;quot;${staging_fold}/temp/&amp;quot;                +&lt;br /&gt;
 UNZIPTOOL=unzip                               +&lt;br /&gt;
 WGETTOOL=&amp;quot;/usr/bin/wget&amp;quot;                      +&lt;br /&gt;
 export PGBIN=/usr/lib/postgresql/9.6/bin      +&lt;br /&gt;
 export PGPORT=5432                            +&lt;br /&gt;
 export PGHOST=localhost                       +&lt;br /&gt;
 export PGUSER=postgres                        +&lt;br /&gt;
 export PGPASSWORD=yourpasswordhere            +&lt;br /&gt;
 export PGDATABASE=geocoder                    +&lt;br /&gt;
 PSQL=${PGBIN}/psql                            +&lt;br /&gt;
 SHP2PGSQL=shp2pgsql                           +&lt;br /&gt;
 cd ${staging_fold}&lt;br /&gt;
&lt;br /&gt;
Another option is to edit the sh file before running the script. The downloaded script is located in the following directory:&lt;br /&gt;
 /gisdata&lt;br /&gt;
&lt;br /&gt;
There needs to be a directory called &amp;quot;temp&amp;quot; in the gisdata directory. To make the script, use the following from the command line:&lt;br /&gt;
 psql -c &amp;quot;SELECT Loader_Generate_Nation_Script('debbie')&amp;quot; -d geocoder -tA &amp;gt; /gisdata/nation_script_load.sh&lt;br /&gt;
&lt;br /&gt;
This will create a script in the gisdata directory. Change to that directory. If you did not edit the paths in the declare_sect table in psql, then you will need to edit this file to contain the correct paths. Run the script by using: &lt;br /&gt;
 sh nation_script_load.sh&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=21123</id>
		<title>Oliver Chang (Work Log)</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=21123"/>
		<updated>2017-10-25T21:58:45Z</updated>

		<summary type="html">&lt;p&gt;OliverC: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Oliver Chang]] [[Work Logs]]&lt;br /&gt;
[[Oliver Chang (Work Log)|(logpage)]]&lt;br /&gt;
&lt;br /&gt;
''To-do List'':&lt;br /&gt;
&lt;br /&gt;
* Fix St. Louis problem&lt;br /&gt;
* Query xml_explorer data&lt;br /&gt;
* Create modern application xml schema (version &amp;gt; 1.6)&lt;br /&gt;
* Re-run import of data Friday afternoon&lt;br /&gt;
* Finish ID joining&lt;br /&gt;
&lt;br /&gt;
''Projects'':&lt;br /&gt;
&lt;br /&gt;
* [[PostGIS_Installation|PostGIS Installation]]&lt;br /&gt;
* [[Reproducible_Patent_Data|Reproducible Patent Data]]&lt;br /&gt;
* [[Patent_Validity_Ideas_for_ML|Predictive Patent Validity Machine Learning Ideas]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification]]&lt;br /&gt;
* [[GPU_Build|GPU Computer Build]]&lt;br /&gt;
* [[Parallel_Enclosing_Circle_Algorithm|Parallel Enclosing Circle Algorithm]]&lt;br /&gt;
&lt;br /&gt;
''Uploads'':&lt;br /&gt;
&lt;br /&gt;
* [[File:PADX-File-Description-v2_Hague.pdf]]&lt;br /&gt;
** Describes patent kind codes (notably, what the hell X0 represents)&lt;br /&gt;
* [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]]&lt;br /&gt;
** Describes the fields in APS, their supposed character lengths, and if they are required/optional&lt;br /&gt;
* [[File:Aps-wku-modulus11.pdf]]&lt;br /&gt;
** Describes the layout of the check digit on magnetic tape&lt;br /&gt;
* [[File:Mod-11-algorithm.pdf]]&lt;br /&gt;
** Describes the algorithm used to calculate the check digit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Day-by-Day (in reverse chronological order) ==&lt;br /&gt;
&lt;br /&gt;
=== October 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Oct 25: start ingestion of application xml files and deal with all the bugs which accompany that&lt;br /&gt;
* Oct 21: create xml explorer script to mass-inspect xpaths (can be found at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\xml_schema_explorer&amp;lt;/code&amp;gt;&lt;br /&gt;
* Oct 20: re-run assignment import, review xpaths&lt;br /&gt;
* Oct 19: repopulate patents database and create spreadsheet of assignment equivalencies&lt;br /&gt;
* Oct 11: add issues to work on to the PECA wiki page; cleanup PECA git repo; start patent application code from granted patent code and start customizing to new domain&lt;br /&gt;
* Oct 3: troubleshoot vc_circles.py and make command line interface a little nicer&lt;br /&gt;
* Oct 2: discuss mapping strategies &amp;amp; investigate missing eca data&lt;br /&gt;
&lt;br /&gt;
=== September 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Sept 23: make Project/OliverLovesCircles usable and add initial splitting ability&lt;br /&gt;
* Sept 22: goal setting &amp;amp; server debugging &amp;amp; meet with Yang&lt;br /&gt;
&lt;br /&gt;
=== August 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Aug 4: setup parallel instance python framework for job reporting; begin test run&lt;br /&gt;
* Aug 2: finish up some documentation of the code and for the wiki&lt;br /&gt;
* Aug 1: discuss with Abhi &amp;amp; Ed about alternatives to Java port because of algorithmic constants that would be hard to port; run test batches on python with addition of equality operators and convergence early stopping&lt;br /&gt;
&lt;br /&gt;
=== July 2017 ===&lt;br /&gt;
&lt;br /&gt;
* July 31: sketch out parallel enclosing circle algorithm&lt;br /&gt;
* July 28: field questions and data cleanup questions from Kerda &amp;amp; Joe &amp;amp; Adrian&lt;br /&gt;
* ''travelling''&lt;br /&gt;
* July 19: try to remove duplicated records (esp. those with empty titles) which are preventing the addition of a unique constraint&lt;br /&gt;
* July 18: run correspondent join on properties and correspondents table to match previous project; sync with Adrian and Abhi&lt;br /&gt;
* July 17: redo db operations after cleaning up granted patent number bugs&lt;br /&gt;
* July 13: powwow about parallelizing Enclosing Circle Algorithm; sketch out what to do for the rest of the summer; work more on joins&lt;br /&gt;
* July 12: generate some example data illustrating the difficulty of joining different tables&lt;br /&gt;
* July 11: track down some bugs that happen very rarely and were missed in the initial qa phase&lt;br /&gt;
* July 7: catch up on documentation&lt;br /&gt;
* July 6: try (unsuccessfully) to understand docid mapping...create exploration scripts&lt;br /&gt;
* July 5: add invention title to proper grouping of assignment properties; optimize XML parsing&lt;br /&gt;
&lt;br /&gt;
=== June 2017 ===&lt;br /&gt;
&lt;br /&gt;
* June 30: powwow with James, Abhi, Ed about optimization issues; discuss document ids, X0 etc with Ed; pinpoint issues with APS doc numbers (see Repro Pat Dat#Gotchas) for more info&lt;br /&gt;
* June 29: add logging of copy commands, more chattiness to scripts, debug assignment data failure&lt;br /&gt;
* June 28: create examples for expansion to plant, reissue, design patent collection; start optimizing xml&lt;br /&gt;
* June 27: write SQL to replicate assignees, extract postcodes for ongoing projects&lt;br /&gt;
* June 26: speedup code, abstract in-memory file splitters to avoid repetition and some weird edge cases&lt;br /&gt;
* June 25: create mappings for APS, assignment properties, XML 2.5 for data import; run data imports for granted data&lt;br /&gt;
* June 23: cleanup hacky models with a better set of abstractions; cleanup IDE warnings; redefine patent-address mapping&lt;br /&gt;
* June 22: create postcode&amp;lt;-&amp;gt;patent table&lt;br /&gt;
* June 21: document granted patent queries and equivalencies&lt;br /&gt;
* June 20: sketch out APS driver; discuss patent id problem; further document with evidence the zipcode data validity&lt;br /&gt;
* June 19: skim address regular expressions; cursory investigation of patent table&lt;br /&gt;
* June 16: create method of getting all data into the database, whether it likes it or not; copy over assignments, granted data using new scheme&lt;br /&gt;
* June 15: add more robust error reporting, fix race conditions; build out assignment driver; build out fee event driver; add error logging&lt;br /&gt;
* June 14: migrate bulk inserts to copy command; refresh on address data and start in on that; convert processor to multi-threaded application&lt;br /&gt;
* June 13: spot check SQL tables; fix broken final case endlessly looping; investigate smarter insert methods&lt;br /&gt;
* June 12: add XML printer, use it to inspect applications; extend BaseScraper to fetch patent application data; add applications documentation to my project page; add CREATE of other tables&lt;br /&gt;
* June 8: add foreign key inserts; create pretty printer for XML analysis&lt;br /&gt;
* June 7: finalize DB abstraction layer; migrate code to bulk inserts; upgrade webserver software and do optimization on RDP postgres with Ed&lt;br /&gt;
* June 6: add jdbc; create basic schema; add db interaction; schedule meeting for later in the week&lt;br /&gt;
* June 5: look into postgresql; refersh on postgis; add some notes to the Enclosing Circle Algorithm page&lt;br /&gt;
* June 1: add RDP git remote; add more documentation to wiki page; refactor downloader scripts; start creation of tooling for interacting with data&lt;br /&gt;
&lt;br /&gt;
=== May 2017 ===&lt;br /&gt;
&lt;br /&gt;
* May 31: finish copy-pasting attributes into the wiki page; retroactively fill out work log; meet with Ed to discuss next steps&lt;br /&gt;
* May 30: update documentation on wiki, restructure large binary files to have more hierarchy instead of a flat listing at the root&lt;br /&gt;
* May 29: expand to APS; expand to raw assignment data&lt;br /&gt;
* May 27: expand to maintenance fee data&lt;br /&gt;
* May 26: create models, translate &amp;lt;code&amp;gt;xmlparser*.pl&amp;lt;/code&amp;gt; file into Java; start using builder pattern&lt;br /&gt;
* May 25: sketch out OO design of project; download bulk data&lt;br /&gt;
* May 24: move wiki pages around; start git repository for project&lt;br /&gt;
* May 21: discuss technical details of previous work with Ed&lt;br /&gt;
* May 8: cleanup dead links on wiki and start reading about previous work; discuss current project status with Ed&lt;br /&gt;
* May 4: setup wiki account, rdp account, database training&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Work Log]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=21122</id>
		<title>Oliver Chang (Work Log)</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=21122"/>
		<updated>2017-10-25T21:53:12Z</updated>

		<summary type="html">&lt;p&gt;OliverC: /* October 2017 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Oliver Chang]] [[Work Logs]]&lt;br /&gt;
[[Oliver Chang (Work Log)|(logpage)]]&lt;br /&gt;
&lt;br /&gt;
''To-do List'':&lt;br /&gt;
&lt;br /&gt;
* Expand XPath use in the patent data&lt;br /&gt;
* Edit to include Application data&lt;br /&gt;
* Finish ID joining&lt;br /&gt;
&lt;br /&gt;
''Projects'':&lt;br /&gt;
&lt;br /&gt;
* [[PostGIS_Installation|PostGIS Installation]]&lt;br /&gt;
* [[Reproducible_Patent_Data|Reproducible Patent Data]]&lt;br /&gt;
* [[Patent_Validity_Ideas_for_ML|Predictive Patent Validity Machine Learning Ideas]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification]]&lt;br /&gt;
* [[GPU_Build|GPU Computer Build]]&lt;br /&gt;
* [[Parallel_Enclosing_Circle_Algorithm|Parallel Enclosing Circle Algorithm]]&lt;br /&gt;
&lt;br /&gt;
''Uploads'':&lt;br /&gt;
&lt;br /&gt;
* [[File:PADX-File-Description-v2_Hague.pdf]]&lt;br /&gt;
** Describes patent kind codes (notably, what the hell X0 represents)&lt;br /&gt;
* [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]]&lt;br /&gt;
** Describes the fields in APS, their supposed character lengths, and if they are required/optional&lt;br /&gt;
* [[File:Aps-wku-modulus11.pdf]]&lt;br /&gt;
** Describes the layout of the check digit on magnetic tape&lt;br /&gt;
* [[File:Mod-11-algorithm.pdf]]&lt;br /&gt;
** Describes the algorithm used to calculate the check digit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Day-by-Day (in reverse chronological order) ==&lt;br /&gt;
&lt;br /&gt;
=== October 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Oct 25: start ingestion of application xml files and deal with all the bugs which accompany that&lt;br /&gt;
* Oct 21: create xml explorer script to mass-inspect xpaths (can be found at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\xml_schema_explorer&amp;lt;/code&amp;gt;&lt;br /&gt;
* Oct 20: re-run assignment import, review xpaths&lt;br /&gt;
* Oct 19: repopulate patents database and create spreadsheet of assignment equivalencies&lt;br /&gt;
* Oct 11: add issues to work on to the PECA wiki page; cleanup PECA git repo; start patent application code from granted patent code and start customizing to new domain&lt;br /&gt;
* Oct 3: troubleshoot vc_circles.py and make command line interface a little nicer&lt;br /&gt;
* Oct 2: discuss mapping strategies &amp;amp; investigate missing eca data&lt;br /&gt;
&lt;br /&gt;
=== September 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Sept 23: make Project/OliverLovesCircles usable and add initial splitting ability&lt;br /&gt;
* Sept 22: goal setting &amp;amp; server debugging &amp;amp; meet with Yang&lt;br /&gt;
&lt;br /&gt;
=== August 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Aug 4: setup parallel instance python framework for job reporting; begin test run&lt;br /&gt;
* Aug 2: finish up some documentation of the code and for the wiki&lt;br /&gt;
* Aug 1: discuss with Abhi &amp;amp; Ed about alternatives to Java port because of algorithmic constants that would be hard to port; run test batches on python with addition of equality operators and convergence early stopping&lt;br /&gt;
&lt;br /&gt;
=== July 2017 ===&lt;br /&gt;
&lt;br /&gt;
* July 31: sketch out parallel enclosing circle algorithm&lt;br /&gt;
* July 28: field questions and data cleanup questions from Kerda &amp;amp; Joe &amp;amp; Adrian&lt;br /&gt;
* ''travelling''&lt;br /&gt;
* July 19: try to remove duplicated records (esp. those with empty titles) which are preventing the addition of a unique constraint&lt;br /&gt;
* July 18: run correspondent join on properties and correspondents table to match previous project; sync with Adrian and Abhi&lt;br /&gt;
* July 17: redo db operations after cleaning up granted patent number bugs&lt;br /&gt;
* July 13: powwow about parallelizing Enclosing Circle Algorithm; sketch out what to do for the rest of the summer; work more on joins&lt;br /&gt;
* July 12: generate some example data illustrating the difficulty of joining different tables&lt;br /&gt;
* July 11: track down some bugs that happen very rarely and were missed in the initial qa phase&lt;br /&gt;
* July 7: catch up on documentation&lt;br /&gt;
* July 6: try (unsuccessfully) to understand docid mapping...create exploration scripts&lt;br /&gt;
* July 5: add invention title to proper grouping of assignment properties; optimize XML parsing&lt;br /&gt;
&lt;br /&gt;
=== June 2017 ===&lt;br /&gt;
&lt;br /&gt;
* June 30: powwow with James, Abhi, Ed about optimization issues; discuss document ids, X0 etc with Ed; pinpoint issues with APS doc numbers (see Repro Pat Dat#Gotchas) for more info&lt;br /&gt;
* June 29: add logging of copy commands, more chattiness to scripts, debug assignment data failure&lt;br /&gt;
* June 28: create examples for expansion to plant, reissue, design patent collection; start optimizing xml&lt;br /&gt;
* June 27: write SQL to replicate assignees, extract postcodes for ongoing projects&lt;br /&gt;
* June 26: speedup code, abstract in-memory file splitters to avoid repetition and some weird edge cases&lt;br /&gt;
* June 25: create mappings for APS, assignment properties, XML 2.5 for data import; run data imports for granted data&lt;br /&gt;
* June 23: cleanup hacky models with a better set of abstractions; cleanup IDE warnings; redefine patent-address mapping&lt;br /&gt;
* June 22: create postcode&amp;lt;-&amp;gt;patent table&lt;br /&gt;
* June 21: document granted patent queries and equivalencies&lt;br /&gt;
* June 20: sketch out APS driver; discuss patent id problem; further document with evidence the zipcode data validity&lt;br /&gt;
* June 19: skim address regular expressions; cursory investigation of patent table&lt;br /&gt;
* June 16: create method of getting all data into the database, whether it likes it or not; copy over assignments, granted data using new scheme&lt;br /&gt;
* June 15: add more robust error reporting, fix race conditions; build out assignment driver; build out fee event driver; add error logging&lt;br /&gt;
* June 14: migrate bulk inserts to copy command; refresh on address data and start in on that; convert processor to multi-threaded application&lt;br /&gt;
* June 13: spot check SQL tables; fix broken final case endlessly looping; investigate smarter insert methods&lt;br /&gt;
* June 12: add XML printer, use it to inspect applications; extend BaseScraper to fetch patent application data; add applications documentation to my project page; add CREATE of other tables&lt;br /&gt;
* June 8: add foreign key inserts; create pretty printer for XML analysis&lt;br /&gt;
* June 7: finalize DB abstraction layer; migrate code to bulk inserts; upgrade webserver software and do optimization on RDP postgres with Ed&lt;br /&gt;
* June 6: add jdbc; create basic schema; add db interaction; schedule meeting for later in the week&lt;br /&gt;
* June 5: look into postgresql; refersh on postgis; add some notes to the Enclosing Circle Algorithm page&lt;br /&gt;
* June 1: add RDP git remote; add more documentation to wiki page; refactor downloader scripts; start creation of tooling for interacting with data&lt;br /&gt;
&lt;br /&gt;
=== May 2017 ===&lt;br /&gt;
&lt;br /&gt;
* May 31: finish copy-pasting attributes into the wiki page; retroactively fill out work log; meet with Ed to discuss next steps&lt;br /&gt;
* May 30: update documentation on wiki, restructure large binary files to have more hierarchy instead of a flat listing at the root&lt;br /&gt;
* May 29: expand to APS; expand to raw assignment data&lt;br /&gt;
* May 27: expand to maintenance fee data&lt;br /&gt;
* May 26: create models, translate &amp;lt;code&amp;gt;xmlparser*.pl&amp;lt;/code&amp;gt; file into Java; start using builder pattern&lt;br /&gt;
* May 25: sketch out OO design of project; download bulk data&lt;br /&gt;
* May 24: move wiki pages around; start git repository for project&lt;br /&gt;
* May 21: discuss technical details of previous work with Ed&lt;br /&gt;
* May 8: cleanup dead links on wiki and start reading about previous work; discuss current project status with Ed&lt;br /&gt;
* May 4: setup wiki account, rdp account, database training&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Work Log]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=21015</id>
		<title>Oliver Chang (Work Log)</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=21015"/>
		<updated>2017-10-23T20:51:23Z</updated>

		<summary type="html">&lt;p&gt;OliverC: /* October 2017 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Oliver Chang]] [[Work Logs]]&lt;br /&gt;
[[Oliver Chang (Work Log)|(logpage)]]&lt;br /&gt;
&lt;br /&gt;
''To-do List'':&lt;br /&gt;
&lt;br /&gt;
* Expand XPath use in the patent data&lt;br /&gt;
* Edit to include Application data&lt;br /&gt;
* Finish ID joining&lt;br /&gt;
&lt;br /&gt;
''Projects'':&lt;br /&gt;
&lt;br /&gt;
* [[PostGIS_Installation|PostGIS Installation]]&lt;br /&gt;
* [[Reproducible_Patent_Data|Reproducible Patent Data]]&lt;br /&gt;
* [[Patent_Validity_Ideas_for_ML|Predictive Patent Validity Machine Learning Ideas]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification]]&lt;br /&gt;
* [[GPU_Build|GPU Computer Build]]&lt;br /&gt;
* [[Parallel_Enclosing_Circle_Algorithm|Parallel Enclosing Circle Algorithm]]&lt;br /&gt;
&lt;br /&gt;
''Uploads'':&lt;br /&gt;
&lt;br /&gt;
* [[File:PADX-File-Description-v2_Hague.pdf]]&lt;br /&gt;
** Describes patent kind codes (notably, what the hell X0 represents)&lt;br /&gt;
* [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]]&lt;br /&gt;
** Describes the fields in APS, their supposed character lengths, and if they are required/optional&lt;br /&gt;
* [[File:Aps-wku-modulus11.pdf]]&lt;br /&gt;
** Describes the layout of the check digit on magnetic tape&lt;br /&gt;
* [[File:Mod-11-algorithm.pdf]]&lt;br /&gt;
** Describes the algorithm used to calculate the check digit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Day-by-Day (in reverse chronological order) ==&lt;br /&gt;
&lt;br /&gt;
=== October 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Oct 21: create xml explorer script to mass-inspect xpaths (can be found at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\xml_schema_explorer&amp;lt;/code&amp;gt;&lt;br /&gt;
* Oct 20: re-run assignment import, review xpaths&lt;br /&gt;
* Oct 19: repopulate patents database and create spreadsheet of assignment equivalencies&lt;br /&gt;
* Oct 11: add issues to work on to the PECA wiki page; cleanup PECA git repo; start patent application code from granted patent code and start customizing to new domain&lt;br /&gt;
* Oct 3: troubleshoot vc_circles.py and make command line interface a little nicer&lt;br /&gt;
* Oct 2: discuss mapping strategies &amp;amp; investigate missing eca data&lt;br /&gt;
&lt;br /&gt;
=== September 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Sept 23: make Project/OliverLovesCircles usable and add initial splitting ability&lt;br /&gt;
* Sept 22: goal setting &amp;amp; server debugging &amp;amp; meet with Yang&lt;br /&gt;
&lt;br /&gt;
=== August 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Aug 4: setup parallel instance python framework for job reporting; begin test run&lt;br /&gt;
* Aug 2: finish up some documentation of the code and for the wiki&lt;br /&gt;
* Aug 1: discuss with Abhi &amp;amp; Ed about alternatives to Java port because of algorithmic constants that would be hard to port; run test batches on python with addition of equality operators and convergence early stopping&lt;br /&gt;
&lt;br /&gt;
=== July 2017 ===&lt;br /&gt;
&lt;br /&gt;
* July 31: sketch out parallel enclosing circle algorithm&lt;br /&gt;
* July 28: field questions and data cleanup questions from Kerda &amp;amp; Joe &amp;amp; Adrian&lt;br /&gt;
* ''travelling''&lt;br /&gt;
* July 19: try to remove duplicated records (esp. those with empty titles) which are preventing the addition of a unique constraint&lt;br /&gt;
* July 18: run correspondent join on properties and correspondents table to match previous project; sync with Adrian and Abhi&lt;br /&gt;
* July 17: redo db operations after cleaning up granted patent number bugs&lt;br /&gt;
* July 13: powwow about parallelizing Enclosing Circle Algorithm; sketch out what to do for the rest of the summer; work more on joins&lt;br /&gt;
* July 12: generate some example data illustrating the difficulty of joining different tables&lt;br /&gt;
* July 11: track down some bugs that happen very rarely and were missed in the initial qa phase&lt;br /&gt;
* July 7: catch up on documentation&lt;br /&gt;
* July 6: try (unsuccessfully) to understand docid mapping...create exploration scripts&lt;br /&gt;
* July 5: add invention title to proper grouping of assignment properties; optimize XML parsing&lt;br /&gt;
&lt;br /&gt;
=== June 2017 ===&lt;br /&gt;
&lt;br /&gt;
* June 30: powwow with James, Abhi, Ed about optimization issues; discuss document ids, X0 etc with Ed; pinpoint issues with APS doc numbers (see Repro Pat Dat#Gotchas) for more info&lt;br /&gt;
* June 29: add logging of copy commands, more chattiness to scripts, debug assignment data failure&lt;br /&gt;
* June 28: create examples for expansion to plant, reissue, design patent collection; start optimizing xml&lt;br /&gt;
* June 27: write SQL to replicate assignees, extract postcodes for ongoing projects&lt;br /&gt;
* June 26: speedup code, abstract in-memory file splitters to avoid repetition and some weird edge cases&lt;br /&gt;
* June 25: create mappings for APS, assignment properties, XML 2.5 for data import; run data imports for granted data&lt;br /&gt;
* June 23: cleanup hacky models with a better set of abstractions; cleanup IDE warnings; redefine patent-address mapping&lt;br /&gt;
* June 22: create postcode&amp;lt;-&amp;gt;patent table&lt;br /&gt;
* June 21: document granted patent queries and equivalencies&lt;br /&gt;
* June 20: sketch out APS driver; discuss patent id problem; further document with evidence the zipcode data validity&lt;br /&gt;
* June 19: skim address regular expressions; cursory investigation of patent table&lt;br /&gt;
* June 16: create method of getting all data into the database, whether it likes it or not; copy over assignments, granted data using new scheme&lt;br /&gt;
* June 15: add more robust error reporting, fix race conditions; build out assignment driver; build out fee event driver; add error logging&lt;br /&gt;
* June 14: migrate bulk inserts to copy command; refresh on address data and start in on that; convert processor to multi-threaded application&lt;br /&gt;
* June 13: spot check SQL tables; fix broken final case endlessly looping; investigate smarter insert methods&lt;br /&gt;
* June 12: add XML printer, use it to inspect applications; extend BaseScraper to fetch patent application data; add applications documentation to my project page; add CREATE of other tables&lt;br /&gt;
* June 8: add foreign key inserts; create pretty printer for XML analysis&lt;br /&gt;
* June 7: finalize DB abstraction layer; migrate code to bulk inserts; upgrade webserver software and do optimization on RDP postgres with Ed&lt;br /&gt;
* June 6: add jdbc; create basic schema; add db interaction; schedule meeting for later in the week&lt;br /&gt;
* June 5: look into postgresql; refersh on postgis; add some notes to the Enclosing Circle Algorithm page&lt;br /&gt;
* June 1: add RDP git remote; add more documentation to wiki page; refactor downloader scripts; start creation of tooling for interacting with data&lt;br /&gt;
&lt;br /&gt;
=== May 2017 ===&lt;br /&gt;
&lt;br /&gt;
* May 31: finish copy-pasting attributes into the wiki page; retroactively fill out work log; meet with Ed to discuss next steps&lt;br /&gt;
* May 30: update documentation on wiki, restructure large binary files to have more hierarchy instead of a flat listing at the root&lt;br /&gt;
* May 29: expand to APS; expand to raw assignment data&lt;br /&gt;
* May 27: expand to maintenance fee data&lt;br /&gt;
* May 26: create models, translate &amp;lt;code&amp;gt;xmlparser*.pl&amp;lt;/code&amp;gt; file into Java; start using builder pattern&lt;br /&gt;
* May 25: sketch out OO design of project; download bulk data&lt;br /&gt;
* May 24: move wiki pages around; start git repository for project&lt;br /&gt;
* May 21: discuss technical details of previous work with Ed&lt;br /&gt;
* May 8: cleanup dead links on wiki and start reading about previous work; discuss current project status with Ed&lt;br /&gt;
* May 4: setup wiki account, rdp account, database training&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Work Log]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=20986</id>
		<title>Oliver Chang (Work Log)</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=20986"/>
		<updated>2017-10-21T16:08:21Z</updated>

		<summary type="html">&lt;p&gt;OliverC: /* October 2017 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Oliver Chang]] [[Work Logs]]&lt;br /&gt;
[[Oliver Chang (Work Log)|(logpage)]]&lt;br /&gt;
&lt;br /&gt;
''To-do List'':&lt;br /&gt;
&lt;br /&gt;
* Expand XPath use in the patent data&lt;br /&gt;
* Edit to include Application data&lt;br /&gt;
* Finish ID joining&lt;br /&gt;
&lt;br /&gt;
''Projects'':&lt;br /&gt;
&lt;br /&gt;
* [[PostGIS_Installation|PostGIS Installation]]&lt;br /&gt;
* [[Reproducible_Patent_Data|Reproducible Patent Data]]&lt;br /&gt;
* [[Patent_Validity_Ideas_for_ML|Predictive Patent Validity Machine Learning Ideas]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification]]&lt;br /&gt;
* [[GPU_Build|GPU Computer Build]]&lt;br /&gt;
* [[Parallel_Enclosing_Circle_Algorithm|Parallel Enclosing Circle Algorithm]]&lt;br /&gt;
&lt;br /&gt;
''Uploads'':&lt;br /&gt;
&lt;br /&gt;
* [[File:PADX-File-Description-v2_Hague.pdf]]&lt;br /&gt;
** Describes patent kind codes (notably, what the hell X0 represents)&lt;br /&gt;
* [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]]&lt;br /&gt;
** Describes the fields in APS, their supposed character lengths, and if they are required/optional&lt;br /&gt;
* [[File:Aps-wku-modulus11.pdf]]&lt;br /&gt;
** Describes the layout of the check digit on magnetic tape&lt;br /&gt;
* [[File:Mod-11-algorithm.pdf]]&lt;br /&gt;
** Describes the algorithm used to calculate the check digit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Day-by-Day (in reverse chronological order) ==&lt;br /&gt;
&lt;br /&gt;
=== October 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Oct 20: re-run assignment import, review xpaths&lt;br /&gt;
* Oct 19: repopulate patents database and create spreadsheet of assignment equivalencies&lt;br /&gt;
* Oct 11: add issues to work on to the PECA wiki page; cleanup PECA git repo; start patent application code from granted patent code and start customizing to new domain&lt;br /&gt;
* Oct 3: troubleshoot vc_circles.py and make command line interface a little nicer&lt;br /&gt;
* Oct 2: discuss mapping strategies &amp;amp; investigate missing eca data&lt;br /&gt;
&lt;br /&gt;
=== September 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Sept 23: make Project/OliverLovesCircles usable and add initial splitting ability&lt;br /&gt;
* Sept 22: goal setting &amp;amp; server debugging &amp;amp; meet with Yang&lt;br /&gt;
&lt;br /&gt;
=== August 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Aug 4: setup parallel instance python framework for job reporting; begin test run&lt;br /&gt;
* Aug 2: finish up some documentation of the code and for the wiki&lt;br /&gt;
* Aug 1: discuss with Abhi &amp;amp; Ed about alternatives to Java port because of algorithmic constants that would be hard to port; run test batches on python with addition of equality operators and convergence early stopping&lt;br /&gt;
&lt;br /&gt;
=== July 2017 ===&lt;br /&gt;
&lt;br /&gt;
* July 31: sketch out parallel enclosing circle algorithm&lt;br /&gt;
* July 28: field questions and data cleanup questions from Kerda &amp;amp; Joe &amp;amp; Adrian&lt;br /&gt;
* ''travelling''&lt;br /&gt;
* July 19: try to remove duplicated records (esp. those with empty titles) which are preventing the addition of a unique constraint&lt;br /&gt;
* July 18: run correspondent join on properties and correspondents table to match previous project; sync with Adrian and Abhi&lt;br /&gt;
* July 17: redo db operations after cleaning up granted patent number bugs&lt;br /&gt;
* July 13: powwow about parallelizing Enclosing Circle Algorithm; sketch out what to do for the rest of the summer; work more on joins&lt;br /&gt;
* July 12: generate some example data illustrating the difficulty of joining different tables&lt;br /&gt;
* July 11: track down some bugs that happen very rarely and were missed in the initial qa phase&lt;br /&gt;
* July 7: catch up on documentation&lt;br /&gt;
* July 6: try (unsuccessfully) to understand docid mapping...create exploration scripts&lt;br /&gt;
* July 5: add invention title to proper grouping of assignment properties; optimize XML parsing&lt;br /&gt;
&lt;br /&gt;
=== June 2017 ===&lt;br /&gt;
&lt;br /&gt;
* June 30: powwow with James, Abhi, Ed about optimization issues; discuss document ids, X0 etc with Ed; pinpoint issues with APS doc numbers (see Repro Pat Dat#Gotchas) for more info&lt;br /&gt;
* June 29: add logging of copy commands, more chattiness to scripts, debug assignment data failure&lt;br /&gt;
* June 28: create examples for expansion to plant, reissue, design patent collection; start optimizing xml&lt;br /&gt;
* June 27: write SQL to replicate assignees, extract postcodes for ongoing projects&lt;br /&gt;
* June 26: speedup code, abstract in-memory file splitters to avoid repetition and some weird edge cases&lt;br /&gt;
* June 25: create mappings for APS, assignment properties, XML 2.5 for data import; run data imports for granted data&lt;br /&gt;
* June 23: cleanup hacky models with a better set of abstractions; cleanup IDE warnings; redefine patent-address mapping&lt;br /&gt;
* June 22: create postcode&amp;lt;-&amp;gt;patent table&lt;br /&gt;
* June 21: document granted patent queries and equivalencies&lt;br /&gt;
* June 20: sketch out APS driver; discuss patent id problem; further document with evidence the zipcode data validity&lt;br /&gt;
* June 19: skim address regular expressions; cursory investigation of patent table&lt;br /&gt;
* June 16: create method of getting all data into the database, whether it likes it or not; copy over assignments, granted data using new scheme&lt;br /&gt;
* June 15: add more robust error reporting, fix race conditions; build out assignment driver; build out fee event driver; add error logging&lt;br /&gt;
* June 14: migrate bulk inserts to copy command; refresh on address data and start in on that; convert processor to multi-threaded application&lt;br /&gt;
* June 13: spot check SQL tables; fix broken final case endlessly looping; investigate smarter insert methods&lt;br /&gt;
* June 12: add XML printer, use it to inspect applications; extend BaseScraper to fetch patent application data; add applications documentation to my project page; add CREATE of other tables&lt;br /&gt;
* June 8: add foreign key inserts; create pretty printer for XML analysis&lt;br /&gt;
* June 7: finalize DB abstraction layer; migrate code to bulk inserts; upgrade webserver software and do optimization on RDP postgres with Ed&lt;br /&gt;
* June 6: add jdbc; create basic schema; add db interaction; schedule meeting for later in the week&lt;br /&gt;
* June 5: look into postgresql; refersh on postgis; add some notes to the Enclosing Circle Algorithm page&lt;br /&gt;
* June 1: add RDP git remote; add more documentation to wiki page; refactor downloader scripts; start creation of tooling for interacting with data&lt;br /&gt;
&lt;br /&gt;
=== May 2017 ===&lt;br /&gt;
&lt;br /&gt;
* May 31: finish copy-pasting attributes into the wiki page; retroactively fill out work log; meet with Ed to discuss next steps&lt;br /&gt;
* May 30: update documentation on wiki, restructure large binary files to have more hierarchy instead of a flat listing at the root&lt;br /&gt;
* May 29: expand to APS; expand to raw assignment data&lt;br /&gt;
* May 27: expand to maintenance fee data&lt;br /&gt;
* May 26: create models, translate &amp;lt;code&amp;gt;xmlparser*.pl&amp;lt;/code&amp;gt; file into Java; start using builder pattern&lt;br /&gt;
* May 25: sketch out OO design of project; download bulk data&lt;br /&gt;
* May 24: move wiki pages around; start git repository for project&lt;br /&gt;
* May 21: discuss technical details of previous work with Ed&lt;br /&gt;
* May 8: cleanup dead links on wiki and start reading about previous work; discuss current project status with Ed&lt;br /&gt;
* May 4: setup wiki account, rdp account, database training&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Work Log]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Reproducible_Patent_Data&amp;diff=20961</id>
		<title>Reproducible Patent Data</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Reproducible_Patent_Data&amp;diff=20961"/>
		<updated>2017-10-20T18:30:30Z</updated>

		<summary type="html">&lt;p&gt;OliverC: update application use dates and remove imaginary xml 4.5&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{McNair Projects&lt;br /&gt;
|Has Image=Uspto web logo.jpg&lt;br /&gt;
|Has title=Reproducible Patent Data&lt;br /&gt;
|Has owner=Oliver Chang&lt;br /&gt;
|Has start date=May 17&lt;br /&gt;
|Has project status=Active&lt;br /&gt;
|Does subsume=Redesigning Patent Database, Patent Assignment Data Restructure,&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A continuation of [[Redesigning Patent Database]] that aims to write faster, more centralized code to deal with data from the United States Patent and Trademark Office (USPTO). By having an end-to-end pipeline we can easily reproduce or update data without worrying about unintentional side effects or missing data.&lt;br /&gt;
&lt;br /&gt;
== Quickstart ==&lt;br /&gt;
&lt;br /&gt;
To get up and running with the code, do the following:&lt;br /&gt;
&lt;br /&gt;
# Clone the git project (link at end of page) to your user directory&lt;br /&gt;
# Launch IntelliJ with &amp;gt;= Java 8 and Maven configured (default version installed on the RDP is setup to do this)&lt;br /&gt;
# Open project in IntelliJ&lt;br /&gt;
# Create an empty database (see [[#Database]])&lt;br /&gt;
# Run the table creation scripts in &amp;lt;code&amp;gt;src/db/schemas/&amp;lt;/code&amp;gt; in your new database&lt;br /&gt;
# Modify the constant &amp;lt;code&amp;gt;DATABASE_NAME&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\postgres\DatabaseHelper.java&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run the Driver scripts in IntelliJ with the correct value for &amp;lt;code&amp;gt;DATA_DIRECTORY&amp;lt;/code&amp;gt;&lt;br /&gt;
# [Take a really, really long lunch...in total should take no more than five hours to load data on RDP]&lt;br /&gt;
# Run scripts in &amp;lt;code&amp;gt;src/db/constraints&amp;lt;/code&amp;gt; to check data assumptions&lt;br /&gt;
# That's it!&lt;br /&gt;
&lt;br /&gt;
== Directory Layout ==&lt;br /&gt;
&lt;br /&gt;
=== Where is the Data? ===&lt;br /&gt;
&lt;br /&gt;
==== Directories ====&lt;br /&gt;
&lt;br /&gt;
All of the information for this project is located at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are several interesting directories:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;data/downloads/&amp;lt;/code&amp;gt; is USPTO bulkdata, unmodified straight from the scraper&lt;br /&gt;
* &amp;lt;code&amp;gt;data/extracts/&amp;lt;/code&amp;gt; is a directory of a strict subset of the information stored in &amp;lt;code&amp;gt;data/downloads/&amp;lt;/code&amp;gt;. It is the result of running a bulk 7-zip job on that directory to get everything unzipped in a flat data structure. Note that these files have the USPTO modified-by time since that metadata is stored in the zipfiles. To extract files in this nice format, select all of the zipfiles and setup an extraction job like in this [[media:7zip-params.png|screenshot]]&lt;br /&gt;
* &amp;lt;code&amp;gt;data/backups/&amp;lt;/code&amp;gt; is a 7zip'd backup of the corresponding directory in extracts&lt;br /&gt;
* &amp;lt;code&amp;gt;src/&amp;lt;/code&amp;gt; is the main code repository for the java project&lt;br /&gt;
&lt;br /&gt;
==== Input Files ====&lt;br /&gt;
&lt;br /&gt;
All of the text-only Red Book files for '''granted patents''' from 1976 to 2016, inclusive. To find a specific year's XML file, find it in&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\granted\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find application data''' from 2001 to 2016, inclusive, look in&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\applications\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find assignment data''', look in &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\extracts\granted\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''To find maintenance fee data''', look in &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\downloads\maintenance\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Where is the Code? ===&lt;br /&gt;
&lt;br /&gt;
The code has the same parent directory as the data, so it is at &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src&amp;lt;/code&amp;gt;. You might notice a lot of single-entry directories; this is an idiomatic Java pattern that is used for package separation. If using IntelliJ or some other IDE, these directories are a bit less annoying.&lt;br /&gt;
&lt;br /&gt;
The development environment is Java 8 JDK, IntelliJ Ultimate IDE, Maven build tools, and git VCS.&lt;br /&gt;
&lt;br /&gt;
The git repository can be found at https://rdp.mcnaircenter.org/codebase/Repository/ReproduciblePatent&lt;br /&gt;
&lt;br /&gt;
==== Prior Art ====&lt;br /&gt;
&lt;br /&gt;
This tool is not so concerned with adding new functionality; rather, it aims to take a bunch of spread out Perl scripts and create a faster system that is easier to work with. As such, its functionality is largely stolen from those scripts:&lt;br /&gt;
&lt;br /&gt;
* Downloader: &amp;lt;code&amp;gt;E:\McNair\Software\Scripts\Patent\USPTO_Parser.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
* XML Splitter: &amp;lt;code&amp;gt;E:\McNair\PatentData\splitter.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
* XML Parsing: &amp;lt;code&amp;gt;E:\McNair\PatentData\Processed\xmlparser_4.5_4.4_4.3.pl&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;E:\McNair\PatentData\Processed\*.pm&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, I used several non-standard Java libraries listed below:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/mashape/unirest-java/ Unirest] for easy HTTP requests (MIT License)&lt;br /&gt;
* [https://github.com/google/guava Google Guava] for immutable collections and Stream utilities (Apache v2.0 License)&lt;br /&gt;
* [https://github.com/jhy/jsoup/ jsoup] for HTML parsing (MIT License)&lt;br /&gt;
* [http://commons.apache.org/proper/commons-codec/ Apache Commons Codec] (Apache v2.0 License)&lt;br /&gt;
* [http://commons.apache.org/proper/commons-lang/ Apache Commons Lang v3] (Apache v2.0 License)&lt;br /&gt;
* [https://mvnrepository.com/artifact/org.jetbrains/annotations/15.0 Jetbrains Annotations] for enhanced null checks (Apache v2.0 License)&lt;br /&gt;
* [http://search.maven.org/#artifactdetails%7Corg.postgresql%7Cpostgresql%7C42.1.1.jre7%7Cbundle PostgreSQL JDBC] (BSD 3-clause per https://github.com/pgjdbc/pgjdbc-jre7/blob/master/LICENSE)&lt;br /&gt;
&lt;br /&gt;
If using maven, these dependencies are listed and should automatically be setup.&lt;br /&gt;
&lt;br /&gt;
==== Using Code ====&lt;br /&gt;
&lt;br /&gt;
Any file with a line that says &amp;lt;code&amp;gt;public static void main(String[] args) {&amp;lt;/code&amp;gt; can be run as a standalone file. The easiest way to do this is to load the project and then the file in IntelliJ and click the little green play arrow next to this bit of code.&lt;br /&gt;
&lt;br /&gt;
The code can also be run via the standard &amp;lt;code&amp;gt;javac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;java&amp;lt;/code&amp;gt; commands but since this project has a complicated structure you end up having to run commands like &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;C:\Program Files\Java\jdk1.8.0_131\bin\java&amp;quot; &amp;quot;-javaagent:C:\Users\OliverC\IntelliJ IDEA 2017.1.3\lib\idea_rt.jar=62364:C:\Users\OliverC\IntelliJ IDEA 2017.1.3\bin&amp;quot; -Dfile.encoding=UTF-8 -classpath &amp;quot;[...contents truncated...];C:\Users\OliverC\.m2\repository\org\postgresql\postgresql\42.1.1\postgresql-42.1.1.jar&amp;quot; org.bakerinstitute.mcnair.uspto_assignments.XmlDriver&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to include all of the runtime dependencies and it's just not worth it.&lt;br /&gt;
&lt;br /&gt;
==== Altering Code ====&lt;br /&gt;
&lt;br /&gt;
* Use the IntelliJ command Reformat code (found in the menus at &amp;lt;code&amp;gt;Code &amp;gt; Reformat Code&amp;lt;/code&amp;gt;&lt;br /&gt;
* Use the optimize imports function found under the same menu&lt;br /&gt;
* Use spaces for indentation&lt;br /&gt;
* Loosely try to keep lines below 120 characters&lt;br /&gt;
* Commit changes to the Git remote repository &amp;quot;bonobo&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Schema Reconciliation ==&lt;br /&gt;
&lt;br /&gt;
For the work by Joe, see the [[Patent Schema Reconciliation]] page &lt;br /&gt;
&lt;br /&gt;
=== Patents (Granted) ===&lt;br /&gt;
&lt;br /&gt;
See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\data\examples\granted&amp;lt;/code&amp;gt; for extracted examples of what specific data is available for a sample of the data.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Granted Patent Data Formats&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Dates Used !! scope=&amp;quot;col&amp;quot; | Format !! scope=&amp;quot;col&amp;quot; | Location !! scope=&amp;quot;col&amp;quot; | Supported? !! scope=&amp;quot;col&amp;quot; | Utility !! scope=&amp;quot;col&amp;quot; | Reissue !! scope=&amp;quot;col&amp;quot; | Design !! scope=&amp;quot;col&amp;quot; | Plant&lt;br /&gt;
|-&lt;br /&gt;
|January 1976 to December 2001&lt;br /&gt;
|APS&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;del&amp;gt;January 2001 to December 2001&amp;lt;/del&amp;gt;&lt;br /&gt;
|&amp;lt;del&amp;gt;SGML&amp;lt;/del&amp;gt;&lt;br /&gt;
|Ignored; use concurrently recorded APS data&lt;br /&gt;
|No&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|-&lt;br /&gt;
|January 2002 to December 2004&lt;br /&gt;
|XML Version 2.5&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/blunderyears&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2005 to December 2005&lt;br /&gt;
|XML Version 4.0 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2006 to December 2006&lt;br /&gt;
|XML Version 4.1 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2007 to December 2012&lt;br /&gt;
|XML Version 4.2 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2013 to September 24, 2013&lt;br /&gt;
|XML Version 4.3 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|October 8, 2013 to December 2014&lt;br /&gt;
|XML Version 4.4 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|-&lt;br /&gt;
|January 2015 to December 2016&lt;br /&gt;
|XML Version 4.5 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/granted/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: green; color: white;&amp;quot; | Yes&lt;br /&gt;
|✓&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|~&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== APS Rosetta Stone ===&lt;br /&gt;
&lt;br /&gt;
The Advanced Patent System (APS) is a fixed-width text format used to store historical patent grant data. The documentation for this sucks; there are pages missing at random. Luckily, we only care about the content contained here: [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]].&lt;br /&gt;
&lt;br /&gt;
It's worth mentioning that the APS contains an advanced text markup system for chemical formulae, basic text markup, tables, etc. that can lead to seemingly garbled text that is perfectly well-formed.&lt;br /&gt;
&lt;br /&gt;
==== APS Gotchas ====&lt;br /&gt;
&lt;br /&gt;
* PATN.WKU is the granted patent number. It is 7 digits while the spec promises 6 digits. The rightmost digit is a check digit modulus 11. See [[File:Aps-wku-modulus11.pdf]] for the words from the horse's mouth.&lt;br /&gt;
&lt;br /&gt;
=== Patents (Applications) ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Patent Application Data Formats&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Dates Used !! scope=&amp;quot;col&amp;quot; | Format !! scope=&amp;quot;col&amp;quot; | Location !! scope=&amp;quot;col&amp;quot; | Supported by Parser?&lt;br /&gt;
|-&lt;br /&gt;
|March 15, 2001 to December 2001&lt;br /&gt;
|XML Version 1.5&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: red; color: white;&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
|January 2002 to December 2004&lt;br /&gt;
|XML Version 1.6&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/vintage&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: red; color: white;&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
|January 2005 to December 2005&lt;br /&gt;
|XML Version 4.0 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Maybe&lt;br /&gt;
|-&lt;br /&gt;
|January 2006 to December 2006&lt;br /&gt;
|XML Version 4.1 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Maybe&lt;br /&gt;
|-&lt;br /&gt;
|January 2007 to December 2012&lt;br /&gt;
|XML Version 4.2 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Maybe&lt;br /&gt;
|-&lt;br /&gt;
|January 2013 to December 2014&lt;br /&gt;
|XML Version 4.3 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Maybe&lt;br /&gt;
|-&lt;br /&gt;
|January 2015 to ''Present''&lt;br /&gt;
|XML Version 4.4 ICE&lt;br /&gt;
|&amp;lt;code&amp;gt;data/extracts/applications/modern&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;background: yellow;&amp;quot; | Maybe&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Database ==&lt;br /&gt;
&lt;br /&gt;
Because there isn't a compelling reason not to, I used the existing PostgreSQL infrastructure on the RDP.&lt;br /&gt;
The &amp;quot;Java Way&amp;quot; of interacting with databases is the Java Database Connectivity API (JDBC), an implementation-agnostic API for interacting with databases.&lt;br /&gt;
This project uses the stock [https://jdbc.postgresql.org/ Postgres JDBC], version 42.1.1&lt;br /&gt;
&lt;br /&gt;
=== Create an empty database on RDP ===&lt;br /&gt;
&lt;br /&gt;
To create an empty database, run this command: &amp;lt;code&amp;gt;$ createdb --username=postgres database-name-goes-here # password is tabspaceenter&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstraction Layer ===&lt;br /&gt;
&lt;br /&gt;
Since writing raw SQL is a bit cumbersome and error-prone, I have added some abstraction layers that make it much easier to quickly add bulk data. By using Postgres's &amp;lt;code&amp;gt;CopyManager&amp;lt;/code&amp;gt; class, we buffer SQL copy commands in memory (as many as possible) and then flush these rows. To understand how the abstraction layers work, see the code in &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\postgres&amp;lt;/code&amp;gt;. See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\main\java\org\bakerinstitute\mcnair\models\GrantedPatent.java&amp;lt;/code&amp;gt; for '''an example of how to extend''' the abstraction layer to deal with more complex scenarios.&lt;br /&gt;
&lt;br /&gt;
== Address Data ==&lt;br /&gt;
&lt;br /&gt;
To get the most granular address data (street level, or at least postcode level) about who owns patents, the path is not so straightforward because off the complicated mapping of ownership to a granted patent.&lt;br /&gt;
This is the final part of this project that I am working on and it is all at the level of SQL.&lt;br /&gt;
See &amp;lt;code&amp;gt;E:\McNair\Projects\SimplerPatentData\src\db\joins&amp;lt;/code&amp;gt; for my attempts to create a clean mapping.&lt;br /&gt;
Optimistically speaking, the data generated here should be superset of the data present in the Patent Assignment Data Restructure project.&lt;br /&gt;
&lt;br /&gt;
Note that as of the beginning of August 2017, this part '''has not been completed.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Intuition ===&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;assignments_longform.last_update_date&amp;lt;/code&amp;gt; to find current/latest (or first/earliest) date of assignment. Then match with &amp;lt;code&amp;gt;properties.docid&amp;lt;/code&amp;gt; on &amp;lt;code&amp;gt;reelno, frameno&amp;lt;/code&amp;gt; to find patent application id. With this mapping to granted patents, we can discover the details of the original granted patent. And with the right date and reelno and frameno, we can match to the &amp;lt;code&amp;gt;assignees&amp;lt;/code&amp;gt; table and get fine granularity addresses.&lt;br /&gt;
&lt;br /&gt;
== Related Pages ==&lt;br /&gt;
&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries, Summer 2017 by this guy]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification, Summer 2017 based on tables from Assignment Data Restructure]]&lt;br /&gt;
* [[Patent_Assignment_Data_Restructure|Assignment Data Restructure, Spring 2017 by Marcela and Sonia]]&lt;br /&gt;
* [[Redesigning_Patent_Database|Redesigning Patent Database, Spring 2017 by Shelby]]&lt;br /&gt;
* [[Patent_Data_Cleanup_(June_2016)|Patent Data Cleanup, June 2016 by Marcela]]&lt;br /&gt;
* [[Patent_Data|Patent Data, Spring 2016 by Marcela]] &lt;br /&gt;
* [[Lex_Machina|Lex Machina]]&lt;br /&gt;
* [[USPTO_Patent_Litigation_Data|USPTO Patent Litigation Research Dataset by Ed]]&lt;br /&gt;
* [[Patent_Litigation_and_Review|Patent Litigation and Review by Marcela]]&lt;br /&gt;
* [[Bag_of_Words_Analysis_of_Patent_Data|Bag of Words Analysis]]&lt;br /&gt;
* [[Patent|Existing Database Schema]]&lt;br /&gt;
* [[Oliver_Chang_(Work_Log)|My Work Log]]&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&lt;br /&gt;
* Understanding Assignment Data: [https://www.uspto.gov/sites/default/files/documents/USPTO_Patents_Assignment_Dataset_WP.pdf USPTO Documentation on their cleanup of this data]&lt;br /&gt;
* [https://bulkdata.uspto.gov/data2/patent/grant/redbook/fulltext/1976/PatentFullTextAPSDoc_GreenBook.pdf USPTO Green Book (APS) Documentation]&lt;br /&gt;
* [https://bulkdata.uspto.gov/ USPTO Bulk Data Storage System (BDSS)]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Builder_pattern Builder Pattern in Object-Oriented Programming]&lt;br /&gt;
* [https://rdp.mcnaircenter.org/codebase/Repository/ReproduciblePatent Git Repository]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=20960</id>
		<title>Oliver Chang (Work Log)</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=20960"/>
		<updated>2017-10-20T17:01:57Z</updated>

		<summary type="html">&lt;p&gt;OliverC: /* Day-by-Day (in reverse chronological order) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Oliver Chang]] [[Work Logs]]&lt;br /&gt;
[[Oliver Chang (Work Log)|(logpage)]]&lt;br /&gt;
&lt;br /&gt;
''To-do List'':&lt;br /&gt;
&lt;br /&gt;
* Expand XPath use in the patent data&lt;br /&gt;
* Edit to include Application data&lt;br /&gt;
* Finish ID joining&lt;br /&gt;
&lt;br /&gt;
''Projects'':&lt;br /&gt;
&lt;br /&gt;
* [[PostGIS_Installation|PostGIS Installation]]&lt;br /&gt;
* [[Reproducible_Patent_Data|Reproducible Patent Data]]&lt;br /&gt;
* [[Patent_Validity_Ideas_for_ML|Predictive Patent Validity Machine Learning Ideas]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification]]&lt;br /&gt;
* [[GPU_Build|GPU Computer Build]]&lt;br /&gt;
* [[Parallel_Enclosing_Circle_Algorithm|Parallel Enclosing Circle Algorithm]]&lt;br /&gt;
&lt;br /&gt;
''Uploads'':&lt;br /&gt;
&lt;br /&gt;
* [[File:PADX-File-Description-v2_Hague.pdf]]&lt;br /&gt;
** Describes patent kind codes (notably, what the hell X0 represents)&lt;br /&gt;
* [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]]&lt;br /&gt;
** Describes the fields in APS, their supposed character lengths, and if they are required/optional&lt;br /&gt;
* [[File:Aps-wku-modulus11.pdf]]&lt;br /&gt;
** Describes the layout of the check digit on magnetic tape&lt;br /&gt;
* [[File:Mod-11-algorithm.pdf]]&lt;br /&gt;
** Describes the algorithm used to calculate the check digit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Day-by-Day (in reverse chronological order) ==&lt;br /&gt;
&lt;br /&gt;
=== October 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Oct 19: repopulate patents database and create spreadsheet of assignment equivalencies&lt;br /&gt;
* Oct 11: add issues to work on to the PECA wiki page; cleanup PECA git repo; start patent application code from granted patent code and start customizing to new domain&lt;br /&gt;
* Oct 3: troubleshoot vc_circles.py and make command line interface a little nicer&lt;br /&gt;
* Oct 2: discuss mapping strategies &amp;amp; investigate missing eca data &lt;br /&gt;
&lt;br /&gt;
=== September 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Sept 23: make Project/OliverLovesCircles usable and add initial splitting ability&lt;br /&gt;
* Sept 22: goal setting &amp;amp; server debugging &amp;amp; meet with Yang&lt;br /&gt;
&lt;br /&gt;
=== August 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Aug 4: setup parallel instance python framework for job reporting; begin test run&lt;br /&gt;
* Aug 2: finish up some documentation of the code and for the wiki&lt;br /&gt;
* Aug 1: discuss with Abhi &amp;amp; Ed about alternatives to Java port because of algorithmic constants that would be hard to port; run test batches on python with addition of equality operators and convergence early stopping&lt;br /&gt;
&lt;br /&gt;
=== July 2017 ===&lt;br /&gt;
&lt;br /&gt;
* July 31: sketch out parallel enclosing circle algorithm&lt;br /&gt;
* July 28: field questions and data cleanup questions from Kerda &amp;amp; Joe &amp;amp; Adrian&lt;br /&gt;
* ''travelling''&lt;br /&gt;
* July 19: try to remove duplicated records (esp. those with empty titles) which are preventing the addition of a unique constraint&lt;br /&gt;
* July 18: run correspondent join on properties and correspondents table to match previous project; sync with Adrian and Abhi&lt;br /&gt;
* July 17: redo db operations after cleaning up granted patent number bugs&lt;br /&gt;
* July 13: powwow about parallelizing Enclosing Circle Algorithm; sketch out what to do for the rest of the summer; work more on joins&lt;br /&gt;
* July 12: generate some example data illustrating the difficulty of joining different tables&lt;br /&gt;
* July 11: track down some bugs that happen very rarely and were missed in the initial qa phase&lt;br /&gt;
* July 7: catch up on documentation&lt;br /&gt;
* July 6: try (unsuccessfully) to understand docid mapping...create exploration scripts&lt;br /&gt;
* July 5: add invention title to proper grouping of assignment properties; optimize XML parsing&lt;br /&gt;
&lt;br /&gt;
=== June 2017 ===&lt;br /&gt;
&lt;br /&gt;
* June 30: powwow with James, Abhi, Ed about optimization issues; discuss document ids, X0 etc with Ed; pinpoint issues with APS doc numbers (see Repro Pat Dat#Gotchas) for more info&lt;br /&gt;
* June 29: add logging of copy commands, more chattiness to scripts, debug assignment data failure&lt;br /&gt;
* June 28: create examples for expansion to plant, reissue, design patent collection; start optimizing xml&lt;br /&gt;
* June 27: write SQL to replicate assignees, extract postcodes for ongoing projects&lt;br /&gt;
* June 26: speedup code, abstract in-memory file splitters to avoid repetition and some weird edge cases&lt;br /&gt;
* June 25: create mappings for APS, assignment properties, XML 2.5 for data import; run data imports for granted data&lt;br /&gt;
* June 23: cleanup hacky models with a better set of abstractions; cleanup IDE warnings; redefine patent-address mapping&lt;br /&gt;
* June 22: create postcode&amp;lt;-&amp;gt;patent table&lt;br /&gt;
* June 21: document granted patent queries and equivalencies&lt;br /&gt;
* June 20: sketch out APS driver; discuss patent id problem; further document with evidence the zipcode data validity&lt;br /&gt;
* June 19: skim address regular expressions; cursory investigation of patent table&lt;br /&gt;
* June 16: create method of getting all data into the database, whether it likes it or not; copy over assignments, granted data using new scheme&lt;br /&gt;
* June 15: add more robust error reporting, fix race conditions; build out assignment driver; build out fee event driver; add error logging&lt;br /&gt;
* June 14: migrate bulk inserts to copy command; refresh on address data and start in on that; convert processor to multi-threaded application&lt;br /&gt;
* June 13: spot check SQL tables; fix broken final case endlessly looping; investigate smarter insert methods&lt;br /&gt;
* June 12: add XML printer, use it to inspect applications; extend BaseScraper to fetch patent application data; add applications documentation to my project page; add CREATE of other tables&lt;br /&gt;
* June 8: add foreign key inserts; create pretty printer for XML analysis&lt;br /&gt;
* June 7: finalize DB abstraction layer; migrate code to bulk inserts; upgrade webserver software and do optimization on RDP postgres with Ed&lt;br /&gt;
* June 6: add jdbc; create basic schema; add db interaction; schedule meeting for later in the week&lt;br /&gt;
* June 5: look into postgresql; refersh on postgis; add some notes to the Enclosing Circle Algorithm page&lt;br /&gt;
* June 1: add RDP git remote; add more documentation to wiki page; refactor downloader scripts; start creation of tooling for interacting with data&lt;br /&gt;
&lt;br /&gt;
=== May 2017 ===&lt;br /&gt;
&lt;br /&gt;
* May 31: finish copy-pasting attributes into the wiki page; retroactively fill out work log; meet with Ed to discuss next steps&lt;br /&gt;
* May 30: update documentation on wiki, restructure large binary files to have more hierarchy instead of a flat listing at the root&lt;br /&gt;
* May 29: expand to APS; expand to raw assignment data&lt;br /&gt;
* May 27: expand to maintenance fee data&lt;br /&gt;
* May 26: create models, translate &amp;lt;code&amp;gt;xmlparser*.pl&amp;lt;/code&amp;gt; file into Java; start using builder pattern&lt;br /&gt;
* May 25: sketch out OO design of project; download bulk data&lt;br /&gt;
* May 24: move wiki pages around; start git repository for project&lt;br /&gt;
* May 21: discuss technical details of previous work with Ed&lt;br /&gt;
* May 8: cleanup dead links on wiki and start reading about previous work; discuss current project status with Ed&lt;br /&gt;
* May 4: setup wiki account, rdp account, database training&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Work Log]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=20736</id>
		<title>Oliver Chang (Work Log)</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=20736"/>
		<updated>2017-10-11T19:19:38Z</updated>

		<summary type="html">&lt;p&gt;OliverC: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Oliver Chang]] [[Work Logs]]&lt;br /&gt;
[[Oliver Chang (Work Log)|(logpage)]]&lt;br /&gt;
&lt;br /&gt;
''To-do List'':&lt;br /&gt;
&lt;br /&gt;
* Expand XPath use in the patent data&lt;br /&gt;
* Edit to include Application data&lt;br /&gt;
* Finish ID joining&lt;br /&gt;
&lt;br /&gt;
''Projects'':&lt;br /&gt;
&lt;br /&gt;
* [[PostGIS_Installation|PostGIS Installation]]&lt;br /&gt;
* [[Reproducible_Patent_Data|Reproducible Patent Data]]&lt;br /&gt;
* [[Patent_Validity_Ideas_for_ML|Predictive Patent Validity Machine Learning Ideas]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification]]&lt;br /&gt;
* [[GPU_Build|GPU Computer Build]]&lt;br /&gt;
* [[Parallel_Enclosing_Circle_Algorithm|Parallel Enclosing Circle Algorithm]]&lt;br /&gt;
&lt;br /&gt;
''Uploads'':&lt;br /&gt;
&lt;br /&gt;
* [[File:PADX-File-Description-v2_Hague.pdf]]&lt;br /&gt;
** Describes patent kind codes (notably, what the hell X0 represents)&lt;br /&gt;
* [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]]&lt;br /&gt;
** Describes the fields in APS, their supposed character lengths, and if they are required/optional&lt;br /&gt;
* [[File:Aps-wku-modulus11.pdf]]&lt;br /&gt;
** Describes the layout of the check digit on magnetic tape&lt;br /&gt;
* [[File:Mod-11-algorithm.pdf]]&lt;br /&gt;
** Describes the algorithm used to calculate the check digit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Day-by-Day (in reverse chronological order) ==&lt;br /&gt;
&lt;br /&gt;
=== October 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Oct 11: add issues to work on to the PECA wiki page; cleanup PECA git repo; start patent application code from granted patent code and start customizing to new domain&lt;br /&gt;
* Oct 3: troubleshoot vc_circles.py and make command line interface a little nicer&lt;br /&gt;
* Oct 2: discuss mapping strategies &amp;amp; investigate missing eca data &lt;br /&gt;
&lt;br /&gt;
=== September 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Sept 23: make Project/OliverLovesCircles usable and add initial splitting ability&lt;br /&gt;
* Sept 22: goal setting &amp;amp; server debugging &amp;amp; meet with Yang&lt;br /&gt;
&lt;br /&gt;
=== August 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Aug 4: setup parallel instance python framework for job reporting; begin test run&lt;br /&gt;
* Aug 2: finish up some documentation of the code and for the wiki&lt;br /&gt;
* Aug 1: discuss with Abhi &amp;amp; Ed about alternatives to Java port because of algorithmic constants that would be hard to port; run test batches on python with addition of equality operators and convergence early stopping&lt;br /&gt;
&lt;br /&gt;
=== July 2017 ===&lt;br /&gt;
&lt;br /&gt;
* July 31: sketch out parallel enclosing circle algorithm&lt;br /&gt;
* July 28: field questions and data cleanup questions from Kerda &amp;amp; Joe &amp;amp; Adrian&lt;br /&gt;
* ''travelling''&lt;br /&gt;
* July 19: try to remove duplicated records (esp. those with empty titles) which are preventing the addition of a unique constraint&lt;br /&gt;
* July 18: run correspondent join on properties and correspondents table to match previous project; sync with Adrian and Abhi&lt;br /&gt;
* July 17: redo db operations after cleaning up granted patent number bugs&lt;br /&gt;
* July 13: powwow about parallelizing Enclosing Circle Algorithm; sketch out what to do for the rest of the summer; work more on joins&lt;br /&gt;
* July 12: generate some example data illustrating the difficulty of joining different tables&lt;br /&gt;
* July 11: track down some bugs that happen very rarely and were missed in the initial qa phase&lt;br /&gt;
* July 7: catch up on documentation&lt;br /&gt;
* July 6: try (unsuccessfully) to understand docid mapping...create exploration scripts&lt;br /&gt;
* July 5: add invention title to proper grouping of assignment properties; optimize XML parsing&lt;br /&gt;
&lt;br /&gt;
=== June 2017 ===&lt;br /&gt;
&lt;br /&gt;
* June 30: powwow with James, Abhi, Ed about optimization issues; discuss document ids, X0 etc with Ed; pinpoint issues with APS doc numbers (see Repro Pat Dat#Gotchas) for more info&lt;br /&gt;
* June 29: add logging of copy commands, more chattiness to scripts, debug assignment data failure&lt;br /&gt;
* June 28: create examples for expansion to plant, reissue, design patent collection; start optimizing xml&lt;br /&gt;
* June 27: write SQL to replicate assignees, extract postcodes for ongoing projects&lt;br /&gt;
* June 26: speedup code, abstract in-memory file splitters to avoid repetition and some weird edge cases&lt;br /&gt;
* June 25: create mappings for APS, assignment properties, XML 2.5 for data import; run data imports for granted data&lt;br /&gt;
* June 23: cleanup hacky models with a better set of abstractions; cleanup IDE warnings; redefine patent-address mapping&lt;br /&gt;
* June 22: create postcode&amp;lt;-&amp;gt;patent table&lt;br /&gt;
* June 21: document granted patent queries and equivalencies&lt;br /&gt;
* June 20: sketch out APS driver; discuss patent id problem; further document with evidence the zipcode data validity&lt;br /&gt;
* June 19: skim address regular expressions; cursory investigation of patent table&lt;br /&gt;
* June 16: create method of getting all data into the database, whether it likes it or not; copy over assignments, granted data using new scheme&lt;br /&gt;
* June 15: add more robust error reporting, fix race conditions; build out assignment driver; build out fee event driver; add error logging&lt;br /&gt;
* June 14: migrate bulk inserts to copy command; refresh on address data and start in on that; convert processor to multi-threaded application&lt;br /&gt;
* June 13: spot check SQL tables; fix broken final case endlessly looping; investigate smarter insert methods&lt;br /&gt;
* June 12: add XML printer, use it to inspect applications; extend BaseScraper to fetch patent application data; add applications documentation to my project page; add CREATE of other tables&lt;br /&gt;
* June 8: add foreign key inserts; create pretty printer for XML analysis&lt;br /&gt;
* June 7: finalize DB abstraction layer; migrate code to bulk inserts; upgrade webserver software and do optimization on RDP postgres with Ed&lt;br /&gt;
* June 6: add jdbc; create basic schema; add db interaction; schedule meeting for later in the week&lt;br /&gt;
* June 5: look into postgresql; refersh on postgis; add some notes to the Enclosing Circle Algorithm page&lt;br /&gt;
* June 1: add RDP git remote; add more documentation to wiki page; refactor downloader scripts; start creation of tooling for interacting with data&lt;br /&gt;
&lt;br /&gt;
=== May 2017 ===&lt;br /&gt;
&lt;br /&gt;
* May 31: finish copy-pasting attributes into the wiki page; retroactively fill out work log; meet with Ed to discuss next steps&lt;br /&gt;
* May 30: update documentation on wiki, restructure large binary files to have more hierarchy instead of a flat listing at the root&lt;br /&gt;
* May 29: expand to APS; expand to raw assignment data&lt;br /&gt;
* May 27: expand to maintenance fee data&lt;br /&gt;
* May 26: create models, translate &amp;lt;code&amp;gt;xmlparser*.pl&amp;lt;/code&amp;gt; file into Java; start using builder pattern&lt;br /&gt;
* May 25: sketch out OO design of project; download bulk data&lt;br /&gt;
* May 24: move wiki pages around; start git repository for project&lt;br /&gt;
* May 21: discuss technical details of previous work with Ed&lt;br /&gt;
* May 8: cleanup dead links on wiki and start reading about previous work; discuss current project status with Ed&lt;br /&gt;
* May 4: setup wiki account, rdp account, database training&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Work Log]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Parallel_Enclosing_Circle_Algorithm&amp;diff=20735</id>
		<title>Parallel Enclosing Circle Algorithm</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Parallel_Enclosing_Circle_Algorithm&amp;diff=20735"/>
		<updated>2017-10-11T18:52:33Z</updated>

		<summary type="html">&lt;p&gt;OliverC: add notes about the current issues faced by the program that were mentioned on Monday&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{McNair Projects&lt;br /&gt;
|Has title=Parallel Enclosing Circle Algorithm&lt;br /&gt;
|Has owner=Oliver Chang,&lt;br /&gt;
|Has start date=July 31, 2017&lt;br /&gt;
|Has deadline=October 4, 2017&lt;br /&gt;
|Has project status=Complete&lt;br /&gt;
|Is dependent on=Enclosing Circle Algorithm,&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A thin-wrapper around [[Enclosing_Circle_Algorithm_(Rework)|the enclosing circle algorithm]] which allows for instance-level parallelization.&lt;br /&gt;
This project consists of the python files in &amp;lt;code&amp;gt;E:\McNair\Projects\OliverLovesCircles\src\python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Parallelization is implemented via Python2's [https://docs.python.org/2/library/subprocess.html#subprocess.Popen &amp;lt;code&amp;gt;subprocess.open()&amp;lt;/code&amp;gt;] which is non-blocking and available in the standard library.&lt;br /&gt;
&lt;br /&gt;
== The Problem ==&lt;br /&gt;
&lt;br /&gt;
Note that this '''is not the classical enclosing circle algorithm'''.&lt;br /&gt;
Rather, we seek to minimize the sum of enclosing circles containing at least &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; points.&lt;br /&gt;
Thus, multiple circles are allowed and inclusion in multiple circles is possible.&lt;br /&gt;
&lt;br /&gt;
This algorithm has terrible time-performance characteristics, so we make the assumption that we can divide a large number of points with k-means and then solve those subproblems.&lt;br /&gt;
In other words, we make the simplifying assumption that the Enclosing Circle Algorithm has [https://en.wikipedia.org/wiki/Optimal_substructure Optimal Substructure].&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
* in &amp;lt;code&amp;gt;circles.py&amp;lt;/code&amp;gt;:&lt;br /&gt;
** &amp;lt;code&amp;gt;ITERATIONS&amp;lt;/code&amp;gt;: the number of iterations to attempt for each &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt; to find minimum for that &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;MIN_POINTS_PER_CIRCLE&amp;lt;/code&amp;gt; (AKA &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;): the minimum number of data points that must be included in a circle&lt;br /&gt;
* in &amp;lt;code&amp;gt;vc_circles.py&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;NUMBER_INSTANCES&amp;lt;/code&amp;gt;: number of parallel instances to run; assume no data-races between instances&lt;br /&gt;
** &amp;lt;code&amp;gt;SWEEP_CYCLE_SECONDS&amp;lt;/code&amp;gt;: amount of time before removing completed jobs from the current job and adding new jobs if any files are left to process&lt;br /&gt;
** &amp;lt;code&amp;gt;TIMEOUT_MINUTES&amp;lt;/code&amp;gt;: maximum running time of a parallel instance of the algorithm&lt;br /&gt;
** &amp;lt;code&amp;gt;SPLIT_THRESHOLD&amp;lt;/code&amp;gt;: if a dataset has more than this threshold of data points, it will be split via k-means&lt;br /&gt;
&lt;br /&gt;
== Example Usage ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ python vc_circles.py --infile E:/McNair/Projects/OliverLovesCircles/CoLevelForCirclesNotRunGTE200.txt&lt;br /&gt;
$ python outjoiner.py&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
where &amp;lt;code&amp;gt;CoLevelForCirclesNotRunGTE200.txt&amp;lt;/code&amp;gt; is a tab-separated values file with the columns&lt;br /&gt;
&amp;lt;code&amp;gt;placestate, place, statecode, year, latitude, longitude, coname, datefirstinv, placens, geoid, city&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command will populate (and overwrite) any files in &amp;lt;code&amp;gt;data/&amp;lt;/code&amp;gt;. The format of the filenames in this directory are &amp;lt;code&amp;gt;{city}{sep}{state}{sep}{year}{sep}{num}.tsv&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;num&amp;lt;/code&amp;gt; is a 0-indexed integer of a split city/state/year &amp;lt;code&amp;gt;infile&amp;lt;/code&amp;gt; that has greater than &amp;lt;code&amp;gt;SPLIT_THRESHOLD&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Bugs/Issues ==&lt;br /&gt;
&lt;br /&gt;
# &amp;quot;St. Paul&amp;quot; and &amp;quot;St. Louis&amp;quot; have un-enclosed points--speculate because of weird file path issues&lt;br /&gt;
# Some place/state/year combinations do not run to completion regardless of how tractable the number of points&lt;br /&gt;
# How to merge small enclosing circles? This is a better measure of agglomeration regardless&lt;br /&gt;
# How to separate outliers? &lt;br /&gt;
&lt;br /&gt;
== Related Pages ==&lt;br /&gt;
&lt;br /&gt;
* [[Enclosing_Circle_Algorithm_(Rework)|Abhi's Rework (Summer 2017)]]&lt;br /&gt;
* [[Enclosing_Circle_Algorithm|Original Implementation (Spring 2017)]]&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&lt;br /&gt;
* [https://rdp.mcnaircenter.org/codebase/Repository/OliverEnclosingCircle Git Repository]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=20652</id>
		<title>Oliver Chang (Work Log)</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=20652"/>
		<updated>2017-10-06T16:55:28Z</updated>

		<summary type="html">&lt;p&gt;OliverC: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Oliver Chang]] [[Work Logs]]&lt;br /&gt;
[[Oliver Chang (Work Log)|(logpage)]]&lt;br /&gt;
&lt;br /&gt;
''To-do List'':&lt;br /&gt;
&lt;br /&gt;
* Expand XPath use in the patent data&lt;br /&gt;
* Edit to include Application data&lt;br /&gt;
* Finish ID joining&lt;br /&gt;
&lt;br /&gt;
''Projects'':&lt;br /&gt;
&lt;br /&gt;
* [[PostGIS_Installation|PostGIS Installation]]&lt;br /&gt;
* [[Reproducible_Patent_Data|Reproducible Patent Data]]&lt;br /&gt;
* [[Patent_Validity_Ideas_for_ML|Predictive Patent Validity Machine Learning Ideas]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification]]&lt;br /&gt;
* [[GPU_Build|GPU Computer Build]]&lt;br /&gt;
* [[Parallel_Enclosing_Circle_Algorithm|Parallel Enclosing Circle Algorithm]]&lt;br /&gt;
&lt;br /&gt;
''Uploads'':&lt;br /&gt;
&lt;br /&gt;
* [[File:PADX-File-Description-v2_Hague.pdf]]&lt;br /&gt;
** Describes patent kind codes (notably, what the hell X0 represents)&lt;br /&gt;
* [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]]&lt;br /&gt;
** Describes the fields in APS, their supposed character lengths, and if they are required/optional&lt;br /&gt;
* [[File:Aps-wku-modulus11.pdf]]&lt;br /&gt;
** Describes the layout of the check digit on magnetic tape&lt;br /&gt;
* [[File:Mod-11-algorithm.pdf]]&lt;br /&gt;
** Describes the algorithm used to calculate the check digit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Day-by-Day (in reverse chronological order) ==&lt;br /&gt;
&lt;br /&gt;
=== October 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Oct 3: troubleshoot vc_circles.py and make command line interface a little nicer&lt;br /&gt;
* Oct 2: discuss mapping strategies &amp;amp; investigate missing eca data &lt;br /&gt;
&lt;br /&gt;
=== September 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Sept 23: make Project/OliverLovesCircles usable and add initial splitting ability&lt;br /&gt;
* Sept 22: goal setting &amp;amp; server debugging &amp;amp; meet with Yang&lt;br /&gt;
&lt;br /&gt;
=== August 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Aug 4: setup parallel instance python framework for job reporting; begin test run&lt;br /&gt;
* Aug 2: finish up some documentation of the code and for the wiki&lt;br /&gt;
* Aug 1: discuss with Abhi &amp;amp; Ed about alternatives to Java port because of algorithmic constants that would be hard to port; run test batches on python with addition of equality operators and convergence early stopping&lt;br /&gt;
&lt;br /&gt;
=== July 2017 ===&lt;br /&gt;
&lt;br /&gt;
* July 31: sketch out parallel enclosing circle algorithm&lt;br /&gt;
* July 28: field questions and data cleanup questions from Kerda &amp;amp; Joe &amp;amp; Adrian&lt;br /&gt;
* ''travelling''&lt;br /&gt;
* July 19: try to remove duplicated records (esp. those with empty titles) which are preventing the addition of a unique constraint&lt;br /&gt;
* July 18: run correspondent join on properties and correspondents table to match previous project; sync with Adrian and Abhi&lt;br /&gt;
* July 17: redo db operations after cleaning up granted patent number bugs&lt;br /&gt;
* July 13: powwow about parallelizing Enclosing Circle Algorithm; sketch out what to do for the rest of the summer; work more on joins&lt;br /&gt;
* July 12: generate some example data illustrating the difficulty of joining different tables&lt;br /&gt;
* July 11: track down some bugs that happen very rarely and were missed in the initial qa phase&lt;br /&gt;
* July 7: catch up on documentation&lt;br /&gt;
* July 6: try (unsuccessfully) to understand docid mapping...create exploration scripts&lt;br /&gt;
* July 5: add invention title to proper grouping of assignment properties; optimize XML parsing&lt;br /&gt;
&lt;br /&gt;
=== June 2017 ===&lt;br /&gt;
&lt;br /&gt;
* June 30: powwow with James, Abhi, Ed about optimization issues; discuss document ids, X0 etc with Ed; pinpoint issues with APS doc numbers (see Repro Pat Dat#Gotchas) for more info&lt;br /&gt;
* June 29: add logging of copy commands, more chattiness to scripts, debug assignment data failure&lt;br /&gt;
* June 28: create examples for expansion to plant, reissue, design patent collection; start optimizing xml&lt;br /&gt;
* June 27: write SQL to replicate assignees, extract postcodes for ongoing projects&lt;br /&gt;
* June 26: speedup code, abstract in-memory file splitters to avoid repetition and some weird edge cases&lt;br /&gt;
* June 25: create mappings for APS, assignment properties, XML 2.5 for data import; run data imports for granted data&lt;br /&gt;
* June 23: cleanup hacky models with a better set of abstractions; cleanup IDE warnings; redefine patent-address mapping&lt;br /&gt;
* June 22: create postcode&amp;lt;-&amp;gt;patent table&lt;br /&gt;
* June 21: document granted patent queries and equivalencies&lt;br /&gt;
* June 20: sketch out APS driver; discuss patent id problem; further document with evidence the zipcode data validity&lt;br /&gt;
* June 19: skim address regular expressions; cursory investigation of patent table&lt;br /&gt;
* June 16: create method of getting all data into the database, whether it likes it or not; copy over assignments, granted data using new scheme&lt;br /&gt;
* June 15: add more robust error reporting, fix race conditions; build out assignment driver; build out fee event driver; add error logging&lt;br /&gt;
* June 14: migrate bulk inserts to copy command; refresh on address data and start in on that; convert processor to multi-threaded application&lt;br /&gt;
* June 13: spot check SQL tables; fix broken final case endlessly looping; investigate smarter insert methods&lt;br /&gt;
* June 12: add XML printer, use it to inspect applications; extend BaseScraper to fetch patent application data; add applications documentation to my project page; add CREATE of other tables&lt;br /&gt;
* June 8: add foreign key inserts; create pretty printer for XML analysis&lt;br /&gt;
* June 7: finalize DB abstraction layer; migrate code to bulk inserts; upgrade webserver software and do optimization on RDP postgres with Ed&lt;br /&gt;
* June 6: add jdbc; create basic schema; add db interaction; schedule meeting for later in the week&lt;br /&gt;
* June 5: look into postgresql; refersh on postgis; add some notes to the Enclosing Circle Algorithm page&lt;br /&gt;
* June 1: add RDP git remote; add more documentation to wiki page; refactor downloader scripts; start creation of tooling for interacting with data&lt;br /&gt;
&lt;br /&gt;
=== May 2017 ===&lt;br /&gt;
&lt;br /&gt;
* May 31: finish copy-pasting attributes into the wiki page; retroactively fill out work log; meet with Ed to discuss next steps&lt;br /&gt;
* May 30: update documentation on wiki, restructure large binary files to have more hierarchy instead of a flat listing at the root&lt;br /&gt;
* May 29: expand to APS; expand to raw assignment data&lt;br /&gt;
* May 27: expand to maintenance fee data&lt;br /&gt;
* May 26: create models, translate &amp;lt;code&amp;gt;xmlparser*.pl&amp;lt;/code&amp;gt; file into Java; start using builder pattern&lt;br /&gt;
* May 25: sketch out OO design of project; download bulk data&lt;br /&gt;
* May 24: move wiki pages around; start git repository for project&lt;br /&gt;
* May 21: discuss technical details of previous work with Ed&lt;br /&gt;
* May 8: cleanup dead links on wiki and start reading about previous work; discuss current project status with Ed&lt;br /&gt;
* May 4: setup wiki account, rdp account, database training&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Work Log]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Parallel_Enclosing_Circle_Algorithm&amp;diff=20651</id>
		<title>Parallel Enclosing Circle Algorithm</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Parallel_Enclosing_Circle_Algorithm&amp;diff=20651"/>
		<updated>2017-10-06T16:52:10Z</updated>

		<summary type="html">&lt;p&gt;OliverC: /* Example Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{McNair Projects&lt;br /&gt;
|Has title=Parallel Enclosing Circle Algorithm&lt;br /&gt;
|Has owner=Oliver Chang,&lt;br /&gt;
|Has start date=July 31, 2017&lt;br /&gt;
|Has deadline=October 4, 2017&lt;br /&gt;
|Has project status=Complete&lt;br /&gt;
|Is dependent on=Enclosing Circle Algorithm,&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A thin-wrapper around [[Enclosing_Circle_Algorithm_(Rework)|the enclosing circle algorithm]] which allows for instance-level parallelization.&lt;br /&gt;
This project consists of the python files in &amp;lt;code&amp;gt;E:\McNair\Projects\OliverLovesCircles\src\python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Parallelization is implemented via Python2's [https://docs.python.org/2/library/subprocess.html#subprocess.Popen &amp;lt;code&amp;gt;subprocess.open()&amp;lt;/code&amp;gt;] which is non-blocking and available in the standard library.&lt;br /&gt;
&lt;br /&gt;
== The Problem ==&lt;br /&gt;
&lt;br /&gt;
Note that this '''is not the classical enclosing circle algorithm'''.&lt;br /&gt;
Rather, we seek to minimize the sum of enclosing circles containing at least &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; points.&lt;br /&gt;
Thus, multiple circles are allowed and inclusion in multiple circles is possible.&lt;br /&gt;
&lt;br /&gt;
This algorithm has terrible time-performance characteristics, so we make the assumption that we can divide a large number of points with k-means and then solve those subproblems.&lt;br /&gt;
In other words, we make the simplifying assumption that the Enclosing Circle Algorithm has [https://en.wikipedia.org/wiki/Optimal_substructure Optimal Substructure].&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
* in &amp;lt;code&amp;gt;circles.py&amp;lt;/code&amp;gt;:&lt;br /&gt;
** &amp;lt;code&amp;gt;ITERATIONS&amp;lt;/code&amp;gt;: the number of iterations to attempt for each &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt; to find minimum for that &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;MIN_POINTS_PER_CIRCLE&amp;lt;/code&amp;gt; (AKA &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;): the minimum number of data points that must be included in a circle&lt;br /&gt;
* in &amp;lt;code&amp;gt;vc_circles.py&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;NUMBER_INSTANCES&amp;lt;/code&amp;gt;: number of parallel instances to run; assume no data-races between instances&lt;br /&gt;
** &amp;lt;code&amp;gt;SWEEP_CYCLE_SECONDS&amp;lt;/code&amp;gt;: amount of time before removing completed jobs from the current job and adding new jobs if any files are left to process&lt;br /&gt;
** &amp;lt;code&amp;gt;TIMEOUT_MINUTES&amp;lt;/code&amp;gt;: maximum running time of a parallel instance of the algorithm&lt;br /&gt;
** &amp;lt;code&amp;gt;SPLIT_THRESHOLD&amp;lt;/code&amp;gt;: if a dataset has more than this threshold of data points, it will be split via k-means&lt;br /&gt;
&lt;br /&gt;
== Example Usage ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ python vc_circles.py --infile E:/McNair/Projects/OliverLovesCircles/CoLevelForCirclesNotRunGTE200.txt&lt;br /&gt;
$ python outjoiner.py&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
where &amp;lt;code&amp;gt;CoLevelForCirclesNotRunGTE200.txt&amp;lt;/code&amp;gt; is a tab-separated values file with the columns&lt;br /&gt;
&amp;lt;code&amp;gt;placestate, place, statecode, year, latitude, longitude, coname, datefirstinv, placens, geoid, city&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command will populate (and overwrite) any files in &amp;lt;code&amp;gt;data/&amp;lt;/code&amp;gt;. The format of the filenames in this directory are &amp;lt;code&amp;gt;{city}{sep}{state}{sep}{year}{sep}{num}.tsv&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;num&amp;lt;/code&amp;gt; is a 0-indexed integer of a split city/state/year &amp;lt;code&amp;gt;infile&amp;lt;/code&amp;gt; that has greater than &amp;lt;code&amp;gt;SPLIT_THRESHOLD&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Related Pages ==&lt;br /&gt;
&lt;br /&gt;
* [[Enclosing_Circle_Algorithm_(Rework)|Abhi's Rework (Summer 2017)]]&lt;br /&gt;
* [[Enclosing_Circle_Algorithm|Original Implementation (Spring 2017)]]&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&lt;br /&gt;
* [https://rdp.mcnaircenter.org/codebase/Repository/OliverEnclosingCircle Git Repository]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Parallel_Enclosing_Circle_Algorithm&amp;diff=20650</id>
		<title>Parallel Enclosing Circle Algorithm</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Parallel_Enclosing_Circle_Algorithm&amp;diff=20650"/>
		<updated>2017-10-06T16:50:32Z</updated>

		<summary type="html">&lt;p&gt;OliverC: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{McNair Projects&lt;br /&gt;
|Has title=Parallel Enclosing Circle Algorithm&lt;br /&gt;
|Has owner=Oliver Chang,&lt;br /&gt;
|Has start date=July 31, 2017&lt;br /&gt;
|Has deadline=October 4, 2017&lt;br /&gt;
|Has project status=Complete&lt;br /&gt;
|Is dependent on=Enclosing Circle Algorithm,&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A thin-wrapper around [[Enclosing_Circle_Algorithm_(Rework)|the enclosing circle algorithm]] which allows for instance-level parallelization.&lt;br /&gt;
This project consists of the python files in &amp;lt;code&amp;gt;E:\McNair\Projects\OliverLovesCircles\src\python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Parallelization is implemented via Python2's [https://docs.python.org/2/library/subprocess.html#subprocess.Popen &amp;lt;code&amp;gt;subprocess.open()&amp;lt;/code&amp;gt;] which is non-blocking and available in the standard library.&lt;br /&gt;
&lt;br /&gt;
== The Problem ==&lt;br /&gt;
&lt;br /&gt;
Note that this '''is not the classical enclosing circle algorithm'''.&lt;br /&gt;
Rather, we seek to minimize the sum of enclosing circles containing at least &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; points.&lt;br /&gt;
Thus, multiple circles are allowed and inclusion in multiple circles is possible.&lt;br /&gt;
&lt;br /&gt;
This algorithm has terrible time-performance characteristics, so we make the assumption that we can divide a large number of points with k-means and then solve those subproblems.&lt;br /&gt;
In other words, we make the simplifying assumption that the Enclosing Circle Algorithm has [https://en.wikipedia.org/wiki/Optimal_substructure Optimal Substructure].&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
* in &amp;lt;code&amp;gt;circles.py&amp;lt;/code&amp;gt;:&lt;br /&gt;
** &amp;lt;code&amp;gt;ITERATIONS&amp;lt;/code&amp;gt;: the number of iterations to attempt for each &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt; to find minimum for that &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;MIN_POINTS_PER_CIRCLE&amp;lt;/code&amp;gt; (AKA &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;): the minimum number of data points that must be included in a circle&lt;br /&gt;
* in &amp;lt;code&amp;gt;vc_circles.py&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;NUMBER_INSTANCES&amp;lt;/code&amp;gt;: number of parallel instances to run; assume no data-races between instances&lt;br /&gt;
** &amp;lt;code&amp;gt;SWEEP_CYCLE_SECONDS&amp;lt;/code&amp;gt;: amount of time before removing completed jobs from the current job and adding new jobs if any files are left to process&lt;br /&gt;
** &amp;lt;code&amp;gt;TIMEOUT_MINUTES&amp;lt;/code&amp;gt;: maximum running time of a parallel instance of the algorithm&lt;br /&gt;
** &amp;lt;code&amp;gt;SPLIT_THRESHOLD&amp;lt;/code&amp;gt;: if a dataset has more than this threshold of data points, it will be split via k-means&lt;br /&gt;
&lt;br /&gt;
== Example Usage ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ python vc_circles.py --infile E:/McNair/Projects/OliverLovesCircles/CoLevelForCirclesNotRunGTE200.txt&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
where &amp;lt;code&amp;gt;CoLevelForCirclesNotRunGTE200.txt&amp;lt;/code&amp;gt; is a tab-separated values file with the columns&lt;br /&gt;
&amp;lt;code&amp;gt;placestate, place, statecode, year, latitude, longitude, coname, datefirstinv, placens, geoid, city&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command will populate (and overwrite) any files in &amp;lt;code&amp;gt;data/&amp;lt;/code&amp;gt;. The format of the filenames in this directory are &amp;lt;code&amp;gt;{city}{sep}{state}{sep}{year}{sep}{num}.tsv&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;num&amp;lt;/code&amp;gt; is a 0-indexed integer of a split city/state/year &amp;lt;code&amp;gt;infile&amp;lt;/code&amp;gt; that has greater than &amp;lt;code&amp;gt;SPLIT_THRESHOLD&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Related Pages ==&lt;br /&gt;
&lt;br /&gt;
* [[Enclosing_Circle_Algorithm_(Rework)|Abhi's Rework (Summer 2017)]]&lt;br /&gt;
* [[Enclosing_Circle_Algorithm|Original Implementation (Spring 2017)]]&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&lt;br /&gt;
* [https://rdp.mcnaircenter.org/codebase/Repository/OliverEnclosingCircle Git Repository]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Parallel_Enclosing_Circle_Algorithm&amp;diff=20649</id>
		<title>Parallel Enclosing Circle Algorithm</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Parallel_Enclosing_Circle_Algorithm&amp;diff=20649"/>
		<updated>2017-10-06T16:47:42Z</updated>

		<summary type="html">&lt;p&gt;OliverC: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{McNair Projects&lt;br /&gt;
|Has title=Parallel Enclosing Circle Algorithm&lt;br /&gt;
|Has owner=Oliver Chang,&lt;br /&gt;
|Has start date=July 31, 2017&lt;br /&gt;
|Has deadline=October 4, 2017&lt;br /&gt;
|Has project status=Complete&lt;br /&gt;
|Is dependent on=Enclosing Circle Algorithm,&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A thin-wrapper around [[Enclosing_Circle_Algorithm_(Rework)|the enclosing circle algorithm]] which allows for instance-level parallelization.&lt;br /&gt;
This project consists of the python files in &amp;lt;code&amp;gt;E:\McNair\Projects\OliverLovesCircles\src\python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Parallelization is implemented via Python2's [https://docs.python.org/2/library/subprocess.html#subprocess.Popen &amp;lt;code&amp;gt;subprocess.open()&amp;lt;/code&amp;gt;] which is non-blocking and available in the standard library.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The Problem ==&lt;br /&gt;
&lt;br /&gt;
Note that this '''is not the classical enclosing circle algorithm'''.&lt;br /&gt;
Rather, we seek to minimize the sum of enclosing circles containing at least &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; points.&lt;br /&gt;
Thus, multiple circles are allowed and inclusion in multiple circles is possible.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
* in &amp;lt;code&amp;gt;circles.py&amp;lt;/code&amp;gt;:&lt;br /&gt;
** &amp;lt;code&amp;gt;ITERATIONS&amp;lt;/code&amp;gt;: the number of iterations to attempt for each &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt; to find minimum for that &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;MIN_POINTS_PER_CIRCLE&amp;lt;/code&amp;gt; (AKA &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;): the minimum number of data points that must be included in a circle&lt;br /&gt;
* in &amp;lt;code&amp;gt;vc_circles.py&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;NUMBER_INSTANCES&amp;lt;/code&amp;gt;: number of parallel instances to run; assume no data-races between instances&lt;br /&gt;
** &amp;lt;code&amp;gt;SWEEP_CYCLE_SECONDS&amp;lt;/code&amp;gt;: amount of time before removing completed jobs from the current job and adding new jobs if any files are left to process&lt;br /&gt;
** &amp;lt;code&amp;gt;TIMEOUT_MINUTES&amp;lt;/code&amp;gt;: maximum running time of a parallel instance of the algorithm&lt;br /&gt;
** &amp;lt;code&amp;gt;SPLIT_THRESHOLD&amp;lt;/code&amp;gt;: if a dataset has more than this threshold of data points, it will be split via k-means&lt;br /&gt;
&lt;br /&gt;
== Example Usage ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ python vc_circles.py --infile E:/McNair/Projects/OliverLovesCircles/CoLevelForCirclesNotRunGTE200.txt&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
where &amp;lt;code&amp;gt;CoLevelForCirclesNotRunGTE200.txt&amp;lt;/code&amp;gt; is a tab-separated values file with the columns&lt;br /&gt;
&amp;lt;code&amp;gt;placestate, place, statecode, year, latitude, longitude, coname, datefirstinv, placens, geoid, city&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command will populate (and overwrite) any files in &amp;lt;code&amp;gt;data/&amp;lt;/code&amp;gt;. The format of the filenames in this directory are &amp;lt;code&amp;gt;{city}{sep}{state}{sep}{year}{sep}{num}.tsv&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;num&amp;lt;/code&amp;gt; is a 0-indexed integer of a split city/state/year &amp;lt;code&amp;gt;infile&amp;lt;/code&amp;gt; that has greater than &amp;lt;code&amp;gt;SPLIT_THRESHOLD&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Related Pages ==&lt;br /&gt;
&lt;br /&gt;
* [[Enclosing_Circle_Algorithm_(Rework)|Abhi's Rework (Summer 2017)]]&lt;br /&gt;
* [[Enclosing_Circle_Algorithm|Original Implementation (Spring 2017)]]&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&lt;br /&gt;
* [https://rdp.mcnaircenter.org/codebase/Repository/OliverEnclosingCircle Git Repository]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=20587</id>
		<title>Oliver Chang (Work Log)</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=20587"/>
		<updated>2017-10-04T02:41:12Z</updated>

		<summary type="html">&lt;p&gt;OliverC: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Oliver Chang]] [[Work Logs]]&lt;br /&gt;
[[Oliver Chang (Work Log)|(logpage)]]&lt;br /&gt;
&lt;br /&gt;
''To-do List'':&lt;br /&gt;
&lt;br /&gt;
* Expand XPath use in the patent data&lt;br /&gt;
* Edit to include Application data&lt;br /&gt;
* Finish ID joining&lt;br /&gt;
* Look into NIH document similarity algorithm&lt;br /&gt;
* Sysadminy stuff&lt;br /&gt;
&lt;br /&gt;
''Projects'':&lt;br /&gt;
&lt;br /&gt;
* [[PostGIS_Installation|PostGIS Installation]]&lt;br /&gt;
* [[Reproducible_Patent_Data|Reproducible Patent Data]]&lt;br /&gt;
* [[Patent_Validity_Ideas_for_ML|Predictive Patent Validity Machine Learning Ideas]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification]]&lt;br /&gt;
* [[GPU_Build|GPU Computer Build]]&lt;br /&gt;
* [[Parallel_Enclosing_Circle_Algorithm|Parallel Enclosing Circle Algorithm]]&lt;br /&gt;
&lt;br /&gt;
''Uploads'':&lt;br /&gt;
&lt;br /&gt;
* [[File:PADX-File-Description-v2_Hague.pdf]]&lt;br /&gt;
** Describes patent kind codes (notably, what the hell X0 represents)&lt;br /&gt;
* [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]]&lt;br /&gt;
** Describes the fields in APS, their supposed character lengths, and if they are required/optional&lt;br /&gt;
* [[File:Aps-wku-modulus11.pdf]]&lt;br /&gt;
** Describes the layout of the check digit on magnetic tape&lt;br /&gt;
* [[File:Mod-11-algorithm.pdf]]&lt;br /&gt;
** Describes the algorithm used to calculate the check digit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Day-by-Day (in reverse chronological order) ==&lt;br /&gt;
&lt;br /&gt;
=== October 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Oct 3: troubleshoot vc_circles.py and make command line interface a little nicer&lt;br /&gt;
* Oct 2: discuss mapping strategies &amp;amp; investigate missing eca data &lt;br /&gt;
&lt;br /&gt;
=== September 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Sept 23: make Project/OliverLovesCircles usable and add initial splitting ability&lt;br /&gt;
* Sept 22: goal setting &amp;amp; server debugging &amp;amp; meet with Yang&lt;br /&gt;
&lt;br /&gt;
=== August 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Aug 4: setup parallel instance python framework for job reporting; begin test run&lt;br /&gt;
* Aug 2: finish up some documentation of the code and for the wiki&lt;br /&gt;
* Aug 1: discuss with Abhi &amp;amp; Ed about alternatives to Java port because of algorithmic constants that would be hard to port; run test batches on python with addition of equality operators and convergence early stopping&lt;br /&gt;
&lt;br /&gt;
=== July 2017 ===&lt;br /&gt;
&lt;br /&gt;
* July 31: sketch out parallel enclosing circle algorithm&lt;br /&gt;
* July 28: field questions and data cleanup questions from Kerda &amp;amp; Joe &amp;amp; Adrian&lt;br /&gt;
* ''travelling''&lt;br /&gt;
* July 19: try to remove duplicated records (esp. those with empty titles) which are preventing the addition of a unique constraint&lt;br /&gt;
* July 18: run correspondent join on properties and correspondents table to match previous project; sync with Adrian and Abhi&lt;br /&gt;
* July 17: redo db operations after cleaning up granted patent number bugs&lt;br /&gt;
* July 13: powwow about parallelizing Enclosing Circle Algorithm; sketch out what to do for the rest of the summer; work more on joins&lt;br /&gt;
* July 12: generate some example data illustrating the difficulty of joining different tables&lt;br /&gt;
* July 11: track down some bugs that happen very rarely and were missed in the initial qa phase&lt;br /&gt;
* July 7: catch up on documentation&lt;br /&gt;
* July 6: try (unsuccessfully) to understand docid mapping...create exploration scripts&lt;br /&gt;
* July 5: add invention title to proper grouping of assignment properties; optimize XML parsing&lt;br /&gt;
&lt;br /&gt;
=== June 2017 ===&lt;br /&gt;
&lt;br /&gt;
* June 30: powwow with James, Abhi, Ed about optimization issues; discuss document ids, X0 etc with Ed; pinpoint issues with APS doc numbers (see Repro Pat Dat#Gotchas) for more info&lt;br /&gt;
* June 29: add logging of copy commands, more chattiness to scripts, debug assignment data failure&lt;br /&gt;
* June 28: create examples for expansion to plant, reissue, design patent collection; start optimizing xml&lt;br /&gt;
* June 27: write SQL to replicate assignees, extract postcodes for ongoing projects&lt;br /&gt;
* June 26: speedup code, abstract in-memory file splitters to avoid repetition and some weird edge cases&lt;br /&gt;
* June 25: create mappings for APS, assignment properties, XML 2.5 for data import; run data imports for granted data&lt;br /&gt;
* June 23: cleanup hacky models with a better set of abstractions; cleanup IDE warnings; redefine patent-address mapping&lt;br /&gt;
* June 22: create postcode&amp;lt;-&amp;gt;patent table&lt;br /&gt;
* June 21: document granted patent queries and equivalencies&lt;br /&gt;
* June 20: sketch out APS driver; discuss patent id problem; further document with evidence the zipcode data validity&lt;br /&gt;
* June 19: skim address regular expressions; cursory investigation of patent table&lt;br /&gt;
* June 16: create method of getting all data into the database, whether it likes it or not; copy over assignments, granted data using new scheme&lt;br /&gt;
* June 15: add more robust error reporting, fix race conditions; build out assignment driver; build out fee event driver; add error logging&lt;br /&gt;
* June 14: migrate bulk inserts to copy command; refresh on address data and start in on that; convert processor to multi-threaded application&lt;br /&gt;
* June 13: spot check SQL tables; fix broken final case endlessly looping; investigate smarter insert methods&lt;br /&gt;
* June 12: add XML printer, use it to inspect applications; extend BaseScraper to fetch patent application data; add applications documentation to my project page; add CREATE of other tables&lt;br /&gt;
* June 8: add foreign key inserts; create pretty printer for XML analysis&lt;br /&gt;
* June 7: finalize DB abstraction layer; migrate code to bulk inserts; upgrade webserver software and do optimization on RDP postgres with Ed&lt;br /&gt;
* June 6: add jdbc; create basic schema; add db interaction; schedule meeting for later in the week&lt;br /&gt;
* June 5: look into postgresql; refersh on postgis; add some notes to the Enclosing Circle Algorithm page&lt;br /&gt;
* June 1: add RDP git remote; add more documentation to wiki page; refactor downloader scripts; start creation of tooling for interacting with data&lt;br /&gt;
&lt;br /&gt;
=== May 2017 ===&lt;br /&gt;
&lt;br /&gt;
* May 31: finish copy-pasting attributes into the wiki page; retroactively fill out work log; meet with Ed to discuss next steps&lt;br /&gt;
* May 30: update documentation on wiki, restructure large binary files to have more hierarchy instead of a flat listing at the root&lt;br /&gt;
* May 29: expand to APS; expand to raw assignment data&lt;br /&gt;
* May 27: expand to maintenance fee data&lt;br /&gt;
* May 26: create models, translate &amp;lt;code&amp;gt;xmlparser*.pl&amp;lt;/code&amp;gt; file into Java; start using builder pattern&lt;br /&gt;
* May 25: sketch out OO design of project; download bulk data&lt;br /&gt;
* May 24: move wiki pages around; start git repository for project&lt;br /&gt;
* May 21: discuss technical details of previous work with Ed&lt;br /&gt;
* May 8: cleanup dead links on wiki and start reading about previous work; discuss current project status with Ed&lt;br /&gt;
* May 4: setup wiki account, rdp account, database training&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Work Log]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=20586</id>
		<title>Oliver Chang (Work Log)</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=20586"/>
		<updated>2017-10-04T02:40:57Z</updated>

		<summary type="html">&lt;p&gt;OliverC: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Oliver Chang]] [[Work Logs]]&lt;br /&gt;
[[Oliver Chang (Work Log)|(logpage)]]&lt;br /&gt;
&lt;br /&gt;
''To-do List'':&lt;br /&gt;
&lt;br /&gt;
* Expand XPath use in the patent data&lt;br /&gt;
* Edit to include Application data&lt;br /&gt;
* Finish ID joining&lt;br /&gt;
* Look into NIH document similarity algorithm&lt;br /&gt;
* Sysadminy stuff&lt;br /&gt;
&lt;br /&gt;
''Projects'':&lt;br /&gt;
&lt;br /&gt;
* [[PostGIS_Installation|PostGIS Installation]]&lt;br /&gt;
* [[Reproducible_Patent_Data|Reproducible Patent Data]]&lt;br /&gt;
* [[Patent_Validity_Ideas_for_ML|Predictive Patent Validity Machine Learning Ideas]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification]]&lt;br /&gt;
* [[GPU_Build|GPU Computer Build]]&lt;br /&gt;
* [[Parallel_Enclosing_Circle_Algorithm|Parallel Enclosing Circle Algorithm]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Uploads'':&lt;br /&gt;
&lt;br /&gt;
* [[File:PADX-File-Description-v2_Hague.pdf]]&lt;br /&gt;
** Describes patent kind codes (notably, what the hell X0 represents)&lt;br /&gt;
* [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]]&lt;br /&gt;
** Describes the fields in APS, their supposed character lengths, and if they are required/optional&lt;br /&gt;
* [[File:Aps-wku-modulus11.pdf]]&lt;br /&gt;
** Describes the layout of the check digit on magnetic tape&lt;br /&gt;
* [[File:Mod-11-algorithm.pdf]]&lt;br /&gt;
** Describes the algorithm used to calculate the check digit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Day-by-Day (in reverse chronological order) ==&lt;br /&gt;
&lt;br /&gt;
=== October 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Oct 3: troubleshoot vc_circles.py and make command line interface a little nicer&lt;br /&gt;
* Oct 2: discuss mapping strategies &amp;amp; investigate missing eca data &lt;br /&gt;
&lt;br /&gt;
=== September 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Sept 23: make Project/OliverLovesCircles usable and add initial splitting ability&lt;br /&gt;
* Sept 22: goal setting &amp;amp; server debugging &amp;amp; meet with Yang&lt;br /&gt;
&lt;br /&gt;
=== August 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Aug 4: setup parallel instance python framework for job reporting; begin test run&lt;br /&gt;
* Aug 2: finish up some documentation of the code and for the wiki&lt;br /&gt;
* Aug 1: discuss with Abhi &amp;amp; Ed about alternatives to Java port because of algorithmic constants that would be hard to port; run test batches on python with addition of equality operators and convergence early stopping&lt;br /&gt;
&lt;br /&gt;
=== July 2017 ===&lt;br /&gt;
&lt;br /&gt;
* July 31: sketch out parallel enclosing circle algorithm&lt;br /&gt;
* July 28: field questions and data cleanup questions from Kerda &amp;amp; Joe &amp;amp; Adrian&lt;br /&gt;
* ''travelling''&lt;br /&gt;
* July 19: try to remove duplicated records (esp. those with empty titles) which are preventing the addition of a unique constraint&lt;br /&gt;
* July 18: run correspondent join on properties and correspondents table to match previous project; sync with Adrian and Abhi&lt;br /&gt;
* July 17: redo db operations after cleaning up granted patent number bugs&lt;br /&gt;
* July 13: powwow about parallelizing Enclosing Circle Algorithm; sketch out what to do for the rest of the summer; work more on joins&lt;br /&gt;
* July 12: generate some example data illustrating the difficulty of joining different tables&lt;br /&gt;
* July 11: track down some bugs that happen very rarely and were missed in the initial qa phase&lt;br /&gt;
* July 7: catch up on documentation&lt;br /&gt;
* July 6: try (unsuccessfully) to understand docid mapping...create exploration scripts&lt;br /&gt;
* July 5: add invention title to proper grouping of assignment properties; optimize XML parsing&lt;br /&gt;
&lt;br /&gt;
=== June 2017 ===&lt;br /&gt;
&lt;br /&gt;
* June 30: powwow with James, Abhi, Ed about optimization issues; discuss document ids, X0 etc with Ed; pinpoint issues with APS doc numbers (see Repro Pat Dat#Gotchas) for more info&lt;br /&gt;
* June 29: add logging of copy commands, more chattiness to scripts, debug assignment data failure&lt;br /&gt;
* June 28: create examples for expansion to plant, reissue, design patent collection; start optimizing xml&lt;br /&gt;
* June 27: write SQL to replicate assignees, extract postcodes for ongoing projects&lt;br /&gt;
* June 26: speedup code, abstract in-memory file splitters to avoid repetition and some weird edge cases&lt;br /&gt;
* June 25: create mappings for APS, assignment properties, XML 2.5 for data import; run data imports for granted data&lt;br /&gt;
* June 23: cleanup hacky models with a better set of abstractions; cleanup IDE warnings; redefine patent-address mapping&lt;br /&gt;
* June 22: create postcode&amp;lt;-&amp;gt;patent table&lt;br /&gt;
* June 21: document granted patent queries and equivalencies&lt;br /&gt;
* June 20: sketch out APS driver; discuss patent id problem; further document with evidence the zipcode data validity&lt;br /&gt;
* June 19: skim address regular expressions; cursory investigation of patent table&lt;br /&gt;
* June 16: create method of getting all data into the database, whether it likes it or not; copy over assignments, granted data using new scheme&lt;br /&gt;
* June 15: add more robust error reporting, fix race conditions; build out assignment driver; build out fee event driver; add error logging&lt;br /&gt;
* June 14: migrate bulk inserts to copy command; refresh on address data and start in on that; convert processor to multi-threaded application&lt;br /&gt;
* June 13: spot check SQL tables; fix broken final case endlessly looping; investigate smarter insert methods&lt;br /&gt;
* June 12: add XML printer, use it to inspect applications; extend BaseScraper to fetch patent application data; add applications documentation to my project page; add CREATE of other tables&lt;br /&gt;
* June 8: add foreign key inserts; create pretty printer for XML analysis&lt;br /&gt;
* June 7: finalize DB abstraction layer; migrate code to bulk inserts; upgrade webserver software and do optimization on RDP postgres with Ed&lt;br /&gt;
* June 6: add jdbc; create basic schema; add db interaction; schedule meeting for later in the week&lt;br /&gt;
* June 5: look into postgresql; refersh on postgis; add some notes to the Enclosing Circle Algorithm page&lt;br /&gt;
* June 1: add RDP git remote; add more documentation to wiki page; refactor downloader scripts; start creation of tooling for interacting with data&lt;br /&gt;
&lt;br /&gt;
=== May 2017 ===&lt;br /&gt;
&lt;br /&gt;
* May 31: finish copy-pasting attributes into the wiki page; retroactively fill out work log; meet with Ed to discuss next steps&lt;br /&gt;
* May 30: update documentation on wiki, restructure large binary files to have more hierarchy instead of a flat listing at the root&lt;br /&gt;
* May 29: expand to APS; expand to raw assignment data&lt;br /&gt;
* May 27: expand to maintenance fee data&lt;br /&gt;
* May 26: create models, translate &amp;lt;code&amp;gt;xmlparser*.pl&amp;lt;/code&amp;gt; file into Java; start using builder pattern&lt;br /&gt;
* May 25: sketch out OO design of project; download bulk data&lt;br /&gt;
* May 24: move wiki pages around; start git repository for project&lt;br /&gt;
* May 21: discuss technical details of previous work with Ed&lt;br /&gt;
* May 8: cleanup dead links on wiki and start reading about previous work; discuss current project status with Ed&lt;br /&gt;
* May 4: setup wiki account, rdp account, database training&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Work Log]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=20585</id>
		<title>Oliver Chang (Work Log)</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=20585"/>
		<updated>2017-10-04T02:40:43Z</updated>

		<summary type="html">&lt;p&gt;OliverC: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Oliver Chang]] [[Work Logs]]&lt;br /&gt;
[[Oliver Chang (Work Log)|(logpage)]]&lt;br /&gt;
&lt;br /&gt;
''To-do List'':&lt;br /&gt;
&lt;br /&gt;
* Expand XPath use in the patent data&lt;br /&gt;
* Edit to include Application data&lt;br /&gt;
* Finish ID joining&lt;br /&gt;
* Look into NIH document similarity algorithm&lt;br /&gt;
* Sysadminy stuff&lt;br /&gt;
&lt;br /&gt;
''Projects'':&lt;br /&gt;
&lt;br /&gt;
* [[http://mcnair.bakerinstitute.org/wiki/PostGIS_Installation|PostGIS Installation]]&lt;br /&gt;
* [[Reproducible_Patent_Data|Reproducible Patent Data]]&lt;br /&gt;
* [[Patent_Validity_Ideas_for_ML|Predictive Patent Validity Machine Learning Ideas]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification]]&lt;br /&gt;
* [[GPU_Build|GPU Computer Build]]&lt;br /&gt;
* [[Parallel_Enclosing_Circle_Algorithm|Parallel Enclosing Circle Algorithm]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Uploads'':&lt;br /&gt;
&lt;br /&gt;
* [[File:PADX-File-Description-v2_Hague.pdf]]&lt;br /&gt;
** Describes patent kind codes (notably, what the hell X0 represents)&lt;br /&gt;
* [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]]&lt;br /&gt;
** Describes the fields in APS, their supposed character lengths, and if they are required/optional&lt;br /&gt;
* [[File:Aps-wku-modulus11.pdf]]&lt;br /&gt;
** Describes the layout of the check digit on magnetic tape&lt;br /&gt;
* [[File:Mod-11-algorithm.pdf]]&lt;br /&gt;
** Describes the algorithm used to calculate the check digit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Day-by-Day (in reverse chronological order) ==&lt;br /&gt;
&lt;br /&gt;
=== October 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Oct 3: troubleshoot vc_circles.py and make command line interface a little nicer&lt;br /&gt;
* Oct 2: discuss mapping strategies &amp;amp; investigate missing eca data &lt;br /&gt;
&lt;br /&gt;
=== September 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Sept 23: make Project/OliverLovesCircles usable and add initial splitting ability&lt;br /&gt;
* Sept 22: goal setting &amp;amp; server debugging &amp;amp; meet with Yang&lt;br /&gt;
&lt;br /&gt;
=== August 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Aug 4: setup parallel instance python framework for job reporting; begin test run&lt;br /&gt;
* Aug 2: finish up some documentation of the code and for the wiki&lt;br /&gt;
* Aug 1: discuss with Abhi &amp;amp; Ed about alternatives to Java port because of algorithmic constants that would be hard to port; run test batches on python with addition of equality operators and convergence early stopping&lt;br /&gt;
&lt;br /&gt;
=== July 2017 ===&lt;br /&gt;
&lt;br /&gt;
* July 31: sketch out parallel enclosing circle algorithm&lt;br /&gt;
* July 28: field questions and data cleanup questions from Kerda &amp;amp; Joe &amp;amp; Adrian&lt;br /&gt;
* ''travelling''&lt;br /&gt;
* July 19: try to remove duplicated records (esp. those with empty titles) which are preventing the addition of a unique constraint&lt;br /&gt;
* July 18: run correspondent join on properties and correspondents table to match previous project; sync with Adrian and Abhi&lt;br /&gt;
* July 17: redo db operations after cleaning up granted patent number bugs&lt;br /&gt;
* July 13: powwow about parallelizing Enclosing Circle Algorithm; sketch out what to do for the rest of the summer; work more on joins&lt;br /&gt;
* July 12: generate some example data illustrating the difficulty of joining different tables&lt;br /&gt;
* July 11: track down some bugs that happen very rarely and were missed in the initial qa phase&lt;br /&gt;
* July 7: catch up on documentation&lt;br /&gt;
* July 6: try (unsuccessfully) to understand docid mapping...create exploration scripts&lt;br /&gt;
* July 5: add invention title to proper grouping of assignment properties; optimize XML parsing&lt;br /&gt;
&lt;br /&gt;
=== June 2017 ===&lt;br /&gt;
&lt;br /&gt;
* June 30: powwow with James, Abhi, Ed about optimization issues; discuss document ids, X0 etc with Ed; pinpoint issues with APS doc numbers (see Repro Pat Dat#Gotchas) for more info&lt;br /&gt;
* June 29: add logging of copy commands, more chattiness to scripts, debug assignment data failure&lt;br /&gt;
* June 28: create examples for expansion to plant, reissue, design patent collection; start optimizing xml&lt;br /&gt;
* June 27: write SQL to replicate assignees, extract postcodes for ongoing projects&lt;br /&gt;
* June 26: speedup code, abstract in-memory file splitters to avoid repetition and some weird edge cases&lt;br /&gt;
* June 25: create mappings for APS, assignment properties, XML 2.5 for data import; run data imports for granted data&lt;br /&gt;
* June 23: cleanup hacky models with a better set of abstractions; cleanup IDE warnings; redefine patent-address mapping&lt;br /&gt;
* June 22: create postcode&amp;lt;-&amp;gt;patent table&lt;br /&gt;
* June 21: document granted patent queries and equivalencies&lt;br /&gt;
* June 20: sketch out APS driver; discuss patent id problem; further document with evidence the zipcode data validity&lt;br /&gt;
* June 19: skim address regular expressions; cursory investigation of patent table&lt;br /&gt;
* June 16: create method of getting all data into the database, whether it likes it or not; copy over assignments, granted data using new scheme&lt;br /&gt;
* June 15: add more robust error reporting, fix race conditions; build out assignment driver; build out fee event driver; add error logging&lt;br /&gt;
* June 14: migrate bulk inserts to copy command; refresh on address data and start in on that; convert processor to multi-threaded application&lt;br /&gt;
* June 13: spot check SQL tables; fix broken final case endlessly looping; investigate smarter insert methods&lt;br /&gt;
* June 12: add XML printer, use it to inspect applications; extend BaseScraper to fetch patent application data; add applications documentation to my project page; add CREATE of other tables&lt;br /&gt;
* June 8: add foreign key inserts; create pretty printer for XML analysis&lt;br /&gt;
* June 7: finalize DB abstraction layer; migrate code to bulk inserts; upgrade webserver software and do optimization on RDP postgres with Ed&lt;br /&gt;
* June 6: add jdbc; create basic schema; add db interaction; schedule meeting for later in the week&lt;br /&gt;
* June 5: look into postgresql; refersh on postgis; add some notes to the Enclosing Circle Algorithm page&lt;br /&gt;
* June 1: add RDP git remote; add more documentation to wiki page; refactor downloader scripts; start creation of tooling for interacting with data&lt;br /&gt;
&lt;br /&gt;
=== May 2017 ===&lt;br /&gt;
&lt;br /&gt;
* May 31: finish copy-pasting attributes into the wiki page; retroactively fill out work log; meet with Ed to discuss next steps&lt;br /&gt;
* May 30: update documentation on wiki, restructure large binary files to have more hierarchy instead of a flat listing at the root&lt;br /&gt;
* May 29: expand to APS; expand to raw assignment data&lt;br /&gt;
* May 27: expand to maintenance fee data&lt;br /&gt;
* May 26: create models, translate &amp;lt;code&amp;gt;xmlparser*.pl&amp;lt;/code&amp;gt; file into Java; start using builder pattern&lt;br /&gt;
* May 25: sketch out OO design of project; download bulk data&lt;br /&gt;
* May 24: move wiki pages around; start git repository for project&lt;br /&gt;
* May 21: discuss technical details of previous work with Ed&lt;br /&gt;
* May 8: cleanup dead links on wiki and start reading about previous work; discuss current project status with Ed&lt;br /&gt;
* May 4: setup wiki account, rdp account, database training&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Work Log]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=20584</id>
		<title>Oliver Chang (Work Log)</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=20584"/>
		<updated>2017-10-04T02:38:10Z</updated>

		<summary type="html">&lt;p&gt;OliverC: /* Day-by-Day (in reverse chronological order) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Oliver Chang]] [[Work Logs]]&lt;br /&gt;
[[Oliver Chang (Work Log)|(logpage)]]&lt;br /&gt;
&lt;br /&gt;
''To-do List'':&lt;br /&gt;
&lt;br /&gt;
* Expand XPath use in the patent data&lt;br /&gt;
* Edit to include Application data&lt;br /&gt;
* Finish ID joining&lt;br /&gt;
* Look into NIH document similarity algorithm&lt;br /&gt;
* Sysadminy stuff&lt;br /&gt;
&lt;br /&gt;
''Projects'':&lt;br /&gt;
&lt;br /&gt;
* [[Reproducible_Patent_Data|Reproducible Patent Data]]&lt;br /&gt;
* [[Patent_Validity_Ideas_for_ML|Predictive Patent Validity Machine Learning Ideas]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification]]&lt;br /&gt;
* [[GPU_Build|GPU Computer Build]]&lt;br /&gt;
* [[Parallel_Enclosing_Circle_Algorithm|Parallel Enclosing Circle Algorithm]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Uploads'':&lt;br /&gt;
&lt;br /&gt;
* [[File:PADX-File-Description-v2_Hague.pdf]]&lt;br /&gt;
** Describes patent kind codes (notably, what the hell X0 represents)&lt;br /&gt;
* [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]]&lt;br /&gt;
** Describes the fields in APS, their supposed character lengths, and if they are required/optional&lt;br /&gt;
* [[File:Aps-wku-modulus11.pdf]]&lt;br /&gt;
** Describes the layout of the check digit on magnetic tape&lt;br /&gt;
* [[File:Mod-11-algorithm.pdf]]&lt;br /&gt;
** Describes the algorithm used to calculate the check digit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Day-by-Day (in reverse chronological order) ==&lt;br /&gt;
&lt;br /&gt;
=== October 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Oct 3: troubleshoot vc_circles.py and make command line interface a little nicer&lt;br /&gt;
* Oct 2: discuss mapping strategies &amp;amp; investigate missing eca data &lt;br /&gt;
&lt;br /&gt;
=== September 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Sept 23: make Project/OliverLovesCircles usable and add initial splitting ability&lt;br /&gt;
* Sept 22: goal setting &amp;amp; server debugging &amp;amp; meet with Yang&lt;br /&gt;
&lt;br /&gt;
=== August 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Aug 4: setup parallel instance python framework for job reporting; begin test run&lt;br /&gt;
* Aug 2: finish up some documentation of the code and for the wiki&lt;br /&gt;
* Aug 1: discuss with Abhi &amp;amp; Ed about alternatives to Java port because of algorithmic constants that would be hard to port; run test batches on python with addition of equality operators and convergence early stopping&lt;br /&gt;
&lt;br /&gt;
=== July 2017 ===&lt;br /&gt;
&lt;br /&gt;
* July 31: sketch out parallel enclosing circle algorithm&lt;br /&gt;
* July 28: field questions and data cleanup questions from Kerda &amp;amp; Joe &amp;amp; Adrian&lt;br /&gt;
* ''travelling''&lt;br /&gt;
* July 19: try to remove duplicated records (esp. those with empty titles) which are preventing the addition of a unique constraint&lt;br /&gt;
* July 18: run correspondent join on properties and correspondents table to match previous project; sync with Adrian and Abhi&lt;br /&gt;
* July 17: redo db operations after cleaning up granted patent number bugs&lt;br /&gt;
* July 13: powwow about parallelizing Enclosing Circle Algorithm; sketch out what to do for the rest of the summer; work more on joins&lt;br /&gt;
* July 12: generate some example data illustrating the difficulty of joining different tables&lt;br /&gt;
* July 11: track down some bugs that happen very rarely and were missed in the initial qa phase&lt;br /&gt;
* July 7: catch up on documentation&lt;br /&gt;
* July 6: try (unsuccessfully) to understand docid mapping...create exploration scripts&lt;br /&gt;
* July 5: add invention title to proper grouping of assignment properties; optimize XML parsing&lt;br /&gt;
&lt;br /&gt;
=== June 2017 ===&lt;br /&gt;
&lt;br /&gt;
* June 30: powwow with James, Abhi, Ed about optimization issues; discuss document ids, X0 etc with Ed; pinpoint issues with APS doc numbers (see Repro Pat Dat#Gotchas) for more info&lt;br /&gt;
* June 29: add logging of copy commands, more chattiness to scripts, debug assignment data failure&lt;br /&gt;
* June 28: create examples for expansion to plant, reissue, design patent collection; start optimizing xml&lt;br /&gt;
* June 27: write SQL to replicate assignees, extract postcodes for ongoing projects&lt;br /&gt;
* June 26: speedup code, abstract in-memory file splitters to avoid repetition and some weird edge cases&lt;br /&gt;
* June 25: create mappings for APS, assignment properties, XML 2.5 for data import; run data imports for granted data&lt;br /&gt;
* June 23: cleanup hacky models with a better set of abstractions; cleanup IDE warnings; redefine patent-address mapping&lt;br /&gt;
* June 22: create postcode&amp;lt;-&amp;gt;patent table&lt;br /&gt;
* June 21: document granted patent queries and equivalencies&lt;br /&gt;
* June 20: sketch out APS driver; discuss patent id problem; further document with evidence the zipcode data validity&lt;br /&gt;
* June 19: skim address regular expressions; cursory investigation of patent table&lt;br /&gt;
* June 16: create method of getting all data into the database, whether it likes it or not; copy over assignments, granted data using new scheme&lt;br /&gt;
* June 15: add more robust error reporting, fix race conditions; build out assignment driver; build out fee event driver; add error logging&lt;br /&gt;
* June 14: migrate bulk inserts to copy command; refresh on address data and start in on that; convert processor to multi-threaded application&lt;br /&gt;
* June 13: spot check SQL tables; fix broken final case endlessly looping; investigate smarter insert methods&lt;br /&gt;
* June 12: add XML printer, use it to inspect applications; extend BaseScraper to fetch patent application data; add applications documentation to my project page; add CREATE of other tables&lt;br /&gt;
* June 8: add foreign key inserts; create pretty printer for XML analysis&lt;br /&gt;
* June 7: finalize DB abstraction layer; migrate code to bulk inserts; upgrade webserver software and do optimization on RDP postgres with Ed&lt;br /&gt;
* June 6: add jdbc; create basic schema; add db interaction; schedule meeting for later in the week&lt;br /&gt;
* June 5: look into postgresql; refersh on postgis; add some notes to the Enclosing Circle Algorithm page&lt;br /&gt;
* June 1: add RDP git remote; add more documentation to wiki page; refactor downloader scripts; start creation of tooling for interacting with data&lt;br /&gt;
&lt;br /&gt;
=== May 2017 ===&lt;br /&gt;
&lt;br /&gt;
* May 31: finish copy-pasting attributes into the wiki page; retroactively fill out work log; meet with Ed to discuss next steps&lt;br /&gt;
* May 30: update documentation on wiki, restructure large binary files to have more hierarchy instead of a flat listing at the root&lt;br /&gt;
* May 29: expand to APS; expand to raw assignment data&lt;br /&gt;
* May 27: expand to maintenance fee data&lt;br /&gt;
* May 26: create models, translate &amp;lt;code&amp;gt;xmlparser*.pl&amp;lt;/code&amp;gt; file into Java; start using builder pattern&lt;br /&gt;
* May 25: sketch out OO design of project; download bulk data&lt;br /&gt;
* May 24: move wiki pages around; start git repository for project&lt;br /&gt;
* May 21: discuss technical details of previous work with Ed&lt;br /&gt;
* May 8: cleanup dead links on wiki and start reading about previous work; discuss current project status with Ed&lt;br /&gt;
* May 4: setup wiki account, rdp account, database training&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Work Log]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=20246</id>
		<title>Oliver Chang (Work Log)</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=Oliver_Chang_(Work_Log)&amp;diff=20246"/>
		<updated>2017-09-24T04:49:37Z</updated>

		<summary type="html">&lt;p&gt;OliverC: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Oliver Chang]] [[Work Logs]]&lt;br /&gt;
[[Oliver Chang (Work Log)|(logpage)]]&lt;br /&gt;
&lt;br /&gt;
''To-do List'':&lt;br /&gt;
&lt;br /&gt;
* Expand XPath use in the patent data&lt;br /&gt;
* Edit to include Application data&lt;br /&gt;
* Finish ID joining&lt;br /&gt;
* Look into NIH document similarity algorithm&lt;br /&gt;
* Sysadminy stuff&lt;br /&gt;
&lt;br /&gt;
''Projects'':&lt;br /&gt;
&lt;br /&gt;
* [[Reproducible_Patent_Data|Reproducible Patent Data]]&lt;br /&gt;
* [[Patent_Validity_Ideas_for_ML|Predictive Patent Validity Machine Learning Ideas]]&lt;br /&gt;
* [[Equivalent_XPath_and_APS_Queries|Equivalent XPath and APS Queries]]&lt;br /&gt;
* [[US_Address_Verification|US Address Verification]]&lt;br /&gt;
* [[GPU_Build|GPU Computer Build]]&lt;br /&gt;
* [[Parallel_Enclosing_Circle_Algorithm|Parallel Enclosing Circle Algorithm]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Uploads'':&lt;br /&gt;
&lt;br /&gt;
* [[File:PADX-File-Description-v2_Hague.pdf]]&lt;br /&gt;
** Describes patent kind codes (notably, what the hell X0 represents)&lt;br /&gt;
* [[File:PatentFullTextAPSDoc_GreenBook_pgs13-22.pdf]]&lt;br /&gt;
** Describes the fields in APS, their supposed character lengths, and if they are required/optional&lt;br /&gt;
* [[File:Aps-wku-modulus11.pdf]]&lt;br /&gt;
** Describes the layout of the check digit on magnetic tape&lt;br /&gt;
* [[File:Mod-11-algorithm.pdf]]&lt;br /&gt;
** Describes the algorithm used to calculate the check digit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Day-by-Day (in reverse chronological order) ==&lt;br /&gt;
&lt;br /&gt;
=== September 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Sept 23: make Project/OliverLovesCircles usable and add initial splitting ability&lt;br /&gt;
* Sept 22: goal setting &amp;amp; server debugging &amp;amp; meet with Yang&lt;br /&gt;
&lt;br /&gt;
=== August 2017 ===&lt;br /&gt;
&lt;br /&gt;
* Aug 4: setup parallel instance python framework for job reporting; begin test run&lt;br /&gt;
* Aug 2: finish up some documentation of the code and for the wiki&lt;br /&gt;
* Aug 1: discuss with Abhi &amp;amp; Ed about alternatives to Java port because of algorithmic constants that would be hard to port; run test batches on python with addition of equality operators and convergence early stopping&lt;br /&gt;
&lt;br /&gt;
=== July 2017 ===&lt;br /&gt;
&lt;br /&gt;
* July 31: sketch out parallel enclosing circle algorithm&lt;br /&gt;
* July 28: field questions and data cleanup questions from Kerda &amp;amp; Joe &amp;amp; Adrian&lt;br /&gt;
* ''travelling''&lt;br /&gt;
* July 19: try to remove duplicated records (esp. those with empty titles) which are preventing the addition of a unique constraint&lt;br /&gt;
* July 18: run correspondent join on properties and correspondents table to match previous project; sync with Adrian and Abhi&lt;br /&gt;
* July 17: redo db operations after cleaning up granted patent number bugs&lt;br /&gt;
* July 13: powwow about parallelizing Enclosing Circle Algorithm; sketch out what to do for the rest of the summer; work more on joins&lt;br /&gt;
* July 12: generate some example data illustrating the difficulty of joining different tables&lt;br /&gt;
* July 11: track down some bugs that happen very rarely and were missed in the initial qa phase&lt;br /&gt;
* July 7: catch up on documentation&lt;br /&gt;
* July 6: try (unsuccessfully) to understand docid mapping...create exploration scripts&lt;br /&gt;
* July 5: add invention title to proper grouping of assignment properties; optimize XML parsing&lt;br /&gt;
&lt;br /&gt;
=== June 2017 ===&lt;br /&gt;
&lt;br /&gt;
* June 30: powwow with James, Abhi, Ed about optimization issues; discuss document ids, X0 etc with Ed; pinpoint issues with APS doc numbers (see Repro Pat Dat#Gotchas) for more info&lt;br /&gt;
* June 29: add logging of copy commands, more chattiness to scripts, debug assignment data failure&lt;br /&gt;
* June 28: create examples for expansion to plant, reissue, design patent collection; start optimizing xml&lt;br /&gt;
* June 27: write SQL to replicate assignees, extract postcodes for ongoing projects&lt;br /&gt;
* June 26: speedup code, abstract in-memory file splitters to avoid repetition and some weird edge cases&lt;br /&gt;
* June 25: create mappings for APS, assignment properties, XML 2.5 for data import; run data imports for granted data&lt;br /&gt;
* June 23: cleanup hacky models with a better set of abstractions; cleanup IDE warnings; redefine patent-address mapping&lt;br /&gt;
* June 22: create postcode&amp;lt;-&amp;gt;patent table&lt;br /&gt;
* June 21: document granted patent queries and equivalencies&lt;br /&gt;
* June 20: sketch out APS driver; discuss patent id problem; further document with evidence the zipcode data validity&lt;br /&gt;
* June 19: skim address regular expressions; cursory investigation of patent table&lt;br /&gt;
* June 16: create method of getting all data into the database, whether it likes it or not; copy over assignments, granted data using new scheme&lt;br /&gt;
* June 15: add more robust error reporting, fix race conditions; build out assignment driver; build out fee event driver; add error logging&lt;br /&gt;
* June 14: migrate bulk inserts to copy command; refresh on address data and start in on that; convert processor to multi-threaded application&lt;br /&gt;
* June 13: spot check SQL tables; fix broken final case endlessly looping; investigate smarter insert methods&lt;br /&gt;
* June 12: add XML printer, use it to inspect applications; extend BaseScraper to fetch patent application data; add applications documentation to my project page; add CREATE of other tables&lt;br /&gt;
* June 8: add foreign key inserts; create pretty printer for XML analysis&lt;br /&gt;
* June 7: finalize DB abstraction layer; migrate code to bulk inserts; upgrade webserver software and do optimization on RDP postgres with Ed&lt;br /&gt;
* June 6: add jdbc; create basic schema; add db interaction; schedule meeting for later in the week&lt;br /&gt;
* June 5: look into postgresql; refersh on postgis; add some notes to the Enclosing Circle Algorithm page&lt;br /&gt;
* June 1: add RDP git remote; add more documentation to wiki page; refactor downloader scripts; start creation of tooling for interacting with data&lt;br /&gt;
&lt;br /&gt;
=== May 2017 ===&lt;br /&gt;
&lt;br /&gt;
* May 31: finish copy-pasting attributes into the wiki page; retroactively fill out work log; meet with Ed to discuss next steps&lt;br /&gt;
* May 30: update documentation on wiki, restructure large binary files to have more hierarchy instead of a flat listing at the root&lt;br /&gt;
* May 29: expand to APS; expand to raw assignment data&lt;br /&gt;
* May 27: expand to maintenance fee data&lt;br /&gt;
* May 26: create models, translate &amp;lt;code&amp;gt;xmlparser*.pl&amp;lt;/code&amp;gt; file into Java; start using builder pattern&lt;br /&gt;
* May 25: sketch out OO design of project; download bulk data&lt;br /&gt;
* May 24: move wiki pages around; start git repository for project&lt;br /&gt;
* May 21: discuss technical details of previous work with Ed&lt;br /&gt;
* May 8: cleanup dead links on wiki and start reading about previous work; discuss current project status with Ed&lt;br /&gt;
* May 4: setup wiki account, rdp account, database training&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Work Log]]&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=PostGIS_Installation&amp;diff=20238</id>
		<title>PostGIS Installation</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=PostGIS_Installation&amp;diff=20238"/>
		<updated>2017-09-22T22:39:10Z</updated>

		<summary type="html">&lt;p&gt;OliverC: /* Bulk Download TIGER Shapefiles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://postgis.net/install/ PostGIS] is a spatial database extender for PostgreSQL object-relational database. It adds support for geographic objects allowing location queries to be run in SQL.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation Commands ==&lt;br /&gt;
&lt;br /&gt;
Going off of http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS23UbuntuPGSQL96Apt&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ lsb_release --codename&lt;br /&gt;
Codename:       trusty&lt;br /&gt;
$ sudo sh -c 'echo &amp;quot;deb http://apt.postgresql.org/pub/repos/apt trusty-pgdg main&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list'&lt;br /&gt;
$ wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -&lt;br /&gt;
$ sudo apt-get update&lt;br /&gt;
$ psql -V&lt;br /&gt;
psql (PostgreSQL) 9.5.4&lt;br /&gt;
$ sudo apt install postgresql-9.5-postgis-2.3&lt;br /&gt;
$ sudo apt-get install --no-install-recommends postgis&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note the last line. Without the &amp;lt;code&amp;gt;--no-install-recommends&amp;lt;/code&amp;gt; line postgres assumes you're using the default configuration (in this case, postgis for postgresql 9.6). Since we're using a different flavor of postgis, we do not want this.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;postgis&amp;lt;/code&amp;gt; apt package is not the extension to postgres. It is a collection of command line utilities for importing and exporting data to a postgis db.&lt;br /&gt;
&lt;br /&gt;
== Creating a Postgis DB ==&lt;br /&gt;
&lt;br /&gt;
=== Initial Setup ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ createdb --username researcher tigertest&lt;br /&gt;
$ psql --username researcher --dbname tigertest&lt;br /&gt;
&amp;gt; create extension postgis;&lt;br /&gt;
&amp;gt; select postgis_full_version(); -- sanity test and make sure installed and enabled&lt;br /&gt;
&amp;gt; \q&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bulk Download TIGER Shapefiles ===&lt;br /&gt;
&lt;br /&gt;
For example, say we want all of the state-level place data. The first step is to find a programmatic URL that we can use. You can inspect the HTML on the HTML interface to place data to get the correct mapping of states/territories to two digit integer. Note that they are not necessarily sequential and there is not strictly fifty.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ for i in $(seq -f &amp;quot;%02g&amp;quot; 1 80); do&lt;br /&gt;
    wget &amp;quot;https://www2.census.gov/geo/tiger/TIGER2016/PLACE/tl_2016_${i}_place.zip&amp;quot;;&lt;br /&gt;
    sleep 3 # not necessary but a good guy scraper move&lt;br /&gt;
done;&lt;br /&gt;
$ for f in *.zip; do unzip &amp;quot;$f&amp;quot;; done&lt;br /&gt;
$ for f in *.shp; do shp2pgsql -I &amp;quot;$f&amp;quot; | psql -U researcher -d tigertest; done&lt;br /&gt;
$ psql --username researcher --dbname tigertest&lt;br /&gt;
&amp;gt; select count(*) from tl_2016_01_place; -- 585&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also say we want to separate New York City, New York into a more granular by-borough set of polygons. Using [https://geo.nyu.edu/catalog/nyu_2451_34505 City University of New York data], we will import this shapefile.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ curl --insecure https://archive.nyu.edu/retrieve/74704/nyu_2451_34505.zip &amp;gt; /tmp/boroughs.zip&lt;br /&gt;
$ cd /tmp&lt;br /&gt;
$ unzip boroughs.zip&lt;br /&gt;
$ shp2pgsql -I nyu_2451_34505/nyu_2451_34505.shp | psql -U researcher -d tigertest&lt;br /&gt;
$ psql --username researcher --dbname tigertest&lt;br /&gt;
&amp;gt; select count(*) from nyu_2451_34505;&lt;br /&gt;
&amp;gt; \q&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
	<entry>
		<id>http://www.edegan.com/mediawiki/index.php?title=PostGIS_Installation&amp;diff=20237</id>
		<title>PostGIS Installation</title>
		<link rel="alternate" type="text/html" href="http://www.edegan.com/mediawiki/index.php?title=PostGIS_Installation&amp;diff=20237"/>
		<updated>2017-09-22T22:33:59Z</updated>

		<summary type="html">&lt;p&gt;OliverC: /* Bulk Download TIGER Shapefiles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://postgis.net/install/ PostGIS] is a spatial database extender for PostgreSQL object-relational database. It adds support for geographic objects allowing location queries to be run in SQL.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation Commands ==&lt;br /&gt;
&lt;br /&gt;
Going off of http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS23UbuntuPGSQL96Apt&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ lsb_release --codename&lt;br /&gt;
Codename:       trusty&lt;br /&gt;
$ sudo sh -c 'echo &amp;quot;deb http://apt.postgresql.org/pub/repos/apt trusty-pgdg main&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list'&lt;br /&gt;
$ wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -&lt;br /&gt;
$ sudo apt-get update&lt;br /&gt;
$ psql -V&lt;br /&gt;
psql (PostgreSQL) 9.5.4&lt;br /&gt;
$ sudo apt install postgresql-9.5-postgis-2.3&lt;br /&gt;
$ sudo apt-get install --no-install-recommends postgis&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note the last line. Without the &amp;lt;code&amp;gt;--no-install-recommends&amp;lt;/code&amp;gt; line postgres assumes you're using the default configuration (in this case, postgis for postgresql 9.6). Since we're using a different flavor of postgis, we do not want this.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;postgis&amp;lt;/code&amp;gt; apt package is not the extension to postgres. It is a collection of command line utilities for importing and exporting data to a postgis db.&lt;br /&gt;
&lt;br /&gt;
== Creating a Postgis DB ==&lt;br /&gt;
&lt;br /&gt;
=== Initial Setup ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ createdb --username researcher tigertest&lt;br /&gt;
$ psql --username researcher --dbname tigertest&lt;br /&gt;
&amp;gt; create extension postgis;&lt;br /&gt;
&amp;gt; select postgis_full_version(); -- sanity test and make sure installed and enabled&lt;br /&gt;
&amp;gt; \q&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bulk Download TIGER Shapefiles ===&lt;br /&gt;
&lt;br /&gt;
For example, say we want all of the state-level place data. The first step is to find a programmatic URL that we can use. You can inspect the HTML on the HTML interface to place data to get the correct mapping of states/territories to two digit integer. Note that they are not necessarily sequential and there is not strictly fifty.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
for i in $(seq -f &amp;quot;%02g&amp;quot; 1 80); do&lt;br /&gt;
    wget &amp;quot;https://www2.census.gov/geo/tiger/TIGER2016/PLACE/tl_2016_${i}_place.zip&amp;quot;;&lt;br /&gt;
    sleep 3 # not necessary but a good guy scraper move&lt;br /&gt;
done;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also say we want to separate New York City, New York into a more granular by-borough set of polygons. Using [https://geo.nyu.edu/catalog/nyu_2451_34505 City University of New York data], we will import this shapefile.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ curl --insecure https://archive.nyu.edu/retrieve/74704/nyu_2451_34505.zip &amp;gt; /tmp/boroughs.zip&lt;br /&gt;
$ cd /tmp&lt;br /&gt;
$ unzip boroughs.zip&lt;br /&gt;
$ shp2pgsql -I nyu_2451_34505/nyu_2451_34505.shp | psql -U researcher -d tigertest&lt;br /&gt;
$ psql --username researcher --dbname tigertest&lt;br /&gt;
&amp;gt; select count(*) from nyu_2451_34505;&lt;br /&gt;
&amp;gt; \q&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>OliverC</name></author>
		
	</entry>
</feed>