@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,106 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
|
|
2
|
+
import { s as defaultGraph } from "./chunk-Rdf.mjs";
|
|
3
|
+
//#region src/Trig.ts
|
|
4
|
+
var Trig_exports = /* @__PURE__ */ __exportAll({ write: () => write });
|
|
5
|
+
var XSD = "http://www.w3.org/2001/XMLSchema#";
|
|
6
|
+
var ESCAPES = {
|
|
7
|
+
"\\": "\\\\",
|
|
8
|
+
"\"": "\\\"",
|
|
9
|
+
" ": "\\t",
|
|
10
|
+
"\n": "\\n",
|
|
11
|
+
"\r": "\\r",
|
|
12
|
+
"\b": "\\b",
|
|
13
|
+
"\f": "\\f"
|
|
14
|
+
};
|
|
15
|
+
var escapeCharacter = (character) => {
|
|
16
|
+
const known = ESCAPES[character];
|
|
17
|
+
if (known !== void 0) return known;
|
|
18
|
+
if (character.length === 1) return `\\u${character.charCodeAt(0).toString(16).padStart(4, "0")}`;
|
|
19
|
+
return `\\U${((character.charCodeAt(0) - 55296) * 1024 + character.charCodeAt(1) + 9216).toString(16).padStart(8, "0")}`;
|
|
20
|
+
};
|
|
21
|
+
/** Code units up to U+0019 are escaped, as n3 does (it leaves U+001A..U+001F as they are). */
|
|
22
|
+
var isEscaped = (code) => code === 34 || code === 92 || code <= 25;
|
|
23
|
+
var isHighSurrogate = (code) => code >= 55296 && code <= 56319;
|
|
24
|
+
var isLowSurrogate = (code) => code >= 56320 && code <= 57343;
|
|
25
|
+
/** Escapes quotes, backslashes, control characters and surrogate pairs, scanning code units so no regex holds control characters. */
|
|
26
|
+
var escape = (text) => {
|
|
27
|
+
let output = "";
|
|
28
|
+
let start = 0;
|
|
29
|
+
for (let index = 0; index < text.length; index++) {
|
|
30
|
+
const code = text.charCodeAt(index);
|
|
31
|
+
const width = isEscaped(code) ? 1 : isHighSurrogate(code) && isLowSurrogate(text.charCodeAt(index + 1)) ? 2 : 0;
|
|
32
|
+
if (width > 0) {
|
|
33
|
+
output += text.slice(start, index) + escapeCharacter(text.slice(index, index + width));
|
|
34
|
+
index += width - 1;
|
|
35
|
+
start = index + 1;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return start === 0 ? text : output + text.slice(start);
|
|
39
|
+
};
|
|
40
|
+
var escapeRegex = (text) => text.replace(/[.*+?^${}()|[\]\\/]/g, "\\$&");
|
|
41
|
+
/** Serializes quads as TriG, in the order given; consecutive quads that share a graph and subject are grouped. */
|
|
42
|
+
var write = (quads, { prefixes = {} } = {}) => {
|
|
43
|
+
const prefixByNamespace = /* @__PURE__ */ new Map();
|
|
44
|
+
let output = "";
|
|
45
|
+
for (const [prefix, namespace] of Object.entries(prefixes)) {
|
|
46
|
+
prefixByNamespace.set(namespace, `${prefix}:`);
|
|
47
|
+
output += `@prefix ${prefix}: <${namespace}>.\n`;
|
|
48
|
+
}
|
|
49
|
+
const hasPrefixes = prefixByNamespace.size > 0;
|
|
50
|
+
if (hasPrefixes) output += "\n";
|
|
51
|
+
const prefixPattern = hasPrefixes ? new RegExp(`^(${[...prefixByNamespace.keys()].map(escapeRegex).join("|")})([_a-zA-Z0-9][\\-_a-zA-Z0-9]*)$`) : void 0;
|
|
52
|
+
const iriOrBlank = (term) => {
|
|
53
|
+
if (term.termType !== "NamedNode") return `_:${term.value}`;
|
|
54
|
+
const iri = escape(term.value);
|
|
55
|
+
const match = prefixPattern?.exec(iri);
|
|
56
|
+
if (!match) return `<${iri}>`;
|
|
57
|
+
return `${prefixByNamespace.get(match[1])}${match[2]}`;
|
|
58
|
+
};
|
|
59
|
+
const literal = (term) => {
|
|
60
|
+
const value = escape(term.value);
|
|
61
|
+
if (term.language) return `"${value}"@${term.language}${term.direction ? `--${term.direction}` : ""}`;
|
|
62
|
+
switch (term.datatype.value) {
|
|
63
|
+
case `${XSD}string`: return `"${value}"`;
|
|
64
|
+
case `${XSD}boolean`:
|
|
65
|
+
if (value === "true" || value === "false") return value;
|
|
66
|
+
break;
|
|
67
|
+
case `${XSD}integer`:
|
|
68
|
+
if (/^[+-]?\d+$/.test(value)) return value;
|
|
69
|
+
break;
|
|
70
|
+
case `${XSD}decimal`:
|
|
71
|
+
if (/^[+-]?\d*\.\d+$/.test(value)) return value;
|
|
72
|
+
break;
|
|
73
|
+
case `${XSD}double`: if (/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(value)) return value;
|
|
74
|
+
}
|
|
75
|
+
return `"${value}"^^${iriOrBlank(term.datatype)}`;
|
|
76
|
+
};
|
|
77
|
+
const object = (term) => term.termType === "Literal" ? literal(term) : iriOrBlank(term);
|
|
78
|
+
const predicate = (term) => term.termType === "NamedNode" && term.value === "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" ? "a" : iriOrBlank(term);
|
|
79
|
+
let graph = defaultGraph();
|
|
80
|
+
let subject;
|
|
81
|
+
let lastPredicate;
|
|
82
|
+
const closing = () => graph.termType === "DefaultGraph" ? ".\n" : "\n}\n";
|
|
83
|
+
for (const next of quads) {
|
|
84
|
+
for (const term of [
|
|
85
|
+
next.subject,
|
|
86
|
+
next.predicate,
|
|
87
|
+
next.object,
|
|
88
|
+
next.graph
|
|
89
|
+
]) if (term.termType === "Quad" || term.termType === "Variable") throw new TypeError(`TriG cannot write a ${term.termType === "Quad" ? "quoted triple" : "variable"} as a term.`);
|
|
90
|
+
if (!next.graph.equals(graph)) {
|
|
91
|
+
output += (subject === void 0 ? "" : closing()) + (next.graph.termType === "DefaultGraph" ? "" : `${iriOrBlank(next.graph)} {\n`);
|
|
92
|
+
graph = next.graph;
|
|
93
|
+
subject = void 0;
|
|
94
|
+
}
|
|
95
|
+
if (subject !== void 0 && next.subject.equals(subject)) output += lastPredicate !== void 0 && next.predicate.equals(lastPredicate) ? `, ${object(next.object)}` : `;\n ${predicate(next.predicate)} ${object(next.object)}`;
|
|
96
|
+
else output += `${subject === void 0 ? "" : ".\n"}${iriOrBlank(next.subject)} ${predicate(next.predicate)} ${object(next.object)}`;
|
|
97
|
+
subject = next.subject;
|
|
98
|
+
lastPredicate = next.predicate;
|
|
99
|
+
}
|
|
100
|
+
if (subject !== void 0) output += closing();
|
|
101
|
+
return output;
|
|
102
|
+
};
|
|
103
|
+
//#endregion
|
|
104
|
+
export { write as n, Trig_exports as t };
|
|
105
|
+
|
|
106
|
+
//# sourceMappingURL=chunk-Trig.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-Trig.mjs","names":["Rdf.defaultGraph"],"sources":["../../src/Trig.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Rdf from './Rdf.ts';\n\n//\n// A TriG writer whose output matches n3's `Writer` in TriG mode character for character (prefix block, named graph\n// blocks, `;` and `,` grouping, datatype abbreviations, escapes, base direction), so readers of n3's TriG keep working;\n// it differs only where n3's output would not read back: an IRI that only looks prefixed stays bracketed, and quoted\n// triples and variables are refused.\n//\n\nconst XSD = 'http://www.w3.org/2001/XMLSchema#';\n\nconst ESCAPES: Readonly<Record<string, string>> = {\n '\\\\': '\\\\\\\\',\n '\"': '\\\\\"',\n '\\t': '\\\\t',\n '\\n': '\\\\n',\n '\\r': '\\\\r',\n '\\b': '\\\\b',\n '\\f': '\\\\f',\n};\n\nconst escapeCharacter = (character: string): string => {\n const known = ESCAPES[character];\n if (known !== undefined) {\n return known;\n }\n if (character.length === 1) {\n return `\\\\u${character.charCodeAt(0).toString(16).padStart(4, '0')}`;\n }\n // A surrogate pair: its code point as an 8-digit escape.\n const codePoint = (character.charCodeAt(0) - 0xd800) * 0x400 + character.charCodeAt(1) + 0x2400;\n return `\\\\U${codePoint.toString(16).padStart(8, '0')}`;\n};\n\n/** Code units up to U+0019 are escaped, as n3 does (it leaves U+001A..U+001F as they are). */\nconst isEscaped = (code: number): boolean => code === 0x22 || code === 0x5c || code <= 0x19;\nconst isHighSurrogate = (code: number): boolean => code >= 0xd800 && code <= 0xdbff;\nconst isLowSurrogate = (code: number): boolean => code >= 0xdc00 && code <= 0xdfff;\n\n/** Escapes quotes, backslashes, control characters and surrogate pairs, scanning code units so no regex holds control characters. */\nconst escape = (text: string): string => {\n let output = '';\n let start = 0;\n for (let index = 0; index < text.length; index++) {\n const code = text.charCodeAt(index);\n const width = isEscaped(code) ? 1 : isHighSurrogate(code) && isLowSurrogate(text.charCodeAt(index + 1)) ? 2 : 0;\n if (width > 0) {\n output += text.slice(start, index) + escapeCharacter(text.slice(index, index + width));\n index += width - 1;\n start = index + 1;\n }\n }\n return start === 0 ? text : output + text.slice(start);\n};\n\nconst escapeRegex = (text: string): string => text.replace(/[.*+?^${}()|[\\]\\\\/]/g, '\\\\$&');\n\nexport type WriteOptions = {\n /** Namespaces to abbreviate IRIs with, by prefix; a later prefix for the same namespace replaces an earlier one. */\n readonly prefixes?: Readonly<Record<string, string>>;\n};\n\n/** Serializes quads as TriG, in the order given; consecutive quads that share a graph and subject are grouped. */\nexport const write = (quads: Iterable<Rdf.Quad>, { prefixes = {} }: WriteOptions = {}): string => {\n const prefixByNamespace = new Map<string, string>();\n let output = '';\n for (const [prefix, namespace] of Object.entries(prefixes)) {\n prefixByNamespace.set(namespace, `${prefix}:`);\n output += `@prefix ${prefix}: <${namespace}>.\\n`;\n }\n const hasPrefixes = prefixByNamespace.size > 0;\n if (hasPrefixes) {\n output += '\\n';\n }\n\n // An IRI in one of the namespaces followed by a valid local name; any other IRI keeps its angle brackets.\n const prefixPattern = hasPrefixes\n ? new RegExp(`^(${[...prefixByNamespace.keys()].map(escapeRegex).join('|')})([_a-zA-Z0-9][\\\\-_a-zA-Z0-9]*)$`)\n : undefined;\n\n const iriOrBlank = (term: Rdf.Term): string => {\n if (term.termType !== 'NamedNode') {\n return `_:${term.value}`;\n }\n const iri = escape(term.value);\n const match = prefixPattern?.exec(iri);\n if (!match) {\n return `<${iri}>`;\n }\n return `${prefixByNamespace.get(match[1])}${match[2]}`;\n };\n\n const literal = (term: Rdf.Literal): string => {\n const value = escape(term.value);\n if (term.language) {\n return `\"${value}\"@${term.language}${term.direction ? `--${term.direction}` : ''}`;\n }\n switch (term.datatype.value) {\n case `${XSD}string`:\n return `\"${value}\"`;\n case `${XSD}boolean`:\n if (value === 'true' || value === 'false') {\n return value;\n }\n break;\n case `${XSD}integer`:\n if (/^[+-]?\\d+$/.test(value)) {\n return value;\n }\n break;\n case `${XSD}decimal`:\n if (/^[+-]?\\d*\\.\\d+$/.test(value)) {\n return value;\n }\n break;\n case `${XSD}double`:\n if (/^[+-]?(?:\\d+\\.\\d*|\\.?\\d+)[eE][+-]?\\d+$/.test(value)) {\n return value;\n }\n break;\n }\n return `\"${value}\"^^${iriOrBlank(term.datatype)}`;\n };\n\n const object = (term: Rdf.QuadObject): string => (term.termType === 'Literal' ? literal(term) : iriOrBlank(term));\n const predicate = (term: Rdf.QuadPredicate): string =>\n term.termType === 'NamedNode' && term.value === Rdf.RDF_TYPE ? 'a' : iriOrBlank(term);\n\n let graph: Rdf.QuadGraph = Rdf.defaultGraph();\n let subject: Rdf.QuadSubject | undefined;\n let lastPredicate: Rdf.QuadPredicate | undefined;\n const closing = () => (graph.termType === 'DefaultGraph' ? '.\\n' : '\\n}\\n');\n\n for (const next of quads) {\n for (const term of [next.subject, next.predicate, next.object, next.graph]) {\n if (term.termType === 'Quad' || term.termType === 'Variable') {\n throw new TypeError(\n `TriG cannot write a ${term.termType === 'Quad' ? 'quoted triple' : 'variable'} as a term.`,\n );\n }\n }\n if (!next.graph.equals(graph)) {\n output +=\n (subject === undefined ? '' : closing()) +\n (next.graph.termType === 'DefaultGraph' ? '' : `${iriOrBlank(next.graph)} {\\n`);\n graph = next.graph;\n subject = undefined;\n }\n if (subject !== undefined && next.subject.equals(subject)) {\n output +=\n lastPredicate !== undefined && next.predicate.equals(lastPredicate)\n ? `, ${object(next.object)}`\n : `;\\n ${predicate(next.predicate)} ${object(next.object)}`;\n } else {\n output += `${subject === undefined ? '' : '.\\n'}${iriOrBlank(next.subject)} ${predicate(next.predicate)} ${object(next.object)}`;\n }\n subject = next.subject;\n lastPredicate = next.predicate;\n }\n if (subject !== undefined) {\n output += closing();\n }\n return output;\n};\n"],"mappings":"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"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
|
|
2
|
+
import { i as EntityKey } from "./chunk-Fact.mjs";
|
|
3
|
+
import { i as Rdf_exports } from "./chunk-Rdf.mjs";
|
|
4
|
+
//#region src/Vocab.ts
|
|
5
|
+
var Vocab_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
BRAIN: () => BRAIN,
|
|
7
|
+
DCTERMS: () => DCTERMS,
|
|
8
|
+
DCTERMS_CREATED: () => DCTERMS_CREATED,
|
|
9
|
+
DCTERMS_CREATOR: () => DCTERMS_CREATOR,
|
|
10
|
+
DCTERMS_IS_REPLACED_BY: () => DCTERMS_IS_REPLACED_BY,
|
|
11
|
+
DX: () => DX,
|
|
12
|
+
ENTITY: () => ENTITY,
|
|
13
|
+
FACT: () => FACT,
|
|
14
|
+
FOAF: () => FOAF,
|
|
15
|
+
GRAPH: () => GRAPH,
|
|
16
|
+
LOCAL_BRAIN: () => LOCAL_BRAIN,
|
|
17
|
+
ONTOLOGY_GRAPH: () => ONTOLOGY_GRAPH,
|
|
18
|
+
ORG: () => ORG,
|
|
19
|
+
OWL: () => OWL,
|
|
20
|
+
OWL_DEPRECATED: () => OWL_DEPRECATED,
|
|
21
|
+
OWL_EQUIVALENT_PROPERTY: () => OWL_EQUIVALENT_PROPERTY,
|
|
22
|
+
OWL_INVERSE_OF: () => OWL_INVERSE_OF,
|
|
23
|
+
OWL_SAME_AS: () => OWL_SAME_AS,
|
|
24
|
+
PROV: () => PROV,
|
|
25
|
+
RDF: () => RDF,
|
|
26
|
+
RDFS: () => RDFS,
|
|
27
|
+
RDFS_COMMENT: () => RDFS_COMMENT,
|
|
28
|
+
RDFS_DOMAIN: () => RDFS_DOMAIN,
|
|
29
|
+
RDFS_IS_DEFINED_BY: () => RDFS_IS_DEFINED_BY,
|
|
30
|
+
RDFS_LABEL: () => RDFS_LABEL,
|
|
31
|
+
RDFS_RANGE: () => RDFS_RANGE,
|
|
32
|
+
RDF_PROPERTY: () => RDF_PROPERTY,
|
|
33
|
+
RDF_TYPE: () => RDF_TYPE,
|
|
34
|
+
SCHEMA: () => SCHEMA,
|
|
35
|
+
SIOC: () => SIOC,
|
|
36
|
+
SKOS: () => SKOS,
|
|
37
|
+
SKOS_ALT_LABEL: () => SKOS_ALT_LABEL,
|
|
38
|
+
SKOS_EXAMPLE: () => SKOS_EXAMPLE,
|
|
39
|
+
SX: () => SX,
|
|
40
|
+
SX_GRAPH: () => SX_GRAPH,
|
|
41
|
+
SX_SEED: () => SX_SEED,
|
|
42
|
+
SX_SHORTHAND: () => SX_SHORTHAND,
|
|
43
|
+
XSD: () => XSD,
|
|
44
|
+
brainNamespace: () => brainNamespace,
|
|
45
|
+
brainNamespaceOf: () => brainNamespaceOf,
|
|
46
|
+
dx: () => dx,
|
|
47
|
+
entityIdFromIri: () => entityIdFromIri,
|
|
48
|
+
entityIri: () => entityIri,
|
|
49
|
+
entityKey: () => entityKey,
|
|
50
|
+
entityNode: () => entityNode,
|
|
51
|
+
factIdFromIri: () => factIdFromIri,
|
|
52
|
+
factIri: () => factIri,
|
|
53
|
+
graphIri: () => graphIri,
|
|
54
|
+
isIri: () => isIri,
|
|
55
|
+
localEntityId: () => localEntityId,
|
|
56
|
+
localEntityIri: () => localEntityIri,
|
|
57
|
+
localEntitySuffix: () => localEntitySuffix,
|
|
58
|
+
prov: () => prov,
|
|
59
|
+
str: () => str,
|
|
60
|
+
sx: () => sx
|
|
61
|
+
});
|
|
62
|
+
var { namedNode, literal } = Rdf_exports;
|
|
63
|
+
/** Semantic-index vocabulary (provenance and factuality predicates). */
|
|
64
|
+
var SX = "https://dxos.org/semantic#";
|
|
65
|
+
/** W3C PROV-O. */
|
|
66
|
+
var PROV = "http://www.w3.org/ns/prov#";
|
|
67
|
+
/** Entity IRI prefix. */
|
|
68
|
+
var ENTITY = "https://dxos.org/semantic/entity/";
|
|
69
|
+
/** Fact-node IRI prefix; a stored fact without an explicit graph is the graph of this IRI. */
|
|
70
|
+
var FACT = "https://dxos.org/semantic/fact/";
|
|
71
|
+
/** Named-graph IRI prefix for graphs the extractor names. */
|
|
72
|
+
var GRAPH = "https://dxos.org/semantic/graph/";
|
|
73
|
+
/** Ontology namespace: predicates and entity classes. */
|
|
74
|
+
var DX = "https://dxos.org/ontology/";
|
|
75
|
+
var RDF = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
|
|
76
|
+
var RDFS = "http://www.w3.org/2000/01/rdf-schema#";
|
|
77
|
+
var OWL = "http://www.w3.org/2002/07/owl#";
|
|
78
|
+
var XSD = "http://www.w3.org/2001/XMLSchema#";
|
|
79
|
+
var SKOS = "http://www.w3.org/2004/02/skos/core#";
|
|
80
|
+
var DCTERMS = "http://purl.org/dc/terms/";
|
|
81
|
+
var SCHEMA = "https://schema.org/";
|
|
82
|
+
var FOAF = "http://xmlns.com/foaf/0.1/";
|
|
83
|
+
var ORG = "http://www.w3.org/ns/org#";
|
|
84
|
+
/** SIOC: online communities (posts, replies, channels, members). */
|
|
85
|
+
var SIOC = "http://rdfs.org/sioc/ns#";
|
|
86
|
+
/** Brain namespaces: each brain mints the predicates its extractors invent under its own IRI. */
|
|
87
|
+
var BRAIN = "https://dxos.org/semantic/brain/";
|
|
88
|
+
/** The graph holding the brain's predicate metadata (labels, descriptions, synonyms). */
|
|
89
|
+
var ONTOLOGY_GRAPH = `${GRAPH}ontology`;
|
|
90
|
+
var RDF_TYPE = `${RDF}type`;
|
|
91
|
+
var RDFS_LABEL = `${RDFS}label`;
|
|
92
|
+
var RDFS_COMMENT = `${RDFS}comment`;
|
|
93
|
+
var RDFS_DOMAIN = `${RDFS}domain`;
|
|
94
|
+
var RDFS_RANGE = `${RDFS}range`;
|
|
95
|
+
var RDFS_IS_DEFINED_BY = `${RDFS}isDefinedBy`;
|
|
96
|
+
var RDF_PROPERTY = `${RDF}Property`;
|
|
97
|
+
var OWL_SAME_AS = `${OWL}sameAs`;
|
|
98
|
+
var OWL_INVERSE_OF = `${OWL}inverseOf`;
|
|
99
|
+
var OWL_EQUIVALENT_PROPERTY = `${OWL}equivalentProperty`;
|
|
100
|
+
var OWL_DEPRECATED = `${OWL}deprecated`;
|
|
101
|
+
var SKOS_ALT_LABEL = `${SKOS}altLabel`;
|
|
102
|
+
var SKOS_EXAMPLE = `${SKOS}example`;
|
|
103
|
+
var DCTERMS_CREATED = `${DCTERMS}created`;
|
|
104
|
+
var DCTERMS_CREATOR = `${DCTERMS}creator`;
|
|
105
|
+
var DCTERMS_IS_REPLACED_BY = `${DCTERMS}isReplacedBy`;
|
|
106
|
+
/** The version of the seed vocabulary a store holds, stated about the ontology graph. */
|
|
107
|
+
var SX_SEED = `${SX}seed`;
|
|
108
|
+
/** The shorthand rules use for a predicate (`member_of`). */
|
|
109
|
+
var SX_SHORTHAND = `${SX}shorthand`;
|
|
110
|
+
/** The class of every stored graph, so an unconstrained query can enumerate them. */
|
|
111
|
+
var SX_GRAPH = `${SX}Graph`;
|
|
112
|
+
/** Named node in the `sx:` namespace. */
|
|
113
|
+
var sx = (name) => namedNode(SX + name);
|
|
114
|
+
/** Named node in the `prov:` namespace. */
|
|
115
|
+
var prov = (name) => namedNode(PROV + name);
|
|
116
|
+
/** IRI for an entity id. */
|
|
117
|
+
var entityIri = (id) => namedNode(ENTITY + encodeURIComponent(id));
|
|
118
|
+
/** IRI for a fact id. */
|
|
119
|
+
var factIri = (id) => namedNode(FACT + encodeURIComponent(id));
|
|
120
|
+
/** IRI for a named graph. */
|
|
121
|
+
var graphIri = (name) => namedNode(GRAPH + encodeURIComponent(name));
|
|
122
|
+
/** Named node in the `dx:` namespace. */
|
|
123
|
+
var dx = (name) => namedNode(DX + name);
|
|
124
|
+
/** The namespace a brain mints its predicates under. */
|
|
125
|
+
var brainNamespace = (id) => `${BRAIN}${encodeURIComponent(id)}/`;
|
|
126
|
+
/** The brain namespace an IRI was minted in, if it was minted in one. */
|
|
127
|
+
var brainNamespaceOf = (iri) => {
|
|
128
|
+
if (!iri.startsWith("https://dxos.org/semantic/brain/")) return;
|
|
129
|
+
const end = iri.indexOf("/", 32);
|
|
130
|
+
return end === -1 ? void 0 : iri.slice(0, end + 1);
|
|
131
|
+
};
|
|
132
|
+
/** The namespace of a brain that has no id of its own (a preview, a test). */
|
|
133
|
+
var LOCAL_BRAIN = brainNamespace("local");
|
|
134
|
+
/**
|
|
135
|
+
* IRI of an entity the extractor named but could not resolve: local to the graph that mentions it, since a label
|
|
136
|
+
* alone does not say that two graphs mean the same thing.
|
|
137
|
+
*/
|
|
138
|
+
var localEntityIri = (graph, id) => namedNode(`${graph}#${encodeURIComponent(id)}`);
|
|
139
|
+
/** The slug of a graph-local entity IRI (see {@link localEntityIri}), if it is one of `graph`'s. */
|
|
140
|
+
var localEntityId = (graph, iri) => iri.startsWith(`${graph}#`) ? decodeURIComponent(iri.slice(graph.length + 1)) : void 0;
|
|
141
|
+
/** The suffix every graph-local IRI of an entity slug ends with, whichever graph it is local to. */
|
|
142
|
+
var localEntitySuffix = (id) => `#${encodeURIComponent(id)}`;
|
|
143
|
+
/** True for an absolute IRI (`did:key:…`, `echo://…`, `mailto:…`); entity slugs never contain `:`. */
|
|
144
|
+
var isIri = (value) => /^[a-z][a-z0-9+.-]*:/i.test(value);
|
|
145
|
+
/** The node for an entity key: an absolute IRI as itself, a slug local to `graph` (under {@link ENTITY} when none). */
|
|
146
|
+
var entityNode = (key, graph) => isIri(key) ? namedNode(key) : graph !== void 0 ? localEntityIri(graph, key) : entityIri(key);
|
|
147
|
+
/** Inverse of {@link entityNode}: the slug for an IRI local to `graph` or under {@link ENTITY}, any other IRI unchanged. */
|
|
148
|
+
var entityKey = (iri, graph) => EntityKey.make((graph !== void 0 ? localEntityId(graph, iri) : void 0) ?? (iri.startsWith("https://dxos.org/semantic/entity/") ? entityIdFromIri(iri) : iri));
|
|
149
|
+
/** Plain string literal. */
|
|
150
|
+
var str = (value) => literal(value);
|
|
151
|
+
/** Inverse of {@link entityIri}; throws on a non-entity IRI. */
|
|
152
|
+
var entityIdFromIri = (iri) => {
|
|
153
|
+
if (!iri.startsWith("https://dxos.org/semantic/entity/")) throw new TypeError(`Expected entity IRI with prefix ${ENTITY}: ${iri}`);
|
|
154
|
+
return decodeURIComponent(iri.slice(33));
|
|
155
|
+
};
|
|
156
|
+
/** Inverse of {@link factIri}; throws on a non-fact IRI. */
|
|
157
|
+
var factIdFromIri = (iri) => {
|
|
158
|
+
if (!iri.startsWith("https://dxos.org/semantic/fact/")) throw new TypeError(`Expected fact IRI with prefix ${FACT}: ${iri}`);
|
|
159
|
+
return decodeURIComponent(iri.slice(31));
|
|
160
|
+
};
|
|
161
|
+
//#endregion
|
|
162
|
+
export { localEntitySuffix as $, SIOC as A, brainNamespace as B, RDFS_DOMAIN as C, RDF_PROPERTY as D, RDFS_RANGE as E, SX_GRAPH as F, entityKey as G, dx as H, SX_SEED as I, factIri as J, entityNode as K, SX_SHORTHAND as L, SKOS_ALT_LABEL as M, SKOS_EXAMPLE as N, RDF_TYPE as O, SX as P, localEntityIri as Q, Vocab_exports as R, RDFS_COMMENT as S, RDFS_LABEL as T, entityIdFromIri as U, brainNamespaceOf as V, entityIri as W, isIri as X, graphIri as Y, localEntityId as Z, OWL_INVERSE_OF as _, DCTERMS_IS_REPLACED_BY as a, RDF as b, FACT as c, LOCAL_BRAIN as d, prov as et, ONTOLOGY_GRAPH as f, OWL_EQUIVALENT_PROPERTY as g, OWL_DEPRECATED as h, DCTERMS_CREATOR as i, SKOS as j, SCHEMA as k, FOAF as l, OWL as m, DCTERMS as n, sx as nt, DX as o, ORG as p, factIdFromIri as q, DCTERMS_CREATED as r, ENTITY as s, BRAIN as t, str as tt, GRAPH as u, OWL_SAME_AS as v, RDFS_IS_DEFINED_BY as w, RDFS as x, PROV as y, XSD as z };
|
|
163
|
+
|
|
164
|
+
//# sourceMappingURL=chunk-Vocab.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-Vocab.mjs","names":["Rdf"],"sources":["../../src/Vocab.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Fact from './Fact.ts';\nimport * as Rdf from './Rdf.ts';\n\nconst { namedNode, literal } = Rdf;\n\n/** Semantic-index vocabulary (provenance and factuality predicates). */\nexport const SX = 'https://dxos.org/semantic#';\n/** W3C PROV-O. */\nexport const PROV = 'http://www.w3.org/ns/prov#';\n/** Entity IRI prefix. */\nexport const ENTITY = 'https://dxos.org/semantic/entity/';\n/** Fact-node IRI prefix; a stored fact without an explicit graph is the graph of this IRI. */\nexport const FACT = 'https://dxos.org/semantic/fact/';\n/** Named-graph IRI prefix for graphs the extractor names. */\nexport const GRAPH = 'https://dxos.org/semantic/graph/';\n/** Ontology namespace: predicates and entity classes. */\nexport const DX = 'https://dxos.org/ontology/';\nexport const RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';\nexport const RDFS = 'http://www.w3.org/2000/01/rdf-schema#';\nexport const OWL = 'http://www.w3.org/2002/07/owl#';\nexport const XSD = 'http://www.w3.org/2001/XMLSchema#';\nexport const SKOS = 'http://www.w3.org/2004/02/skos/core#';\nexport const DCTERMS = 'http://purl.org/dc/terms/';\nexport const SCHEMA = 'https://schema.org/';\nexport const FOAF = 'http://xmlns.com/foaf/0.1/';\nexport const ORG = 'http://www.w3.org/ns/org#';\n/** SIOC: online communities (posts, replies, channels, members). */\nexport const SIOC = 'http://rdfs.org/sioc/ns#';\n/** Brain namespaces: each brain mints the predicates its extractors invent under its own IRI. */\nexport const BRAIN = 'https://dxos.org/semantic/brain/';\n\n/** The graph holding the brain's predicate metadata (labels, descriptions, synonyms). */\nexport const ONTOLOGY_GRAPH = `${GRAPH}ontology`;\nexport const RDF_TYPE = `${RDF}type`;\nexport const RDFS_LABEL = `${RDFS}label`;\nexport const RDFS_COMMENT = `${RDFS}comment`;\nexport const RDFS_DOMAIN = `${RDFS}domain`;\nexport const RDFS_RANGE = `${RDFS}range`;\nexport const RDFS_IS_DEFINED_BY = `${RDFS}isDefinedBy`;\nexport const RDF_PROPERTY = `${RDF}Property`;\nexport const OWL_SAME_AS = `${OWL}sameAs`;\nexport const OWL_INVERSE_OF = `${OWL}inverseOf`;\nexport const OWL_EQUIVALENT_PROPERTY = `${OWL}equivalentProperty`;\nexport const OWL_DEPRECATED = `${OWL}deprecated`;\nexport const SKOS_ALT_LABEL = `${SKOS}altLabel`;\nexport const SKOS_EXAMPLE = `${SKOS}example`;\nexport const DCTERMS_CREATED = `${DCTERMS}created`;\nexport const DCTERMS_CREATOR = `${DCTERMS}creator`;\nexport const DCTERMS_IS_REPLACED_BY = `${DCTERMS}isReplacedBy`;\n/** The version of the seed vocabulary a store holds, stated about the ontology graph. */\nexport const SX_SEED = `${SX}seed`;\n/** The shorthand rules use for a predicate (`member_of`). */\nexport const SX_SHORTHAND = `${SX}shorthand`;\n/** The class of every stored graph, so an unconstrained query can enumerate them. */\nexport const SX_GRAPH = `${SX}Graph`;\n\n/** Named node in the `sx:` namespace. */\nexport const sx = (name: string) => namedNode(SX + name);\n/** Named node in the `prov:` namespace. */\nexport const prov = (name: string) => namedNode(PROV + name);\n/** IRI for an entity id. */\nexport const entityIri = (id: string) => namedNode(ENTITY + encodeURIComponent(id));\n/** IRI for a fact id. */\nexport const factIri = (id: string) => namedNode(FACT + encodeURIComponent(id));\n/** IRI for a named graph. */\nexport const graphIri = (name: string) => namedNode(GRAPH + encodeURIComponent(name));\n/** Named node in the `dx:` namespace. */\nexport const dx = (name: string) => namedNode(DX + name);\n\n/** The namespace a brain mints its predicates under. */\nexport const brainNamespace = (id: string): string => `${BRAIN}${encodeURIComponent(id)}/`;\n\n/** The brain namespace an IRI was minted in, if it was minted in one. */\nexport const brainNamespaceOf = (iri: string): string | undefined => {\n if (!iri.startsWith(BRAIN)) {\n return undefined;\n }\n const end = iri.indexOf('/', BRAIN.length);\n return end === -1 ? undefined : iri.slice(0, end + 1);\n};\n\n/** The namespace of a brain that has no id of its own (a preview, a test). */\nexport const LOCAL_BRAIN = brainNamespace('local');\n\n/**\n * IRI of an entity the extractor named but could not resolve: local to the graph that mentions it, since a label\n * alone does not say that two graphs mean the same thing.\n */\nexport const localEntityIri = (graph: string, id: string) => namedNode(`${graph}#${encodeURIComponent(id)}`);\n\n/** The slug of a graph-local entity IRI (see {@link localEntityIri}), if it is one of `graph`'s. */\nexport const localEntityId = (graph: string, iri: string): string | undefined =>\n iri.startsWith(`${graph}#`) ? decodeURIComponent(iri.slice(graph.length + 1)) : undefined;\n\n/** The suffix every graph-local IRI of an entity slug ends with, whichever graph it is local to. */\nexport const localEntitySuffix = (id: string): string => `#${encodeURIComponent(id)}`;\n\n/** True for an absolute IRI (`did:key:…`, `echo://…`, `mailto:…`); entity slugs never contain `:`. */\nexport const isIri = (value: string): boolean => /^[a-z][a-z0-9+.-]*:/i.test(value);\n\n/** The node for an entity key: an absolute IRI as itself, a slug local to `graph` (under {@link ENTITY} when none). */\nexport const entityNode = (key: string, graph?: string) =>\n isIri(key) ? namedNode(key) : graph !== undefined ? localEntityIri(graph, key) : entityIri(key);\n\n/** Inverse of {@link entityNode}: the slug for an IRI local to `graph` or under {@link ENTITY}, any other IRI unchanged. */\nexport const entityKey = (iri: string, graph?: string): Fact.EntityKey =>\n Fact.EntityKey.make(\n (graph !== undefined ? localEntityId(graph, iri) : undefined) ??\n (iri.startsWith(ENTITY) ? entityIdFromIri(iri) : iri),\n );\n\n/** Plain string literal. */\nexport const str = (value: string) => literal(value);\n/** Inverse of {@link entityIri}; throws on a non-entity IRI. */\nexport const entityIdFromIri = (iri: string) => {\n if (!iri.startsWith(ENTITY)) {\n throw new TypeError(`Expected entity IRI with prefix ${ENTITY}: ${iri}`);\n }\n return decodeURIComponent(iri.slice(ENTITY.length));\n};\n\n/** Inverse of {@link factIri}; throws on a non-fact IRI. */\nexport const factIdFromIri = (iri: string) => {\n if (!iri.startsWith(FACT)) {\n throw new TypeError(`Expected fact IRI with prefix ${FACT}: ${iri}`);\n }\n return decodeURIComponent(iri.slice(FACT.length));\n};\n"],"mappings":"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"}
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
|
|
2
|
+
import { A as SIOC$1, k as SCHEMA$1, l as FOAF$1, n as DCTERMS$1, p as ORG$1 } from "./chunk-Vocab.mjs";
|
|
3
|
+
import { a as entry, t as DEFAULT$1 } from "./chunk-Ontology.mjs";
|
|
4
|
+
//#region src/Vocabularies.ts
|
|
5
|
+
var Vocabularies_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
ALL: () => ALL,
|
|
7
|
+
DCTERMS: () => DCTERMS,
|
|
8
|
+
DEFAULT: () => DEFAULT,
|
|
9
|
+
FOAF: () => FOAF,
|
|
10
|
+
ORG: () => ORG,
|
|
11
|
+
SCHEMA: () => SCHEMA,
|
|
12
|
+
SIOC: () => SIOC,
|
|
13
|
+
compose: () => compose,
|
|
14
|
+
get: () => get,
|
|
15
|
+
parse: () => parse
|
|
16
|
+
});
|
|
17
|
+
var pack = (id, label, namespace, terms) => ({
|
|
18
|
+
id,
|
|
19
|
+
label,
|
|
20
|
+
namespace,
|
|
21
|
+
entries: Object.entries(terms).map(([name, [local, term]]) => entry(name, {
|
|
22
|
+
...term,
|
|
23
|
+
iri: `${namespace}${local}`,
|
|
24
|
+
definedBy: namespace
|
|
25
|
+
}))
|
|
26
|
+
});
|
|
27
|
+
var schema = (name) => `${SCHEMA$1}${name}`;
|
|
28
|
+
var foaf = (name) => `${FOAF$1}${name}`;
|
|
29
|
+
var sioc = (name) => `${SIOC$1}${name}`;
|
|
30
|
+
var org = (name) => `${ORG$1}${name}`;
|
|
31
|
+
var PERSON = schema("Person");
|
|
32
|
+
var ORGANIZATION = schema("Organization");
|
|
33
|
+
var CREATIVE_WORK = schema("CreativeWork");
|
|
34
|
+
var EVENT = schema("Event");
|
|
35
|
+
/** schema.org beyond the seed: authorship, employment, organizational structure, events and software. */
|
|
36
|
+
var SCHEMA = pack("schema", "schema.org", SCHEMA$1, {
|
|
37
|
+
has_author: ["author", {
|
|
38
|
+
label: "has author",
|
|
39
|
+
range: PERSON,
|
|
40
|
+
domain: CREATIVE_WORK
|
|
41
|
+
}],
|
|
42
|
+
publisher: ["publisher", {
|
|
43
|
+
synonyms: ["published by"],
|
|
44
|
+
domain: CREATIVE_WORK
|
|
45
|
+
}],
|
|
46
|
+
employee: ["employee", {
|
|
47
|
+
label: "employs",
|
|
48
|
+
synonyms: ["has employee", "hired"],
|
|
49
|
+
domain: ORGANIZATION,
|
|
50
|
+
range: PERSON
|
|
51
|
+
}],
|
|
52
|
+
colleague: ["colleague", {
|
|
53
|
+
label: "colleague of",
|
|
54
|
+
synonyms: ["works with", "is colleague of"],
|
|
55
|
+
domain: PERSON
|
|
56
|
+
}],
|
|
57
|
+
parent_organization: ["parentOrganization", {
|
|
58
|
+
label: "parent organization",
|
|
59
|
+
synonyms: ["is subsidiary of", "owned by company"],
|
|
60
|
+
domain: ORGANIZATION,
|
|
61
|
+
range: ORGANIZATION
|
|
62
|
+
}],
|
|
63
|
+
sub_organization: ["subOrganization", {
|
|
64
|
+
label: "sub organization",
|
|
65
|
+
synonyms: ["has subsidiary", "has division"],
|
|
66
|
+
domain: ORGANIZATION,
|
|
67
|
+
range: ORGANIZATION
|
|
68
|
+
}],
|
|
69
|
+
affiliation: ["affiliation", {
|
|
70
|
+
label: "affiliated with",
|
|
71
|
+
synonyms: ["is affiliated with"],
|
|
72
|
+
domain: PERSON,
|
|
73
|
+
range: ORGANIZATION
|
|
74
|
+
}],
|
|
75
|
+
owns: ["owns", { synonyms: ["is owner of", "possesses"] }],
|
|
76
|
+
sponsor: ["sponsor", {
|
|
77
|
+
label: "sponsored by",
|
|
78
|
+
synonyms: ["funded by", "backed by"]
|
|
79
|
+
}],
|
|
80
|
+
attendee: ["attendee", {
|
|
81
|
+
label: "attended by",
|
|
82
|
+
synonyms: ["has attendee"],
|
|
83
|
+
domain: EVENT
|
|
84
|
+
}],
|
|
85
|
+
organizer: ["organizer", {
|
|
86
|
+
label: "organized by",
|
|
87
|
+
synonyms: ["hosted by", "run by"],
|
|
88
|
+
domain: EVENT
|
|
89
|
+
}],
|
|
90
|
+
start_date: ["startDate", {
|
|
91
|
+
label: "starts on",
|
|
92
|
+
synonyms: ["start date", "begins on"]
|
|
93
|
+
}],
|
|
94
|
+
end_date: ["endDate", {
|
|
95
|
+
label: "ends on",
|
|
96
|
+
synonyms: ["end date", "deadline"]
|
|
97
|
+
}],
|
|
98
|
+
email: ["email", {
|
|
99
|
+
label: "has email",
|
|
100
|
+
synonyms: ["email address"],
|
|
101
|
+
domain: PERSON
|
|
102
|
+
}],
|
|
103
|
+
url: ["url", {
|
|
104
|
+
label: "has url",
|
|
105
|
+
synonyms: ["website"]
|
|
106
|
+
}],
|
|
107
|
+
is_based_on: ["isBasedOn", {
|
|
108
|
+
label: "based on",
|
|
109
|
+
synonyms: ["derived from", "forked from"]
|
|
110
|
+
}],
|
|
111
|
+
citation: ["citation", {
|
|
112
|
+
label: "cites work",
|
|
113
|
+
synonyms: ["references paper"]
|
|
114
|
+
}],
|
|
115
|
+
programming_language: ["programmingLanguage", {
|
|
116
|
+
label: "written in",
|
|
117
|
+
synonyms: ["programming language", "implemented in"]
|
|
118
|
+
}],
|
|
119
|
+
software_version: ["softwareVersion", {
|
|
120
|
+
label: "at version",
|
|
121
|
+
synonyms: ["software version", "release"]
|
|
122
|
+
}],
|
|
123
|
+
knows_language: ["knowsLanguage", {
|
|
124
|
+
label: "speaks",
|
|
125
|
+
synonyms: ["knows language"],
|
|
126
|
+
domain: PERSON
|
|
127
|
+
}],
|
|
128
|
+
works_location: ["workLocation", {
|
|
129
|
+
label: "works in",
|
|
130
|
+
synonyms: ["work location", "office in"],
|
|
131
|
+
domain: PERSON
|
|
132
|
+
}],
|
|
133
|
+
award: ["award", {
|
|
134
|
+
label: "won award",
|
|
135
|
+
synonyms: ["received award", "awarded"]
|
|
136
|
+
}]
|
|
137
|
+
});
|
|
138
|
+
/** FOAF: people, their interests, projects and what they made. */
|
|
139
|
+
var FOAF = pack("foaf", "FOAF", FOAF$1, {
|
|
140
|
+
nick: ["nick", {
|
|
141
|
+
label: "nickname",
|
|
142
|
+
synonyms: [
|
|
143
|
+
"goes by",
|
|
144
|
+
"called",
|
|
145
|
+
"nicknamed"
|
|
146
|
+
],
|
|
147
|
+
domain: foaf("Person")
|
|
148
|
+
}],
|
|
149
|
+
homepage: ["homepage", { synonyms: ["home page"] }],
|
|
150
|
+
interest: ["topic_interest", {
|
|
151
|
+
label: "interested in",
|
|
152
|
+
synonyms: [
|
|
153
|
+
"likes",
|
|
154
|
+
"is into",
|
|
155
|
+
"cares about"
|
|
156
|
+
],
|
|
157
|
+
domain: foaf("Person")
|
|
158
|
+
}],
|
|
159
|
+
current_project: ["currentProject", {
|
|
160
|
+
label: "current project",
|
|
161
|
+
synonyms: ["is building", "is working on project"],
|
|
162
|
+
domain: foaf("Person")
|
|
163
|
+
}],
|
|
164
|
+
past_project: ["pastProject", {
|
|
165
|
+
label: "past project",
|
|
166
|
+
synonyms: ["used to work on", "former project"],
|
|
167
|
+
domain: foaf("Person")
|
|
168
|
+
}],
|
|
169
|
+
made: ["made", { synonyms: [
|
|
170
|
+
"built",
|
|
171
|
+
"created",
|
|
172
|
+
"is maker of"
|
|
173
|
+
] }],
|
|
174
|
+
based_near: ["based_near", {
|
|
175
|
+
label: "based near",
|
|
176
|
+
synonyms: ["near", "lives near"]
|
|
177
|
+
}],
|
|
178
|
+
workplace_homepage: ["workplaceHomepage", { label: "workplace homepage" }]
|
|
179
|
+
});
|
|
180
|
+
/** Dublin Core terms: documents, their subjects, versions and references. */
|
|
181
|
+
var DCTERMS = pack("dcterms", "Dublin Core", DCTERMS$1, {
|
|
182
|
+
subject: ["subject", {
|
|
183
|
+
label: "has subject",
|
|
184
|
+
synonyms: ["is on the topic of", "categorized as"]
|
|
185
|
+
}],
|
|
186
|
+
title: ["title", {
|
|
187
|
+
label: "titled",
|
|
188
|
+
synonyms: ["has title", "named"]
|
|
189
|
+
}],
|
|
190
|
+
contributor: ["contributor", {
|
|
191
|
+
label: "contributed to by",
|
|
192
|
+
synonyms: ["has contributor"]
|
|
193
|
+
}],
|
|
194
|
+
references: ["references", { synonyms: ["points to", "links"] }],
|
|
195
|
+
replaces: ["replaces", { synonyms: ["supersedes", "succeeds"] }],
|
|
196
|
+
has_part: ["hasPart", {
|
|
197
|
+
label: "has part",
|
|
198
|
+
synonyms: ["contains", "includes"]
|
|
199
|
+
}],
|
|
200
|
+
has_version: ["hasVersion", {
|
|
201
|
+
label: "has variant",
|
|
202
|
+
synonyms: ["variant of", "edition of"]
|
|
203
|
+
}],
|
|
204
|
+
conforms_to: ["conformsTo", {
|
|
205
|
+
label: "conforms to",
|
|
206
|
+
synonyms: ["complies with", "implements spec"]
|
|
207
|
+
}],
|
|
208
|
+
license: ["license", {
|
|
209
|
+
label: "licensed under",
|
|
210
|
+
synonyms: ["license"]
|
|
211
|
+
}],
|
|
212
|
+
language: ["language", { label: "in language" }],
|
|
213
|
+
modified: ["modified", {
|
|
214
|
+
label: "modified on",
|
|
215
|
+
synonyms: ["updated on", "last changed"]
|
|
216
|
+
}]
|
|
217
|
+
});
|
|
218
|
+
/** W3C Organization Ontology: reporting lines, posts and units. */
|
|
219
|
+
var ORG = pack("org", "W3C Organization", ORG$1, {
|
|
220
|
+
head_of: ["headOf", {
|
|
221
|
+
label: "head of",
|
|
222
|
+
synonyms: [
|
|
223
|
+
"leads",
|
|
224
|
+
"runs",
|
|
225
|
+
"is head of",
|
|
226
|
+
"manages"
|
|
227
|
+
],
|
|
228
|
+
range: org("Organization")
|
|
229
|
+
}],
|
|
230
|
+
reports_to: ["reportsTo", {
|
|
231
|
+
label: "reports to",
|
|
232
|
+
synonyms: ["managed by", "works under"]
|
|
233
|
+
}],
|
|
234
|
+
has_unit: ["hasUnit", {
|
|
235
|
+
label: "has unit",
|
|
236
|
+
synonyms: ["has team", "has department"]
|
|
237
|
+
}],
|
|
238
|
+
unit_of: ["unitOf", {
|
|
239
|
+
label: "unit of",
|
|
240
|
+
synonyms: ["team of", "department of"]
|
|
241
|
+
}],
|
|
242
|
+
has_site: ["hasSite", {
|
|
243
|
+
label: "has site",
|
|
244
|
+
synonyms: ["has office", "office at"]
|
|
245
|
+
}],
|
|
246
|
+
purpose: ["purpose", {
|
|
247
|
+
label: "has purpose",
|
|
248
|
+
synonyms: ["mission", "aims to"]
|
|
249
|
+
}],
|
|
250
|
+
resulted_from: ["resultedFrom", {
|
|
251
|
+
label: "resulted from",
|
|
252
|
+
synonyms: ["formed by", "came out of"]
|
|
253
|
+
}]
|
|
254
|
+
});
|
|
255
|
+
/** SIOC: online-community structure, so chat threads read as posts, replies and channels. */
|
|
256
|
+
var SIOC = pack("sioc", "SIOC", SIOC$1, {
|
|
257
|
+
has_creator: ["has_creator", {
|
|
258
|
+
label: "posted by",
|
|
259
|
+
synonyms: ["has creator", "sent by"],
|
|
260
|
+
domain: sioc("Post")
|
|
261
|
+
}],
|
|
262
|
+
reply_of: ["reply_of", {
|
|
263
|
+
label: "reply to",
|
|
264
|
+
synonyms: [
|
|
265
|
+
"replies to",
|
|
266
|
+
"responds to",
|
|
267
|
+
"answers"
|
|
268
|
+
],
|
|
269
|
+
domain: sioc("Post")
|
|
270
|
+
}],
|
|
271
|
+
has_container: ["has_container", {
|
|
272
|
+
label: "posted in",
|
|
273
|
+
synonyms: ["in channel", "in thread"],
|
|
274
|
+
domain: sioc("Item")
|
|
275
|
+
}],
|
|
276
|
+
container_of: ["container_of", {
|
|
277
|
+
label: "contains post",
|
|
278
|
+
synonyms: ["channel of"]
|
|
279
|
+
}],
|
|
280
|
+
topic: ["topic", {
|
|
281
|
+
label: "has topic",
|
|
282
|
+
synonyms: ["discusses", "is discussing"]
|
|
283
|
+
}],
|
|
284
|
+
links_to: ["links_to", {
|
|
285
|
+
label: "links to",
|
|
286
|
+
synonyms: ["shares link to", "shared"]
|
|
287
|
+
}],
|
|
288
|
+
addressed_to: ["addressed_to", {
|
|
289
|
+
label: "addressed to",
|
|
290
|
+
synonyms: [
|
|
291
|
+
"directed at",
|
|
292
|
+
"pings",
|
|
293
|
+
"tags"
|
|
294
|
+
]
|
|
295
|
+
}],
|
|
296
|
+
moderator_of: ["moderator_of", {
|
|
297
|
+
label: "moderator of",
|
|
298
|
+
synonyms: ["moderates", "admin of"]
|
|
299
|
+
}],
|
|
300
|
+
subscriber_of: ["subscriber_of", {
|
|
301
|
+
label: "subscribed to",
|
|
302
|
+
synonyms: ["follows channel", "watches"]
|
|
303
|
+
}]
|
|
304
|
+
});
|
|
305
|
+
/** Every pack, in the order {@link compose} prefers them when two claim one surface form. */
|
|
306
|
+
var ALL = [
|
|
307
|
+
SCHEMA,
|
|
308
|
+
FOAF,
|
|
309
|
+
DCTERMS,
|
|
310
|
+
ORG,
|
|
311
|
+
SIOC
|
|
312
|
+
];
|
|
313
|
+
/** The pack a configuration names, if any. */
|
|
314
|
+
var get = (id) => ALL.find((candidate) => candidate.id === id);
|
|
315
|
+
/**
|
|
316
|
+
* An ontology seeded with these packs on top of `base` (the default seed). A pack predicate the ontology already
|
|
317
|
+
* defines, or whose surface form an earlier one claims, is left out, so packs compose in any combination.
|
|
318
|
+
*/
|
|
319
|
+
var compose = (packs, base = DEFAULT$1) => base.include(packs.flatMap(({ entries }) => entries));
|
|
320
|
+
/**
|
|
321
|
+
* The ontology extraction uses when the caller names none: the seed plus every pack, so facts land on
|
|
322
|
+
* published predicates (schema.org, FOAF, …) rather than freshly minted ones.
|
|
323
|
+
*/
|
|
324
|
+
var DEFAULT = compose(ALL);
|
|
325
|
+
/**
|
|
326
|
+
* The packs a comma-separated list of ids names (`schema,foaf,sioc`; `all` for every pack; `none` for
|
|
327
|
+
* the bare seed).
|
|
328
|
+
* @throws Error naming an unknown id.
|
|
329
|
+
*/
|
|
330
|
+
var parse = (ids) => {
|
|
331
|
+
const names = ids.split(",").map((id) => id.trim()).filter((id) => id.length > 0);
|
|
332
|
+
if (names.includes("all")) return [...ALL];
|
|
333
|
+
if (names.includes("none")) return [];
|
|
334
|
+
return names.map((id) => {
|
|
335
|
+
const found = get(id);
|
|
336
|
+
if (!found) throw new Error(`Unknown vocabulary "${id}"; known: ${ALL.map((candidate) => candidate.id).join(", ")}, all.`);
|
|
337
|
+
return found;
|
|
338
|
+
});
|
|
339
|
+
};
|
|
340
|
+
//#endregion
|
|
341
|
+
export { ORG as a, Vocabularies_exports as c, parse as d, FOAF as i, compose as l, DCTERMS as n, SCHEMA as o, DEFAULT as r, SIOC as s, ALL as t, get as u };
|
|
342
|
+
|
|
343
|
+
//# sourceMappingURL=chunk-Vocabularies.mjs.map
|