public-law/open-gov-crawlers

Fix: Colorado "duplicate" Divisions

dogweather opened this issue · 7 comments

E.g.:

Error importing Division(Nonprofit Corporations) in Title 7: PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "index_statutes_on_citation_and_year_and_publication_id"
   3   │ DETAIL:  Key (citation, year, publication_id)=(C.R.S. Title 7. Division “Nonprofit Corporations”, 2022, 10) already exists.

Wait a minute ... I don't see how Part could play a role.

So, Nonprofit Corporations appears twice) as a Division. The first time it's at the location of previously existing statutes. The second time, it's at the new location.

Options:

  • Keep the uniqueness constraints, and make the names unique. E.g., the first instance could become Nonprofit Corporations (Renumbered)
  • Drop the uniqueness constraint for this particular node type. That'd mean also dropping the citation.

Ah hah — I'm seeing Divisions and Subdivisions. And uniqueness is preserved.

Screenshot 2023-07-21 at 12 48 47 PM

I seem to be parsing Divisions and Subdivisions all as Divisions.

Possible attributes of each

  • Divisions: All caps, centered, bold
  • Subdivisions: Titlecase, centered, bold

Maybe just create something called "Heading"?