Skip to content

Schema Reference

Documentation of the theory graph schema and entity/relationship types.

Theoretical Foundations

See Formal Graph Schema (TheoryNet) and Theory-Nets, Posets & Topologies for the structuralist philosophy, coherence models, and formal graph representations that inform this schema's design.

Graph Schema Configuration

The graph schema defines the expected structure of the constructed theory graph.

Bases: BaseModel

Decoupled schema configuration — all node/edge types the pipeline uses.

Pass a custom instance to PipelineConfig to override the defaults for a different domain. Prompt templates receive these lists as {entity_types} and {relation_types} at runtime.

Source code in packages/episteme-pipeline/episteme_pipeline/schema/default_schema.py
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
class SchemaConfig(BaseModel):
    """
    Decoupled schema configuration — all node/edge types the pipeline uses.

    Pass a custom instance to PipelineConfig to override the defaults for a
    different domain. Prompt templates receive these lists as {entity_types}
    and {relation_types} at runtime.
    """

    version: str = "v1"
    node_types: list[str] = Field(default_factory=lambda: list(L2_NODE_TYPES))
    relation_types: list[str] = Field(default_factory=lambda: list(L2_RELATION_TYPES))
    node_definitions: dict[str, str] = Field(default_factory=lambda: dict(L2_NODE_DEFINITIONS))
    relation_definitions: dict[str, str] = Field(default_factory=lambda: dict(L2_RELATION_DEFINITIONS))
    component_types: list[str] = Field(default_factory=lambda: list(L3_COMPONENT_TYPES))
    argument_relation_types: list[str] = Field(default_factory=lambda: list(L3_RELATION_TYPES))
    component_definitions: dict[str, str] = Field(default_factory=lambda: dict(L3_COMPONENT_DEFINITIONS))
    argument_relation_definitions: dict[str, str] = Field(default_factory=lambda: dict(L3_RELATION_DEFINITIONS))
    relation_polarities: dict[str, int] = Field(default_factory=lambda: dict(RELATION_POLARITIES))
    component_partitions: dict[str, str] = Field(default_factory=lambda: dict(COMPONENT_PARTITIONS))
    scope_types: list[str] = Field(default_factory=lambda: list(SCOPE_TYPES))
    epistemic_statuses: list[str] = Field(default_factory=lambda: list(EPISTEMIC_STATUSES))

    def node_types_str(self) -> str:
        return ", ".join(self.node_types)

    def relation_types_str(self) -> str:
        return ", ".join(self.relation_types)

    def component_types_str(self) -> str:
        import json
        payload = {k: self.component_definitions.get(k, "No description provided.") for k in self.component_types}
        return json.dumps(payload, indent=2, ensure_ascii=False)

    def argument_relation_types_str(self) -> str:
        import json
        payload = {k: self.argument_relation_definitions.get(k, "No description provided.") for k in self.argument_relation_types}
        return json.dumps(payload, indent=2, ensure_ascii=False)

    def get_relations_with_polarity(self, polarity: int | None = None) -> list[str]:
        """Return relation names filtered by epistemic polarity.

        Parameters
        ----------
        polarity : int or None, default None
            +1 for positive (support/entailment), -1 for negative (attack/undercut),
            0 for neutral/structural. If None, returns all non-zero dialectical relations (+1 and -1).

        Returns
        -------
        list of str
            Relation type names matching the requested polarity.
        """
        if polarity is None:
            return [r for r, p in self.relation_polarities.items() if p != 0]
        return [r for r, p in self.relation_polarities.items() if p == polarity]

    def get_support_relations(self) -> list[str]:
        """Return all relation names with positive support polarity (+1).

        Returns
        -------
        list of str
            Relation types with polarity +1.
        """
        return self.get_relations_with_polarity(1)

    def get_attack_relations(self) -> list[str]:
        """Return all relation names with negative attack polarity (-1).

        Returns
        -------
        list of str
            Relation types with polarity -1.
        """
        return self.get_relations_with_polarity(-1)

    def is_support_relation(self, relation_type: str) -> bool:
        """Check whether a relation type has positive support polarity (+1).

        Parameters
        ----------
        relation_type : str
            Relation type to evaluate.

        Returns
        -------
        bool
            True if relation has polarity +1.
        """
        return self.relation_polarities.get(relation_type, self.relation_polarities.get(relation_type.upper(), 0)) > 0

    def is_attack_relation(self, relation_type: str) -> bool:
        """Check whether a relation type has negative attack polarity (-1).

        Parameters
        ----------
        relation_type : str
            Relation type to evaluate.

        Returns
        -------
        bool
            True if relation has polarity -1.
        """
        return self.relation_polarities.get(relation_type, self.relation_polarities.get(relation_type.upper(), 0)) < 0

    def resolve_relation_type(self, candidate: str) -> str | None:
        """Resolve a candidate relation name or dialectical stance to a configured argument relation.

        Matches candidate names directly against argument_relation_types or dynamically
        maps positive/negative stance labels (e.g. 'SUPPORTS' -> 'SUPPORTS_ARG') based
        on identical polarity alignment.

        Parameters
        ----------
        candidate : str
            Candidate relation or stance identifier.

        Returns
        -------
        str or None
            Matching canonical relation type, or None if unmapped.
        """
        if not candidate:
            return None
        cand_upper = candidate.upper()
        if candidate in self.argument_relation_types:
            return candidate
        if cand_upper in self.argument_relation_types:
            return cand_upper

        cand_pol = self.relation_polarities.get(cand_upper, self.relation_polarities.get(candidate, 0))
        if cand_pol != 0:
            for r in self.argument_relation_types:
                if self.relation_polarities.get(r) == cand_pol:
                    return r
        return None

get_attack_relations()

Return all relation names with negative attack polarity (-1).

Returns

list of str Relation types with polarity -1.

Source code in packages/episteme-pipeline/episteme_pipeline/schema/default_schema.py
192
193
194
195
196
197
198
199
200
def get_attack_relations(self) -> list[str]:
    """Return all relation names with negative attack polarity (-1).

    Returns
    -------
    list of str
        Relation types with polarity -1.
    """
    return self.get_relations_with_polarity(-1)

get_relations_with_polarity(polarity=None)

Return relation names filtered by epistemic polarity.

Parameters

polarity : int or None, default None +1 for positive (support/entailment), -1 for negative (attack/undercut), 0 for neutral/structural. If None, returns all non-zero dialectical relations (+1 and -1).

Returns

list of str Relation type names matching the requested polarity.

Source code in packages/episteme-pipeline/episteme_pipeline/schema/default_schema.py
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
def get_relations_with_polarity(self, polarity: int | None = None) -> list[str]:
    """Return relation names filtered by epistemic polarity.

    Parameters
    ----------
    polarity : int or None, default None
        +1 for positive (support/entailment), -1 for negative (attack/undercut),
        0 for neutral/structural. If None, returns all non-zero dialectical relations (+1 and -1).

    Returns
    -------
    list of str
        Relation type names matching the requested polarity.
    """
    if polarity is None:
        return [r for r, p in self.relation_polarities.items() if p != 0]
    return [r for r, p in self.relation_polarities.items() if p == polarity]

get_support_relations()

Return all relation names with positive support polarity (+1).

Returns

list of str Relation types with polarity +1.

Source code in packages/episteme-pipeline/episteme_pipeline/schema/default_schema.py
182
183
184
185
186
187
188
189
190
def get_support_relations(self) -> list[str]:
    """Return all relation names with positive support polarity (+1).

    Returns
    -------
    list of str
        Relation types with polarity +1.
    """
    return self.get_relations_with_polarity(1)

is_attack_relation(relation_type)

Check whether a relation type has negative attack polarity (-1).

Parameters

relation_type : str Relation type to evaluate.

Returns

bool True if relation has polarity -1.

