Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLOntologyID


    @Test
    public void testMultipleVersionLoadsNoOntologyVersionIRIFirstTime()
            throws Exception {
        // given
        OWLOntologyDocumentSource documentSource = getDocumentSource();
        OWLOntologyID initialUniqueOWLOntologyID = new OWLOntologyID(
                Optional.of(CREATE0139), Optional.<IRI> absent());
        OWLOntologyDocumentSource secondDocumentSource = getDocumentSource();
        OWLOntologyID secondUniqueOWLOntologyID = new OWLOntologyID(
                Optional.of(CREATE0139), Optional.of(CREATEV2));
        // when
        OWLOntology initialOntology = m
                .createOntology(initialUniqueOWLOntologyID);
        parseOnto(documentSource, initialOntology);
View Full Code Here


    @Test
    public void testSingleVersionLoadChangeIRI() throws Exception {
        // given
        OWLOntologyDocumentSource secondDocumentSource = getDocumentSource();
        OWLOntologyID secondUniqueOWLOntologyID = new OWLOntologyID(
                Optional.of(CREATE0139), Optional.of(CREATEV2));
        // when
        OWLOntology secondOntology = m
                .createOntology(secondUniqueOWLOntologyID);
        parseOnto(secondDocumentSource, secondOntology);
View Full Code Here

    @Test
    public void testSingleVersionLoadNoChange() throws Exception {
        // given
        OWLOntologyDocumentSource documentSource = getDocumentSource();
        OWLOntologyID initialUniqueOWLOntologyID = new OWLOntologyID(
                Optional.of(CREATE0139), Optional.of(CREATEV1));
        // when
        OWLOntology initialOntology = m
                .createOntology(initialUniqueOWLOntologyID);
        parseOnto(documentSource, initialOntology);
View Full Code Here

    @Test
    public void testOntologyID() {
        IRI iriA = IRI("http://www.another.com/ont");
        IRI iriB = IRI("http://www.another.com/ont/version");
        OWLOntologyID ontIDBoth = new OWLOntologyID(of(iriA), of(iriB));
        OWLOntologyID ontIDBoth2 = new OWLOntologyID(of(iriA), of(iriB));
        assertEquals(ontIDBoth, ontIDBoth2);
        OWLOntologyID ontIDURIOnly = new OWLOntologyID(of(iriA), absent());
        assertFalse(ontIDBoth.equals(ontIDURIOnly));
        OWLOntologyID ontIDNoneA = new OWLOntologyID();
        OWLOntologyID ontIDNoneB = new OWLOntologyID();
        assertFalse(ontIDNoneA.equals(ontIDNoneB));
    }
View Full Code Here

        IRI iri = IRI("http://www.another.com/ont");
        OWLOntology ont = m.createOntology(iri);
        assertEquals(ont.getOntologyID().getOntologyIRI().get(), iri);
        assertTrue(m.contains(iri));
        assertTrue(m.getOntologies().contains(ont));
        OWLOntologyID ontID = new OWLOntologyID(of(iri), absent());
        assertEquals(ont.getOntologyID(), ontID);
    }
View Full Code Here

    @Test
    public void testSetOntologyURI() throws OWLOntologyCreationException {
        IRI iri = IRI("http://www.another.com/ont");
        OWLOntology ont = m.createOntology(iri);
        IRI newIRI = IRI("http://www.another.com/newont");
        SetOntologyID sou = new SetOntologyID(ont, new OWLOntologyID(
                of(newIRI), absent()));
        m.applyChange(sou);
        assertFalse(m.contains(iri));
        assertTrue(m.contains(newIRI));
        assertEquals(ont.getOntologyID().getOntologyIRI().get(), newIRI);
View Full Code Here

    @Test
    public void testVersionURI() throws OWLOntologyCreationException {
        IRI ontIRI = IRI("http://www.another.com/ont");
        IRI verIRI = IRI("http://www.another.com/ont/versions/1.0.0");
        OWLOntology ont = m.createOntology(new OWLOntologyID(of(ontIRI),
                of(verIRI)));
        assertEquals(ont.getOntologyID().getOntologyIRI().get(), ontIRI);
        assertEquals(ont.getOntologyID().getVersionIRI().get(), verIRI);
    }
View Full Code Here

    @Test
    public void testNullVersionURI() throws OWLOntologyCreationException {
        IRI ontIRI = IRI("http://www.another.com/ont");
        IRI verIRI = null;
        OWLOntology ont = m.createOntology(new OWLOntologyID(of(ontIRI),
                of(verIRI)));
        assertEquals(ont.getOntologyID().getOntologyIRI().get(), ontIRI);
        assertFalse(ont.getOntologyID().getVersionIRI().isPresent());
    }
View Full Code Here

    @Test
    public void shouldCheckContents() throws OWLOntologyCreationException {
        OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
        manager.createOntology(IRI.create("http://www.test.com/123"));
        OWLOntologyID anonymousId = OWLManager.createOWLOntologyManager()
                .createOntology().getOntologyID();
        manager.contains(anonymousId);
    }
View Full Code Here

    @Test
    public void shouldNotFailOnAnonymousOntologySearch()
            throws OWLOntologyCreationException {
        OWLOntologyManager man = OWLManager.createOWLOntologyManager();
        man.createOntology(new OWLOntologyID());
        assertNull(man.getOntology(new OWLOntologyID()));
    }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.model.OWLOntologyID

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.