@manta-eu/ldo 0.1.0 → 0.1.1
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/README.md +35 -34
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,47 +1,48 @@
|
|
|
1
|
-
# manta-ldo
|
|
1
|
+
# @manta-eu/ldo
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
TypeScript types for the Manta knowledge graph, generated from its SHACL shapes with
|
|
4
|
+
[LDkit](https://ldkit.io/).
|
|
4
5
|
|
|
5
|
-
##
|
|
6
|
+
## Installation
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
```bash
|
|
9
|
+
pnpm add @manta-eu/ldo
|
|
10
|
+
```
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
`linguist-generated=true`). The two `.shapes/*.ttl` files above are intermediates of that run and are
|
|
13
|
-
git-ignored; `.shapes/reference/shacl-shacl.ttl` is a committed input and stays.
|
|
12
|
+
## Usage
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
realm-invariant superset; `@manta-eu/ldo/realm` (`realm.ts`) rebases the generated `.ldkit/namespaces.ts`
|
|
17
|
-
onto whichever realm the app runs as (`VITE_KEYCLOAK_REALM`), so one generation serves every realm.
|
|
14
|
+
Each export is a set of generated LDkit schemas and the namespaces they are built from:
|
|
18
15
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
root, since the generated types recompose them at runtime from `realm.ts`.
|
|
16
|
+
```typescript
|
|
17
|
+
import { namespaces } from "@manta-eu/ldo/namespaces";
|
|
18
|
+
import * as schemas from "@manta-eu/ldo/schemas";
|
|
19
|
+
```
|
|
24
20
|
|
|
25
|
-
|
|
21
|
+
The types describe the graph as a whole. `./realm` carries the vocabulary roots a deployment
|
|
22
|
+
rebases them onto:
|
|
26
23
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
`make generate-shacl-all` builds the bundle with Nix (`devenv/packages/all-shacl-by-realm.nix`) into
|
|
31
|
-
`shacl/<realm>/all-shacl.ttl`. `manta-shacl-upload` uploads it to RDFox for SHACL validation, and
|
|
32
|
-
`manta.action-handlers-codegen`'s `shacl.clj` reads the same file.
|
|
24
|
+
```typescript
|
|
25
|
+
import { realmRegistry, realmVocabRoots, defaultRealm } from "@manta-eu/ldo/realm";
|
|
26
|
+
```
|
|
33
27
|
|
|
34
|
-
|
|
28
|
+
These read injected configuration: without `VITE_REALM_REGISTRY` carrying the roster your
|
|
29
|
+
application deploys, `realmVocabRoots` is empty and `defaultRealm` is `""`. `VITE_KEYCLOAK_REALM`
|
|
30
|
+
picks which of them is active, and is optional — unset means the default.
|
|
35
31
|
|
|
36
|
-
|
|
32
|
+
## Exports
|
|
37
33
|
|
|
38
|
-
|
|
34
|
+
| Export | Contents |
|
|
35
|
+
| ------------------ | ---------------------------------------------------- |
|
|
36
|
+
| `.` | The generated schemas and namespaces together |
|
|
37
|
+
| `./schemas` | LDkit schemas for every shape |
|
|
38
|
+
| `./namespaces` | Namespace prefixes the schemas are built from |
|
|
39
|
+
| `./realm` | Vocabulary roots and the registry that resolves them |
|
|
40
|
+
| `./sparql-types` | Types for SPARQL result bindings |
|
|
41
|
+
| `./manual-schemas` | Hand-written schemas for shapes that are not derived |
|
|
39
42
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
whenever the realm shapes change.
|
|
43
|
+
`./ad-platform-links`, `./external-links`, `./figma-links` and `./redirect-queries` carry the
|
|
44
|
+
link-shaped helpers that go with them.
|
|
43
45
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
over every realm.
|
|
46
|
+
## License
|
|
47
|
+
|
|
48
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manta-eu/ldo",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Package that generates TS types from SHACL shapes using LDkit",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -83,6 +83,6 @@
|
|
|
83
83
|
"codegen": "pnpm build:shacl && pnpm build:ldkit",
|
|
84
84
|
"test": "vitest --run",
|
|
85
85
|
"types": "tsc --noEmit",
|
|
86
|
-
"build": "tsc --project tsconfig.build.json && tsc-alias --project tsconfig.build.json --resolve-full-paths"
|
|
86
|
+
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc --project tsconfig.build.json && tsc-alias --project tsconfig.build.json --resolve-full-paths"
|
|
87
87
|
}
|
|
88
88
|
}
|