public static void testWithDatabase() { TRepository.setDatabaseProperties(); boolean dbInsert = true; Manager manager = new Manager(); DataImport importer = manager.getImporter(); importer.dropRepositorySchema(); importer.createRepositorySchema(); for (int i = 0; i < data3.length; i++) { OWLParser_V3 par = new OWLParser_V3(dbInsert); String srcFile = (directory + data3[i][0]).replace("\\", "/"); int srcId = par.parseSingleSource(srcFile); String trgFile = (directory + data3[i][1]).replace("\\", "/"); int trgId = par.parseSingleSource(trgFile); manager.loadRepository(); RDFAlignmentParser parser = new RDFAlignmentParser(manager, dbInsert); String alignFile = directory + data3[i][2]; parser.loadOWLAlignmentFile(alignFile, null, srcFile, trgFile); MatchResult result = manager.loadMatchResult(srcId, trgId, parser.getMappingId()); assertEquals(Integer.parseInt(data3[i][3]), result.getMatchCount()); } manager.closeDatabaseConnection(); }
private static void saveInstanceToRepository( Element element, String elementText, String connect, DataImport importer) { if (elementText != null && elementText.length() > 0) { element.addInstance(elementText); int id = -1; String attributeName = null; id = importer.insertInstance(connect, element.getId(), id, attributeName, elementText); importer.updateInstance(id, id); } }
public void parseInstancesForSchema(Graph schemaGraph) { int id = schemaGraph.getSource().getId(); // importer.createInstancesTable(id); importer.prepareInstancesStatement(id); ArrayList<Element> inners = schemaGraph.getInners(); for (int i = 0; i < inners.size(); i++) { Element inner = inners.get(i); // table name ArrayList<Element> children = schemaGraph.getChildren(inner); // attributes if (children.isEmpty()) { continue; } parseInstancesForTable(inner, children); } }