Class StructureSiblingSetRule
java.lang.Object
com.northconcepts.datapipeline.foundations.pipeline.tree.detect.StructureSiblingSetRule
- All Implemented Interfaces:
SiblingSetRule
Derives a
SiblingSetPattern from siblings whose child structures overlap, instead
of their names: each candidate's structural signature is the set of its child element and
attribute names (looking through JSON object/array container nodes),
and siblings whose signatures agree above minimumSimilarity
(Jaccard overlap) form the collapse group.
This collapses siblings that are instances of the same entity even when their names share no
derivable affix (for example alpha, beta, gamma elements
with identical children), and refuses siblings that merely share a naming convention while
holding different content (for example Form ADV's Item3A/Item5B
sections, whose attribute sets do not overlap). Siblings without children are never clustered —
value-only leaf fields such as first_name/last_name are fields, not
repeating records.
The derived pattern is a closed set: it matches exactly the sibling names that formed the
cluster (with any shared affix contributing a field-name hint), unlike
AffixSiblingSetRule whose patterns also match future names with the same shape.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final double -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionderivePattern(TreeNode parent, List<TreeNode> candidateSiblings) Returns the pattern shared by the candidate children ofparent, or null;CollapseSiblingPatternspasses its named children, excluding attributes, wildcards and JSON containers.intReturns the minimum number of structurally similar siblings required to derive a pattern (default 3).doubleReturns the minimum Jaccard overlap between sibling structural signatures (default 0.75).Returns the node's structural signature: the names of its element and attribute children, looking through JSONobject/arraycontainer nodes to the entries inside them.setMinimumSiblings(int minimumSiblings) Sets the minimum number of structurally similar siblings required to derive a pattern (default 3, at least 2).setMinimumSimilarity(double minimumSimilarity) Sets the minimum Jaccard overlap between sibling structural signatures (default 0.75; greater than 0, at most 1).
-
Field Details
-
DEFAULT_MINIMUM_SIBLINGS
public static final int DEFAULT_MINIMUM_SIBLINGS- See Also:
-
DEFAULT_MINIMUM_SIMILARITY
public static final double DEFAULT_MINIMUM_SIMILARITY- See Also:
-
-
Constructor Details
-
StructureSiblingSetRule
public StructureSiblingSetRule()
-
-
Method Details
-
getMinimumSiblings
public int getMinimumSiblings()Returns the minimum number of structurally similar siblings required to derive a pattern (default 3). -
setMinimumSiblings
Sets the minimum number of structurally similar siblings required to derive a pattern (default 3, at least 2). -
getMinimumSimilarity
public double getMinimumSimilarity()Returns the minimum Jaccard overlap between sibling structural signatures (default 0.75). -
setMinimumSimilarity
Sets the minimum Jaccard overlap between sibling structural signatures (default 0.75; greater than 0, at most 1). -
derivePattern
Description copied from interface:SiblingSetRuleReturns the pattern shared by the candidate children ofparent, or null;CollapseSiblingPatternspasses its named children, excluding attributes, wildcards and JSON containers.- Specified by:
derivePatternin interfaceSiblingSetRule
-
getStructuralSignature
Returns the node's structural signature: the names of its element and attribute children, looking through JSONobject/arraycontainer nodes to the entries inside them. Empty for value-only leaves.
-