Implement merging of partnered schemas #145
Labels
bids
BIDS integration
enhancement
New feature or request
hed 3
HED 3-specific issues
important
Important issues
schema
Schema parsing
Milestone
Partnered schemas were introduced in HED standard schema version 8.2.0. Currently, hed-javascript has basic support for using partnered schemas separately from each other, with different prefixes for each schema. Now, we require support for so-called "lazy partnered schema" merging, where compatible partnered schemas with the same prefix may be merged into a single schema.
Partnered schemas are compatible (in this version) if:
withStandard
XML attribute (referencing the same standard schema version; merging this standard schema version shall be a no-op).inLibrary
schema attribute have no overlap.A sketch for merging partnered schemas
A
andB
(assuming they are both partnered to a standard schema we're callingS
:A
andB
as normal. Failures here end the process.A
andB
are both actually partnered to the same standard schema (S
in this case). Error out if they differ.B
intoA
(tags only for now). Iterate throughB
's tags.inLibrary
schema attribute, skip the tag. (It is already in the standard schemaS
.)B
's short tag name is already in A, error out (error message: "Library A and Library B are incompatible and a prefix must be given for one or the other."). This includes short tags that resolve to the same full path.B
toA
at the position indicated by therooted
schema attribute (if the attribute is not present, place it at the top level).The text was updated successfully, but these errors were encountered: