v2.2.0
Patch Changes
-
#34
e2ae4a2Thanks @flyon! - ### SHACL property path supportProperty decorators now accept full SPARQL property path syntax:
@literalProperty({path: 'foaf:knows/foaf:name'}) // sequence @literalProperty({path: '<http://ex.org/a>|<http://ex.org/b>'}) // alternative @literalProperty({path: '^foaf:knows'}) // inverse @literalProperty({path: 'foaf:knows*'}) // zeroOrMore
New exports from
src/paths/:PathExpr,PathRef— AST types for property pathsparsePropertyPath(input): PathExpr— parser for SPARQL property path stringsnormalizePropertyPath(input): PathExpr— normalizes any input form to canonical ASTpathExprToSparql(expr): string— renders PathExpr to SPARQL syntaxserializePathToSHACL(expr): SHACLPathResult— serializes to SHACL RDF triples
PropertyShape.pathis now typed asPathExpr(was opaque). Complex paths flow through the full IR pipeline and emit correct SPARQL property path syntax in generated queries.Strict prefix resolution in query API
QueryBuilder.for()and.forAll()now throw on unregistered prefixes instead of silently passing through. New export:resolveUriOrThrow(str): string— strict prefix resolution (throws on unknown prefix)
SHACL constraint field fixes
hasValueandinconfig fields now correctly handle literal values (string,number,boolean) — previously all values were wrapped as IRI nodeslessThanandlessThanOrEqualsconfig fields are now wired intocreatePropertyShapeand exposed viagetResult()- New
PropertyShapeResultinterface provides typed access togetResult()output