Examples of OntologyManager


Examples of org.herakles.ml.selection.trainingData.OntologyManager

    ontoFolder = new File(FileLocator.ONTOLOGY_FOLDER);
    ontoNames = ontoFolder.list();
   
    queryMap = new QueryMap();
   
    ontologyManager = new OntologyManager();
   
    batch();
  }
View Full Code Here

Examples of org.herakles.ml.selection.trainingData.OntologyManager

  public static void tearDownAfterClass() throws Exception {
  }

  @Before
  public void setUp() throws Exception {
    OWLOntology ontology = (new OntologyManager()).getOntology(
        IRI.create(TestParameters.ontologyIri));
    OWLOntoElementExtractor ontoExtractor = new OWLOntoElementExtractor(ontology);
    generator = new OWLClassExpressionGenerator(ontoExtractor);
  }
View Full Code Here

Examples of org.herakles.ml.selection.trainingData.OntologyManager

    }
  }
 
  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    OntologyManager ontoManager = new OntologyManager();
    QueryGenerator generator = new QueryGenerator(ontoManager.getOntology(
        IRI.create(new File("external" + File.separator + "ontology"
            + File.separator + "wine.owl"))));
    queryList = generator.generateQueries();
  }
View Full Code Here

Examples of ru.spbu.math.ontologycomparison.zhukova.logic.builder.loader.impl.OntologyManager

* @author Anna Zhukova
*/
public class TestGraphLoader extends TestCase {

    public void testItBuildsAnything() throws FileNotFoundException, /*OWLTransformationException,*/ OWLReasonerException {
        new OntologyManager(new FileInputStream(OntologyTestConstants.ONTOPL_URL)).load();
    }
View Full Code Here

Examples of ru.spbu.math.ontologycomparison.zhukova.logic.builder.loader.impl.OntologyManager

    public void testItBuildsAnything() throws FileNotFoundException, /*OWLTransformationException,*/ OWLReasonerException {
        new OntologyManager(new FileInputStream(OntologyTestConstants.ONTOPL_URL)).load();
    }

    public void testConceptsNumber() throws FileNotFoundException, /*OWLTransformationException,*/ OWLReasonerException {
        IOntologyGraph graph = new OntologyManager(new FileInputStream(OntologyTestConstants.ONTOPL_URL)).load();
        assertEquals(OntologyTestConstants.ONTO_PL_CONCEPTS_COUNT, graph.getConcepts().size());
    }
View Full Code Here

Examples of ru.spbu.math.ontologycomparison.zhukova.logic.builder.loader.impl.OntologyManager

