Пример #1
0
  /**
   * Serializes a batch of triples corresponding to a predicate into one file. Upper bound:
   * TRIPLE_LIMIT_PER_FILE.
   */
  private static int serializeTripleBatch(
      OWLOntology ontology,
      QuestOWLIndividualAxiomIterator iterator,
      String filePrefix,
      String predicateName,
      int fileCount,
      String format)
      throws Exception {
    String fileName = filePrefix + fileCount + ".owl";

    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();

    // Main buffer
    OWLOntology aBox = manager.createOntology(IRI.create(predicateName));

    // Add the signatures
    for (OWLDeclarationAxiom axiom : ontology.getAxioms(AxiomType.DECLARATION)) {
      manager.addAxiom(aBox, axiom);
    }

    int tripleCount = 0;
    while (iterator.hasNext() && (tripleCount < TRIPLE_LIMIT_PER_FILE)) {
      manager.addAxiom(aBox, iterator.next());
      tripleCount++;
    }

    // BufferedOutputStream output = new BufferedOutputStream(new
    // FileOutputStream(outputPath.toFile()));
    // BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(output, "UTF-8"));
    BufferedWriter writer = new BufferedWriter(new FileWriter(fileName));
    manager.saveOntology(aBox, getOntologyFormat(format), new WriterDocumentTarget(writer));

    return tripleCount;
  }
  public void testIgnoreAnnotations() throws Exception {
    OWLOntologyManager man = getManager(); // OWLManager.createOWLOntologyManager();
    OWLOntology ont = man.createOntology();
    OWLDataFactory df = man.getOWLDataFactory();
    OWLClass clsA = df.getOWLClass(IRI.create("http://ont.com#A"));
    OWLClass clsB = df.getOWLClass(IRI.create("http://ont.com#B"));
    OWLSubClassOfAxiom sca = df.getOWLSubClassOfAxiom(clsA, clsB);
    man.addAxiom(ont, sca);

    OWLAnnotationProperty rdfsComment = df.getRDFSComment();
    OWLLiteral lit = df.getOWLLiteral("Hello world");

    OWLAnnotationAssertionAxiom annoAx1 =
        df.getOWLAnnotationAssertionAxiom(rdfsComment, clsA.getIRI(), lit);
    man.addAxiom(ont, annoAx1);

    OWLAnnotationPropertyDomainAxiom annoAx2 =
        df.getOWLAnnotationPropertyDomainAxiom(rdfsComment, clsA.getIRI());
    man.addAxiom(ont, annoAx2);

    OWLAnnotationPropertyRangeAxiom annoAx3 =
        df.getOWLAnnotationPropertyRangeAxiom(rdfsComment, clsB.getIRI());
    man.addAxiom(ont, annoAx3);

    OWLAnnotationProperty myComment =
        df.getOWLAnnotationProperty(IRI.create("http://ont.com#myComment"));
    OWLSubAnnotationPropertyOfAxiom annoAx4 =
        df.getOWLSubAnnotationPropertyOfAxiom(myComment, rdfsComment);
    man.addAxiom(ont, annoAx4);

    reload(ont, new RDFXMLOntologyFormat());
    reload(ont, new OWLXMLOntologyFormat());
    reload(ont, new TurtleOntologyFormat());
    reload(ont, new OWLFunctionalSyntaxOntologyFormat());
  }
  ////////////////////////////////
  // INDIVIDUAL ASSERTION METHODS//
  ////////////////////////////////
  public boolean assertSiteIndividual(String siteNameHash, String siteNameAnnotation) {
    OWLClassExpression tmpCE = OWLFactory.getOWLClass(":Site", topIxPrefixManager);
    OWLIndividual tmpInd = OWLFactory.getOWLNamedIndividual(':' + siteNameHash, topIxPrefixManager);

    manager.addAxiom(topIxOnt, OWLFactory.getOWLClassAssertionAxiom(tmpCE, tmpInd));
    manager.addAxiom(
        topIxOnt,
        OWLFactory.getOWLAnnotationAssertionAxiom(
            OWLFactory.getOWLAnnotationProperty(
                IRI.create(
                    topIxOnt.getOntologyID().getOntologyIRI().toString() + '#' + "individualName")),
            IRI.create(topIxOnt.getOntologyID().getOntologyIRI().toString() + '#' + siteNameHash),
            OWLFactory.getOWLLiteral(siteNameAnnotation)));
    return true;
  }
  public boolean assertHouseIndividual(String houseEntryHash, String houseEntryAnnotation) {
    OWLClassExpression tempClassExpression = OWLFactory.getOWLClass(":House", topIxPrefixManager);
    OWLIndividual tempIndividual =
        OWLFactory.getOWLNamedIndividual(':' + houseEntryHash, topIxPrefixManager);

    manager.addAxiom(
        topIxOnt, OWLFactory.getOWLClassAssertionAxiom(tempClassExpression, tempIndividual));
    manager.addAxiom(
        topIxOnt,
        OWLFactory.getOWLAnnotationAssertionAxiom(
            OWLFactory.getOWLAnnotationProperty(
                IRI.create(
                    topIxOnt.getOntologyID().getOntologyIRI().toString() + '#' + "individualName")),
            IRI.create(topIxOnt.getOntologyID().getOntologyIRI().toString() + '#' + houseEntryHash),
            OWLFactory.getOWLLiteral(houseEntryAnnotation)));
    return true;
  }
