https://github.com/michaelhirn/rlay-ontology-datum
https://github.com/michaelhirn/rlay-ontology-datum
rlay rlay-ontology
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/michaelhirn/rlay-ontology-datum
- Owner: MichaelHirn
- Created: 2019-09-16T13:54:51.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T00:40:14.000Z (over 2 years ago)
- Last Synced: 2025-02-12T12:16:08.173Z (3 months ago)
- Topics: rlay, rlay-ontology
- Language: JavaScript
- Size: 424 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rlay Ontology: Datum
This module exposes high-level interface over [@rlay/transform](https://github.com/rlay-project/rlay-transform) for easier transformation and integration of non-rlay objects (e.g. JSON, XML, CSV, etc.).
## Architecture
This library uses a stacked approach of `Datum` -> `DatumAggregate`. Every non-rlay object can be turned into a `Datum` and every `Datum` can be turned into a `DatumAggregate`.
### `Datum`
The `Datum` uses `@rlay/transform` under the hood and guarantees that any generated schema is provided back to the client. If a schemaRegistry instance is provided, it will also write the auto-generated schema to the registry when a new `Datum` is created. With `.field`, `.fieldProperty`, and `.fieldAssert` it also provides an easy way to access the generated assertions. Under the hood it uses the `datumPrefixDatumProperty` for this.
### `DatumAggregate`
Many non-rlay objects cary an internal identifier, whenever that is the case it makes sense to transform the `Datum` into a `DatumAggregate`. This allows that data changes on the non-rlay object can be captured and rolled up into a 'static' representation, the `DatumAggregate`. With `.field`, `.fieldProperty`, and `.fieldAssert` it also provides an easy way to access the generated assertions. Under the hood it uses the `datumPrefixDatumProperty` for this.
## Usage
This package exposes only mixins and it is recommended to implement the mixins in your application for each non-rlay object type.
### Example
Datum*Mixin -> (CustomDatum*Mixin) -> CustomDatum* -> (CustomDatum*Factory)