Skip to content

Binary-Origami Figurator - evidence graph for investigative journalism with PROMPT scoring

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
LICENSE.txt
Notifications You must be signed in to change notification settings

hyperpolymath/bofig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Binary-Origami Figurator

Infrastructure for pragmatic epistemology. Combining

  • i-docs navigation,

  • PROMPT epistemological scoring, and

  • boundary objects theory.

An evidence graph for investigative journalism.

Status: Phase 1 (PoC) - Month 1 Complete Version: 0.1.0

New Here? Start with the Wiki

Tip

Confused by the terminology? The Binary-Origami Wiki explains everything in metaphors, diagrams, and plain language.

This isn’t just a database. It’s infrastructure for folding and unfolding evidence—so everyone can see the shape that fits their needs.

Why "Binary-Origami"?

  • Binary: Evidence is stored as clear, connected data (supports/contradicts, 0-100 scores)

  • Origami: The same evidence can be "folded" into different forms for different audiences

  • Figuration: The rules for folding/unfolding are transparent and reversible

Concept Description Learn More

i-docs Navigation

"Choose Your Own Adventure" for evidence

Wiki

PROMPT Scoring

"Nutrition labels" for trustworthiness

Wiki

Boundary Objects

"Shared maps" with multiple routes

Wiki

Evidence Graphs

The "skeleton" beneath the origami

Wiki

For the Impatient

  1. Try the Quick Start to see it in action

  2. Skim the Binary-Origami Metaphor page

  3. Dive into the FAQ if something’s unclear

Vision

We didn’t fall from Truth to Post-Truth; we evolved to complex epistemology without building infrastructure. This system IS that infrastructure.

Core Concepts

  1. i-docs Navigation: Navigation over narration, reader agency

  2. PROMPT Framework: 6-dimensional epistemological scoring (Provenance, Replicability, Objective, Methodology, Publication, Transparency)

  3. Boundary Objects: Multiple audience perspectives on same evidence

  4. Evidence Graph for Investigative Journalism amd Related Disciplines

Quick Start

Prerequisites

  • Elixir 1.16+ & Erlang/OTP 26+

  • Phoenix 1.7+

  • Docker or Podman

  • Node.js 20+ (for assets)

1. Clone Repository

git clone https://github.com/Hyperpolymath/bofig.git
cd bofig

2. Start Databases

Using Docker Compose:

docker-compose up -d

Using Podman: See [Podmanfile.md](Podmanfile.md)

Verify ArangoDB is running: http://localhost:8529 (root/dev)

3. Install Dependencies

= Elixir dependencies

mix deps.get
mix deps.compile

= Frontend assets

cd assets && npm install && cd ..

4. Setup Database

= Create PostgreSQL database (for user auth)

mix ecto.create

= Setup ArangoDB collections and indexes

iex -S mix
iex> EvidenceGraph.ArangoDB.setup_database()

= Load UK Inflation 2023 test data

mix run priv/repo/seeds.exs

5. Start Phoenix Server

mix phx.server

Visit: - GraphQL Playground: http://localhost:4000/api/graphiql - LiveDashboard: http://localhost:4000/dev/dashboard

GraphQL API Examples

Query: Get All Claims

query {
  claims(investigationId: "uk_inflation_2023") {
    id
    text
    claimType
    confidenceLevel
    promptScores {
      provenance
      replicability
      objective
      methodology
      publication
      transparency
      overall
    }
    supportingEvidence {
      evidence {
        title
        evidenceType
      }
      weight
      confidence
    }
  }
}

Query: Evidence Chain (Graph Traversal)

query {
  evidenceChain(claimId: "claim_1", maxDepth: 3) {
    rootClaim {
      text
    }
    nodes {
      ... on Claim {
        id
        text
      }
      ... on Evidence {
        id
        title
      }
    }
    edges {
      relationshipType
      weight
      confidence
    }
    maxDepth
  }
}

Mutation: Create Claim

mutation {
  createClaim(input: {
    investigationId: "uk_inflation_2023"
    text: "Inflation disproportionately affected renters"
    claimType: SUPPORTING
    confidenceLevel: 0.85
    promptScores: {
      provenance: 70
      replicability: 65
      objective: 75
      methodology: 70
      publication: 65
      transparency: 70
    }
  }) {
    id
    text
    promptScores {
      overall
    }
  }
}

Mutation: Import from Zotero

mutation {
  importFromZotero(
    investigationId: "uk_inflation_2023"
    zoteroJson: {
      key: "ABC123"
      itemType: "journalArticle"
      title: "New Economic Study"
      url: "https://doi.org/10.1111/example"
      creators: [{name: "Smith, J."}]
      tags: [{tag: "economics"}]
    }
  ) {
    id
    title
    zoteroKey
  }
}

Query: Navigation Paths

query {
  navigationPaths(
    investigationId: "uk_inflation_2023"
    audienceType: RESEARCHER
  ) {
    id
    name
    description
    pathNodes {
      entityId
      entityType
      order
      context
    }
  }
}

Mutation: Auto-Generate Navigation Path

mutation {
  autoGeneratePath(
    investigationId: "uk_inflation_2023"
    audienceType: SKEPTIC
  ) {
    id
    name
    pathNodes {
      entityId
      order
    }
  }
}

Project Structure

