Skip to main content
LadyGraph core: the data model, rules and update logic shared by every system.

core.address

Addresses: canonical URI strings, <scheme>://<scope>/<locator>#<anchor>.

AddressParts

canonical_address

parse_address

core.concept

Candidate

Found

extraction_schema

The answer schema for one ontology: type and relation type can only be values it declares.

core.merge

Applying a Contribution, and merging Concepts (INTERFACE §3, ownership).

ApplyResult

apply_contribution

  1. Remove this unit’s Evidence for the replaced passages (all of them when replaces is None), and Relations that lose all their Evidence.

merge_concepts

Merge other into keep.

core.model

The LadyGraph data model. Terms are defined in CONTEXT.md; see docs/INTERFACE.md §2–3.

Actorstamp

Concept

Context

ContextChoice

A pinned context choice; a rebuild replays it instead of asking the LLM.

Contribution

Declared

An entry whose meaning a human declared in configuration, so no model is needed to read it.

Document

DocVersion

Evidence

One OKF sources[] entry: a position and a Fingerprint, never source text.

Passage

Relation

Resolution

Word

concept_id

Opaque and permanent.

concept_path

context_id

is_human

core.normalize

The two text normalizations. They must never be swapped.

faithful

fingerprint

Fingerprint of text that is already faithfully normalized.

for_matching

locate

Where the span with this fingerprint starts in the passage, or None.

passage_fingerprint

slug

core.ontology

The ontology: the concept types and relation types a system allows.

Ontology

RelationCheck

Construct with RelationCheck(*values).

RelationSpec

TypeSpec

core.pipeline

Pipeline interfaces and the update stage (INTERFACE §6).

Embedder

Text to vectors, sync and async like llm.LlmClient. Construct with Embedder(*args, **kwargs).

Extractor

Construct with Extractor(*args, **kwargs).

GraphStore

Construct with GraphStore(*args, **kwargs).

Resolver

Construct with Resolver(*args, **kwargs).

Source

Construct with Source(*args, **kwargs).

UpdateResult

changed_passages

(passages the extractor runs on, passages whose evidence is replaced).

classify

contribution_scope

Fields every Contribution from doc must carry.

plan_update

replaces_for

The replaces set run_update expects, from what an extractor is given.

run_update

core.query

The query interface (INTERFACE §8).

Hit

Query

core.redaction

Contact details: patterns, the optional masks, and the rule that a contact detail is never a concept.

contact_sentences

The (start, end) of each sentence of text that holds a contact detail or a mask, in order, without repeats.

only_contact_detail

True when text is a contact detail or a mask with, at most, a stray word around it.

core.registry

The Context registry and candidate ranking (INTERFACE §3, “Context”).

Candidate

ContextRegistry

Construct with ContextRegistry(scope: str, contexts: list[Context]).

core.runner

When to run the update (INTERFACE §6).

Scheduler

Construct with Scheduler(source: Source, extractor: Extractor, store: GraphStore, ontology: Ontology, scopes: list[str], *, poll: datetime.timedelta = datetime.timedelta(seconds=900), clock: Callable[[], datetime.datetime] = <function _now at 0x102524400>).

core.validate

Validating a Contribution before it is applied (INTERFACE §4).

Report

validate_contribution

Return a cleaned copy of c and a report.

core.validity

Validity periods: a Document is indexed only while it is in force.

Period

is_valid

local_midnight

next_boundary

The earliest instant after now when some Document enters or leaves.

validity_period

replacement_effective holds the effective dates of Documents that fully replace this one AND are themselves valid; the caller resolves that.

core.words

Matching a question against the words a human declared for a concept.

canonical

Join a form code to its variant letter, on text that for_matching has already normalized.

matches

positive_terms

The terms of a clause that must appear, as written (with their accents), for showing a person.

prepare_question

The question in the form matches needs, so it is normalized once per search.