Here’s a clean, working knowledge graph for the whole Logos system—language units → lawful neologisms → legal/industry pragmatics—delivered in two formats:


  • JSON-LD (machine-readable, import into graph DBs, OntoText, Neo4j via n10s, Stardog, etc.)
    Download JSON-LD
{
  "@context": {
    "@vocab": "https://example.org/logos#",
    "schema": "https://schema.org/",
    "name": "schema:name",
    "description": "schema:description",
    "inLanguage": "schema:inLanguage",
    "url": "schema:url",
    "created": "schema:dateCreated",
    "modified": "schema:dateModified",
    "label": "schema:alternateName",
    "type": "@type",
    "id": "@id",
    "composedOf": {
      "@type": "@id"
    },
    "hasMorpheme": {
      "@type": "@id"
    },
    "hasEtymon": {
      "@type": "@id"
    },
    "spelledBy": {
      "@type": "@id"
    },
    "definedIn": {
      "@type": "@id"
    },
    "recursesTo": {
      "@type": "@id"
    },
    "hasSemanticField": {
      "@type": "@id"
    },
    "usedInDomain": {
      "@type": "@id"
    },
    "contrastsWith": {
      "@type": "@id"
    },
    "synonymOf": {
      "@type": "@id"
    },
    "antonymOf": {
      "@type": "@id"
    },
    "governs": {
      "@type": "@id"
    },
    "references": {
      "@type": "@id"
    },
    "implements": {
      "@type": "@id"
    },
    "derivesFrom": {
      "@type": "@id"
    },
    "hasGloss": "schema:disambiguatingDescription",
    "example": "schema:exampleOfWork",
    "rule": "schema:variableMeasured"
  },
  "@graph": [
    {
      "id": "https://example.org/id/LinguisticUnit",
      "type": "rdfs:Class",
      "name": "LinguisticUnit",
      "description": "Class of all language units."
    },
    {
      "id": "https://example.org/id/Grapheme",
      "type": "rdfs:Class",
      "name": "Grapheme",
      "description": "Smallest visual unit (letter/glyph). Subclass of LinguisticUnit."
    },
    {
      "id": "https://example.org/id/Phoneme",
      "type": "rdfs:Class",
      "name": "Phoneme",
      "description": "Smallest sound unit. Subclass of LinguisticUnit."
    },
    {
      "id": "https://example.org/id/Morpheme",
      "type": "rdfs:Class",
      "name": "Morpheme",
      "description": "Smallest meaningful unit. Subclass of LinguisticUnit."
    },
    {
      "id": "https://example.org/id/Etymon",
      "type": "rdfs:Class",
      "name": "Etymon",
      "description": "Historical lexical root from which words derive."
    },
    {
      "id": "https://example.org/id/Lexeme",
      "type": "rdfs:Class",
      "name": "Lexeme",
      "description": "Abstract vocabulary item (word sense family)."
    },
    {
      "id": "https://example.org/id/Word",
      "type": "rdfs:Class",
      "name": "Word",
      "description": "Concrete written form tied to a lexeme."
    },
    {
      "id": "https://example.org/id/Neologism",
      "type": "rdfs:Class",
      "name": "Neologism",
      "description": "Newly coined lexeme created via morphemic composition and etiquette."
    },
    {
      "id": "https://example.org/id/SemanticField",
      "type": "rdfs:Class",
      "name": "SemanticField",
      "description": "Cluster of related meanings (conceptual domain)."
    },
    {
      "id": "https://example.org/id/PragmaticDomain",
      "type": "rdfs:Class",
      "name": "PragmaticDomain",
      "description": "Use-context for meaning (industry, legal, social)."
    },
    {
      "id": "https://example.org/id/RecursiveRule",
      "type": "rdfs:Class",
      "name": "RecursiveRule",
      "description": "Constraint/rule that must recurse through definitions for validity."
    },
    {
      "id": "https://example.org/id/Predicate",
      "type": "rdfs:Class",
      "name": "Predicate",
      "description": "Intent/function that forecasts a lexical gap (predictive semantics)."
    },
    {
      "id": "https://example.org/id/Polarity",
      "type": "rdfs:Class",
      "name": "Polarity",
      "description": "Oppositional pairing (e.g., reasonable/unreasonable)."
    },
    {
      "id": "https://example.org/id/CodexEntry",
      "type": "rdfs:Class",
      "name": "CodexEntry",
      "description": "Canonical, versioned entry in the Logos Codex."
    },
    {
      "id": "https://example.org/id/InterpretationFrame",
      "type": "rdfs:Class",
      "name": "InterpretationFrame",
      "description": "Contextual frame for applying/deriving meaning across time."
    },
    {
      "id": "https://example.org/id/LegalContract",
      "type": "rdfs:Class",
      "name": "LegalContract",
      "description": "Recursive linguistic instrument with closed definitions."
    },
    {
      "id": "https://example.org/id/Clause",
      "type": "rdfs:Class",
      "name": "Clause",
      "description": "Syntactic unit in a contract with operational effect."
    },
    {
      "id": "https://example.org/id/Definition",
      "type": "rdfs:Class",
      "name": "Definition",
      "description": "Explicit meaning of a term in a given codex/document."
    },
    {
      "id": "https://example.org/id/ComprehensionAsStructure",
      "type": "https://example.org/id/RecursiveRule",
      "name": "Comprehension as Structural Principle",
      "description": "Meaning must be structurally recoverable from units \u2192 morphemes \u2192 etymon \u2192 lexeme \u2192 semantics \u2192 pragmatics.",
      "rule": "A term is admissible only if each level recurses without ambiguity.",
      "created": "2025-08-21"
    },
    {
      "id": "https://example.org/id/EtymologicalEtiquette",
      "type": "https://example.org/id/RecursiveRule",
      "name": "Etymological Etiquette",
      "description": "Coin a term only when its morphemes justify the sense and can recurse to a verifiable etymon.",
      "rule": "New lexemes must be transparently compositional (no orphan morphemes).",
      "created": "2025-08-21"
    },
    {
      "id": "https://example.org/id/PredictivePredicate",
      "type": "https://example.org/id/Predicate",
      "name": "Predictive Predicate",
      "description": "A functional intention that forecasts gaps and proposes morphologically lawful candidates.",
      "created": "2025-08-21"
    },
    {
      "id": "https://example.org/id/PrecedentAsEtymologicalMemory",
      "type": "https://example.org/id/InterpretationFrame",
      "name": "Precedent as Etymological Memory",
      "description": "Prior decisions act as the etymology of rulings; interpretation must recurse to origin and function.",
      "created": "2025-08-21"
    },
    {
      "id": "https://example.org/id/Broadband",
      "type": "https://example.org/id/PragmaticDomain",
      "name": "Broadband",
      "description": "Connectivity services and networks"
    },
    {
      "id": "https://example.org/id/IoT",
      "type": "https://example.org/id/PragmaticDomain",
      "name": "IoT",
      "description": "Connected devices and telemetry"
    },
    {
      "id": "https://example.org/id/Cloud",
      "type": "https://example.org/id/PragmaticDomain",
      "name": "Cloud",
      "description": "Compute, storage, orchestration across edges and hyperscalers"
    },
    {
      "id": "https://example.org/id/Cybersecurity",
      "type": "https://example.org/id/PragmaticDomain",
      "name": "Cybersecurity",
      "description": "Threat detection, Zero Trust, governance, MDR"
    },
    {
      "id": "https://example.org/id/AI",
      "type": "https://example.org/id/PragmaticDomain",
      "name": "AI",
      "description": "Predictive, linguistic, orchestration systems"
    },
    {
      "id": "https://example.org/id/CircularEconomy",
      "type": "https://example.org/id/PragmaticDomain",
      "name": "CircularEconomy",
      "description": "Traceability, lifecycle, closed-loop systems"
    },
    {
      "id": "https://example.org/id/morpheme/chrono",
      "type": "https://example.org/id/Morpheme",
      "name": "chrono",
      "hasGloss": "time",
      "hasEtymon": "https://example.org/id/Etymon"
    },
    {
      "id": "https://example.org/id/morpheme/nomics",
      "type": "https://example.org/id/Morpheme",
      "name": "nomics",
      "hasGloss": "governance/systemic ordering",
      "hasEtymon": "https://example.org/id/Etymon"
    },
    {
      "id": "https://example.org/id/morpheme/symbio",
      "type": "https://example.org/id/Morpheme",
      "name": "symbio",
      "hasGloss": "living together, mutualism",
      "hasEtymon": "https://example.org/id/Etymon"
    },
    {
      "id": "https://example.org/id/morpheme/glyph",
      "type": "https://example.org/id/Morpheme",
      "name": "glyph",
      "hasGloss": "carved figure, symbol; writing sign",
      "hasEtymon": "https://example.org/id/Etymon"
    },
    {
      "id": "https://example.org/id/morpheme/neuro",
      "type": "https://example.org/id/Morpheme",
      "name": "neuro",
      "hasGloss": "nerve, the nervous system",
      "hasEtymon": "https://example.org/id/Etymon"
    },
    {
      "id": "https://example.org/id/morpheme/pragmatics",
      "type": "https://example.org/id/Morpheme",
      "name": "pragmatics",
      "hasGloss": "contextual language use; action-guided meaning",
      "hasEtymon": "https://example.org/id/Etymon"
    },
    {
      "id": "https://example.org/id/Etymon",
      "type": "https://example.org/id/Etymon",
      "name": "Etymon",
      "description": "Historical root that anchors morphemes to their origin meanings."
    },
    {
      "id": "https://example.org/id/neologism/Chrononomics",
      "type": [
        "https://example.org/id/Lexeme",
        "https://example.org/id/Neologism"
      ],
      "name": "Chrononomics",
      "inLanguage": "en",
      "description": "Logic of time-regulated systems; study of system behavior under temporal governance.",
      "hasMorpheme": [
        "https://example.org/id/morpheme/chrono",
        "https://example.org/id/morpheme/nomics"
      ],
      "spelledBy": "https://example.org/id/EtymologicalEtiquette",
      "recursesTo": "https://example.org/id/ComprehensionAsStructure",
      "hasSemanticField": "https://example.org/id/SemanticSystemics",
      "usedInDomain": [
        "https://example.org/id/AI",
        "https://example.org/id/Cloud"
      ]
    },
    {
      "id": "https://example.org/id/neologism/Symbioglyph",
      "type": [
        "https://example.org/id/Lexeme",
        "https://example.org/id/Neologism"
      ],
      "name": "Symbioglyph",
      "inLanguage": "en",
      "description": "A symbol that evolves through mutual interpretation among agents (human\u2013AI\u2013institutional).",
      "hasMorpheme": [
        "https://example.org/id/morpheme/symbio",
        "https://example.org/id/morpheme/glyph"
      ],
      "spelledBy": "https://example.org/id/EtymologicalEtiquette",
      "recursesTo": "https://example.org/id/ComprehensionAsStructure",
      "hasSemanticField": "https://example.org/id/SemanticSystemics",
      "usedInDomain": [
        "https://example.org/id/AI",
        "https://example.org/id/Cybersecurity"
      ]
    },
    {
      "id": "https://example.org/id/neologism/Neuropragmatics",
      "type": [
        "https://example.org/id/Lexeme",
        "https://example.org/id/Neologism"
      ],
      "name": "Neuropragmatics",
      "inLanguage": "en",
      "description": "How brain processes shape contextual language use and policy/operational intent.",
      "hasMorpheme": [
        "https://example.org/id/morpheme/neuro",
        "https://example.org/id/morpheme/pragmatics"
      ],
      "spelledBy": "https://example.org/id/EtymologicalEtiquette",
      "recursesTo": "https://example.org/id/ComprehensionAsStructure",
      "hasSemanticField": "https://example.org/id/SemanticSystemics",
      "usedInDomain": [
        "https://example.org/id/AI",
        "https://example.org/id/AI",
        "https://example.org/id/Cybersecurity"
      ]
    },
    {
      "id": "https://example.org/id/SemanticSystemics",
      "type": "https://example.org/id/SemanticField",
      "name": "Systemics",
      "description": "Interlinked study of structure, function, process, and governance of systems."
    },
    {
      "id": "https://example.org/id/RecursiveContractTemplate",
      "type": "https://example.org/id/LegalContract",
      "name": "Recursive Contract (Template)",
      "description": "Self-verifying agreement: all terms defined in-document; clauses recurse to definitions; polarity scoped.",
      "definedIn": "https://example.org/id/Codex/Contracts/Recursive",
      "recursesTo": "https://example.org/id/ComprehensionAsStructure",
      "references": "https://example.org/id/PrecedentAsEtymologicalMemory",
      "implements": "https://example.org/id/EtymologicalEtiquette",
      "usedInDomain": [
        "https://example.org/id/Cloud",
        "https://example.org/id/Cybersecurity",
        "https://example.org/id/AI"
      ]
    },
    {
      "id": "https://example.org/id/Clause/Definitions",
      "type": "https://example.org/id/Clause",
      "name": "Definitions",
      "description": "Every operative term is explicitly defined; no orphan variables.",
      "governs": "https://example.org/id/RecursiveContractTemplate"
    },
    {
      "id": "https://example.org/id/Clause/Polarity",
      "type": "https://example.org/id/Clause",
      "name": "Polarity Symmetry",
      "description": "Where 'reasonable' is operative, 'unreasonable' is bounded by explicit neg-conditions.",
      "governs": "https://example.org/id/RecursiveContractTemplate",
      "typeNote": "Ensures antonym/antonym scoping to prevent semantic drift."
    },
    {
      "id": "https://example.org/id/Clause/Recursion",
      "type": "https://example.org/id/Clause",
      "name": "Recursive Reference",
      "description": "Each clause that references another section must be resolvable in finite steps to a definition.",
      "governs": "https://example.org/id/RecursiveContractTemplate"
    },
    {
      "id": "https://example.org/id/Definition/Reasonable",
      "type": "https://example.org/id/Definition",
      "name": "Definition: Reasonable",
      "description": "Bounded by enumerated factors (time, risk, cost, industry practice).",
      "antonymOf": "https://example.org/id/Definition/Unreasonable",
      "definedIn": "https://example.org/id/RecursiveContractTemplate"
    },
    {
      "id": "https://example.org/id/Definition/Unreasonable",
      "type": "https://example.org/id/Definition",
      "name": "Definition: Unreasonable",
      "description": "Occurs when thresholds in the Reasonable definition are exceeded.",
      "synonymOf": "https://example.org/id/Definition/NotReasonable",
      "definedIn": "https://example.org/id/RecursiveContractTemplate"
    },
    {
      "id": "https://example.org/id/Codex",
      "type": "https://example.org/id/CodexEntry",
      "name": "Logos Codex",
      "description": "Canon of recursively defined terms, rules, and templates."
    },
    {
      "id": "https://example.org/id/Codex/Neologisms",
      "type": "https://example.org/id/CodexEntry",
      "name": "Neologism Directory",
      "description": "Versioned registry of lawful neologisms with decomposition, semantics, pragmatics.",
      "references": [
        "https://example.org/id/EtymologicalEtiquette",
        "https://example.org/id/ComprehensionAsStructure"
      ]
    },
    {
      "id": "https://example.org/id/Codex/Contracts/Recursive",
      "type": "https://example.org/id/CodexEntry",
      "name": "Recursive Contracts",
      "description": "Templates + validation rules for self-verifying agreements.",
      "references": [
        "https://example.org/id/ComprehensionAsStructure",
        "https://example.org/id/PrecedentAsEtymologicalMemory"
      ]
    }
  ],
  "generated": "2025-08-21"
}
  • Graphviz DOT (quick visualization / convertible to PNG/SVG)
    Download DOT
