Graph Engineering Concepts › Entities, relations, and triples 12 of 12 steps written
01 — part 1, conceptsconcept

Entities, relations, and triples

Graph engineering is the practice of converting documents into an explicit structure of entities and relations, so that retrieval can follow connections instead of matching resemblance.

The unit of work is not the document

Retrieval systems store documents and return documents. A document is an arbitrary container: it is whatever a person happened to write in one sitting. The fact you need is usually one clause inside it, and the fact that completes the answer is a clause in a different document written by someone else.

Graph engineering changes the unit. The unit is the triple.

Triple — one subject, one relation, one object. “Release v4.2.0 includes change CHG-7043” is a triple. A document of forty sentences yields perhaps eight triples, and the other thirty-two sentences are prose about them.
One sentence becomes one triple doc2 · Release notes v4.2.0 Components rebuilt in this release: cart from change CHG-7043 v4.2.0 subject :Release CHG-7043 object :Change INCLUDES one of eight relation types the schema allows The other words in that sentence are prose about the fact. The triple is the fact. Five documents of this corpus yield 11 accepted triples in total.
A sentence from the corpus, and the triple inside it. Subject, relation and object lift out and settle as two nodes joined by a typed arrow.
The relation is not free text. INCLUDES is one of eight types the schema permits, which is step 4.

A graph is two things

what it iswhat it carries
nodeone entity, named oncea label saying what kind of thing it is
edgeone relation between two nodesits direction, the document it came from, and a confidence

That is the entire definition. There is no third element. Everything else in this volume is a decision about how nodes and edges get made, kept or refused.

What the structure buys

Once relations are explicit, two things are true that were not true of the documents.

Paths exist that no document states. If one document says a test covers a framework and another says a submission changed that framework, the graph contains a two-step path from the test to the submission. Neither document mentions the other.

The connection is queryable. “What is three steps from here” is a question you can ask of a graph and cannot ask of a corpus.

Five documents, one graph no single document contains the answer CI run 88213 Release notes Change CHG-7043 BUG-18402 Release note 10 nodes · 11 edges · every edge carries the document it came from
The five documents of the triage lab, and the graph hiding in them. Each document contributes triples; the triples share entities; the shared entities are what make it one graph rather than five.
10 nodes and 11 edges out of five short documents. The corpus is 101 words.

What it costs, stated up front

A graph is not free and this volume is not a recommendation to build one. It costs a vocabulary somebody maintains, an extraction pass over every document, and a rule for deciding when two names mean one thing. Step 11 puts a number on that and names the cases where you should not pay it.

The three labs here reject facts as well as accept them. On this corpus, extraction accepts 11 triples and rejects 2 — and the rejection is a product, not a failure. Step 4 is about why.

What to take from this step

  • The unit is the triple, not the document. A document is an arbitrary container.
  • A graph is nodes and edges. There is no third element.
  • The payoff is paths that no single document states — and the price is a schema, an extractor and a resolution rule.