Source code in packages/episteme-pipeline/episteme_pipeline/schema/default_schema.py
217
218
219
220
221
222
223
224
225
226
227
228
229
230
def is_attack_relation(self, relation_type: str) -> bool:
    """Check whether a relation type has negative attack polarity (-1).

    Parameters
    ----------
    relation_type : str
        Relation type to evaluate.

    Returns
    -------
    bool
        True if relation has polarity -1.
    """
    return self.relation_polarities.get(relation_type, self.relation_polarities.get(relation_type.upper(), 0)) < 0

is_support_relation(relation_type)

Check whether a relation type has positive support polarity (+1).

Parameters

relation_type : str Relation type to evaluate.

Returns

bool True if relation has polarity +1.

Source code in packages/episteme-pipeline/episteme_pipeline/schema/default_schema.py
202
203
204
205
206
207
208
209
210
211
212
213
214
215
def is_support_relation(self, relation_type: str) -> bool:
    """Check whether a relation type has positive support polarity (+1).

    Parameters
    ----------
    relation_type : str
        Relation type to evaluate.

    Returns
    -------
    bool
        True if relation has polarity +1.
    """
    return self.relation_polarities.get(relation_type, self.relation_polarities.get(relation_type.upper(), 0)) > 0

resolve_relation_type(candidate)

Resolve a candidate relation name or dialectical stance to a configured argument relation.

Matches candidate names directly against argument_relation_types or dynamically maps positive/negative stance labels (e.g. 'SUPPORTS' -> 'SUPPORTS_ARG') based on identical polarity alignment.

Parameters

candidate : str Candidate relation or stance identifier.

Returns

str or None Matching canonical relation type, or None if unmapped.

Source code in packages/episteme-pipeline/episteme_pipeline/schema/default_schema.py
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
def resolve_relation_type(self, candidate: str) -> str | None:
    """Resolve a candidate relation name or dialectical stance to a configured argument relation.

    Matches candidate names directly against argument_relation_types or dynamically
    maps positive/negative stance labels (e.g. 'SUPPORTS' -> 'SUPPORTS_ARG') based
    on identical polarity alignment.

    Parameters
    ----------
    candidate : str
        Candidate relation or stance identifier.

    Returns
    -------
    str or None
        Matching canonical relation type, or None if unmapped.
    """
    if not candidate:
        return None
    cand_upper = candidate.upper()
    if candidate in self.argument_relation_types:
        return candidate
    if cand_upper in self.argument_relation_types:
        return cand_upper

    cand_pol = self.relation_polarities.get(cand_upper, self.relation_polarities.get(candidate, 0))
    if cand_pol != 0:
        for r in self.argument_relation_types:
            if self.relation_polarities.get(r) == cand_pol:
                return r
    return None

Visual Overview

The following diagrams provide a high-level visualization of the entity typologies and how they interact, broken down into two core perspectives based on the structuralist framework.

1. Node Ontology and Class Hierarchy

This class diagram illustrates the fundamental types of nodes in the graph, separating high-level Core Entities from the epistemological Propositions (Theory-Elements). It also explicitly defines the structuralist attributes and their possible categorical values (enumerations).

classDiagram
    class Node {
        +Float Confidence
        +String Evidence
        +String Provenance
    }
    class CoreEntity {
        <<Entity>>
    }
    class Proposition {
        <<Theory-Element>>
        +EpistemicStatus status
        +ScopeType scope
        +Float activation
    }

    Node <|-- CoreEntity
    Node <|-- Proposition

    %% Proposition Subtypes
    Proposition <|-- ObservationUnit : Beobachtungssatz
    Proposition <|-- EmpiricalStatement : Empirischer Satz
    Proposition <|-- TheoreticalHypothesis : Theoretischer Satz
    Proposition <|-- CoreExpansion : Mutable Expansion

    %% Enumerations for Attributes
    class ScopeType {
        <<enumeration>>
        Essentieller_Allsatz
        Existenzsatz
        Statistischer_Allsatz
        Lokalisierter_Existenzsatz
        Lokalisierter_Allsatz
    }

    class EpistemicStatus {
        <<enumeration>>
        Synthetisch
        Analytisch
    }

    Proposition ..> ScopeType : uses
    Proposition ..> EpistemicStatus : uses