digraph LogosKG {
  rankdir=LR;
  node [shape=rect, style=rounded, fontsize=10];
  subgraph cluster_0 { label="Language Spine"; color="#999999";
    Grapheme->Phoneme->Morpheme->Etymon->Lexeme->Neologism->SemanticField->PragmaticDomain;
  }
  "Comprehension as Structural Principle" [shape=oval,style=filled,fillcolor="#eef7ff"];
  "Etymological Etiquette" [shape=oval,style=filled,fillcolor="#eef7ff"];
  "Predictive Predicate" [shape=oval,style=filled,fillcolor="#eef7ff"];
  "Precedent as Etymological Memory" [shape=oval,style=filled,fillcolor="#fff7ee"];
  "Recursive Contract (Template)" [shape=rect,style=filled,fillcolor="#f4fff0"];
  "Neologism Directory" [shape=folder,style=filled,fillcolor="#f9f9f9"];
  "Chrononomics" [shape=box];
  "Symbioglyph" [shape=box];
  "Neuropragmatics" [shape=box];
  "Comprehension as Structural Principle" -> "Neologism Directory";
  "Etymological Etiquette" -> "Neologism Directory";
  "Etymological Etiquette" -> "Chrononomics";
  "Etymological Etiquette" -> "Symbioglyph";
  "Etymological Etiquette" -> "Neuropragmatics";
  "Chrononomics" -> "AI";
  "Chrononomics" -> "Cloud";
  "Symbioglyph" -> "AI";
  "Symbioglyph" -> "Cybersecurity";
  "Neuropragmatics" -> "AI";
  "Recursive Contract (Template)" -> "Comprehension as Structural Principle";
  "Recursive Contract (Template)" -> "Precedent as Etymological Memory";
  "Recursive Contract (Template)" -> "Definitions";
  "Definitions" -> "Reasonable";
  "Reasonable" -> "Unreasonable" [label="antonym"];
  Broadband [shape=component]; IoT [shape=component]; Cloud [shape=component]; Cybersecurity [shape=component]; AI [shape=component]; "CircularEconomy" [shape=component,label="Circular Economy"];
}

