Using this, embedding of ASP into SQL could be realized, following the scheme
Marek pointed out that a slightly subtler approach has been already suggested, in which relational structures are encoded by such tuples representing models, and that first order logic is used as the language for conditions. In this context, it is important that conditions can come from a language not related to ASP (e.g., Smodels has hooks for this).
For integrating imperative languages and ASP, Marek proposed that instead of building a declarative interface to ASP, classes or templates should be build which can be pulled into an imperative language. This has been tried before, and as examples for other declarative languages Marek mentioned Prolog solvers for JAVA, and a C++ library for CLP by ILog. Within ASP syntax, escapes to an imperative language from within the clauses have already been proposed in the ASP community.
Marek said that to pull either ASP into imperative languages (or conversely), suitable APIs are needed, and inspiration for that can be taken from ODBC and especially JDBC drivers, and other interfacing software may be the key.