        IOntologyGraph graph = new OntologyManager(new FileInputStream(OntologyTestConstants.ONTOPL_URL)).load();
        assertEquals(OntologyTestConstants.ONTO_PL_CONCEPTS_COUNT, graph.getConcepts().size());
    }

    public void testConceptsContent() throws FileNotFoundException, /*OWLTransformationException,*/ OWLReasonerException {
        IOntologyGraph graph = new OntologyManager(new FileInputStream(OntologyTestConstants.ONTOPL_URL)).load();
        for (IOntologyConcept concept : graph.getConcepts()) {
            if (concept.getLabelCollection().contains(OntologyTestConstants.JAVA)) {
                return;
            }
        }
View Full Code Here

Examples of ru.spbu.math.ontologycomparison.zhukova.logic.builder.loader.impl.OntologyManager

        }
        fail();
    }

    public void testChildParentRelation() throws FileNotFoundException, /*OWLTransformationException,*/ OWLReasonerException {
        IOntologyGraph graph = new OntologyManager(new FileInputStream(OntologyTestConstants.ONTOPL_URL)).load();
        for (IOntologyConcept concept : graph.getConcepts()) {
            if (concept.getLabelCollection().contains(OntologyTestConstants.JAVA)) {
                for (IOntologyConcept parent : concept.getParents()) {
                    if (parent.getLabelCollection().contains(OntologyTestConstants.PROGRAMMING_LANGUAGE)) {
                        return;
View Full Code Here

Examples of ru.spbu.math.ontologycomparison.zhukova.logic.builder.loader.impl.OntologyManager

    private IOntologyGraph ontoPLFull;
    private IOntologyGraph ontoJavaCSharpGraph;
    private IOntologyGraph ontoDrinkGraph;

    public void setUp() throws FileNotFoundException, /*OWLTransformationException,*/ OWLReasonerException {
        this.ontoPLGraph = new OntologyManager(new FileInputStream(OntologyTestConstants.ONTOPL_URL)).load();
        this.ontoDrinkGraph = new OntologyManager(new FileInputStream(OntologyTestConstants.ONTODRINK_URL)).load();
        this.ontoPLFull = new OntologyManager(new FileInputStream(OntologyTestConstants.ONTOPLFULL_URL)).load();
        this.ontoJavaCSharpGraph = new OntologyManager(new FileInputStream(OntologyTestConstants.ONTOJAVASHARP_URL)).load();
        this.ontoJavaGraph = new OntologyManager(new FileInputStream(OntologyTestConstants.ONTOJAVA_URL)).load();
    }
View Full Code Here

Examples of ru.spbu.math.ontologycomparison.zhukova.logic.builder.loader.impl.OntologyManager

*/
public class TestOwl extends TestCase {
    private IOntologyManager loader;

    public void setUp() throws FileNotFoundException {
        this.loader = new OntologyManager(new FileInputStream(OntologyTestConstants.ONTOPL_URL));
    }
View Full Code Here

Examples of ru.spbu.math.ontologycomparison.zhukova.logic.builder.loader.impl.OntologyManager

    }

    private void buildGraph(final File firstFile, final File secondFile) throws IOException {
        try {
            this.main.log(String.format("Loading %s...", firstFile.getName()));
            final OntologyManager firstOntologyManager = new OntologyManager(firstFile, this.main);
            final IOntologyGraph[] firstOntologyGraph = {null};
            Thread firstGraphThread = new Thread(new Runnable() {
                public void run() {
                    try {
                        firstOntologyGraph[0] = firstOntologyManager.load(new ClassAnnotationVisitor(), new PropertyVisitor());
                    } catch (Throwable e1) {
                        handleException(e1);
                    }
                }
            });
            firstGraphThread.start();
            final OntologyManager secondOntologyManager = new OntologyManager(secondFile, this.main);
            Open.this.main.log(String.format("Loading %s...", secondFile.getName()));
            IOntologyGraph secondOntologyGraph = secondOntologyManager.load(new ClassAnnotationVisitor(), new PropertyVisitor());
            try {
                firstGraphThread.join();
            } catch (InterruptedException e) {
                // ignore;
            }
            if (firstOntologyGraph[0] == null) {
                return;
            }
            this.main.log("Merging ontologies...");
            IOntologyComparator ontologyComparator = new OntologyComparator(firstOntologyGraph[0], secondOntologyGraph, this.main);
            IOntologyGraph ontologyGraph = ontologyComparator.mapOntologies().getFirst();
            int similarity = (int) (ontologyComparator.getSimilarity() * 100);
            final IGraphModelBuilder myGraphModelBuilder =
                    new GraphModelBuilder(firstOntologyGraph[0], secondOntologyGraph, ontologyGraph, similarity, this.main);
            this.main.log("Visualising ontologies...");
            GraphModel graphModel = myGraphModelBuilder.buildGraphModel(main.getGraphPane(), main.areUnmappedConceptsVisible(), main.areUnmappedConceptsWithSynsetsVisible());
            OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
            OWLOntology result = OntologyManager.saveOntologies(manager, firstOntologyManager.getOntology(), secondOntologyManager.getOntology());
            onGraphModelBuilt(manager, result);
            this.main.setGraphModel(graphModel);
            ITreeBuilder firstTreeBuilder = new TreeBuilder(firstFile.getName(), firstOntologyGraph[0].getRoots());
            ITreeBuilder secondTreeBuilder = new TreeBuilder(secondFile.getName(), secondOntologyGraph.getRoots());
            this.main.setTrees(firstTreeBuilder.buildTree(main.areUnmappedConceptsVisible(), main.areUnmappedConceptsWithSynsetsVisible()), secondTreeBuilder.buildTree(main.areUnmappedConceptsVisible(), main.areUnmappedConceptsWithSynsetsVisible()));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.