What’s inside the graph

1) Ontology spine (classes)

  • GraphemePhonemeMorphemeEtymonLexeme/NeologismSemanticFieldPragmaticDomain
  • Legal/interpretive layer: RecursiveRule, Predicate, LegalContract, Clause, Definition, InterpretationFrame, CodexEntry.

2) Governing principles (as nodes)

  • Comprehension as Structural Principle — meaning must be recoverable from units → morphemes → etymon → lexeme → semantics → pragmatics.
  • Etymological Etiquette — coin only when morphemes justify the sense and recurse to an etymon.
  • Predictive Predicate — forecasts lexical gaps and proposes morphologically lawful candidates.
  • Precedent as Etymological Memory — prior rulings = the etymology of judgments.

3) Industry / pragmatics domains (the “where” words live)

  • Broadband, IoT, Cloud, Cybersecurity, AI, CircularEconomy.

4) Language units & morpheme inventory (excerpts)

  • chrono (time), nomics (systemic ordering), symbio (living-together), glyph (symbol), neuro (nerve), pragmatics (contextual use).

5) Neologisms (instantiated with decomposition & domains)

  • Chrononomics = chrono + nomics → “time-regulated systems”; used in AI, Cloud.
  • Symbioglyph = symbio + glyph → “a symbol that evolves via mutual interpretation”; used in AI, Cybersecurity.
  • Neuropragmatics = neuro + pragmatics → “how brain processes shape contextual use”; linked to AI (and by extension healthcare/cyber).

