@Override public Object clone() { OBDAModel clone = dfac.getOBDAModel(); for (OBDADataSource source : datasources.values()) { clone.addSource((OBDADataSource) source.clone()); for (ArrayList<OBDAMappingAxiom> mappingList : mappings.values()) { for (OBDAMappingAxiom mapping : mappingList) { try { clone.addMapping(source.getSourceID(), (OBDAMappingAxiom) mapping.clone(), false); } catch (DuplicateMappingException e) { // Does nothing } } } } return clone; }
model.addSource(datasource); return sourceUri;
/** * the method that gives the obda model based on the given graph * @param dataSource - the datasource of the model * @return the read obda model */ public OBDAModel readModel(OBDADataSource dataSource){ try { obdaModel.addSource(dataSource); URI sourceUri = dataSource.getSourceID(); //add to the model the mappings retrieved from the manager obdaModel.addMappings(sourceUri, manager.getMappings(m)); } catch (DuplicateMappingException e) { e.printStackTrace(); } return obdaModel; }
obdaModel.addSource(source);
tbox = OntologyFactoryImpl.getInstance().createOntology(voc); if (obdaModel.getSources().size() == 0) obdaModel.addSource(getMemOBDADataSource("MemH2"));