Akoma Ntoso, Standards

Legislative Legos

I just got back from a vacation in Denmark – the land where Legos come from. I thought it might be appropriate to spend some time talking about Flavio Zeni at UNDESA calls Legislative Legos – building blocks that can be used to build legislative systems.

Why is this such an important concept? Well, it’s all about managing risk and building a system that can adapt to change in timely manner. Legislative systems can take years and cost many millions of dollars to develop. As the sophistication grows and automation takes root throughout the organization, these systems become extensive mission critical parts of the organization’s fabric. So failure is not an option.

At the same time as legislative systems become so ingrained, technology cycles are shrinking. Rapid changes in technology ensures that the expected lifecycle of any part of a system will be compressed. Wasting 5 years of a technology cycle to perfect a large system chews up a lot of the viable life of a technology as well. Also, as change occurs, the technology waves are being blurred into streams of constant change. So catching a technology wave at the exact right moment becomes impossible.

Imagine for a moment choosing to build a brand new, built from scratch, system. You’re looking at a multi-million dollar proposition that will take at least 3-5 years to come to fruition. The technologies you choose will all be at various stages of maturity. Some technologies might be well established and stable – but they might also be waning and likely to soon be obsolete. There the risk is building a system now that will be obsolete by the time it is deployed. On the other hand, other technologies will be on the bleeding edge. Choosing to use them might maximize the lifecycle of the result, but it does so at the risk of using a technology that might not yet be ready for prime time. When building a large scale system, the likelihood of all the technologies being optimal for adoption at the same time you need them is very remote.

Think about the infrastructure of a city. The road system has all sorts of problems. Traffic jams, potholes, and aging infrastructure abound. Under the streets are a rat’s nest of utilities from different eras. It might be very tempting to want to simply demolish the city and build a new one. But that’s a preposterous idea. Not only would it not be affordable, the inconveniance and risk would be unthinkable. This is something that becomes true of all systems as them become large and ingrained. They are no longer replaceable. Instead they must evolve constantly – in as smooth and efficient a manner as can be achieved.

So how must legislative systems evolve? The must evolve by being built as interoperable modules. These modules must stand on their own and be able to be deployed, updated, and replaced on their own timetable. These modules must be defined in such a way as to maximize the likelihood that expertise gained elsewhere can be harnessed to reduce risk and lower costs. These modules must be sufficiently independent of the rest of the system that should they fail or become obsolete they do not jeopardize everything else. This is all simply good risk management.

So let’s think about Legos for a moment. When I was a kid they were my favorite toy and I was the champ at the Lego competitions in the small town where I grew up. I would spend hours and hours building all sorts of different things out of them. A consistent standard for how the blocks connect is what made this possible. That standard doesn’t dictate how the blocks go together or what you can build with them. Instead, Lego defines a simple protocol that allows the blocks to connect and then they provide enough variety in their blocks to allow your imagination to run wild.

We need the same concept for legislative systems. Instead of large monolithic, likely to either fail or be obsolete, but always be expensive solutions, we need a simple set of protocols that will allow modules to be built and then mixed or matched to solve all the varying requirements that exist for legislative systems.

So what is the legislative analogue of the Lego standard? First we need the basic protocol for how things connect. That is where XML and something like Akoma Ntoso comes in. It defines the most basic parameters of how the information can be connected. Next we need to define what the basic pieces are. We need an editor, a repository, some sort of metadata management, various publishing engines, and so on. Those are the blocks. Not every system will need the same blocks and not every block will fit every application. With enough forethought and enough industry cooperation, blocks can be made to fit together in a variety of ways to solve every need.

I come from the electronic CAD industry. Our early generation systems in the 1980s were large monolithic solutions. As a vendor, we loved the idea because we locked our customers into our solution. Their investment in our system become so large that replacing us was inconceivable. All we had to do was have our professional services people show up at a prospect, convince them to choose our product suite, and then accept all the custom code we would build to cement the relationship forever. This worked great until our product became obsolete. Not only could our customers not get out from under the monstrosity we had built, neither could we. Smaller companies with new innovative ideas started chipping away at our fortress (that’s what we called it) and we couldn’t adapt. When we tried, the result was more pieces stuck to our monolith which only made the problem worse. Monolothic system thinking nearly killed the business and made a lot of customers very angry. Today that same industry is made up of a myriad of much smaller less tightly coupled products, available from a large selection of venders, and bound by common industry standards. The Lego inspired model made the industry much stronger and served the customers far better. The design efficiency that results is what makes thing like smartphones and tablets, updated every few months, even possible.

