A <onlyinclude>The [[Reproducible Patent Data]] project is a continuation of the [[Redesigning Patent Database]] that project. It 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.See also the [[Patent Data]] umbrella project. </onlyinclude>
== Quickstart ==
# Run scripts in <code>src/db/constraints</code> to check data assumptions
# That's it!
===Troubleshooting===
If you're new to IntelliJ (and even if you're not) you might run into problems with importing the project.
'''Setting Up Project as a Maven project'''
It should be clear if the project is not set up as a Maven project - when you right click on RunInitialImport.java, for example, you won't see an option with
a green triangle next to it that says "Run 'RunInitialImport.java'", and the green triangle in the top toolbar will be grayed out. If the project is not set up as a Maven project, you will not be able to run any of the code. To set up the project as a Maven project, when you import the project, follow the instructions at the following [https://www.jetbrains.com/help/idea/maven.html#maven_import_project_start link].
* Note that when you click "Import Project", you should select the "Simpler Patent Data" folder, not the "src" folder within Simpler Patent Data, otherwise you won't get the pom.xml file that you need to let IntelliJ know that this is a Maven project.
* On the second window (there will be several options with check boxes next to them) make sure "import Maven projects automatically" is selected
* On the "Please select project SDK" window, make sure it says "1.8" in the "Name" slot.
* On the next window, enter a name for the project and enter a folder location.
This should ensure that the project is set up as a Maven project.
'''Setting Up Your Data Source'''
If you run into a message across the top that says something along the lines of "Configure Data Source", then you have not connected IntelliJ to a database. You will not be able to run the code located under src/db until you configure one. Start by clicking on the link in the message, or if it doesn't appear, follow the instructions [https://www.jetbrains.com/help/idea/connecting-to-a-database.html here] to open up the "Data Sources and Drivers" pop-up to add a PostgreSQL database. When you get to the dialogue asking about the host, database, user, and password, do the following to connect to the database on the RDP:
host: localhost
database: whatever the constant DATABASE_NAME is set to - the default is patentsj
user: postgres
password: tabspaceenter
Make sure to test the connection by clicking "Test Connection". Now you should be able to run the scripts under src/db.
If you're seeing issues such as "column [something] of relation [something] doesn't exist" but you've run the schema scripts, you probably have different database name under the data source than the one the constant DATABASE_NAME is set to. To change this, right click on the data source in the Database tab and select "Properties".
== Directory Layout ==
* [[Lex_Machina|Lex Machina]]
* [[USPTO_Patent_Litigation_Data|USPTO Patent Litigation Research Dataset by Ed]]
* [[Patent_Litigation_and_Review|Patent Litigation and Review by Marcela]]* [[Bag_of_Words_Analysis_of_Patent_Data|Bag of Words Analysis]]* [[Patent|Existing Database Schema]]