You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2e25236
Browse filesBrowse the repository at this point in the historyBrowse files
+ ShExMap: schema-to-schema mapping via Map/# semantic actions
Implement http://shex.io/extensions/Map/# (lib/ShExMap.{hpp,cpp}),
ported from shex.js's @shexjs/extension-map: validating data against a
source schema whose triple constraints carry %Map:{ pfx:var %} actions
binds each matched value to the (prefix-expanded) variable, and
materialization walks a target schema emitting those bindings as a new
graph. Lift/lower functions are supported on both sides:
%Map:{ regex(/(?<bp:family>[a-zA-Z]+), (?<bp:given>[a-zA-Z]+)/) %}
%Map:{ hashmap(bp:code, {"D": "Divorced", ...}) %}
with named-group regexes rewritten for Boost.Regex and hashmaps read
via MiniJSON.
The validator gains a SemActHandler interface (in addition to the
built-in Test language): handlers see each action with its focus node
and the triples the accepted matching assigned to its constraint, and
mark()/rollback() scope handler state to successful validation
subtrees -- without that, probing a sibling shape (e.g. a systolic
component against the diastolic shape) leaks spurious bindings.
Bindings are an ordered log frozen into per-variable FIFO queues:
variables bound once (and manifest staticVars) stay available, while
multi-valued queues pop, and only pops count as "consumption". The
materializer uses that to decide repetition: a repeated triple
constraint (@<Shape>* etc.) keeps emitting fresh bnodes only while
each repetition consumes bindings, which reproduces shex.js's
multi-bindings behavior without its solution-tree binder.
Manifest entries (JSON or YAML) drive mapping with outputSchema[URL],
outputShape, createRoot and staticVars, plus optional
expectedBindingsURL and outputDataURL checks (materialized graphs
compared bnode-isomorphically); bin/sparql --shex-manifest prints the
materialized graph. tests/ShExMap/ carries the BP FHIR<->DAM round
trip and the multi-bindings case from shex.js's examples; the ShEx
suite is now 1736 cases, all green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments