Package org.semanticweb.owlapi.apibinding.OWLFunctionalSyntaxFactory

Examples of org.semanticweb.owlapi.apibinding.OWLFunctionalSyntaxFactory.IRI


        assertEquals(ont.getOntologyID().getVersionIRI().get(), verIRI);
    }

    @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


    private final String uriBase = "http://www.semanticweb.org/owlapi/test";

    @Nonnull
    public OWLOntology getOWLOntology(String name) {
        try {
            IRI iri = IRI(uriBase + '/' + name);
            if (m.contains(iri)) {
                return m.getOntology(iri);
            } else {
                return m.createOntology(iri);
            }
View Full Code Here

@SuppressWarnings({ "javadoc", "null" })
public class ChangeOntologyURITestCase extends TestBase {

    @Test
    public void testChangeURI() throws OWLOntologyCreationException {
        IRI oldIRI = IRI("http://www.semanticweb.org/ontologies/ontA");
        IRI newIRI = IRI("http://www.semanticweb.org/ontologies/ontB");
        OWLOntology ont = m.createOntology(oldIRI);
        OWLOntology importingOnt = m
                .createOntology(IRI("http://www.semanticweb.org/ontologies/ontC"));
        m.applyChange(new AddImport(importingOnt, m.getOWLDataFactory()
                .getOWLImportsDeclaration(
View Full Code Here

@SuppressWarnings("javadoc")
public class ImportsClosureTestCase extends TestBase {

    @Test
    public void testImportsClosureUpdate() throws OWLOntologyCreationException {
        IRI aIRI = IRI("http://a.com");
        OWLOntology ontA = m.createOntology(aIRI);
        IRI bIRI = IRI("http://b.com");
        OWLOntology ontB = m.createOntology(bIRI);
        m.applyChange(new AddImport(ontA, df.getOWLImportsDeclaration(bIRI)));
        assertEquals(2, m.getImportsClosure(ontA).size());
        m.removeOntology(ontB);
        assertEquals(1, m.getImportsClosure(ontA).size());
View Full Code Here

    @Test
    public void testManualImports() throws OWLOntologyCreationException {
        OWLOntology baseOnt = m
                .createOntology(IRI("http://semanticweb.org/ontologies/base"));
        IRI importedIRI = IRI("http://semanticweb.org/ontologies/imported");
        OWLOntology importedOnt = m.createOntology(importedIRI);
        Set<OWLOntology> preImportsClosureCache = new HashSet<>(
                m.getImportsClosure(baseOnt));
        assertTrue(preImportsClosureCache.contains(baseOnt));
        assertFalse(preImportsClosureCache.contains(importedOnt));
View Full Code Here

        @Nonnull
        File f = folder.newFile("a.owl");
        createOntologyFile(IRI("http://a.com"), f);
        // have to load an ontology for it to get a document IRI
        OWLOntology a = m.loadOntologyFromOntologyDocument(f);
        IRI locA = m.getOntologyDocumentIRI(a);
        IRI bIRI = IRI("http://b.com");
        OWLOntology b = m.createOntology(bIRI);
        // import from the document location of a.owl (rather than the
        // ontology IRI)
        m.applyChange(new AddImport(b, df.getOWLImportsDeclaration(locA)));
        assertEquals(1, b.getImportsDeclarations().size());
View Full Code Here

    }

    @Test
    public void testPrefixIRIExpansion() {
        PrefixManager pm = new DefaultPrefixManager();
        IRI iri = pm.getIRI("rdfs:comment");
        assertEquals(iri, OWLRDFVocabulary.RDFS_COMMENT.getIRI());
    }
View Full Code Here

        pm.setDefaultPrefix(defaultPrefix);
        assertTrue(pm.containsPrefixMapping(":"));
        assertNotNull(pm.getDefaultPrefix());
        assertEquals(pm.getDefaultPrefix(), pm.getPrefix(":"));
        String expansion = defaultPrefix + 'A';
        IRI iri = pm.getIRI(":A");
        assertEquals(iri.toString(), expansion);
    }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.apibinding.OWLFunctionalSyntaxFactory.IRI

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.