use of eu.xsdi.mdl.model.reason.ReasonRule in project hale by halestudio.
the class MismatchRuleRepository method getCellbasedRules.
public static List<ReasonRule> getCellbasedRules() {
ReasonSet rs1 = new ReasonSet();
List<ReasonCondition> conditions1 = new ArrayList<ReasonCondition>();
conditions1.add(new ReasonCondition(// to be applied to all elements
null, // no value filter
null, // selected Characteristic for this Mismatch
EntityCharacteristic.AttributeCardinalityConstraint));
rs1.setConditions(conditions1);
ReasonSet rs2 = new ReasonSet();
List<ReasonCondition> conditions2 = new ArrayList<ReasonCondition>();
conditions2.add(new ReasonCondition(// to be applied to all elements
null, // no value filter
null, // selected Characteristic for this Mismatch
EntityCharacteristic.AttributeCardinalityConstraint));
rs2.setConditions(conditions2);
ReasonRule rr1 = new ReasonRule(rs1, rs2);
return null;
}
use of eu.xsdi.mdl.model.reason.ReasonRule in project hale by halestudio.
the class MismatchPropertiesBlock method getDummyCell.
private Object getDummyCell() {
Mismatch a = new Mismatch(MismatchType.AggregationLevelMismatch);
a.setReason(new Reason(new FeatureClass(new About("FC1")), new FeatureClass(new About("FC2")), EntityCharacteristic.AssociationCardinalityConstraint));
a.getConsequences().add(new Consequence());
a.getConsequences().add(new Consequence());
a.getConsequences().add(new Consequence());
a.setProvenance("HALE MDL Inference Engine");
Mismatch b = new Mismatch(MismatchType.StructureMismatch);
b.setReason(new Reason(new Property(new About("Prop1Name")), new Property(new About("Prop2Name")), EntityCharacteristic.AttributeTypeConstraint));
b.getReason().setReasonRule(new ReasonRule(new ReasonSet("Prop1Name"), new ReasonSet("Prop2Name")));
List<ReasonCondition> conditions = new ArrayList<ReasonCondition>();
conditions.add(new ReasonCondition("attributeName", "attributeFilterValue", null));
b.getReason().getReasonRule().getSet1().setConditions(conditions);
b.getReason().getReasonRule().getSet1().setSubSet(new ReasonSet("SubProp1Name"));
b.getConsequences().add(new Consequence());
b.setProvenance("User");
Mismatch c = new Mismatch(MismatchType.AbstractionMismatch);
c.setReason(new Reason(new Property(new About("Prop3Name")), new Property(new About("Prop4Name")), EntityCharacteristic.AttributeDerivedPopulatedValues));
c.getReason().setReasonRule(new ReasonRule(new ReasonSet("Prop3Name"), new ReasonSet("Prop4Name")));
c.getConsequences().add(new Consequence());
c.getConsequences().add(new Consequence());
c.setProvenance("HALE MDL Inference Engine");
MismatchCell mc = new MismatchCell();
mc.getMismatches().add(a);
mc.getMismatches().add(b);
mc.getMismatches().add(c);
return mc;
}
Aggregations