All three are spelled by Etymological Etiquette and recurse to Comprehension as Structural Principle.

6) Legal layer (recursive contracts)

  • Recursive Contract (Template) → requires:
    • Clause/Definitions (no orphan variables; all terms defined in-document)
    • Clause/Polarity (antonym scoping: reasonableunreasonable)
    • Clause/Recursion (cross-refs must resolve in finite steps to a definition)
  • The template references Precedent as Etymological Memory and recurses to the comprehension rule.

7) Codex and registries

  • Logos Codex (root)
  • Codex/Neologisms (directory; governed by Etiquette + Comprehension)
  • Codex/Contracts/Recursive (templates + validation rules)

How to use it

  • Load the JSON-LD into your triple store / graph DB; it already includes IDs and relationships like hasMorpheme, hasEtymon, usedInDomain, spelledBy, recursesTo, definedIn, governs, antonymOf, references.
  • Extend by adding new morphemes/lexemes: just add nodes with hasMorpheme + spelledBy: EtymologicalEtiquette + recursesTo: ComprehensionAsStructure.
  • Attach legal meaning by adding Definition nodes and linking contracts/clauses using definedIn, governs, recursesTo.

# Build a JSON-LD knowledge graph for the Logos system (language → neologism → law/industry)
import json, textwrap, os, datetime

