Package org.semanticweb.owlapi.api.test.imports

Source Code of org.semanticweb.owlapi.api.test.imports.AnonymousOntologyWithImportsTestCase

package org.semanticweb.owlapi.api.test.imports;

import static org.junit.Assert.*;

import javax.annotation.Nonnull;

import org.junit.Test;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.io.StringDocumentSource;
import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.owlapi.model.OWLOntologyCreationException;
import org.semanticweb.owlapi.model.OWLOntologyManager;

@SuppressWarnings("javadoc")
public class AnonymousOntologyWithImportsTestCase {

    @Nonnull
    String input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
            + "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:owl =\"http://www.w3.org/2002/07/owl#\">\n"
            + "    <owl:Ontology><owl:imports rdf:resource=\"urn:test\"/></owl:Ontology></rdf:RDF>";

    @Test
    public void shouldNotLoadWrong() throws OWLOntologyCreationException {
        OWLOntologyManager m = OWLManager.createOWLOntologyManager();
        m.createOntology(IRI.create("urn:test"));
        StringDocumentSource documentSource = new StringDocumentSource(input);
        OWLOntology o = m.loadOntologyFromOntologyDocument(documentSource);
        assertTrue(o.getOntologyID().toString(), o.isAnonymous());
        assertFalse(o.getOntologyID().getDefaultDocumentIRI().isPresent());
    }
}
TOP

Related Classes of org.semanticweb.owlapi.api.test.imports.AnonymousOntologyWithImportsTestCase

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.