Actually I think it should be easy. I'll add a new predicate called something like
%% ranslate_rdf_db(+IRI)
% translates a graph in current rdf_db instance into an owl2_model.pl set of facts.
% assumes that IRI has already been loaded using the semweb package
translate_rdf_db(IRI) :-
rdf_2_owl,
owl2_model_init,
owl_canonical_parse_3(IRI).
Going in the reverse direction is trickier. If I have n owl ontologies in memory and I want to synchronize this with rdf_db make n rdf graphs then we need a new predicate.
This is hard because currently rdf_assert/3 is used, which places everything to the 'user' graph.
I think for now I will implement a workaround, that iterates over ontology/1, generates an rdf_db in user, copies that graph to the current base uri, ....