alizarin 1.0.0 → 2.0.0-alpha.87
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 +120 -2
- package/dist/_wasm.d.ts +23 -0
- package/dist/alizarin.full.js +799 -0
- package/dist/alizarin.full.js.map +1 -0
- package/dist/alizarin.inline-full.js +4 -0
- package/dist/alizarin.inline.js +4 -0
- package/dist/alizarin.js +45 -4970
- package/dist/alizarin.js.map +1 -1
- package/dist/alizarin_bg.wasm +0 -0
- package/dist/backend.d.ts +74 -0
- package/dist/cards.d.ts +21 -0
- package/dist/client.d.ts +86 -0
- package/dist/collectionMutator.d.ts +155 -0
- package/dist/csvModelLoader.d.ts +59 -0
- package/dist/full.d.ts +3 -0
- package/dist/graphManager.d.ts +259 -0
- package/dist/interfaces.d.ts +145 -0
- package/dist/main-DqLDaUYo.js +12457 -0
- package/dist/main-DqLDaUYo.js.map +1 -0
- package/dist/main.d.ts +28 -0
- package/dist/nodeConfig.d.ts +61 -0
- package/dist/pseudos.d.ts +118 -0
- package/dist/rdm.d.ts +68 -0
- package/dist/renderers.d.ts +67 -0
- package/dist/semantic.d.ts +35 -0
- package/dist/static-types.d.ts +172 -0
- package/dist/staticStore.d.ts +60 -0
- package/dist/tracing/index.d.ts +172 -0
- package/dist/utils.d.ts +43 -0
- package/dist/validation/index.d.ts +734 -0
- package/dist/validation/index.js +1194 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/validators/graphLoading.d.ts +69 -0
- package/dist/validation/validators/index.d.ts +1 -0
- package/dist/viewModels/BooleanViewModel.d.ts +17 -0
- package/dist/viewModels/ConceptListViewModel.d.ts +15 -0
- package/dist/viewModels/ConceptValueViewModel.d.ts +28 -0
- package/dist/viewModels/DateViewModel.d.ts +16 -0
- package/dist/viewModels/DomainValueListViewModel.d.ts +15 -0
- package/dist/viewModels/DomainValueViewModel.d.ts +17 -0
- package/dist/viewModels/EDTFViewModel.d.ts +13 -0
- package/dist/viewModels/GeoJSONViewModel.d.ts +26 -0
- package/dist/viewModels/NodeViewModel.d.ts +15 -0
- package/dist/viewModels/NonLocalizedStringViewModel.d.ts +13 -0
- package/dist/viewModels/NumberViewModel.d.ts +14 -0
- package/dist/viewModels/ResourceInstanceListViewModel.d.ts +25 -0
- package/dist/viewModels/ResourceInstanceViewModel.d.ts +62 -0
- package/dist/viewModels/StringViewModel.d.ts +17 -0
- package/dist/viewModels/UrlViewModel.d.ts +22 -0
- package/dist/viewModels/cacheEntries.d.ts +73 -0
- package/dist/viewModels/getViewModel.d.ts +4 -0
- package/dist/viewModels/index.d.ts +20 -0
- package/dist/viewModels/types.d.ts +15 -0
- package/dist/viewModels.d.ts +1 -0
- package/dist/wasmTiming.d.ts +11 -0
- package/package.json +61 -8
- package/dist/__vite-browser-external-2Ng8QIWW.js +0 -5
- package/dist/__vite-browser-external-2Ng8QIWW.js.map +0 -1
- package/dist/alizarin.d.ts +0 -1298
- package/dist/alizarin.umd.cjs +0 -4981
- package/dist/alizarin.umd.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -2,8 +2,126 @@
|
|
|
2
2
|
|
|
3
3
|
# Alizarin
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
A high-performance TypeScript/JavaScript SDK for working with [Arches](https://www.archesproject.org/) data management systems. Alizarin provides a sophisticated object-relational mapping (ORM) layer that enables seamless interaction with Arches' graph-based data models.
|
|
6
|
+
|
|
7
|
+
This is a pure JS/TS implementation of [AORM](https://github.com/flaxandteal/arches-orm/) for front or backend.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **Universal Compatibility**: Works in both browser and Node.js environments
|
|
12
|
+
- **Type-Safe**: Full TypeScript support with comprehensive type definitions
|
|
13
|
+
- **Lazy Loading**: Optimized data fetching with on-demand tile loading
|
|
14
|
+
- **Graph-Based ORM**: Intuitive API for working with Arches' complex graph structures
|
|
15
|
+
- **Multiple Data Sources**: Support for remote servers, static JSON files, and local data
|
|
16
|
+
- **Internationalization**: Built-in support for multilingual content
|
|
17
|
+
- **Schema Manipulation**: Programmatically create and modify graph schemas
|
|
18
|
+
- **Caching**: Intelligent caching for improved performance
|
|
19
|
+
|
|
20
|
+
## Goals
|
|
21
|
+
|
|
22
|
+
Alizarin aims to:
|
|
23
|
+
|
|
24
|
+
1. **Simplify Arches Development**: Provide an intuitive, developer-friendly interface to Arches' complex data models
|
|
25
|
+
2. **Enable Modern Web Applications**: Support building reactive, performant front-end applications with Arches data
|
|
26
|
+
3. **Maintain Flexibility**: Work with any Arches instance without requiring server-side modifications
|
|
27
|
+
4. **Ensure Type Safety**: Leverage TypeScript to catch errors early and improve developer experience
|
|
28
|
+
5. **Optimize Performance**: Minimize network requests and memory usage through intelligent caching and lazy loading
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm install alizarin
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Quick Start
|
|
37
|
+
|
|
38
|
+
### Basic Usage
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { ArchesClientRemote, GraphManager } from 'alizarin';
|
|
42
|
+
|
|
43
|
+
// Connect to an Arches instance
|
|
44
|
+
const client = new ArchesClientRemote('https://your-arches-instance.org');
|
|
45
|
+
const graphManager = new GraphManager(client);
|
|
46
|
+
|
|
47
|
+
// Load a resource model
|
|
48
|
+
const MonumentModel = await graphManager.loadGraph('Monument');
|
|
49
|
+
|
|
50
|
+
// Query all monuments
|
|
51
|
+
const monuments = await MonumentModel.all();
|
|
52
|
+
|
|
53
|
+
// Access monument data
|
|
54
|
+
for (const monument of monuments) {
|
|
55
|
+
console.log(monument.name);
|
|
56
|
+
console.log(monument.constructionDate);
|
|
57
|
+
console.log(monument.heritage_status?.prefLabel);
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Working with Static Data
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
import { ArchesClientRemoteStatic, GraphManager } from 'alizarin';
|
|
65
|
+
|
|
66
|
+
// Load from static JSON exports
|
|
67
|
+
const client = new ArchesClientRemoteStatic('/data/exports');
|
|
68
|
+
const graphManager = new GraphManager(client);
|
|
69
|
+
|
|
70
|
+
// Usage is identical to remote client
|
|
71
|
+
const PersonModel = await graphManager.loadGraph('Person');
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Creating Resources
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
const PersonModel = await graphManager.loadGraph('Person');
|
|
78
|
+
|
|
79
|
+
// Create a new person
|
|
80
|
+
const newPerson = PersonModel.create();
|
|
81
|
+
newPerson.forename = "Jane";
|
|
82
|
+
newPerson.surname = "Smith";
|
|
83
|
+
newPerson.birthDate = new Date(1990, 5, 15);
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## API Reference
|
|
87
|
+
|
|
88
|
+
### Client Classes
|
|
89
|
+
|
|
90
|
+
- `ArchesClient` - Abstract base class for all clients
|
|
91
|
+
- `ArchesClientRemote` - Connect to live Arches servers
|
|
92
|
+
- `ArchesClientRemoteStatic` - Load from static JSON files
|
|
93
|
+
- `ArchesClientLocal` - Load from local filesystem (Node.js)
|
|
94
|
+
|
|
95
|
+
### Core Classes
|
|
96
|
+
|
|
97
|
+
- `GraphManager` - Central manager for graphs and resources
|
|
98
|
+
- `ResourceModelWrapper` - ORM wrapper for resource models
|
|
99
|
+
- `ResourceInstanceViewModel` - View model for resource instances
|
|
100
|
+
- `GraphMutator` - Tool for modifying graph schemas
|
|
101
|
+
|
|
102
|
+
### View Model Types
|
|
103
|
+
|
|
104
|
+
- `StringViewModel` - String values
|
|
105
|
+
- `NumberViewModel` - Numeric values
|
|
106
|
+
- `DateViewModel` - Date/time values
|
|
107
|
+
- `ConceptValueViewModel` - Controlled vocabulary concepts
|
|
108
|
+
- `GeojsonFeatureCollectionViewModel` - Geographic data
|
|
109
|
+
- `ResourceInstanceListViewModel` - Related resources
|
|
110
|
+
- `SemanticViewModel` - Complex nested structures
|
|
111
|
+
|
|
112
|
+
## Development
|
|
113
|
+
|
|
114
|
+
### Running Tests
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
npm test
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Linting
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
npm run lint
|
|
124
|
+
```
|
|
7
125
|
|
|
8
126
|
### CI
|
|
9
127
|
|
package/dist/_wasm.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { StaticNode as WasmStaticNode, StaticGraphMeta as WasmStaticGraphMeta, WasmRdmCache, parseSkosXml, parseSkosXmlToCollection, collectionToSkosXml, collectionsToSkosXml, registerExtensionHandler } from "../pkg/alizarin";
|
|
2
|
+
export declare function setWasmURL(url: string): void;
|
|
3
|
+
/**
|
|
4
|
+
* Get the global WASM RDM cache singleton.
|
|
5
|
+
* Creates the cache on first access (after WASM initialization).
|
|
6
|
+
* @throws Error if WASM is not yet initialized
|
|
7
|
+
*/
|
|
8
|
+
export declare function getGlobalWasmRdmCache(): WasmRdmCache;
|
|
9
|
+
/**
|
|
10
|
+
* Check if the global WASM RDM cache is available.
|
|
11
|
+
*/
|
|
12
|
+
export declare function hasGlobalWasmRdmCache(): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Ensure the WASM RDM cache is initialized and ready.
|
|
15
|
+
* This can be awaited early in the application lifecycle to ensure
|
|
16
|
+
* the cache is available before any hierarchy methods are called.
|
|
17
|
+
* @returns The initialized WasmRdmCache
|
|
18
|
+
*/
|
|
19
|
+
export declare function ensureWasmRdmCache(): Promise<WasmRdmCache>;
|
|
20
|
+
export declare function initWasm(): Promise<void>;
|
|
21
|
+
export { WasmStaticNode, WasmStaticGraphMeta, WasmRdmCache };
|
|
22
|
+
export { parseSkosXml, parseSkosXmlToCollection, collectionToSkosXml, collectionsToSkosXml };
|
|
23
|
+
export { registerExtensionHandler };
|