// Ensure the metadata graph is there.
TripleCollection meta = ontologyProvider.getMetaGraph(TripleCollection.class);
assertNotNull(meta);
String scopeId = "updateTest";
Scope scope = onm.createOntologyScope(scopeId, new GraphContentInputSource(getClass()
.getResourceAsStream("/ontologies/test1.owl")));
UriRef collector = new UriRef(_NS_STANBOL_INTERNAL + OntologySpace.shortName + "/"
+ scope.getCoreSpace().getID());
UriRef test1id = new UriRef("http://stanbol.apache.org/ontologies/test1.owl"); // Has no versionIRI
// Be strict: the whole property pair must be there.
UriRef predicate = MANAGES_URIREF;
assertTrue(meta.contains(new TripleImpl(collector, predicate, test1id)));
predicate = IS_MANAGED_BY_URIREF;
assertTrue(meta.contains(new TripleImpl(test1id, predicate, collector)));
scope.tearDown(); // To modify the core space.
scope.getCoreSpace().addOntology(
new GraphContentInputSource(getClass().getResourceAsStream("/ontologies/minorcharacters.owl")));
UriRef minorId = new UriRef("http://stanbol.apache.org/ontologies/pcomics/minorcharacters.owl");
predicate = MANAGES_URIREF;
assertTrue(meta.contains(new TripleImpl(collector, predicate, minorId)));
predicate = IS_MANAGED_BY_URIREF;
assertTrue(meta.contains(new TripleImpl(minorId, predicate, collector)));
scope.getCustomSpace().addOntology(
new GraphContentInputSource(getClass().getResourceAsStream("/ontologies/test1.owl")));
scope.getCustomSpace().addOntology(
new GraphContentInputSource(getClass().getResourceAsStream("/ontologies/minorcharacters.owl")));
}