1 Introduction

Visual representation of law and legal processes has potential to systematise decision-making in a way that mitigates risk and improves efficiency for lawyers, and lessens confusion and misunderstanding for their clients (Leiman 2016); both of which could decrease costs, especially those incurred relitigating matters (Fang 2014). In a system which is largely client funded this means there is potential for greater access to good quality legal assistance that a larger portion of the community can afford. Historic visual approaches like Wigmore Charts (Fig. 1) and Beardsley Diagrams have been proposed for analysis of trial evidence (Reed et al. 2007),Footnote 1 and newer methods like Araucaria Diagrams and Bayesian Networks (Fig. 2) have been used as visual steps to computational representation of legal argument in construction of AI (Reed et al. 2007; Fenton et al. 2013). However, in a recently published literature review it was found that in spite of calls for legal visualisations, use of diagrams to describe the inner workings of legislation or lawyerly processes remains rare (McLachlan and Webley 2020). This means that while diagrams and AI exist that exemplify a particular argument type, individual case or court judgment, there are very few exposing broader legal issues, legislation or categories of cases.

Fig. 1
figure 1

Wigmore diagram reproduced from Reed et al. (2007)

Fig. 2
figure 2

Bayesian Network for the case of R v Adams reproduced from Fenton et al. (2013)

Fig. 3
figure 3

The pathway to Legal AI

Fig. 4
figure 4

Extract of the multi-level Buyer pathway from conveyancing process lawmap

Visualisations of law and justice can be an important component for how lawyers and society more widely engage with the legal system. Legislation is infused with structure, and not just the visible structure of chapters, headings and statutory sections, but also an implicit structure that only becomes apparent when different sections and subsections interact as that legislation is analysed or when they are applied to a particular set of circumstances. The complex, verbose and abstruse nature of legislation means that it is difficult for those not trained in the law to comprehend the structure and meaning of legislation.

The systematic collation of interactions between legal provisions, processes and decision points could provide a formidable tool to support lawyer’s decision-making and a powerful representation of the law and legal system. Information visualisation (infovis) provides a map** between discrete data and visual representations in order to improve memory, cognition and comprehension of otherwise abstract information (Huron 2014; Manovich 2011). Infovis reduces the variability of what is specific to individual instances of data or an activity to visually represent only the core characteristics in order to reveal the patterns and structures inherent to that data or activity. The process of develo** infovis draws on two core principles (Manovich 2011):

  • The reduction of complex data and relationships to graphical primitives such as points, lines, curves and simple geometric shapes, and;

  • Use of spatial variables such as position, size, shape, colour and movement to represent key differences in data and reveal patterns.

Lawyers make countless decisions in the course of daily practice. Decisions about the relevant legal provisions that apply to a given matter, the scope of advice they give, the investigations they undertake on behalf of their client, and the context of submissions they draft. The vast array of complex legislation, practice rules and precedent all serve to make legal decision-making a challenging task (James 2007; Johnson 1999; Mulvenna and Hughes 1995). Lawyers adhere to relatively traditional ways of doing things, even as professionals in other domains adopt new technologies (Becerra 2018). While there have been numerous calls to develop approaches and train lawyers using infovis (Koch 2010; Leiman 2016; McCloskey 1998), these calls presently remain unanswered (Leiman 2016; McLachlan et al. 2020a, 1997; Rissland 1990). More recent projects have developed formulaic or rule-based approaches for performing routine tasks including predictive coding processes for e-Discovery, ranking of precedents during legal research, and predetermined routine document generation (Becerra 2018). While there have been a number of forays into predictive analytics these have usually sought to provide a limited prediction as to the potential outcome if a matter proceeds to trial, or the decision a particular judge might be expected to make based on past rulings (Becerra 2018). Issues have been raised with other predictive approaches that have drawn critical attention in the media, with claims that systems such as COMPASFootnote 2 and PredpolFootnote 3 are racist and prejudicially biased. However, these applications of AI more correctly exist within the policing and justice domains and are not routinely used by lawyers. For this reason, while their striking ethical issues should be foremost in the minds of all who are develo** intelligent solutions, we consider them to exist outside the scope of AI for legal practice.

Real-world problems generally comprise multiple related but uncertain variables and data (Constantinou et al. 2016). Develo** effective AI involves two major tasks: (1) determining the structure; and (2) specifying the computational parameters and values (Kyrimi et al. 2020). It can be difficult to determine the most appropriate inputs when develo** a new AI. However, one approach that has shown success is when data is combined with expert knowledge (Constantinou et al. 2016; Kyrimi et al. 2020). The process of deriving knowledge from experts, or expert elicitation (Constantinou et al. 2016; Kyrimi et al. 2020), allows for interdisciplinary collaboration between those develo** the AI and experienced practitioners from the domain under investigation. The goal should not be wholesale replacement of the expert practitioner. Rather, the goal should be to develop tools that can aid or enhance their practice, and reproduce elements of their expertise that may assist the untrained or inexperienced to identify when and why they have an issue that requires expert input.

