<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Michael Jay Lissner</title><link href="https://michaeljaylissner.com/" rel="alternate"></link><link href="https://michaeljaylissner.com/feeds/tag/data-modeling" rel="self"></link><id>https://michaeljaylissner.com/</id><updated>2014-06-18T00:00:00-07:00</updated><entry><title>Reworking the CourtListener Datamodel</title><link href="https://michaeljaylissner.com/posts/2014/06/18/reworking-the-courtlistener-datamodel/" rel="alternate"></link><updated>2014-06-18T00:00:00-07:00</updated><author><name>Mike Lissner</name></author><id>tag:michaeljaylissner.com,2014-06-18:posts/2014/06/18/reworking-the-courtlistener-datamodel/</id><summary type="html">&lt;p&gt;Brian and I have  been hard at work the past week figuring out how to make 
&lt;a href="https://www.courtlistener.com/"&gt;CourtListener&lt;/a&gt; able to understand more that one document type. Our goal
 right now is to make it possible to&amp;nbsp;add:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;oral arguments and other audio&amp;nbsp;content,&lt;/li&gt;
&lt;li&gt;video content if it&amp;#8217;s&amp;nbsp;available,&lt;/li&gt;
&lt;li&gt;content from &lt;a href="https://free.law/recap/"&gt;&lt;span class="caps"&gt;RECAP&lt;/span&gt;&lt;/a&gt;,&amp;nbsp;and&lt;/li&gt;
&lt;li&gt;thousands of ninth circuit briefs that Resource.org &lt;a href="https://law.resource.org/pub/us/case/ca9/"&gt;has recently&amp;nbsp;scanned&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The problem with our current database is that it&amp;#8217;s not organized in a way 
that supports linkages between content. So, if we have the oral argument 
and the opinion from a single case, we have no way of pointing them at each
other. Turns out this is a sticky&amp;nbsp;problem. &lt;/p&gt;
&lt;p&gt;The solution we&amp;#8217;ve come up with is an architecture like the&amp;nbsp;following:&lt;/p&gt;
&lt;p&gt;&lt;img alt="New Schema" src="https://michaeljaylissner.com/images/new-schema-design-compact_0.png" /&gt;&lt;/p&gt;
&lt;p&gt;(we also have &lt;a href="http://owncloud.freelawproject.org/public.php?service=files&amp;amp;t=76ef76ec69488fb72b4d96dba4809339"&gt;a more detailed version&lt;/a&gt; and &lt;a href="http://owncloud.freelawproject.org/public.php?service=files&amp;amp;t=62510f0282b06948e8c3d3b1e4946ec0"&gt;an editable version&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;And eventually, this will also have a Case table above the docket that 
allows multiple dockets to be associated with a single case. For now though,
that&amp;#8217;s moot, as we don&amp;#8217;t have anyway of figuring out which dockets go&amp;nbsp;together. &lt;/p&gt;
&lt;p&gt;The first stage of this will be to add support for oral arguments, 
since they make a simple case to work with. Once that&amp;#8217;s complete the next 
stage will be either to add the &lt;span class="caps"&gt;RECAP&lt;/span&gt; documents or those from&amp;nbsp;Resource.org. &lt;/p&gt;
&lt;h3 id="urls"&gt;URLs&lt;/h3&gt;
&lt;p&gt;Since this is such a big change, we&amp;#8217;re also taking this opportunity to 
re-work our URLs. Currently, they look like&amp;nbsp;this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="n"&gt;court&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="n"&gt;alpha&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;numeric&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;case&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;of&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;the&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;case&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;For&amp;nbsp;example:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nl"&gt;https:&lt;/span&gt;&lt;span class="c1"&gt;//www.courtlistener.com/scotus/yjn/roe-v-wade/&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;A few things bug me about that. First, it doesn&amp;#8217;t tell you anything about 
what kind of thing you can expect to see if you click that link. Second, 
the alpha-numeric &lt;span class="caps"&gt;ID&lt;/span&gt; is kind of lame. It&amp;#8217;s just a reference to the database
primary key for the item, and we should just show that value (in this case,
&amp;#8220;yjn&amp;#8221; means &amp;#8220;108713&amp;#8221;). To fix both of these issues, the new URLs will&amp;nbsp;be:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;opinion&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="n"&gt;numeric&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;case&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;So:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nl"&gt;https:&lt;/span&gt;&lt;span class="c1"&gt;//www.courtlistener.com/opinion/108713/roe-v-wade/&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;That should be easier to read and should tell you what type of item you&amp;#8217;re 
about to look at. Don&amp;#8217;t worry, the old URLs will keep working just&amp;nbsp;fine. &lt;/p&gt;
&lt;p&gt;And the rest of the new URLs will&amp;nbsp;be:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;oral&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;argument&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="n"&gt;numeric&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;case&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;docket&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="n"&gt;numeric&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;case&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;and&amp;nbsp;eventually:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;recap&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="n"&gt;numeric&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;case&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;h3 id="api"&gt;&lt;span class="caps"&gt;API&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;We expect these changes to come with changes to the &lt;span class="caps"&gt;API&lt;/span&gt;, 
so we&amp;#8217;ll likely be releasing &lt;span class="caps"&gt;API&lt;/span&gt; version 1.1 that will add support for 
dockets and oral&amp;nbsp;arguments. &lt;/p&gt;
&lt;p&gt;The current version 1.0 should keep working just fine, 
since we&amp;#8217;re not changing any of the underlying data, 
but I expect that it will have some changes to the URLs and things like 
that. I&amp;#8217;ll be posting more about this in the CourtListener dev list. 
as the changes become more clear and as we sort out what a fair policy is 
for the deprecation of old&amp;nbsp;APIs. &lt;/p&gt;</summary><category term="CourtListener"></category><category term="data modeling"></category><category term="database"></category></entry></feed>