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
Convert between OO-LD schemas and SHACL shapes graphs in both directions, so schemas authored in either form can be used with the other stack.
Spec-side twin: OO-LD/oold-schema#76 (align x-oold-range / x-oold-ui-* with SHACL 1.2). That issue holds the crosswalk definition; this one is the implementation.
sh:NodeShape per object schema, sh:PropertyShape per property
type to sh:datatype/sh:nodeKind, required and array bounds to sh:minCount/sh:maxCount, pattern to sh:pattern, enum to sh:in, numeric bounds to sh:minInclusive/sh:maxInclusive
JSON-LD context resolves property IRIs for sh:path and the type IRI for sh:targetClass
Logical composition maps to SHACL Core: anyOf to sh:or, oneOf to sh:xone, allOf to sh:and, not to sh:not
Nested objects and $ref
SHACL to OO-LD
Shapes graph to JSON Schema plus @context, inverting the mappings above. Several constructs have
no direct counterpart but do have candidates to evaluate:
sh:closed to additionalProperties: false
inverse paths to x-oold-reverse-properties
sh:path sequence and alternative paths: no evident equivalent, needs a decision
Round-trip OO-LD to SHACL to OO-LD should be semantically stable on the reference schemas.
Open questions
if/then/else has no SHACL Core equivalent. SHACL-SPARQL (sh:sparql) could express it, as could SHACL 1.2 Node Expressions. Worth deciding whether to support it at all: conditional subschemas are also awkward for code generation, so the spec may prefer to discourage if/then rather than carry it through every converter. Coordinate with Align x-oold-range / x-oold-ui-* with SHACL 1.2 (Core, Node Expressions, User Interfaces) oold-schema#76.
Which SHACL subset is the primary target: Core only, or Core plus SHACL-SPARQL for the residue
SHACL 1.2 User Interfaces is a Working Draft and overlaps x-oold-ui-*; the converter should emit and consume UI annotations rather than dropping them
Whether SHACL validation results should be normalised against JSON Schema validator output
Acceptance
Generated shapes validate reference instances consistently with JSON Schema validation
Round-trip test in both directions over the example schemas in the repo
Convert between OO-LD schemas and SHACL shapes graphs in both directions, so schemas authored in either form can be used with the other stack.
Spec-side twin: OO-LD/oold-schema#76 (align
x-oold-range/x-oold-ui-*with SHACL 1.2). That issue holds the crosswalk definition; this one is the implementation.cc @durmaz07
OO-LD to SHACL
sh:NodeShapeper object schema,sh:PropertyShapeper propertytypetosh:datatype/sh:nodeKind,requiredand array bounds tosh:minCount/sh:maxCount,patterntosh:pattern,enumtosh:in, numeric bounds tosh:minInclusive/sh:maxInclusivesh:pathand the type IRI forsh:targetClassanyOftosh:or,oneOftosh:xone,allOftosh:and,nottosh:not$refSHACL to OO-LD
Shapes graph to JSON Schema plus
@context, inverting the mappings above. Several constructs haveno direct counterpart but do have candidates to evaluate:
sh:closedtoadditionalProperties: falsex-oold-reverse-propertiessh:pathsequence and alternative paths: no evident equivalent, needs a decisionRound-trip OO-LD to SHACL to OO-LD should be semantically stable on the reference schemas.
Open questions
if/then/elsehas no SHACL Core equivalent. SHACL-SPARQL (sh:sparql) could express it, as could SHACL 1.2 Node Expressions. Worth deciding whether to support it at all: conditional subschemas are also awkward for code generation, so the spec may prefer to discourageif/thenrather than carry it through every converter. Coordinate with Align x-oold-range / x-oold-ui-* with SHACL 1.2 (Core, Node Expressions, User Interfaces) oold-schema#76.x-oold-ui-*; the converter should emit and consume UI annotations rather than dropping themAcceptance