The same thing must happen for legislative systems. Modular Legislative Legos will allow this field to flourish – to everyone’s benefit. So let’s work together to make this happen.

Standard
Akoma Ntoso, Standards

Why is Building a Legislative Editor so difficult?

Way back in 2002, when I first started building an editor for legislation, the problem looked so simple. We figured it was a quick six month project and we would then have a product we could resell to other jurisdictions. I remember when we first made our modest proposal, having it pushed back at us and being told we needed to go and rethink it. California had already learned, the hard way, that the deceptively simple problem of building a legislative editor was actually much more difficult and complex. What I have come to appreciate, over time, is that California’s approach actually makes the problem easier. It’s even harder elsewhere where the drafting rules are less structured and well thought out. I actually lucked out in starting with California, and it still took over three years to get a deployed solution in place – and that was only the beginning.

So what makes building a legislative editor so difficult? First of all, you need to understand what a bill really is. If you’re a software developer, the easiest way to understand it is to think of it as a document to “patch” existing law. Quite confusingly to software types, that process of patching the law results in something called “compiling codes”. So bills are patch documents containing intricate instructions for how to modify the law. What’s so hard about that? Well, for starters, the law has been built up over many decades or centuries and has accumulated all sorts of errors and odd situations that have to be accommodated. How do you correctly refer to something when, quite by accident, two different things have been numbered the same? How do you deal with the situation that arises when the law is defined to change in some complex temporal way? What happens when something is referred to by one number before a particular date, and then by a different number after that date? Quickly all these complexities start accumulating on top of your clean and simple architecture and the hope you’ll ever be able to solve it starts becoming a panic that perhaps you’ve attempted a problem that cannot be solved.

Let’s add another layer of complexity to the problem. The patch documents, which legislative types like to call bills, are also patched – or amended to use the real terminology. So you’ve got to deal with patches of patches. As a bill winds through the process of becoming law, it might be amended many times. Tracking all those amendments is going to be important to a lot of people. Keeping it all straight is crucial to producing an eventual result that patches the law accurately. Those legislative types aren’t very understanding when you get it wrong.

So now that you understand the complexity of the process, lets add some more complexity. Legislative traditions were defined long before there were computers. The procedures were defined for an era where everything was done using pen and paper. Amendments were made using scissors and glue. In fact, scissors and glue were still a part of the amendment process until quite recently in California. Other jurisdiction still have to resort to these procedures even today. Unfortunately, it is simply not possible to replace these outdated traditions with modern computer-based methodologies overnight. Legal traditions evolve on a deliberately conservative path. Good luck trying to throw out the old way just because the new way will be easier for the software. Chances are, you’re going to have to adapt more to the current process than the current process is going to adapt to you.

So what other aspects of legislative bill drafting are complex? I could go on and on about this subject. First of all, you’re not going to be able to convince the government to throw out all the existing laws and start again. You’re just going to have to deal with all the strange ways things were done in the past. If they numbered things with vulgar fractions (i.e. 1/2, 1/3) once-upon-a-time, you’re going to have to deal with that. If they believe that 100.15 reads as “one hundred point fifteen” and comes somewhere between “one hundred point ten” and “one hundred point twenty”, except when it is found between “one hundred point one and one hundred point two”, then you’re going to have to accept that too. Then there is the whole subject of redlining. Don’t be fooled into believing that redlining is the same as track changes in a word processor. It might look the same and be conceptually similar, but chances are there is a lot more hidden meaning in those strikes and inserts than you realize. When you get to the subject of making references or citations, you’ll discover just how much ambiguity there is in the subject. Quite often, a reference to a person is by last name alone. The only way to know which person with that last name is being referred to is to understand the context in terms of location and time. Even then, you might have to deal with ambiguity. When you get to the subject of tables, you’ll want to throw your arms in the air and walk away. Amending tables is an almost intractible problem. If you’re lucky, page and line numbers won’t come up at all. How on earth do you represent page and line numbers in a document that is explicitly designed to not worry about the physical aspects of the published form?

