<commit_before>package org.phenoscape.owl

import scala.collection.JavaConversions._

import utest._
import org.semanticweb.owlapi.apibinding.OWLManager

import org.phenoscape.scowl._


object NegationHierarchyAsserterTest extends TestSuite{

  val tests = Tests{

  val base = "http://owl.phenoscape.org/NegationHierarchyAsserterTest"
  val manager = OWLManager.createOWLOntologyManager()
  val input = getClass().getClassLoader().getResourceAsStream("NegationHierarchyAsserterTest.ofn")
  val ontology = manager.loadOntologyFromOntologyDocument(input)
  input.close()

  'beforeAxioms - {
    'test1 - {
      assert(ontology.containsAxiom(Class(s"$base#B") SubClassOf Class(s"$base#A")))
    }

    'test2 - {
      assert(!(ontology.containsAxiom(Class(s"$base#NotA") SubClassOf Class(s"$base#NotB"))))
    }

    'test3 - {
      assert(ontology.containsAxiom(Class(s"$base#C") SubClassOf Class(s"$base#B")))
    }

    'test4 - {
      assert(!(ontology.containsAxiom(Class(s"$base#NotB") SubClassOf Class(s"$base#NotC"))))
    }

    'test5 - {
      assert(ontology.containsAxiom(Class(s"$base#B") EquivalentTo Class(s"$base#D")))
    }

    'test6 - {
      assert(!(ontology.containsAxiom(Class(s"$base#NotB") EquivalentTo Class(s"$base#NotD"))))
    }
  }

   manager.addAxioms(ontology, NegationHierarchyAsserter.assertNegationHierarchy(ontology.getAxioms().toSet))


  'afterAxioms - {

    'test7 - {
      assert(ontology.containsAxiom(Class(s"$base#NotA") SubClassOf Class(s"$base#NotB")))
    }

    'test8 - {
      assert(ontology.containsAxiom(Class(s"$base#NotB") SubClassOf Class(s"$base#NotC")))
    }

    'test9 - {
      assert(ontology.containsAxiom(Class(s"$base#NotB") EquivalentTo Class(s"$base#NotD")))
    }
  }




}

//  @Test
//  def testHierarchy() {
//    val manager = OWLManager.createOWLOntologyManager()
//    val input = getClass().getClassLoader().getResourceAsStream("NegationHierarchyAsserterTest.ofn")
//    val ontology = manager.loadOntologyFromOntologyDocument(input)
//    input.close()
//    Assert.assertTrue(ontology.containsAxiom(Class(s"$base#B") SubClassOf Class(s"$base#A")))
//    Assert.assertFalse(ontology.containsAxiom(Class(s"$base#NotA") SubClassOf Class(s"$base#NotB")))
//    Assert.assertTrue(ontology.containsAxiom(Class(s"$base#C") SubClassOf Class(s"$base#B")))
//    Assert.assertFalse(ontology.containsAxiom(Class(s"$base#NotB") SubClassOf Class(s"$base#NotC")))
//    Assert.assertTrue(ontology.containsAxiom(Class(s"$base#B") EquivalentTo Class(s"$base#D")))
//    Assert.assertFalse(ontology.containsAxiom(Class(s"$base#NotB") EquivalentTo Class(s"$base#NotD")))
//    manager.addAxioms(ontology, NegationHierarchyAsserter.assertNegationHierarchy(ontology.getAxioms().toSet))
//    Assert.assertTrue(ontology.containsAxiom(Class(s"$base#NotA") SubClassOf Class(s"$base#NotB")))
//    Assert.assertTrue(ontology.containsAxiom(Class(s"$base#NotB") SubClassOf Class(s"$base#NotC")))
//    Assert.assertTrue(ontology.containsAxiom(Class(s"$base#NotB") EquivalentTo Class(s"$base#NotD")))
//  }

}<commit_msg>Formatting and cleaup<commit_after>package org.phenoscape.owl

import scala.collection.JavaConversions._

import utest._
import org.semanticweb.owlapi.apibinding.OWLManager

import org.phenoscape.scowl._


object NegationHierarchyAsserterTest extends TestSuite {

  val tests = Tests {

    val base = "http://owl.phenoscape.org/NegationHierarchyAsserterTest"
    val manager = OWLManager.createOWLOntologyManager()
    val input = getClass().getClassLoader().getResourceAsStream("NegationHierarchyAsserterTest.ofn")
    val ontology = manager.loadOntologyFromOntologyDocument(input)
    input.close()

    'beforeAxioms - {
      'test1 - {
        assert(ontology.containsAxiom(Class(s"$base#B") SubClassOf Class(s"$base#A")))
      }

      'test2 - {
        assert(!(ontology.containsAxiom(Class(s"$base#NotA") SubClassOf Class(s"$base#NotB"))))
      }

      'test3 - {
        assert(ontology.containsAxiom(Class(s"$base#C") SubClassOf Class(s"$base#B")))
      }

      'test4 - {
        assert(!(ontology.containsAxiom(Class(s"$base#NotB") SubClassOf Class(s"$base#NotC"))))
      }

      'test5 - {
        assert(ontology.containsAxiom(Class(s"$base#B") EquivalentTo Class(s"$base#D")))
      }

      'test6 - {
        assert(!(ontology.containsAxiom(Class(s"$base#NotB") EquivalentTo Class(s"$base#NotD"))))
      }
    }

    manager.addAxioms(ontology, NegationHierarchyAsserter.assertNegationHierarchy(ontology.getAxioms().toSet))


    'afterAxioms - {

      'test7 - {
        assert(ontology.containsAxiom(Class(s"$base#NotA") SubClassOf Class(s"$base#NotB")))
      }

      'test8 - {
        assert(ontology.containsAxiom(Class(s"$base#NotB") SubClassOf Class(s"$base#NotC")))
      }

      'test9 - {
        assert(ontology.containsAxiom(Class(s"$base#NotB") EquivalentTo Class(s"$base#NotD")))
      }
    }
  }
}
{'fraction_non_alphanumeric': 0.15742433475523054, 'fraction_numerical': 0.003656307129798903, 'mean_word_length': 4.428886438809261, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '534137', 'n_tokens_mistral': 1866, 'n_tokens_neox': 1823, 'n_words': 184}