/** Check if any ontology needs to be preloaded **/
File ontDir = new File(Params.ONTOLOGY_DIR);
if (ontDir.exists()) {
File[] ontologies = ontDir.listFiles();
OntologyManager mgr = new OntologyManager();
for (File ontology: ontologies) {
System.out.println(ontology.getName());
if (ontology.getName().endsWith(".owl") ||
ontology.getName().endsWith(".rdf") ||
ontology.getName().endsWith(".n3") ||
ontology.getName().endsWith(".ttl") ||
ontology.getName().endsWith(".xml")) {
logger.info("Loading ontology file: " + ontology.getAbsolutePath());
try {
String encoding = EncodingDetector.detect(ontology);
mgr.doImport(ontology, encoding);
} catch (Exception t) {
// logger.error("Error loading ontology: " + ontology.getAbsolutePath(), t);
}
} else {
logger.error ("the file: " + ontology.getAbsolutePath() + " does not have proper format: xml/rdf/n3/ttl/owl");
}
}
// update the cache at the end when all files are added to the model
mgr.updateCache();
Set<String> test = mgr.getPossibleUris("http://example.com/layout/C01_", "http://example.com/layout/C02_");
for (String s : test) {
System.out.println(s);
}
Alignment al = new Alignment(mgr);
ColumnNode c1 = al.addColumnNode("h1", "c1", null);