{"_id":"@businessmaps/metaontology","_rev":"2-d975a3164cc3f88fa5cfa05d570a1962","name":"@businessmaps/metaontology","dist-tags":{"latest":"0.62.0"},"versions":{"0.61.3":{"name":"@businessmaps/metaontology","version":"0.61.3","keywords":["ontology","metaontology","knowledge-graph","business-maps","dsl","modeling"],"author":{"name":"Business Maps"},"license":"MIT","_id":"@businessmaps/metaontology@0.61.3","maintainers":[{"name":"shalashtein","email":"shalashtein@gmail.com"}],"homepage":"https://github.com/Business-Maps/metaontology#readme","bugs":{"url":"https://github.com/Business-Maps/metaontology/issues"},"dist":{"shasum":"68a183be59078d823fafb60e457751e0b0295e9a","tarball":"https://registry.npmjs.org/@businessmaps/metaontology/-/metaontology-0.61.3.tgz","fileCount":487,"integrity":"sha512-L99B0VlwhG3P5WZgRRq7o+nNVDwHy/vunMKLrI7p4icCclgoF9s8Ewd2xceWUyDUvRdEsvhWavTehFBoCRmYgQ==","signatures":[{"sig":"MEUCIQDI9JH9CtRZCo1RCPgPbbZJsvSlbYm/SmankLgQMtKmCwIgVLsCokFKwmQ7i1rUKWdzvZjFgYpbAovLJkxGR5GjWGE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@businessmaps%2fmetaontology@0.61.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":4495777},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./dsl":{"import":{"types":"./dist/dsl/index.d.ts","default":"./dist/dsl/index.js"},"require":{"types":"./dist/dsl/index.d.cts","default":"./dist/dsl/index.cjs"}},"./core":{"import":{"types":"./dist/core/index.d.ts","default":"./dist/core/index.js"},"require":{"types":"./dist/core/index.d.cts","default":"./dist/core/index.cjs"}},"./meta":{"import":{"types":"./dist/meta/index.d.ts","default":"./dist/meta/index.js"},"require":{"types":"./dist/meta/index.d.cts","default":"./dist/meta/index.cjs"}},"./util":{"import":{"types":"./dist/util/templates.d.ts","default":"./dist/util/templates.js"},"require":{"types":"./dist/util/templates.d.cts","default":"./dist/util/templates.cjs"}},"./types":{"import":{"types":"./dist/types/index.d.ts","default":"./dist/types/index.js"},"require":{"types":"./dist/types/index.d.cts","default":"./dist/types/index.cjs"}},"./engine":{"import":{"types":"./dist/engine/index.d.ts","default":"./dist/engine/index.js"},"require":{"types":"./dist/engine/index.d.cts","default":"./dist/engine/index.cjs"}},"./export":{"import":{"types":"./dist/export/index.d.ts","default":"./dist/export/index.js"},"require":{"types":"./dist/export/index.d.cts","default":"./dist/export/index.cjs"}},"./runtime":{"import":{"types":"./dist/runtime/index.d.ts","default":"./dist/runtime/index.js"},"require":{"types":"./dist/runtime/index.d.cts","default":"./dist/runtime/index.cjs"}},"./generate":{"import":{"types":"./dist/generate/index.d.ts","default":"./dist/generate/index.js"},"require":{"types":"./dist/generate/index.d.cts","default":"./dist/generate/index.cjs"}},"./types/m0":{"import":{"types":"./dist/types/m0.d.ts","default":"./dist/types/m0.js"},"require":{"types":"./dist/types/m0.d.cts","default":"./dist/types/m0.cjs"}},"./meta/i18n":{"import":{"types":"./dist/meta/i18n.d.ts","default":"./dist/meta/i18n.js"},"require":{"types":"./dist/meta/i18n.d.cts","default":"./dist/meta/i18n.cjs"}},"./migrations":{"import":{"types":"./dist/migrations/index.d.ts","default":"./dist/migrations/index.js"},"require":{"types":"./dist/migrations/index.d.cts","default":"./dist/migrations/index.cjs"}},"./engine/diff":{"import":{"types":"./dist/engine/diff.d.ts","default":"./dist/engine/diff.js"},"require":{"types":"./dist/engine/diff.d.cts","default":"./dist/engine/diff.cjs"}},"./meta/facets":{"import":{"types":"./dist/meta/facets.d.ts","default":"./dist/meta/facets.js"},"require":{"types":"./dist/meta/facets.d.cts","default":"./dist/meta/facets.cjs"}},"./meta/fields":{"import":{"types":"./dist/meta/fields.d.ts","default":"./dist/meta/fields.js"},"require":{"types":"./dist/meta/fields.d.cts","default":"./dist/meta/fields.cjs"}},"./types/query":{"import":{"types":"./dist/types/query.d.ts","default":"./dist/types/query.js"},"require":{"types":"./dist/types/query.d.cts","default":"./dist/types/query.cjs"}},"./engine/apply":{"import":{"types":"./dist/engine/apply.d.ts","default":"./dist/engine/apply.js"},"require":{"types":"./dist/engine/apply.d.cts","default":"./dist/engine/apply.cjs"}},"./engine/merge":{"import":{"types":"./dist/engine/merge.d.ts","default":"./dist/engine/merge.js"},"require":{"types":"./dist/engine/merge.d.cts","default":"./dist/engine/merge.cjs"}},"./engine/query":{"import":{"types":"./dist/engine/query.d.ts","default":"./dist/engine/query.js"},"require":{"types":"./dist/engine/query.d.cts","default":"./dist/engine/query.cjs"}},"./generate/app":{"import":{"types":"./dist/generate/app.d.ts","default":"./dist/generate/app.js"},"require":{"types":"./dist/generate/app.d.cts","default":"./dist/generate/app.cjs"}},"./types/branch":{"import":{"types":"./dist/types/branch.d.ts","default":"./dist/types/branch.js"},"require":{"types":"./dist/types/branch.d.cts","default":"./dist/types/branch.cjs"}},"./meta/ontology":{"import":{"types":"./dist/meta/ontology.d.ts","default":"./dist/meta/ontology.js"},"require":{"types":"./dist/meta/ontology.d.cts","default":"./dist/meta/ontology.cjs"}},"./types/commits":{"import":{"types":"./dist/types/commits.d.ts","default":"./dist/types/commits.js"},"require":{"types":"./dist/types/commits.d.cts","default":"./dist/types/commits.cjs"}},"./types/context":{"import":{"types":"./dist/types/context.d.ts","default":"./dist/types/context.js"},"require":{"types":"./dist/types/context.d.cts","default":"./dist/types/context.cjs"}},"./dsl/dispatcher":{"import":{"types":"./dist/dsl/dispatcher.d.ts","default":"./dist/dsl/dispatcher.js"},"require":{"types":"./dist/dsl/dispatcher.d.cts","default":"./dist/dsl/dispatcher.cjs"}},"./engine/analyze":{"import":{"types":"./dist/engine/analyze.d.ts","default":"./dist/engine/analyze.js"},"require":{"types":"./dist/engine/analyze.d.cts","default":"./dist/engine/analyze.cjs"}},"./engine/applyM0":{"import":{"types":"./dist/engine/applyM0.d.ts","default":"./dist/engine/applyM0.js"},"require":{"types":"./dist/engine/applyM0.d.cts","default":"./dist/engine/applyM0.cjs"}},"./engine/inverse":{"import":{"types":"./dist/engine/inverse.d.ts","default":"./dist/engine/inverse.js"},"require":{"types":"./dist/engine/inverse.d.cts","default":"./dist/engine/inverse.cjs"}},"./engine/triples":{"import":{"types":"./dist/engine/triples.d.ts","default":"./dist/engine/triples.js"},"require":{"types":"./dist/engine/triples.d.cts","default":"./dist/engine/triples.cjs"}},"./generate/index":{"import":{"types":"./dist/generate/index.d.ts","default":"./dist/generate/index.js"},"require":{"types":"./dist/generate/index.d.cts","default":"./dist/generate/index.cjs"}},"./types/commands":{"import":{"types":"./dist/types/commands.d.ts","default":"./dist/types/commands.js"},"require":{"types":"./dist/types/commands.d.cts","default":"./dist/types/commands.cjs"}},"./types/instance":{"import":{"types":"./dist/types/instance.d.ts","default":"./dist/types/instance.js"},"require":{"types":"./dist/types/instance.d.cts","default":"./dist/types/instance.cjs"}},"./util/templates":{"import":{"types":"./dist/util/templates.d.ts","default":"./dist/util/templates.js"},"require":{"types":"./dist/util/templates.d.cts","default":"./dist/util/templates.cjs"}},"./generate/export":{"import":{"types":"./dist/generate/export.d.ts","default":"./dist/generate/export.js"},"require":{"types":"./dist/generate/export.d.cts","default":"./dist/generate/export.cjs"}},"./meta/vocabulary":{"import":{"types":"./dist/meta/vocabulary.d.ts","default":"./dist/meta/vocabulary.js"},"require":{"types":"./dist/meta/vocabulary.d.cts","default":"./dist/meta/vocabulary.cjs"}},"./engine/m0Triples":{"import":{"types":"./dist/engine/m0Triples.d.ts","default":"./dist/engine/m0Triples.js"},"require":{"types":"./dist/engine/m0Triples.d.cts","default":"./dist/engine/m0Triples.cjs"}},"./engine/normalize":{"import":{"types":"./dist/engine/normalize.d.ts","default":"./dist/engine/normalize.js"},"require":{"types":"./dist/engine/normalize.d.cts","default":"./dist/engine/normalize.cjs"}},"./engine/serialize":{"import":{"types":"./dist/engine/serialize.d.ts","default":"./dist/engine/serialize.js"},"require":{"types":"./dist/engine/serialize.d.cts","default":"./dist/engine/serialize.cjs"}},"./meta/customTypes":{"import":{"types":"./dist/meta/customTypes.d.ts","default":"./dist/meta/customTypes.js"},"require":{"types":"./dist/meta/customTypes.d.cts","default":"./dist/meta/customTypes.cjs"}},"./engine/inheritance":{"import":{"types":"./dist/engine/inheritance.d.ts","default":"./dist/engine/inheritance.js"},"require":{"types":"./dist/engine/inheritance.d.cts","default":"./dist/engine/inheritance.cjs"}},"./engine/completeness":{"import":{"types":"./dist/engine/completeness.d.ts","default":"./dist/engine/completeness.js"},"require":{"types":"./dist/engine/completeness.d.cts","default":"./dist/engine/completeness.cjs"}},"./generate/domainLayer":{"import":{"types":"./dist/generate/domainLayer.d.ts","default":"./dist/generate/domainLayer.js"},"require":{"types":"./dist/generate/domainLayer.d.cts","default":"./dist/generate/domainLayer.cjs"}},"./runtime/queryBuilder":{"import":{"types":"./dist/runtime/queryBuilder.d.ts","default":"./dist/runtime/queryBuilder.js"},"require":{"types":"./dist/runtime/queryBuilder.d.cts","default":"./dist/runtime/queryBuilder.cjs"}},"./engine/instanceTriples":{"import":{"types":"./dist/engine/instanceTriples.d.ts","default":"./dist/engine/instanceTriples.js"},"require":{"types":"./dist/engine/instanceTriples.d.cts","default":"./dist/engine/instanceTriples.cjs"}},"./generate/selfProjection":{"import":{"types":"./dist/generate/selfProjection.d.ts","default":"./dist/generate/selfProjection.js"},"require":{"types":"./dist/generate/selfProjection.d.cts","default":"./dist/generate/selfProjection.cjs"}},"./runtime/pipelineRuntime":{"import":{"types":"./dist/runtime/pipelineRuntime.d.ts","default":"./dist/runtime/pipelineRuntime.js"},"require":{"types":"./dist/runtime/pipelineRuntime.d.cts","default":"./dist/runtime/pipelineRuntime.cjs"}},"./runtime/typedCollection":{"import":{"types":"./dist/runtime/typedCollection.d.ts","default":"./dist/runtime/typedCollection.js"},"require":{"types":"./dist/runtime/typedCollection.d.cts","default":"./dist/runtime/typedCollection.cjs"}},"./runtime/writebackRuntime":{"import":{"types":"./dist/runtime/writebackRuntime.d.ts","default":"./dist/runtime/writebackRuntime.js"},"require":{"types":"./dist/runtime/writebackRuntime.d.cts","default":"./dist/runtime/writebackRuntime.cjs"}},"./engine/instanceValidation":{"import":{"types":"./dist/engine/instanceValidation.d.ts","default":"./dist/engine/instanceValidation.js"},"require":{"types":"./dist/engine/instanceValidation.d.cts","default":"./dist/engine/instanceValidation.cjs"}},"./runtime/inMemoryRepository":{"import":{"types":"./dist/runtime/inMemoryRepository.d.ts","default":"./dist/runtime/inMemoryRepository.js"},"require":{"types":"./dist/runtime/inMemoryRepository.d.cts","default":"./dist/runtime/inMemoryRepository.cjs"}},"./runtime/providers/localProvider":{"import":{"types":"./dist/runtime/providers/localProvider.d.ts","default":"./dist/runtime/providers/localProvider.js"},"require":{"types":"./dist/runtime/providers/localProvider.d.cts","default":"./dist/runtime/providers/localProvider.cjs"}}},"gitHead":"ad69e80676b91391bab47100be527e2c4611c7b9","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"shalashtein","email":"shalashtein@gmail.com"},"repository":{"url":"git+https://github.com/Business-Maps/metaontology.git","type":"git"},"_npmVersion":"10.9.7","description":"A metaontology that supercharges your app. Built on the Business Maps framework for modeling businesses as structured knowledge graphs.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","dependencies":{"immer":"^10.0.0","klona":"^2.0.6","nanoid":"^5.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","vitest":"^3.2.4","typescript":"^6.0.2","@types/node":"^24.6.1"},"peerDependencies":{"typescript":">=5.0.0"},"peerDependenciesMeta":{"typescript":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/metaontology_0.61.3_1775953585982_0.8129862097233533","host":"s3://npm-registry-packages-npm-production"}},"0.62.0":{"name":"@businessmaps/metaontology","version":"0.62.0","description":"A metaontology that supercharges your app. Built on the Business Maps framework for modeling businesses as structured knowledge graphs.","author":{"name":"Business Maps"},"license":"Apache-2.0","keywords":["ontology","metaontology","knowledge-graph","business-maps","dsl","modeling"],"repository":{"type":"git","url":"git+https://github.com/Business-Maps/metaontology.git"},"homepage":"https://github.com/Business-Maps/metaontology#readme","bugs":{"url":"https://github.com/Business-Maps/metaontology/issues"},"type":"module","sideEffects":false,"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./core":{"import":{"types":"./dist/core/index.d.ts","default":"./dist/core/index.js"},"require":{"types":"./dist/core/index.d.cts","default":"./dist/core/index.cjs"}},"./dsl":{"import":{"types":"./dist/dsl/index.d.ts","default":"./dist/dsl/index.js"},"require":{"types":"./dist/dsl/index.d.cts","default":"./dist/dsl/index.cjs"}},"./dsl/dispatcher":{"import":{"types":"./dist/dsl/dispatcher.d.ts","default":"./dist/dsl/dispatcher.js"},"require":{"types":"./dist/dsl/dispatcher.d.cts","default":"./dist/dsl/dispatcher.cjs"}},"./engine":{"import":{"types":"./dist/engine/index.d.ts","default":"./dist/engine/index.js"},"require":{"types":"./dist/engine/index.d.cts","default":"./dist/engine/index.cjs"}},"./engine/triples":{"import":{"types":"./dist/engine/triples.d.ts","default":"./dist/engine/triples.js"},"require":{"types":"./dist/engine/triples.d.cts","default":"./dist/engine/triples.cjs"}},"./engine/query":{"import":{"types":"./dist/engine/query.d.ts","default":"./dist/engine/query.js"},"require":{"types":"./dist/engine/query.d.cts","default":"./dist/engine/query.cjs"}},"./engine/merge":{"import":{"types":"./dist/engine/merge.d.ts","default":"./dist/engine/merge.js"},"require":{"types":"./dist/engine/merge.d.cts","default":"./dist/engine/merge.cjs"}},"./engine/diff":{"import":{"types":"./dist/engine/diff.d.ts","default":"./dist/engine/diff.js"},"require":{"types":"./dist/engine/diff.d.cts","default":"./dist/engine/diff.cjs"}},"./engine/completeness":{"import":{"types":"./dist/engine/completeness.d.ts","default":"./dist/engine/completeness.js"},"require":{"types":"./dist/engine/completeness.d.cts","default":"./dist/engine/completeness.cjs"}},"./engine/apply":{"import":{"types":"./dist/engine/apply.d.ts","default":"./dist/engine/apply.js"},"require":{"types":"./dist/engine/apply.d.cts","default":"./dist/engine/apply.cjs"}},"./engine/applyM0":{"import":{"types":"./dist/engine/applyM0.d.ts","default":"./dist/engine/applyM0.js"},"require":{"types":"./dist/engine/applyM0.d.cts","default":"./dist/engine/applyM0.cjs"}},"./engine/inverse":{"import":{"types":"./dist/engine/inverse.d.ts","default":"./dist/engine/inverse.js"},"require":{"types":"./dist/engine/inverse.d.cts","default":"./dist/engine/inverse.cjs"}},"./engine/analyze":{"import":{"types":"./dist/engine/analyze.d.ts","default":"./dist/engine/analyze.js"},"require":{"types":"./dist/engine/analyze.d.cts","default":"./dist/engine/analyze.cjs"}},"./engine/inheritance":{"import":{"types":"./dist/engine/inheritance.d.ts","default":"./dist/engine/inheritance.js"},"require":{"types":"./dist/engine/inheritance.d.cts","default":"./dist/engine/inheritance.cjs"}},"./engine/instanceTriples":{"import":{"types":"./dist/engine/instanceTriples.d.ts","default":"./dist/engine/instanceTriples.js"},"require":{"types":"./dist/engine/instanceTriples.d.cts","default":"./dist/engine/instanceTriples.cjs"}},"./engine/instanceValidation":{"import":{"types":"./dist/engine/instanceValidation.d.ts","default":"./dist/engine/instanceValidation.js"},"require":{"types":"./dist/engine/instanceValidation.d.cts","default":"./dist/engine/instanceValidation.cjs"}},"./engine/m0Triples":{"import":{"types":"./dist/engine/m0Triples.d.ts","default":"./dist/engine/m0Triples.js"},"require":{"types":"./dist/engine/m0Triples.d.cts","default":"./dist/engine/m0Triples.cjs"}},"./engine/serialize":{"import":{"types":"./dist/engine/serialize.d.ts","default":"./dist/engine/serialize.js"},"require":{"types":"./dist/engine/serialize.d.cts","default":"./dist/engine/serialize.cjs"}},"./engine/normalize":{"import":{"types":"./dist/engine/normalize.d.ts","default":"./dist/engine/normalize.js"},"require":{"types":"./dist/engine/normalize.d.cts","default":"./dist/engine/normalize.cjs"}},"./export":{"import":{"types":"./dist/export/index.d.ts","default":"./dist/export/index.js"},"require":{"types":"./dist/export/index.d.cts","default":"./dist/export/index.cjs"}},"./generate":{"import":{"types":"./dist/generate/index.d.ts","default":"./dist/generate/index.js"},"require":{"types":"./dist/generate/index.d.cts","default":"./dist/generate/index.cjs"}},"./generate/index":{"import":{"types":"./dist/generate/index.d.ts","default":"./dist/generate/index.js"},"require":{"types":"./dist/generate/index.d.cts","default":"./dist/generate/index.cjs"}},"./generate/app":{"import":{"types":"./dist/generate/app.d.ts","default":"./dist/generate/app.js"},"require":{"types":"./dist/generate/app.d.cts","default":"./dist/generate/app.cjs"}},"./generate/domainLayer":{"import":{"types":"./dist/generate/domainLayer.d.ts","default":"./dist/generate/domainLayer.js"},"require":{"types":"./dist/generate/domainLayer.d.cts","default":"./dist/generate/domainLayer.cjs"}},"./generate/export":{"import":{"types":"./dist/generate/export.d.ts","default":"./dist/generate/export.js"},"require":{"types":"./dist/generate/export.d.cts","default":"./dist/generate/export.cjs"}},"./generate/download":{"import":{"types":"./dist/generate/download.d.ts","default":"./dist/generate/download.js"},"require":{"types":"./dist/generate/download.d.cts","default":"./dist/generate/download.cjs"}},"./generate/selfProjection":{"import":{"types":"./dist/generate/selfProjection.d.ts","default":"./dist/generate/selfProjection.js"},"require":{"types":"./dist/generate/selfProjection.d.cts","default":"./dist/generate/selfProjection.cjs"}},"./meta":{"import":{"types":"./dist/meta/index.d.ts","default":"./dist/meta/index.js"},"require":{"types":"./dist/meta/index.d.cts","default":"./dist/meta/index.cjs"}},"./meta/customTypes":{"import":{"types":"./dist/meta/customTypes.d.ts","default":"./dist/meta/customTypes.js"},"require":{"types":"./dist/meta/customTypes.d.cts","default":"./dist/meta/customTypes.cjs"}},"./meta/ontology":{"import":{"types":"./dist/meta/ontology.d.ts","default":"./dist/meta/ontology.js"},"require":{"types":"./dist/meta/ontology.d.cts","default":"./dist/meta/ontology.cjs"}},"./meta/i18n":{"import":{"types":"./dist/meta/i18n.d.ts","default":"./dist/meta/i18n.js"},"require":{"types":"./dist/meta/i18n.d.cts","default":"./dist/meta/i18n.cjs"}},"./meta/vocabulary":{"import":{"types":"./dist/meta/vocabulary.d.ts","default":"./dist/meta/vocabulary.js"},"require":{"types":"./dist/meta/vocabulary.d.cts","default":"./dist/meta/vocabulary.cjs"}},"./meta/fields":{"import":{"types":"./dist/meta/fields.d.ts","default":"./dist/meta/fields.js"},"require":{"types":"./dist/meta/fields.d.cts","default":"./dist/meta/fields.cjs"}},"./meta/facets":{"import":{"types":"./dist/meta/facets.d.ts","default":"./dist/meta/facets.js"},"require":{"types":"./dist/meta/facets.d.cts","default":"./dist/meta/facets.cjs"}},"./migrations":{"import":{"types":"./dist/migrations/index.d.ts","default":"./dist/migrations/index.js"},"require":{"types":"./dist/migrations/index.d.cts","default":"./dist/migrations/index.cjs"}},"./runtime":{"import":{"types":"./dist/runtime/index.d.ts","default":"./dist/runtime/index.js"},"require":{"types":"./dist/runtime/index.d.cts","default":"./dist/runtime/index.cjs"}},"./runtime/pipelineRuntime":{"import":{"types":"./dist/runtime/pipelineRuntime.d.ts","default":"./dist/runtime/pipelineRuntime.js"},"require":{"types":"./dist/runtime/pipelineRuntime.d.cts","default":"./dist/runtime/pipelineRuntime.cjs"}},"./runtime/queryBuilder":{"import":{"types":"./dist/runtime/queryBuilder.d.ts","default":"./dist/runtime/queryBuilder.js"},"require":{"types":"./dist/runtime/queryBuilder.d.cts","default":"./dist/runtime/queryBuilder.cjs"}},"./runtime/typedCollection":{"import":{"types":"./dist/runtime/typedCollection.d.ts","default":"./dist/runtime/typedCollection.js"},"require":{"types":"./dist/runtime/typedCollection.d.cts","default":"./dist/runtime/typedCollection.cjs"}},"./runtime/writebackRuntime":{"import":{"types":"./dist/runtime/writebackRuntime.d.ts","default":"./dist/runtime/writebackRuntime.js"},"require":{"types":"./dist/runtime/writebackRuntime.d.cts","default":"./dist/runtime/writebackRuntime.cjs"}},"./runtime/inMemoryRepository":{"import":{"types":"./dist/runtime/inMemoryRepository.d.ts","default":"./dist/runtime/inMemoryRepository.js"},"require":{"types":"./dist/runtime/inMemoryRepository.d.cts","default":"./dist/runtime/inMemoryRepository.cjs"}},"./runtime/providers/localProvider":{"import":{"types":"./dist/runtime/providers/localProvider.d.ts","default":"./dist/runtime/providers/localProvider.js"},"require":{"types":"./dist/runtime/providers/localProvider.d.cts","default":"./dist/runtime/providers/localProvider.cjs"}},"./types":{"import":{"types":"./dist/types/index.d.ts","default":"./dist/types/index.js"},"require":{"types":"./dist/types/index.d.cts","default":"./dist/types/index.cjs"}},"./types/context":{"import":{"types":"./dist/types/context.d.ts","default":"./dist/types/context.js"},"require":{"types":"./dist/types/context.d.cts","default":"./dist/types/context.cjs"}},"./types/commands":{"import":{"types":"./dist/types/commands.d.ts","default":"./dist/types/commands.js"},"require":{"types":"./dist/types/commands.d.cts","default":"./dist/types/commands.cjs"}},"./types/query":{"import":{"types":"./dist/types/query.d.ts","default":"./dist/types/query.js"},"require":{"types":"./dist/types/query.d.cts","default":"./dist/types/query.cjs"}},"./types/branch":{"import":{"types":"./dist/types/branch.d.ts","default":"./dist/types/branch.js"},"require":{"types":"./dist/types/branch.d.cts","default":"./dist/types/branch.cjs"}},"./types/commits":{"import":{"types":"./dist/types/commits.d.ts","default":"./dist/types/commits.js"},"require":{"types":"./dist/types/commits.d.cts","default":"./dist/types/commits.cjs"}},"./types/instance":{"import":{"types":"./dist/types/instance.d.ts","default":"./dist/types/instance.js"},"require":{"types":"./dist/types/instance.d.cts","default":"./dist/types/instance.cjs"}},"./types/m0":{"import":{"types":"./dist/types/m0.d.ts","default":"./dist/types/m0.js"},"require":{"types":"./dist/types/m0.d.cts","default":"./dist/types/m0.cjs"}},"./util":{"import":{"types":"./dist/util/templates.d.ts","default":"./dist/util/templates.js"},"require":{"types":"./dist/util/templates.d.cts","default":"./dist/util/templates.cjs"}},"./util/templates":{"import":{"types":"./dist/util/templates.d.ts","default":"./dist/util/templates.js"},"require":{"types":"./dist/util/templates.d.cts","default":"./dist/util/templates.cjs"}}},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest run","test:watch":"vitest","typecheck":"tsc --noEmit","prepublishOnly":"npm run build","clean":"rm -rf dist"},"dependencies":{"immer":"^10.0.0","klona":"^2.0.6","nanoid":"^5.0.0"},"devDependencies":{"@types/node":"^24.6.1","tsup":"^8.5.1","typescript":"^6.0.2","vitest":"^3.2.4"},"peerDependencies":{"typescript":">=5.0.0"},"peerDependenciesMeta":{"typescript":{"optional":true}},"publishConfig":{"access":"public"},"engines":{"node":">=18.0.0"},"_id":"@businessmaps/metaontology@0.62.0","gitHead":"2d00b310631258c7c43727ee26668c3350dc9d19","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-h9CxYnxYnPf9lvFj9np6QPWUFt957c4o/Z6xkBKfCMfmNKrOLDtYrRRB8+p4veGm1YWDP1puHeVPoLlHOA6s8g==","shasum":"6e72557434ed5d9d329b80402408061a8be54c06","tarball":"https://registry.npmjs.org/@businessmaps/metaontology/-/metaontology-0.62.0.tgz","fileCount":493,"unpackedSize":4499440,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@businessmaps%2fmetaontology@0.62.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDI/xTJuLBIOFmWlm6UeoSjnzwzFOuTFmHgCV8vTW4X6AiEApcYijQCswLcWZaFfbZ9KPi+Qly5cSNpCppQ3waA9Ye4="}]},"_npmUser":{"name":"shalashtein","email":"shalashtein@gmail.com"},"directories":{},"maintainers":[{"name":"shalashtein","email":"shalashtein@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/metaontology_0.62.0_1776154461587_0.7973990910805502"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-12T00:26:25.870Z","modified":"2026-04-14T08:14:22.187Z","0.61.3":"2026-04-12T00:26:26.237Z","0.62.0":"2026-04-14T08:14:21.782Z"},"bugs":{"url":"https://github.com/Business-Maps/metaontology/issues"},"author":{"name":"Business Maps"},"license":"Apache-2.0","homepage":"https://github.com/Business-Maps/metaontology#readme","keywords":["ontology","metaontology","knowledge-graph","business-maps","dsl","modeling"],"repository":{"type":"git","url":"git+https://github.com/Business-Maps/metaontology.git"},"description":"A metaontology that supercharges your app. Built on the Business Maps framework for modeling businesses as structured knowledge graphs.","maintainers":[{"name":"shalashtein","email":"shalashtein@gmail.com"}],"readme":"# @businessmaps/metaontology\n\nA typed domain modeling framework for TypeScript. Define your business entities, relationships, and processes once; get an immutable command engine, a triple store, set-theoretic queries, three-way merge, completeness checking, and RDF export.\n\nIf you've built TypeScript applications around a domain model, you've probably written something like `type Order = { id: string; items: OrderItem[]; status: string }`. That works until you need to know which status transitions are valid, who can perform them, which downstream systems care, and whether your model actually covers everything. You end up with validation logic scattered across three layers, a state machine in a separate file, and a data dictionary in a document nobody keeps current. This framework treats the domain model itself as a structured artifact: typed, queryable, versioned, and projectable to linked data.\n\n```ts\nimport { defineThing, definePredicate, decimal, enumOf }\n  from '@businessmaps/metaontology'\n\nconst product = defineThing('Product', {\n  attributes: { price: decimal, category: enumOf('electronics', 'clothing', 'food') },\n})\nconst warehouse = defineThing('Warehouse', { attributes: { capacity: decimal } })\nconst stocks = definePredicate('stocks', { domain: [warehouse], range: [product] })\n```\n\nEvery `defineThing` call registers a typed entity in a runtime registry. Every `definePredicate` call declares a validated relationship with `domain` and `range` constraints. Both sides carry full TypeScript inference; no codegen step required. The engine enforces the constraints, computes inverses for undo, and projects everything to triples.\n\n---\n\n## Getting started\n\n```bash\nnpm install @businessmaps/metaontology\n```\n\n### 1. Define your domain\n\n```ts\n// domain.ts\nimport { defineThing, definePersona, definePredicate,\n         text, decimal, markdown, enumOf } from '@businessmaps/metaontology'\n\nexport const product = defineThing('Product', {\n  attributes: {\n    sku:         text,\n    price:       decimal,\n    description: markdown,\n    category:    enumOf('electronics', 'clothing', 'food', 'other'),\n  },\n})\n\nexport const warehouse = definePersona('Warehouse', {\n  attributes: {\n    location: text,\n    capacity: decimal,\n  },\n})\n\nexport const stocks = definePredicate('stocks', {\n  domain: [warehouse],\n  range:  [product],\n  label:        { en: 'stocks' },\n  inverseLabel: { en: 'stocked by' },\n})\n```\n\n### 2. Wire the dispatcher\n\n`applyCommand` is a pure function: model in, result out. It has no idea where your state lives. The dispatcher binding is the seam that connects the two; set it up once at startup, then the typed handles on `product`, `warehouse`, and `stocks` route commands through it automatically.\n\n```ts\n// app.ts\nimport { bindDispatcher, bindRootAccessor } from '@businessmaps/metaontology'\nimport { createEmptyRootContext, applyCommand } from '@businessmaps/metaontology/engine'\n\nlet model = createEmptyRootContext('My Business')\n\nbindDispatcher((cmd) => {\n  const result = applyCommand(model, cmd)\n  if (result.success) model = result.state\n  return result\n})\n\nbindRootAccessor(() => model)\n```\n\nYour state can live anywhere: a plain variable, a Pinia store, Redux, a database. The framework has no opinion.\n\n### 3. Create entities and relationships\n\n```ts\nimport { product, warehouse, stocks } from './domain'\n\nconst widgetId = product.add({\n  name: 'Widget', sku: 'W-001',\n  price: 9.99, category: 'electronics',\n})\n\nconst dcId = warehouse.add({\n  name: 'Main Distribution Center',\n  location: 'Denver', capacity: 50000,\n})\n\n// The framework checks that dcId resolves to a Warehouse (domain)\n// and widgetId resolves to a Product (range) before creating the link.\nstocks.link(dcId, widgetId)\n\n// Direct lookup\nproduct.findByUri(widgetId)\n```\n\nFor set-theoretic queries across the model (filtering by attributes, traversing the relationship graph, aggregating) see the [Query algebra](#query-algebra) section.\n\n---\n\n## What is a metaontology?\n\nAn ontology describes a domain: \"an Order has line items, a Customer places Orders.\" A *meta*ontology describes how to describe domains: there are Things with attributes, Personas that act, Events that happen, and typed predicates that connect them.\n\nThis package is the metaontology: the M2 layer. It doesn't know about your business. Your domain declarations (`defineThing('Order', {...})`) are the M1 layer. The live data those types produce at runtime are M0.\n\n```\nM2  @businessmaps/metaontology     DSL, engine, triple store, query algebra\n    ────────────────────────────   entity classes, predicates, datatypes\nM1  Your Domain Ontology            defineThing('Order', {...})\n    ────────────────────────────   defineAction('PlaceOrder', {...})\nM0  Runtime Instances               a specific order placed at 14:32 on Tuesday\n```\n\nThe separation is not academic. M2 changes rarely: when a new entity class or predicate is added to the framework. M1 changes during modeling sessions: when a team adds a new bounded context or redefines a relationship. M0 changes continuously during operation: when customer records arrive from Stripe, when orders are placed, when inventory moves. Each layer has its own mutation contract, its own persistence strategy, and its own merge semantics. Keeping them distinct means you can evolve one without breaking the others.\n\nDifferent businesses share the framework (M2) but declare different ontologies (M1). A logistics company and a healthcare company both use `defineThing`, `defineAction`, and `definePredicate`, but their entities, actions, and relationships differ. Each domain can have multiple applications on top (a visual modeler, an admin panel, a CLI, a monitoring dashboard), all reading from the same M1 model.\n\n---\n\n## The model\n\nEverything lives in a single `RootContext`, a plain JSON-serializable object that is the complete, portable state of your domain model.\n\n**Contexts** are bounded contexts in the DDD sense. `RootContext.contexts` is a flat map of `Context` objects; `parentUri` on each context forms the tree. Each context is a `FacetContainer` that holds its own entities, symbols, and any user-defined entity instances. The flat map (rather than nested objects) enables O(1) lookup by URI and simplifies merge: context tree shape is expressed through data, not through nesting.\n\n**Facets** are the typed entities. The framework ships 11 built-in facet types (see [The 11 primitives](#the-11-primitives)); each lives in a typed array inside its container. User-defined entity types declared via `customTypes` are stored in `customFacets`. Every facet carries at minimum a `uri` and `name`.\n\n**Links** are the persisted relationships. They live in a flat array at the root, not nested inside the entities they connect. This means a link between a Customer in `ctx-sales` and an Order in `ctx-fulfillment` doesn't break if either context is reorganized. Links are validated against the predicate registry on creation.\n\n**Symbols** are free-form notes: sticky-note stubs with an `id` and `content`, useful during early modeling when you know something exists but haven't decided what type it is. A `symbol:classify` command promotes a symbol to a typed facet without changing its URI.\n\n---\n\n## The 11 primitives\n\nEleven abstract entity types organized into three tiers. Start with what exists; add what happens; add how it's built.\n\n**Tier 1: What exists**\n\n| Primitive | What it models |\n|---|---|\n| **Thing** | Domain entities: Order, Customer, Product, Invoice. The nouns of your business. |\n| **Persona** | Actors: humans, teams, systems, external services. Who (or what) does things. |\n\n**Tier 2: What happens**\n\n| Primitive | What it models |\n|---|---|\n| **Port** | Boundary contracts: what a context produces or consumes. |\n| **Action** | Operations: commands that change state, queries that read it, intents that represent goals. |\n| **Workflow** | Processes: multi-step sequences with triggers, SLAs, and step-level assignment. |\n| **Event** | Things that happened: domain events, state changes, signals with typed payloads. |\n| **Measure** | What you track: KPIs, aggregations, financial metrics with units and time windows. |\n\n**Tier 3: How it's built**\n\n| Primitive | What it models |\n|---|---|\n| **Interface** | Surfaces: pages, APIs, dashboards, forms, webhooks, reports. 12 interface kinds. |\n| **Function** | Pure computations: validators, formatters, calculators. |\n| **DataSource** | External connections: Stripe, Postgres, S3, CSV. Carries auth config and connection status. |\n| **Pipeline** | Data flows: pull from a DataSource, map fields, populate Things. |\n\nYour domain declares subtypes of these primitives via `defineThing('Order', {...})`, `defineAction('PlaceOrder', {...})`, and so on. The engine, query algebra, and triple projection work uniformly across all 11 types without needing to know which specific subtype you declared.\n\n---\n\n## Commands\n\nThe model is immutable. All mutations flow through commands: `applyCommand(root, cmd)` takes a `RootContext` and returns a new one, or an error. The original state is always unchanged.\n\n```ts\nimport { createEmptyRootContext, applyCommand, applyBatch }\n  from '@businessmaps/metaontology/engine'\nimport { computeInverse } from '@businessmaps/metaontology/engine'\n\nconst root = createEmptyRootContext('My Business')\n\n// Apply a single command\nconst result = applyCommand(root, {\n  type: 'facet:add',\n  payload: {\n    contextUri: root.uri,\n    facetType: 'things',\n    facet: { uri: 'thing-1', name: 'Order', attributes: [], tags: [] },\n  },\n})\n// result: { success, state, error?, warnings, events }\n\n// Compute the inverse (for undo)\nconst undoCmd = computeInverse(result.command, root, result.state)\nconst { state: restored } = applyCommand(result.state, undoCmd)\n\n// Batch: multiple commands, all-or-nothing\nconst batchResult = applyBatch(root, {\n  type: 'batch',\n  payload: {\n    label: 'Setup initial model',\n    commands: [\n      { type: 'facet:add', payload: { contextUri: root.uri, facetType: 'things',\n          facet: { uri: 't1', name: 'Order', attributes: [], tags: [] } } },\n      { type: 'facet:add', payload: { contextUri: root.uri, facetType: 'personas',\n          facet: { uri: 'p1', name: 'Customer', tags: [] } } },\n      { type: 'link:add', payload: { predicate: 'owns', sourceUri: 'p1', targetUri: 't1' } },\n    ],\n  },\n})\n```\n\nEvery command has a computed inverse. Undo appends the inverse as a new commit; the log never rewinds. This means undo, redo, branching, collaborative sync, and conflict resolution all compose from the same primitive without special-casing any of them.\n\n### Command types\n\n| Command | Purpose |\n|---|---|\n| `context:add/remove/rename/update` | Manage sub-contexts (bounded-context modeling) |\n| `facet:add/update/remove/move/retype` | Create, modify, delete, relocate, or reclassify entities |\n| `link:add/remove/update` | Typed relationships between entities |\n| `symbol:add/update/remove/classify` | Free-form notes, promotable to typed entities |\n| `assertion:add/update/remove` | Model quality assertions |\n\n---\n\n## Triple store\n\nThe engine projects the typed model into `(subject, predicate, object)` triples for O(1) lookups on any axis. This is a read-only projection of the model; triples are not the storage format.\n\n```ts\nimport { projectToTriples, buildIndexes, sp, po, spo }\n  from '@businessmaps/metaontology/engine/triples'\n\nconst triples = projectToTriples(model)\nconst idx = buildIndexes(triples)\n\n// What type is entity X?\nidx.typeOf.get('thing-order')                         // 'Thing'\n\n// All triples about entity X\nidx.byS.get('thing-order')                            // Triple[]\n\n// Who performs action Y?\nidx.bySP.get(sp('action-place', 'performs'))           // Triple[]\n\n// What entities are Things?\nidx.byPO.get(po('rdf:type', 'https://ontology.businessmaps.io/Thing'))\n\n// Existence check in O(1)\nidx.bySPO.has(spo('p1', 'performs', 'a1'))             // boolean\n```\n\nStructural relationships (`childOf`, `memberOf`, `hasTag`) appear as derived triples even though they are not stored as `Link` records. A link between a context and its parent doesn't need a `Link` entry; the tree structure already expresses it. The triple index makes both stored and structural relationships queryable through the same interface.\n\n### RDF serialization\n\n```ts\nimport { serialiseAsTurtle, serialiseAsJsonLd, serialiseAsNTriples }\n  from '@businessmaps/metaontology/engine/triples'\n\nconst turtle = serialiseAsTurtle(triples)\nconst jsonld = serialiseAsJsonLd(triples)\nconst nt     = serialiseAsNTriples(triples)\n```\n\nActual Turtle output for a `Product` entity named \"Widget\" in a model with URI `my-map`:\n\n```turtle\n@prefix bm:   <https://ontology.businessmaps.io/> .\n@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix xsd:  <http://www.w3.org/2001/XMLSchema#> .\n\nbm:entity/thing-1\n  a bm:Thing ;\n  rdfs:label \"Widget\"^^xsd:string ;\n  bm:memberOf bm:entity/my-map .\n\nbm:entity/my-map\n  bm:stocks bm:entity/thing-1 .\n```\n\nEvery entity has a stable URI formed from the namespace and the entity's `uri` field. Predicates in stored links use the registered predicate URI. The namespace is configurable (see [Namespace configuration](#namespace-configuration)); Turtle, JSON-LD, N-Triples, and TriG (named graphs per context) are supported. The framework does not generate OWL axioms or support SPARQL directly; the triple projection is a standard RDF serialization for export and interoperability.\n\n---\n\n## Query algebra\n\nSet-theoretic expressions over the model graph, composable from primitives:\n\n```ts\nimport { evaluateSetExpr } from '@businessmaps/metaontology/engine/query'\n\n// All Things\nevaluateSetExpr(model, { op: 'base', objectType: 'Thing' })\n\n// All entities in a bounded context\nevaluateSetExpr(model, { op: 'context', contextId: 'ctx-checkout' })\n\n// Things that are targets of at least one 'performs' link\nevaluateSetExpr(model, {\n  op: 'filter',\n  base:  { op: 'base', objectType: 'Thing' },\n  where: { op: 'hasLink', predicate: 'performs', direction: 'in' },\n})\n\n// Graph traversal: everything within 2 hops of an action\nevaluateSetExpr(model, {\n  op:        'traverse',\n  from:      { op: 'ids', ids: ['action-place-order'] },\n  predicate: '*',\n  direction: 'both',\n  depth:     2,\n})\n\n// Set composition: Things also tagged 'revenue-bearing'\nevaluateSetExpr(model, {\n  op:   'intersect',\n  sets: [\n    { op: 'base',   objectType: 'Thing' },\n    { op: 'tagged', tag: 'revenue-bearing' },\n  ],\n})\n```\n\nSupported operations: `base`, `context`, `tagged`, `ids`, `union`, `intersect`, `subtract`, `traverse`, `filter`, `aggregate`. Filter predicates: 18 variants including `eq`, `neq`, `contains`, `regex`, `hasLink`, `hasTag`, `hasStereotype`, `facetCount`, and boolean combinators `and`/`or`/`not`. Aggregate operations: `count`, `sum`, `avg`, `min`, `max`, `countDistinct`, `groupBy`.\n\nHigher-level helpers for common operations:\n\n```ts\nimport { searchEntities, describeContext, listContexts }\n  from '@businessmaps/metaontology/engine/query'\n\nsearchEntities(model, 'order')         // full-text search across names and definitions\ndescribeContext(model, model.uri)       // context with all its facets and links\nlistContexts(model)                    // hierarchical context tree\n```\n\nAn async evaluator, `evaluateSetExprM0`, runs the same algebra against M0 runtime instances via a `InstanceRepository` interface for queries against live data rather than the model schema.\n\n---\n\n## Branching and three-way merge\n\n```ts\nimport { mergeRootContexts } from '@businessmaps/metaontology/engine/merge'\nimport { diffRootContexts }  from '@businessmaps/metaontology/engine/diff'\n\n// Fork: snapshot the current model\nconst base = structuredClone(model)\n\n// Both sides edit independently\nconst ours   = applyCommand(base, ourCmd).state\nconst theirs = applyCommand(base, theirCmd).state\n\n// Diff: what changed between base and theirs?\nconst diff = diffRootContexts(base, theirs)\n// diff.facets, diff.links, diff.contexts, each with changeType: 'added' | 'removed' | 'modified'\n\n// Three-way merge with conflict detection\nconst result = mergeRootContexts({ base, ours, theirs })\n\nif (result.success) {\n  model = result.mergedModel\n} else {\n  for (const conflict of result.conflicts) {\n    conflict.resolution = 'ours'  // or 'theirs'\n  }\n}\n```\n\n---\n\n## Completeness engine\n\nDeclare structural assertions about model quality. The engine evaluates them against the live model and returns typed violations.\n\n```ts\nimport { evaluateAllGaps, generateDefaultAssertions }\n  from '@businessmaps/metaontology/engine/completeness'\n\n// Ontology-derived defaults: \"every Action should have a performer\", etc.\nconst defaults = generateDefaultAssertions()\n\n// Custom assertions\nconst assertion = {\n  id:       'require-attributes',\n  name:     'Every Thing should have at least one attribute',\n  selector: { scope: 'entityType', entityTypes: ['things'] },\n  rule:     { type: 'requires-field', field: 'attributes', facetTypes: ['things'] },\n  severity: 'warning',\n  enabled:  true,\n}\n\nconst violations = evaluateAllGaps(model)\n// [{ entityName: 'Order', message: 'Thing \"Order\" has no \"performs\" links', severity: 'info' }]\n```\n\nSeven rule types: `requires-field`, `requires-link`, `min-count`, `max-count`, `requires-tag`, `requires-stereotype`, `custom`. Assertions are stored in `RootContext.assertions` and can be added, updated, or removed via commands, so they participate in the same undo/redo/sync flow as the rest of the model.\n\n---\n\n## Persistence\n\n`RootContext` is a plain JSON-serializable object. Store it however you want:\n\n```ts\n// File system\nawait fs.writeFile('model.json', JSON.stringify(model, null, 2))\nconst loaded = JSON.parse(await fs.readFile('model.json', 'utf8')) as RootContext\n\n// localStorage\nlocalStorage.setItem('my-model', JSON.stringify(model))\n\n// Any database\nawait db.put('model', JSON.stringify(model))\n```\n\nFor versioned persistence with undo history, implement a commit log on top of the command engine:\n\n```ts\ninterface Commit {\n  id:        string\n  command:   DispatchableCommand\n  inverse:   DispatchableCommand\n  timestamp: string\n}\n\nconst commits: Commit[] = []\n\nfunction commitCommand(cmd) {\n  const before = model\n  const result = applyCommand(model, cmd)\n  if (!result.success) return result\n\n  model = result.state\n  commits.push({\n    id:        nanoid(),\n    command:   cmd,\n    inverse:   computeInverse(cmd, before, model),\n    timestamp: new Date().toISOString(),\n  })\n  return result\n}\n\nfunction undo() {\n  const last = commits.pop()\n  if (!last) return\n  const result = applyCommand(model, last.inverse)\n  if (result.success) model = result.state\n}\n```\n\nLoading a model is loading the latest checkpoint and replaying commits since. The `@businessmaps/metaontology` package defines the `Commit` type and `computeInverse`; the storage layer is yours to choose.\n\n---\n\n## Pipeline runtime\n\nPull data from external systems, map fields, and populate model entities:\n\n```ts\nimport { createPipelineRuntime } from '@businessmaps/metaontology/runtime/pipelineRuntime'\nimport { createFakeTransport }   from '@businessmaps/metaontology/runtime/transports/fakeTransport'\nimport { createLocalProvider }   from '@businessmaps/metaontology/runtime/providers/localProvider'\n\nconst runtime   = createPipelineRuntime()\nconst transport = createFakeTransport()\nconst provider  = createLocalProvider({ thingId: 'thing-customer' })\n\nruntime.register(pipeline, { transport, provider, dataSource: stripeDs })\n\nconst result = await runtime.runOnce('pipe-stripe-customers')\n// { status: 'ok', fetched: 100, mapped: 100, written: 100, errors: 0 }\n```\n\nMapping is declarative JSON: an `iterate` path expression selects the source array, `identity.externalId` extracts the upsert key, and `fields` maps source paths to entity attribute names. The mapping engine uses a JSONata-style path subset (`$`, `$.a.b.c`, literals). Same input + same mapping + same transform always produces the same output.\n\n---\n\n## Predicates and relationships\n\nThe framework ships 45 predicates in three tiers.\n\n**Framework tier** covers the structural metamodel: who performs what, who owns what, what triggers what, what is composed of what. Examples: `performs`, `stewards`, `owns`, `triggers`, `uses`, `emits`, `exposes`, `composes`, `extends`, `derivedFrom`. These are validated against the 11 entity types: a link using `performs` where the source is not a Persona will be rejected.\n\n**Domain tier** covers cross-cutting relationships useful across many business domains: `dependsOn`, `flowsTo`, `implements`, `produces`, `consumes`, `sameConceptAs`.\n\n**Structural predicates** (`childOf`, `memberOf`, `hasTag`, and others) are derived from model structure and projected as triples without being stored as `Link` records.\n\nWhen the curated set doesn't fit, add your own:\n\n```ts\nimport { definePredicate } from '@businessmaps/metaontology'\n\nconst assignedTo = definePredicate('assignedTo', {\n  domain: [order],\n  range:  [customer],\n  label:        { en: 'assigned to' },\n  inverseLabel: { en: 'has assignment' },\n  cardinality:  { source: 'many', target: 'one' },\n})\n\nassignedTo.link(orderId, customerId)\n```\n\nCustom predicates participate in the same validation, triple projection, and query algebra as built-in predicates.\n\n---\n\n## Datatypes\n\n18 XSD-grounded attribute types with TypeScript mappings:\n\n| Family | Types |\n|---|---|\n| **String** | `text`, `identifier`, `email`, `uri`, `markdown` |\n| **Number** | `integer`, `decimal`, `percentage`, `money` (+ `currencyCode`), `quantity` (+ `unit`) |\n| **Temporal** | `date`, `dateTime`, `time`, `duration` |\n| **Boolean** | `boolean` |\n| **Complex** | `reference`, `enum`, `list` |\n\nAdd semantic value types with validation constraints:\n\n```ts\nimport { defineValueType } from '@businessmaps/metaontology'\n\nconst rating = defineValueType('rating', {\n  baseType:    'integer',\n  constraints: [{ type: 'range', min: 1, max: 5 }],\n})\n```\n\n---\n\n## Namespace configuration\n\nBy default, entity classes, predicates, and datatypes use `https://ontology.businessmaps.io/` as their namespace. To use your own:\n\n```ts\nimport { configureOntologyNamespace } from '@businessmaps/metaontology'\n\nconfigureOntologyNamespace({\n  namespace: 'https://ontology.example.com/',\n  prefix:    'ex',\n})\n```\n\nCall this once at startup, before any `defineX` calls.\n\n---\n\n## Code generation\n\nThe `generate/` module produces source code from a `RootContext`. All generators are pure functions: `(RootContext) => string`.\n\nAvailable: TypeScript types, Zod schemas, event schemas, guard functions, test skeletons, service boundary documentation, Nuxt domain layers, and Vue application scaffolds. The framework itself has no Vue or Nuxt runtime dependency; these are output formats produced by the generators, not dependencies of the package.\n\n---\n\n## Directory structure\n\n```\ndsl/        Schema combinators, typed handles, dispatcher bridge, DSL registry\ncore/       Built-in declarations: 11 base types, 18 datatypes, 10 value types, 45 predicates\nengine/     Pure operations: apply, inverse, merge, diff, triples, query, completeness, inheritance\nruntime/    M0 instance layer: providers, transports, pipeline runtime, action interpreter\ntypes/      Generated (context.ts) and hand-authored types: commands, query, branch, commits\nmeta/       Metaontology registries: entity classes, predicates, fields, vocabulary\nmigrations/ Schema migrations for forward compatibility\ngenerate/   Code generators: TS types, Zod schemas, Nuxt apps, domain layers\nexport/     Bundle and scaffold generation\nutil/       Template helpers\n```\n\n---\n\n## FAIR compliance\n\nThe framework supports the [FAIR principles](https://www.go-fair.org/fair-principles/):\n\n- **Findable**: every entity class, predicate, and datatype has a persistent, configurable URI.\n- **Accessible**: the model is a plain JSON document. No proprietary format, no binary encoding, no runtime dependency to read it.\n- **Interoperable**: the triple store projects to standard RDF. Labels are language-tagged (`{ en: string; [lang: string]: string }`). Datatypes map to XSD. Predicates follow RDFS conventions where applicable.\n- **Reusable**: the SPEC defines a conformance checklist. Any language can implement a compatible reader/writer. The model carries its own vocabulary.\n\n---\n\n## Design decisions\n\n**Immutable state, command-sourced.** The model is never mutated directly. Every change goes through a command that produces a new state. This makes undo, redo, branching, merge, and sync possible without special-casing any of them; they all compose from the same `applyCommand` primitive.\n\n**Append-only log.** Undo doesn't rewind history. It appends the inverse command. The commit log is a complete linear record of everything that happened, which makes collaboration and conflict resolution tractable without distributed coordination at the command level.\n\n**Pure engine.** `applyCommand` has no side effects, no async, no framework dependency. It takes a model and a command, returns a result. This makes it testable in isolation, portable across environments, and safe to call from any context including service workers, background threads, and server-side code.\n\n**Registry-driven.** Entity classes, predicates, datatypes, and validation rules live in a runtime registry populated by `defineX()` calls at module load time. The engine reads from the registry rather than from hardcoded constants. Consumer layers can extend the vocabulary (new entity types, new predicates, new datatypes) without forking the engine or modifying package internals.\n\n**Persistence-agnostic.** `RootContext` is a plain JSON object. The framework has no opinion about IndexedDB, Postgres, S3, or any storage backend. The same model can be stored in a browser, a server database, a file, or memory, without any adapter layer in the framework itself.\n\n---\n\n## License\n\nApache License 2.0\n\nCopyright 2025 Business Maps\n","readmeFilename":"README.md"}