10 ms·
The entire US Code is now online in XML
- calpaterson 13y agoFor those of us who don't know anything about it, what are the uses of machine readable law?
- generj 13y agoJust from a Natural Language perspective, this is amazing. By using the code as as a corpus, we can see how differently legal language differs from day-to-day parlance. Such an analysis might be fascinating, especially if we compare to word frequency in Google Ngram's historical index. I suspect legal language trails several decades behind modern lingo. Semi-intelligent queries can be executed, such that ignorance of the law might be abated. Imagine saying "Siri, is it illegal to do X?" and Siri answering you. This is important, because of the "Three Felonies a Day" syndrome with unwitting violations of the law. http://www.amazon.com/Three-Felonies-Day-Target-Innocent/dp/1594035229 http://www.amazon.com/Three-Felonies-Day-Target-Innocent/dp/...
- rlvesco7 13y agoThere is a company that is doing something somewhat related and equally cool. They use NLP to identify who may have written particular portions of bills. http://www.legcyte.com/ http://www.legcyte.com/
- bjr- 13y agoThe 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.
- rottyguy 13y agoRobotWars for Lawyers invariably leading to digitizing the whole judicial process.
- muricuh 13y agoFuck yeah!
- BenoitEssiambre 13y agoYup, 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.
- vdaniuk 13y agoHey, that is one quite interesting idea about law and code. Thanks!
- rhizome 13y agoYou could also add in EDGAR data that touches the laws to make estimates on the way the judiciary would interpet a certain action. It could also be used to find loopholes, conviction-free zones near boundaries in the law that could be closed.
- jacques_chester 13y ago> I guess I should patent that invention. Your comment above would potentially count as disclosure. I and probably others have previously used the black-box analogy too.
- tianhe 13y agoXML? this should be in json!
- toyg 13y agoConsidering typical timescales for this sort of projects, i'd say we should be happy it's not in CSV or SGML.
- liscovich 13y agoAs the schema guide explains, in 1999 they picked XML based on the study from 1996: "Following a 1999 feasibility study on XML/SGML, the Committee on House Administration adopted XML as a data standard for the exchange of legislative documents" http://uscodebeta.house.gov/download/resources/USLM-User-Guide.pdf http://uscodebeta.house.gov/download/resources/USLM-User-Gui... It took the US Govt 17 years to release 200,000 pages of the US code in XML.
- adregan 13y agoI wonder if 17 years is fast for the government or slow.
- BWStearns 13y agoFast..... sadly
- liscovich 13y agoWe might have to wait even longer for all the common law based on the court rulings to be published in the same format. Not to mention the "secret common law" based on the FISA court rulings.
- pseingatl 13y agoNot sure what format the files are kept in, but it's been done. Several private companies have these behind a paywall:ThompsonWest and Lexis/Nexis are the most well known, but there are others. Don't forget the published caselaw of the fifty states as well as state legislation. The U.S. Code is far from the whole picture.
- pnathan 13y agoI'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.
- tlrobinson 13y agoI was under the impression law is essentially "append only". New laws override existing laws, but the text of the existing law never changes.
- liscovich 13y agoAccording to Wikipedia: "When sections are repealed, their text is deleted and replaced by a note summarizing what used to be there." https://en.wikipedia.org/wiki/United_States_Code#Treatment_of_repealed_laws https://en.wikipedia.org/wiki/United_States_Code#Treatment_o...
- at-fates-hands 13y agoImagine trying to keep track of this in paper form instead of digitally.
- officemonkey 13y agoImagine? I used to do it. When I first started out, I would get stacks of the Chicago Municipal Code revisions on onionskin and it was my job to follow the instructions to update the five-inch binder. "Remove pages 123.4 - 123.6 and replace with pages 123.4a-123.7." Later, when I learned about diffs, I understood the concept immediately.
- michaelolenick 13y agoThey've been doing exactly that for about 237 years.
- deleted 13y ago[deleted]
- tbatterii 13y agonow if the same could be provided for bills(ideally before they are voted on), and that should go in github or something.
- mpyne 13y agoImagine if it was done essentially as a "pull request" in the future. That would be amazing.
- tbatterii 13y agoyep thats what i'm thinking. I'm sure lobbyists won't allow it.
- BWStearns 13y agoMaybe try to organize some tech-minded staffers on the hill? Get them to put bills onto a github repo when they are made public, maybe even XMLizing it to make it more exposed to machine analysis. It'd be a huge step in congressional transparency, especially now that bills are going into the high hundreds and thousands of pages (not a dig at the healthcare bill in particular, just a trend).
- tbatterii 13y agoWell it looks like the sunlight foundation has done some nice work in this area, but as far as I can tell these are all bills that have made it to vote. http://www.opencongress.org/bill/all http://www.opencongress.org/bill/all Whereas, I would like to see the drafts and how they progress behind closed doors with all the lobbying influence.
- BWStearns 13y agoI think its quite understandable that they have the deliberations in private. Imagine if your customers saw every minute of your office's day. What irks me is that although bills are available, they are available in such a way that it is a fulltime job to even look for things of interest. With better machine-searchable formats, you could set up alerts for potentially interesting sub-components of legislation that is up for debate. Edit: I don't endorse some skeevy lobbying activities, but that isn't the only influence, and there are some legitimately difficult choices that our reps make (when they're working right... so I guess rarely) that they believe are in the best interest of the country and their constituents. Many of these decisions would be made even more difficult and actually discourage much of what thoughtful and earnest decision making does exist.
- prmobiledev 13y agoPortugal should do this to their civil code!!!
- methehack 13y agoDoes anyone know how people search this now and how much it costs?
- ww520 13y agoCongress has a site for it. http://uscode.house.gov/search/criteria.shtml http://uscode.house.gov/search/criteria.shtml
- ChuckMcM 13y agoThis is pretty awesome, and if it were in git/hg would have the ability to write a 'blame' tool to figure out who voted on the part of the law that is pissing you off :-)
- lobotryas 13y agoYou can already do this - Congressional voting records are publicly available. However, even if you correlated these records with specific legislation, you would be making a dangerous mistake by missing the big picture. Many laws are passed jn bundles and require compromise. Just because your Senator voted to support farm subsidies, doesn't mean he likes them - it just means he wanted a minimum wage increase to pass more.
- ckozlowski 13y agoOpencongress.org is a great site for following this sort of info.
- DannyBee 13y agoActually, you wouldn't. This is the US code, not the legislative info :) I actually tried to create this once (with a team behind me, in fact) with what's available or possible with the legislative info. THOMAS theoretically published in XML, but it's missing a lot of info. Not only is this info not published, it's not even stored. They still are literally passing bills around to each other in some cases. You'd have to sit in on committee markup hearings, etc. Even the small amount that is published from markups or whatever doesn't tell you who did it, only that it was done. Some committees were willing to give more info. None were willing to essentially publish the in-flight staff attorney or other versions that would tell you for real who changed something. Remember also that hg/git diff does not display what really happened. It is displaying "how can i produce version B from version A using some minimal or near-minimal set of changes", converted to a line (or sub-line) based set of changes. This does not tell you history, only one possible set of changes. THOMAS does publish some in-flight versions of bills, but again, it's not really enough to do what you really want to do. I can tell you a bill changed between introduction and markup, and was different again when it got back to the floor. I can even, in some cases, tell you what was amended/deleted. I can't tell you who did it. (Well, i can tell you with some percentage accuracy, because we built a machine learning model, but ..)
- antitrust 13y agoThis actually makes law accessible to the technologically-savvy out there, and is going to launch a thousand apps giving specialized legal advice. This could in turn mean a reduction in the cost of litigation, which would hopefully be passed on to the rest of us. Hopefully I won't get sued for that statement.
- liscovich 13y agoHopefully, as a result, the disturbing statements like the ones below will become obsolete: James Duane, Regent Law School professor, defense attorney: "Estimates of the current size of the body of federal criminal law vary. It has been reported that the Congressional Research Service cannot even count the current number of federal crimes. These laws are scattered in over 50 titles of the United States Code, encompassing roughly 27,000 pages. Worse yet, the statutory code sections often incorporate, by reference, the provisions and sanctions of administrative regulations promulgated by various regulatory agencies under congressional authorization. Estimates of how many such regulations exist are even less well settled, but the ABA thinks there are ”nearly 10,000.” http://youtu.be/6wXkI4t7nuc?t=5m18s http://youtu.be/6wXkI4t7nuc?t=5m18s Supreme Court Justice Breyer: "the complexity of modern federal criminal law, codified in several thousand sections of the United States Code and the virtually infinite variety of factual circumstances that might trigger an investigation into a possible violation of the law, make it difficult for anyone to know, in advance, just when a particular set of statements might later appear (to a prosecutor) to be relevant to some such investigation." http://www.law.cornell.edu/supct/html/98-93.ZD.html http://www.law.cornell.edu/supct/html/98-93.ZD.html
- pasquinelli 13y agoor, after people get burned a few times with bad legal advice from those apps, it'd drive up demand for actual legal advice.
- mpyne 13y agoThis 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.
- drv 13y agoThe 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.
- tmoertel 13y agoIt's tragic that the United States (Federal) Legislative Model (USLM) is defined in terms of W3C XML Schema Definition language (XSD) instead of the comparably sane RELAX NG and its easily interpreted compact syntax. You would think that something this important ought to be made clear and understandable. EDITED TO CLARIFY: The tragic part isn't that the schema is given in XSD but that it's defined in XSD, which lacks RELAX NG's simple semantics and composibility rules. For a good summary of what I'm referring to, see James Clark's message to the IETF on the subject: http://www.imc.org/ietf-xml-use/mail-archive/msg00217.html http://www.imc.org/ietf-xml-use/mail-archive/msg00217.html
- mindcrime 13y agoIn practice, it probably doesn't make any difference. Assuming, for the sake of argument, that XSD is expressive enough to allow the authors to say what they're trying to say, in an unambiguous way, it's more or less a moot point. RELAX/NG is awesome, sure... but to some extent the "war" between it and XSD is a religious war. Pretty much every popular & widely used language / platform has XSD support... hell, it's so commonplace there are probably schema aware xml parsers in Brainfuck, INTERCAL and Befunge. RELAX NG may well be a better choice, but saying this is "tragic" strikes me as a bit of excessive hyperbole.
- tmoertel 13y agoThe tragic part isn't that the schema is given in XSD but that it's defined in XSD. What I'm lamenting (yes more hyperbole) is that a schema this important wasn't defined in a schema language that had clear semantics and composability rules, fostering reuse and adoption for related domains, of which we would expect there to be many. (Later, of course, the definition could always be extruded into XSD and other popular yet semantically stunted formats as a practical publication step.)
- mindcrime 13y agoFair enough. I haven't really dug into this schema in detail yet, but I'm guessing that XSD is expressive enough, and that - worst case - somebody could define an equivalent schema in $WHATEVER, and mirror the data after tranforming it. It's not a perfect setup, but at least it might make the content more usable for some purposes. I'm kinda curious to see what can be done with it in terms of transforming to RDF triples myself, but time will tell...
- OldSchool 13y agoCaveat 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.
- lobotryas 13y agoYou 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?
- tsax 13y agoI suspect he's simply warning against mistaking the formal spec (US code) for enforcement.
- gohrt 13y agoJust as you shoulding mistake the formal spec (requirements document) for an explanation of how software works.
- saraid216 13y agoI'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.
- jamieb 13y agoYes, we should have black and white laws, and unit tests for them. So someone could write a unit test for "Will this allow the NSA to create a secret court that is outside the rule of law?" or "Does accessing a university computer that has an open access policy allow for a sentence of 130 years?" I believe we'd see a lot simpler laws.
- mathattack 13y agoPutting something online is very different than actually getting meaning out of it. I'm afraid that this will push us towards more laws rather than less. But... Perhaps there will be good machine learning apps that can make sense out of all the contradictions.
- fnordfnordfnord 13y agoDoesn't appear to include codes and standards which are included by reference such as NFPA, IBC, IRC, SAE, etc. (see [1] for a non-gov't project to publish those) Nevertheless it is a very good thing to see the the gov't publish (most of) the law in an easy to use format. [1] https://public.resource.org/ https://public.resource.org/
- thinkcomp 13y agoI'm attempting to centralize many different sets of laws on PlainSite: http://www.plainsite.org/laws http://www.plainsite.org/laws Feel free to contribute.
- liscovich 13y agoDoes anyone know what software is used by the hill staffers when drafting new bills? How do they make sure that the laws do not contradict each other?
- pdw 13y agoI'm annoyed that Title 38 - Veteran's Benefits is out of alphabetical order. Was it originally called Pensions or something?
- dailyrorschach 13y agoYes, old name is: Title 38 - Pensions, Bonuses, and Veterans' Relief http://www.gpo.gov/fdsys/pkg/CFR-2004-title38-vol1/content-detail.html http://www.gpo.gov/fdsys/pkg/CFR-2004-title38-vol1/content-d...
- dnautics 13y agoI'm more annoyed that they are out of order with reference to which clause in Article I, section 8 their existence is justified by - but I suspect there's a reason for that.
- liscovich 13y agoIf you were to start a new country, what would the legislative process look like there? For example, how should new "startup nations" like BlueSeed (http://blueseed.co http://blueseed.co) inspired by Seasteading Institute go about passing and storing laws? Should they have some sort of open github repo to which anyone can make pull requests? How do you see the congress of the future?
- pseingatl 13y agoYou can look at relatively small jurisdictions and copy what's appropriate. Throw out hunting and fishing and take Alaska's laws in 1959 and you've got the minimum for a jurisdiction. Same for the Canal Zone. You can add legislation from other jurisdictions that works, like New Zealand's torrens (not torrent) system. Alberta's condo laws. I wrote a set of laws for a new jurisdiction, there's no reason to start from scratch.
- rmc 13y agoUsually countries inherit the laws from the country they are decended from.
- liscovich 13y agoTrue, but what would it look like in the future? Would you just fork a repo?
- jacques_chester 13y agoYou just say that the laws in force on a particular date apply locally, minus anything that physically can't apply (eg laws about particular locations). The law of every country in the English-speaking world started that way. Australia's current system of law, for example, commenced as a branch of British law on 26 January 1788. All the laws in force in Britain at that moment were presumed to apply; laws governing institutions and issues peculiar to Britain-as-a-place just weren't of any consequence. Periodically you go into the collection and clear it out. In Australia in the 80s and 90s there was a law reform movement and as a positive side-effect enormous research was done to discover the true coverage of "Imperial" laws still technically in force. Our various Parliaments passed various Acts to repeal and replace old laws. For example, where I come from, in the Northern Territory, the Law of Property Act repealed laws going all the way back to shortly after the Norman conquest.
- pseingatl 13y agoI can't wait to look for the law whereby Congress established a church in violation of the Establishment Clause. But no one complained.
- krob 13y agodoes that mean these are all the current federal laws?..
- liscovich 13y agoThis 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.
- mpyne 13y agoAlso there is the Code of Federal Regulations to contend with, but those are available online already.
- liscovich 13y agoAn alternative XML version of the US Code from Cornell Law School: http://www.law.cornell.edu/wiki/lexcraft/united_states_code_in_xml http://www.law.cornell.edu/wiki/lexcraft/united_states_code_...
- pkinnaird 13y agorepo with the contents of the house.gov site: https://github.com/peterkinnaird/US-Code https://github.com/peterkinnaird/US-Code
- lisper 13y agoThis information has been available for a long time on plainsite: http://www.plainsite.org/laws/index.html?corpusid=3 http://www.plainsite.org/laws/index.html?corpusid=3
- rogerchucker 13y agoGenuinely curious - how can this data be used from a software perspective?
- vog 13y agoI find it amusing that here in Germany, we have that for years: http://www.gesetze-im-internet.de/ http://www.gesetze-im-internet.de/ All laws are available in XML, HTML, PDF, etc. The site also provides an RSS feed. In addition, some enthusiasts regularily download stuff from there and apply those to a Git repository: https://github.com/bundestag/gesetze https://github.com/bundestag/gesetze That way, this repository contains not only the current laws, but also the history of how the laws developed! For the Git repository, the XML version is not used directly, but converted to markdown. This produces very readable diffs: https://github.com/bundestag/gesetze/commit/f90e8fc8eb20f08173e608f493e15f986d7e43ba https://github.com/bundestag/gesetze/commit/f90e8fc8eb20f081... Wouldn't it be cool if we could finally manage our laws of filing pull requests?
- gsnedders 13y agoLikewise in the UK: http://www.legislation.gov.uk/developer/formats/ http://www.legislation.gov.uk/developer/formats/ XML, HTML, RDF/XML for everything, as well as browsable online (often with original source PDFs of the printed laws), with both online and RDF/XML representations showing all alterations to the law (with date, cross-reference to the Act that made the amendment, etc.). The website is one of the big success stories of RDF, IMO, as it is all based around a model of the laws in RDF, with everything else just being varying serializations thereof. It also allows the website to show what has been amended — no need for dumping stuff to GitHub and then diffing it! (e.g., see the annotation on 28(1)c in http://www.legislation.gov.uk/ukpga/1998/29/part/IV http://www.legislation.gov.uk/ukpga/1998/29/part/IV) That all said, there tends to be a delay between the PDF being uploaded and everything being marked up and entered into the RDF database (see the "new legislation" on the home page).
- muricuh 13y agoOh yeah?! OH YEAH?!!!
- proggR 13y agoI actually wrote a tumblr post about that a while ago. It also included a user engagement aspect that would allow users to subscribe to topics of interest to receive a curated feed of changes that could each have a dialogue/poll emerge. I hadn't really thought through the specifics but its awesome to know that something like this is already started to some degree. Thanks for that! Here's the post if interested. http://proggr.tumblr.com/post/52801512630/githubberment http://proggr.tumblr.com/post/52801512630/githubberment
- HNLogInShit 13y agoWhat is the "entire US Code"?
- ilaksh 13y agoThis reminds me of a recent discussion where someone mentioned tools over process. (http://rc3.org/2013/07/29/seven-signs-of-dysfunctional-engineering-teams/ http://rc3.org/2013/07/29/seven-signs-of-dysfunctional-engin...) I would say that the 'law' is just subjective manual process, and we desperately need more tools for every-day judgement and decision making. For example, if there were a computer system that logged all corporate financial transactions including income, then we could automatically tax large corporations, rather than waiting for them to report income through loopholes.
- jingo 13y agoThe USC has been available in HTML or ASCII for many years. From house.gov, gpo.gov and cornell.edu, to name a few sources.
- sinzone 13y agoThe developer friendly RESTful version: https://www.mashape.com/community/united-states-code#!documentation https://www.mashape.com/community/united-states-code#!docume...
- techtalsky 13y agoI'm probably a little late to the party, but I think it's worth mentioning that some of the "XML" looks like this: <tr style=" -uslm-lc:II22; "><td style=" text-align:left; vertical-align:top; border-right:1px solid black; padding-right:2pt;"><p style=" text-align:left; text-indent: -1em; padding-left:1em;"> Wow. I wonder what -uslm-lc does.
- nxn 13y agoSimilar question and answer on another site: http://www.reddit.com/r/technology/comments/1jfufh/the_entire_us_code_is_now_online_in_xml/cbeiub8 http://www.reddit.com/r/technology/comments/1jfufh/the_entir...
- bandushrew 13y agoExcept for the secret laws, of course...
- tlrobinson 13y agoIn case anyone was wondering, it's about 80MB zipped, 500MB unzipped.
- thehme 13y agoSince this is hacker news, I was curious to see which code the subject was talking about and surprisingly not the code I was thinking of. I wonder how much more of this gov code has actually been read by the people in all those countries where it's been available longer.