v2.15.0
Minor Changes
-
#177
e5373fdThanks @flyon! - Shapes are now metadata-only:Shapesubclasses can no longer be instantiated, and SHACL metadata is exposed as plain objects.Behavioral change —
new SomeShape()throws. Constructing anyShapesubclass now throws a clear error steering you to the DSL (Shape.select(...),.create(...),.update(...),.delete(...)). Shapes never carried live data — their decorated getters only returned typing stubs — so this turns a silent footgun into a loud error. All querying and mutation continues to go through the DSL exactly as before.Metadata is plain objects.
SomeShape.shapeand each property shape are now plainNodeShapeData/PropertyShapeDataobjects (importable as types from@_linked/core), not class instances. The formerNodeShape/PropertyShapeinstance methods are now free functions, exported from the package:import { getPropertyShapes, // (nodeShape, includeSuperClasses?) => PropertyShapeData[] getUniquePropertyShapes, // (nodeShape) => PropertyShapeData[] getPropertyShape, // (nodeShape, label, checkSubShapes?) => PropertyShapeData | undefined addPropertyShape, // (nodeShape, propertyShape) => void nodeShapeEquals, // (a, b) => boolean } from "@_linked/core"; // before: Person.shape.getUniquePropertyShapes() // now: getUniquePropertyShapes(Person.shape)
If you read shape metadata via the old instance methods, switch to these free functions; if you only use the query DSL, no change is needed.
Deprecations (scheduled for removal):
Shape.getSetOf,Shape.mapPropertyShapes,propertyShapeToResult, and thePropertyShapeResulttype. Read the plainPropertyShapeDatafields directly instead of the result projection.SparqlDatasetno longer extendsShape. A SPARQL-backed dataset is a live store, not a metadata shape; it never used anyShapemember. This has no effect on constructing or using datasets/stores.