Repository navigation
Add ontology core: typed objects, evidence-backed links, SQLite/PostgreSQL store - #1
Merged
Merged
Conversation
…reSQL store Objects are revisioned by content hash with full history and an audit log. Analytic links must cite evidence already in the store; there is no person object type, per the legal source policy. Both backends share one contract test suite, and CI now runs it against PostgreSQL 16. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GcagdBzPRAWDhhc9Yipm4d
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.
Requested by Zach · project thread
Before: Forge had no shared object model. Events lived as
NormalizedOSINTEventrows in SQLite, and the memory graph existed only in memory, so there was nothing durable for Live Map to read.After: Forge has an ontology store for typed objects: events, places, organizations, vessels, aircraft, facilities, sources, documents, observations, claims, assessments and requirements. Objects are joined by typed, time-bounded links, and every analytic link must cite evidence. Each object keeps its full revision history and an audit log, in SQLite (no extra packages) or PostgreSQL.
This is step 3 of the roadmap: the record store Live Map will become a client of. The vocabulary follows Live Map's
CONTEXT.md.How:
osint_forge/ontology/model.py:OntologyObjectandOntologyLinkwith validation.type:key, and every object needs provenance.(0,0)is a valid point, not a missing one.persontype, per the legal source policy.supports,contradicts,mentions,same_as, …) must cite evidence.possible_associationis capped at 0.5 confidence.osint_forge/ontology/store.py: one store contract withSQLiteOntologyStoreandPostgresOntologyStore. It covers revisioned upserts and history, type/text/bbox listing, link writes that refuse unknown endpoints or evidence,links_for, aneighborhoodexpansion for link-analysis views, and an audit log.osint_forge/ontology/sql/(SQLite, plus PostgreSQL migration 001). PostGIS indexing comes in a later migration.tests/test_ontology.py: 20 tests. One shared contract suite runs against both backends.actions/checkout@v5/setup-python@v6, since the old versions used the deprecated Node 20.psycopgis an optional extra (osint-forge[postgres]). The core stays dependency-free.Verified locally: 107 tests pass. The 20 ontology tests also pass against a local PostgreSQL 16 server.
Not in this PR: the HTTP API and Live Map feed, migrating existing events and memory-graph data onto these objects, and entity resolution.
Generated by Claude Code