Пример #5
0
 private void applyAnnotations(
     OWLEntity aEntity,
     Map<OWLEntity, Set<OWLAnnotationAssertionAxiom>> entityAnnotations,
     OWLOntologyManager manager,
     OWLOntology ontology) {
   Set<OWLAnnotationAssertionAxiom> entitySet = entityAnnotations.get(aEntity);
   if (entitySet != null) {
     for (OWLAnnotationAssertionAxiom ann : entitySet) {
       manager.addAxiom(ontology, ann);
     }
   }
 }
 public boolean assertDataPropertyInstance(String ind, String prop, int value) {
   OWLDataProperty dataProp =
       OWLFactory.getOWLDataProperty(
           IRI.create(topIxOnt.getOntologyID().getOntologyIRI().toString() + '#' + prop));
   OWLDataPropertyAssertionAxiom tmpAx =
       OWLFactory.getOWLDataPropertyAssertionAxiom(
           dataProp,
           OWLFactory.getOWLNamedIndividual(
               IRI.create(topIxOnt.getOntologyID().getOntologyIRI().toString() + '#' + ind)),
           OWLFactory.getOWLLiteral(value));
   manager.addAxiom(topIxOnt, tmpAx);
   return true;
 }
 // asserts a hasHouse property instance between a house and its corresponding
 // site
 public boolean assertHasHousePropertyInstance(String houseEntryHash, String siteNameHash) {
   OWLObjectProperty objProp =
       OWLFactory.getOWLObjectProperty(
           IRI.create(topIxOnt.getOntologyID().getOntologyIRI() + "#hasHouse"));
   OWLIndividual houseIndividual =
       OWLFactory.getOWLNamedIndividual(':' + houseEntryHash, topIxPrefixManager);
   OWLIndividual siteIndividual =
       OWLFactory.getOWLNamedIndividual(':' + siteNameHash, topIxPrefixManager);
   manager.addAxiom(
       topIxOnt,
       OWLFactory.getOWLObjectPropertyAssertionAxiom(objProp, siteIndividual, houseIndividual));
   return true;
 }
  @Test
  public void shouldTestNoResultsSubClassAxiom() throws Exception {
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    OWLOntology ontology = manager.createOntology();
    OPPLFactory opplFactory = new OPPLFactory(manager, ontology, null);
    ConstraintSystem constraintSystem = opplFactory.createConstraintSystem();
    Variable<OWLClassExpression> x =
        constraintSystem.createVariable("?x", VariableTypeFactory.getCLASSVariableType(), null);
    OWLDataFactory dataFactory = manager.getOWLDataFactory();
    OWLClass a = dataFactory.getOWLClass(IRI.create("A"));
    OWLClass b = dataFactory.getOWLClass(IRI.create("B"));
    OWLClass c = dataFactory.getOWLClass(IRI.create("C"));
    OWLObjectProperty p = dataFactory.getOWLObjectProperty(IRI.create("p"));
    manager.addAxiom(
        ontology,
        dataFactory.getOWLSubClassOfAxiom(
            dataFactory.getOWLObjectSomeValuesFrom(p, a),
            dataFactory.getOWLObjectSomeValuesFrom(p, b)));
    OWLSubClassOfAxiom axiom =
        dataFactory.getOWLSubClassOfAxiom(
            dataFactory.getOWLObjectSomeValuesFrom(p, dataFactory.getOWLClass(x.getIRI())),
            dataFactory.getOWLObjectSomeValuesFrom(p, c));
    AxiomSolvability axiomSolvability =
        new NoResultsAxiomSolvability(constraintSystem, new AssertedModelQuerySolver(manager));
    SolvabilitySearchNode node =
        axiomSolvability.getSolvabilitySearchNode(axiom, BindingNode.createNewEmptyBindingNode());
    node.accept(
        new SolvabilitySearchNodeVisitor() {
          @Override
          public void visitUnsolvableSearchNode(UnsolvableSearchNode unsolvableSearchNode) {
            fail("Wrong type of solvability node: unsolvable, when expecting no solutions");
          }

          @Override
          public void visitSolvedSearchNode(SolvedSearchNode solvedSearchNode) {
            fail("Wrong type of solvability node: solved, when expecting no solutions");
          }

          @Override
          public void visitNoSolutionSolvableSearchNode(
              NoSolutionSolvableSearchNode noSolutionSolvableSearchNode) {
            // That's fine
          }

          @Override
          public void visitSolvableSearchNode(SolvableSearchNode solvableSearchNode) {
            fail("Wrong type of solvability node: no solution, when expecting no solutions");
          }
        });
  }
 //////////////////////////////
 // PROPERTY ASSERTION METHODS//
 //////////////////////////////
 public boolean assertPropertyInstance(
     String comboBoxObjectPropertyEntry, String room1Hash, String room2Hash) {
   OWLObjectProperty objProp =
       OWLFactory.getOWLObjectProperty(
           IRI.create(propEntryNametoPropEntryIRI.get(comboBoxObjectPropertyEntry)));
   OWLIndividual room1Individual =
       OWLFactory.getOWLNamedIndividual(':' + room1Hash, topIxPrefixManager);
   OWLIndividual room2Individual =
       OWLFactory.getOWLNamedIndividual(':' + room2Hash, topIxPrefixManager);
   manager.addAxiom(
       topIxOnt,
       OWLFactory.getOWLObjectPropertyAssertionAxiom(objProp, room1Individual, room2Individual));
   return true;
 }
 public boolean assertHasRoomPropertyInstance(
     String houseIndividualHash, String roomIndividualHash) {
   OWLObjectProperty tempOWLbjectProperty =
       OWLFactory.getOWLObjectProperty(
           IRI.create(topIxOnt.getOntologyID().getOntologyIRI() + "#hasRoom"));
   OWLIndividual houseIndividual =
       OWLFactory.getOWLNamedIndividual(':' + houseIndividualHash, topIxPrefixManager);
   OWLIndividual roomIndividual =
       OWLFactory.getOWLNamedIndividual(':' + roomIndividualHash, topIxPrefixManager);
   manager.addAxiom(
       topIxOnt,
       OWLFactory.getOWLObjectPropertyAssertionAxiom(
           tempOWLbjectProperty, houseIndividual, roomIndividual));
   return true;
 }
  public boolean assertRoomIndividual(
      String roomName, String roomIndividualHash, String roomIndividualAnnotation) {
    OWLClassExpression tempClassExpression =
        OWLFactory.getOWLClass(
            IRI.create(
                roomToIRI.get(
                    roomName))); // retrieves the Room Class IRI fron the roomToIRI map, using
                                 // roomID as a key.
    OWLIndividual tempIndividual =
        OWLFactory.getOWLNamedIndividual(':' + roomIndividualHash, topIxPrefixManager);

    manager.addAxiom(
        topIxOnt, OWLFactory.getOWLClassAssertionAxiom(tempClassExpression, tempIndividual));
    manager.addAxiom(
        topIxOnt,
        OWLFactory.getOWLAnnotationAssertionAxiom(
            OWLFactory.getOWLAnnotationProperty(
                IRI.create(
                    topIxOnt.getOntologyID().getOntologyIRI().toString() + '#' + "individualName")),
            IRI.create(
                topIxOnt.getOntologyID().getOntologyIRI().toString() + '#' + roomIndividualHash),
            OWLFactory.getOWLLiteral(String.format(roomIndividualAnnotation))));
    return true;
  }