context = {
    "@vocab": "https://example.org/logos#",
    "schema": "https://schema.org/",
    "name": "schema:name",
    "description": "schema:description",
    "inLanguage": "schema:inLanguage",
    "url": "schema:url",
    "created": "schema:dateCreated",
    "modified": "schema:dateModified",
    "label": "schema:alternateName",

    # core relations
    "type": "@type",
    "id": "@id",
    "composedOf": {"@type": "@id"},
    "hasMorpheme": {"@type": "@id"},
    "hasEtymon": {"@type": "@id"},
    "spelledBy": {"@type": "@id"},
    "definedIn": {"@type": "@id"},
    "recursesTo": {"@type": "@id"},
    "hasSemanticField": {"@type": "@id"},
    "usedInDomain": {"@type": "@id"},
    "contrastsWith": {"@type": "@id"},
    "synonymOf": {"@type": "@id"},
    "antonymOf": {"@type": "@id"},
    "governs": {"@type": "@id"},
    "references": {"@type": "@id"},
    "implements": {"@type": "@id"},
    "derivesFrom": {"@type": "@id"},
    "hasGloss": "schema:disambiguatingDescription",
    "example": "schema:exampleOfWork",
    "rule": "schema:variableMeasured"
}

today = datetime.date.today().isoformat()
base = "https://example.org/id/"

