Node-neighborhood Description Framework (NDF) β A desktop-first knowledge modeling app built with:
- π₯οΈ Electron for cross-platform desktop shell
- βοΈ Vite + React for frontend
- π§ FastAPI + NetworkX for backend graph modeling
- π§© flatfile backend: YAML-based persistence
- π Local-first, offline-friendly, with optional cloud sync (future)
ndf-studio/
βββ backend/ # See full structure below: FastAPI + NetworkX
β βββ main.py
βββ frontend/ # Vite + React
β βββ index.html
β βββ src/
β β βββ App.jsx
β β βββ main.jsx
β β βββ services/api.js
βββ electron/ # Electron shell
β βββ main.js
β βββ package.json
βββ graph_data/ # YAML files for nodes and relations
# Install frontend
cd frontend
npm install
# Build frontend
npm run build
# Install Electron shell
cd ../electron
npm installnpm run start # from inside electron/Electron will:
- Launch the backend (
uvicorn) - Serve the compiled frontend
- Open the app window
# Terminal 1: run frontend dev server
cd frontend
npm run dev
# Terminal 2: run Electron in dev mode
cd electron
npm run dev- Add nodes with optional qualifiers
- Store attributes and semantic relations
- View and edit YAML-based knowledge units
- Export/import support planned
- D3.js or Cytoscape-based graph view upcoming
From electron/package.json:
"scripts": {
"start": "electron .",
"dev": "NODE_ENV=development electron .",
"build-and-run": "cd ../frontend && npm run build && cd ../electron && npm run start"
}To create distributables:
npm install --save-dev electron-builder
npx electron-builderAGPLv3 β Free and Open-source and remixable for educational, civic, and public use.
The Node-neighborhood Description Framework (NDF) is a lightweight, file-based graph knowledge system designed for learners, educators, and researchers who want to build and explore meaningful networks of knowledge through neighborhoods rather than rigid triples.
This is the backend repository built with FastAPI and NetworkX, using YAML files to represent each node's local neighborhood (NBH) as the unit of meaning.
NDF contrasts with RDF and traditional semantic web models by:
- Treating neighborhoods (NBHs) as the fundamental units of knowledge, not individual triples, though fully compatible in terms of encoding to RDF.
- Embracing a constructivist, learner-friendly designβno rigid ontology, schema enforcement is soft.
- Enabling emergent semantics through iterative exploration, use, and refinement of type hierarchies.
Students and users are encouraged to:
- Build from the bottom-up
- Define their own schemas
- Learn through doing and refining
Each node is stored as a YAML file under graph_data/:
node:
id: india
label: India
role: individual # or "class"
qualifier: OPTIONAL # optional (e.g., "asian" in "asian country")
attributes:
- name: area
value: 32,87,263
unit: sq. km
quantifier: OPTIONAL
modality: OPTIONAL
relations:
- type: located in
target: Asia
subject_quantifier: OPTIONAL
object_quantifier: OPTIONAL
modality: OPTIONAL- CRUD routes for:
- Nodes
- Attributes
- Relations
- nodeTypes / attributeTypes / relationTypes
- Auto-handling of inverse relations (e.g.,
has_partβpart_of) - Optional soft schema validation:
- Only enforced if
domainandrangeare defined
- Only enforced if
- Minimal preloaded schema:
is_aandmember_ofas core relation types
- Reasoning engine (planned) based on transitive
is_ainference
- Learners can create nodes and connect them freely.
- Softly encouraged to define:
- whether a node is a class or an individual
- sub-types (
is_a) and memberships (member_of)
- Advanced features like domain/range validation and ontology editing unlock as learners gain fluency
- Future feature: "Simulate Strict Typing" toggle for advanced validation
pip install -r requirements.txtuvicorn main:app --reloadOpen http://localhost:8000/docs to explore the API with Swagger UI.
- Promote network thinking in education
- Provide graph-based alternative to rigid object-oriented business logic
- Build a scalable, federated knowledge ecosystem rooted in human reasoning
backend/
βββ main.py # FastAPI entry point
βββ routes/ # API routes
β βββ nodes.py
β βββ graph_ops.py
β βββ schema.py
βββ schema/ # Editable schema files
β βββ node_types.yaml
β βββ attribute_types.yaml
β βββ relation_types.yaml
βββ graph_data/ # Flat-file graph DB
βββ requirements.txt
This project is licensed under the AGPL v3 to ensure knowledge and improvements remain open.
An initiative of https://www.gnowledge.org
For easy development, we provide several startup scripts:
Start Backend Only:
./start_backend.sh- Checks virtual environment and directory
- Sets correct PYTHONPATH
- Starts backend on http://localhost:8000
Start Frontend Only:
./start_frontend.sh- Checks directory and dependencies
- Starts frontend on http://localhost:5173 (or next available port)
Start Both Backend and Frontend:
./start_services.sh- Checks virtual environment and directory
- Starts both services in parallel
- Press Ctrl+C to stop both
If you prefer to start services manually:
Backend:
source venv/bin/activate
PYTHONPATH=/home/nagarjun/dev/ndf-studio/backend python -m uvicorn backend.main:app --reload --host 0.0.0.0 --port 8000Frontend:
cd frontend
npm install # if needed
npm run dev- Python 3.8+ with virtual environment activated
- Node.js 16+ with npm
- All dependencies installed (see Installation section above)