Skip to content

Elevated Statements

Fresh

Elevated statements are the automatic extraction of the "golden graph" from rdf:Statement reification patterns. When you attach metadata to a relationship (confidence, source, timestamp), MD-LD automatically extracts both the reification node and the direct triple.

What Reification Is

In RDF, sometimes you need to make statements about statements. For example:

  • "Alice knows Bob" — this fact was recorded with 95% confidence
  • "The project is active" — Bob said this on 2026-05-06
  • "The report was generated by" — this was true between these two dates

Standard RDF reification uses rdf:Statement with three properties: rdf:subject, rdf:predicate, rdf:object. This creates a node that describes a triple.

The MD-LD Pattern

markdown
[my] <tag:alice.smith@example.org,2026:>

## Observation 1 {=my:obs1 .rdf:Statement .prov:Entity label}

I observed that [Alice] {+my:alice ?rdf:subject} [knows] {+my:knows ?rdf:predicate} [Bob] {+my:bob ?rdf:object}.

Confidence: [0.95] {my:confidence ^^xsd:decimal}
Source: [field notes] {+my:field-notes ?prov:wasDerivedFrom label}

This produces two levels of output:

In quads — The reification node with all its properties:

ttl
my:obs1 a rdf:Statement, prov:Entity ;
    rdfs:label "Observation 1" ;
    rdf:subject my:alice ;
    rdf:predicate my:knows ;
    rdf:object my:bob ;
    my:confidence "0.95"^^xsd:decimal ;
    prov:wasDerivedFrom my:field-notes .

In statements — The elevated direct triple:

ttl
my:alice my:knows my:bob .

Why "Elevated" Statements

The term "elevated" refers to the extraction of the core SPO triple from the reification scaffolding. The reification node (my:obs1) is the container for metadata. The elevated statement is the pure triple that the reification describes.

This separation is valuable because:

  • The reification node contains the evidence, confidence, and provenance
  • The elevated statement contains the clean fact you want to reason over
  • You can query statements for the clean graph while preserving all metadata in quads

Detection Rules

The parser detects the pattern in a single pass:

  1. A node is typed as rdf:Statement
  2. That node has rdf:subject, rdf:predicate, and rdf:object properties
  3. When all three are present, the elevated SPO triple is created and added to result.statements

Incomplete patterns (missing one of the three required properties) are tracked in statementCandidates until the document ends. Any incomplete candidates are discarded.

Accessing Elevated Statements

javascript
import { parse } from 'mdld-parse';

const result = parse({ text: mdldDocument });

// All quads including reification nodes
console.log(result.quads);

// Just the elevated clean triples
console.log(result.statements);

// Use statements for reasoning while quads have the full metadata
const directFacts = result.statements;
const metadataFacts = result.quads;

Use Cases

Confidence Scoring

markdown
## Claim {=my:claim-1 .rdf:Statement label}

[Alice] {+my:alice ?rdf:subject} [knows] {+my:knows ?rdf:predicate} [Bob] {+my:bob ?rdf:object}.
Confidence: [0.9] {my:confidence ^^xsd:decimal}
Recorded: [2026-05-06] {prov:generatedAtTime ^^xsd:date}

The elevated statement my:alice my:knows my:bob appears in statements. The confidence and timestamp stay in quads attached to my:claim-1.

Source Attribution

markdown
## Report claim {=my:report-claim .rdf:Statement label}

Claims that [Project Alpha] {+my:alpha ?rdf:subject} [has status] {+my:hasStatus ?rdf:predicate} [active] {+my:status/active ?rdf:object}.

Reported by [Alice] {+my:alice ?prov:wasAttributedTo}
From [quarterly review] {+my:review-q2 ?prov:wasDerivedFrom}

Temporal Facts

markdown
## Employment period {=my:emp-1 .rdf:Statement label}

[Alice] {+my:alice ?rdf:subject} [works at] {+my:worksAt ?rdf:predicate} [ACME] {+my:acme ?rdf:object}.

Valid from: [2024-01-01] {my:startDate ^^xsd:date}
Valid until: [2026-12-31] {my:endDate ^^xsd:date}

Qualifying Relationships (PROV-O Pattern)

PROV-O has a "qualified" pattern where you create a node about a relationship to attach additional metadata. This works naturally with elevated statements:

markdown
## Association {=my:assoc-1 .prov:Association label}

[Alice] {+my:alice ?prov:agent}
[Analysis run] {+my:run ?prov:activity}
[Lead analyst] {+my:role-lead ?prov:hadRole label}

Combining with merge()

Elevated statements accumulate across merged documents:

javascript
const merged = merge([doc1, doc2, doc3]);

// All elevated triples from all documents
console.log(merged.statements);

Each document contributes its own elevated statements to the merged result.