nodes = []

# ===== Ontology (classes) =====
classes = [
    ("LinguisticUnit", "Class of all language units."),
    ("Grapheme", "Smallest visual unit (letter/glyph). Subclass of LinguisticUnit."),
    ("Phoneme", "Smallest sound unit. Subclass of LinguisticUnit."),
    ("Morpheme", "Smallest meaningful unit. Subclass of LinguisticUnit."),
    ("Etymon", "Historical lexical root from which words derive."),
    ("Lexeme", "Abstract vocabulary item (word sense family)."),
    ("Word", "Concrete written form tied to a lexeme."),
    ("Neologism", "Newly coined lexeme created via morphemic composition and etiquette."),
    ("SemanticField", "Cluster of related meanings (conceptual domain)."),
    ("PragmaticDomain", "Use-context for meaning (industry, legal, social)."),
    ("RecursiveRule", "Constraint/rule that must recurse through definitions for validity."),
    ("Predicate", "Intent/function that forecasts a lexical gap (predictive semantics)."),
    ("Polarity", "Oppositional pairing (e.g., reasonable/unreasonable)."),
    ("CodexEntry", "Canonical, versioned entry in the Logos Codex."),
    ("InterpretationFrame", "Contextual frame for applying/deriving meaning across time."),
    ("LegalContract", "Recursive linguistic instrument with closed definitions."),
    ("Clause", "Syntactic unit in a contract with operational effect."),
    ("Definition", "Explicit meaning of a term in a given codex/document."),
]
for c, desc in classes:
    nodes.append({
        "id": base + c,
        "type": "rdfs:Class",
        "name": c,
        "description": desc,
    })

# ===== Core Rules / Principles =====
nodes += [
    {
        "id": base + "ComprehensionAsStructure",
        "type": base + "RecursiveRule",
        "name": "Comprehension as Structural Principle",
        "description": "Meaning must be structurally recoverable from units → morphemes → etymon → lexeme → semantics → pragmatics.",
        "rule": "A term is admissible only if each level recurses without ambiguity.",
        "created": today
    },
    {
        "id": base + "EtymologicalEtiquette",
        "type": base + "RecursiveRule",
        "name": "Etymological Etiquette",
        "description": "Coin a term only when its morphemes justify the sense and can recurse to a verifiable etymon.",
        "rule": "New lexemes must be transparently compositional (no orphan morphemes).",
        "created": today
    },
    {
        "id": base + "PredictivePredicate",
        "type": base + "Predicate",
        "name": "Predictive Predicate",
        "description": "A functional intention that forecasts gaps and proposes morphologically lawful candidates.",
        "created": today
    },
    {
        "id": base + "PrecedentAsEtymologicalMemory",
        "type": base + "InterpretationFrame",
        "name": "Precedent as Etymological Memory",
        "description": "Prior decisions act as the etymology of rulings; interpretation must recurse to origin and function.",
        "created": today
    }
]

# ===== Industry / Pragmatics Domains (six pillars as domains) =====
domains = [
    ("Broadband", "Connectivity services and networks"),
    ("IoT", "Connected devices and telemetry"),
    ("Cloud", "Compute, storage, orchestration across edges and hyperscalers"),
    ("Cybersecurity", "Threat detection, Zero Trust, governance, MDR"),
    ("AI", "Predictive, linguistic, orchestration systems"),
    ("CircularEconomy", "Traceability, lifecycle, closed-loop systems")
]
for slug, desc in domains:
    nodes.append({
        "id": base + slug,
        "type": base + "PragmaticDomain",
        "name": slug,
        "description": desc
    })

