@dxos/echo-memory 0.0.0-stage → 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +105 -0
- package/dist/lib/Fact.mjs +1 -0
- package/dist/lib/FactFeed.mjs +1 -0
- package/dist/lib/Graph.mjs +1 -0
- package/dist/lib/Hash.mjs +1 -0
- package/dist/lib/Mapping.mjs +1 -0
- package/dist/lib/MemoryError.mjs +1 -0
- package/dist/lib/MemoryQuery.mjs +1 -0
- package/dist/lib/MemoryService.mjs +1 -0
- package/dist/lib/Ontology.mjs +1 -0
- package/dist/lib/Pipeline.mjs +1 -0
- package/dist/lib/Predicate.mjs +1 -0
- package/dist/lib/Rdf.mjs +1 -0
- package/dist/lib/RdfStore.mjs +1 -0
- package/dist/lib/Sparql.mjs +1 -0
- package/dist/lib/Subscription.mjs +1 -0
- package/dist/lib/Trig.mjs +1 -0
- package/dist/lib/Vocab.mjs +1 -0
- package/dist/lib/Vocabularies.mjs +1 -0
- package/dist/lib/chunk-Fact.mjs +245 -0
- package/dist/lib/chunk-Fact.mjs.map +1 -0
- package/dist/lib/chunk-FactFeed.mjs +29 -0
- package/dist/lib/chunk-FactFeed.mjs.map +1 -0
- package/dist/lib/chunk-Graph.mjs +147 -0
- package/dist/lib/chunk-Graph.mjs.map +1 -0
- package/dist/lib/chunk-Hash.mjs +16 -0
- package/dist/lib/chunk-Hash.mjs.map +1 -0
- package/dist/lib/chunk-Mapping.mjs +226 -0
- package/dist/lib/chunk-Mapping.mjs.map +1 -0
- package/dist/lib/chunk-MemoryError.mjs +10 -0
- package/dist/lib/chunk-MemoryError.mjs.map +1 -0
- package/dist/lib/chunk-MemoryQuery.mjs +99 -0
- package/dist/lib/chunk-MemoryQuery.mjs.map +1 -0
- package/dist/lib/chunk-MemoryService.mjs +31 -0
- package/dist/lib/chunk-MemoryService.mjs.map +1 -0
- package/dist/lib/chunk-Ontology.mjs +529 -0
- package/dist/lib/chunk-Ontology.mjs.map +1 -0
- package/dist/lib/chunk-Pipeline.mjs +84 -0
- package/dist/lib/chunk-Pipeline.mjs.map +1 -0
- package/dist/lib/chunk-Predicate.mjs +66 -0
- package/dist/lib/chunk-Predicate.mjs.map +1 -0
- package/dist/lib/chunk-Rdf.mjs +120 -0
- package/dist/lib/chunk-Rdf.mjs.map +1 -0
- package/dist/lib/chunk-RdfStore.mjs +60 -0
- package/dist/lib/chunk-RdfStore.mjs.map +1 -0
- package/dist/lib/chunk-Sparql.mjs +153 -0
- package/dist/lib/chunk-Sparql.mjs.map +1 -0
- package/dist/lib/chunk-Subscription.mjs +44 -0
- package/dist/lib/chunk-Subscription.mjs.map +1 -0
- package/dist/lib/chunk-Trig.mjs +106 -0
- package/dist/lib/chunk-Trig.mjs.map +1 -0
- package/dist/lib/chunk-Vocab.mjs +164 -0
- package/dist/lib/chunk-Vocab.mjs.map +1 -0
- package/dist/lib/chunk-Vocabularies.mjs +343 -0
- package/dist/lib/chunk-Vocabularies.mjs.map +1 -0
- package/dist/lib/chunk-rolldown-runtime.mjs +13 -0
- package/dist/lib/index.mjs +19 -0
- package/dist/types/src/Fact.d.ts +339 -0
- package/dist/types/src/Fact.d.ts.map +1 -0
- package/dist/types/src/Fact.test.d.ts +2 -0
- package/dist/types/src/Fact.test.d.ts.map +1 -0
- package/dist/types/src/FactFeed.d.ts +11 -0
- package/dist/types/src/FactFeed.d.ts.map +1 -0
- package/dist/types/src/FactFeed.test.d.ts +2 -0
- package/dist/types/src/FactFeed.test.d.ts.map +1 -0
- package/dist/types/src/Graph.d.ts +31 -0
- package/dist/types/src/Graph.d.ts.map +1 -0
- package/dist/types/src/Graph.test.d.ts +2 -0
- package/dist/types/src/Graph.test.d.ts.map +1 -0
- package/dist/types/src/Hash.d.ts +3 -0
- package/dist/types/src/Hash.d.ts.map +1 -0
- package/dist/types/src/Mapping.d.ts +18 -0
- package/dist/types/src/Mapping.d.ts.map +1 -0
- package/dist/types/src/Mapping.test.d.ts +2 -0
- package/dist/types/src/Mapping.test.d.ts.map +1 -0
- package/dist/types/src/MemoryError.d.ts +33 -0
- package/dist/types/src/MemoryError.d.ts.map +1 -0
- package/dist/types/src/MemoryQuery.d.ts +136 -0
- package/dist/types/src/MemoryQuery.d.ts.map +1 -0
- package/dist/types/src/MemoryQuery.test.d.ts +2 -0
- package/dist/types/src/MemoryQuery.test.d.ts.map +1 -0
- package/dist/types/src/MemoryService.d.ts +72 -0
- package/dist/types/src/MemoryService.d.ts.map +1 -0
- package/dist/types/src/Ontology.d.ts +115 -0
- package/dist/types/src/Ontology.d.ts.map +1 -0
- package/dist/types/src/Ontology.test.d.ts +2 -0
- package/dist/types/src/Ontology.test.d.ts.map +1 -0
- package/dist/types/src/Pipeline.d.ts +103 -0
- package/dist/types/src/Pipeline.d.ts.map +1 -0
- package/dist/types/src/Predicate.d.ts +17 -0
- package/dist/types/src/Predicate.d.ts.map +1 -0
- package/dist/types/src/Predicate.test.d.ts +2 -0
- package/dist/types/src/Predicate.test.d.ts.map +1 -0
- package/dist/types/src/Rdf.d.ts +33 -0
- package/dist/types/src/Rdf.d.ts.map +1 -0
- package/dist/types/src/Rdf.test.d.ts +2 -0
- package/dist/types/src/Rdf.test.d.ts.map +1 -0
- package/dist/types/src/RdfStore.d.ts +471 -0
- package/dist/types/src/RdfStore.d.ts.map +1 -0
- package/dist/types/src/Sparql.d.ts +58 -0
- package/dist/types/src/Sparql.d.ts.map +1 -0
- package/dist/types/src/Sparql.test.d.ts +2 -0
- package/dist/types/src/Sparql.test.d.ts.map +1 -0
- package/dist/types/src/Subscription.d.ts +100 -0
- package/dist/types/src/Subscription.d.ts.map +1 -0
- package/dist/types/src/Trig.d.ts +8 -0
- package/dist/types/src/Trig.d.ts.map +1 -0
- package/dist/types/src/Trig.test.d.ts +2 -0
- package/dist/types/src/Trig.test.d.ts.map +1 -0
- package/dist/types/src/Vocab.d.ts +90 -0
- package/dist/types/src/Vocab.d.ts.map +1 -0
- package/dist/types/src/Vocabularies.d.ts +45 -0
- package/dist/types/src/Vocabularies.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +19 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +133 -3
- package/src/Fact.test.ts +74 -0
- package/src/Fact.ts +269 -0
- package/src/FactFeed.test.ts +40 -0
- package/src/FactFeed.ts +38 -0
- package/src/Graph.test.ts +106 -0
- package/src/Graph.ts +158 -0
- package/src/Hash.ts +15 -0
- package/src/Mapping.test.ts +197 -0
- package/src/Mapping.ts +320 -0
- package/src/MemoryError.ts +10 -0
- package/src/MemoryQuery.test.ts +67 -0
- package/src/MemoryQuery.ts +114 -0
- package/src/MemoryService.ts +89 -0
- package/src/Ontology.test.ts +94 -0
- package/src/Ontology.ts +571 -0
- package/src/Pipeline.ts +97 -0
- package/src/Predicate.test.ts +47 -0
- package/src/Predicate.ts +89 -0
- package/src/Rdf.test.ts +104 -0
- package/src/Rdf.ts +158 -0
- package/src/RdfStore.ts +111 -0
- package/src/Sparql.test.ts +72 -0
- package/src/Sparql.ts +237 -0
- package/src/Subscription.ts +47 -0
- package/src/Trig.test.ts +199 -0
- package/src/Trig.ts +170 -0
- package/src/Vocab.ts +134 -0
- package/src/Vocabularies.ts +204 -0
- package/src/index.ts +22 -0
- package/README.md +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-Vocabularies.mjs","names":["Ontology.entry","Vocab.SCHEMA","Vocab.FOAF","Vocab.SIOC","Vocab.ORG","Vocab.DCTERMS","Ontology.DEFAULT"],"sources":["../../src/Vocabularies.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Ontology from './Ontology.ts';\nimport * as Vocab from './Vocab.ts';\n\n/**\n * A published vocabulary's predicates, under that vocabulary's own IRIs, as a pack an ontology can be seeded with. The\n * packs cover what conversations mostly state (people, organizations, work, discussion threads); each lists a curated\n * subset, since every predicate shown to the extractor costs prompt tokens.\n */\nexport type Pack = {\n /** Short id a configuration names the pack by (`schema`, `foaf`). */\n readonly id: string;\n readonly label: string;\n /** The vocabulary's namespace IRI; `rdfs:isDefinedBy` of every entry. */\n readonly namespace: string;\n readonly entries: ReadonlyArray<Ontology.Entry>;\n};\n\ntype Term = Omit<Ontology.Entry, 'iri' | 'name' | 'label' | 'definedBy'> & { readonly label?: string };\n\nconst pack = (id: string, label: string, namespace: string, terms: Record<string, [local: string, Term]>): Pack => ({\n id,\n label,\n namespace,\n entries: Object.entries(terms).map(([name, [local, term]]) =>\n Ontology.entry(name, { ...term, iri: `${namespace}${local}`, definedBy: namespace }),\n ),\n});\n\nconst schema = (name: string) => `${Vocab.SCHEMA}${name}`;\nconst foaf = (name: string) => `${Vocab.FOAF}${name}`;\nconst sioc = (name: string) => `${Vocab.SIOC}${name}`;\nconst org = (name: string) => `${Vocab.ORG}${name}`;\n\nconst PERSON = schema('Person');\nconst ORGANIZATION = schema('Organization');\nconst CREATIVE_WORK = schema('CreativeWork');\nconst EVENT = schema('Event');\n\n/** schema.org beyond the seed: authorship, employment, organizational structure, events and software. */\nexport const SCHEMA: Pack = pack('schema', 'schema.org', Vocab.SCHEMA, {\n has_author: ['author', { label: 'has author', range: PERSON, domain: CREATIVE_WORK }],\n publisher: ['publisher', { synonyms: ['published by'], domain: CREATIVE_WORK }],\n employee: [\n 'employee',\n { label: 'employs', synonyms: ['has employee', 'hired'], domain: ORGANIZATION, range: PERSON },\n ],\n colleague: ['colleague', { label: 'colleague of', synonyms: ['works with', 'is colleague of'], domain: PERSON }],\n parent_organization: [\n 'parentOrganization',\n {\n label: 'parent organization',\n synonyms: ['is subsidiary of', 'owned by company'],\n domain: ORGANIZATION,\n range: ORGANIZATION,\n },\n ],\n sub_organization: [\n 'subOrganization',\n {\n label: 'sub organization',\n synonyms: ['has subsidiary', 'has division'],\n domain: ORGANIZATION,\n range: ORGANIZATION,\n },\n ],\n affiliation: [\n 'affiliation',\n { label: 'affiliated with', synonyms: ['is affiliated with'], domain: PERSON, range: ORGANIZATION },\n ],\n owns: ['owns', { synonyms: ['is owner of', 'possesses'] }],\n sponsor: ['sponsor', { label: 'sponsored by', synonyms: ['funded by', 'backed by'] }],\n attendee: ['attendee', { label: 'attended by', synonyms: ['has attendee'], domain: EVENT }],\n organizer: ['organizer', { label: 'organized by', synonyms: ['hosted by', 'run by'], domain: EVENT }],\n start_date: ['startDate', { label: 'starts on', synonyms: ['start date', 'begins on'] }],\n end_date: ['endDate', { label: 'ends on', synonyms: ['end date', 'deadline'] }],\n email: ['email', { label: 'has email', synonyms: ['email address'], domain: PERSON }],\n url: ['url', { label: 'has url', synonyms: ['website'] }],\n is_based_on: ['isBasedOn', { label: 'based on', synonyms: ['derived from', 'forked from'] }],\n citation: ['citation', { label: 'cites work', synonyms: ['references paper'] }],\n programming_language: [\n 'programmingLanguage',\n { label: 'written in', synonyms: ['programming language', 'implemented in'] },\n ],\n software_version: ['softwareVersion', { label: 'at version', synonyms: ['software version', 'release'] }],\n knows_language: ['knowsLanguage', { label: 'speaks', synonyms: ['knows language'], domain: PERSON }],\n works_location: ['workLocation', { label: 'works in', synonyms: ['work location', 'office in'], domain: PERSON }],\n award: ['award', { label: 'won award', synonyms: ['received award', 'awarded'] }],\n});\n\n/** FOAF: people, their interests, projects and what they made. */\nexport const FOAF: Pack = pack('foaf', 'FOAF', Vocab.FOAF, {\n nick: ['nick', { label: 'nickname', synonyms: ['goes by', 'called', 'nicknamed'], domain: foaf('Person') }],\n homepage: ['homepage', { synonyms: ['home page'] }],\n interest: [\n 'topic_interest',\n { label: 'interested in', synonyms: ['likes', 'is into', 'cares about'], domain: foaf('Person') },\n ],\n current_project: [\n 'currentProject',\n { label: 'current project', synonyms: ['is building', 'is working on project'], domain: foaf('Person') },\n ],\n past_project: [\n 'pastProject',\n { label: 'past project', synonyms: ['used to work on', 'former project'], domain: foaf('Person') },\n ],\n made: ['made', { synonyms: ['built', 'created', 'is maker of'] }],\n based_near: ['based_near', { label: 'based near', synonyms: ['near', 'lives near'] }],\n workplace_homepage: ['workplaceHomepage', { label: 'workplace homepage' }],\n});\n\n/** Dublin Core terms: documents, their subjects, versions and references. */\nexport const DCTERMS: Pack = pack('dcterms', 'Dublin Core', Vocab.DCTERMS, {\n subject: ['subject', { label: 'has subject', synonyms: ['is on the topic of', 'categorized as'] }],\n title: ['title', { label: 'titled', synonyms: ['has title', 'named'] }],\n contributor: ['contributor', { label: 'contributed to by', synonyms: ['has contributor'] }],\n references: ['references', { synonyms: ['points to', 'links'] }],\n replaces: ['replaces', { synonyms: ['supersedes', 'succeeds'] }],\n has_part: ['hasPart', { label: 'has part', synonyms: ['contains', 'includes'] }],\n has_version: ['hasVersion', { label: 'has variant', synonyms: ['variant of', 'edition of'] }],\n conforms_to: ['conformsTo', { label: 'conforms to', synonyms: ['complies with', 'implements spec'] }],\n license: ['license', { label: 'licensed under', synonyms: ['license'] }],\n language: ['language', { label: 'in language' }],\n modified: ['modified', { label: 'modified on', synonyms: ['updated on', 'last changed'] }],\n});\n\n/** W3C Organization Ontology: reporting lines, posts and units. */\nexport const ORG: Pack = pack('org', 'W3C Organization', Vocab.ORG, {\n head_of: [\n 'headOf',\n { label: 'head of', synonyms: ['leads', 'runs', 'is head of', 'manages'], range: org('Organization') },\n ],\n reports_to: ['reportsTo', { label: 'reports to', synonyms: ['managed by', 'works under'] }],\n has_unit: ['hasUnit', { label: 'has unit', synonyms: ['has team', 'has department'] }],\n unit_of: ['unitOf', { label: 'unit of', synonyms: ['team of', 'department of'] }],\n has_site: ['hasSite', { label: 'has site', synonyms: ['has office', 'office at'] }],\n purpose: ['purpose', { label: 'has purpose', synonyms: ['mission', 'aims to'] }],\n resulted_from: ['resultedFrom', { label: 'resulted from', synonyms: ['formed by', 'came out of'] }],\n});\n\n/** SIOC: online-community structure, so chat threads read as posts, replies and channels. */\nexport const SIOC: Pack = pack('sioc', 'SIOC', Vocab.SIOC, {\n has_creator: ['has_creator', { label: 'posted by', synonyms: ['has creator', 'sent by'], domain: sioc('Post') }],\n reply_of: [\n 'reply_of',\n { label: 'reply to', synonyms: ['replies to', 'responds to', 'answers'], domain: sioc('Post') },\n ],\n has_container: ['has_container', { label: 'posted in', synonyms: ['in channel', 'in thread'], domain: sioc('Item') }],\n container_of: ['container_of', { label: 'contains post', synonyms: ['channel of'] }],\n topic: ['topic', { label: 'has topic', synonyms: ['discusses', 'is discussing'] }],\n links_to: ['links_to', { label: 'links to', synonyms: ['shares link to', 'shared'] }],\n addressed_to: ['addressed_to', { label: 'addressed to', synonyms: ['directed at', 'pings', 'tags'] }],\n moderator_of: ['moderator_of', { label: 'moderator of', synonyms: ['moderates', 'admin of'] }],\n subscriber_of: ['subscriber_of', { label: 'subscribed to', synonyms: ['follows channel', 'watches'] }],\n});\n\n/** Every pack, in the order {@link compose} prefers them when two claim one surface form. */\nexport const ALL: ReadonlyArray<Pack> = [SCHEMA, FOAF, DCTERMS, ORG, SIOC];\n\n/** The pack a configuration names, if any. */\nexport const get = (id: string): Pack | undefined => ALL.find((candidate) => candidate.id === id);\n\n/**\n * An ontology seeded with these packs on top of `base` (the default seed). A pack predicate the ontology already\n * defines, or whose surface form an earlier one claims, is left out, so packs compose in any combination.\n */\nexport const compose = (packs: ReadonlyArray<Pack>, base: Ontology.Ontology = Ontology.DEFAULT): Ontology.Ontology =>\n base.include(packs.flatMap(({ entries }) => entries));\n\n/**\n * The ontology extraction uses when the caller names none: the seed plus every pack, so facts land on\n * published predicates (schema.org, FOAF, …) rather than freshly minted ones.\n */\nexport const DEFAULT: Ontology.Ontology = compose(ALL);\n\n/**\n * The packs a comma-separated list of ids names (`schema,foaf,sioc`; `all` for every pack; `none` for\n * the bare seed).\n * @throws Error naming an unknown id.\n */\nexport const parse = (ids: string): Pack[] => {\n const names = ids\n .split(',')\n .map((id) => id.trim())\n .filter((id) => id.length > 0);\n if (names.includes('all')) {\n return [...ALL];\n }\n if (names.includes('none')) {\n return [];\n }\n return names.map((id) => {\n const found = get(id);\n if (!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IAAI,MAAM,SAAS,KAAK,GACtB,OAAO,CAAC,GAAG,GAAG;CAEhB,IAAI,MAAM,SAAS,MAAM,GACvB,OAAO,CAAC;CAEV,OAAO,MAAM,KAAK,OAAO;EACvB,MAAM,QAAQ,IAAI,EAAE;EACpB,IAAI,CAAC,OACH,MAAM,IAAI,MAAM,uBAAuB,GAAG,YAAY,IAAI,KAAK,cAAc,UAAU,EAAE,CAAC,CAAC,KAAK,IAAI,EAAE,OAAO;EAE/G,OAAO;CACT,CAAC;AACH"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { __exportAll as t };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { l as Fact_exports } from "./chunk-Fact.mjs";
|
|
2
|
+
import { o as MemoryQuery_exports } from "./chunk-MemoryQuery.mjs";
|
|
3
|
+
import { u as RdfStore_exports } from "./chunk-RdfStore.mjs";
|
|
4
|
+
import { t as FactFeed_exports } from "./chunk-FactFeed.mjs";
|
|
5
|
+
import { t as Hash_exports } from "./chunk-Hash.mjs";
|
|
6
|
+
import { t as Predicate_exports } from "./chunk-Predicate.mjs";
|
|
7
|
+
import { i as Rdf_exports } from "./chunk-Rdf.mjs";
|
|
8
|
+
import { R as Vocab_exports } from "./chunk-Vocab.mjs";
|
|
9
|
+
import { i as Ontology_exports } from "./chunk-Ontology.mjs";
|
|
10
|
+
import { n as Mapping_exports } from "./chunk-Mapping.mjs";
|
|
11
|
+
import { t as Trig_exports } from "./chunk-Trig.mjs";
|
|
12
|
+
import { n as Graph_exports } from "./chunk-Graph.mjs";
|
|
13
|
+
import { n as MemoryError_exports } from "./chunk-MemoryError.mjs";
|
|
14
|
+
import { n as MemoryService_exports } from "./chunk-MemoryService.mjs";
|
|
15
|
+
import { r as Pipeline_exports } from "./chunk-Pipeline.mjs";
|
|
16
|
+
import { a as Sparql_exports } from "./chunk-Sparql.mjs";
|
|
17
|
+
import { o as Subscription_exports } from "./chunk-Subscription.mjs";
|
|
18
|
+
import { c as Vocabularies_exports } from "./chunk-Vocabularies.mjs";
|
|
19
|
+
export { Fact_exports as Fact, FactFeed_exports as FactFeed, Graph_exports as Graph, Hash_exports as Hash, Mapping_exports as Mapping, MemoryError_exports as MemoryError, MemoryQuery_exports as MemoryQuery, MemoryService_exports as MemoryService, Ontology_exports as Ontology, Pipeline_exports as Pipeline, Predicate_exports as Predicate, Rdf_exports as Rdf, RdfStore_exports as RdfStore, Sparql_exports as Sparql, Subscription_exports as Subscription, Trig_exports as Trig, Vocab_exports as Vocab, Vocabularies_exports as Vocabularies };
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
/** A statement's id, derived from its graph and the statement. */
|
|
3
|
+
export declare const FactId: Schema.brand<Schema.String, "@dxos/echo-memory/FactId">;
|
|
4
|
+
export type FactId = Schema.Schema.Type<typeof FactId>;
|
|
5
|
+
/** The IRI of a named graph. */
|
|
6
|
+
export declare const GraphIri: Schema.brand<Schema.String, "@dxos/echo-memory/GraphIri">;
|
|
7
|
+
export type GraphIri = Schema.Schema.Type<typeof GraphIri>;
|
|
8
|
+
/** An entity: an absolute IRI where one is known (`echo://…`, `did:…`, `mailto:…`, a URL), else a normalized slug. */
|
|
9
|
+
export declare const EntityKey: Schema.brand<Schema.String, "@dxos/echo-memory/EntityKey">;
|
|
10
|
+
export type EntityKey = Schema.Schema.Type<typeof EntityKey>;
|
|
11
|
+
/** The item facts were read from, or a source read into facts: a DXN or another URI. */
|
|
12
|
+
export declare const SourceUri: Schema.brand<Schema.String, "@dxos/echo-memory/SourceUri">;
|
|
13
|
+
export type SourceUri = Schema.Schema.Type<typeof SourceUri>;
|
|
14
|
+
export declare const EntityKind: Schema.Literals<readonly ["person", "org", "place", "event", "concept", "thing"]>;
|
|
15
|
+
export type EntityKind = Schema.Schema.Type<typeof EntityKind>;
|
|
16
|
+
/** A reference to an entity: `entity` is its key, `label` the surface form kept for display. */
|
|
17
|
+
export declare const EntityTerm: Schema.Struct<{
|
|
18
|
+
readonly kind: Schema.Literal<"entity">;
|
|
19
|
+
readonly entity: Schema.brand<Schema.String, "@dxos/echo-memory/EntityKey">;
|
|
20
|
+
readonly label: Schema.optional<Schema.String>;
|
|
21
|
+
/** What sort of thing the extractor took it for. */
|
|
22
|
+
readonly type: Schema.optional<Schema.Literals<readonly ["person", "org", "place", "event", "concept", "thing"]>>;
|
|
23
|
+
}>;
|
|
24
|
+
export interface EntityTerm extends Schema.Schema.Type<typeof EntityTerm> {
|
|
25
|
+
}
|
|
26
|
+
/** A literal value. */
|
|
27
|
+
export declare const LiteralTerm: Schema.Struct<{
|
|
28
|
+
readonly kind: Schema.Literal<"literal">;
|
|
29
|
+
readonly literal: Schema.String;
|
|
30
|
+
}>;
|
|
31
|
+
export interface LiteralTerm extends Schema.Schema.Type<typeof LiteralTerm> {
|
|
32
|
+
}
|
|
33
|
+
/** A subject or object: an entity reference or a literal, tagged by `kind`. */
|
|
34
|
+
export declare const Term: Schema.Union<readonly [Schema.Struct<{
|
|
35
|
+
readonly kind: Schema.Literal<"entity">;
|
|
36
|
+
readonly entity: Schema.brand<Schema.String, "@dxos/echo-memory/EntityKey">;
|
|
37
|
+
readonly label: Schema.optional<Schema.String>;
|
|
38
|
+
/** What sort of thing the extractor took it for. */
|
|
39
|
+
readonly type: Schema.optional<Schema.Literals<readonly ["person", "org", "place", "event", "concept", "thing"]>>;
|
|
40
|
+
}>, Schema.Struct<{
|
|
41
|
+
readonly kind: Schema.Literal<"literal">;
|
|
42
|
+
readonly literal: Schema.String;
|
|
43
|
+
}>]>;
|
|
44
|
+
export type Term = Schema.Schema.Type<typeof Term>;
|
|
45
|
+
/** A resolved entity. */
|
|
46
|
+
export declare const Entity: Schema.Struct<{
|
|
47
|
+
readonly id: Schema.brand<Schema.String, "@dxos/echo-memory/EntityKey">;
|
|
48
|
+
readonly kind: Schema.Literals<readonly ["person", "org", "place", "event", "concept", "thing"]>;
|
|
49
|
+
readonly label: Schema.String;
|
|
50
|
+
readonly aliases: Schema.$Array<Schema.String>;
|
|
51
|
+
/** DXN of a canonical ECHO object, once resolved. */
|
|
52
|
+
readonly ref: Schema.optional<Schema.String>;
|
|
53
|
+
}>;
|
|
54
|
+
export interface Entity extends Schema.Schema.Type<typeof Entity> {
|
|
55
|
+
}
|
|
56
|
+
/** The proposition: subject, predicate, object, and when it holds in the world. */
|
|
57
|
+
export declare const Assertion: Schema.Struct<{
|
|
58
|
+
readonly subject: Schema.Union<readonly [Schema.Struct<{
|
|
59
|
+
readonly kind: Schema.Literal<"entity">;
|
|
60
|
+
readonly entity: Schema.brand<Schema.String, "@dxos/echo-memory/EntityKey">;
|
|
61
|
+
readonly label: Schema.optional<Schema.String>;
|
|
62
|
+
/** What sort of thing the extractor took it for. */
|
|
63
|
+
readonly type: Schema.optional<Schema.Literals<readonly ["person", "org", "place", "event", "concept", "thing"]>>;
|
|
64
|
+
}>, Schema.Struct<{
|
|
65
|
+
readonly kind: Schema.Literal<"literal">;
|
|
66
|
+
readonly literal: Schema.String;
|
|
67
|
+
}>]>;
|
|
68
|
+
/** The predicate's label: the surface form, or the ontology's label once stored. */
|
|
69
|
+
readonly predicate: Schema.String;
|
|
70
|
+
/** The predicate's IRI; resolved from `predicate` through the ontology when absent. */
|
|
71
|
+
readonly predicateIri: Schema.optional<Schema.String>;
|
|
72
|
+
/** What a minted predicate means, as its extractor defined it. */
|
|
73
|
+
readonly predicateDescription: Schema.optional<Schema.String>;
|
|
74
|
+
readonly object: Schema.Union<readonly [Schema.Struct<{
|
|
75
|
+
readonly kind: Schema.Literal<"entity">;
|
|
76
|
+
readonly entity: Schema.brand<Schema.String, "@dxos/echo-memory/EntityKey">;
|
|
77
|
+
readonly label: Schema.optional<Schema.String>;
|
|
78
|
+
/** What sort of thing the extractor took it for. */
|
|
79
|
+
readonly type: Schema.optional<Schema.Literals<readonly ["person", "org", "place", "event", "concept", "thing"]>>;
|
|
80
|
+
}>, Schema.Struct<{
|
|
81
|
+
readonly kind: Schema.Literal<"literal">;
|
|
82
|
+
readonly literal: Schema.String;
|
|
83
|
+
}>]>;
|
|
84
|
+
/** ISO date from which the asserted state holds. */
|
|
85
|
+
readonly validFrom: Schema.optional<Schema.String>;
|
|
86
|
+
/** ISO date until which the asserted state holds. */
|
|
87
|
+
readonly validTo: Schema.optional<Schema.String>;
|
|
88
|
+
/** The source text it was read from. */
|
|
89
|
+
readonly quote: Schema.optional<Schema.String>;
|
|
90
|
+
}>;
|
|
91
|
+
export interface Assertion extends Schema.Schema.Type<typeof Assertion> {
|
|
92
|
+
}
|
|
93
|
+
/** FactBank values: a degree (CT certain, PR probable, PS possible) with a polarity, plus CTu and Uu (uncommitted). */
|
|
94
|
+
export declare const FactualityValue: Schema.Literals<readonly ["CT+", "CT-", "PR+", "PR-", "PS+", "PS-", "CTu", "Uu"]>;
|
|
95
|
+
export type FactualityValue = Schema.Schema.Type<typeof FactualityValue>;
|
|
96
|
+
/** The speaker's epistemic commitment to the proposition. */
|
|
97
|
+
export declare const Factuality: Schema.Struct<{
|
|
98
|
+
readonly value: Schema.Literals<readonly ["CT+", "CT-", "PR+", "PR-", "PS+", "PS-", "CTu", "Uu"]>;
|
|
99
|
+
readonly polarity: Schema.Literals<readonly ["+", "-", "?"]>;
|
|
100
|
+
/** The extractor's confidence in its reading, 0..1. */
|
|
101
|
+
readonly confidence: Schema.optional<Schema.Number>;
|
|
102
|
+
readonly nature: Schema.optional<Schema.Literals<readonly ["epistemic", "aleatory"]>>;
|
|
103
|
+
}>;
|
|
104
|
+
export interface Factuality extends Schema.Schema.Type<typeof Factuality> {
|
|
105
|
+
}
|
|
106
|
+
/** Searle's illocutionary forces, minus `declarative`. */
|
|
107
|
+
export declare const IllocutionaryForce: Schema.Literals<readonly ["assertive", "directive", "commissive", "expressive"]>;
|
|
108
|
+
export type IllocutionaryForce = Schema.Schema.Type<typeof IllocutionaryForce>;
|
|
109
|
+
/** The speech act the source performed; `mood` tells a question from a request. */
|
|
110
|
+
export declare const Illocution: Schema.Struct<{
|
|
111
|
+
readonly force: Schema.Literals<readonly ["assertive", "directive", "commissive", "expressive"]>;
|
|
112
|
+
readonly mood: Schema.optional<Schema.Literals<readonly ["declarative", "interrogative", "imperative"]>>;
|
|
113
|
+
/** Who is asked to act or answer; the message's recipient when absent. */
|
|
114
|
+
readonly addressee: Schema.optional<Schema.String>;
|
|
115
|
+
}>;
|
|
116
|
+
export interface Illocution extends Schema.Schema.Type<typeof Illocution> {
|
|
117
|
+
}
|
|
118
|
+
/** PROV-O-named provenance. */
|
|
119
|
+
export declare const Attribution: Schema.Struct<{
|
|
120
|
+
/** Who said it. */
|
|
121
|
+
readonly agent: Schema.optional<Schema.brand<Schema.String, "@dxos/echo-memory/EntityKey">>;
|
|
122
|
+
/** The speaker's display name; `agent` stays the join key. */
|
|
123
|
+
readonly agentLabel: Schema.optional<Schema.String>;
|
|
124
|
+
readonly source: Schema.brand<Schema.String, "@dxos/echo-memory/SourceUri">;
|
|
125
|
+
/** When it was said (ISO). */
|
|
126
|
+
readonly generatedAtTime: Schema.String;
|
|
127
|
+
readonly wasDerivedFrom: Schema.optional<Schema.$Array<Schema.String>>;
|
|
128
|
+
readonly span: Schema.optional<Schema.Struct<{
|
|
129
|
+
readonly start: Schema.Number;
|
|
130
|
+
readonly end: Schema.Number;
|
|
131
|
+
}>>;
|
|
132
|
+
}>;
|
|
133
|
+
export interface Attribution extends Schema.Schema.Type<typeof Attribution> {
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* One statement and what is known about it. Statements that share their provenance live in one named graph
|
|
137
|
+
* (`graph`), which carries that provenance once; a fact without a graph is the only statement of its own.
|
|
138
|
+
*/
|
|
139
|
+
export declare const Fact: Schema.Struct<{
|
|
140
|
+
readonly id: Schema.brand<Schema.String, "@dxos/echo-memory/FactId">;
|
|
141
|
+
readonly graph: Schema.optional<Schema.brand<Schema.String, "@dxos/echo-memory/GraphIri">>;
|
|
142
|
+
readonly assertion: Schema.Struct<{
|
|
143
|
+
readonly subject: Schema.Union<readonly [Schema.Struct<{
|
|
144
|
+
readonly kind: Schema.Literal<"entity">;
|
|
145
|
+
readonly entity: Schema.brand<Schema.String, "@dxos/echo-memory/EntityKey">;
|
|
146
|
+
readonly label: Schema.optional<Schema.String>;
|
|
147
|
+
/** What sort of thing the extractor took it for. */
|
|
148
|
+
readonly type: Schema.optional<Schema.Literals<readonly ["person", "org", "place", "event", "concept", "thing"]>>;
|
|
149
|
+
}>, Schema.Struct<{
|
|
150
|
+
readonly kind: Schema.Literal<"literal">;
|
|
151
|
+
readonly literal: Schema.String;
|
|
152
|
+
}>]>;
|
|
153
|
+
/** The predicate's label: the surface form, or the ontology's label once stored. */
|
|
154
|
+
readonly predicate: Schema.String;
|
|
155
|
+
/** The predicate's IRI; resolved from `predicate` through the ontology when absent. */
|
|
156
|
+
readonly predicateIri: Schema.optional<Schema.String>;
|
|
157
|
+
/** What a minted predicate means, as its extractor defined it. */
|
|
158
|
+
readonly predicateDescription: Schema.optional<Schema.String>;
|
|
159
|
+
readonly object: Schema.Union<readonly [Schema.Struct<{
|
|
160
|
+
readonly kind: Schema.Literal<"entity">;
|
|
161
|
+
readonly entity: Schema.brand<Schema.String, "@dxos/echo-memory/EntityKey">;
|
|
162
|
+
readonly label: Schema.optional<Schema.String>;
|
|
163
|
+
/** What sort of thing the extractor took it for. */
|
|
164
|
+
readonly type: Schema.optional<Schema.Literals<readonly ["person", "org", "place", "event", "concept", "thing"]>>;
|
|
165
|
+
}>, Schema.Struct<{
|
|
166
|
+
readonly kind: Schema.Literal<"literal">;
|
|
167
|
+
readonly literal: Schema.String;
|
|
168
|
+
}>]>;
|
|
169
|
+
/** ISO date from which the asserted state holds. */
|
|
170
|
+
readonly validFrom: Schema.optional<Schema.String>;
|
|
171
|
+
/** ISO date until which the asserted state holds. */
|
|
172
|
+
readonly validTo: Schema.optional<Schema.String>;
|
|
173
|
+
/** The source text it was read from. */
|
|
174
|
+
readonly quote: Schema.optional<Schema.String>;
|
|
175
|
+
}>;
|
|
176
|
+
readonly factuality: Schema.Struct<{
|
|
177
|
+
readonly value: Schema.Literals<readonly ["CT+", "CT-", "PR+", "PR-", "PS+", "PS-", "CTu", "Uu"]>;
|
|
178
|
+
readonly polarity: Schema.Literals<readonly ["+", "-", "?"]>;
|
|
179
|
+
/** The extractor's confidence in its reading, 0..1. */
|
|
180
|
+
readonly confidence: Schema.optional<Schema.Number>;
|
|
181
|
+
readonly nature: Schema.optional<Schema.Literals<readonly ["epistemic", "aleatory"]>>;
|
|
182
|
+
}>;
|
|
183
|
+
/** Absent ⇒ assertive. */
|
|
184
|
+
readonly illocution: Schema.optional<Schema.Struct<{
|
|
185
|
+
readonly force: Schema.Literals<readonly ["assertive", "directive", "commissive", "expressive"]>;
|
|
186
|
+
readonly mood: Schema.optional<Schema.Literals<readonly ["declarative", "interrogative", "imperative"]>>;
|
|
187
|
+
/** Who is asked to act or answer; the message's recipient when absent. */
|
|
188
|
+
readonly addressee: Schema.optional<Schema.String>;
|
|
189
|
+
}>>;
|
|
190
|
+
readonly attribution: Schema.Struct<{
|
|
191
|
+
/** Who said it. */
|
|
192
|
+
readonly agent: Schema.optional<Schema.brand<Schema.String, "@dxos/echo-memory/EntityKey">>;
|
|
193
|
+
/** The speaker's display name; `agent` stays the join key. */
|
|
194
|
+
readonly agentLabel: Schema.optional<Schema.String>;
|
|
195
|
+
readonly source: Schema.brand<Schema.String, "@dxos/echo-memory/SourceUri">;
|
|
196
|
+
/** When it was said (ISO). */
|
|
197
|
+
readonly generatedAtTime: Schema.String;
|
|
198
|
+
readonly wasDerivedFrom: Schema.optional<Schema.$Array<Schema.String>>;
|
|
199
|
+
readonly span: Schema.optional<Schema.Struct<{
|
|
200
|
+
readonly start: Schema.Number;
|
|
201
|
+
readonly end: Schema.Number;
|
|
202
|
+
}>>;
|
|
203
|
+
}>;
|
|
204
|
+
/** When memory stored it (ISO transaction time). */
|
|
205
|
+
readonly recordedAt: Schema.String;
|
|
206
|
+
readonly extractor: Schema.Struct<{
|
|
207
|
+
readonly id: Schema.String;
|
|
208
|
+
readonly model: Schema.String;
|
|
209
|
+
readonly version: Schema.String;
|
|
210
|
+
}>;
|
|
211
|
+
/** Hash of the source content read, so a changed source is read again. */
|
|
212
|
+
readonly sourceHash: Schema.String;
|
|
213
|
+
/** Extraction pass id, grouping the facts one run produced. */
|
|
214
|
+
readonly pass: Schema.optional<Schema.String>;
|
|
215
|
+
/** What sort of free-text memory the graph records (`preference`, `commitment`); absent for a fact. */
|
|
216
|
+
readonly kind: Schema.optional<Schema.String>;
|
|
217
|
+
/** Whether the speaker said it (`stated`) or the agent concluded it (`inferred`). */
|
|
218
|
+
readonly origin: Schema.optional<Schema.String>;
|
|
219
|
+
/** The graphs this one replaces. */
|
|
220
|
+
readonly supersedes: Schema.optional<Schema.$Array<Schema.brand<Schema.String, "@dxos/echo-memory/GraphIri">>>;
|
|
221
|
+
/** The graphs this one withdraws. */
|
|
222
|
+
readonly retracts: Schema.optional<Schema.$Array<Schema.brand<Schema.String, "@dxos/echo-memory/GraphIri">>>;
|
|
223
|
+
}>;
|
|
224
|
+
export interface Fact extends Schema.Schema.Type<typeof Fact> {
|
|
225
|
+
}
|
|
226
|
+
/** A fact before the id brands are applied: every id a plain string, as stored and as written by hand. */
|
|
227
|
+
export type Encoded = Schema.Codec.Encoded<typeof Fact>;
|
|
228
|
+
/** A term before the id brands are applied, as a hand-built fact's {@link Encoded} assertion holds it. */
|
|
229
|
+
export type EncodedTerm = Schema.Codec.Encoded<typeof Term>;
|
|
230
|
+
/** An entity term before the id brands are applied. */
|
|
231
|
+
export type EncodedEntityTerm = Schema.Codec.Encoded<typeof EntityTerm>;
|
|
232
|
+
/** Builds a fact from its plain form, applying the id brands; throws on a malformed fact. */
|
|
233
|
+
export declare const make: (fact: Encoded) => Fact;
|
|
234
|
+
/** {@link make} over a list, so a literal list of facts is still checked against {@link Encoded}. */
|
|
235
|
+
export declare const makeMany: (facts: readonly Encoded[]) => Fact[];
|
|
236
|
+
/** Decodes facts from their JSON form, applying the id brands; throws on a malformed fact. */
|
|
237
|
+
export declare const decode: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => readonly {
|
|
238
|
+
readonly id: string & import("effect/Brand").Brand<"@dxos/echo-memory/FactId">;
|
|
239
|
+
readonly graph?: (string & import("effect/Brand").Brand<"@dxos/echo-memory/GraphIri">) | undefined;
|
|
240
|
+
readonly assertion: {
|
|
241
|
+
readonly subject: {
|
|
242
|
+
readonly kind: "entity";
|
|
243
|
+
readonly entity: string & import("effect/Brand").Brand<"@dxos/echo-memory/EntityKey">;
|
|
244
|
+
readonly label?: string | undefined;
|
|
245
|
+
readonly type?: "concept" | "event" | "org" | "person" | "place" | "thing" | undefined;
|
|
246
|
+
} | {
|
|
247
|
+
readonly kind: "literal";
|
|
248
|
+
readonly literal: string;
|
|
249
|
+
};
|
|
250
|
+
readonly predicate: string;
|
|
251
|
+
readonly predicateIri?: string | undefined;
|
|
252
|
+
readonly predicateDescription?: string | undefined;
|
|
253
|
+
readonly object: {
|
|
254
|
+
readonly kind: "entity";
|
|
255
|
+
readonly entity: string & import("effect/Brand").Brand<"@dxos/echo-memory/EntityKey">;
|
|
256
|
+
readonly label?: string | undefined;
|
|
257
|
+
readonly type?: "concept" | "event" | "org" | "person" | "place" | "thing" | undefined;
|
|
258
|
+
} | {
|
|
259
|
+
readonly kind: "literal";
|
|
260
|
+
readonly literal: string;
|
|
261
|
+
};
|
|
262
|
+
readonly validFrom?: string | undefined;
|
|
263
|
+
readonly validTo?: string | undefined;
|
|
264
|
+
readonly quote?: string | undefined;
|
|
265
|
+
};
|
|
266
|
+
readonly factuality: {
|
|
267
|
+
readonly value: "CT+" | "CT-" | "CTu" | "PR+" | "PR-" | "PS+" | "PS-" | "Uu";
|
|
268
|
+
readonly polarity: "+" | "-" | "?";
|
|
269
|
+
readonly confidence?: number | undefined;
|
|
270
|
+
readonly nature?: "aleatory" | "epistemic" | undefined;
|
|
271
|
+
};
|
|
272
|
+
readonly illocution?: {
|
|
273
|
+
readonly force: "assertive" | "commissive" | "directive" | "expressive";
|
|
274
|
+
readonly mood?: "declarative" | "imperative" | "interrogative" | undefined;
|
|
275
|
+
readonly addressee?: string | undefined;
|
|
276
|
+
} | undefined;
|
|
277
|
+
readonly attribution: {
|
|
278
|
+
readonly agent?: (string & import("effect/Brand").Brand<"@dxos/echo-memory/EntityKey">) | undefined;
|
|
279
|
+
readonly agentLabel?: string | undefined;
|
|
280
|
+
readonly source: string & import("effect/Brand").Brand<"@dxos/echo-memory/SourceUri">;
|
|
281
|
+
readonly generatedAtTime: string;
|
|
282
|
+
readonly wasDerivedFrom?: readonly string[] | undefined;
|
|
283
|
+
readonly span?: {
|
|
284
|
+
readonly start: number;
|
|
285
|
+
readonly end: number;
|
|
286
|
+
} | undefined;
|
|
287
|
+
};
|
|
288
|
+
readonly recordedAt: string;
|
|
289
|
+
readonly extractor: {
|
|
290
|
+
readonly id: string;
|
|
291
|
+
readonly model: string;
|
|
292
|
+
readonly version: string;
|
|
293
|
+
};
|
|
294
|
+
readonly sourceHash: string;
|
|
295
|
+
readonly pass?: string | undefined;
|
|
296
|
+
readonly kind?: string | undefined;
|
|
297
|
+
readonly origin?: string | undefined;
|
|
298
|
+
readonly supersedes?: readonly (string & import("effect/Brand").Brand<"@dxos/echo-memory/GraphIri">)[] | undefined;
|
|
299
|
+
readonly retracts?: readonly (string & import("effect/Brand").Brand<"@dxos/echo-memory/GraphIri">)[] | undefined;
|
|
300
|
+
}[];
|
|
301
|
+
/** A predicate a memory knows, as its ontology graph describes it (RDFS / OWL / SKOS). */
|
|
302
|
+
export declare const PredicateEntry: Schema.Struct<{
|
|
303
|
+
readonly iri: Schema.String;
|
|
304
|
+
/** Lowercase shorthand rules use, e.g. `works_on`. */
|
|
305
|
+
readonly name: Schema.String;
|
|
306
|
+
readonly label: Schema.String;
|
|
307
|
+
readonly synonyms: Schema.optional<Schema.$Array<Schema.String>>;
|
|
308
|
+
readonly description: Schema.optional<Schema.String>;
|
|
309
|
+
readonly domain: Schema.optional<Schema.String>;
|
|
310
|
+
readonly range: Schema.optional<Schema.String>;
|
|
311
|
+
readonly inverse: Schema.optional<Schema.String>;
|
|
312
|
+
readonly equivalents: Schema.optional<Schema.$Array<Schema.String>>;
|
|
313
|
+
readonly definedBy: Schema.optional<Schema.String>;
|
|
314
|
+
readonly created: Schema.optional<Schema.String>;
|
|
315
|
+
readonly creator: Schema.optional<Schema.String>;
|
|
316
|
+
readonly example: Schema.optional<Schema.String>;
|
|
317
|
+
readonly replacedBy: Schema.optional<Schema.String>;
|
|
318
|
+
}>;
|
|
319
|
+
export interface PredicateEntry extends Schema.Schema.Type<typeof PredicateEntry> {
|
|
320
|
+
}
|
|
321
|
+
/** The graph a fact's statement lives in: its own graph, else the graph of the fact alone. */
|
|
322
|
+
export declare const graphOf: (fact: Fact) => GraphIri;
|
|
323
|
+
/** Whether a graph still holds: another graph can replace it (`supersedes`) or withdraw it (`retracts`). */
|
|
324
|
+
export declare const GraphStatus: Schema.Literals<readonly ["active", "superseded", "retracted"]>;
|
|
325
|
+
export type GraphStatus = Schema.Schema.Type<typeof GraphStatus>;
|
|
326
|
+
/** The status of every graph the facts mention, by graph IRI. */
|
|
327
|
+
export declare const graphStatus: (facts: readonly Fact[]) => Map<GraphIri, GraphStatus>;
|
|
328
|
+
/**
|
|
329
|
+
* The facts that still hold at `now` (ISO): none in a superseded or retracted graph, none past its `validTo`, and
|
|
330
|
+
* none in a graph with a `kind`, which records a free-text memory rather than a fact.
|
|
331
|
+
*/
|
|
332
|
+
export declare const currentFacts: (facts: readonly Fact[], now: string) => Fact[];
|
|
333
|
+
/** The value a term contributes as a join key: the entity key, else the literal. */
|
|
334
|
+
export declare const termValue: (term: Term) => string;
|
|
335
|
+
/** The text of a term, for display. */
|
|
336
|
+
export declare const termText: (term: Term) => string;
|
|
337
|
+
/** A fact as one line: subject, predicate, object; a negated fact is marked "not:". */
|
|
338
|
+
export declare const factText: (fact: Fact) => string;
|
|
339
|
+
//# sourceMappingURL=Fact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Fact.d.ts","sourceRoot":"","sources":["../../../src/Fact.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAOxC,kEAAkE;AAClE,eAAO,MAAM,MAAM,yDAA+D,CAAC;AACnF,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,MAAM,CAAC,CAAC;AAEvD,gCAAgC;AAChC,eAAO,MAAM,QAAQ,2DAAiE,CAAC;AACvF,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC,CAAC;AAE3D,sHAAsH;AACtH,eAAO,MAAM,SAAS,4DAAkE,CAAC;AACzF,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC,CAAC;AAE7D,wFAAwF;AACxF,eAAO,MAAM,SAAS,4DAAkE,CAAC;AACzF,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC,CAAC;AAM7D,eAAO,MAAM,UAAU,mFAA2E,CAAC;AACnG,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/D,gGAAgG;AAChG,eAAO,MAAM,UAAU;;;;IAIrB,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kH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Fact.test.d.ts","sourceRoot":"","sources":["../../../src/Fact.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EntityId, type SpaceId } from '@dxos/keys';
|
|
2
|
+
import * as RdfStore from './RdfStore.ts';
|
|
3
|
+
/** The feed namespace a space's fact feed lives in (`FeedProtocol.WellKnownNamespaces.facts`). */
|
|
4
|
+
export declare const NAMESPACE = "facts";
|
|
5
|
+
/** The id of a space's fact feed. */
|
|
6
|
+
export declare const feedId: (spaceId: SpaceId) => EntityId;
|
|
7
|
+
/** A batch as a block payload: the UTF-8 JSON of the encoded batch. */
|
|
8
|
+
export declare const encodeBlock: (batch: RdfStore.Batch) => Uint8Array;
|
|
9
|
+
/** Inverse of {@link encodeBlock}. */
|
|
10
|
+
export declare const decodeBlock: (data: Uint8Array) => RdfStore.Batch;
|
|
11
|
+
//# sourceMappingURL=FactFeed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FactFeed.d.ts","sourceRoot":"","sources":["../../../src/FactFeed.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAQ1C,kGAAkG;AAClG,eAAO,MAAM,SAAS,UAAU,CAAC;AAKjC,qCAAqC;AACrC,eAAO,MAAM,MAAM,YAAa,OAAO,KAAG,QAAsD,CAAC;AAOjG,uEAAuE;AACvE,eAAO,MAAM,WAAW,UAAW,QAAQ,CAAC,KAAK,KAAG,UACI,CAAC;AAEzD,sCAAsC;AACtC,eAAO,MAAM,WAAW,SAAU,UAAU,KAAG,QAAQ,CAAC,KAA0D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FactFeed.test.d.ts","sourceRoot":"","sources":["../../../src/FactFeed.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as Fact from './Fact.ts';
|
|
2
|
+
import * as Ontology from './Ontology.ts';
|
|
3
|
+
export type AssignOptions = {
|
|
4
|
+
/** Names the graph for a fact; facts given the same name and provenance share a graph. Defaults to its source. */
|
|
5
|
+
readonly name?: (fact: Fact.Fact) => string;
|
|
6
|
+
readonly ontology?: Ontology.Ontology;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Puts facts into named graphs: facts that share their provenance (source, speaker, time, quote, factuality,
|
|
10
|
+
* extraction pass, …) share a graph, and a fact that differs in any of it starts another. A fact that already names
|
|
11
|
+
* a graph keeps it. Each fact gets its predicate IRI, and the id it will have once stored; facts come in their plain
|
|
12
|
+
* form, since the ids they will have are only known here.
|
|
13
|
+
*/
|
|
14
|
+
export declare const assign: (facts: readonly Fact.Encoded[], { name, ontology }?: AssignOptions) => Fact.Fact[];
|
|
15
|
+
/** Prefixes TriG output abbreviates. */
|
|
16
|
+
export declare const PREFIXES: Readonly<Record<string, string>>;
|
|
17
|
+
/** Prefixes a whole store's TriG export abbreviates: {@link PREFIXES}, the brain namespaces and SIOC. */
|
|
18
|
+
export declare const EXPORT_PREFIXES: Readonly<Record<string, string>>;
|
|
19
|
+
/**
|
|
20
|
+
* The facts as TriG: each graph's statements, then its provenance. The brain's namespace reads as `brain:`, and the
|
|
21
|
+
* entities local to each graph as `g1:`, `g2:`, … so a graph-local entity is visibly not a shared one.
|
|
22
|
+
*/
|
|
23
|
+
export declare const toTriG: (facts: readonly Fact.Fact[], ontology?: Ontology.Ontology) => string;
|
|
24
|
+
/** The ontology's predicates as TriG: each an `rdf:Property` described in the ontology graph. */
|
|
25
|
+
export declare const ontologyToTriG: (ontology: Ontology.Ontology) => string;
|
|
26
|
+
/**
|
|
27
|
+
* The predicates the facts use that the ontology does not define, as entries minted in its namespace, so the next
|
|
28
|
+
* extraction can reuse them; the first quote that used one is kept as its example.
|
|
29
|
+
*/
|
|
30
|
+
export declare const mintedPredicates: (facts: readonly Fact.Fact[], ontology?: Ontology.Ontology) => Ontology.Entry[];
|
|
31
|
+
//# sourceMappingURL=Graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Graph.d.ts","sourceRoot":"","sources":["../../../src/Graph.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAGlC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AA6B1C,MAAM,MAAM,aAAa,GAAG;IAC1B,kHAAkH;IAClH,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC;IAC5C,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;CACvC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,MAAM,UACV,SAAS,IAAI,CAAC,OAAO,EAAE,uBACS,aAAa,KACnD,IAAI,CAAC,IAAI,EAeR,CAAC;AAEL,wCAAwC;AACxC,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAgBrD,CAAC;AAEF,yGAAyG;AACzG,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAyD,CAAC;AAevH;;;GAGG;AACH,eAAO,MAAM,MAAM,UAAW,SAAS,IAAI,CAAC,IAAI,EAAE,aAAY,QAAQ,CAAC,QAAQ,KAAsB,MAgBpG,CAAC;AAEF,iGAAiG;AACjG,eAAO,MAAM,cAAc,aAAc,QAAQ,CAAC,QAAQ,KAAG,MACwB,CAAC;AAEtF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,UACpB,SAAS,IAAI,CAAC,IAAI,EAAE,aACjB,QAAQ,CAAC,QAAQ,KAC1B,QAAQ,CAAC,KAAK,EAmBhB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Graph.test.d.ts","sourceRoot":"","sources":["../../../src/Graph.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Hash.d.ts","sourceRoot":"","sources":["../../../src/Hash.ts"],"names":[],"mappings":"AAMA,wGAAwG;AACxG,eAAO,MAAM,IAAI,SAAU,MAAM,KAAG,MAOnC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as Fact from './Fact.ts';
|
|
2
|
+
import * as Ontology from './Ontology.ts';
|
|
3
|
+
import * as Rdf from './Rdf.ts';
|
|
4
|
+
/** The class IRIs an entity's kind is typed with; an `rdf:type` to any other class is a statement, not a kind. */
|
|
5
|
+
export declare const KIND_CLASSES: ReadonlyArray<string>;
|
|
6
|
+
/** Whether a quad states an entity's kind (an `rdf:type` to a kind class) rather than making a statement. */
|
|
7
|
+
export declare const isKindQuad: (predicate: string, object: string) => boolean;
|
|
8
|
+
/** The class IRI an entity of this kind is typed with. */
|
|
9
|
+
export declare const classIri: (kind: Fact.EntityKind) => string;
|
|
10
|
+
/** The predicate IRI a fact is stored with. */
|
|
11
|
+
export declare const predicateOf: (fact: Fact.Fact, ontology?: Ontology.Ontology) => string;
|
|
12
|
+
/** The id a fact has once stored in `graph` ({@link triplesToFacts} reads it back). */
|
|
13
|
+
export declare const idInGraph: (fact: Fact.Fact, graph: string, ontology?: Ontology.Ontology) => Fact.FactId;
|
|
14
|
+
/** Expands a fact into its statement, the descriptions of its entities, and its graph's provenance. */
|
|
15
|
+
export declare const factToTriples: (fact: Fact.Fact, ontology?: Ontology.Ontology) => Rdf.Quad[];
|
|
16
|
+
/** Reassembles (and validates) facts from quads: the inverse of {@link factToTriples}, one fact per statement. */
|
|
17
|
+
export declare const triplesToFacts: (quads: readonly Rdf.Quad[], ontology?: Ontology.Ontology) => Fact.Fact[];
|
|
18
|
+
//# sourceMappingURL=Mapping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mapping.d.ts","sourceRoot":"","sources":["../../../src/Mapping.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AA2ChC,kHAAkH;AAClH,eAAO,MAAM,YAAY,EAAE,aAAa,CAAC,MAAM,CAAqB,CAAC;AAErE,6GAA6G;AAC7G,eAAO,MAAM,UAAU,cAAe,MAAM,UAAU,MAAM,KAAG,OACZ,CAAC;AAEpD,0DAA0D;AAC1D,eAAO,MAAM,QAAQ,SAAU,IAAI,CAAC,UAAU,KAAG,MAAuB,CAAC;AAYzE,+CAA+C;AAC/C,eAAO,MAAM,WAAW,SAAU,IAAI,CAAC,IAAI,aAAY,QAAQ,CAAC,QAAQ,KAAsB,MACf,CAAC;AAQhF,uFAAuF;AACvF,eAAO,MAAM,SAAS,SACd,IAAI,CAAC,IAAI,SACR,MAAM,aACH,QAAQ,CAAC,QAAQ,KAC1B,IAAI,CAAC,MAUL,CAAC;AAEJ,uGAAuG;AACvG,eAAO,MAAM,aAAa,SAAU,IAAI,CAAC,IAAI,aAAY,QAAQ,CAAC,QAAQ,KAAsB,GAAG,CAAC,IAAI,EAiFvG,CAAC;AAEF,kHAAkH;AAClH,eAAO,MAAM,cAAc,UAClB,SAAS,GAAG,CAAC,IAAI,EAAE,aAChB,QAAQ,CAAC,QAAQ,KAC1B,IAAI,CAAC,IAAI,EAkIX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mapping.test.d.ts","sourceRoot":"","sources":["../../../src/Mapping.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { BaseError } from '@dxos/errors';
|
|
2
|
+
declare const MemoryError_base: {
|
|
3
|
+
new (options?: import("@dxos/errors").BaseErrorOptions): {
|
|
4
|
+
cause?: unknown;
|
|
5
|
+
stack?: string;
|
|
6
|
+
name: "MemoryError";
|
|
7
|
+
context: Record<string, unknown>;
|
|
8
|
+
readonly message: string;
|
|
9
|
+
readonly _tag: "MemoryError";
|
|
10
|
+
};
|
|
11
|
+
isError(error: unknown): error is Error;
|
|
12
|
+
name: "MemoryError";
|
|
13
|
+
is(error: unknown): error is BaseError;
|
|
14
|
+
wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, 'cause'> & {
|
|
15
|
+
ifTypeDiffers?: boolean;
|
|
16
|
+
}): (error: unknown) => {
|
|
17
|
+
cause?: unknown;
|
|
18
|
+
stack?: string;
|
|
19
|
+
name: "MemoryError";
|
|
20
|
+
context: Record<string, unknown>;
|
|
21
|
+
readonly message: string;
|
|
22
|
+
readonly _tag: "MemoryError";
|
|
23
|
+
};
|
|
24
|
+
extend<Name extends string = string>(name: Name, message?: string): any;
|
|
25
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
26
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
27
|
+
stackTraceLimit: number;
|
|
28
|
+
};
|
|
29
|
+
/** The memory refused, could not be reached, or the input does not compile; the message says which. */
|
|
30
|
+
export declare class MemoryError extends MemoryError_base {
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=MemoryError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemoryError.d.ts","sourceRoot":"","sources":["../../../src/MemoryError.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzC,uGAAuG;AACvG,qBAAa,WAAY,SAAQ,gBAA2D;CAAG"}
|