Skip to content

chore: version package for release#16

Merged
flyon merged 1 commit intomainfrom
changeset-release/main
Mar 2, 2026
Merged

chore: version package for release#16
flyon merged 1 commit intomainfrom
changeset-release/main

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Mar 2, 2026

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@_linked/core@1.2.0

Minor Changes

  • #9 381067b Thanks @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 b65e156 Thanks @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:

      import { SparqlStore } from "@_linked/core/sparql";
      
      class MyStore extends SparqlStore {
        protected async executeSparqlSelect(
          sparql: string
        ): Promise<SparqlJsonResults> {
          /* ... */
        }
        protected async executeSparqlUpdate(sparql: string): Promise<void> {
          /* ... */
        }
      }
    • 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 for the full type reference, conversion rules, and store implementation guide.

@flyon flyon merged commit 9847957 into main Mar 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant