From f2690b8a168eef6fcd7ce9aedd377c509b3080fb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 12:29:48 +0000 Subject: [PATCH] chore: version package for release --- .changeset/gold-rats-shout.md | 5 --- .changeset/sparql-conversion-layer.md | 45 -------------------- CHANGELOG.md | 60 +++++++++++++++++++++++++++ package.json | 2 +- 4 files changed, 61 insertions(+), 51 deletions(-) delete mode 100644 .changeset/gold-rats-shout.md delete mode 100644 .changeset/sparql-conversion-layer.md diff --git a/.changeset/gold-rats-shout.md b/.changeset/gold-rats-shout.md deleted file mode 100644 index bed8dbe..0000000 --- a/.changeset/gold-rats-shout.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@_linked/core": minor ---- - -Replaced internal query representation with a canonical backend-agnostic IR AST. `SelectQuery`, `CreateQuery`, `UpdateQuery`, and `DeleteQuery` are now typed IR objects with `kind` discriminators, compact shape/property ID references, and expression trees — replacing the previous ad-hoc nested arrays. The public Shape DSL is unchanged; what changed is what `IQuadStore` implementations receive. Store result types (`ResultRow`, `SelectResult`, `CreateResult`, `UpdateResult`) are now exported. All factories expose `build()` as the primary method. See `documentation/intermediate-representation.md` for the full IR reference and migration guidance. diff --git a/.changeset/sparql-conversion-layer.md b/.changeset/sparql-conversion-layer.md deleted file mode 100644 index fb11999..0000000 --- a/.changeset/sparql-conversion-layer.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -"@_linked/core": minor ---- - -Add SPARQL conversion layer — compiles Linked IR queries into executable SPARQL and maps results back to typed DSL objects. - -**New exports from `@_linked/core/sparql`:** - -- **`SparqlStore`** — abstract base class for SPARQL-backed stores. Extend it and implement two methods to connect any SPARQL 1.1 endpoint: - ```ts - import {SparqlStore} from '@_linked/core/sparql'; - - class MyStore extends SparqlStore { - protected async executeSparqlSelect(sparql: string): Promise { /* ... */ } - protected async executeSparqlUpdate(sparql: string): Promise { /* ... */ } - } - ``` - -- **IR → SPARQL string** convenience functions (full pipeline in one call): - - `selectToSparql(query, options?)` — SelectQuery → SPARQL string - - `createToSparql(query, options?)` — CreateQuery → SPARQL string - - `updateToSparql(query, options?)` — UpdateQuery → SPARQL string - - `deleteToSparql(query, options?)` — DeleteQuery → SPARQL string - -- **IR → SPARQL algebra** (for stores that want to inspect/optimize the algebra before serialization): - - `selectToAlgebra(query, options?)` — returns `SparqlSelectPlan` - - `createToAlgebra(query, options?)` — returns `SparqlInsertDataPlan` - - `updateToAlgebra(query, options?)` — returns `SparqlDeleteInsertPlan` - - `deleteToAlgebra(query, options?)` — returns `SparqlDeleteInsertPlan` - -- **Algebra → SPARQL string** serialization: - - `selectPlanToSparql(plan, options?)`, `insertDataPlanToSparql(plan, options?)`, `deleteInsertPlanToSparql(plan, options?)`, `deleteWherePlanToSparql(plan, options?)` - - `serializeAlgebraNode(node)`, `serializeExpression(expr)`, `serializeTerm(term)` - -- **Result mapping** (SPARQL JSON results → typed DSL objects): - - `mapSparqlSelectResult(json, query)` — handles flat/nested/aggregated results with XSD type coercion - - `mapSparqlCreateResult(uri, query)` — echoes created fields with generated URI - - `mapSparqlUpdateResult(query)` — echoes updated fields - -- **All algebra types** re-exported: `SparqlTerm`, `SparqlTriple`, `SparqlAlgebraNode`, `SparqlExpression`, `SparqlSelectPlan`, `SparqlInsertDataPlan`, `SparqlDeleteInsertPlan`, `SparqlDeleteWherePlan`, `SparqlPlan`, `SparqlOptions`, etc. - -**Bug fixes included:** -- Fixed `isNodeReference()` in MutationQuery.ts — nested creates with predefined IDs (e.g., `{id: '...', name: 'Bestie'}`) now correctly insert entity data instead of only creating the link. - -See [SPARQL Algebra Layer docs](./documentation/sparql-algebra.md) for the full type reference, conversion rules, and store implementation guide. diff --git a/CHANGELOG.md b/CHANGELOG.md index c983ed3..e3a0470 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,65 @@ # Changelog +## 1.2.0 + +### Minor Changes + +- [#9](https://github.com/Semantu/linked/pull/9) [`381067b`](https://github.com/Semantu/linked/commit/381067b0fbc25f4a0446c5f8cc0eec57ddded466) Thanks [@flyon](https://github.com/flyon)! - Replaced internal query representation with a canonical backend-agnostic IR AST. `SelectQuery`, `CreateQuery`, `UpdateQuery`, and `DeleteQuery` are now typed IR objects with `kind` discriminators, compact shape/property ID references, and expression trees — replacing the previous ad-hoc nested arrays. The public Shape DSL is unchanged; what changed is what `IQuadStore` implementations receive. Store result types (`ResultRow`, `SelectResult`, `CreateResult`, `UpdateResult`) are now exported. All factories expose `build()` as the primary method. See `documentation/intermediate-representation.md` for the full IR reference and migration guidance. + +- [#14](https://github.com/Semantu/linked/pull/14) [`b65e156`](https://github.com/Semantu/linked/commit/b65e15688ac173478e58e1dbb9f26dbaf5fc5a37) Thanks [@flyon](https://github.com/flyon)! - Add SPARQL conversion layer — compiles Linked IR queries into executable SPARQL and maps results back to typed DSL objects. + + **New exports from `@_linked/core/sparql`:** + + - **`SparqlStore`** — abstract base class for SPARQL-backed stores. Extend it and implement two methods to connect any SPARQL 1.1 endpoint: + + ```ts + import { SparqlStore } from "@_linked/core/sparql"; + + class MyStore extends SparqlStore { + protected async executeSparqlSelect( + sparql: string + ): Promise { + /* ... */ + } + protected async executeSparqlUpdate(sparql: string): Promise { + /* ... */ + } + } + ``` + + - **IR → SPARQL string** convenience functions (full pipeline in one call): + + - `selectToSparql(query, options?)` — SelectQuery → SPARQL string + - `createToSparql(query, options?)` — CreateQuery → SPARQL string + - `updateToSparql(query, options?)` — UpdateQuery → SPARQL string + - `deleteToSparql(query, options?)` — DeleteQuery → SPARQL string + + - **IR → SPARQL algebra** (for stores that want to inspect/optimize the algebra before serialization): + + - `selectToAlgebra(query, options?)` — returns `SparqlSelectPlan` + - `createToAlgebra(query, options?)` — returns `SparqlInsertDataPlan` + - `updateToAlgebra(query, options?)` — returns `SparqlDeleteInsertPlan` + - `deleteToAlgebra(query, options?)` — returns `SparqlDeleteInsertPlan` + + - **Algebra → SPARQL string** serialization: + + - `selectPlanToSparql(plan, options?)`, `insertDataPlanToSparql(plan, options?)`, `deleteInsertPlanToSparql(plan, options?)`, `deleteWherePlanToSparql(plan, options?)` + - `serializeAlgebraNode(node)`, `serializeExpression(expr)`, `serializeTerm(term)` + + - **Result mapping** (SPARQL JSON results → typed DSL objects): + + - `mapSparqlSelectResult(json, query)` — handles flat/nested/aggregated results with XSD type coercion + - `mapSparqlCreateResult(uri, query)` — echoes created fields with generated URI + - `mapSparqlUpdateResult(query)` — echoes updated fields + + - **All algebra types** re-exported: `SparqlTerm`, `SparqlTriple`, `SparqlAlgebraNode`, `SparqlExpression`, `SparqlSelectPlan`, `SparqlInsertDataPlan`, `SparqlDeleteInsertPlan`, `SparqlDeleteWherePlan`, `SparqlPlan`, `SparqlOptions`, etc. + + **Bug fixes included:** + + - Fixed `isNodeReference()` in MutationQuery.ts — nested creates with predefined IDs (e.g., `{id: '...', name: 'Bestie'}`) now correctly insert entity data instead of only creating the link. + + See [SPARQL Algebra Layer docs](./documentation/sparql-algebra.md) for the full type reference, conversion rules, and store implementation guide. + ## 1.1.0 ### Minor Changes diff --git a/package.json b/package.json index d27e9bf..ff478a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@_linked/core", - "version": "1.1.0", + "version": "1.2.0", "license": "MIT", "description": "Linked.js core query and SHACL shape DSL (copy-then-prune baseline)", "repository": {