Architecture
NeoWiki is a MediaWiki extension. It adds structured data to ordinary wiki pages, keeps that data on the page it describes, and projects it into graph stores so it can be queried.
Data lives on the page
A page's structured data sits in a dedicated content slot on the page itself, stored as JSON and versioned with the page exactly like its wikitext (ADR 2, ADR 4). That slot content is the source of truth.
The slot holds Subjects, each carrying Statements and shaped by a Schema. The Glossary defines this vocabulary, which the UI and the code share.
Graph stores hold projections
A wiki can connect to one or more graph stores: Neo4j, and any SPARQL 1.1 store. Each holds a Projection, a derived, query-optimized copy of the wiki's data, written on every save and rebuildable from page content at any time (ADR 19). A Projection is either the built-in native one or an ontology projection defined by a Mapping, which expresses Subjects in a vocabulary such as EDM or CIDOC-CRM.
Queries are written in each backend's own language, Cypher for Neo4j and SPARQL for SPARQL stores, and run from parser functions, Lua, and the REST API. NeoWiki deliberately has no query language of its own (ADR 19).
The subject-to-page index is authoritative in a MediaWiki table, so a wiki can also run with no graph store at all (ADR 32): graph queries are then unavailable, and the rest works.
Frontend and extension points
The editing and display interfaces are a TypeScript and Vue application built on Wikimedia Codex and embedded into wiki pages (ADR 15, ADR 16, ADR 20). The PHP behind them follows a domain-centric architecture (ADR 1).
Other MediaWiki extensions can add Property Types, View Types, Page Properties, graph backends, and frontend components (Extending NeoWiki).
Architecture Decision Records
Every architectural decision on record, in the order it was made.
- ADR 1: Domain Centric Architecture
- ADR 2: Store Data as JSON
- ADR 3: Neo4j as Graph Database
- ADR 4: Use a Dedicated MediaWiki Revision Slot
- ADR 5: Subject GUIDs
- ADR 6: Schemas
- ADR 7: Multiple Subjects Per Page
- ADR 8: One Schema per Subject
- ADR 9: Move Away from JSON Schema
- ADR 10: Add GUIDs to Relations
- ADR 11: Include Writer's Schema in Subjects
- ADR 12: Backend Validation
- ADR 13: Restrict Neo4j Access
- ADR 14: Improved ID Format
- ADR 15: Dedicated Editors
- ADR 16: Frontend State Management
- ADR 17: Names as Identifiers
- ADR 18: Views and Layouts
- ADR 19: Graph Database Architecture
- ADR 20: Codex Styling Policy
- ADR 21: Add Backend Validation
- ADR 22: Multi-wiki Graph Node Identity
- ADR 23: Subject Sources
- ADR 24: Frontend Extension Mechanism
- ADR 25: Backend-driven Frontend Validation
- ADR 26: Validation Severity Levels
- ADR 27: Access Control
- ADR 28: Relations Model
- ADR 29: Scalability Targets
- ADR 30: Frontend Stores Are Registries, Not Caches
- ADR 31: Optional Subject Labels
- ADR 32: Subject-to-Page Index