@canonical/design-system 0.1.1 → 0.1.2
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/.github/PULL_REQUEST_TEMPLATE.md +13 -0
- package/.github/workflows/ci.yml +39 -0
- package/.mcp.json +1 -3
- package/biome.json +1 -1
- package/bun.lock +38 -35
- package/data/apps_launchpad/component/badge.ttl +2 -1
- package/data/apps_launchpad/component/button.ttl +2 -1
- package/data/apps_launchpad/component/combobox.ttl +2 -1
- package/data/apps_launchpad/component/text_input.ttl +2 -1
- package/data/apps_launchpad/component/tooltip.ttl +2 -1
- package/data/global/component/announcement.ttl +1 -1
- package/data/global/component/button.ttl +3 -1
- package/data/global/component/code_snippet.ttl +1 -1
- package/data/global/component/heading.ttl +3 -2
- package/data/global/component/tile.ttl +1 -1
- package/data/global/component/tooltip.ttl +38 -19
- package/data/global/pattern/dropdown_button.ttl +1 -1
- package/data/global/pattern/timeline.ttl +8 -4
- package/definitions/ontology.ttl +108 -161
- package/package.json +1 -1
- package/skills/anatomy-author/SKILL.md +5 -0
- package/skills/component-specifier/SKILL.md +5 -2
- package/skills/design-auditor/SKILL.md +5 -0
- package/source.json +7 -2
- package/src/cli.ts +33 -33
- package/src/collect/generateTurtle.tests.ts +181 -176
- package/src/collect/generateTurtle.ts +189 -138
- package/src/collect/index.ts +5 -2
- package/src/collect/scanAnnotations.tests.ts +116 -110
- package/src/collect/scanAnnotations.ts +35 -33
- package/src/collect/types.ts +34 -33
- package/src/collect/validateCollectConfig.tests.ts +135 -112
- package/src/collect/validateCollectConfig.ts +60 -54
- package/src/collect-implementations.ts +101 -88
- package/src/commands/extract.tests.ts +31 -32
- package/src/commands/extract.ts +29 -27
- package/src/commands/index.ts +1 -1
- package/src/commands/list.tests.ts +13 -14
- package/src/commands/list.ts +9 -9
- package/src/commands/transform.tests.ts +21 -21
- package/src/commands/transform.ts +118 -114
- package/src/config/types.ts +40 -40
- package/src/config/validateConfig.tests.ts +31 -31
- package/src/config/validateConfig.ts +9 -9
- package/src/constants.ts +7 -8
- package/src/graph/GraphStore.tests.ts +111 -111
- package/src/graph/GraphStore.ts +205 -189
- package/src/graph/PrefixMap.tests.ts +124 -122
- package/src/graph/PrefixMap.ts +77 -77
- package/src/graph/buildUri.tests.ts +116 -116
- package/src/graph/buildUri.ts +45 -45
- package/src/graph/index.ts +2 -2
- package/src/graph/types.ts +3 -3
- package/src/providers/CodaProvider.tests.ts +233 -233
- package/src/providers/CodaProvider.ts +145 -145
- package/src/providers/CodaProvider.types.generated.ts +12484 -12123
- package/src/providers/index.ts +13 -13
- package/src/serializers/JSONSerializer.tests.ts +64 -64
- package/src/serializers/JSONSerializer.ts +51 -51
- package/src/serializers/TTLSerializer.tests.ts +45 -45
- package/src/serializers/TTLSerializer.ts +64 -57
- package/src/serializers/index.ts +4 -1
- package/src/serializers/types.ts +3 -3
- package/src/transform/resolveReferences.tests.ts +47 -43
- package/src/transform/resolveReferences.ts +18 -18
- package/src/transform/resolveValue.tests.ts +55 -49
- package/src/transform/resolveValue.ts +48 -48
- package/src/transform/transform.tests.ts +90 -77
- package/src/transform/transform.ts +77 -77
- package/src/transform/transformRow.tests.ts +372 -356
- package/src/transform/transformRow.ts +222 -191
- package/src/transform/types.ts +4 -4
- package/tsconfig.json +2 -1
- package/.gemini/settings.json +0 -14
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Dirent } from "node:fs";
|
|
2
|
+
import { mkdir, readdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
2
3
|
import { join } from "node:path";
|
|
3
4
|
import type { Config } from "../config/types.js";
|
|
5
|
+
import { serializeToJsonLd, serializeToTurtle } from "../serializers/index.js";
|
|
4
6
|
import transformData from "../transform/transform.js";
|
|
5
|
-
import { serializeToTurtle, serializeToJsonLd } from "../serializers/index.js";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Extracted data structure from the extract command
|
|
9
10
|
*/
|
|
10
11
|
interface ExtractedData {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
document: string;
|
|
13
|
+
extractedAt: string;
|
|
14
|
+
tables: Record<string, Array<Record<string, unknown>>>;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* Load extracted data from file
|
|
18
19
|
*/
|
|
19
20
|
async function loadExtractedData(inputPath: string): Promise<ExtractedData> {
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
const content = await readFile(inputPath, "utf-8");
|
|
22
|
+
return JSON.parse(content);
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
/**
|
|
@@ -30,21 +31,21 @@ async function loadExtractedData(inputPath: string): Promise<ExtractedData> {
|
|
|
30
31
|
* Returns array of path parts, or null if URI doesn't match expected format
|
|
31
32
|
*/
|
|
32
33
|
function parseUri(uri: string): string[] | null {
|
|
33
|
-
|
|
34
|
+
const dsNamespace = "https://ds.canonical.com/";
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
if (!uri.startsWith(dsNamespace)) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
const path = uri.slice(dsNamespace.length);
|
|
41
|
+
const parts = path.split(".");
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
// Reject URIs with empty segments (e.g. double dots from unresolved templates)
|
|
44
|
+
if (parts.some((p) => p === "")) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
return parts.length > 0 ? parts : null;
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
/**
|
|
@@ -52,106 +53,109 @@ function parseUri(uri: string): string[] | null {
|
|
|
52
53
|
* Called before writing new output to avoid stale files accumulating.
|
|
53
54
|
*/
|
|
54
55
|
async function cleanOutputDir(outputDir: string, ext: string): Promise<void> {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
56
|
+
let entries: Dirent[];
|
|
57
|
+
try {
|
|
58
|
+
entries = (await readdir(outputDir, {
|
|
59
|
+
withFileTypes: true,
|
|
60
|
+
recursive: true,
|
|
61
|
+
})) as Dirent[];
|
|
62
|
+
} catch {
|
|
63
|
+
return; // Directory doesn't exist yet
|
|
64
|
+
}
|
|
65
|
+
await Promise.all(
|
|
66
|
+
entries
|
|
67
|
+
.filter((e) => e.isFile() && e.name.endsWith(`.${ext}`))
|
|
68
|
+
.map((e) => rm(join(e.parentPath, e.name), { force: true })),
|
|
69
|
+
);
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
/**
|
|
69
73
|
* Transforms extracted data into RDF and serializes to files
|
|
70
74
|
*/
|
|
71
75
|
export default async function transform(config: Config): Promise<void> {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
76
|
+
if (!config.transform) {
|
|
77
|
+
throw new Error("Transform config section is required");
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const inputPath = config.extract?.output;
|
|
81
|
+
if (!inputPath) {
|
|
82
|
+
throw new Error("Extract output path is required for transform");
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const extractedData = await loadExtractedData(inputPath);
|
|
86
|
+
const { store, prefixes, subjects } = transformData(
|
|
87
|
+
config.transform,
|
|
88
|
+
extractedData,
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
const isTurtle = config.transform.format === "ttl";
|
|
92
|
+
const ext = isTurtle ? "ttl" : "jsonld";
|
|
93
|
+
|
|
94
|
+
await mkdir(config.transform.outputDir, { recursive: true });
|
|
95
|
+
await cleanOutputDir(config.transform.outputDir, ext);
|
|
96
|
+
|
|
97
|
+
if (config.transform.atomicity === "class") {
|
|
98
|
+
// One file per table - serialize all subjects together
|
|
99
|
+
const content = isTurtle
|
|
100
|
+
? await serializeToTurtle(store, { prefixes })
|
|
101
|
+
: JSON.stringify(await serializeToJsonLd(store, { prefixes }), null, 2);
|
|
102
|
+
|
|
103
|
+
const outputPath = join(config.transform.outputDir, `all.${ext}`);
|
|
104
|
+
await writeFile(outputPath, content);
|
|
105
|
+
console.log(`Wrote ${subjects.length} subjects to ${outputPath}`);
|
|
106
|
+
} else {
|
|
107
|
+
// One file per instance, organized by URI structure
|
|
108
|
+
for (const subjectUri of subjects) {
|
|
109
|
+
const parts = parseUri(subjectUri);
|
|
110
|
+
|
|
111
|
+
let outputDir: string;
|
|
112
|
+
let filename: string;
|
|
113
|
+
|
|
114
|
+
if (parts && parts.length > 1) {
|
|
115
|
+
// Use all parts except the last as directory path, last part as filename
|
|
116
|
+
const dirParts = parts.slice(0, -1);
|
|
117
|
+
filename = parts[parts.length - 1];
|
|
118
|
+
outputDir = join(config.transform.outputDir, ...dirParts);
|
|
119
|
+
} else if (parts && parts.length === 1) {
|
|
120
|
+
// Single part - put in root output dir
|
|
121
|
+
outputDir = config.transform.outputDir;
|
|
122
|
+
filename = parts[0];
|
|
123
|
+
} else {
|
|
124
|
+
// Fallback for URIs that don't match expected format
|
|
125
|
+
outputDir = config.transform.outputDir;
|
|
126
|
+
const lastSlash = subjectUri.lastIndexOf("/");
|
|
127
|
+
const path =
|
|
128
|
+
lastSlash !== -1 ? subjectUri.slice(lastSlash + 1) : subjectUri;
|
|
129
|
+
const colonIdx = path.indexOf(":");
|
|
130
|
+
filename = colonIdx !== -1 ? path.slice(colonIdx + 1) : path;
|
|
131
|
+
filename = filename.replace(/[^a-z0-9.\-_]/gi, "_");
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
await mkdir(outputDir, { recursive: true });
|
|
135
|
+
const outputPath = join(outputDir, `${filename}.${ext}`);
|
|
136
|
+
|
|
137
|
+
// Create a new store with just this subject's quads
|
|
138
|
+
const subjectQuads = store.getQuadsForSubject(subjectUri);
|
|
139
|
+
const { GraphStore } = await import("../graph/index.js");
|
|
140
|
+
const subjectStore = new GraphStore();
|
|
141
|
+
for (const quad of subjectQuads) {
|
|
142
|
+
// Re-add using full URIs since we extracted them from the original store
|
|
143
|
+
subjectStore.getN3Store().addQuad(quad);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const content = isTurtle
|
|
147
|
+
? await serializeToTurtle(subjectStore, { prefixes })
|
|
148
|
+
: JSON.stringify(
|
|
149
|
+
await serializeToJsonLd(subjectStore, {
|
|
150
|
+
prefixes,
|
|
151
|
+
subject: subjectUri,
|
|
152
|
+
}),
|
|
153
|
+
null,
|
|
154
|
+
2,
|
|
155
|
+
);
|
|
156
|
+
|
|
157
|
+
await writeFile(outputPath, content);
|
|
158
|
+
}
|
|
159
|
+
console.log(`Wrote ${subjects.length} files`);
|
|
160
|
+
}
|
|
157
161
|
}
|
package/src/config/types.ts
CHANGED
|
@@ -19,33 +19,33 @@ export type Atomicity = "class" | "instance";
|
|
|
19
19
|
* Inline table configuration for embedding related data as blank nodes
|
|
20
20
|
*/
|
|
21
21
|
export interface InlineConfig {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
/** Name of the table in extractedData.tables to embed */
|
|
23
|
+
table: string;
|
|
24
|
+
/** Property mappings for the blank node (column → predicate) */
|
|
25
|
+
properties: Record<string, string>;
|
|
26
|
+
/** Optional: class type for the blank node */
|
|
27
|
+
class?: string;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* JSON-LD context value - can be a string or object with @id, @type
|
|
32
32
|
*/
|
|
33
33
|
export type ContextValue =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
34
|
+
| string
|
|
35
|
+
| {
|
|
36
|
+
"@id": string;
|
|
37
|
+
"@type"?: string;
|
|
38
|
+
"@container"?: string;
|
|
39
|
+
/** Embed related data inline as blank nodes */
|
|
40
|
+
"@inline"?: InlineConfig;
|
|
41
|
+
};
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* JSON-LD @context - maps column names directly to predicates
|
|
45
45
|
*/
|
|
46
46
|
export type JsonLdContext = {
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
"@vocab"?: string;
|
|
48
|
+
[columnName: string]: ContextValue | undefined;
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
/**
|
|
@@ -53,52 +53,52 @@ export type JsonLdContext = {
|
|
|
53
53
|
* Note: Column names in @context ARE the Coda column names
|
|
54
54
|
*/
|
|
55
55
|
export interface TableTransform {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
56
|
+
"@context": JsonLdContext;
|
|
57
|
+
class: string;
|
|
58
|
+
uriTemplate: string;
|
|
59
|
+
/**
|
|
60
|
+
* Additional literal column→predicate mappings applied only when the
|
|
61
|
+
* resolved RDF class matches the key (prefixed form, e.g. "ds:Layout").
|
|
62
|
+
* Values in the inner map are `{ columnName: predicate }` pairs and are
|
|
63
|
+
* treated as plain string literals (same semantics as a bare string in @context).
|
|
64
|
+
*/
|
|
65
|
+
classProperties?: Record<string, Record<string, string>>;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* Reference configuration for cross-table lookups
|
|
70
70
|
*/
|
|
71
71
|
export interface Reference {
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
uriTemplate: string;
|
|
73
|
+
keyColumn?: string;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* Extract command configuration
|
|
78
78
|
*/
|
|
79
79
|
export interface ExtractConfig {
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
output: string;
|
|
81
|
+
tables: Record<string, string>;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* Transform command configuration
|
|
86
86
|
*/
|
|
87
87
|
export interface TransformConfig {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
format: Format;
|
|
89
|
+
outputDir: string;
|
|
90
|
+
atomicity: Atomicity;
|
|
91
|
+
cleanupExtract?: boolean;
|
|
92
|
+
tables: Record<string, TableTransform>;
|
|
93
|
+
references?: Record<string, Reference>;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
/**
|
|
97
97
|
* Full source configuration
|
|
98
98
|
*/
|
|
99
99
|
export interface Config {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
document: string;
|
|
101
|
+
provider: Provider;
|
|
102
|
+
extract?: ExtractConfig;
|
|
103
|
+
transform?: TransformConfig;
|
|
104
104
|
}
|
|
@@ -2,45 +2,45 @@ import { describe, expect, it } from "vitest";
|
|
|
2
2
|
import validateConfig from "./validateConfig.js";
|
|
3
3
|
|
|
4
4
|
describe("validateConfig", () => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
it("should return valid config when data is valid", () => {
|
|
6
|
+
const validConfig = {
|
|
7
|
+
document: "doc-123",
|
|
8
|
+
provider: "coda",
|
|
9
|
+
};
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
const result = validateConfig(validConfig);
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
expect(result).toEqual(validConfig);
|
|
14
|
+
});
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
it("should throw for missing required fields", () => {
|
|
17
|
+
const invalidConfig = {};
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
expect(() => validateConfig(invalidConfig)).toThrow("Invalid config");
|
|
20
|
+
});
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
it("should throw for unsupported provider", () => {
|
|
23
|
+
const invalidConfig = {
|
|
24
|
+
document: "doc-123",
|
|
25
|
+
provider: "notion",
|
|
26
|
+
};
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
expect(() => validateConfig(invalidConfig)).toThrow("Invalid config");
|
|
29
|
+
});
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
it("should throw for missing document", () => {
|
|
32
|
+
const invalidConfig = {
|
|
33
|
+
provider: "coda",
|
|
34
|
+
};
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
expect(() => validateConfig(invalidConfig)).toThrow("Invalid config");
|
|
37
|
+
});
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
it("should throw for missing provider", () => {
|
|
40
|
+
const invalidConfig = {
|
|
41
|
+
document: "doc-123",
|
|
42
|
+
};
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
expect(() => validateConfig(invalidConfig)).toThrow("Invalid config");
|
|
45
|
+
});
|
|
46
46
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Ajv from "ajv";
|
|
2
1
|
import type { ErrorObject } from "ajv";
|
|
3
|
-
import
|
|
2
|
+
import Ajv from "ajv";
|
|
4
3
|
import schema from "./source.schema.json" with { type: "json" };
|
|
4
|
+
import type { Config } from "./types.js";
|
|
5
5
|
|
|
6
6
|
const ajv = new Ajv.default({ allErrors: true });
|
|
7
7
|
const validateSchema = ajv.compile<Config>(schema);
|
|
@@ -11,11 +11,11 @@ const validateSchema = ajv.compile<Config>(schema);
|
|
|
11
11
|
* @throws Error if validation fails
|
|
12
12
|
*/
|
|
13
13
|
export default function validateConfig(data: unknown): Config {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
if (!validateSchema(data)) {
|
|
15
|
+
const errors = validateSchema.errors
|
|
16
|
+
?.map((e: ErrorObject) => `${e.instancePath} ${e.message}`)
|
|
17
|
+
.join(", ");
|
|
18
|
+
throw new Error(`Invalid config: ${errors}`);
|
|
19
|
+
}
|
|
20
|
+
return data as Config;
|
|
21
21
|
}
|
package/src/constants.ts
CHANGED
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
* RDF namespace URIs used throughout the application
|
|
3
3
|
*/
|
|
4
4
|
export const NAMESPACES = {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
ds: "https://ds.canonical.com/",
|
|
6
|
+
rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
|
|
7
7
|
} as const;
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Common RDF predicates
|
|
11
11
|
*/
|
|
12
12
|
export const PREDICATES = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
hasModifierFamily: `${NAMESPACES.ds}hasModifierFamily`,
|
|
13
|
+
type: `${NAMESPACES.rdf}type`,
|
|
14
|
+
name: `${NAMESPACES.ds}name`,
|
|
15
|
+
summary: `${NAMESPACES.ds}summary`,
|
|
16
|
+
tier: `${NAMESPACES.ds}tier`,
|
|
17
|
+
hasModifierFamily: `${NAMESPACES.ds}hasModifierFamily`,
|
|
19
18
|
} as const;
|