NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Towards Checking Laws' Consistency through Ontology Design: The Case of Brazilian Vehicles' Laws

Frederico Luiz Gonçalves de Freitas, Zacharias Candeias Jr., Heiner StuckenschmidtJ. Theor. Appl. Electron. Commer. Res 2011

Introduction

Legal systems are built upon vast collections of texts that govern society. However, because these laws are written in natural language, they are frequently plagued by ambiguities, contradictions, and gaps. This paper explores the intersection of legal theory and the Semantic Web, demonstrating how formal logic can be used to "debug" legal codes. By translating Brazilian vehicle laws into a machine-readable ontology, the research reveals hidden contradictions that hinder e-government interoperability and automated legal services.

Identifying Semantic Deficiencies

The core challenge in digitizing legal knowledge lies in the inherent messiness of natural language. The authors categorize these issues as "semantic deficiencies," which can be broadly divided into linguistic and conceptual types.

Taxonomy of semantic deficiencies in legal texts.

Linguistic deficiencies include problems like polysemy (where a single word has multiple meanings) and confusing references such as anaphoras. Conceptual flaws are often more insidious, involving "false agreements" where different stakeholders believe they share a definition but actually rely on conflicting underlying models. Another common issue is underspecification, where a rule is too vague to be enforced consistently by an automated system.

In the context of e-government, these deficiencies are not merely academic. If a tax system's definition of a "moped" differs from the registration system's definition due to vague legislation, automated government services fail to interoperate, leading to administrative errors and legal disputes.

To address these deficiencies, the authors developed a framework to formalize laws into a logic-based ontology. They utilized the Web Ontology Language (OWL), which allows computers to reason over definitions and identify logical inconsistencies.

The development process followed the Methontology framework, a structured approach for building ontologies that includes identifying key terms, defining a glossary, and creating logical axioms. The underlying mathematical formalism is Description Logic, which allows for precise definitions of classes and their properties.

Conceptual model of the Vehicle Ontology.

As shown in the conceptual model, the ontology defines relationships between various entities such as vehicles, components, owners, and propulsion types. For example, a "Moped" might be formally defined as a vehicle with exactly two or three wheels and a maximum speed of 50 km/h. By establishing these rigid definitions, the system can automatically flag any vehicle instance that violates the established rules.

Case Study: The Brazilian Traffic Code

The researchers applied this framework to the primary legal sources governing vehicles in Brazil, including the Brazilian Traffic Code (CTB), Contran Resolutions, and documentation from the State Traffic Department of Pernambuco (DETRAN-PE).

The "Electric Bus" Paradox

One of the most significant findings was a logical contradiction regarding electric buses. Article 96 of the Brazilian Traffic Code implies that "automotor" (motorized) and "electrical" vehicles are disjoint, meaning a vehicle cannot be both. However, the same law later defines an "electric bus" as a sub-type of "automotor vehicle."

When this was formalized in the ontology, the reasoner immediately flagged an absurdity: logically, an electric bus would have to be "not electrical." This contradiction, while perhaps glossed over by human readers, represents a fundamental flaw in the legal text that formal ontologies are uniquely equipped to catch.

Practical Polysemy

The study also highlighted issues with the Portuguese term Carroçaria, which is used inconsistently to mean both "rear cargo area" and the "vehicle body" as a whole. Such polysemy leads to "False Agreements" in software systems, potentially causing errors in weight and capacity registrations that affect law enforcement and taxation.

Results and Discussion

The resulting Vehicle Ontology is a robust formal model featuring 102 named classes and 184 anonymous class restrictions. Unlike many existing web ontologies that function as simple taxonomies, this model uses complex axioms to define vehicle types precisely.

A comparison with existing "car ontologies" on the web demonstrated the superiority of this approach. The authors' version contained 63 "defined" classes (those with complex logical restrictions) compared to just one in the baseline ontology. This level of detail is necessary for the ontology to serve as a diagnostic tool for legislation.

Conclusion and Future Work

This research proves that the process of building an ontology is as valuable as the final artifact. Attempting to translate a law into formal logic forces designers to confront every ambiguity that a human reader might ignore.

While the vehicle domain provided a clear proof of concept, scaling this to more complex legal branches like civil or tax law remains a challenge. Future work will focus on developing a functional Semantic Law Checker prototype for legislators and judges, applying the framework to case studies with higher "ontological stakes," and integrating these ontologies into live e-government Web Services to ensure legal compliance in automated transactions.

Summary updated

BibTeX
@article{freitas2011towards,
  author = {Frederico Luiz Gonçalves de Freitas and Zacharias Candeias Jr. and Heiner Stuckenschmidt},
  title = {{Towards Checking Laws' Consistency through Ontology Design: The Case of Brazilian Vehicles' Laws}},
  journal = {J. Theor. Appl. Electron. Commer. Res.},
  year = {2011},
  url = {https://openreview.net/forum?id=Z3ghW8WZ5W8U},
}

Loading related content...

Figure