use of org.apache.jena.util.FileManager in project jena by apache.
the class TestImportManager method testFollowOwlImportsDeeply.
public void testFollowOwlImportsDeeply() {
final Model m1 = model("this hasMarker M1; _x owl:imports M2"), m2 = model("this hasMarker M2");
Model m = model("x ja:reasoner y; _x owl:imports M1");
FileManager fm = new FixedFileManager().add("eh:/M1", m1).add("eh:/M2", m2);
Model result = new ImportManager().withImports(fm, m);
assertInstanceOf(MultiUnion.class, result.getGraph());
assertIsoModels(m1.union(m2).union(m), result);
}
use of org.apache.jena.util.FileManager in project jena by apache.
the class TestImportManager method testImportMayBeLiteral.
public void testImportMayBeLiteral() {
final Model modelToLoad = model("this hasMarker B5");
Model m = model("x ja:reasoner y; _x ja:imports 'eh:/loadMe'");
FileManager fm = new FixedFileManager().add("eh:/loadMe", modelToLoad);
Model m2 = new ImportManager().withImports(fm, m);
assertInstanceOf(MultiUnion.class, m2.getGraph());
assertIsoModels(modelToLoad.union(m), m2);
}
use of org.apache.jena.util.FileManager in project jena by apache.
the class TestImportManager method testCatchesCircularity.
public void testCatchesCircularity() {
final Model m1 = model("this hasMarker Mx; _x owl:imports My"), m2 = model("this hasMarker My; _x owl:imports Mx");
FileManager fm = new FixedFileManager().add("eh:/Mx", m1).add("eh:/My", m2);
Model result = new ImportManager().withImports(fm, m1);
assertIsoModels(m1.union(m2), result);
}
use of org.apache.jena.util.FileManager in project jena by apache.
the class TestFileManager method testCache1.
public void testCache1() {
FileManager fileManager = new FileManager();
fileManager.addLocatorFile(testingDir);
Model m1 = fileManager.loadModel(fileModel);
Model m2 = fileManager.loadModel(fileModel);
assertNotSame(m1, m2);
}
use of org.apache.jena.util.FileManager in project jena by apache.
the class TestFileManager method testCache2.
public void testCache2() {
FileManager fileManager = FileManager.get();
fileManager.addLocatorFile(testingDir);
fileManager.setModelCaching(true);
Model m1 = fileManager.loadModel(fileModel);
Model m2 = fileManager.loadModel(fileModel);
assertSame(m1, m2);
}
Aggregations