Knowledge Graph Engineering for Design Review: Specs, Codes and Drawings Checked as One Model
On a simulated 600-item electrical design with 40 planted defects, a rule check run one document at a time finds 10. The same rules over a knowledge graph find all 40, and 88.7% with realistic extraction errors. The schema, the Python, the SHACL and what the errors cost.

Article 220 is now Article 120
The 2026 edition of the National Electrical Code moved branch circuit, feeder and service load calculations out of Article 220 and into Article 120, according to EC&M's July 2026 overview of the edition. It was one change among many in a code shaped by more than 4,000 public inputs and just under 2,000 public comments. Every specification section that still cites Article 220 is now out of date on a project that adopts the 2026 code. The citation lives in the specification. The adopted edition lives in the design criteria. No single document is wrong on its own, which is why a reviewer reading one document at a time will not see it.
That is the case for knowledge graph engineering in design review: turn the facts in specifications, codes, schedules and drawings into one connected set of statements, each tagged with the document it came from, and write review rules that join across them. I built a small simulation to see how much that buys and what it costs. On a simulated electrical design with 600 equipment items and 40 planted defects, rules applied one document at a time found 10. The same rules over a knowledge graph found all 40 when every fact was extracted correctly, and 88.7% when 3% of facts were missing and 2% had wrong values, with another 8.2% sent to a reviewer by completeness checks.
The rest of this piece covers the schema, the Python that produced every number here, the same rules written in SHACL, the price of extraction errors in false alarms and review queue, and where the approach stops working.
Why design review is a knowledge graph engineering problem
Most design defects that reach the field are relationships, not typos. An enclosure rating is fine until you learn the room it sits in is classified as wet. A cable ampacity is fine until you read the load it feeds from a separate calculation. Each fact is correct in its own document, and the defect exists only in the join.
Rework is expensive and hard to see. A study by Peter Love in the Journal of Construction Engineering and Management, summarized by ASCE in January 2026, found a contractor's actual precompletion rework averaged 0.38% of contract value, rising to 0.76% with postcompletion corrections, and that actual rework costs were underreported by 300%. ASCE's summary lists design errors among the causes of field rework. The figure will vary by firm and project type, but the direction is clear enough: a defect caught in review costs a markup, and a defect caught in the field costs a crew.
Kansas City has a direct stake in this. Burns & McDonnell has kept its world headquarters in Kansas City since 1898, and Black & Veatch has called the region home since 1915, with its headquarters in Overland Park. Both design and build infrastructure, work in which one specification section can feed hundreds of drawings. Nothing in this article uses either firm's data or describes how either one reviews designs; the simulation is synthetic.
The model: facts, documents and four rules
Every fact is a triple plus its source: subject, predicate, value, document. Equipment E214 has enclosure NEMA 12, from the equipment schedule. E214 is located in room R07, from the layout drawing. R07 is classified wet, from the area classification drawing. Wet rooms require enclosure 4 or 4X, from the specification. Keeping the source on every fact matters later, when a reviewer needs to know which document to open.
The simulated project has 60 rooms (42 normal, 12 wet, 6 hazardous), 600 equipment items, 600 cables and 40 specification sections, for 4,303 facts drawn from 9 documents. I planted 10 defects of each of four types:
| Defect | Facts needed | Documents spanned |
|---|---|---|
| A. Breaker trip above its frame rating | 2 | 1 (equipment schedule) |
| B. Spec cites NEC 2023 Article 220 on a project that adopts NEC 2026 | 2 | 2 (specification, design criteria) |
| C. Cable ampacity below 1.25 times its load | 3 | 3 (cable schedule, one-line, load calculation) |
| D. Enclosure not allowed for the room's area class | 4 | 4 (equipment schedule, layout, area classification, specification) |
The 1.25 margin is the project specification's rule in this simulation. The four types were chosen to span one to four documents, so the share of defects that cross documents (30 of 40) is set by the design of the test. The point the test makes is narrower and harder to argue with: a check that cannot join documents cannot find a cross-document defect at any level of care.
The Python
The full script is about 170 lines with no dependencies beyond the standard library. The core is one function that runs all four rules. With scope_by_document=True it may only join facts from the same document, which is what a document-by-document review does.
def check(facts, scope_by_document=False):
groups = defaultdict(list)
for f in facts:
groups[f[3] if scope_by_document else "all"].append(f)
issues, flags = set(), set()
required = {"enclosure", "located_in", "load_A", "trip_A", "frame_A"}
for doc, fs in groups.items():
v, fed_by = defaultdict(dict), {}
for s, p, o, _ in fs:
v[s][p] = o
if p == "feeds":
fed_by[o] = s
adopted = v["project"].get("adopts")
for e, a in v.items():
if not e.startswith("E"):
continue
if "trip_A" in a and "frame_A" in a and a["trip_A"] > a["frame_A"]:
issues.add(("A", e))
room = a.get("located_in")
cls = v.get(room, {}).get("area_class")
rule = v.get(cls, {}).get("requires_enclosure")
if "enclosure" in a and rule and a["enclosure"] not in rule.split("|"):
issues.add(("D", e))
cable = fed_by.get(e)
amp = v.get(cable, {}).get("ampacity_A")
if amp is not None and "load_A" in a and amp < MARGIN * a["load_A"]:
issues.add(("C", e))
if not scope_by_document: # a missing required fact goes to a reviewer
if ((required - a.keys()) or cable is None or amp is None or cls is None
or (cls != "normal" and rule is None)):
flags.add(e)
for s, a in v.items():
if s.startswith("S") and not scope_by_document and (not adopted or "cites" not in a):
flags.add(s)
if s.startswith("S") and adopted and "cites" in a:
edition, art = a["cites"].split(" Art. ")
if edition != adopted or art in MOVED:
issues.add(("B", s))
return issues, flags
Run on the exact facts, it prints:
facts: 4303 from 9 documents; planted defects: 40
one document at a time found 10/40 false alarms 0 by type {'A': 10}
graph, exact facts found 40/40 false alarms 0 by type {'A': 10, 'B': 10, 'C': 10, 'D': 10}
The document-scoped check finds every type A defect and nothing else. The graph check finds all 40 with no false alarms. That second line is the ceiling. Real facts are not exact, because someone or something has to read them out of PDFs, schedules and drawing title blocks.
What extraction errors do to the result
To model extraction, each fact is independently dropped with probability 3% or replaced with a wrong value from the same field with probability 2%. A rule that needs k facts can only fire correctly when all k came through, so the share of defects found directly is roughly
where q is the probability that one fact is extracted correctly (here q = 0.95) and k is the number of facts the rule joins. For two facts that is 0.95² ≈ 90.2%, for three 85.7%, for four 81.5%. Over 2,000 simulated extractions, the measured rates came out a little higher, because a wrong value sometimes still breaks the rule:
graph, extracted facts (3% missing, 2% wrong), 2000 runs:
found 88.7% flagged for review 8.2% missed 3.1%
false alarms per project 29.1 items flagged for review per project 143.4 of 640
type A (1 document): found 92.0% flagged 6.6% missed 1.4%
type B (2 documents): found 92.5% flagged 2.4% missed 5.1%
type C (3 documents): found 87.3% flagged 10.6% missed 2.1%
type D (4 documents): found 83.1% flagged 13.0% missed 3.9%
The four-document enclosure check loses the most: 83.1% found directly. That is the general shape of the problem. The defects a graph is best placed to catch are the ones that need the most facts, and every added fact multiplies in another chance of an extraction error.
Completeness checks turn misses into a review queue
A graph can query for what is absent. Every equipment item should have a room, an enclosure, a load and a feeding cable, and every specification section should carry a citation. When one of those facts is missing, the item goes to a reviewer instead of passing silently. That moved 8.2% of the planted defects from missed to flagged, which left 3.1% missed outright. Most of the remaining misses come from wrong values rather than missing ones: a misread citation that happens to look current, or a misread enclosure that happens to be allowed.
The cost shows up in the other two numbers. With 3% of facts missing, about 143 of the 640 equipment items and spec sections got flagged per project, because an item with seven or eight required facts has a good chance of losing at least one. And the 2% wrong values produced about 29 false alarms per project, defects the rules reported that were not there. A review team that adopts this approach is trading a reading task for a checking task. That trade is worth making only if the extraction error rates are measured, so the team knows the size of the queue before it arrives.
The same rules in SHACL
Graph standards already cover this kind of rule. SHACL, the Shapes Constraint Language, became a W3C Recommendation on July 20, 2017, as a language for validating RDF graphs against a set of conditions. Here are two of the rules, a completeness check and the wet-room enclosure check, as SHACL shapes, validated with the open-source pySHACL library on three equipment items:
from pyshacl import validate
from rdflib import Graph
DATA = """
@prefix ex: <https://example.org/plant#> .
ex:R07 ex:areaClass "wet" .
ex:R12 ex:areaClass "normal" .
ex:E101 a ex:Equipment ; ex:locatedIn ex:R07 ; ex:enclosure "12" .
ex:E102 a ex:Equipment ; ex:locatedIn ex:R07 ; ex:enclosure "4X" .
ex:E103 a ex:Equipment ; ex:enclosure "1" .
"""
SHAPES = """
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix ex: <https://example.org/plant#> .
ex:EquipmentShape a sh:NodeShape ;
sh:targetClass ex:Equipment ;
sh:property [ sh:path ex:locatedIn ; sh:minCount 1 ;
sh:message "No room on the layout drawing" ] ;
sh:sparql [ sh:message "Enclosure not allowed in a wet room" ;
sh:select '''
PREFIX ex: <https://example.org/plant#>
SELECT $this WHERE {
$this ex:locatedIn ?room ; ex:enclosure ?enc .
?room ex:areaClass "wet" .
FILTER (?enc NOT IN ("4", "4X"))
}''' ] .
"""
conforms, _, report = validate(Graph().parse(data=DATA, format="turtle"),
shacl_graph=Graph().parse(data=SHAPES, format="turtle"))
print("conforms:", conforms)
for line in report.splitlines():
if "Focus Node" in line or "Message" in line:
print(line.strip())
conforms: False
Focus Node: ex:E101
Message: Enclosure not allowed in a wet room
Focus Node: ex:E103
Message: No room on the layout drawing
E101 sits in a wet room with a NEMA 12 enclosure. E103 has no room at all. E102 passes. The Python version is easier to read for a first project; the SHACL version is what a firm would keep, because the rules live as data next to the graph and any standards-compliant validator can run them. On the building side, buildingSMART's Information Delivery Specification (IDS), a computer-interpretable XML standard for stating what information an IFC model must contain, has been approved as a candidate standard. It covers the completeness half of this problem for BIM models.
Why not ask a language model to read the documents
A language model can read a specification and answer questions about it, and retrieval over code text is a reasonable way to find the relevant clause. The trouble is consistency when a number has to come out. In a 2025 case study, researchers at Pacific Northwest National Laboratory tested automated building code review for lighting allowances under ASHRAE Standard 90.1-2022. Their framework calculated the lighting power allowance as 3,019 W, while answers from different language models with retrieval came back as 5,500 W, 7,585 W, 5,400 W and 3,019 W. The authors also note the limit of their other route, direct calls to the Department of Energy's COMcheck engine: it can only check what COMcheck has encoded.
That is a fair summary of where each piece fits. Models and retrieval are useful for reading documents into facts and for finding which clause applies. The check itself belongs in a rule over structured facts, where the same input gives the same answer and the result points back to the source documents.
What engineering firms in Kansas City can do this quarter
- Pick one discipline and four rules. Electrical is a good start because schedules are already tabular. Write each rule as a sentence naming the documents it joins.
- Build the graph from the schedules first. Equipment, cable and panel schedules are structured already. Extract drawings and specs second, and keep the source document and revision on every fact.
- Measure extraction before you trust it. Hand-check a random sample of a few hundred facts and estimate q. The q^k formula then tells you what share of a four-fact rule's defects you will catch directly.
- Write completeness rules alongside the defect rules, and size the review queue from the measured missing rate before anyone commits to clearing it.
- Seed the test with known defects. Plant a dozen defects in a past project whose issues you already know, and report found, flagged and missed for each rule. That is the same known-answer approach used for the AI agent benchmark article on this site.
Where this breaks
The simulation is simple on purpose. Facts fail independently at fixed rates I chose, while real extraction errors cluster: a misread drawing title block can take a whole sheet's facts with it. The four rules are clean comparisons; real code requirements carry exceptions, conditions and engineering judgment that do not reduce to a filter. The completeness checks assume every required fact is known in advance, which holds for schedules and much less for narrative specification text. And the planted defect mix sets the 10 of 40 result for the document-scoped check, so that number describes this test, not any firm's projects.
There is also a cost the simulation leaves out: someone has to own the schema and keep the rules current when codes change, as the Article 220 move shows. The graph makes that change easy to trace, and it still has to be made.
The paid edition on Substack extends this into a working kit: a 16-cell sensitivity grid of found, flagged and missed rates and review workload across missing and wrong-value rates, the q^k table for rules joining up to six facts, a double-extraction test that cut false alarms from 29.5 to 0.2 per project and what it did to the review queue, a change-impact query that traces the Article 220 move through calculations and drawing notes, the full scripts and a 20-item checklist for a first design-review graph. Subscribe free for new articles by email, or get a Team License for a whole engineering or digital delivery team. More on knowledge engineering, ontologies and retrieval is in the Knowledge Graphs & Production AI research area, and the longer knowledge engineering system guide covers the pipelines behind a graph like this one.
Sources
- Ryan Jackson, Global Code-Wide Changes and Overview, EC&M, July 15, 2026
- ASCE Civil Engineering Source, How much does field rework in construction actually cost?, January 22, 2026, summarizing Peter E. D. Love, "Quantifying the Costs of Field Rework in Construction," Journal of Construction Engineering and Management
- W3C, Shapes Constraint Language (SHACL) is now a W3C Recommendation, July 20, 2017
- buildingSMART International, Information Delivery Specification (IDS) Gains Approval as Candidate Standard and the IDS repository
- Hanlong Wan, Weili Xu, Michael Rosenberg, Jian Zhang and Aysha Siddika, Automatic Building Code Review: A Case Study, Pacific Northwest National Laboratory, arXiv 2025
- Burns & McDonnell, Kansas City, Missouri and Black & Veatch in Kansas City