Okay, so you have found your way through all of that and now your editor is ready to go. Whew, that was hard! Oh, but now they want to be able to tear apart and rearrange the document in arbitary ways that make no sense with the XML hierarchy you’ve defined. Of course, you’re expected to be able to piece together the resulting mess to produce a valid document. Well they can’t do that. That’s just the way it is and you’ll tell them that when they tell you they’re not happy with the editor. Alright, that’s not a very good answer. Well, back to the drawing boards on that. Building an editor that both conforms to the software notions of how a document should be structured and how a non-technical users perceives it to be structured is a very difficult problem.

Legislative XML editors can be built. There are a few successful examples to show that it is possible. I’m proud to have muddled through to success with California, but it was very difficult. At the same time, there have been plenty of failures and projects that have gone way over budget. Having a standardized model, such as is promised by Akoma Ntoso and the standards effort within OASIS, should help by allowing this problem to be solved only a few times and then reused many times afterwards. However, given all the variations that exist, even with a standard in place this is going to be a difficult problem to solve for the foreseeable future.

Standard
Akoma Ntoso, HTML5, Standards, W3C

A Pluggable XML Editor

Ever since I announced my HTML5-based XML editor, I’ve been getting all sorts of requests for a variety of implementations. While the focus has been, and continues to be, providing an Akoma Ntoso based legislative editor, I’ve realized that the interest in a web-based XML editor extends well beyond Akoma Ntoso and even legislative editors.

So… with that in mind I’ve started making some serious architectural changes to the base editor. From the get-go, my intent had been for the editor to be “pluggable” although I hadn’t totally thought it through. By “pluggable” I mean capable of allowing different information models to be used. I’m actually taking the model a bit further to allow modules to be built that can provide optional functionality to the base editor. What this means is that if you have a different document information model, and it is capable of being round-tripped in some way with an editing view, then I can probably adapt it to the editor.

Let’s talk about the round-tripping problem for a moment. In the other XML editors I have worked with, the XML model has had to quite closely match the editing view that one works with. So you’re literally authoring the document using that information model. Think about HTML (or XHTML for an XML perspective). The arrangement of the tags pretty much exactly represents how you think of an deal with the components of the document.  Paragraphs, headings, tables, images, etc, are all pretty much laid out how you would author them. This is the ideal situation as it makes building the editor quite straight-forward.

However, this isn’t always the case. Depending on how much this isn’t the case determines how feasible building an editor is at all. Sometimes the issues are minor. For instance, in Akoma Ntoso, a section “num” element is out-of-line with the content block containing the paragraphs. So while it is quite common for the num to be inline in the first paragraph of the the section, that isn’t how Akoma Ntoso chooses to represent this. And it gets more difficult from there when you start dealing with subsections and sub-subsections.

To deal with these sorts of issues, a means of translating back and forth between what you’re editing and the information model you’re building is needed. I am using XSL Transforms, designed specifically for round-tripping to solve the problem. Not every XML model lends itself to document authoring, but by building a pluggable translating layer I’m able to adapt to more models than I have been able to in the past.

Along with these mechanisms I am also allowing for pluggable command structures, CSS styling rules, and, of course, the schema validation. In fact, the latest release of the editor at legalhacks.org has been refactored and now somewhat follows this pluggable architecture.

Next I plan to start working with modules like change tracking / redlining, metadata generation (including XBRL generation), and multilingual support following this pluggable architecture. I’m totally amazed at how much more capable HTML5 is turning out to be when compared to old-fashioned HTML4. I can finally build the XML editor I always wanted.

Standard
Akoma Ntoso, HTML5, Standards, Transparency

XBRL in Legislation

Over the past few weeks, my posts about the HTML5 editor I have been working on have received a lot of attention. One aspect that I have noticed throughout has been people equating legislative markup to XBRL. In fact, I have taken to explaining Akoma Ntoso as being like XBRL for legislation. That helps people better understand what we are up to.

Or does it? It’s a little misleading to describe a legislative information model as being like XBRL for legislation. The reason is that many of the people interested in the transparency aspects of legislative XML are interested in it precisely because they’re interested in tracking budget appropriations. The assumption being made is that the XML will somehow make it possible to track the money that flows through legislation.

In some respects XML does help track money. Certainly, reporting budgets as XML is a whole lot better than the other approach you often see – tables reported as images. Images are a very effective way to hide appropriations from machine processing. However, that’s less and less of a problem. Nowadays, if you take a look at any budget appropriation embedded within legislation, you’re likely to find the numbers reported in a table. Most likely that table will be in the form of an HTML table at that. How you interpret that table is up to you. Perhaps the CSS class names for each cell will provide some guidance as to each cell’s content, but the information is being reported in a manner intended for human consumption rather than machine processing. In short, the manner in which financial information is reported in legislation is not for the sake of improving the transparency of the data.

In California, when we designed the budget amending facilities within the bill drafting system, our objective was to find a way to draft a budget amendment with the limited tabular capabilities of XMetaL. Whether the result was transparent or not was not a consideration as it was not a requirement six years ago. Victory for us was finding a way to get the immediate job done. Elsewhere, I have yet to see any legislative information model attempt to address the issue of making budget appropriations more transparent. Rather, the focus is instead on things like the temporal aspects of amending the law, the issues that arise in a multilingual society, or ensuring the accuracy and authenticity of the documents.

So what is the solution? I must profess to know very little about XBRL. What I do know tells me that it is not a suitable replacement for all those HTML tables that we tend to use. XBRL is a complex data format normalized for database consumption. The information is not stored in a manner that would allow for easy authoring by a human author or easy reading by a human reader. I did find one article from three years back that begins to address the issue. Certainly we’ve come far on the subject of legislative XML and it’s time to reconsider this subject.

The good news is that we do have a solution for integrating XBRL with legislative XML. Within an Akoma Ntoso document is a proprietary section found inside the metadata block. This section is set aside specifically to allow foreign information models to be embedded within the legislative document. So, much as the metadata already contains analysis sections for recording the temporal aspects of the legislation, it is quite easy to add an XBRL section to record the financial aspects of the legislation.

So the next question is whether or not XBRL is designed to be embedded within another document. It would seem that the answer is yes – and it is called inline XBRL. While the specification addresses fragments of XBRL within HTML documents, I don’t see why this cannot be extended to a legislative information model.  Simply put, a fragment of inline XBRL data would be embedded within the metadata block of the legislative document recorded in XML. This data would be available for any XBRL processor to discover (how is another question) and consume. The inline XBRL would be produced prior to publication by analyzing the legislative XML’s tables used to draft the document.

Ideally, the XBRL data would be hooked directly to the legislative XML data, much like spreadsheet formalas can be attached to data, but maybe I’m getting ahead of myself. Providing budget appropriation information within inline XBRL embedded within the legislative XML would be a great step forward – and it would achieve the objectives that people that are interested in the transparency aspects of legislative XML actually have.

I’m certainly no expert in XBRL, so I’m interested in hearing what people in the know have to say about this. Let me know. If you know of an appropriations taxonomy for XBRL, let me know. And if you’re interested in following how the DATA Act might influence this subject, check out the Data Transparency Coalition.

Standard
Akoma Ntoso, Hackathon, Transparency

Unhackathon Wrapup

Well, we had our “unhackathon” and it was, overall, a great success. We learned a lot, introduced a lot of people to the notion of XML markup and Akoma Ntoso, and made a number of important contacts all around. I hope that all the participants got something out of the experience. In San Francisco we were competing with a lovely Saturday afternoon and a street fair outside – which people chose to give up in order to attend our event.

At UC Hastings we had a special visit from State Senator Leland Yee of the 8th District which was most gratifying. He has been a strong proponent for government transparency and his surprise visit was awesome.

This was the first outing of the new AKN/Editor so I was quite nervous going in. Deciding to write an advanced editor, using brand new technologies, on all four browsers, and then planning an unmovable date just 10 weeks into the project is a little crazy now that I think about it. But the editor held up well for the most part. There were a number of glitches, but we were able to work around or fix most of them. The Akoma Ntoso model seemed to work overall, although there was a lot of the normal confusion over the hierarchical containment structure of XML. I did wish we could have made more progress with more jurisdictions and had been able to explore more of the redlining issues. But that was perhaps a bit too ambitious. I still want to find a venue to completely vet redlining as I believe that this is going to be the real challenge for Akoma Ntoso and I want to resolve them sooner rather than later.

On the entrepreneurial front, we did discover a potential market serving lonely males in the Middle East on Google Hangouts. We’ll leave that opportunity for someone else to exploit.

For me, trying to manage a room full of people, take care of editor issues, and keep in contact with the remotes sites and participants around the world was very overwhelming. If I missed your call or your question, please accept my apologies. My brain was simply overloading.

Going forward we are now starting to make plans for where to go from here. The LegalHacks.org website will remain intact and will even continue to develop. I’m going to refine the editor based on feedback and continue further development in the weeks and months to come. We hope that the site will continue to develop as a venue for legal informatics hacking. Also, preliminary work is now underway for a follow-on unhackathon in another part of the world. Look for an announcement soon!

Thank you to all the organizers – Charles Belle at UC Hastings, Pieter Gunst at Stanford Codex, Karen Sahuka in Denver (BillTrack 50). Thank you to Ari Hershowitz at Tabulaw for pulling it all together, Jim Harper from the Cato Institute for his opening words, Brad Chang of Xcential for being me at Stanford, Robert Richards for being our tireless word spreader, and a special thank you to Monica Palmirani and Fabio Vitali at the University of Bologna for participating from afar and for providing Monica’s videos.

Standard
Akoma Ntoso, Hackathon, HTML5, Standards, W3C

An HTML5-Based XML Editor for Legislation!

UPDATE: (May 17, 2012) For all the people that asked for more editing capabilities, I have updated the editor to provide rudimentary cut/copy/paste capabilities via the normal shortcut keys. More to follow as I get the cycles to refine the capabilities.

I’ve just released my mini-tutorial for the HTML5-based XML editor I am developing for drafting legislation (actually it’s best for tagging existing legislation at this point).


Please keep in mind that this editor is still very much in development – so its not fully functional and bug-free at this point. But I do believe in being open and sharing what I am working on. We will be using this editor at our upcoming International Legislation Unhackathons (http://legalhacks.org) this coming weekend. The editor is available to experiment with at legalhacks.org site.

There are three reason I think that this approach to building editors is important:

  1. The editor uses an open standard for storing legislative data. This is a huge development. The first couple generations of legislative systems were built upon totally proprietary data formats. That meant that all the data was locked into fully custom tools that were built years ago could only be understood by those systems. Those systems were very closed. That last decade was the development of the XML era of legislative tools. This made it possible to use off-the-shelf editors, repositories, and publishing tools. But the XML schemas that everyone used were still largely proprietary and that meant everyone still had to invest millions of dollars in semi-custom tools to produce a workable system. The cost and risk of this type of development still put the effort out of reach of many smaller legislative bodies.

    So now we’re moving to a new era, tools based on a common open standard. This makes it possible for an industry of plug-and-play tools to emerge, reducing the cost and risks for everyone. The editor I am showing uses Akoma Ntoso for its information model. While not yet a standard, it’s on a standards track at the OASIS Standards Consortium and has the best chance of emerging as the standard for legal documents.

  2. The editor is built upon open web standards. Today you have several choices when you build a legislative editor. First, you can build a full custom editor. That’s a bad idea in this day and age when there are so many existing editors to build upon. So that leaves you with the choice of building your editor atop a customizable XML editor or customizing the heck out of a word processor. Most XML editors are built with this type of customization in mind. They intrinsically understand XML and are very customizable. But they’re not the easiest tools to master – for either the developer or the end user. Another approach is to use a word processor and bend and distort it into being an XML editor. This is something well beyond the original intent of the word processor and dealing with the mismatch in mission statements for a word processor and a legislative drafting tool leaves open lots of room for issues in the resulting legislation.

    There is another problem as well with this approach. When you choose to customize an off-the-shelf application, you have to buy into the API that the tool vendor supplies. Chances are that API is proprietary and you have no guarantee that they won’t change it on a whim. So you end up with a large investment in software built on an application API that could become almost unrecognizable with the next major release. So while you hope that your investment should be good for 10-12 years, you might be in for a nasty surprise at a most inopportune time well before that.

    The editor I have built has taken a different approach. It is building upon W3C standards that are being built around HTML5. These APIs are standards, so they won’t change on a whim – they will be very long lived. If you don’t like a vendor and want to change, doing so is trivial. I’m not just saying this. The proof is in the pudding. This editor works on all four major browsers today! This isn’t just something I am planning to support in the future; it is something I already support. Even while the standards are still being refined, this editor already works with all the major browsers. (Opera is lagging behind in support for some of the application APIs I am using.) Can you do that with an application built on top of Microsoft Office? Do you want to switch to Open Office and have an application you built? You’re going to have to rewrite your application.

  3. Cloud-based computing is the future, Sure, this trend has been obvious for years, but the W3C finally recognizes the web-based application as being more than just a sophisticated website. That recognition is going to change computing forever. Whether your cloud is public or private, the future lies in web-based applications. Add to that the looming demands for more transparent government and open systems with facilitate real public participation and it becomes obvious that the era of the desktop application is over. The editor I am building anticipates this future.

  4. I’ve been giving a lot of thought to where this editor can go. As the standards mature, I learn to tame the APIs, and the browsers finish the work remaining for them, it seems that legislative drafting is only the tip of the iceberg for such an approach to XML-based editing. Other XML models such as DITA and XBRL might well be other areas worth exploring.

    What do you think? Let me know what ideas you have in this area.

Standard
Akoma Ntoso, Standards

Common Identifiers or a Common Data Format. What is more important?

I just read this excellent post by Tom Bruce, et. al. from the Legal Information Institute at the Cornell University Law School.

Tom’s post brought to mind something I have long wrestled with. (Actually so long that it was a key part of my job working on CAD systems in the aerospace industry long ago). I sometimes wonder if having common identifiers isn’t more important than having a common data format. The reason is that being able to unambiguously establish relationships is both very difficult and very useful. In fact, one of the reasons you want a common format is so that you can find and establish these identifiers.

I have used a number of schemes for identifiers over the past ten years. Most of the schemes I have used have involved Uniform Resource Names or URNs. A decade ago we designed a URN mechanism for use in the California Legislature. Our LegisWeb product uses a very similar URN schema based on the lessons learned on the California Project. In more recent years I have experimented with the URN:lex proposal and the URL-based proposal that is within Akoma Ntoso. Both of these proposals are based around FRBR. I can’t say I have found the ideal solution.

I favor URN-based mechanism for a number of reasons. URNs are names – that was their intent as defined by the IETF. They are not meant to imply a location or organizational containment (well mostly they aren’t). In theory, these identifiers can be passed around and resolved to find the most relevent representation when needed. But there is a problem. URNs have never really been accepted. While they conceptually are very valuable, their poor acceptance and lack of supporting tools tends to undermine their value.

Akoma Ntoso takes a different approach. It uses URLs intead of URNs. Rather than using URLs as locations though, they are used as if they are identifiers. It is the duty of the webserver and applications plugged into the webserver to intercept the URLs and treat them as identifiers. In doing this, the webserver provides the same resolution functions that URNs were supposed to offer. My upcoming editor implements this functionality. I have built HTTP handlers that convert URLs into repository queries which retrieve and compose the requested documents. I have it working and it works well – as much as I understand the Akoma Ntoso proposal. I’m still not totally crazy about overloading identifier semantics on top of location semantics though. At least the technology support is better in place.

So what issues have I struggled with?

First of all, none of the proposals seem to adequately address how you deal with portions of documents. There are many issues in the area. The biggest of course is the inherent ambiguity within legislative documents. As Tom mentioned in his post, duplicate numbering often occurs. There are usually perfectly good and valid reasons for this – such as different operational conditions. But sometimes these are simply errors that everyone has to accommodate. Being able to specify the information necessary to resolve the ambiguity is not in any proposal I have seen. Add to that the temporal issues that come with renumbering actions. How do you refer to something that is subject to amendment and renumbering? Do you want a reference to specific wording at a specific point in time, or do you want you reference to track with amendments and renumbering?

At this point people often ask me why a hash identifier followed by a cleverly designed element id won’t work. The first thing you have to realize is that the # means something to the effect of “retrieve the document and then scroll to that Id”. The semantic I am looking for is “retreive the document fragment located at Id”. The importance of the difference becomes obvious when you realize that the client browser holds the “#” part of the request and all the server sees is the document URL, minus the hash and identifier. When your document is a thousand pages long and all you want is a single section, that distinction is quite important. Secondly managing ids across renumbering actions is very messy and introduces as many problems as it solves.

Secondly, the referencing mechanism tends to be documented oriented. Certainly, Akoma Ntoso uses virtual URL identifiers to refer to much more than simple documents, but the whole approach gets cumbersome and hard to explain. (If you want to appreciate this, try and explain XML schema’s namespace URI/URL concept to an uninitiated developer.) What’s more, it’s not clear if a common URL mechanism does enough to establish common enough practices for the effort to be useful. For instance, what if I want to refer to the floor vote after the second reading in the Assembly? Is there a reference to that? In California there is. That’s because the results of that vote are reported as a document. But there is nothing that says this should be the case. I have had the need to interrelate a number of ancilliary documents with the legislation. How to do that in a consistent way is not all that clear cut.

The third problem is user acceptance. The URN:Lex proposal, in particular, looks quite daunting. It uses lots of characters like @, $, ;, While end users can be shielded from some of this, my experience has taught me that even software developers rebel against complexity they can’t understand or appreciate. So far, this has been a struggle.

I’m eagerly awaiting Part 2 of Tom’s post on identifiers. It’s a great subject to explore.

Standard
Akoma Ntoso, Standards, Transparency

Imagine All 50 States Legislation in a Common Format

Last week I expressed dissapointment over NCSL’s opposition to the DATA Act (H.R. 2146). Their reasoning is that the burden this might create on the state’s systems will not be affordable. Contrast this with the topic of the international workshop held in Brussels last week – “Identifying benefits deriving from the adoption of XML-based chains for drafting legislation“. The push toward more transparent government need not be unaffordable.

With that in mind, stop for a while and imagine having the text from all 50 states legislation publishing in a common XML format. Seem like an impossibly difficult and expensive undertaking doesn’t it? With all the requirements gathering, getting systems to cooperate, and getting buy-in throughout the country, this could be another super-expensive project that in the end would fail. What would such a project cost? Millions and millions?

Well, remember again Henry Ford’s quote “If you think you can do a thing or think you can’t do a thing, you’re right”. Would you believe that a system to gather and publish all 50 states has recently been developed, in months rather than years, and on a shoe-string budget? That system is BillTrack50.com. It’s a 50 state bill tracking service. Check it out! We, at Xcential, helped them to do this herculian task by providing a simple and neutral XML and the software to do much of the processing. The press release is here. The format is SLIM, the same format the underlies my legix.info prototype. It’s a simple, easy-to-adopt XML format built on our past decade’s experience in legislative systems. Karen Sahuka at BillTrack50 recently gave a presentation on her product at the Non-profit Technology Conference in San Francisco.

SLIM is not as ambitious as Akoma Ntoso. If you take a gander at my legix.info site, you will see that it’s very easy to go from SLIM to Akoma Ntoso. In fact, going between any two formats is not all that difficult with modern transformation technology. It’s how we built the publishing system for the State of California as well. My point is that with the right attitude, a little innovation, and the right tools, achieving the modern requirements for accountability and transparency need not be out of reach.

Standard
Akoma Ntoso, Hackathon, Standards

Building a Web-Based Legislative Editor

I built the legislative drafting tool used by the Office of the Legislative Counsel in California. It was a long and arduous process and took several years to complete. Issues like redlining, page & line numbers, and the complexities of tables really turned an effort that, while looking quite simple at the surface, into a very difficult task. We used XMetaL as the base tool and customized it from there, developing what has to be the most sophisticated implementation of XMetaL out there. We even had to have a special API added to XMetaL to allow us to drive the change tracking mechanism to support the very specialized redlining needs one finds in legislation.

Using an XML editor allows one to develop a very precise and accurate solution. The price you pay is the rigidity imposed upon you by the XML structure enforced by the editor. We worked very hard to loosen up that rigidity by providing a rules-based system that allowed the user to work within some wiggle room relying the application to sense what was intended and produce the desired rigid structure that XML demands. Another approach, taken by many, is to use a word processor to generate the document, relying on styles or lightweight tagging in the word processor to guide an XML generator or transformer after-the-fact. This gives the drafter more flexibility, at the expense of the accuracy when the drafter deviates outside of the expected range of document patterns that the XML generator can handle.

I have often wondered if a web-based editor wouldn’t be a better approach, allowing us to achieve the flexibility the user needs with the rigidity that makes XML useful to downstream processing. In the end, the question has always been whether such an editor is even possible. When the Writely word processor (now Google Docs) came along in 2005, the answer seemed to be a tentative yes. Looking into it a little bit I discovered that while feasible, given all the browser incompatibilites of the time, achieving a worthwhile editor of the sophistication needed to draft and manage legislation would still be a daunting task. So the idea has always remained in the back of my mind waiting for browser technology to mature to the point where building such an editor comes within a shot of being a reasonable approach.

That point has now arrived. With HTML5, it is now possible to build a full fledged browser-based legislative editor. For the past few months I have been building a prototype legislative editor in HTML5 that uses Akoma Ntoso as its XML schema. The results have been most gratifying. Certainly, building such an editor is no easy task. Having been working in this subject for 10 years now I have all the issues well internalized and can navigate the difficulties that arise. But I have come a long way towards achieving the holy grail of legislative editors – a web-based, standards-based, browser-neutral solution.


There are a lot of challenges. Interacting with all the browser events to maintain an undo stack is no easy task. Building a change tracking mechanism from scratch gives me lots of freedom but getting your head around all the variations is bewildering at times. And how do you build something that is useful to multiple jurisdictions and is sufficiently flexible to adapt to all the varying needs? This takes a trick – but one I have thought long and hard about.

HTML5 is not yet a fully defined standard. None of the browsers fully support what is defined. The same can be said for CSS, JavaScript, XML Support, and on and on. But the editor I have built works with the latest version of all four major browsers. I don’t have a single CSS quirk at all. In fact, the only substantive browser incompatibility that I have had to deal with arises from the fact that Internet Explorer’s XML implementation pre-dates the standard in this area and the API does not yet match the full standards-based API. This is the case despite IE having been the pioneer in this area.

What’s more, I have achieved this with Akoma Ntoso as the internal XML schema. Akoma Ntoso is itself a proposed standard within OASIS. Certainly not everything has been smooth sailing and I have submitted a whole slew of issues to the drafters of Akoma Ntoso, but I have been able to find my way to a workable implementation. It works!

Our plan is to use this prototype for the Unhackathon at UC Hastings and Stanford Law School on May 19th and then in follow-on events elsewhere. In a few days I will provide a link to the prototype for everyone to try it out. It’s still early days and the editor is far from being a complete and robust tool suitable for production, but what I have now confirms my belief that the next generation of legislative systems will be web-based and built on open-standards.

In my next post I will provide a little mini-tutorial to set the stage for the upcoming pre-beta release.

Standard
Akoma Ntoso, Hackathon, Standards

Toward’s more Affordable Solutions in Legal Informatics – with Standards

Got six million dollars? That’s the ballpark figure for a complete legislative system and it is too much. A decade ago when the technologies were still new, the risks were high, and experience was scarce, the reasons for this were easily explained. But now it’s time to move beyond the early-adopter market towards a more mature, affordable, and predictable market for legislative systems. The key to moving to this new era is standards.

Towards this end I am participating as a member of the OASIS LegalDocML Technical Committee. Our charter is to develop a common standard for legal documents. We had our initial meeting in March and are defining our deliverables for this important mission.

The wide variety of legal systems and traditions ensures that there are never going to be off-the-shelf solutions in legislative systems. However, all the differences should not deter us from finding what we have in common. It is this commonality that provides the basis for the development of common applications that can be cost-effectively adapted to local requirements. Of course, to achieve this goal you need a common information model. The OASIS TC is using Akoma Ntoso as the starting point for this information model.

Akoma Ntoso Logo

Okay, so what is Akoma Ntoso? Akoma Ntoso is an XML schema developed at the University of Bologna and supported by Africa i-Parliaments, a project sponsored by United Nations Department of Economic and Social Affairs. It defines an XML-based information model for legislative documents. In the last few years it has been gaining traction in Europe, Africa, South America, and now slowly in North America as well.

Do you find the name Akoma Ntoso intimidating? Well, you’re not alone. However, it’s easy to say once you know how. Simply pronounce it as in “a-coma-in-tozo” and you’ll be close. Akoma Ntoso means “linked hearts” in the Akan language of West Africa.

If you find all the talk about XML confusing, then we have a solution for you. Through my company Xcential, I am working with Ari Hershowitz @arihersh of Tabulaw, Charles Belle @brainseedblog of UC Hastings, and Pieter Gunst @DigitalLawyer of Stanford and LawGives.org to host two “unhackathons” on May 19th at UC Hastings and at the Stanford Law School, both near San Francisco. The point of our unhackathons is to provide participants with an entry-level and fun introduction to the world of XML markup and Akoma Ntoso. And once we’re done with the May 19th events around San Francisco, we’re going to stage other events in other locations around the world to bring the same knowledge to a much wider audiance

If you would like to attend one of these events please sign up at the Eventbrite.com site and/or contact one of the organizers. And if you would like to host or participate in a virtual unhackathon in June, please let one of us know as well. We’re looking for volunteers.

Within the next week I will be posting a prototype of a new legislative editor for use at the unhackathon.  It’s an HTML5-based editor built entirely around Akoma Ntoso. While we don’t yet have any productization plans, this editor will demonstrate the coming era of cost-effective and standardized components which can be mixed and matched to produce the next generation of legal informatics solutions. Stay tuned…

Standard