# ===== Language units (exemplars) =====
# Morphemes
morphemes = [
    ("chrono", "time"),
    ("nomics", "governance/systemic ordering"),
    ("symbio", "living together, mutualism"),
    ("glyph", "carved figure, symbol; writing sign"),
    ("neuro", "nerve, the nervous system"),
    ("pragmatics", "contextual language use; action-guided meaning")
]
for m, gloss in morphemes:
    nodes.append({
        "id": base + f"morpheme/{m}",
        "type": base + "Morpheme",
        "name": m,
        "hasGloss": gloss,
        "hasEtymon": base + "Etymon"
    })

# Etymon (generic node to anchor etymology references)
nodes.append({
    "id": base + "Etymon",
    "type": base + "Etymon",
    "name": "Etymon",
    "description": "Historical root that anchors morphemes to their origin meanings."
})

# ===== Neologisms (examples) =====
neologisms = [
    ("Chrononomics", ["chrono", "nomics"],
     "Logic of time-regulated systems; study of system behavior under temporal governance.",
     ["AI", "Cloud"]),
    ("Symbioglyph", ["symbio", "glyph"],
     "A symbol that evolves through mutual interpretation among agents (human–AI–institutional).",
     ["AI", "Cybersecurity"]),
    ("Neuropragmatics", ["neuro", "pragmatics"],
     "How brain processes shape contextual language use and policy/operational intent.",
     ["AI", "Healthcare", "Cybersecurity"])
]

for label, mor_list, desc, used_in in neologisms:
    neoid = base + "neologism/" + label
    nodes.append({
        "id": neoid,
        "type": [base + "Lexeme", base + "Neologism"],
        "name": label,
        "inLanguage": "en",
        "description": desc,
        "hasMorpheme": [base + f"morpheme/{m}" for m in mor_list],
        "spelledBy": base + "EtymologicalEtiquette",
        "recursesTo": base + "ComprehensionAsStructure",
        "hasSemanticField": base + "SemanticSystemics",
        "usedInDomain": [base + d if d in dict(domains) else base + "AI" for d in used_in]
    })

# semantic field node used above
nodes.append({
    "id": base + "SemanticSystemics",
    "type": base + "SemanticField",
    "name": "Systemics",
    "description": "Interlinked study of structure, function, process, and governance of systems."
})

# ===== Legal model (recursive contract) =====
nodes += [
    {
        "id": base + "RecursiveContractTemplate",
        "type": base + "LegalContract",
        "name": "Recursive Contract (Template)",
        "description": "Self-verifying agreement: all terms defined in-document; clauses recurse to definitions; polarity scoped.",
        "definedIn": base + "Codex/Contracts/Recursive",
        "recursesTo": base + "ComprehensionAsStructure",
        "references": base + "PrecedentAsEtymologicalMemory",
        "implements": base + "EtymologicalEtiquette",
        "usedInDomain": [base + "Cloud", base + "Cybersecurity", base + "AI"]
    },
    {
        "id": base + "Clause/Definitions",
        "type": base + "Clause",
        "name": "Definitions",
        "description": "Every operative term is explicitly defined; no orphan variables.",
        "governs": base + "RecursiveContractTemplate"
    },
    {
        "id": base + "Clause/Polarity",
        "type": base + "Clause",
        "name": "Polarity Symmetry",
        "description": "Where 'reasonable' is operative, 'unreasonable' is bounded by explicit neg-conditions.",
        "governs": base + "RecursiveContractTemplate",
        "typeNote": "Ensures antonym/antonym scoping to prevent semantic drift."
    },
    {
        "id": base + "Clause/Recursion",
        "type": base + "Clause",
        "name": "Recursive Reference",
        "description": "Each clause that references another section must be resolvable in finite steps to a definition.",
        "governs": base + "RecursiveContractTemplate"
    }
]

