This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This project will examine how to provide polycentric knowledge processing by orchestrating multiple monocentric instances of knowledge processing systems via a holonic overlay. Being polycentric is differentiated from being distributed by polycentricity's focus on orchestration over heterogenous instances each having their own "center" whereas distribution leans more to orchestration over homogenous instances and a merging or blurring of centers. The goal of this project is to develop a POC of polycentric knowledge processing derived from two individual instances of the Flexo MMS (Model Management System). Flexo is being used as a exemplar of an operational knowledge processing system used by Engineers to develop and operate high reliability systems.
At a future point in time, a second POC using Discourse Graphs may be developed as a sister POC with Discourse Graphs being the exemplar of research knowledge processing system used by Scientists to extend knowledge.
This is a deployment configuration repository for Flexo MMS (Model Management System) - a version control system for RDF-based model data. It is NOT a source code repository; it orchestrates deployment of multiple microservices via Docker Compose and Kubernetes.
Important: Flexo MMS supports native RDF data and is distinct from Exec MMS (which supports JSON documents).
# Start Instance A
docker-compose -f instances/instance-a/docker-compose.yml up -d
# Start Instance B
docker-compose -f instances/instance-b/docker-compose.yml up -d
# Start both instances
docker-compose -f instances/instance-a/docker-compose.yml up -d && docker-compose -f instances/instance-b/docker-compose.yml up -d
# Shutdown both instances
docker-compose -f instances/instance-a/docker-compose.yml down && docker-compose -f instances/instance-b/docker-compose.yml down# Instance A: Get JWT token (use user01/password1 or user02/password2)
curl -u user01 -X GET http://localhost:8082/login
# Use token for Layer1 API at http://localhost:8080
# Instance B: Get JWT token
curl -u user01 -X GET http://localhost:8182/login
# Use token for Layer1 API at http://localhost:8180# Start with Fuseki backend (default)
docker-compose -f flexo-mms-deployment/docker-compose/docker-compose.yml up
# Shutdown
docker-compose -f flexo-mms-deployment/docker-compose/docker-compose.yml down| Service | Instance A | Instance B | Purpose |
|---|---|---|---|
| Layer1 Service | 8080 | 8180 | Main API for model management, RDF handling |
| Store Service | 8081 | 8181 | Artifact/blob storage (S3-compatible) |
| Auth Service | 8082 | 8182 | Authentication, JWT token generation |
| Apache Fuseki | 3030 | 3130 | Quad store (SPARQL endpoint) |
| MinIO | 9000 | 9100 | S3-compatible object storage |
| OpenLDAP | 1389 | 1489 | User/group management |
- Instance A:
flexo-mms-instance-a-network - Instance B:
flexo-mms-instance-b-network
Layer1 Service → Store Service, Auth Service, Quad Store
Auth Service → OpenLDAP, Quad Store
Store Service → MinIO
instances/- Two isolated Flexo MMS instances for polycentric POCinstance-a/andinstance-b/- Each contains:docker-compose.yml- Instance-specific Docker Compose configenv/- Environment files with instance-specific hostnamesmount/cluster.trig- Initial RDF data with instance-specific URIs
flexo-mms-deployment/- Original Flexo MMS deployment repo (reference)docker-compose/- Single-instance Docker Compose configurationsk8s/- Kubernetes manifests
- Access UI at
http://localhost:7200 - Create repository: Setup > Repositories > Create > GraphDB Repository
- Repository ID:
openmbee - Ruleset: "No inference"
- Enable: content index, predicate list index, FTS index
- Repository ID:
- Import data: Import > Upload RDF Files > select
mount/cluster.trig
As it currently stands, this project contains a clone of the Flexo MMS Deployment repo. Review this repo and create a plan for instantiating two independent instances of Flexo MMS on this computer.
Status: Implemented. The instances/ directory contains two fully isolated Flexo MMS configurations (instance-a and instance-b) ready to run.
Approach: Create two separate docker-compose configurations, each with distinct ports, container names, and networks. This provides complete isolation between instances while keeping configurations explicit and independently modifiable.
Directory Structure:
distributed-knowledge-processing/
├── instances/
│ ├── instance-a/
│ │ ├── docker-compose.yml
│ │ ├── env/ # Copied and modified from original
│ │ └── mount/
│ │ └── cluster.trig # Initial RDF data
│ └── instance-b/
│ ├── docker-compose.yml
│ ├── env/
│ └── mount/
│ └── cluster.trig
└── flexo-mms-deployment/ # Original repo (reference)
Port Allocation:
| Service | Instance A | Instance B |
|---|---|---|
| Layer1 Service | 8080 | 8180 |
| Store Service | 8081 | 8181 |
| Auth Service | 8082 | 8182 |
| Apache Fuseki | 3030 | 3130 |
| MinIO | 9000 | 9100 |
| OpenLDAP | 1389 | 1489 |
Network Isolation:
- Instance A:
flexo-mms-instance-a-network - Instance B:
flexo-mms-instance-b-network
Container Naming Convention:
- Instance A:
instance-a-<service>(e.g.,instance-a-layer1-service) - Instance B:
instance-b-<service>(e.g.,instance-b-layer1-service)
Implementation Steps:
- Create
instances/directory structure - Copy
docker-compose.ymlto each instance directory - Modify each docker-compose.yml:
- Update all
container_namevalues with instance prefix - Update all
hostnamevalues with instance prefix - Update port mappings per the allocation table above
- Update network name to instance-specific network
- Update volume mount paths to local
./mountand./env
- Update all
- Copy
env/directory to each instance and update internal service hostnames (e.g.,auth-service→instance-a-auth-service) - Copy
mount/cluster.trigto each instance
Commands After Implementation:
# Start Instance A
docker-compose -f instances/instance-a/docker-compose.yml up -d
# Start Instance B
docker-compose -f instances/instance-b/docker-compose.yml up -d
# Instance A API
curl -u user01 -X GET http://localhost:8082/login # Auth
# Use token for http://localhost:8080 # Layer1
# Instance B API
curl -u user01 -X GET http://localhost:8182/login # Auth
# Use token for http://localhost:8180 # Layer1
# Shutdown
docker-compose -f instances/instance-a/docker-compose.yml down
docker-compose -f instances/instance-b/docker-compose.yml downVerification Criteria:
- Both instances start without port conflicts
- Each instance has isolated data (changes in A don't appear in B)
- Authentication works independently on each instance
- API calls to each instance return independent results