2. Intra-Theory Topology (Theory-Net)

This graph illustrates how propositions interact within a single theory-element. It organizes the theoretical hierarchy into three epistemological tiers (from abstract theoretical core down to empirical observations), demonstrating structuralist specialization, logical deduction, and Thagard's explanatory coherence.

graph TB
    %% --- TIER 1: THEORETICAL CORE & LAWS ---
    subgraph TheoreticalTier ["Tier 1: Theoretical Core & Framework (M_p, M)"]
        direction LR
        RootCore["<b>Fundamental Core (T₀)</b><br/><i>Theoretischer Satz i.w.S.</i>"]
        SpecHyp["<b>Specialized Law (T₁)</b><br/><i>Theoretischer Satz i.w.S.</i>"]
        Expansion["<b>Core Expansion (C, CL)</b><br/><i>Mutable Auxiliary Law</i>"]

        RootCore -->|"SPECIALIZES (α)"| SpecHyp
        SpecHyp <-->|"CONSTRAINS"| Expansion
    end

    %% --- TIER 2: EMPIRICAL CLAIMS & HYPOTHESES ---
    subgraph EmpiricalTier ["Tier 2: Empirical Claims & Hypotheses"]
        direction LR
        Emp1["<b>Derived Empirical Claim (H₁)</b><br/><i>Empirischer Satz i.e.S.</i>"]
        Emp2["<b>Competing Hypothesis (H₂)</b><br/><i>Empirischer Satz i.e.S.</i>"]

        Emp2 <-.->|"INHIBITS (R_att)<br/>Incoherence / Conflict"| Emp1
    end

    %% --- TIER 3: OBSERVATIONAL GROUND ---
    subgraph ObservationalTier ["Tier 3: Observational Ground & Intended Applications (M_pp, I)"]
        direction LR
        Obs1["<b>Localized Observation (E₁)</b><br/><i>Beobachtungssatz (Data Priority = 1)</i>"]
        Obs2["<b>Falsifying Evidence (E₂)</b><br/><i>Beobachtungssatz</i>"]
    end

    %% Cross-Tier Deduction
    SpecHyp -->|"DEDUCES<br/>(Erklärungsschema)"| Emp1

    %% Coherence & Argumentation
    Emp1 <-->|"COHERES_WITH (R_supp)<br/>Explanatory Support"| Obs1
    Obs1 -->|"SUPPORTS_ARG"| Emp1

    %% Anomaly / Falsification Flow
    Obs2 -->|"ATTACKS / REFUTES"| Emp1
    Obs2 -.->|"Triggers Revision / Anomaly"| Expansion

    %% Visual Styling
    classDef theoretical fill:#eef2ff,stroke:#4f46e5,stroke-width:2px,color:#1e1b4b;
    classDef expansion fill:#fffbeb,stroke:#d97706,stroke-width:2px,stroke-dasharray: 4 4,color:#78350f;
    classDef empirical fill:#f0f9ff,stroke:#0284c7,stroke-width:2px,color:#0c4a6e;
    classDef observation fill:#ecfdf5,stroke:#059669,stroke-width:2px,color:#064e3b;
    classDef anomaly fill:#fef2f2,stroke:#dc2626,stroke-width:2px,color:#7f1d1d;

    class RootCore,SpecHyp theoretical;
    class Expansion expansion;
    class Emp1,Emp2 empirical;
    class Obs1 observation;
    class Obs2 anomaly;

Entity Types (Nodes)

Core Entity Classes

The schema defines several core entity types that can appear in the theory graph to represent real-world concepts and actors.

Entity Type Description
Concept Theoretical constructs and abstract ideas.
Person Individuals who contribute to theoretical development.
Work Publications, papers, and other scholarly works.
Theory Formal theoretical frameworks and schools of thought.
Institution Organizations and academic institutions.

Theory-Elements and Propositions

Based on structuralist epistemology, nodes represent specific propositions and theoretical elements within the knowledge structure.

Type Description
ObservationUnit (Beobachtungssatz i.e.S.) Singular or localized statements containing exclusively observational terms. Act as raw data nodes.
EmpiricalStatement (Empirischer Satz i.e.S.) Statements containing only logical and empirical concepts.
TheoreticalHypothesis (Theoretischer Satz i.w.S.) Statements containing theoretical concepts or whose quantifiers have theoretical scope. These represent core laws or abstract hypotheses.
CoreExpansion Special auxiliary laws and constraints that form a shifting superstructure around the stable theory core.

Proposition Attributes (Epistemic & Scope)

Propositions can be further classified by their structuralist properties:

  • Epistemic Status: Synthetisch vs. Analytisch.
  • Scope / Type: Essentieller Allsatz, Existenzsatz, Statistischer/probabilistischer Allsatz, Lokalisierter Existenzsatz, Lokalisierter Allsatz.

Relationship Types (Edges)

Semantic Relationships

Basic ontological connections between entities.

Relationship Description
RELATED_TO General associative relationship between entities.
INSTANCE_OF Instance membership in a category or class.
PART_OF Compositional relationship indicating containment.
SUBCLASS_OF Taxonomic specialization relationship.

Theoretical Relationships

Logical interactions between propositions.

Relationship Description
SUPPORTS Indicates evidential or logical support.
REFUTES Indicates contradiction or refutation.
IMPLIES Indicates logical implication.
CONTRADICTS Indicates direct theoretical opposition.

Argument Relationships

Dialectical interactions between components.

Relationship Description
ATTACKS Argument component attacks another (critical relationship).
SUPPORTS_ARG Argument component provides support for another.
UNDERCUTS Argument component undermines the inference of another.

Structuralist and Coherence Relationships

Advanced relationships mapping to structuralist models and Thagard's explanatory coherence.

Relationship Formal Description
SPECIALIZES \(\alpha\) Directed vertical edges forming a hierarchy where a specialized node inherits and restricts properties from its parent.
CONSTRAINS \(C, CL\) Lateral/horizontal edges crossing overlapping applications to ensure intrinsic properties remain constant.
REDUCES_TO / ENTAILS Intertheoretical links connecting entirely separate theories, including strict reduction from older to newer theories.
DEDUCES Logical entailments between nodes such as Explanation Patterns (Erklärungsschema) and Falsification Patterns (Falsifikationsschema).
COHERES_WITH \(\mathcal{R}_{sup}\) Positive (excitatory) connections between hypotheses that explain evidence, or co-hypotheses that jointly explain a fact.
INHIBITS \(\mathcal{R}_{att}\) Negative (inhibitory) weights representing incoherence between logically contradictory or competing hypotheses.

Quality Attributes

Nodes and edges in the graph encapsulate metadata ensuring traceability and confidence.

  • Confidence: Measure of extraction certainty for entities and relationships.
  • Evidence: Supporting text snippets and source references.
  • Provenance: Tracking of origin and processing history.
  • Activation (Acceptability): A continuous value (ranging between -1 and 1) representing the final acceptance or rejection of an individual proposition after coherence network relaxation.

Schema Validation & Extension

Schema Validation

Rules and constraints enforced on graph construction to ensure data integrity:

  • Type Compatibility: Restrictions on which entity types can participate in relationships.
  • Cardinality Constraints: Limits on the number of relationships of each type per entity.
  • Uniqueness Requirements: Guarantees about identifier uniqueness and entity distinctness.

Extension Mechanisms

Mechanisms for adding new entity and relationship types to the schema:

  • Custom Types: Defining domain-specific categories and their properties.
  • Inheritance Hierarchies: Creating taxonomies of theoretical concepts.
  • Relationship Constraints: Specifying domain and range restrictions for new relationships.