bofig/
├── lib/
│   ├── evidence_graph/           # Core business logic
│   │   ├── claims/                # Claims context
│   │   │   └── claim.ex
│   │   ├── evidence/              # Evidence context
│   │   │   └── evidence.ex
│   │   ├── relationships/         # Graph edges
│   │   │   └── relationship.ex
│   │   ├── navigation/            # Audience paths
│   │   │   └── path.ex
│   │   ├── arango.ex              # ArangoDB client
│   │   ├── prompt_scores.ex       # PROMPT scoring
│   │   └── application.ex         # OTP supervisor
│   └── evidence_graph_web/        # Phoenix web layer
│       ├── schema/                # GraphQL schema
│       │   ├── types/             # Type definitions
│       │   └── schema.ex          # Root schema
│       ├── endpoint.ex
│       └── router.ex
├── priv/repo/
│   └── seeds.exs                  # UK Inflation 2023 test data
├── config/                        # Environment configs
├── docs/                          # Architecture docs
│   ├── database-evaluation.md
│   └── zotero-integration.md
├── ARCHITECTURE.md                # Data model, API design
├── ROADMAP.md                     # 18-month plan
├── CLAUDE.md                      # AI assistant context
└── docker-compose.yml             # Container setup

UK Inflation 2023 Test Dataset

The seed data includes a complete investigation:

  • 7 Claims (primary, supporting, counter)

  • 10 Evidence items (expand to 30)

  • Official statistics: ONS CPI, Ofgem, BoE

  • Academic: Peer-reviewed studies

  • Think tanks: Resolution Foundation, IFS

  • Interviews: Expert opinions

  • 10 Relationships (supports/contradicts/contextualizes)

  • 3 Navigation Paths:

    1. Researcher: Evidence-first, methodology priority

    2. Policymaker: Authoritative sources, recommendations

    3. Affected Person: Personal impact, clarity

PROMPT Score Examples

| Evidence | Prov | Repl | Obj | Meth | Pub | Trans | Overall | |----------|------|------|-----|------|-----|-------|---------| | ONS CPI Data | 100 | 100 | 95 | 95 | 100 | 95 | 97.5 | | Academic Study | 85 | 80 | 75 | 85 | 90 | 75 | 81.8 | | Think Tank Report | 75 | 70 | 65 | 75 | 80 | 70 | 72.3 | | Expert Interview | 85 | 45 | 60 | 50 | 40 | 75 | 59.0 |

Development

Run Tests

mix test

Interactive Shell

iex -S mix phx.server

= Query ArangoDB directly

iex> EvidenceGraph.ArangoDB.query("FOR c IN claims RETURN c")

= Get a claim

iex> EvidenceGraph.Claims.get_claim("claim_1")

= Evidence chain traversal

iex> EvidenceGraph.Relationships.evidence_chain("claim_1", 3)

Code Quality

= Format code

mix format

= Static analysis

mix credo

= Type checking

mix dialyzer

Deployment (Phase 2)

  • Hosting: Hetzner Cloud (EU data sovereignty)

  • ArangoDB: ArangoDB Oasis (€45/month)

  • Phoenix: Systemd service, Nginx reverse proxy

  • CI/CD: GitHub Actions

Documentation

Conceptual (Start Here!)

Technical

Key Features

Implemented (Phase 1 Month 1)

  • ✅ Multi-model ArangoDB integration (document + graph)

  • ✅ GraphQL API with Absinthe (15 queries, 11 mutations)

  • ✅ PROMPT epistemological scoring (6 dimensions, audience weighting)

  • ✅ Claims, Evidence, Relationships data models

  • ✅ Navigation Paths (boundary objects concept)

  • ✅ Graph traversal algorithms (evidence chains, shortest path)

  • ✅ Zotero metadata mapping (Dublin Core, Schema.org)

  • ✅ UK Inflation 2023 test dataset

  • ✅ Auto-generate navigation paths

Coming Next (Phase 1 Month 2-6)

  • 🚧 Zotero browser extension (import/export)

  • 🚧 D3.js graph visualization

  • 🚧 Phoenix LiveView UI

  • 🚧 PROMPT scoring interface

  • 🚧 User authentication

  • 🚧 Real-time collaboration

  • 🚧 IPFS provenance integration

Philosophy

This isn’t just a database. It’s infrastructure for coordinating without consensus.

Every design choice asks: 1. Does this support multiple audience perspectives? 2. Does this make epistemology measurable? 3. Does this enable navigation over narration?

Contributing

Open source from day 1. See [ROADMAP.md](ROADMAP.md) for planned features.

Month 3 = Decision Point: User testing with 25 NUJ journalists determines go/no-go.

  • FormDB - The narrative-first, reversible, audit-grade database

  • FQLdt - Dependently-typed Form Query Language (compile-time proofs)

  • FormDB Studio - Zero-friction GUI for non-technical users

  • Zotero-FormDB - Reference manager with PROMPT scores

License

Contact


Built with: Elixir, Phoenix, ArangoDB, Absinthe, LiveView, D3.js

Inspired by: i-docs (PMPL-1.0 Open Doc Lab), Boundary Objects (Star & Griesemer), Pragmatic Epistemology

Last Updated: 2025-11-22

Sponsor this project

Packages

No packages published

Contributors 3

  •  
  •  
  •