Пример #12
0
  @Test
  public void testBadDataproperty() throws Exception {
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    OWLOntology ontology = manager.createOntology(IRI.create(NS));
    OWLClassExpression restriction =
        factory.getOWLDataSomeValuesFrom(
            P, factory.getOWLDatatype(XSDVocabulary.DURATION.getIRI()));
    OWLAxiom axiom = factory.getOWLSubClassOfAxiom(A, restriction);
    manager.addAxiom(ontology, axiom);
    assertTrue(ontology.containsDataPropertyInSignature(P.getIRI()));
    StringDocumentTarget t = new StringDocumentTarget();
    manager.saveOntology(ontology, new RDFXMLOntologyFormat(), t);
    manager.removeOntology(ontology);
    ontology = manager.loadOntologyFromOntologyDocument(new StringDocumentSource(t.toString()));

    assertTrue(ontology.containsDataPropertyInSignature(P.getIRI()));
  }
Пример #13
0
 protected void addAxiom(OWLAxiom axiom) {
   ontologyManager.addAxiom(ontology, axiom);
   clear = false;
 }
Пример #14
0
  public static void main(String[] args)
      throws OWLOntologyCreationException, IOException, OWLOntologyStorageException {
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    OWLOntology ontology = manager.createOntology(ontologyIRI);
    OWLDataFactory factory = manager.getOWLDataFactory();

    // create basic concepts with their IRIs
    currentPhase = factory.getOWLClass(IRI.create(ontologyIRI + "#CurrentPhase"));
    previousPhase = factory.getOWLObjectProperty(IRI.create(ontologyIRI + "#previousPhase"));
    detectedPhase = factory.getOWLClass(IRI.create(ontologyIRI + "#DetectedPhase"));

    // init the currentPhase-class with the "start"-individual
    OWLNamedIndividual start1 = factory.getOWLNamedIndividual(IRI.create(ontologyIRI + "start"));
    manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(currentPhase, start1));

    // create rule1
    SWRLRule rulePP = buildRule("port_placement", "port", "unknown", "place");
    manager.applyChange(new AddAxiom(ontology, rulePP));

    // create rule2
    SWRLRule ruleMob1 =
        buildRule("mobilisation", "atraumatic_grasper", "gallbladder_fundus", "grasp");
    manager.applyChange(new AddAxiom(ontology, ruleMob1));

    SWRLRule ruleMob2 =
        buildRule("mobilisation", "atraumatic_grasper", "gastrocolic_ligament", "grasp");
    manager.applyChange(new AddAxiom(ontology, ruleMob2));

    SWRLRule ruleDis1 =
        buildRule("dissection", "atraumatic_grasper", "hepatoduodenal_ligament", "grasp");
    manager.applyChange(new AddAxiom(ontology, ruleDis1));

    SWRLRule ruleDis2 =
        buildRule("dissection", "atraumatic_grasper", "hepatoduodenal_ligament", "lift");
    manager.applyChange(new AddAxiom(ontology, ruleDis2));

    SWRLRule ruleDis3 =
        buildRule("dissection", "instrument", "calot_triangle", "instrumental_property");
    manager.applyChange(new AddAxiom(ontology, ruleDis3));

    SWRLRule ruleDis4 =
        buildRule("dissection", "sharp_instrument", "hepatoduodenal_ligament", "cutting_action");
    manager.applyChange(new AddAxiom(ontology, ruleDis4));

    SWRLRule ruleResCA1 =
        buildRule("resection_cystic_artery", "sharp_instrument", "cystic_artery", "cutting_action");
    manager.applyChange(new AddAxiom(ontology, ruleResCA1));

    SWRLRule ruleResCA2 = buildRule("resection_cystic_artery", "clip", "cystic_artery", "clipping");
    manager.applyChange(new AddAxiom(ontology, ruleResCA2));

    SWRLRule ruleResCD1 =
        buildRule("resection_cystic_duct", "sharp_instrument", "cystic_duct", "cutting_action");
    manager.applyChange(new AddAxiom(ontology, ruleResCD1));

    SWRLRule ruleResCD2 = buildRule("resection_cystic_duct", "clip", "cystic_duct", "clipping");
    manager.applyChange(new AddAxiom(ontology, ruleResCD2));

    SWRLRule ruleResG1 =
        buildRule(
            "resection_gallbladder", "sharp_instrument", "gallbladder_serosa", "cutting_action");
    manager.applyChange(new AddAxiom(ontology, ruleResG1));

    SWRLRule ruleResG2 =
        buildRule("resection_gallbladder", "sharp_instrument", "gallbladder_serosa", "dissect");
    manager.applyChange(new AddAxiom(ontology, ruleResG2));

    SWRLRule ruleResG3 =
        buildRule("resection_gallbladder", "sharp_instrument", "gallbladder", "cutting_action");
    manager.applyChange(new AddAxiom(ontology, ruleResG3));

    SWRLRule ruleResG4 =
        buildRule(
            "resection_gallbladder", "sharp_instrument", "gallbladder_liverbed", "cutting_action");
    manager.applyChange(new AddAxiom(ontology, ruleResG4));

    SWRLRule ruleClose1 = buildRule("closure", "specimen_bag", "unknown", "instrumental_property");
    manager.applyChange(new AddAxiom(ontology, ruleClose1));

    SWRLRule ruleClose2 = buildRule("closure", "specimen_bag", "organ", "instrumental_property");
    manager.applyChange(new AddAxiom(ontology, ruleClose2));

    // Strange rules with the instrument "drain". It should be called "drainage" as by the next two
    // rules.

    // SWRLRule ruleDrain1 = buildRule("drain", "drain", "unknown", "putting_action");
    // manager.applyChange(new AddAxiom(ontology, ruleDrain1));

    // SWRLRule ruleDrain2 = buildRule("drain", "drain", "unknown", "instrumental_property");
    // manager.applyChange(new AddAxiom(ontology, ruleDrain2));

    SWRLRule ruleDrainage1 = buildRule("drain", "drainage", "unknown", "instrumental_property");
    manager.applyChange(new AddAxiom(ontology, ruleDrainage1));

    SWRLRule ruleDrainage2 = buildRule("drain", "drainage", "organ", "instrumental_property");
    manager.applyChange(new AddAxiom(ontology, ruleDrainage2));

    // save in RDF/XML format
    File output = new File("D:/DiplArbeit/OurWork/USECASE/RULES/CCE_rules.owl");
    output.createNewFile();
    manager.saveOntology(ontology, IRI.create(output.toURI()));
  }
