Package owlOntologies

Examples of owlOntologies.MyOwlOntologyManager


    //first, test that it wrote SOMETHING to the ontology location
    File f = new File(ontologyLocation);
    assertTrue(f.exists());
   
    //second, load it up and check that it contains the following classes
    MyOwlOntologyManager myOwl = new MyOwlOntologyManager();
    OWLOntologyManager manager = myOwl.loadOntologyFromFile(ontologyLocation);
    OWLClass foal = myOwl.getClassFromName(manager, "foal")//note that if any of these 4 fail, we have a problem
    OWLClass poni = myOwl.getClassFromName(manager, "poni")
    OWLClass hobbi = myOwl.getClassFromName(manager, "hobbi");
    OWLClass colt = myOwl.getClassFromName(manager, "colt");
   
    assertNotNull(foal); //these have failed if they are null
    assertNotNull(poni);
    assertNotNull(hobbi);
    assertNotNull(colt);
   
   
    OWLOntology ontology = manager.getOntology(myOwl.getCurrentOntologyID());
   
    //third, check that the following subclasses are here (or not)
    Set<OWLClassExpression> superClasses = foal.getSuperClasses(ontology);
    assertTrue(superClasses.contains(hobbi));
    assertTrue(superClasses.contains(poni));
View Full Code Here


    String ontologyLocation = "/home/nicholas/research/Experiments/DataONEjava/outputTest.owl";
    cot.buildOntologyFromScratch("/home/nicholas/research/Experiments/DataONEjava/unitTestData/testForCreateOntologyFromThesaurus.txt", ontologyLocation);
   
    cot.addToOntology(ontologyLocation, "genoa");
   
    MyOwlOntologyManager myOwl = new MyOwlOntologyManager();
    OWLOntologyManager manager = myOwl.loadOntologyFromFile(ontologyLocation);
   
    OWLOntology ontology = manager.getOntology(myOwl.getCurrentOntologyID());
   
    //should add class genoa,   equivalence -> genova
    OWLClass genoa = myOwl.getClassFromName(manager, "genoa");
    OWLClass genova = myOwl.getClassFromName(manager, "genova");
    assertNotNull(genoa);
    assertNotNull(genova);
   
    Set<OWLClassExpression> equivalenceClassesForGenoa = genoa.getEquivalentClasses(ontology);
   
View Full Code Here

    ontology1Path = "/home/nicholas/research/Experiments/DataONEjava/unitTestData/ontologyForCoverageAnalyzerTest1.owl";
    ontology2Path = "/home/nicholas/research/Experiments/DataONEjava/unitTestData/ontologyForCoverageAnalyzerTest2.owl";
   
   
    //corpus ontology1
    corpusOwl1 = new MyOwlOntologyManager();
    corpusManager1 = corpusOwl1.loadOntologyFromFile(corpus1Path);
    corpusOntology1 = corpusManager1.getOntology(corpusOwl1.getCurrentOntologyID());
   
    //corpus ontology2
    corpusOwl2 = new MyOwlOntologyManager();
    corpusManager2 = corpusOwl2.loadOntologyFromFile(corpus2Path);
    corpusOntology2 = corpusManager2.getOntology(corpusOwl2.getCurrentOntologyID());
   
       
    //test ontology1
    testOwl1 = new MyOwlOntologyManager();
    testManager1 = testOwl1.loadOntologyFromFile(ontology1Path);
    testOntology1 = testManager1.getOntology(testOwl1.getCurrentOntologyID());
   
    //test ontology2
    testOwl2 = new MyOwlOntologyManager();
    testManager2 = testOwl2.loadOntologyFromFile(ontology2Path);
    testOntology2 = testManager2.getOntology(testOwl2.getCurrentOntologyID());
  }
View Full Code Here

TOP

Related Classes of owlOntologies.MyOwlOntologyManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.