@shaclmate/compiler 4.0.100 → 4.0.101
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/generators/ts/Imports.d.ts +1 -0
- package/dist/generators/ts/Imports.js +1 -0
- package/dist/generators/ts/Snippets.d.ts +0 -1
- package/dist/generators/ts/Snippets.js +0 -7
- package/dist/generators/ts/_snippets/snippets_convertToIdentifier.js +1 -1
- package/dist/generators/ts/_snippets/snippets_convertToIdentifierProperty.js +1 -1
- package/dist/generators/ts/_snippets/snippets_convertToIri.js +1 -1
- package/dist/generators/ts/_snippets/snippets_convertToIriIdentifierProperty.js +1 -1
- package/dist/generators/ts/_snippets/snippets_iriFromJsonString.js +1 -1
- package/dist/input/ShapesGraph.js +2 -2
- package/dist/input/input.shaclmate.d.ts +642 -616
- package/dist/input/input.shaclmate.js +155 -147
- package/package.json +10 -12
- package/dist/generators/ts/_snippets/snippets_iriFromString.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_iriFromString.js +0 -76
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
|
-
"@shaclmate/shacl-ast": "4.0.
|
|
3
|
+
"@shaclmate/shacl-ast": "4.0.101",
|
|
4
4
|
"@rdfjs/types": "~2.0.1",
|
|
5
|
-
"@rdfx/collection": "0.0.
|
|
6
|
-
"@rdfx/curie": "0.0.
|
|
7
|
-
"@rdfx/data-factory": "0.0.
|
|
8
|
-
"@rdfx/literal": "0.0.
|
|
9
|
-
"@rdfx/logger": "0.0.
|
|
10
|
-
"@rdfx/resource": "0.0.
|
|
11
|
-
"@rdfx/string": "0.0.
|
|
5
|
+
"@rdfx/collection": "0.0.62",
|
|
6
|
+
"@rdfx/curie": "0.0.62",
|
|
7
|
+
"@rdfx/data-factory": "0.0.62",
|
|
8
|
+
"@rdfx/literal": "0.0.62",
|
|
9
|
+
"@rdfx/logger": "0.0.62",
|
|
10
|
+
"@rdfx/resource": "0.0.62",
|
|
11
|
+
"@rdfx/string": "0.0.62",
|
|
12
12
|
"@sindresorhus/base62": "~0.1.0",
|
|
13
13
|
"@tpluscode/rdf-ns-builders": "~4.3.0",
|
|
14
14
|
"change-case": "~5.4.4",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"uri-template": "~2.0.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@rdfx/fs": "0.0.
|
|
25
|
+
"@rdfx/fs": "0.0.62",
|
|
26
26
|
"typescript": "6.0.3"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
@@ -790,8 +790,6 @@
|
|
|
790
790
|
"dist/generators/ts/_snippets/snippets_iriFromJsonString.js",
|
|
791
791
|
"dist/generators/ts/_snippets/snippets_iriFromRdfResourceValues.d.ts",
|
|
792
792
|
"dist/generators/ts/_snippets/snippets_iriFromRdfResourceValues.js",
|
|
793
|
-
"dist/generators/ts/_snippets/snippets_iriFromString.d.ts",
|
|
794
|
-
"dist/generators/ts/_snippets/snippets_iriFromString.js",
|
|
795
793
|
"dist/generators/ts/_snippets/snippets_iriLiteralFromJsonObject.d.ts",
|
|
796
794
|
"dist/generators/ts/_snippets/snippets_iriLiteralFromJsonObject.js",
|
|
797
795
|
"dist/generators/ts/_snippets/snippets_iriLiteralFromJsonString.d.ts",
|
|
@@ -978,5 +976,5 @@
|
|
|
978
976
|
},
|
|
979
977
|
"type": "module",
|
|
980
978
|
"types": "./dist/index.d.ts",
|
|
981
|
-
"version": "4.0.
|
|
979
|
+
"version": "4.0.101"
|
|
982
980
|
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { code, conditionalOutput, joinCode, literalOf, } from "../ts-poet-wrapper.js";
|
|
2
|
-
export const snippets_iriFromString = ({ imports, snippets, syntheticNamePrefix, }) => {
|
|
3
|
-
const leadingDoubleSlashSchemes = [
|
|
4
|
-
"file",
|
|
5
|
-
"ftp",
|
|
6
|
-
"http",
|
|
7
|
-
"https",
|
|
8
|
-
"git",
|
|
9
|
-
"irc",
|
|
10
|
-
"ldap",
|
|
11
|
-
"postgres",
|
|
12
|
-
"rtsp",
|
|
13
|
-
"sftp",
|
|
14
|
-
"smb",
|
|
15
|
-
"ssh",
|
|
16
|
-
"ws",
|
|
17
|
-
"wss",
|
|
18
|
-
];
|
|
19
|
-
return conditionalOutput(`${syntheticNamePrefix}iriFromString`, code `\
|
|
20
|
-
export function ${syntheticNamePrefix}iriFromString(
|
|
21
|
-
string: string,
|
|
22
|
-
options?: {
|
|
23
|
-
defaultNamespace?: ${snippets.NamespaceBuilder};
|
|
24
|
-
prefixMap?: ${imports.PrefixMap};
|
|
25
|
-
}
|
|
26
|
-
): ${imports.Either}<Error, ${imports.NamedNode}> {
|
|
27
|
-
if (string.trim().length === 0) {
|
|
28
|
-
return ${imports.Left}(new Error("empty/blank IRI"));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const defaultNamespace = options?.defaultNamespace;
|
|
32
|
-
|
|
33
|
-
const colonIndex = string.indexOf(":");
|
|
34
|
-
if (colonIndex === -1) {
|
|
35
|
-
// No : in the string.
|
|
36
|
-
if (defaultNamespace) {
|
|
37
|
-
return ${imports.Right}(defaultNamespace(string));
|
|
38
|
-
} else {
|
|
39
|
-
return ${imports.Left}(new Error(\`ill-formed IRI: \${string}\`));
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const prefix = string.substring(0, colonIndex);
|
|
44
|
-
const path = string.substring(colonIndex + 1);
|
|
45
|
-
if (path.length === 0) {
|
|
46
|
-
return ${imports.Left}(new Error(\`ill-formed IRI: \${string}\`));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Absolute IRIs with scheme:// always win over prefixes with the same name.
|
|
50
|
-
switch (prefix.toLowerCase()) {
|
|
51
|
-
${joinCode(leadingDoubleSlashSchemes.map((scheme) => code ` case ${literalOf(scheme)}:`, { on: "\n" }))}
|
|
52
|
-
if (path.startsWith("//")) {
|
|
53
|
-
return ${imports.Right}(${imports.dataFactory}.namedNode(string));
|
|
54
|
-
}
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const prefixMap = options?.prefixMap;
|
|
59
|
-
if (prefixMap) {
|
|
60
|
-
const prefixNamespace = prefixMap.get(prefix);
|
|
61
|
-
if (prefixNamespace !== undefined) {
|
|
62
|
-
return ${imports.Right}(
|
|
63
|
-
${imports.dataFactory}.namedNode(\`\${prefixNamespace.value}\${path}\`),
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (prefix.length === 0 && defaultNamespace) {
|
|
69
|
-
// a "" prefixMap entry takes precedence, above.
|
|
70
|
-
return ${imports.Right}(defaultNamespace(path));
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return ${imports.Right}(${imports.dataFactory}.namedNode(string));
|
|
74
|
-
}`);
|
|
75
|
-
};
|
|
76
|
-
//# sourceMappingURL=snippets_iriFromString.js.map
|