@Test public void testSimpleNormalizer() { Set<IntegerAnnotation> annotations = new TreeSet<>(); IntegerOntologyObjectFactory factory = new IntegerOntologyObjectFactoryImpl(); SimpleNormalizer normalizer = new SimpleNormalizer(factory); int classAId = factory.getEntityManager().createNamedEntity(IntegerEntityType.CLASS, "a", false); IntegerClass classA = factory.getDataTypeFactory().createClass(classAId); int classBId = factory.getEntityManager().createNamedEntity(IntegerEntityType.CLASS, "b", false); IntegerClass classB = factory.getDataTypeFactory().createClass(classBId); int propertyRId = factory.getEntityManager().createNamedEntity(IntegerEntityType.OBJECT_PROPERTY, "r", false); IntegerObjectProperty propertyR = factory.getDataTypeFactory().createObjectProperty(propertyRId); int indivI0Id = factory.getEntityManager().createNamedEntity(IntegerEntityType.INDIVIDUAL, "i0", false); int indivI1Id = factory.getEntityManager().createNamedEntity(IntegerEntityType.INDIVIDUAL, "i1", false); IntegerClassAssertionAxiom axiom0 = factory.getComplexAxiomFactory().createClassAssertionAxiom(classA, indivI0Id, annotations); IntegerClassAssertionAxiom axiom1 = factory.getComplexAxiomFactory().createClassAssertionAxiom(classB, indivI1Id, annotations); IntegerObjectPropertyAssertionAxiom axiom2 = factory.getComplexAxiomFactory() .createObjectPropertyAssertionAxiom(propertyR, indivI0Id, indivI1Id, annotations); Set<IntegerAxiom> firstIterationAxioms = new HashSet<>(); firstIterationAxioms.addAll(normalizer.normalize(axiom0)); firstIterationAxioms.addAll(normalizer.normalize(axiom1)); firstIterationAxioms.addAll(normalizer.normalize(axiom2)); Set<IntegerAxiom> normalizedAxioms = new HashSet<>(); firstIterationAxioms.forEach(axiom -> normalizedAxioms.addAll(normalizer.normalize(axiom))); Set<IntegerAxiom> expectedAxioms = new HashSet<>(); Optional<Integer> optClassI0 = factory.getEntityManager().getAuxiliaryNominal(indivI0Id); Assert.assertTrue(optClassI0.isPresent()); Optional<Integer> optClassI1 = factory.getEntityManager().getAuxiliaryNominal(indivI1Id); Assert.assertTrue(optClassI1.isPresent()); int classI0Id = optClassI0.get(); int classI1Id = optClassI1.get(); expectedAxioms.add(factory.getNormalizedAxiomFactory().createNominalAxiom(classI0Id, indivI0Id, annotations)); expectedAxioms.add(factory.getNormalizedAxiomFactory().createGCI0Axiom(classI0Id, classAId, annotations)); expectedAxioms.add(factory.getNormalizedAxiomFactory().createNominalAxiom(classI1Id, indivI1Id, annotations)); expectedAxioms.add(factory.getNormalizedAxiomFactory().createGCI0Axiom(classI1Id, classBId, annotations)); expectedAxioms.add( factory.getNormalizedAxiomFactory().createGCI2Axiom(classI0Id, propertyRId, classI1Id, annotations)); Assert.assertEquals(expectedAxioms, normalizedAxioms); }
public SimpleNormalizer(IntegerOntologyObjectFactory factory) { Objects.requireNonNull(factory); this.ontologyObjectFactory = factory; this.norChainOfSubClass = new ArrayList<>(); this.norChainOfSubClass.add(new NormalizerNR1_7(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR2_2(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR2_3(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR2_4(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR3_1(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR3_2(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR3_3(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR4_1(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR4_2(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerSubClassOf(getOntologyObjectFactory())); this.norDisjoint = new NormalizerDisjoint(getOntologyObjectFactory()); this.norEquivProperties = new NormalizerEquivProperties(getOntologyObjectFactory()); this.norSubPropertyChainOf = new NormalizerSubPropertyChainOf(getOntologyObjectFactory()); this.norNR1_5 = new NormalizerNR1_5(getOntologyObjectFactory()); this.norNR1_2 = new NormalizerNR1_2(getOntologyObjectFactory()); this.norNR2_1 = new NormalizerNR2_1(getOntologyObjectFactory()); this.norNR1_6 = new NormalizerNR1_6(); }
SimpleNormalizer implements ComplexIntegerAxiomVisitor<Set<IntegerAxiom>> { public SimpleNormalizer(IntegerOntologyObjectFactory factory) { Objects.requireNonNull(factory); this.ontologyObjectFactory = factory; this.norChainOfSubClass = new ArrayList<>(); this.norChainOfSubClass.add(new NormalizerNR1_7(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR2_2(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR2_3(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR2_4(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR3_1(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR3_2(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR3_3(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR4_1(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR4_2(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerSubClassOf(getOntologyObjectFactory())); this.norDisjoint = new NormalizerDisjoint(getOntologyObjectFactory()); this.norEquivProperties = new NormalizerEquivProperties(getOntologyObjectFactory()); this.norSubPropertyChainOf = new NormalizerSubPropertyChainOf(getOntologyObjectFactory()); this.norNR1_5 = new NormalizerNR1_5(getOntologyObjectFactory()); this.norNR1_2 = new NormalizerNR1_2(getOntologyObjectFactory()); this.norNR2_1 = new NormalizerNR2_1(getOntologyObjectFactory()); this.norNR1_6 = new NormalizerNR1_6(); } }
SimpleNormalizer implements ComplexIntegerAxiomVisitor<Set<IntegerAxiom>> { public SimpleNormalizer(IntegerOntologyObjectFactory factory) { Objects.requireNonNull(factory); this.ontologyObjectFactory = factory; this.norChainOfSubClass = new ArrayList<>(); this.norChainOfSubClass.add(new NormalizerNR1_7(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR2_2(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR2_3(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR2_4(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR3_1(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR3_2(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR3_3(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR4_1(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR4_2(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerSubClassOf(getOntologyObjectFactory())); this.norDisjoint = new NormalizerDisjoint(getOntologyObjectFactory()); this.norEquivProperties = new NormalizerEquivProperties(getOntologyObjectFactory()); this.norSubPropertyChainOf = new NormalizerSubPropertyChainOf(getOntologyObjectFactory()); this.norNR1_5 = new NormalizerNR1_5(getOntologyObjectFactory()); this.norNR1_2 = new NormalizerNR1_2(getOntologyObjectFactory()); this.norNR2_1 = new NormalizerNR2_1(getOntologyObjectFactory()); this.norNR1_6 = new NormalizerNR1_6(); } SimpleNormalizer(IntegerOntologyObjectFactory factory); }
SimpleNormalizer implements ComplexIntegerAxiomVisitor<Set<IntegerAxiom>> { public SimpleNormalizer(IntegerOntologyObjectFactory factory) { Objects.requireNonNull(factory); this.ontologyObjectFactory = factory; this.norChainOfSubClass = new ArrayList<>(); this.norChainOfSubClass.add(new NormalizerNR1_7(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR2_2(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR2_3(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR2_4(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR3_1(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR3_2(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR3_3(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR4_1(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR4_2(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerSubClassOf(getOntologyObjectFactory())); this.norDisjoint = new NormalizerDisjoint(getOntologyObjectFactory()); this.norEquivProperties = new NormalizerEquivProperties(getOntologyObjectFactory()); this.norSubPropertyChainOf = new NormalizerSubPropertyChainOf(getOntologyObjectFactory()); this.norNR1_5 = new NormalizerNR1_5(getOntologyObjectFactory()); this.norNR1_2 = new NormalizerNR1_2(getOntologyObjectFactory()); this.norNR2_1 = new NormalizerNR2_1(getOntologyObjectFactory()); this.norNR1_6 = new NormalizerNR1_6(); } SimpleNormalizer(IntegerOntologyObjectFactory factory); Set<NormalizedIntegerAxiom> getAxiomsForInverseObjectProperties(Integer firstProperty,
			Integer secondProperty); IntegerOntologyObjectFactory getOntologyObjectFactory(); Set<IntegerAxiom> normalize(IntegerAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerClassAssertionAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerClassDeclarationAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerDataPropertyAssertionAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerDataPropertyDeclarationAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerDifferentIndividualsAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerDisjointClassesAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerEquivalentClassesAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerEquivalentObjectPropertiesAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerFunctionalObjectPropertyAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerInverseFunctionalObjectPropertyAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerInverseObjectPropertiesAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerNamedIndividualDeclarationAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerNegativeObjectPropertyAssertionAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerObjectPropertyAssertionAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerObjectPropertyDeclarationAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerPropertyRangeAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerReflexiveObjectPropertyAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerSameIndividualAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerSubClassOfAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerSubObjectPropertyOfAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerSubPropertyChainOfAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerTransitiveObjectPropertyAxiom axiom); }
SimpleNormalizer implements ComplexIntegerAxiomVisitor<Set<IntegerAxiom>> { public SimpleNormalizer(IntegerOntologyObjectFactory factory) { Objects.requireNonNull(factory); this.ontologyObjectFactory = factory; this.norChainOfSubClass = new ArrayList<>(); this.norChainOfSubClass.add(new NormalizerNR1_7(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR2_2(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR2_3(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR2_4(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR3_1(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR3_2(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR3_3(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR4_1(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerNR4_2(getOntologyObjectFactory())); this.norChainOfSubClass.add(new NormalizerSubClassOf(getOntologyObjectFactory())); this.norDisjoint = new NormalizerDisjoint(getOntologyObjectFactory()); this.norEquivProperties = new NormalizerEquivProperties(getOntologyObjectFactory()); this.norSubPropertyChainOf = new NormalizerSubPropertyChainOf(getOntologyObjectFactory()); this.norNR1_5 = new NormalizerNR1_5(getOntologyObjectFactory()); this.norNR1_2 = new NormalizerNR1_2(getOntologyObjectFactory()); this.norNR2_1 = new NormalizerNR2_1(getOntologyObjectFactory()); this.norNR1_6 = new NormalizerNR1_6(); } SimpleNormalizer(IntegerOntologyObjectFactory factory); Set<NormalizedIntegerAxiom> getAxiomsForInverseObjectProperties(Integer firstProperty,
			Integer secondProperty); IntegerOntologyObjectFactory getOntologyObjectFactory(); Set<IntegerAxiom> normalize(IntegerAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerClassAssertionAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerClassDeclarationAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerDataPropertyAssertionAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerDataPropertyDeclarationAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerDifferentIndividualsAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerDisjointClassesAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerEquivalentClassesAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerEquivalentObjectPropertiesAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerFunctionalObjectPropertyAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerInverseFunctionalObjectPropertyAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerInverseObjectPropertiesAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerNamedIndividualDeclarationAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerNegativeObjectPropertyAssertionAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerObjectPropertyAssertionAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerObjectPropertyDeclarationAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerPropertyRangeAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerReflexiveObjectPropertyAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerSameIndividualAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerSubClassOfAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerSubObjectPropertyOfAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerSubPropertyChainOfAxiom axiom); @Override Set<IntegerAxiom> visit(IntegerTransitiveObjectPropertyAxiom axiom);  }