Live data from Hacker News

The entire US Code is now online in XML

uscodebeta.house.gov

91–100 of 244 posts

Re: The entire US Code is now online in XML

#91

Caveat for for many of us overly rational thinkers: the powers that be deliberately are allowed to 'interpret' this code nondeterministically by many different means including its 'spirit,' admissibility of relevant information, manipulation of venue and participants, apparently even extrajudicial proceedings lately. In short, that allows a lawyer to answer almost any question with "it depends," and start billing.

You make this sound like a bad thing. Would you really prefer "black and white" laws that leave zero room for flexibility or interpretation in light of a given situation?

I've never been able to decide whether or not we should rigorously enforce Title 4 Chapter 1. On one hand, such enforcement would be ridiculously overbearing. On the other hand, such enforcement would be ridiculously overbearing.

Re: The entire US Code is now online in XML

#92
post #30
post #6

I'm really tempted to collect the XML files and put them on github, with periodic checkpoints to update it with the latest. Watching the evolution of law over time is a fascinating thing and using SW engineering tools to help would be really fun.

This is currently done via scraping: https://github.com/divegeek/uscode The diffs are huge.

Back in college, I had a project where I walked through every line of the Patriot Act and noted exactly which paragraphs were modified.

I'd be surprised if we couldn't write a parser for bills to produce more efficient diffs.

Re: The entire US Code is now online in XML

#93

Caveat for for many of us overly rational thinkers: the powers that be deliberately are allowed to 'interpret' this code nondeterministically by many different means including its 'spirit,' admissibility of relevant information, manipulation of venue and participants, apparently even extrajudicial proceedings lately. In short, that allows a lawyer to answer almost any question with "it depends," and start billing.

At least for me, accustomed to logic, determinism and mathematical models for laws of nature, this was actually a surprise. Instinctively I still find it distasteful, though I can't say I have anything better to offer other than the unrealistic ideal that all judges would be guaranteed to be truly impartial. I have never directly benefited nor been harmed by the nature of this 'code' either, unless you count getting…

> the unrealistic ideal that all judges would be guaranteed to be truly impartial.

Even this isn't necessarily a good thing. Part of the value of a judge is having an empathetic element in the position of final arbiter. Decisions aren't always "GUILTY / NOT GUILTY"; they're often long-form essays discussing the merits of the case, the factors under consideration, the logic and reasoning behind the ultimate conclusion and so on.

Math is nice because it can be reduced to a symbolic language. We're not at the point where we can reduce human beings to symbols yet.

Re: The entire US Code is now online in XML

#94
post #12

For those of us who don't know anything about it, what are the uses of machine readable law?

The law can be interpreted as a set of rules matched against an action in a particular context to determine whether said action is legal. Right now lots of people do this manually. Maybe computers can do it better. If computers can do it better, maybe people could focus on writing new laws and refactoring old ones instead of repeatedly interpreting old laws for each case.

Yup, legal code isn't that different from computer code where a judge is the interpreter and evidence is fed as input.

If we could invent a computer interpreter that acts as a judge, laws and contracts being its code might make it obvious to lawyers why it doesn't make sense to allow code to be patented.

Every time lawyers would write laws or contracts they would have to avoid using legal ideas that have already been patented subjecting them to the same legal difficulties software developers face every time they write code.

I guess I should patent that invention.

Re: The entire US Code is now online in XML

#95
post #78
post #24

Earlier quoted context omitted.

Laws are essentially diffs against the US code. The diff (slip law) is canonical. They are continually compiled into the US code, which can involve deleting or changing text just like a diff, and periodically an edited, annotated code is published. After a certain amount of time, Congress enacts a portion of the published code, making it canonical and overriding any prior slip law. See: http://en.wikipedia.org/wiki/U…

What we need now is software that reads bills ("in section 123.abc the text 'blah blah' is replaced by 'bleh bleh') and compiles it into before/after views of what the resulting code would be.

I just suggested this, and then scrolled down to find this.

Someone needs to take the plunge and start writing the program; throw it on Github and tell us all about it. I know people who are looking for such a tool.

Re: The entire US Code is now online in XML

#96
post #6

I'm really tempted to collect the XML files and put them on github, with periodic checkpoints to update it with the latest. Watching the evolution of law over time is a fascinating thing and using SW engineering tools to help would be really fun.

NZ laws on github: https://github.com/Br3nda/legislation/tree/master/act/public

Re: The entire US Code is now online in XML

#98
post #41

This is awesome. They even have a stylesheet apparently. However though the file claims to be UTF-8, vim seems to disagree, at least for title 10. I can't tell what encoding it really is though, doesn't seem to be latin1 or windows-1252 either.

The encoding looks like valid UTF-8, at least for the first few pages that I glanced at.

I did notice the section references look a little strange in vim, e.g. "act Aug. 10, 1956, ch. 1041, § 1" near the top; it consists of c2 a7 (section sign), which looks fine, followed by e2 80 af (narrow no-break space), which shows up as a box in vim.

Re: The entire US Code is now online in XML

#99
post #6

I'm really tempted to collect the XML files and put them on github, with periodic checkpoints to update it with the latest. Watching the evolution of law over time is a fascinating thing and using SW engineering tools to help would be really fun.

Probably more important than just diffs is actually a dependency graph and a topical index. While they've tried to do this via titles/chapters and references, linear breaks are never going to be as successful as many-to-many linkages as every Bible concordance out there demonstrates.

Re: The entire US Code is now online in XML

#100
post #97

does that mean these are all the current federal laws?..

This is only the codified portion of the federal law. So called "Statues at Large" that are passed by Congress but not codified into USC are not included. Plus this does not include the federal common law based on the rulings of federal courts.
Post reply on HN