OntopSQLOWLAPIConfiguration Removal of OWLOntology in Ontop 5.0

12 views
Skip to first unread message

Thomas Taylor

unread,
Feb 10, 2023, 11:06:28 AM2/10/23
to ontop4obda

Hi,

In Ontop 4.2, for testing rdb2rdf we used the Ontop DirectMappingBootstrapper configured with OntopSQLOWLAPIConfiguration to extract a mapping and ontology from a relational data source if no mapping was provided, then used either the provided mapping/ontology or the bootstrapped mapping/ontology to configure the OntopRepository.

In Ontop 5.0, OntopSQLOWLAPIConfiguration Builder removed the .ontology(OWLOntology) method, only allowing an Ontology to be provided by ontologyFile(File), ontologyFile(String), ontologyFile(URL), or (new) ontologyReader(Reader).

The DirectMappingBootstrapper.BootstrappingResults still returns an OWLOntology getOntology(), so it looks like we're forced to wrap the OWLOntology in a Reader for Ontop 5.0.

In issue #24, ghxiao states "A relevant issue is #138. The current OWLAPI binding implementation is incomplete. In general, users should [use] the RDF4J binding of Ontop, but not OWLAPI binding. The OWLAPI binding is mainly used internally for the protege plugin."

1. In Ontop-5, what is the recommended way to provide an in-memory ontology to the Ontop Configuration/Repository? Is there a plan to support RDF4J Models?

2. Are the different Ontop Configuration settings documented somewhere? The closest I've found is the Configuration Keys page on the website or searching through the code.


Example Code:

Builder<?> builder = OntopSQLOWLAPIConfiguration.defaultBuilder()
  .jdbcUrl(db.url)
  .jdbcDriver(db.driver)
  .jdbcUser(db.username)
  .jdbcPassword(db.password)
  .properties(db.properties)
  .enableDefaultDatatypeInference(true);

BootstrappingResults results = DirectMappingBootstrapper.defaultBootstrapper()
  .bootstrap(builder.build(), BASE_IRI);
// Ontop 4.2 - OntopSQLOWLAPIConfiguration.Builder - supports .ontology(OWLOntology)
builder
  .ppMapping(results.getPPMapping())
  .ontology(results.getOntology());

// Ontop 5.0 - OntopSQLOWLAPIConfiguration.Builder - removes .ontology, adds .ontologyReader
ByteArrayOutputStream out = new ByteArrayOutputStream();
results.getOntology().saveOntology(out);
builder
  .ppMapping(results.getPPMapping())
  .ontologyReader(new InputStreamReader(new ByteArrayInputStream(out.toByteArray())));

OntopRepository repo = OntopRepository.defaultRepository(builder.build());


Best regards,

Thomas Taylor

Benjamin Cogrel

unread,
Feb 12, 2023, 11:32:00 AM2/12/23
to Thomas Taylor, ontop4obda
Hi Thomas,

Thanks for pointing this out.

Indeed in Ontop 5.0 we removed this method as part of our effort to better decouple Ontop from Protégé.  We are using OWLAPI 5.x internally in Ontop while Protégé still relies on OWLAPI 4.x, so we don't pass objects directly from Protégé to Ontop anymore. Instead we rely on serialization and readers as you did.

My impression is that it is better we keep the configuration builders independent from any library (in that regard we may rename OntopSQLOWLAPIConfiguration as, technically speaking, it does not depend on OWLAPI), for the decoupling it provides. We may for instance consider at some point another ontology parser that better handles RDFS ontologies than OWLAPI.

In that regard we don't have plans to support RDF4J models at the configuration level.

In your experience, is the ontology serialization/deserialization particularly costly? Does it create a pain point?

Kind regards,
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/b9dfced6-2f67-4655-b0e2-199a19538472n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages