@Test public void testRule() { Set<IntegerAnnotation> annotations = new TreeSet<>(); IntegerOntologyObjectFactory factory = new IntegerOntologyObjectFactoryImpl(); NormalizerNR4_2 normalizer = new NormalizerNR4_2(factory); int indivAId = factory.getEntityManager().createNamedEntity(IntegerEntityType.INDIVIDUAL, "a", false); int classBId = factory.getEntityManager().createNamedEntity(IntegerEntityType.CLASS, "B", false); IntegerObjectOneOf oneOf = factory.getDataTypeFactory().createObjectOneOf(indivAId); IntegerClass classB = factory.getDataTypeFactory().createClass(classBId); IntegerSubClassOfAxiom axiom = factory.getComplexAxiomFactory().createSubClassOfAxiom(oneOf, classB, annotations); Set<IntegerAxiom> normalizedAxioms = normalizer.apply(axiom); Set<IntegerAxiom> expectedAxioms = new HashSet<>(); Optional<Integer> optClassA = factory.getEntityManager().getAuxiliaryNominal(indivAId); Assert.assertTrue(optClassA.isPresent()); int classAId = optClassA.get(); expectedAxioms.add(factory.getNormalizedAxiomFactory().createNominalAxiom(classAId, indivAId, annotations)); expectedAxioms.add(factory.getNormalizedAxiomFactory().createGCI0Axiom(classAId, classBId, annotations)); Assert.assertEquals(expectedAxioms, normalizedAxioms); }
@Override public Set<IntegerAxiom> apply(IntegerAxiom axiom) { Objects.requireNonNull(axiom); Set<IntegerAxiom> ret = Collections.emptySet(); if (axiom instanceof IntegerSubClassOfAxiom) { ret = applyRule((IntegerSubClassOfAxiom) axiom); } return ret; }
NormalizerNR4_2 implements NormalizationRule { @Override public Set<IntegerAxiom> apply(IntegerAxiom axiom) { Objects.requireNonNull(axiom); Set<IntegerAxiom> ret = Collections.emptySet(); if (axiom instanceof IntegerSubClassOfAxiom) { ret = applyRule((IntegerSubClassOfAxiom) axiom); } return ret; } }
NormalizerNR4_2 implements NormalizationRule { @Override public Set<IntegerAxiom> apply(IntegerAxiom axiom) { Objects.requireNonNull(axiom); Set<IntegerAxiom> ret = Collections.emptySet(); if (axiom instanceof IntegerSubClassOfAxiom) { ret = applyRule((IntegerSubClassOfAxiom) axiom); } return ret; } NormalizerNR4_2(IntegerOntologyObjectFactory factory); }
NormalizerNR4_2 implements NormalizationRule { @Override public Set<IntegerAxiom> apply(IntegerAxiom axiom) { Objects.requireNonNull(axiom); Set<IntegerAxiom> ret = Collections.emptySet(); if (axiom instanceof IntegerSubClassOfAxiom) { ret = applyRule((IntegerSubClassOfAxiom) axiom); } return ret; } NormalizerNR4_2(IntegerOntologyObjectFactory factory); @Override Set<IntegerAxiom> apply(IntegerAxiom axiom); }
NormalizerNR4_2 implements NormalizationRule { @Override public Set<IntegerAxiom> apply(IntegerAxiom axiom) { Objects.requireNonNull(axiom); Set<IntegerAxiom> ret = Collections.emptySet(); if (axiom instanceof IntegerSubClassOfAxiom) { ret = applyRule((IntegerSubClassOfAxiom) axiom); } return ret; } NormalizerNR4_2(IntegerOntologyObjectFactory factory); @Override Set<IntegerAxiom> apply(IntegerAxiom axiom);  }