base
Person, Organization, Event and Document for Omnigraph apps. Start every app on one store from these four, so they all mean the same thing by Person.
Installation
$
npx ontology.sh add modernrelay/ontologies/baseAdd the modernrelay/base ontology to this project: run `npx ontology.sh add modernrelay/ontologies/base`, then read ontologies/modernrelay/base/ONTOLOGY.md and fit it into our schema. Show me the plan before changing anything.drawing diagram…
Ontology
base
What it models
The four types nearly every app mentions: who (Person, Organization), when (Event) and what was written down (Document). It's deliberately small. Apps built on Omnigraph install it first so their own types can point at the same Person and Organization, instead of each app keeping its own copy. Domain ontologies (CRM, tasks, meetings) add their types on top and link to these.
Entities
- Person: one node per human, keyed by
slug, with an optional uniqueemailand atitle. - Organization: a company, nonprofit, government body or team (
kind), keyed byslug, with an optional uniquedomain. - Event: something that happens at a time:
starts_at(indexed),ends_at, a free-textlocation. - Document: content with an address:
kind(doc, page, file, thread, email, recording),title(indexed), an optional uniqueurl,created_at.
Person, Organization and Event share a Named interface (name).
Relations
- Person → MemberOf → Organization [0..*], with
roleandsince - Organization → PartOf → Organization [0..1]
- Person → Attended → Event [0..*]
- Event → OrganizedBy → Organization [0..1]
- Person → Authored → Document [0..*]
- Document → DocumentAbout → Event [0..*]
Modeling decisions
- Readable
slugkeys (ada-lovelace,acme) instead of opaque ids, so agents can write links without a lookup first. - A team is an Organization with
kind: teamand aPartOfedge to its company. One type covers the whole org chart. locationon Event is free text. Promote it to a Place node (seeschemaorg-core) only if places are shared and queried.- No Document → Person "mentions" edge: Omnigraph edges have one target type, and mentions usually belong to a domain ontology with its own rules.
How to integrate
- Omnigraph: copy
base.pginto your schema first. Domain ontologies referencePerson,Organization,EventandDocumentby name. Compile withomnigraph init --schema base.pg <tmp>, or plan withomnigraph schema planon a live graph. - Other stores: start from the derived files. SQL: four tables (
person,organization,event,document) plus join tables, inbase.hcl. Neo4j:base.cypher. GraphQL:base.graphql. - Overlaps: Person ≈ schema:Person, foaf:Person, prov:Person. Organization ≈ schema:Organization, foaf:Organization. Event ≈ schema:Event. Document ≈ schema:CreativeWork, foaf:Document.
- If your project already has
User, map it to Person and keep login details on User (or on an Actor type, as incompany-brain).
Files
base.pg: canonical. The schema in Omnigraph's schema language; compiles on Omnigraph 0.14 and 0.15. Edit this one.base.cypher: Neo4j 5 constraints and indexes, generated frombase.pg. Relationship rules and enums are comments, since Cypher has no relationship schema; existence and type constraints need Neo4j Enterprise.base.graphql: a GraphQL schema, generated frombase.pg. Edges are fields in both directions, and MemberOf is aMembershiptype. No keys or uniqueness.base.hcl: Atlas HCL for PostgreSQL, generated frombase.pg. Tables keyed byslug;PartOfandOrganizedByare foreign keys, the other edges join tables.