LegalPresence — Litigation Data Model & Ontology
LegalPresence · Litigation Operating System

The Data Model & Ontology behind the Case File

How every document, fact, and legal argument in the matter is stored, related, and reasoned over — from the CRM records you edit to the RDF graph the rules engine judges.

10Core objects
835Evidence items
56Fact assertions
22Legal elements
9Standards crosswalked

01 · Architecture

Two layers: an operational store and a reasoning graph

The system deliberately separates the records people edit from the graph the engine reasons over. The CRM is the source of truth; the RDF graph is a faithful projection of it, rebuilt on demand so reasoning is never done against stale data.

Operational layer · Twenty CRM · PostgreSQL · GraphQL

The case file people work in

Every object below is a real table in the workspace schema, edited through the Twenty GraphQL API (never raw SQL). This is where counsel reviews evidence, where emails land, where AI work product is filed. It holds state; it does not draw conclusions.

project_rdf.py · project_assertions.py  ↓ projects to RDF ↓
Semantic layer · RDF / Turtle · rdflib · pySHACL

The graph the rules engine judges

The CRM records are projected into a typed RDF graph governed by the ontology. rules.py runs SHACL integrity shapes, the court-ready bundle gate, and the readiness scorecard over it — writing append-only DecisionRecords so every ruling is versioned and reproducible.

02 · The spine

The relation chain: from a document to a winning argument

This is the load-bearing path of the whole model. A piece of evidence supports an assertion (a claimed fact); an assertion proves a legal element; elements compose a strategy. The Assertion is the hub that ties raw documents to legal theory.

EvidenceArtifact
A document, email, exhibit or report
835 items
supportedByEvidence
Assertion
A claimed fact, with page/line cite
56 assertions
supportsLegalElement
LegalElement
A required element of a cause
22 elements
elementOfStrategy
StrategyCandidate
Vacatur · Contempt · Valuation…
4 strategies
An EvidenceGap branches off the chain — gapForElement marks an element with no proof, and blocksStrategy flags the strategy it stalls. Nothing on this chain is trusted until a human approves it: every assertion and every artifact defaults to UNREVIEWED, and only counsel promotes it.

03 · Object model

The ten objects and what each carries

Field chips are colour-coded: governance / gate fields carry the review and provenance state, relation fields point at other objects, plain chips are attributes. Only the load-bearing fields are shown.

EvidenceItem835

Every document in the matter. The governance-heavy object — it carries the source, approval, and authenticity state that decides whether a document can ever reach a judge.

namedocumentTypeevidenceTierocrText dateProvenancefileHashcounselReviewStatusadmissibilityAssessmentdkimStatuscourtStatusedrmStage nyscefDocNumberfilingPartymatterRef
FactAssertion56

A single claimed fact extracted from evidence — "the boiler serves Unit 1". The hub linking documents to legal elements, with a page/line citation back to the source.

factTextfactDateactorpageLineRef supportedByEvidenceRefsupportsElementRefcontradicts assertionStrengthassertionReviewStatusllmGeneratedprivilegeFlag
LegalElement22

A required element of a cause of action or strategy — e.g. §5015(a)(3) fraud, or "clear & unequivocal mandate" for contempt. Weighted by how much it moves the case.

namedescriptionelementWeightelementOfStrategy
Matter5

The court case(s) — NY Supreme index numbers, consolidations, the parties and property units at issue.

namecaseIndexNumberconsolidatedIntoconcerns
ImportedEmail242

Raw email intake before it becomes evidence. Carries the authentication material — DKIM verdict, content hash, and the real body (HTML now converted to text).

subjectfromAddressbodyTextmessageId contentHashdkimStatus
AiAnalysis52

AI-generated work product — strategy scans, withheld-evidence analyses. Always marked machine-generated and held to the same counsel-review gate as evidence.

nameanalysisTypeoutputllmGeneratedreviewStatus
TimelineEvent13

Dated procedural events — depositions, discovery demands, deadlines — that anchor "days elapsed" arguments and the chronology.

nameeventDateeventTypelegalSignificance
PrecedentCase10

Case law with its material-fact factors, matched against the matter's facts to test whether a precedent actually controls.

caseNamecitationholdinghasFactor
CaseTheory5

The theories of the case — the narrative frames the strategies serve (fraud on the court, harassment/access obstruction).

namesummarysupportsStrategy
MailboxConnection1

An authenticated IMAP source feeding ImportedEmail. Credentials live in SecureVault, never in the record.

namehostusernameactive

04 · Ontology

A controlling vocabulary, layered on the legal standards

Our own namespace lp: defines the classes and relations, but every class crosswalks to an established standard via rdfs:subClassOf or skos:closeMatch — so the graph stays interoperable and the reasoning rests on recognised legal-informatics foundations rather than a bespoke schema.

