public void run(String baseUri) throws Exception { OBDAModelManager obdaModelManager = (OBDAModelManager) editorKit.get(SQLPPMappingImpl.class.getName()); new BootstrapGenerator(obdaModelManager, baseUri, owlManager, obdaModelManager.getJdbcTypeMapper()); }
private void bootstrapMappingAndOntologyProtege(String baseUri) throws DuplicateMappingException, SQLException { List<SQLPPTriplesMap> sqlppTriplesMaps = bootstrapMapping(activeOBDAModel.generatePPMapping(), baseUri); // update protege ontology OWLOntologyManager manager = owlManager.getActiveOntology().getOWLOntologyManager(); Set<OWLDeclarationAxiom> declarationAxioms = directMappingEngine.extractDeclarationAxioms(manager, sqlppTriplesMaps.stream() .flatMap(ax -> ax.getTargetAtoms().stream())); List<AddAxiom> addAxioms = declarationAxioms.stream() .map(ax -> new AddAxiom(owlManager.getActiveOntology(), ax)) .collect(Collectors.toList()); owlManager.applyChanges(addAxioms); }
newTriplesMap.addAll(getMapping(td, baseURI));
public BootstrapGenerator(OBDAModelManager obdaModelManager, String baseUri, OWLModelManager owlManager, JdbcTypeMapper jdbcTypeMapper) throws DuplicateMappingException, SQLException { this.jdbcTypeMapper = jdbcTypeMapper; connManager = JDBCConnectionManager.getJDBCConnectionManager(); this.owlManager = owlManager; configuration = obdaModelManager.getConfigurationManager().buildOntopSQLOWLAPIConfiguration(owlManager.getActiveOntology()); activeOBDAModel = obdaModelManager.getActiveOBDAModel(); termFactory = obdaModelManager.getTermFactory(); typeFactory = obdaModelManager.getTypeFactory(); targetAtomFactory = obdaModelManager.getTargetAtomFactory(); directMappingEngine = configuration.getInjector().getInstance(DirectMappingEngine.class); rdfFactory = configuration.getRdfFactory(); bootstrapMappingAndOntologyProtege(baseUri); }