From a6e01eb390f63879e5eacd6d9b69d50d1a81f85a Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Fri, 30 Jan 2026 09:50:06 +0100 Subject: [PATCH 1/4] readme cleanup --- readme.md | 19 ++++++++++--------- rust/README.md | 9 ++++----- typescript/readme.md | 16 +++++++--------- 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/readme.md b/readme.md index b195f27..619d380 100644 --- a/readme.md +++ b/readme.md @@ -6,7 +6,7 @@ GRC-20 is designed for encoding, decoding, and synchronizing graph data across d ## Features -- **Property Graph Model** — Entities, relations, and typed properties with 12 data types +- **Property Graph Model** — Entities, relations, and typed properties with 13 data types - **Event Sourced** — All state changes expressed as append-only operations - **Binary Optimized** — Dictionary interning and zstd compression for minimal wire size - **Deterministic** — Canonical encoding for content addressing and signatures @@ -56,8 +56,8 @@ import { EditBuilder, encodeEdit, decodeEdit, properties } from '@geoprotocol/gr // Create an edit const edit = new EditBuilder(editId) - .name('My Edit') - .author(authorId) + .setName('My Edit') + .addAuthor(authorId) .createEntity(entityId, (e) => e.text(properties.name(), 'Hello')) .build(); @@ -78,11 +78,12 @@ const decoded = decodeEdit(bytes); | `DECIMAL` | Arbitrary-precision decimal (with optional unit) | | `TEXT` | UTF-8 string (with optional language) | | `BYTES` | Opaque byte array | -| `DATE` | ISO 8601 date (year, month, or day precision) | -| `TIME` | ISO 8601 time (HH:MM:SS with optional timezone) | -| `DATETIME` | ISO 8601 date-time with timezone | -| `SCHEDULE` | Recurring schedule (cron-like) | +| `DATE` | Calendar date with timezone | +| `TIME` | Time of day with timezone | +| `DATETIME` | Timestamp with timezone | +| `SCHEDULE` | RFC 5545/7953 iCalendar schedule | | `POINT` | WGS84 coordinates (lat, lon) | +| `RECT` | Axis-aligned bounding box | | `EMBEDDING` | Dense vectors for semantic search | ## Operations @@ -107,7 +108,7 @@ Value references allow creating referenceable values that can be used as relatio ```typescript // Create a value ref that can be targeted by relations -.createValueRef(valueRefId, entityId, propId, value) +.addOp({ type: 'createValueRef', id: valueRefId, entity: entityId, property: propId }) ``` ### Multi-Language Support @@ -120,7 +121,7 @@ e.text(nameProp, "Hello", languages.english()) e.text(nameProp, "Hola", languages.spanish()) // Unset specific language variant -u.unsetText(nameProp, languages.english()) +u.unsetLanguage(nameProp, languages.english()) ``` ### Relation Features diff --git a/rust/README.md b/rust/README.md index e0aa115..c8bdc99 100644 --- a/rust/README.md +++ b/rust/README.md @@ -62,7 +62,7 @@ assert_eq!(edit.id, decoded.id); ### Data Types -All 12 GRC-20 data types are supported: +All 13 GRC-20 data types are supported: | Type | Rust Representation | Wire Size | |------|---------------------|-----------| @@ -76,7 +76,8 @@ All 12 GRC-20 data types are supported: | TIME | `Value::Time(Cow)` | 8 bytes | | DATETIME | `Value::Datetime(Cow)` | 10 bytes | | SCHEDULE | `Value::Schedule(String)` | variable | -| POINT | `Value::Point { lon, lat, alt }` | 17-25 bytes | +| POINT | `Value::Point { lat, lon, alt }` | 17-25 bytes | +| RECT | `Value::Rect { min_lat, min_lon, max_lat, max_lon }` | 32 bytes | | EMBEDDING | `Value::Embedding { sub_type, dims, data }` | variable | **Temporal types use RFC 3339 strings in the API:** @@ -184,7 +185,6 @@ let edit = decode_edit_borrowed(&bytes)?; // Strings borrow from input buffer - no allocation assert!(matches!(edit.name, Cow::Borrowed(_))); ``` -- `CreateValueRef` — Create a referenceable ID for a value slot ### Compression @@ -212,8 +212,7 @@ let name_prop = properties::name(); let description_prop = properties::description(); // Core types -let person_type = types::person(); -let organization_type = types::organization(); +let image_type = types::image(); // Core relation types let types_rel = relation_types::types(); diff --git a/typescript/readme.md b/typescript/readme.md index 430e229..947cbfd 100644 --- a/typescript/readme.md +++ b/typescript/readme.md @@ -126,8 +126,8 @@ const edit = new EditBuilder(editId) .updateEntity(entityId, u => u .setText(propId, "new value", undefined) .setInt64(propId, 100n, undefined) - .unsetText(propId, languageId) // Unset specific language - .unsetAll(propId) // Unset all values for property + .unsetLanguage(propId, languageId) // Unset specific language + .unsetAll(propId) // Unset all values for property ) .deleteEntity(entityId) .restoreEntity(entityId) @@ -139,10 +139,7 @@ const edit = new EditBuilder(editId) ) .deleteRelation(relationId) .restoreRelation(relationId) - .createValueRef(valueRefId, entityId, propId, { - type: "text", - value: "Referenceable value" - }) + .addOp({ type: 'createValueRef', id: valueRefId, entity: entityId, property: propId }) .build(); ``` @@ -301,9 +298,10 @@ if (!posResult.valid) { | `DATE` | `{ type: "date", value: string }` (RFC 3339, e.g. `"2024-01-15Z"`) | | `TIME` | `{ type: "time", value: string }` (RFC 3339, e.g. `"14:30:00Z"`) | | `DATETIME` | `{ type: "datetime", value: string }` (RFC 3339, e.g. `"2024-01-15T14:30:00Z"`) | -| `SCHEDULE` | `{ type: "schedule", value: string }` (cron-like) | -| `POINT` | `{ type: "point", lat: number, lon: number }` | -| `EMBEDDING` | `{ type: "embedding", subType: EmbeddingSubType.Float32 \| EmbeddingSubType.Int8 \| EmbeddingSubType.Binary, data: number[] }` | +| `SCHEDULE` | `{ type: "schedule", value: string }` (RFC 5545/7953 iCalendar) | +| `POINT` | `{ type: "point", lat: number, lon: number, alt?: number }` | +| `RECT` | `{ type: "rect", minLat: number, minLon: number, maxLat: number, maxLon: number }` | +| `EMBEDDING` | `{ type: "embedding", subType: EmbeddingSubType, dims: number, data: Uint8Array }` | ### Genesis IDs From c8d18e9949d4850ef5ab79b7e85d88eb40c602c3 Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Fri, 30 Jan 2026 18:00:48 +0100 Subject: [PATCH 2/4] Update rust/README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- rust/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/README.md b/rust/README.md index c8bdc99..e13d4d6 100644 --- a/rust/README.md +++ b/rust/README.md @@ -212,7 +212,7 @@ let name_prop = properties::name(); let description_prop = properties::description(); // Core types -let image_type = types::image(); +let person_type = types::person(); // Core relation types let types_rel = relation_types::types(); From c762d64aaaa5348ffbef5c4f7015ef8c9833f97f Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Fri, 30 Jan 2026 18:01:05 +0100 Subject: [PATCH 3/4] Update rust/README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- rust/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/README.md b/rust/README.md index e13d4d6..f9ac47e 100644 --- a/rust/README.md +++ b/rust/README.md @@ -75,7 +75,7 @@ All 13 GRC-20 data types are supported: | DATE | `Value::Date(Cow)` | 6 bytes | | TIME | `Value::Time(Cow)` | 8 bytes | | DATETIME | `Value::Datetime(Cow)` | 10 bytes | -| SCHEDULE | `Value::Schedule(String)` | variable | +| SCHEDULE | `Value::Schedule(Cow)` | variable | | POINT | `Value::Point { lat, lon, alt }` | 17-25 bytes | | RECT | `Value::Rect { min_lat, min_lon, max_lat, max_lon }` | 32 bytes | | EMBEDDING | `Value::Embedding { sub_type, dims, data }` | variable | From b98d113905fad763df961ea8b8e542a9e89d9a6a Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Fri, 30 Jan 2026 18:01:36 +0100 Subject: [PATCH 4/4] Update readme.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 619d380..85c6838 100644 --- a/readme.md +++ b/readme.md @@ -82,7 +82,7 @@ const decoded = decodeEdit(bytes); | `TIME` | Time of day with timezone | | `DATETIME` | Timestamp with timezone | | `SCHEDULE` | RFC 5545/7953 iCalendar schedule | -| `POINT` | WGS84 coordinates (lat, lon) | +| `POINT` | WGS84 coordinates (lat, lon, optional alt) | | `RECT` | Axis-aligned bounding box | | `EMBEDDING` | Dense vectors for semantic search |