Live data from Hacker News

The entire US Code is now online in XML

uscodebeta.house.gov

61–70 of 244 posts

Re: The entire US Code is now online in XML

#61

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.

Interpretation isn't an unguided, irrational process. When your lawyer answers "it depends" its because you've placed him at one point in what's really a decision tree and asked him: "where does it end?" It's like asking a programmer whether a particular token in a C++ program is a type name or an identifier. It depends.

If you imagine the universe of human activity as a multi-dimensional space, you can think of laws as carving out subspaces with lines (that may be more or less fuzzy) and attaching significance to particular subspaces. If I ask: "my x coordinate is 5, where am I?" what do you answer?

Re: The entire US Code is now online in XML

#63

This 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 :-)

Actually, 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 ..)

Re: The entire US Code is now online in XML

#64
Doesn'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/

Re: The entire US Code is now online in XML

#65

It'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…

In 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…

The 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.)

Re: The entire US Code is now online in XML

#67
post #47
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.

I just created a repo with all the codes[1]. There was a convenient link to all codes in one zip file. I will note that this is a massive amount of text. There is a link to the schema used and a stylesheet (I assume for the xhmtl maybe?) that I would like to add in. But one step at a time. [1] https://github.com/varikin/UnitedStatesCode/

Ah... http://uscodebeta.house.gov/download/priorreleasepoints.htm

Re: The entire US Code is now online in XML

#68

Earlier quoted context omitted.

Maybe 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).

Well 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 Whereas, I would like to see the drafts and how they progress behind closed doors with all the lobbying influence.

I 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.

Re: The entire US Code is now online in XML

#69

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.

"In short, that allows a lawyer to answer almost any question with "it depends," and start billing. "

No, this is usually "lack of sufficient facts to answer question".

If a crime has 4 elements, and you've said you've committed 3 and maybe the 4th depending on how you look at it, the answer to the question "can i be convicted" is "it depends", because it depends on the argument about the 4th element.

If your followup is to claim that there should never be questions about whether you've achieved some element of a crime, it should be binary, that's simply impossible.

Crimes, for example, are often about intent and causation. Until science provides us with historical mind reading devices, and completely accurate point-in-time reconstruction of the world, we're going to have to rely on various theories and evidence (much like science relies on theories and evidence).

Even point-in-time reconstruction wouldn't solve all causation issues, because the issue is often a fairness one: Is it fair to hold the defendant liable for a crime X steps removed from his own action.

Re: The entire US Code is now online in XML

#70

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 suspect he's simply warning against mistaking the formal spec (US code) for enforcement.
Post reply on HN