PROV-OW3C provenance

The backbone of authenticity. lp:EvidenceArtifact is a prov:Entity; chain-of-custody, authentication and e-discovery events are each a prov:Activity; lp:authoredBy refines prov:wasAttributedTo.

SALI LMSSLegal matter taxonomy

Matter classification. lp:Matter is a skos:closeMatch of sali:Matter — the industry-standard practice/area taxonomy.

Akoma NtosoLegal document XML

Document structure. lp:LegalDocument closeMatches akn:documentCollection; pleadings, motions, affidavits and orders subclass it.

LegalRuleMLNorms & deontics

Court-order obligations. lp:imposesDuty closeMatches lrml:Obligation and lp:prohibits closeMatches lrml:Prohibition — how an injunction's mandates become machine-checkable.

EDRME-discovery reference

Discovery lifecycle. The edrmStage field tracks each item through the Electronic Discovery Reference Model stages.

LKIF-CoreLegal concepts

Foundational legal vocabulary for persons, roles, and legal concepts underpinning the domain classes.

ODRL · DCTRights & metadata

Usage/privilege policy (odrl:) and descriptive metadata (dct:) on artifacts.

SHACL · SKOSShapes & crosswalk

SHACL shapes (shapes.ttl) are the integrity gate; SKOS is the crosswalk mechanism that keeps lp: aligned to every standard above.

Class hierarchy example.  lp:Injunction → lp:CourtOrder → lp:LegalDocument → lp:EvidenceArtifact → prov:Entity — an injunction inherits document structure, evidentiary governance, and provenance all at once.
Controlled vocabularies (SKOS).  vocabularies.ttl defines ConceptSchemes for review-status, evidence-tier, document-type, confidence and strategy-type — and the flagship, Party Role. Plaintiff/defendant is a role played in a specific matter, not a fixed label on a person: the same party flips role across the consolidated actions — same party = PLAINTIFF in one index, DEFENDANT in a related action. It is modelled as a reified lp:PartyRole (party × matter × role — PLAINTIFF · DEFENDANT · PETITIONER · RESPONDENT · APPELLANT), following the LKIF-Core role pattern. Drifted CRM enum terms crosswalk to canonical concepts (COUNSEL_APPROVED → APPROVED) with no record migration.

05 · Governance

Three independent gates on every artifact

The reason the model carries so many fields on EvidenceItem: an artifact must clear three separate questions before it can be relied on — where it came from, whether a human approved it, and whether it's authentic. These are stored as distinct fields and rendered as distinct badges.

Source

dateProvenance

How we know the document's date and origin — never assumed, only recorded from a verifiable source.

NYSCEF_STAMPEMAIL_HEADERAI_OCR_EXTRACTED

Approval

counselReviewStatus

Human sign-off. Nothing self-approves — every item and assertion starts UNREVIEWED and only counsel promotes it.

UNREVIEWEDAPPROVEDREJECTED

Authenticity

dkimStatus · fileHash

Cryptographic integrity — a DKIM verdict for email, and a content hash sealing every file against tampering.

DKIM_PASSDKIM_NONEDKIM_FAIL

The same gate on outbound actions

Governance isn't only about what comes in. The one irreversible outward action — sending mail to a party — is gated the same way: nothing reaches an outsider without a human admin.

Outbound-mail gate

mail_guard.send_mail_guarded()

The single sanctioned send path. It sends only if every recipient (To/Cc/Bcc) is on the trusted allowlist; any outside recipient (opposing counsel, the court, third parties) is queued as PENDING_ADMIN_APPROVAL and not sent until an admin releases it. Direct mail calls are neutralised so nothing can bypass it.

allowlisted team → auto-sendanyone else → admin approval

06 · Reasoning

How the rules engine reads the graph

Three layers run in order over the projected RDF, each writing versioned DecisionRecords. The engine never approves anything — it measures readiness and surfaces gaps for a human to act on.

Integrity gate — SHACL shapes

Every EvidenceArtifact must carry a contentHash, a dateProvenance, and a counselReviewStatus; every EmailArtifact must carry a real DKIM verdict. Violations are hard failures — an item that can't prove its own integrity can't be counted.

Bundle gate — court-ready test

An artifact is court-ready only if it is APPROVED and (DKIM PASS or already on the court record). This is what separates "we have it" from "we can put it in front of a judge".

Readiness scorecard — per element & strategy

For each legal element the engine computes approved-ready (proof counsel has cleared) versus potential (proof that exists but awaits review), then rolls them up per strategy by element weight — e.g. Valuation Attack 100% potential, PI Vacatur 89.5%, all 0% approved until counsel signs off.

Enlarged screenshot