Usage of Offline Metadata Provider

25 views
Skip to first unread message

Lorenz B.

unread,
Jun 25, 2020, 2:44:49 AM6/25/20
to ontop4obda
Hi again,

we're trying to use the Ontop SQL query generation without having a JDBC connection online. So somehow Ontop needs the DB metadata to link the mappings ot the SQL database I think. Is this possible in Ontop v4?

Again, I was looking into the old Wiki and found basically this: https://github.com/ontop/ontop/wiki/metadataFetching

  1. Constructor
    The metadata is provided by the user.

  2. Full metadata
    It adds data definition to the metadata and gets tables directly from the connection to the database.
    For each table it gets columns information.

  3. Parsed mappings
    It gets part of the metadata parsing the mappings to obtain tables.
    Connecting to the database, it gets columns information from the retrieved tables.
So it looks like it was possible, but this was about Ontop v1.

I was also digging into the source code and could find a class OfflineMetadataProviderBuilder along with an example [1]. Unfortunately, the example is incomplete and doesn't show the next step.

I also can see that there is a method ppMapping() for the OntopMappingSQLAllConfiguration.defaultBuilder (which we use to generate the OBDA spec which then is used to generate the reformulator) but I'm not sure how to generate this SQLPPMapping

So my question is, is there any way to work without a JDBC datasource?


Thanks in advance,
Lorenz


Benjamin Cogrel

unread,
Jun 25, 2020, 3:16:31 AM6/25/20
to ontop...@googlegroups.com

Hi again,

It is indeed not yet possible to generate a SQL query without having connectivity to the data source because Ontop extracts the DB metadata directly from the data source every time we start it.

DB metadata is needed for generating a SQL query, however it could be extracted once and loaded by parsing a file instead of connecting the DB every time Ontop starts. We are working in this direction (e.g. the OfflineMetadataProviderBuilder you noticed has been added very recently). We are now able to serialize the DB metadata and what is missing is the parsing/loading phase.

Note that we still need to the JDBC URL as input as we use it to recognize the SQL dialect (by deriving the FQDN of the JDBC driver).

I would suggest you not to consider the SQLPPMapping as it is an internal data structure. I think the ppMapping() method has been removed recently if I remember correctly.


Best,

Benjamin

--
Please follow our guidelines on how to report a bug https://ontop-vkg.org/community/contributing/bug-report
---
You received this message because you are subscribed to the Google Groups "ontop4obda" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ontop4obda+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ontop4obda/eaf5452a-7bfd-47a9-b5dc-5f8eca415f97o%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages