Repository navigation
feat(memoir): optional per-memoir ontology for concept types and relations - #554
Open
pszymkowiak wants to merge 1 commit into
Open
pszymkowiak wants to merge 1 commit into
pszymkowiak wants to merge 1 commit into
Conversation
…tions A memoir can now declare the concept types it accepts (carried by type:<name> labels) and the relations allowed between them, written as from:relation:to with * for any type. add_concept, update_concept and add_link reject rows that break it. Memoirs without an ontology keep the free-form behaviour. - icm-core: Ontology, RelationRule, validation and ontology_violations - icm-store (SQLite): memoirs.ontology JSON column, SCHEMA_VERSION 2 - CLI: icm memoir ontology set|show|check|clear - MCP: icm_memoir_set_ontology; icm_memoir_show prints the ontology
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Several agents writing into one memoir each invent their own types (
svc,service,microservice) and read relations differently, so the graph stops answering reliably. This is the shared-vocabulary part of ontology-driven knowledge graphs (OWL/SHACL), without a triplestore or inference engine.What
Ontology { types, require_type, relations }andRelationRule(from:relation:to,*= any type, or justrelation). A concept's type is itstype:<name>label. Includesvalidate_concept,validate_linkandontology_violations.memoirs.ontologyJSON column (added by migration,SCHEMA_VERSION1 → 2).add_concept,update_conceptandadd_linkreturnInvalidInputwhen a row breaks the memoir's ontology. Postgres and OpenSearch still don't support memoirs (feat(store): support pluggable storage backends (beyond SQLite) #301).icm memoir ontology set|show|check|clear.setlists existing rows that break the new ontology and keeps them.checkexits 1 if any row breaks it.icm_memoir_set_ontologytool.icm_memoir_showprints the ontology.A memoir without an ontology behaves exactly as before.
Tests
ontologystill deserializesRan locally: the targeted tests and clippy
-D warnings(SQLite, no embeddings). CI runs the full suite.