@manta-eu/rdf-lib 0.1.4 → 0.1.6
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/dist/rdf-namespaces.d.ts
CHANGED
|
@@ -69,6 +69,7 @@ export type LabeledNamespacePrefix = keyof typeof labeledNamespaces;
|
|
|
69
69
|
export declare const infrastructureNamespaces: Set<string>;
|
|
70
70
|
export declare const wellKnownPredicates: {
|
|
71
71
|
readonly actionShape: `${string}actionShape`;
|
|
72
|
+
readonly autoPilotEnabled: `${string}autoPilotEnabled`;
|
|
72
73
|
readonly label: `${string}label`;
|
|
73
74
|
readonly type: `${string}type`;
|
|
74
75
|
readonly name: `${string}name`;
|
|
@@ -89,6 +90,7 @@ export declare function expandPrefix(prefixed: string): string;
|
|
|
89
90
|
export declare function compactUri(uri: string): string;
|
|
90
91
|
export declare const owlNothingIri = "http://www.w3.org/2002/07/owl#Nothing";
|
|
91
92
|
export declare function isOwlNothing(value: string): boolean;
|
|
93
|
+
export declare const igraphNodeIri = "http://rdf.naturallexicon.org/ont-app/igraph/ont#node";
|
|
92
94
|
export declare function iriLocalName(iri: string): string;
|
|
93
95
|
export declare function iriNamespace(iri: string): string;
|
|
94
96
|
export declare const rdfoxDefaultBaseIri = "https://rdfox.com/default-base-iri/";
|
|
@@ -104,7 +106,7 @@ export declare function formatEntityName(entityUri: string): string;
|
|
|
104
106
|
export declare const m: import("ldkit").NamespaceInterface<{
|
|
105
107
|
readonly iri: string;
|
|
106
108
|
readonly prefix: ":";
|
|
107
|
-
readonly terms: readonly ["BlendedPerformanceDaily", "CampaignChannelBenchmark", "CampaignPerformanceSummary", "
|
|
109
|
+
readonly terms: readonly ["BlendedPerformanceDaily", "CampaignChannelBenchmark", "CampaignPerformanceSummary", "ConversationStarter", "KPISnapshot", "ManualAction", "MetaAd", "MetaAdSet", "MetaCampaign", "Product", "ProductProfitability", "ProductSalesRanking", "ProductVariant", "assignee", "budgetIncreaseFactor", "changeSet", "currentRoas", "dailyBudget", "defaultResolution", "description", "integration", "pauseReason", "previousDailyBudget", "priority", "retryable", "scaleReason", "status", "wastedSpend"];
|
|
108
110
|
}>;
|
|
109
111
|
export declare const rdf: import("ldkit").NamespaceInterface<{
|
|
110
112
|
readonly iri: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rdf-namespaces.d.ts","sourceRoot":"","sources":["../src/rdf-namespaces.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC1G,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEnF,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC;AACzB,MAAM,MAAM,KAAK,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;AAE1C,eAAO,MAAM,OAAO,QAAiB,CAAC;AAEtC,MAAM,MAAM,aAAa,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"rdf-namespaces.d.ts","sourceRoot":"","sources":["../src/rdf-namespaces.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC1G,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEnF,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC;AACzB,MAAM,MAAM,KAAK,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;AAE1C,eAAO,MAAM,OAAO,QAAiB,CAAC;AAEtC,MAAM,MAAM,aAAa,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,E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C;AAC9C,eAAO,MAAM,KAAK;;;;EAAyB,CAAC;AAC5C,eAAO,MAAM,GAAG;;;;EAAuB,CAAC;AACxC,eAAO,MAAM,QAAQ;;;;EAA4B,CAAC;AAClD,eAAO,MAAM,KAAK;;;;EAAyB,CAAC;AAC5C,eAAO,MAAM,IAAI;;;;EAA8D,CAAC;AAChF,eAAO,MAAM,OAAO;;;;EAA2B,CAAC"}
|
package/dist/rdf-namespaces.js
CHANGED
|
@@ -5,7 +5,8 @@ import { createNamespace } from "ldkit/namespaces";
|
|
|
5
5
|
export { cs, namespaces, namespacesForRealm, namespacesForRoot, nfo, sh } from "@manta-eu/ldo/namespaces";
|
|
6
6
|
export { activeRealm, realmVocabBase, realmVocabLabel } from "@manta-eu/ldo/realm";
|
|
7
7
|
export const baseIri = namespaces[""];
|
|
8
|
-
// Covers every namespace with typed schemas in @manta-eu/ldo
|
|
8
|
+
// Covers every namespace with typed schemas in @manta-eu/ldo,
|
|
9
|
+
// excluding infrastructure and integrations without schemas yet
|
|
9
10
|
// mcontent uses a literal IRI — not yet in any realm's vocab.py prefix dict
|
|
10
11
|
export const labeledNamespaces = {
|
|
11
12
|
m: { iri: namespaces[""], label: realmVocabLabel() },
|
|
@@ -37,6 +38,7 @@ export const infrastructureNamespaces = new Set([
|
|
|
37
38
|
]);
|
|
38
39
|
export const wellKnownPredicates = {
|
|
39
40
|
actionShape: `${namespaces[""]}actionShape`,
|
|
41
|
+
autoPilotEnabled: `${namespaces[""]}autoPilotEnabled`,
|
|
40
42
|
label: `${namespaces.rdfs}label`,
|
|
41
43
|
type: `${namespaces.rdf}type`,
|
|
42
44
|
name: `${namespaces.schema}name`,
|
|
@@ -103,11 +105,13 @@ export function validateFullIri(iri) {
|
|
|
103
105
|
throw new Error(`Invalid IRI: malformed URL - got "${iri}"`);
|
|
104
106
|
}
|
|
105
107
|
}
|
|
108
|
+
// eslint-disable-next-line no-control-regex -- an IRI must not contain a control character
|
|
106
109
|
const iriUnsafeCharPattern = /[\s<>"{}|\\^`\x00-\x1f]/g;
|
|
107
110
|
export function encodeIriUnsafeChars(value) {
|
|
108
111
|
return value.replace(iriUnsafeCharPattern, (char) => encodeURIComponent(char));
|
|
109
112
|
}
|
|
110
113
|
// Escapes '%' as well, so a local name survives the round trip
|
|
114
|
+
// eslint-disable-next-line no-control-regex -- an IRI must not contain a control character
|
|
111
115
|
const localNameUnsafeCharPattern = /[%#?/\s<>"{}|\\^`\x00-\x1f]/g;
|
|
112
116
|
export function encodeIriLocalName(value) {
|
|
113
117
|
return value.replace(localNameUnsafeCharPattern, (char) => encodeURIComponent(char));
|
|
@@ -172,6 +176,8 @@ export const owlNothingIri = "http://www.w3.org/2002/07/owl#Nothing";
|
|
|
172
176
|
export function isOwlNothing(value) {
|
|
173
177
|
return value === "owl:Nothing" || value === owlNothingIri;
|
|
174
178
|
}
|
|
179
|
+
// ont-app/igraph library artifact carried in the graph — not domain vocab; hidden from change surfaces.
|
|
180
|
+
export const igraphNodeIri = "http://rdf.naturallexicon.org/ont-app/igraph/ont#node";
|
|
175
181
|
export function iriLocalName(iri) {
|
|
176
182
|
return iri.split(/[#/]/).pop() || iri;
|
|
177
183
|
}
|
|
@@ -217,8 +223,9 @@ export const m = makeNamespace("", [
|
|
|
217
223
|
"BlendedPerformanceDaily",
|
|
218
224
|
"CampaignChannelBenchmark",
|
|
219
225
|
"CampaignPerformanceSummary",
|
|
220
|
-
"CompanyKPISnapshot",
|
|
221
226
|
"ConversationStarter",
|
|
227
|
+
"KPISnapshot",
|
|
228
|
+
"ManualAction",
|
|
222
229
|
"MetaAd",
|
|
223
230
|
"MetaAdSet",
|
|
224
231
|
"MetaCampaign",
|
|
@@ -231,11 +238,13 @@ export const m = makeNamespace("", [
|
|
|
231
238
|
"changeSet",
|
|
232
239
|
"currentRoas",
|
|
233
240
|
"dailyBudget",
|
|
241
|
+
"defaultResolution",
|
|
242
|
+
"description",
|
|
234
243
|
"integration",
|
|
235
|
-
"isManualAction",
|
|
236
244
|
"pauseReason",
|
|
237
245
|
"previousDailyBudget",
|
|
238
246
|
"priority",
|
|
247
|
+
"retryable",
|
|
239
248
|
"scaleReason",
|
|
240
249
|
"status",
|
|
241
250
|
"wastedSpend",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { namespaces, sh, shaclGraphIri } from "./rdf-namespaces.js";
|
|
2
1
|
import { DataFactory } from "ldkit/rdf";
|
|
3
2
|
import { CONSTRUCT, SELECT, sparql } from "ldkit/sparql";
|
|
3
|
+
import { namespaces, sh, shaclGraphIri } from "./rdf-namespaces.js";
|
|
4
4
|
const dataFactory = new DataFactory();
|
|
5
5
|
export function buildShaclShapeQuery(shapeIri) {
|
|
6
6
|
const anyPredicateSeed = dataFactory.namedNode(namespaces[""]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manta-eu/rdf-lib",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Namespace prefixes, CURIE helpers and JSON-LD types for the Manta knowledge graph",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./action-plan-schemas": {
|
|
@@ -35,14 +35,16 @@
|
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"ldkit": "^2.
|
|
39
|
-
"@manta-eu/ldo": "0.1.
|
|
38
|
+
"ldkit": "^2.9.0",
|
|
39
|
+
"@manta-eu/ldo": "0.1.6"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
+
"eslint": "^9.39.2",
|
|
42
43
|
"rimraf": "^6.1.3",
|
|
43
44
|
"tsc-alias": "^1.9.5",
|
|
44
45
|
"typescript": "^5.9.3",
|
|
45
|
-
"vitest": "^4.1.8"
|
|
46
|
+
"vitest": "^4.1.8",
|
|
47
|
+
"@manta-eu/eslint-config": "0.1.0"
|
|
46
48
|
},
|
|
47
49
|
"files": [
|
|
48
50
|
"dist"
|
|
@@ -63,6 +65,8 @@
|
|
|
63
65
|
"scripts": {
|
|
64
66
|
"test": "vitest --run",
|
|
65
67
|
"types": "tsc --noEmit",
|
|
66
|
-
"build": "rimraf dist && tsc --project tsconfig.build.json && tsc-alias --project tsconfig.build.json --resolve-full-paths"
|
|
68
|
+
"build": "rimraf dist && tsc --project tsconfig.build.json && tsc-alias --project tsconfig.build.json --resolve-full-paths",
|
|
69
|
+
"lint": "eslint .",
|
|
70
|
+
"lint:fix": "eslint . --fix"
|
|
67
71
|
}
|
|
68
72
|
}
|