@seedprotocol/rdf 0.8.1 → 0.8.2-next.1774.gc97b5ba
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/CHANGELOG.md +8 -0
- package/README.md +1 -1
- package/dist/bin.js +52 -38
- package/dist/bin.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/defaults.d.ts +6 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/graph.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +142 -142
- package/dist/index.js.map +1 -1
- package/dist/iri.d.ts +2 -0
- package/dist/iri.d.ts.map +1 -1
- package/dist/{sidecar-BjHSnqHK.js → sidecar-C_Li12OR.js} +47 -41
- package/dist/sidecar-C_Li12OR.js.map +1 -0
- package/dist/sidecar.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/sidecar-BjHSnqHK.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ All notable changes to this package are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
- **Breaking:** `seed-rdf` reads `seed.schema.json` when `--schema` isn't given, and the sidecar defaults to `seed.schema.context.jsonld`. They were `seedSchema.json` and `seedSchema.context.jsonld`, names neither the SDK nor its docs use. Rename the files or pass `--schema`. The name is exported as `DEFAULT_SCHEMA_FILE`.
|
|
8
|
+
- `seedVocabulary(base)` throws a `TypeError` for a base without a trailing `/`, as `iriScheme` does. It wrote `{base}ns#` IRIs that didn't match the graph's.
|
|
9
|
+
- `suggestTerms` suggests `schema:associatedMedia` for an Html property named `html`, `body` or `content`. It suggested `schema:text`, whose range is Text, for a value that is a storage seed's IRI.
|
|
10
|
+
- The state graph links no seed for any unfilled reference slot (a relation value below 2^32). It skipped only `0x…20`, so `stateGraph` given another placeholder linked it as a seed.
|
|
11
|
+
- `engines.node` is `>=20.18.1`, the floor of its dependencies `@seedprotocol/eas` and `@seedprotocol/query`. It said `>=20.12.0`, where those dependencies don't install.
|
|
12
|
+
|
|
13
|
+
## 0.8.1 (2026-11-04)
|
|
14
|
+
|
|
7
15
|
- New package. `exportSeeds(seedUids, { chainId })` reads seeds with `getSeedAttestations` from @seedprotocol/query and returns their state graph: each seed's values at its head Version, with IRIs minted from the on-chain schemas (`{base}c/{model}`, `{base}p/{easType}/{easName}`, `{base}eas/{chainId}/{uid}`). `toQuads` gives RDF/JS quads; `toNQuads`, `toTurtle` and `toJsonLd` write RDF 1.1 N-Quads, Turtle and JSON-LD 1.1. `seedVocabulary` gives the Seed vocabulary in Turtle. The base IRI defaults to `PROVISIONAL_BASE_IRI`, which isn't registered yet.
|
|
8
16
|
- New `lens` option on `exportSeeds` and `stateGraph`: `{ schema, sidecar }` maps models and properties, by id, to terms such as `schema:headline`, and types Numbers (`xsd:integer`, `xsd:decimal`, canonical `xsd:double`) and Dates (`xsd:dateTime`). `StateGraph.warnings` lists terms it couldn't use.
|
|
9
17
|
- `toShacl(lens)` writes SHACL 2017 shapes in Turtle for exports made with that lens: a `sh:NodeShape` per model targeting its class, and per property its predicate, `sh:datatype`, `sh:maxCount 1`, `sh:minCount 1` when `required`, and `rdf:List` checks for Lists.
|
package/README.md
CHANGED
|
@@ -183,7 +183,7 @@ seed-rdf suggest # draft schema.org / dcterms terms for unmapped name
|
|
|
183
183
|
seed-rdf suggest --write # add them to the sidecar, creating it if needed
|
|
184
184
|
```
|
|
185
185
|
|
|
186
|
-
Each command reads `
|
|
186
|
+
Each command reads `seed.schema.json` and `seed.schema.context.jsonld` in the working directory;
|
|
187
187
|
`--schema` and `--sidecar` take other paths. `sync` and `suggest` print what they would write
|
|
188
188
|
unless given `--write`, and `sync` keeps stale terms: removing a mapping is your call. The same
|
|
189
189
|
functions are exported as `checkSidecar`, `syncSidecar`, `suggestTerms` and `sidecarContext`.
|
package/dist/bin.js
CHANGED
|
@@ -1,34 +1,48 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as e, i as t, n,
|
|
3
|
-
import
|
|
4
|
-
import { readFile as
|
|
5
|
-
import
|
|
6
|
-
import { parseArgs as
|
|
2
|
+
import { a as e, i as t, n, o as r, t as i } from "./sidecar-C_Li12OR.js";
|
|
3
|
+
import a from "node:process";
|
|
4
|
+
import { readFile as o, writeFile as s } from "node:fs/promises";
|
|
5
|
+
import c from "node:path";
|
|
6
|
+
import { parseArgs as l } from "node:util";
|
|
7
7
|
//#region src/cli.ts
|
|
8
|
-
var
|
|
8
|
+
var u = `Usage:
|
|
9
|
+
seed-rdf check [--schema <file>] [--sidecar <file>] [--base <iri>]
|
|
10
|
+
List stale terms, terms that aren't IRIs, and unmapped models and properties.
|
|
11
|
+
Exits 1 when there are stale or unreadable terms.
|
|
12
|
+
|
|
13
|
+
seed-rdf sync [--schema <file>] [--sidecar <file>] [--base <iri>] [--write]
|
|
14
|
+
Regenerate the sidecar's @context from its terms and the schema's current names, and set
|
|
15
|
+
schemaVersion. Prints the result, or writes it to the sidecar with --write.
|
|
16
|
+
|
|
17
|
+
seed-rdf suggest [--schema <file>] [--sidecar <file>] [--base <iri>] [--write]
|
|
18
|
+
Draft schema.org and dcterms terms for unmapped names with a common meaning. Prints them,
|
|
19
|
+
or adds them to the sidecar (creating it if needed) with --write. Review before committing.
|
|
20
|
+
|
|
21
|
+
Default --schema: ${r}. Default --sidecar: the schema's path with .context.jsonld
|
|
22
|
+
in place of .json.`, d = class extends Error {
|
|
9
23
|
showUsage;
|
|
10
24
|
constructor(e, t = !1) {
|
|
11
25
|
super(e), this.showUsage = t;
|
|
12
26
|
}
|
|
13
27
|
};
|
|
14
|
-
async function
|
|
28
|
+
async function f(e, t) {
|
|
15
29
|
let n;
|
|
16
30
|
try {
|
|
17
|
-
n = await
|
|
31
|
+
n = await o(e, "utf8");
|
|
18
32
|
} catch (n) {
|
|
19
|
-
throw n.code === "ENOENT" ? new
|
|
33
|
+
throw n.code === "ENOENT" ? new d(`No ${t} at ${e}`) : n;
|
|
20
34
|
}
|
|
21
35
|
try {
|
|
22
36
|
return JSON.parse(n);
|
|
23
37
|
} catch (n) {
|
|
24
|
-
throw new
|
|
38
|
+
throw new d(`The ${t} at ${e} isn't JSON: ${n.message}`);
|
|
25
39
|
}
|
|
26
40
|
}
|
|
27
|
-
var
|
|
28
|
-
async function
|
|
41
|
+
var p = (e) => `${JSON.stringify(e, null, 2)}\n`, m = (e) => e.property ? `${e.model}.${e.property}` : e.model;
|
|
42
|
+
async function h(r, a) {
|
|
29
43
|
try {
|
|
30
|
-
let { positionals:
|
|
31
|
-
args: [...
|
|
44
|
+
let { positionals: o, values: h } = l({
|
|
45
|
+
args: [...r],
|
|
32
46
|
allowPositionals: !0,
|
|
33
47
|
options: {
|
|
34
48
|
schema: { type: "string" },
|
|
@@ -40,55 +54,55 @@ async function m(i, a) {
|
|
|
40
54
|
short: "h"
|
|
41
55
|
}
|
|
42
56
|
}
|
|
43
|
-
}), [g, ..._] =
|
|
44
|
-
if (h.help) return a.out(
|
|
57
|
+
}), [g, ..._] = o;
|
|
58
|
+
if (h.help) return a.out(u), 0;
|
|
45
59
|
if (!g || _.length > 0 || ![
|
|
46
60
|
"check",
|
|
47
61
|
"sync",
|
|
48
62
|
"suggest"
|
|
49
|
-
].includes(g)) throw new
|
|
50
|
-
if (g === "check" && h.write) throw new
|
|
51
|
-
let v =
|
|
52
|
-
if (!b.id) throw new
|
|
63
|
+
].includes(g)) throw new d(g ? `Unknown command: ${[g, ..._].join(" ")}` : "No command given", !0);
|
|
64
|
+
if (g === "check" && h.write) throw new d("check never writes; use sync --write");
|
|
65
|
+
let v = c.resolve(a.cwd, h.schema ?? "seed.schema.json"), y = h.sidecar ? c.resolve(a.cwd, h.sidecar) : v.replace(/(\.json)?$/, ".context.jsonld"), b = await f(v, "schema");
|
|
66
|
+
if (!b.id) throw new d(`The schema at ${v} has no id; the SDK assigns one when it writes the schema`);
|
|
53
67
|
let x = { base: h.base };
|
|
54
68
|
if (g === "suggest") {
|
|
55
|
-
let n = await
|
|
56
|
-
if (!(e instanceof
|
|
69
|
+
let n = await f(y, "sidecar").catch((e) => {
|
|
70
|
+
if (!(e instanceof d && e.message.startsWith("No sidecar"))) throw e;
|
|
57
71
|
}) ?? {
|
|
58
72
|
schemaId: b.id,
|
|
59
73
|
terms: {}
|
|
60
|
-
},
|
|
74
|
+
}, r = t({
|
|
61
75
|
schema: b,
|
|
62
76
|
sidecar: n
|
|
63
77
|
});
|
|
64
78
|
if (!h.write) {
|
|
65
|
-
|
|
66
|
-
for (let e of
|
|
79
|
+
r.length === 0 && a.out("No suggestions.");
|
|
80
|
+
for (let e of r) a.out(`${m(e)} (${e.id}): ${e.term}`);
|
|
67
81
|
return 0;
|
|
68
82
|
}
|
|
69
|
-
let
|
|
83
|
+
let o = {
|
|
70
84
|
...n.terms,
|
|
71
|
-
...Object.fromEntries(
|
|
85
|
+
...Object.fromEntries(r.map((e) => [e.id, e.term]))
|
|
72
86
|
}, c = {
|
|
73
|
-
...
|
|
87
|
+
...i,
|
|
74
88
|
...n["@context"]
|
|
75
89
|
};
|
|
76
|
-
return await
|
|
90
|
+
return await s(y, p(e({
|
|
77
91
|
schema: b,
|
|
78
92
|
sidecar: {
|
|
79
93
|
...n,
|
|
80
|
-
terms:
|
|
94
|
+
terms: o,
|
|
81
95
|
"@context": c
|
|
82
96
|
}
|
|
83
|
-
}, x))), a.out(`Added ${
|
|
97
|
+
}, x))), a.out(`Added ${r.length} term${r.length === 1 ? "" : "s"} to ${y}. Review them before committing.`), 0;
|
|
84
98
|
}
|
|
85
|
-
let S = await
|
|
99
|
+
let S = await f(y, "sidecar");
|
|
86
100
|
if (g === "sync") {
|
|
87
101
|
let t = e({
|
|
88
102
|
schema: b,
|
|
89
103
|
sidecar: S
|
|
90
104
|
}, x);
|
|
91
|
-
return h.write ? (await
|
|
105
|
+
return h.write ? (await s(y, p(t)), a.out(`Wrote ${y}`), 0) : (a.out(p(t).trimEnd()), 0);
|
|
92
106
|
}
|
|
93
107
|
let C = n({
|
|
94
108
|
schema: b,
|
|
@@ -104,18 +118,18 @@ async function m(i, a) {
|
|
|
104
118
|
}
|
|
105
119
|
if (C.unmapped.length > 0) {
|
|
106
120
|
a.out("Unmapped (exported under protocol IRIs):");
|
|
107
|
-
for (let e of C.unmapped) a.out(` ${
|
|
121
|
+
for (let e of C.unmapped) a.out(` ${m(e)}${e.id ? ` (${e.id})` : " (no id yet)"}`);
|
|
108
122
|
}
|
|
109
123
|
return (C.contextOutdated || C.versionOutdated) && a.out("The sidecar is behind the schema; run `seed-rdf sync --write` to update @context and schemaVersion."), +(C.stale.length > 0 || C.invalid.length > 0);
|
|
110
124
|
} catch (e) {
|
|
111
|
-
if (!(e instanceof
|
|
112
|
-
return a.err(`[Seed Protocol] ${e.message}`), e instanceof
|
|
125
|
+
if (!(e instanceof d) && !(e instanceof TypeError)) throw e;
|
|
126
|
+
return a.err(`[Seed Protocol] ${e.message}`), e instanceof d && e.showUsage && a.err(u), 2;
|
|
113
127
|
}
|
|
114
128
|
}
|
|
115
129
|
//#endregion
|
|
116
130
|
//#region src/bin.ts
|
|
117
|
-
|
|
118
|
-
cwd:
|
|
131
|
+
a.exitCode = await h(a.argv.slice(2), {
|
|
132
|
+
cwd: a.cwd(),
|
|
119
133
|
out: (e) => console.log(e),
|
|
120
134
|
err: (e) => console.error(e)
|
|
121
135
|
});
|
package/dist/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","names":["syncSidecar","suggestTerms","SUGGESTED_PREFIXES","process","path","USAGE","UsageError","message","showUsage","readJson","text","readFile","file","error","what","json","value","target","t","runRdfCli","parseArgs","args","command","extra","positionals","values","io","schemaFile","sidecarFile","schema","options","sidecar","suggestions","s","terms","context","writeFile","synced","report","checkSidecar","id","term","line"],"sources":["../src/cli.ts","../src/bin.ts"],"sourcesContent":["import { readFile, writeFile } from 'node:fs/promises'\nimport path from 'node:path'\nimport { parseArgs } from 'node:util'\nimport type { RdfSidecar } from './lens.js'\nimport { SUGGESTED_PREFIXES, checkSidecar, suggestTerms, syncSidecar, type SidecarSchema } from './sidecar.js'\n\nconst USAGE = `Usage:\n seed-rdf check [--schema <file>] [--sidecar <file>] [--base <iri>]\n List stale terms, terms that aren't IRIs, and unmapped models and properties.\n Exits 1 when there are stale or unreadable terms.\n\n seed-rdf sync [--schema <file>] [--sidecar <file>] [--base <iri>] [--write]\n Regenerate the sidecar's @context from its terms and the schema's current names, and set\n schemaVersion. Prints the result, or writes it to the sidecar with --write.\n\n seed-rdf suggest [--schema <file>] [--sidecar <file>] [--base <iri>] [--write]\n Draft schema.org and dcterms terms for unmapped names with a common meaning. Prints them,\n or adds them to the sidecar (creating it if needed) with --write. Review before committing.\n\nDefault --schema: seedSchema.json. Default --sidecar: the schema's path with .context.jsonld\nin place of .json.`\n\nexport type CliIo = {\n readonly cwd: string\n readonly out: (line: string) => void\n readonly err: (line: string) => void\n}\n\nclass UsageError extends Error {\n constructor(\n message: string,\n readonly showUsage = false,\n ) {\n super(message)\n }\n}\n\nasync function readJson<T>(file: string, what: string): Promise<T> {\n let text: string\n try {\n text = await readFile(file, 'utf8')\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') throw new UsageError(`No ${what} at ${file}`)\n throw error\n }\n try {\n return JSON.parse(text) as T\n } catch (error) {\n throw new UsageError(`The ${what} at ${file} isn't JSON: ${(error as Error).message}`)\n }\n}\n\nconst json = (value: unknown) => `${JSON.stringify(value, null, 2)}\\n`\nconst target = (t: { model: string; property?: string }) => (t.property ? `${t.model}.${t.property}` : t.model)\n\n/**\n * Runs `seed-rdf` with `args` (without the program name) and returns its exit code: 0 when done,\n * 1 when `check` finds stale or unreadable terms, 2 on a usage or input error.\n */\nexport async function runRdfCli(args: readonly string[], io: CliIo): Promise<number> {\n try {\n const { positionals, values } = parseArgs({\n args: [...args],\n allowPositionals: true,\n options: {\n schema: { type: 'string' },\n sidecar: { type: 'string' },\n base: { type: 'string' },\n write: { type: 'boolean' },\n help: { type: 'boolean', short: 'h' },\n },\n })\n const [command, ...extra] = positionals\n if (values.help) {\n io.out(USAGE)\n return 0\n }\n if (!command || extra.length > 0 || !['check', 'sync', 'suggest'].includes(command)) {\n throw new UsageError(command ? `Unknown command: ${[command, ...extra].join(' ')}` : 'No command given', true)\n }\n if (command === 'check' && values.write) throw new UsageError('check never writes; use sync --write')\n\n const schemaFile = path.resolve(io.cwd, values.schema ?? 'seedSchema.json')\n const sidecarFile = values.sidecar\n ? path.resolve(io.cwd, values.sidecar)\n : schemaFile.replace(/(\\.json)?$/, '.context.jsonld')\n const schema = await readJson<SidecarSchema>(schemaFile, 'schema')\n if (!schema.id) throw new UsageError(`The schema at ${schemaFile} has no id; the SDK assigns one when it writes the schema`)\n const options = { base: values.base }\n\n if (command === 'suggest') {\n const existing = await readJson<RdfSidecar>(sidecarFile, 'sidecar').catch((error: unknown) => {\n if (error instanceof UsageError && error.message.startsWith('No sidecar')) return undefined\n throw error\n })\n const sidecar = existing ?? { schemaId: schema.id, terms: {} }\n const suggestions = suggestTerms({ schema, sidecar })\n if (!values.write) {\n if (suggestions.length === 0) io.out('No suggestions.')\n for (const s of suggestions) io.out(`${target(s)} (${s.id}): ${s.term}`)\n return 0\n }\n const terms = { ...sidecar.terms, ...Object.fromEntries(suggestions.map((s) => [s.id, s.term])) }\n const context = { ...SUGGESTED_PREFIXES, ...sidecar['@context'] }\n await writeFile(sidecarFile, json(syncSidecar({ schema, sidecar: { ...sidecar, terms, '@context': context } }, options)))\n io.out(`Added ${suggestions.length} term${suggestions.length === 1 ? '' : 's'} to ${sidecarFile}. Review them before committing.`)\n return 0\n }\n\n const sidecar = await readJson<RdfSidecar>(sidecarFile, 'sidecar')\n if (command === 'sync') {\n const synced = syncSidecar({ schema, sidecar }, options)\n if (!values.write) {\n io.out(json(synced).trimEnd())\n return 0\n }\n await writeFile(sidecarFile, json(synced))\n io.out(`Wrote ${sidecarFile}`)\n return 0\n }\n\n const report = checkSidecar({ schema, sidecar }, options)\n if (report.stale.length > 0) {\n io.err('Stale terms (no model or property in the schema has this id):')\n for (const { id, term } of report.stale) io.err(` ${id}: ${term}`)\n }\n if (report.invalid.length > 0) {\n io.err(`Terms that aren't an IRI or a name with a prefix in @context:`)\n for (const { id, term } of report.invalid) io.err(` ${id}: ${term}`)\n }\n if (report.unmapped.length > 0) {\n io.out('Unmapped (exported under protocol IRIs):')\n for (const t of report.unmapped) io.out(` ${target(t)}${t.id ? ` (${t.id})` : ' (no id yet)'}`)\n }\n if (report.contextOutdated || report.versionOutdated) {\n io.out('The sidecar is behind the schema; run `seed-rdf sync --write` to update @context and schemaVersion.')\n }\n return report.stale.length > 0 || report.invalid.length > 0 ? 1 : 0\n } catch (error) {\n if (!(error instanceof UsageError) && !(error instanceof TypeError)) throw error\n io.err(`[Seed Protocol] ${error.message}`)\n if (error instanceof UsageError && error.showUsage) io.err(USAGE)\n return 2\n }\n}\n","/** `seed-rdf check|sync|suggest`: keeps an app's RDF sidecar in step with its schema. */\nimport process from 'node:process'\nimport { runRdfCli } from './cli.js'\n\nprocess.exitCode = await runRdfCli(process.argv.slice(2), {\n cwd: process.cwd(),\n out: (line) => console.log(line),\n err: (line) => console.error(line),\n})\n"],"mappings":";;;;;;;AAMA,IAAMK,IAAQ,m3BAsBRC,IAAN,cAAyB,MAAM;CAGlB;CAFX,YACE,GACA,IAAqB,IACrB;EADS,AAET,MAAMC,CAAO,GAFJ,KAAA,YAAAC;CAGX;AACF;AAEA,eAAeC,EAAY,GAAc,GAA0B;CACjE,IAAIC;CACJ,IAAI;EACF,IAAO,MAAMC,EAASC,GAAM,MAAM;CACpC,SAASC,GAAO;EAEd,MADKA,EAAgC,SAAS,WAAgB,IAAIP,EAAW,MAAMQ,EAAK,MAAMF,GAAM,IAC9FC;CACR;CACA,IAAI;EACF,OAAO,KAAK,MAAMH,CAAI;CACxB,SAASG,GAAO;EACd,MAAM,IAAIP,EAAW,OAAOQ,EAAK,MAAMF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EA,IAAMC,IAASC,EAAa;GAAE;GAAQ;EAAQ,GAAGT,CAAO;EACxD,IAAIQ,EAAO,MAAM,SAAS,GAAG;GAC3B,EAAG,IAAI,+DAA+D;GACtE,KAAK,IAAM,EAAE,OAAI,aAAUA,EAAO,OAAO,EAAG,IAAI,KAAKE,EAAG,IAAIC,GAAM;EACpE;EACA,IAAIH,EAAO,QAAQ,SAAS,GAAG;GAC7B,EAAG,IAAI,+DAA+D;GACtE,KAAK,IAAM,EAAE,OAAI,aAAUA,EAAO,SAAS,EAAG,IAAI,KAAKE,EAAG,IAAIC,GAAM;EACtE;EACA,IAAIH,EAAO,SAAS,SAAS,GAAG;GAC9B,EAAG,IAAI,0CAA0C;GACjD,KAAK,IAAMpB,KAAKoB,EAAO,UAAU,EAAG,IAAI,KAAKrB,EAAOC,CAAC,IAAIA,EAAE,KAAK,KAAKA,EAAE,GAAG,KAAK,gBAAgB;EACjG;EAIA,QAHIoB,EAAO,mBAAmBA,EAAO,oBACnCZ,EAAG,IAAI,qGAAqG,GAEvG,IAAO,MAAM,SAAS,KAAKY,EAAO,QAAQ,SAAS;CAC5D,SAASzB,GAAO;EACd,IAAI,EAAEA,aAAiBP,MAAe,EAAEO,aAAiB,YAAY,MAAMA;EAG3E,OAFAa,EAAG,IAAI,mBAAmBb,EAAM,SAAS,GACrCA,aAAiBP,KAAcO,EAAM,aAAWa,EAAG,IAAIrB,CAAK,GACzD;CACT;AACF;;;AC5IA,EAAQ,WAAW,MAAMc,EAAUhB,EAAQ,KAAK,MAAM,CAAC,GAAG;CACxD,KAAKA,EAAQ,IAAI;CACjB,MAAM,MAAS,QAAQ,IAAIuC,CAAI;CAC/B,MAAM,MAAS,QAAQ,MAAMA,CAAI;AACnC,CAAC"}
|
|
1
|
+
{"version":3,"file":"bin.js","names":["syncSidecar","suggestTerms","DEFAULT_SCHEMA_FILE","SUGGESTED_PREFIXES","process","path","USAGE","UsageError","message","showUsage","readJson","text","readFile","file","error","what","json","value","target","t","runRdfCli","parseArgs","args","command","extra","positionals","values","io","schemaFile","sidecarFile","schema","options","sidecar","suggestions","s","terms","context","writeFile","synced","report","checkSidecar","id","term","line"],"sources":["../src/cli.ts","../src/bin.ts"],"sourcesContent":["import { readFile, writeFile } from 'node:fs/promises'\nimport path from 'node:path'\nimport { parseArgs } from 'node:util'\nimport { DEFAULT_SCHEMA_FILE } from './defaults.js'\nimport type { RdfSidecar } from './lens.js'\nimport { SUGGESTED_PREFIXES, checkSidecar, suggestTerms, syncSidecar, type SidecarSchema } from './sidecar.js'\n\nconst USAGE = `Usage:\n seed-rdf check [--schema <file>] [--sidecar <file>] [--base <iri>]\n List stale terms, terms that aren't IRIs, and unmapped models and properties.\n Exits 1 when there are stale or unreadable terms.\n\n seed-rdf sync [--schema <file>] [--sidecar <file>] [--base <iri>] [--write]\n Regenerate the sidecar's @context from its terms and the schema's current names, and set\n schemaVersion. Prints the result, or writes it to the sidecar with --write.\n\n seed-rdf suggest [--schema <file>] [--sidecar <file>] [--base <iri>] [--write]\n Draft schema.org and dcterms terms for unmapped names with a common meaning. Prints them,\n or adds them to the sidecar (creating it if needed) with --write. Review before committing.\n\nDefault --schema: ${DEFAULT_SCHEMA_FILE}. Default --sidecar: the schema's path with .context.jsonld\nin place of .json.`\n\nexport type CliIo = {\n readonly cwd: string\n readonly out: (line: string) => void\n readonly err: (line: string) => void\n}\n\nclass UsageError extends Error {\n constructor(\n message: string,\n readonly showUsage = false,\n ) {\n super(message)\n }\n}\n\nasync function readJson<T>(file: string, what: string): Promise<T> {\n let text: string\n try {\n text = await readFile(file, 'utf8')\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') throw new UsageError(`No ${what} at ${file}`)\n throw error\n }\n try {\n return JSON.parse(text) as T\n } catch (error) {\n throw new UsageError(`The ${what} at ${file} isn't JSON: ${(error as Error).message}`)\n }\n}\n\nconst json = (value: unknown) => `${JSON.stringify(value, null, 2)}\\n`\nconst target = (t: { model: string; property?: string }) => (t.property ? `${t.model}.${t.property}` : t.model)\n\n/**\n * Runs `seed-rdf` with `args` (without the program name) and returns its exit code: 0 when done,\n * 1 when `check` finds stale or unreadable terms, 2 on a usage or input error.\n */\nexport async function runRdfCli(args: readonly string[], io: CliIo): Promise<number> {\n try {\n const { positionals, values } = parseArgs({\n args: [...args],\n allowPositionals: true,\n options: {\n schema: { type: 'string' },\n sidecar: { type: 'string' },\n base: { type: 'string' },\n write: { type: 'boolean' },\n help: { type: 'boolean', short: 'h' },\n },\n })\n const [command, ...extra] = positionals\n if (values.help) {\n io.out(USAGE)\n return 0\n }\n if (!command || extra.length > 0 || !['check', 'sync', 'suggest'].includes(command)) {\n throw new UsageError(command ? `Unknown command: ${[command, ...extra].join(' ')}` : 'No command given', true)\n }\n if (command === 'check' && values.write) throw new UsageError('check never writes; use sync --write')\n\n const schemaFile = path.resolve(io.cwd, values.schema ?? DEFAULT_SCHEMA_FILE)\n const sidecarFile = values.sidecar\n ? path.resolve(io.cwd, values.sidecar)\n : schemaFile.replace(/(\\.json)?$/, '.context.jsonld')\n const schema = await readJson<SidecarSchema>(schemaFile, 'schema')\n if (!schema.id) throw new UsageError(`The schema at ${schemaFile} has no id; the SDK assigns one when it writes the schema`)\n const options = { base: values.base }\n\n if (command === 'suggest') {\n const existing = await readJson<RdfSidecar>(sidecarFile, 'sidecar').catch((error: unknown) => {\n if (error instanceof UsageError && error.message.startsWith('No sidecar')) return undefined\n throw error\n })\n const sidecar = existing ?? { schemaId: schema.id, terms: {} }\n const suggestions = suggestTerms({ schema, sidecar })\n if (!values.write) {\n if (suggestions.length === 0) io.out('No suggestions.')\n for (const s of suggestions) io.out(`${target(s)} (${s.id}): ${s.term}`)\n return 0\n }\n const terms = { ...sidecar.terms, ...Object.fromEntries(suggestions.map((s) => [s.id, s.term])) }\n const context = { ...SUGGESTED_PREFIXES, ...sidecar['@context'] }\n await writeFile(sidecarFile, json(syncSidecar({ schema, sidecar: { ...sidecar, terms, '@context': context } }, options)))\n io.out(`Added ${suggestions.length} term${suggestions.length === 1 ? '' : 's'} to ${sidecarFile}. Review them before committing.`)\n return 0\n }\n\n const sidecar = await readJson<RdfSidecar>(sidecarFile, 'sidecar')\n if (command === 'sync') {\n const synced = syncSidecar({ schema, sidecar }, options)\n if (!values.write) {\n io.out(json(synced).trimEnd())\n return 0\n }\n await writeFile(sidecarFile, json(synced))\n io.out(`Wrote ${sidecarFile}`)\n return 0\n }\n\n const report = checkSidecar({ schema, sidecar }, options)\n if (report.stale.length > 0) {\n io.err('Stale terms (no model or property in the schema has this id):')\n for (const { id, term } of report.stale) io.err(` ${id}: ${term}`)\n }\n if (report.invalid.length > 0) {\n io.err(`Terms that aren't an IRI or a name with a prefix in @context:`)\n for (const { id, term } of report.invalid) io.err(` ${id}: ${term}`)\n }\n if (report.unmapped.length > 0) {\n io.out('Unmapped (exported under protocol IRIs):')\n for (const t of report.unmapped) io.out(` ${target(t)}${t.id ? ` (${t.id})` : ' (no id yet)'}`)\n }\n if (report.contextOutdated || report.versionOutdated) {\n io.out('The sidecar is behind the schema; run `seed-rdf sync --write` to update @context and schemaVersion.')\n }\n return report.stale.length > 0 || report.invalid.length > 0 ? 1 : 0\n } catch (error) {\n if (!(error instanceof UsageError) && !(error instanceof TypeError)) throw error\n io.err(`[Seed Protocol] ${error.message}`)\n if (error instanceof UsageError && error.showUsage) io.err(USAGE)\n return 2\n }\n}\n","/** `seed-rdf check|sync|suggest`: keeps an app's RDF sidecar in step with its schema. */\nimport process from 'node:process'\nimport { runRdfCli } from './cli.js'\n\nprocess.exitCode = await runRdfCli(process.argv.slice(2), {\n cwd: process.cwd(),\n out: (line) => console.log(line),\n err: (line) => console.error(line),\n})\n"],"mappings":";;;;;;;AAOA,IAAMM,IAAQ;;;;;;;;;;;;;oBAaMJ,EAAoB;qBASlCK,IAAN,cAAyB,MAAM;CAGlB;CAFX,YACE,GACA,IAAqB,IACrB;EADS,AAET,MAAMC,CAAO,GAFJ,KAAA,YAAAC;CAGX;AACF;AAEA,eAAeC,E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AAM,CAAC,GAAG;CACxD,KAAKA,EAAQ,IAAI;CACjB,MAAM,MAAS,QAAQ,IAAIuC,CAAI;CAC/B,MAAM,MAAS,QAAQ,MAAMA,CAAI;AACnC,CAAC"}
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAuBA,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CACrC,CAAA;AA6BD;;;GAGG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAqFnF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The schema file `seed-rdf` reads when `--schema` isn't given, and the name the docs use for an
|
|
3
|
+
* app's schema. `@seedprotocol/vite`'s sidecar check defaults to the same name.
|
|
4
|
+
*/
|
|
5
|
+
export declare const DEFAULT_SCHEMA_FILE = "seed.schema.json";
|
|
6
|
+
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,mBAAmB,qBAAqB,CAAA"}
|
package/dist/graph.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../src/graph.ts"],"names":[],"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AM,iBAAiB,GAAG;IAC9B,0FAA0F;IAC1F,OAAO,EAAE,MAAM,CAAA;IACf,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,CAAA;IAC9C;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AA6GD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,EAAE,OAAO,EAAE,iBAAiB,GAAG,UAAU,CAgErG"}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { toTurtle } from './turtle.js';
|
|
|
10
10
|
export { toJsonLd } from './jsonld.js';
|
|
11
11
|
export type { JsonLdDocument } from './jsonld.js';
|
|
12
12
|
export { seedVocabulary } from './vocabulary.js';
|
|
13
|
+
export { DEFAULT_SCHEMA_FILE } from './defaults.js';
|
|
13
14
|
export { toShacl } from './shacl.js';
|
|
14
15
|
export type { ShaclOptions } from './shacl.js';
|
|
15
16
|
export { SUGGESTED_PREFIXES, checkSidecar, sidecarContext, suggestTerms, syncSidecar } from './sidecar.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,0BAA0B,EAAE,MAAM,qBAAqB,CAAA;AAC1F,OAAO,EAAc,KAAK,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEhF,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAC1D,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,i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