Пример #15
0
  public void runWithSingleFile() {
    BufferedOutputStream output = null;
    BufferedWriter writer = null;

    try {
      final long startTime = System.currentTimeMillis();

      if (outputFile != null) {
        output = new BufferedOutputStream(new FileOutputStream(outputFile));
      } else {
        output = new BufferedOutputStream(System.out);
      }
      writer = new BufferedWriter(new OutputStreamWriter(output, "UTF-8"));

      OBDAModel obdaModel = loadMappingFile(mappingFile);

      OWLOntology ontology = null;
      OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
      OWLAPI3Materializer materializer = null;

      if (owlFile != null) {
        // Loading the OWL ontology from the file as with normal OWLReasoners
        ontology = manager.loadOntologyFromOntologyDocument((new File(owlFile)));

        if (disableReasoning) {
          /*
           * when reasoning is disabled, we extract only the declaration assertions for the vocabulary
           */
          ontology = extractDeclarations(manager, ontology);
        }

        Ontology onto = OWLAPI3TranslatorUtility.translate(ontology);
        obdaModel.declareAll(onto.getVocabulary());
        materializer = new OWLAPI3Materializer(obdaModel, onto, DO_STREAM_RESULTS);
      } else {
        ontology = manager.createOntology();
        materializer = new OWLAPI3Materializer(obdaModel, DO_STREAM_RESULTS);
      }

      // OBDAModelSynchronizer.declarePredicates(ontology, obdaModel);

      QuestOWLIndividualAxiomIterator iterator = materializer.getIterator();

      while (iterator.hasNext()) manager.addAxiom(ontology, iterator.next());

      OWLOntologyFormat ontologyFormat = getOntologyFormat(format);

      manager.saveOntology(ontology, ontologyFormat, new WriterDocumentTarget(writer));

      System.err.println("NR of TRIPLES: " + materializer.getTriplesCount());
      System.err.println("VOCABULARY SIZE (NR of QUERIES): " + materializer.getVocabularySize());

      materializer.disconnect();
      if (outputFile != null) output.close();

      final long endTime = System.currentTimeMillis();
      final long time = endTime - startTime;
      System.out.println("Elapsed time to materialize: " + time + " {ms}");

    } catch (Exception e) {
      System.out.println("Error materializing ontology:");
      e.printStackTrace();
    }
  }
  public boolean storeSolutions(String siteNameHash) {
    for (OwlSolution tempSolution : solutionsList) {
      // assert Solution individual and assert Site->hasSolution
      OWLClassExpression solutionClassExpression =
          OWLFactory.getOWLClass(":Solution", topIxPrefixManager);
      String tempSolutionID =
          String.format(siteNameHash + "_S_%1$02d", tempSolution.getSolutionID().intValue());
      OWLIndividual tempSolutionIndividual =
          OWLFactory.getOWLNamedIndividual(":" + tempSolutionID, topIxPrefixManager);
      OWLClassAssertionAxiom tempClassAssertionAxiom =
          OWLFactory.getOWLClassAssertionAxiom(solutionClassExpression, tempSolutionIndividual);
      manager.addAxiom(topIxOnt, tempClassAssertionAxiom);

      OWLObjectProperty tempSolutionObjectProperty =
          OWLFactory.getOWLObjectProperty(":hasSolution", topIxPrefixManager);
      OWLIndividual tempSiteIndividual =
          OWLFactory.getOWLNamedIndividual(":" + siteNameHash, topIxPrefixManager);
      OWLObjectPropertyAssertionAxiom tempObjPropAssAxiom =
          OWLFactory.getOWLObjectPropertyAssertionAxiom(
              tempSolutionObjectProperty, tempSiteIndividual, tempSolutionIndividual);
      manager.addAxiom(topIxOnt, tempObjPropAssAxiom);

      // assert SolvedHouse individuals and assert Solution->hasSolvedHouse objProperty. also assert
      // the DATA PROPERTIES for each solvedHouse indvidual
      for (OwlSolvedHouse tempSolvedHouse : tempSolution.getSolvedHouses()) {
        // logger.info("373");
        // logger.info(tempSolution.getSolvedHouses().toString());
        OWLClassExpression solvedHouseClassExpression =
            OWLFactory.getOWLClass(":SolvedHouse", topIxPrefixManager);
        OWLIndividual tempSolvedHouseIndividual =
            OWLFactory.getOWLNamedIndividual(
                ":" + tempSolutionID + "_SH_" + tempSolvedHouse.getSolvedHouseHash(),
                topIxPrefixManager);
        OWLClassAssertionAxiom tempClassAssAx =
            OWLFactory.getOWLClassAssertionAxiom(
                solvedHouseClassExpression, tempSolvedHouseIndividual);
        manager.addAxiom(topIxOnt, tempClassAssAx);

        OWLObjectProperty tempSolvedHouseObjectProperty =
            OWLFactory.getOWLObjectProperty(":hasSolvedHouse", topIxPrefixManager);
        OWLObjectPropertyAssertionAxiom tempHouseObjPropAssAx =
            OWLFactory.getOWLObjectPropertyAssertionAxiom(
                tempSolvedHouseObjectProperty, tempSolutionIndividual, tempSolvedHouseIndividual);
        manager.addAxiom(topIxOnt, tempHouseObjPropAssAx);

        OWLDataProperty tempDataProperty;
        OWLDataPropertyAssertionAxiom tempDataPropertyAssertionAxiom;

        tempDataProperty = OWLFactory.getOWLDataProperty(":hasLiteral", topIxPrefixManager);
        tempDataPropertyAssertionAxiom =
            OWLFactory.getOWLDataPropertyAssertionAxiom(
                tempDataProperty,
                tempSolvedHouseIndividual,
                tempSolvedHouse.getSolvedHouseLiteral());
        manager.addAxiom(topIxOnt, tempDataPropertyAssertionAxiom);

        tempDataProperty = OWLFactory.getOWLDataProperty(":hasL", topIxPrefixManager);
        tempDataPropertyAssertionAxiom =
            OWLFactory.getOWLDataPropertyAssertionAxiom(
                tempDataProperty,
                tempSolvedHouseIndividual,
                tempSolvedHouse.getSolvedHouseLength());
        manager.addAxiom(topIxOnt, tempDataPropertyAssertionAxiom);

        tempDataProperty = OWLFactory.getOWLDataProperty(":hasW", topIxPrefixManager);
        tempDataPropertyAssertionAxiom =
            OWLFactory.getOWLDataPropertyAssertionAxiom(
                tempDataProperty, tempSolvedHouseIndividual, tempSolvedHouse.getSolvedHouseWidth());
        manager.addAxiom(topIxOnt, tempDataPropertyAssertionAxiom);

        tempDataProperty = OWLFactory.getOWLDataProperty(":hasX", topIxPrefixManager);
        tempDataPropertyAssertionAxiom =
            OWLFactory.getOWLDataPropertyAssertionAxiom(
                tempDataProperty, tempSolvedHouseIndividual, tempSolvedHouse.getSolvedHouseX());
        manager.addAxiom(topIxOnt, tempDataPropertyAssertionAxiom);

        tempDataProperty = OWLFactory.getOWLDataProperty(":hasY", topIxPrefixManager);
        tempDataPropertyAssertionAxiom =
            OWLFactory.getOWLDataPropertyAssertionAxiom(
                tempDataProperty, tempSolvedHouseIndividual, tempSolvedHouse.getSolvedHouseY());
        manager.addAxiom(topIxOnt, tempDataPropertyAssertionAxiom);
        // logger.info("asserts the house");
        // logger.info(tempSolvedHouse.getSolvedHouseLiteral());
      }

      // assert SolvedRoom individuals and assert Solution->hasSolvedRoom objProperty. also assert
      // the DATA PROPERTIES for each solvedRoom indvidual
      for (OwlSolvedRoom tempSolvedRoom : tempSolution.getSolvedRooms()) {
        OWLClassExpression solvedRoomClassExpression =
            OWLFactory.getOWLClass(":SolvedRoom", topIxPrefixManager);
        OWLIndividual tempSolvedRoomIndividual =
            OWLFactory.getOWLNamedIndividual(
                ":" + tempSolutionID + "_SR_" + tempSolvedRoom.getSolvedRoomHash(),
                topIxPrefixManager);
        OWLClassAssertionAxiom tempClassAssAx =
            OWLFactory.getOWLClassAssertionAxiom(
                solvedRoomClassExpression, tempSolvedRoomIndividual);
        manager.addAxiom(topIxOnt, tempClassAssAx);

        OWLObjectProperty tempSolvedRoomObjectProperty =
            OWLFactory.getOWLObjectProperty(":hasSolvedRoom", topIxPrefixManager);
        OWLObjectPropertyAssertionAxiom tempRoomObjPropAssAx =
            OWLFactory.getOWLObjectPropertyAssertionAxiom(
                tempSolvedRoomObjectProperty, tempSolutionIndividual, tempSolvedRoomIndividual);
        manager.addAxiom(topIxOnt, tempRoomObjPropAssAx);

        OWLDataProperty tempDataProperty;
        OWLDataPropertyAssertionAxiom tempDataPropertyAssertionAxiom;

        tempDataProperty = OWLFactory.getOWLDataProperty(":hasLiteral", topIxPrefixManager);
        tempDataPropertyAssertionAxiom =
            OWLFactory.getOWLDataPropertyAssertionAxiom(
                tempDataProperty, tempSolvedRoomIndividual, tempSolvedRoom.getSolvedRoomLiteral());
        manager.addAxiom(topIxOnt, tempDataPropertyAssertionAxiom);

        tempDataProperty = OWLFactory.getOWLDataProperty(":hasL", topIxPrefixManager);
        tempDataPropertyAssertionAxiom =
            OWLFactory.getOWLDataPropertyAssertionAxiom(
                tempDataProperty, tempSolvedRoomIndividual, tempSolvedRoom.getSolvedRoomLength());
        manager.addAxiom(topIxOnt, tempDataPropertyAssertionAxiom);

        tempDataProperty = OWLFactory.getOWLDataProperty(":hasW", topIxPrefixManager);
        tempDataPropertyAssertionAxiom =
            OWLFactory.getOWLDataPropertyAssertionAxiom(
                tempDataProperty, tempSolvedRoomIndividual, tempSolvedRoom.getSolvedRoomWidth());
        manager.addAxiom(topIxOnt, tempDataPropertyAssertionAxiom);

        tempDataProperty = OWLFactory.getOWLDataProperty(":hasH", topIxPrefixManager);
        tempDataPropertyAssertionAxiom =
            OWLFactory.getOWLDataPropertyAssertionAxiom(
                tempDataProperty, tempSolvedRoomIndividual, tempSolvedRoom.getSolvedRoomHeight());
        manager.addAxiom(topIxOnt, tempDataPropertyAssertionAxiom);

        tempDataProperty = OWLFactory.getOWLDataProperty(":hasX", topIxPrefixManager);
        tempDataPropertyAssertionAxiom =
            OWLFactory.getOWLDataPropertyAssertionAxiom(
                tempDataProperty, tempSolvedRoomIndividual, tempSolvedRoom.getSolvedRoomX());
        manager.addAxiom(topIxOnt, tempDataPropertyAssertionAxiom);

        tempDataProperty = OWLFactory.getOWLDataProperty(":hasY", topIxPrefixManager);
        tempDataPropertyAssertionAxiom =
            OWLFactory.getOWLDataPropertyAssertionAxiom(
                tempDataProperty, tempSolvedRoomIndividual, tempSolvedRoom.getSolvedRoomY());
        manager.addAxiom(topIxOnt, tempDataPropertyAssertionAxiom);

        tempDataProperty = OWLFactory.getOWLDataProperty(":hasZ", topIxPrefixManager);
        tempDataPropertyAssertionAxiom =
            OWLFactory.getOWLDataPropertyAssertionAxiom(
                tempDataProperty, tempSolvedRoomIndividual, tempSolvedRoom.getSolvedRoomZ());
        manager.addAxiom(topIxOnt, tempDataPropertyAssertionAxiom);
      }
    }
    return true;
  }