# ===== Link legal semantics to language =====
nodes += [
    {
        "id": base + "Definition/Reasonable",
        "type": base + "Definition",
        "name": "Definition: Reasonable",
        "description": "Bounded by enumerated factors (time, risk, cost, industry practice).",
        "antonymOf": base + "Definition/Unreasonable",
        "definedIn": base + "RecursiveContractTemplate"
    },
    {
        "id": base + "Definition/Unreasonable",
        "type": base + "Definition",
        "name": "Definition: Unreasonable",
        "description": "Occurs when thresholds in the Reasonable definition are exceeded.",
        "synonymOf": base + "Definition/NotReasonable",
        "definedIn": base + "RecursiveContractTemplate"
    }
]

# ===== Knowledge Ops (Codex, entries) =====
nodes += [
    {
        "id": base + "Codex",
        "type": base + "CodexEntry",
        "name": "Logos Codex",
        "description": "Canon of recursively defined terms, rules, and templates."
    },
    {
        "id": base + "Codex/Neologisms",
        "type": base + "CodexEntry",
        "name": "Neologism Directory",
        "description": "Versioned registry of lawful neologisms with decomposition, semantics, pragmatics.",
        "references": [base + "EtymologicalEtiquette", base + "ComprehensionAsStructure"]
    },
    {
        "id": base + "Codex/Contracts/Recursive",
        "type": base + "CodexEntry",
        "name": "Recursive Contracts",
        "description": "Templates + validation rules for self-verifying agreements.",
        "references": [base + "ComprehensionAsStructure", base + "PrecedentAsEtymologicalMemory"]
    }
]

graph = {
    "@context": context,
    "@graph": nodes,
    "generated": today
}

jsonld_path = "/mnt/data/logos_knowledge_graph.jsonld"
with open(jsonld_path, "w") as f:
    json.dump(graph, f, indent=2)

# Also emit a Graphviz DOT for quick visualization of the main spine
dot_lines = [
    'digraph LogosKG {',
    '  rankdir=LR;',
    '  node [shape=rect, style=rounded, fontsize=10];',
    '  subgraph cluster_0 { label="Language Spine"; color="#999999";',
    '    Grapheme->Phoneme->Morpheme->Etymon->Lexeme->Neologism->SemanticField->PragmaticDomain;',
    '  }',
    '  "Comprehension as Structural Principle" [shape=oval,style=filled,fillcolor="#eef7ff"];',
    '  "Etymological Etiquette" [shape=oval,style=filled,fillcolor="#eef7ff"];',
    '  "Predictive Predicate" [shape=oval,style=filled,fillcolor="#eef7ff"];',
    '  "Precedent as Etymological Memory" [shape=oval,style=filled,fillcolor="#fff7ee"];',
    '  "Recursive Contract (Template)" [shape=rect,style=filled,fillcolor="#f4fff0"];',
    '  "Neologism Directory" [shape=folder,style=filled,fillcolor="#f9f9f9"];',
    '  "Chrononomics" [shape=box];',
    '  "Symbioglyph" [shape=box];',
    '  "Neuropragmatics" [shape=box];',
    '  "Comprehension as Structural Principle" -> "Neologism Directory";',
    '  "Etymological Etiquette" -> "Neologism Directory";',
    '  "Etymological Etiquette" -> "Chrononomics";',
    '  "Etymological Etiquette" -> "Symbioglyph";',
    '  "Etymological Etiquette" -> "Neuropragmatics";',
    '  "Chrononomics" -> "AI";',
    '  "Chrononomics" -> "Cloud";',
    '  "Symbioglyph" -> "AI";',
    '  "Symbioglyph" -> "Cybersecurity";',
    '  "Neuropragmatics" -> "AI";',
    '  "Recursive Contract (Template)" -> "Comprehension as Structural Principle";',
    '  "Recursive Contract (Template)" -> "Precedent as Etymological Memory";',
    '  "Recursive Contract (Template)" -> "Definitions";',
    '  "Definitions" -> "Reasonable";',
    '  "Reasonable" -> "Unreasonable" [label="antonym"];',
    '  Broadband [shape=component]; IoT [shape=component]; Cloud [shape=component]; Cybersecurity [shape=component]; AI [shape=component]; "CircularEconomy" [shape=component,label="Circular Economy"];',
    '}'
]
dot_path = "/mnt/data/logos_knowledge_graph.dot"
with open(dot_path, "w") as f:
    f.write("\n".join(dot_lines))

jsonld_path, dot_path