private TcProvider tcp;
@Test
public void canRetrieveOntologyImported() throws Exception {
String pcomics = "http://stanbol.apache.org/ontologies/pcomics/";
OWLOntologyID foaf = new OWLOntologyID(IRI.create("http://xmlns.com/foaf/0.1/")), all = new OWLOntologyID(
IRI.create(pcomics + "characters_all.owl")), main = new OWLOntologyID(
IRI.create(pcomics + "maincharacters.owl")), minor = new OWLOntologyID(
IRI.create(pcomics + "minorcharacters.owl"));
OWLOntology oAll, oMain, oMinor, oFoaf;
final int total = 4;
// Load the Peanuts characters_all ontology (has 2 import levels)
InputStream data = getClass().getResourceAsStream("/ontologies/characters_all.owl");
OWLOntologyID key = ontologyProvider.loadInStore(data, SupportedFormat.RDF_XML, false);
assertNotNull(key);
assertFalse(key.isAnonymous());
/*
* characters_all, main, minor + mockfoaf (note: imports are available only because the xml:base is
* set to be the same as the import target)
*/
assertEquals(total, ontologyProvider.listPrimaryKeys().size());
// Check that each imported ontology is stored
oAll = ontologyProvider.getStoredOntology(all, OWLOntology.class, false);
OWLOntologyID id = oAll.getOntologyID();
assertNotNull(id);
assertEquals(all, id);
oMain = ontologyProvider.getStoredOntology(main, OWLOntology.class, false);
id = oMain.getOntologyID();
assertNotNull(id);