@ontologie/schema 0.1.0-preview.2 → 0.1.0-preview.4
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 +12 -12
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @ontologie/schema
|
|
2
2
|
|
|
3
|
-
[](./) [](./)
|
|
4
4
|
|
|
5
|
-
> **Schema authoring DSL for
|
|
5
|
+
> **Schema authoring DSL for Ontologie** -- define your ontology in code, compile, diff, push, and pull.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
npm install @
|
|
12
|
+
npm install @ontologie/schema
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
---
|
|
@@ -19,7 +19,7 @@ npm install @dataforge/schema
|
|
|
19
19
|
Define your business model in a `dataforge.schema.ts` file:
|
|
20
20
|
|
|
21
21
|
```typescript
|
|
22
|
-
import { objectType, string, number, boolean, date, link } from '@
|
|
22
|
+
import { objectType, string, number, boolean, date, link } from '@ontologie/schema';
|
|
23
23
|
|
|
24
24
|
export const Company = objectType('Company', {
|
|
25
25
|
name: string().required(),
|
|
@@ -84,7 +84,7 @@ objectType('ApiName', { ...fields })
|
|
|
84
84
|
### Compiler
|
|
85
85
|
|
|
86
86
|
```typescript
|
|
87
|
-
import { compile } from '@
|
|
87
|
+
import { compile } from '@ontologie/schema';
|
|
88
88
|
|
|
89
89
|
const manifest = compile([Company, Employee]);
|
|
90
90
|
// -> OntologyManifest (deterministic IDs, sorted)
|
|
@@ -93,7 +93,7 @@ const manifest = compile([Company, Employee]);
|
|
|
93
93
|
### Diff
|
|
94
94
|
|
|
95
95
|
```typescript
|
|
96
|
-
import { diff, formatDiff } from '@
|
|
96
|
+
import { diff, formatDiff } from '@ontologie/schema';
|
|
97
97
|
|
|
98
98
|
const result = diff(localManifest, remoteManifest);
|
|
99
99
|
console.log(formatDiff(result));
|
|
@@ -106,7 +106,7 @@ console.log(formatDiff(result));
|
|
|
106
106
|
### Push
|
|
107
107
|
|
|
108
108
|
```typescript
|
|
109
|
-
import { planPush, executePush } from '@
|
|
109
|
+
import { planPush, executePush } from '@ontologie/schema';
|
|
110
110
|
|
|
111
111
|
const commands = planPush(diffResult, remoteManifest, { workspaceId });
|
|
112
112
|
await executePush({ transport, commands, onProgress: console.log });
|
|
@@ -115,7 +115,7 @@ await executePush({ transport, commands, onProgress: console.log });
|
|
|
115
115
|
### Pull
|
|
116
116
|
|
|
117
117
|
```typescript
|
|
118
|
-
import { emitSchema } from '@
|
|
118
|
+
import { emitSchema } from '@ontologie/schema';
|
|
119
119
|
|
|
120
120
|
const source = emitSchema(remoteManifest);
|
|
121
121
|
// -> valid TypeScript source using the DSL
|
|
@@ -124,7 +124,7 @@ const source = emitSchema(remoteManifest);
|
|
|
124
124
|
### Lockfile
|
|
125
125
|
|
|
126
126
|
```typescript
|
|
127
|
-
import { generateLockfile, verifyLockfile } from '@
|
|
127
|
+
import { generateLockfile, verifyLockfile } from '@ontologie/schema';
|
|
128
128
|
|
|
129
129
|
const lock = generateLockfile(manifest);
|
|
130
130
|
const { drifted } = verifyLockfile(lock, currentManifest);
|
|
@@ -136,9 +136,9 @@ const { drifted } = verifyLockfile(lock, currentManifest);
|
|
|
136
136
|
|
|
137
137
|
| Package | Role |
|
|
138
138
|
|---------|------|
|
|
139
|
-
| `@
|
|
139
|
+
| `@ontologie/sdk-types` | `OntologyManifest`, `PropertyDescriptor`, etc. |
|
|
140
140
|
|
|
141
|
-
No dependency on `@
|
|
141
|
+
No dependency on `@ontologie/sdk-client` -- the schema package is standalone. Only the CLI depends on both.
|
|
142
142
|
|
|
143
143
|
---
|
|
144
144
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ontologie/schema",
|
|
3
|
-
"version": "0.1.0-preview.
|
|
3
|
+
"version": "0.1.0-preview.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Schema authoring DSL for DataForge — define, compile, diff, push, and pull ontology schemas",
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"test": "vitest run"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@ontologie/sdk-types": "0.1.0-preview.
|
|
39
|
+
"@ontologie/sdk-types": "^0.1.0-preview.3",
|
|
40
|
+
"@dataforge/sdk-types": "npm:@ontologie/sdk-types@^0.1.0-preview.3"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
42
43
|
"typescript": "^5.4.0",
|