Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
381067bThanks @flyon! - Replaced internal query representation with a canonical backend-agnostic IR AST.SelectQuery,CreateQuery,UpdateQuery, andDeleteQueryare now typed IR objects withkinddiscriminators, compact shape/property ID references, and expression trees — replacing the previous ad-hoc nested arrays. The public Shape DSL is unchanged; what changed is whatIQuadStoreimplementations receive. Store result types (ResultRow,SelectResult,CreateResult,UpdateResult) are now exported. All factories exposebuild()as the primary method. Seedocumentation/intermediate-representation.mdfor the full IR reference and migration guidance.#14
b65e156Thanks @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:IR → SPARQL string convenience functions (full pipeline in one call):
selectToSparql(query, options?)— SelectQuery → SPARQL stringcreateToSparql(query, options?)— CreateQuery → SPARQL stringupdateToSparql(query, options?)— UpdateQuery → SPARQL stringdeleteToSparql(query, options?)— DeleteQuery → SPARQL stringIR → SPARQL algebra (for stores that want to inspect/optimize the algebra before serialization):
selectToAlgebra(query, options?)— returnsSparqlSelectPlancreateToAlgebra(query, options?)— returnsSparqlInsertDataPlanupdateToAlgebra(query, options?)— returnsSparqlDeleteInsertPlandeleteToAlgebra(query, options?)— returnsSparqlDeleteInsertPlanAlgebra → 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 coercionmapSparqlCreateResult(uri, query)— echoes created fields with generated URImapSparqlUpdateResult(query)— echoes updated fieldsAll algebra types re-exported:
SparqlTerm,SparqlTriple,SparqlAlgebraNode,SparqlExpression,SparqlSelectPlan,SparqlInsertDataPlan,SparqlDeleteInsertPlan,SparqlDeleteWherePlan,SparqlPlan,SparqlOptions, etc.Bug fixes included:
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.