With this in mind we have been develo** lawmaps in a discrete set of legal domains. Figure 3 describes the relationships on our pathway to develo** legal AI. Lawmaps (which we will define formally in Sect. 3) are developed from legislation, precedent and procedural rules, all framed by expert input that illuminates flow, meaning, decision-making and reasoning processes. We believe lawmaps provide a logical structure which, when combined with relevant legal datasets and a common data model (CDM) for law, can support production of Legal AI.

3 Lawmaps: an approach for representing legislation and legal processes

Lawmaps grew from a need for infovis in the legal domain and out of the prior efforts of several of this works’ authors to develop standard diagrams incorporating knowledge from clinical practice guidelines, published texts and clinical expertise in the medical domain. Known as caremaps (McLachlan et al. 2019), the resulting medical visualisations use a custom set of familiar unified modelling language (UML) elements to represent diagnostic and treatment activities, clinical decisions and the pathway a patient takes during the course of treatment for a given medical condition. Scaffolding a new infovis approach with an established presentation model that is familiar to the practitioner mitigated the need for extensive explanation and training of the representation framework, allowed the user to engage more freely with the knowledge content of the diagram, and resulted in an approach that practitioners agreed was simpler and easier to use than the text-based clinical guidelines and literature on which the caremap had, in part, been based (McLachlan et al.

Fig. 6
figure 6

The Lawmap Development Lifecycle

As legislation is amended or new legal judgements reported, the lawmap may be updated through reprise of the lawmap development lifecycle with the updated source materials.

The design process described below assumes that the process being mapped has been identified and begins with collection of the source materials. The process for resolving the structure and flow of a lawmap follows an iterative per-node standard process described in points iii-vi below, with addition of the Extract step which is used to prepare legislation for direct application in that iterative standard process.

  1. i.

    Locate

  • Input: the selected legislative or lawyerly process to me mapped

  • Process: locate and collect relevant source materials to the process under investigation.

  • Output: a collection of relevant source material for use in development of the lawmap.

  • Relates to: the green phase in the Lawmap Development Lifecycle

  1. ii.

    Extract (for legislation)

  • Input: legislation from the source material collection

  • Process: extract plain language logic from the law, making the legislation approachable and explaining its core elements, activities and application.

  • Output: a plain language process flow that describes the source legislation in simple terms.

  • Relates to: the blue phase in the Lawmap Development Lifecycle.

  1. iii.

    Identify

  • Input: output from the Locate and Extract steps.

  • Process: identify the requirement for a node. Such requirement will be indicated from the plain language logic of legislation, conditions of a judgement or common law test, the structure of a legal idiom, or as a necessary step in procedural rules or lawyerly process being undertaken.

  • Output: a collection of identified nodes with analysis of their requirements, dependencies and operative rules.

  • Relates to: the blue phase in the Lawmap Development Lifecycle.

  1. iv.

    Distinguish

  • Input: output from the Identify step.

  • Process: distinguish the type of node by its action and the effect it will have on the process flow. For example: where a node is an action or step to be undertaken and will be followed by another action or step, this will most likely be an activity node. Where there will be multiple pathways diverging from the identified node, this is most likely a decision point and necessitates identification of criterion to define the metric for selecting the individual divergent path to be taken.

  • Output: a complete set of nodes classified as activities or decision points.

  • Relates to: the red phase in the Lawmap Development Lifecycle.

  1. v.

    Sequence

  • Input: output from the Identify and Distinguish steps.

  • Process: the process to sequence a node requires identification of: (i) those activities that must be completed or that are necessary to the activity or decision to be undertaken in this node and which this node would have to follow; and (ii) any activities that depend on the outcome or completion of the activity or decision of this node and which this node must precede.

  • Output: the constructed lawmap.

  • Relates to: the purple phase in the Lawmap Development Lifecycle.

  1. vi.

    Traceability

  • Input: Output of all previous steps.

  • Process: this step annotates the lawmap and enables traceability back to the legislation, case law or source material for nodes and the overall structure. Where the node has been resolved from a particular subsection of legislation, this should be indicated. In cases where a node arises from application, discussion or refinement of the law in judgement, the case law should be referenced with attention drawn to the legal reasoning that is required.

  • Output: annotations for key nodes and pathways in the completed lawmap.

  • Relates to: the purple phase in the Lawmap Development Lifecycle.

There is of course a major leap from step ii to step iii and there has been no single universally agreed method for doing this. However, simple Boolean algebra can greatly assist in this process. Use of Boolean Algebra (Boole, 1847) for expressing the final structure of law or legal rules after thorough analysis, including rules of precedence, is not new (Kort 1963; Allen and Caldwell 1963). More recently this approach has been applied in the form of Temporal and Boolean Logic to model traffic law and road rules (Prakken 2017; Alves et al. 2020). It’s application in this work would help as the basis for develo** machine interpretable visualisations in the form of Lawmaps that can aid lawyers and clients to better understand the law and legal processes, as well as AI developers and decision scientists in their efforts to develop machine learning (ML), neural networks (NN) and other forms of AI. This process of deconstructing law and lawyerly process means each lawmap has a sound formal basis, which also promotes future bi-directional automatic generation of Lawmaps-based output from NLP methods, and the incorporation into and validation of laws in AI. For law and regulation the process begins with investigation of the underlying structure and infers the inherent intention and flow; identifying the key points, actors, processes and chronology of operations and representing them by application of Boolean logic and algebra.